X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Fdygraph-many-points-benchmark.html;h=17dadcd5c9140da6eee6877c698f6981fc98fb0e;hb=4ecb55b5c66f7723d1f5c588af62855bd4c06faa;hp=79566deb740033589e416dc094c33076460be3cd;hpb=c3fa4a741e4424a0fc29caadb1aec2d5a39ecefa;p=dygraphs.git diff --git a/tests/dygraph-many-points-benchmark.html b/tests/dygraph-many-points-benchmark.html index 79566de..17dadcd 100644 --- a/tests/dygraph-many-points-benchmark.html +++ b/tests/dygraph-many-points-benchmark.html @@ -19,16 +19,21 @@

Data to plot: sinusoid function + onclick="setDataType(this);" checked> sinusoid function random points

-

Number of points: + onclick="setDataType(this);"> random points

+

Timestamps: + aligned + unaligned

+

Number of points per series (points):

-

Number of series: +

Number of series (series):

-

Roll period (in points): +

Roll period (in points, rollPeriod):

-

Repetitions: +

Repetitions (repititions):

@@ -43,6 +48,7 @@ var graph = null; var metrics = null; var dataType = "sine"; + var timestamps = "aligned"; var durations = []; updatePlot = function() { @@ -61,6 +67,7 @@ var xmax = 2.0 * Math.PI; var adj = .5; var delta = (xmax - xmin) / (numPoints - 1); + var unalignmentDelta = delta / numSeries; for (var i = 0; i < numPoints; ++i) { var x = xmin + delta * i; @@ -74,7 +81,15 @@ } elem.push(y); } - data[i] = elem; + if (timestamps == "aligned") { + data[i] = elem; + } else { + for (var j = 0; j < numSeries; j++) { + var elemCopy = elem.slice(0); + elemCopy[0] += unalignmentDelta * j; + data[i*numSeries + j] = elemCopy; + } + } } var labels = [ "x" ]; for (var j = 0; j < numSeries; j++) { @@ -128,16 +143,19 @@ return millisecondss; }; - clickedRadioButton = function(radiobutton) { + setDataType = function(radiobutton) { dataType = radiobutton.value; }; + setTimestampType = function(radiobutton) { + timestamps = radiobutton.value; + }; var values = { points: 100, series: 1, rollPeriod: 1, repetitions: 1, - type: 'sine', + type: 'sine' }; // Parse the URL for parameters. Use it to override the values hash.