X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-gviz.js;h=988e0ace10d7c71e20d13c0b929045aedb86aea9;hb=18117d891a79ebdd470cf4e09c829b01008ba515;hp=114263a429b494d5f7fdc0ea4397f14c692ded1c;hpb=82c6fe4d4a5e55a9d5f7696b23a203905006d1ab;p=dygraphs.git diff --git a/dygraph-gviz.js b/dygraph-gviz.js index 114263a..988e0ac 100644 --- a/dygraph-gviz.js +++ b/dygraph-gviz.js @@ -23,12 +23,18 @@ /** * A wrapper around Dygraph that implements the gviz API. - * @param {Object} container The DOM object the visualization should live in. + * @param {!HTMLDivElement} container The DOM object the visualization should + * live in. + * @constructor */ Dygraph.GVizChart = function(container) { this.container = container; }; +/** + * @param {GVizDataTable} data + * @param {Object.<*>} options + */ Dygraph.GVizChart.prototype.draw = function(data, options) { // Clear out any existing dygraph. // TODO(danvk): would it make more sense to simply redraw using the current @@ -44,7 +50,7 @@ Dygraph.GVizChart.prototype.draw = function(data, options) { /** * Google charts compatible setSelection * Only row selection is supported, all points in the row will be highlighted - * @param {Array} array of the selected cells + * @param {Array.<{row:number}>} selection_array array of the selected cells * @public */ Dygraph.GVizChart.prototype.setSelection = function(selection_array) { @@ -57,7 +63,7 @@ Dygraph.GVizChart.prototype.setSelection = function(selection_array) { /** * Google charts compatible getSelection implementation - * @return {Array} array of the selected cells + * @return {Array.<{row:number,column:number}>} array of the selected cells * @public */ Dygraph.GVizChart.prototype.getSelection = function() { @@ -67,8 +73,8 @@ Dygraph.GVizChart.prototype.getSelection = function() { if (row < 0) return selection; - var datasets = this.date_graph.layout_.datasets; - for (var setIdx = 0; setIdx < datasets.length; ++setIdx) { + var points = this.date_graph.layout_.points; + for (var setIdx = 0; setIdx < points.length; ++setIdx) { selection.push({row: row, column: setIdx + 1}); }