From ff00d3e298cd0de01ee4dc9cf1aff9a8463915fe Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Tue, 29 Dec 2009 21:51:23 -0800 Subject: [PATCH] Fix typo spotted by Morgan --- docs/index.html | 2 +- dygraph-canvas.js | 6 +++++- dygraph.js | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/index.html b/docs/index.html index 87165a7..c380ee2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -175,7 +175,7 @@ -

In order to keep this example self-contained, the second parameter is raw CSV data. The dygraphs library parses this data (including column headers), resizes the its container to a reasonable default, calculates appropriate axis ranges and tick marks and draws the graph.

+

In order to keep this example self-contained, the second parameter is raw CSV data. The dygraphs library parses this data (including column headers), resizes its container to a reasonable default, calculates appropriate axis ranges and tick marks and draws the graph.

In most applications, it makes more sense to include a CSV file instead. If the second parameter to the constructor doesn't contain a newline, it will be interpreted as the path to a CSV file. The Dygraph will perform an XMLHttpRequest to retrieve this file and display the data when it becomes available. Make sure your CSV file is readable and serving from a place that understands XMLHttpRequest's! In particular, you cannot specify a CSV file using "file:///". Here's an example: (data from Weather Underground)

diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 8cadd2d..8101b03 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -70,6 +70,7 @@ DygraphLayout.prototype._evaluateLineCharts = function() { for (var j = 0; j < dataset.length; j++) { var item = dataset[j]; var point = { + // TODO(danvk): here x: ((parseFloat(item[0]) - this.minxval) * this.xscale), y: 1.0 - ((parseFloat(item[1]) - this.minyval) * this.yscale), xval: parseFloat(item[0]), @@ -456,7 +457,8 @@ DygraphCanvasRenderer.prototype._renderLineChart = function() { } var setCount = setNames.length; - //Update Points + // Update Points + // TODO(danvk): here for (var i = 0; i < this.layout.points.length; i++) { var point = this.layout.points[i]; point.canvasx = this.area.w * point.x + this.area.x; @@ -497,6 +499,7 @@ DygraphCanvasRenderer.prototype._renderLineChart = function() { prevX = -1; continue; } + // TODO(danvk): here var newYs = [ point.y - point.errorPlus * yscale, point.y + point.errorMinus * yscale ]; newYs[0] = this.area.h * newYs[0] + this.area.y; @@ -516,6 +519,7 @@ DygraphCanvasRenderer.prototype._renderLineChart = function() { ctx.fill(); } } else if (fillGraph) { + // TODO(danvk): merge this code with the logic above; they're very similar. for (var i = 0; i < setCount; i++) { var setName = setNames[i]; var setNameLast; diff --git a/dygraph.js b/dygraph.js index aa02516..7158ff2 100644 --- a/dygraph.js +++ b/dygraph.js @@ -108,6 +108,7 @@ Dygraph.DEFAULT_ATTRS = { delimiter: ',', + logScale: false, sigma: 2.0, errorBars: false, fractions: false, @@ -1102,6 +1103,7 @@ Dygraph.numericTicks = function(minV, maxV, self) { // Try labels every 1, 2, 5, 10, 20, 50, 100, etc. // Calculate the resulting tick spacing (i.e. this.height_ / nTicks). // The first spacing greater than pixelsPerYLabel is what we use. + // TODO(danvk): version that works on a log scale. if (self.attr_("labelsKMG2")) { var mults = [1, 2, 4, 8]; } else { -- 2.7.4