X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=src%2Fdygraph-gviz.js;fp=src%2Fdygraph-gviz.js;h=12c55a7bdcb9aa2d42127ab6598001b4635f2e83;hb=e8c70e4e0f4c124a2c68eb43d6ec4e781d1bf810;hp=d2d7a0d2c40bf7acbe78d7d0c050929a3559fdfa;hpb=6ecc073934b76e5076f917112a24ff7094857730;p=dygraphs.git diff --git a/src/dygraph-gviz.js b/src/dygraph-gviz.js index d2d7a0d..12c55a7 100644 --- a/src/dygraph-gviz.js +++ b/src/dygraph-gviz.js @@ -17,17 +17,18 @@ * - http://dygraphs.com/tests/annotation-gviz.html */ -(function() { /*global Dygraph:false */ "use strict"; +import Dygraph from './dygraph'; + /** * A wrapper around Dygraph that implements the gviz API. * @param {!HTMLDivElement} container The DOM object the visualization should * live in. * @constructor */ -Dygraph.GVizChart = function(container) { +var GVizChart = function(container) { this.container = container; }; @@ -35,7 +36,7 @@ Dygraph.GVizChart = function(container) { * @param {GVizDataTable} data * @param {Object.<*>} options */ -Dygraph.GVizChart.prototype.draw = function(data, options) { +GVizChart.prototype.draw = function(data, options) { // Clear out any existing dygraph. // TODO(danvk): would it make more sense to simply redraw using the current // date_graph object? @@ -53,7 +54,7 @@ Dygraph.GVizChart.prototype.draw = function(data, options) { * @param {Array.<{row:number}>} selection_array array of the selected cells * @public */ -Dygraph.GVizChart.prototype.setSelection = function(selection_array) { +GVizChart.prototype.setSelection = function(selection_array) { var row = false; if (selection_array.length) { row = selection_array[0].row; @@ -66,7 +67,7 @@ Dygraph.GVizChart.prototype.setSelection = function(selection_array) { * @return {Array.<{row:number,column:number}>} array of the selected cells * @public */ -Dygraph.GVizChart.prototype.getSelection = function() { +GVizChart.prototype.getSelection = function() { var selection = []; var row = this.date_graph.getSelection(); @@ -81,4 +82,4 @@ Dygraph.GVizChart.prototype.getSelection = function() { return selection; }; -})(); +export default GVizChart;