From: Robert Konigsberg Date: Tue, 16 Apr 2013 14:26:50 +0000 (-0400) Subject: Reponses to code review for https://github.com/danvk/dygraphs/pull/237 X-Git-Tag: v1.0.0~38^2~1 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=2ed3480b3d067f380abf6636cb984ac9ff7cd484;p=dygraphs.git Reponses to code review for https://github.com/danvk/dygraphs/pull/237 --- diff --git a/closure-todo.txt b/closure-todo.txt index bd42895..5c61495 100644 --- a/closure-todo.txt +++ b/closure-todo.txt @@ -30,9 +30,6 @@ Plugins: - plugins/grid.js - plugins/legend.js -Others: -x rgbcolor/rgbcolor.js - Here's a command that can be used to build dygraphs using the closure compiler: java -jar ../../closure-compiler-read-only/build/compiler.jar --js=dygraph-utils.js --js=dashed-canvas.js --js=dygraph-options-reference.js --js=dygraph-tickers.js --js=dygraph-gviz.js --js=dygraph-options.js --js_output_file=/tmp/out.js --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --externs dygraph-externs.js diff --git a/dygraph-layout.js b/dygraph-layout.js index bab1d97..da0405e 100644 --- a/dygraph-layout.js +++ b/dygraph-layout.js @@ -56,7 +56,7 @@ DygraphLayout.prototype.addDataset = function(setname, set_xy) { * Returns the box which the chart should be drawn in. This is the canvas's * box, less space needed for the axis and chart labels. * - * @return {{ x : numer, y : number, w : number, h : number }} + * @return {{x: number, y: number, w: number, h: number}} */ DygraphLayout.prototype.getPlotArea = function() { return this.area_; diff --git a/dygraph-options.js b/dygraph-options.js index 334b2f6..879a9e1 100644 --- a/dygraph-options.js +++ b/dygraph-options.js @@ -47,8 +47,10 @@ var DygraphOptions = function(dygraph) { this.yAxes_ = []; /** - * { options : { axis-specific options. } } - * @type {Object} @private + * Contains x-axis specific options, which are stored in the options key. + * This matches the yAxes_ object structure (by being a dictionary with an + * options element) allowing for shared code. + * @type {options: Object} @private */ this.xAxis_ = {}; this.series_ = {}; diff --git a/rgbcolor/rgbcolor.js b/rgbcolor/rgbcolor.js index bcdf94c..5a88244 100644 --- a/rgbcolor/rgbcolor.js +++ b/rgbcolor/rgbcolor.js @@ -9,21 +9,12 @@ * http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-RGBColor * so renamed to "RGBColorParser" * - * Modifications by konigsberg: - * Make Closure-compatible. - * * @author Stoyan Stefanov * @link http://www.phpied.com/rgb-color-parser-in-javascript/ * @license Use it if you like it */ "use strict"; -/** - * Create a new instance. - * - * @param {string} color_string the string to be parsed. - * @constructor - */ function RGBColorParser(color_string) { this.ok = false; @@ -197,9 +188,9 @@ function RGBColorParser(color_string) example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'], process: function (bits){ return [ - parseInt(bits[1], 10), - parseInt(bits[2], 10), - parseInt(bits[3], 10) + parseInt(bits[1]), + parseInt(bits[2]), + parseInt(bits[3]) ]; } },