X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=src%2Fdygraph.js;h=1de4485d582bcdfa7757c4b9b9828870ffbc01f2;hb=ac422b3aa23612c220b14e938fbae79d01b40b86;hp=8e6d6e04cb3e0d645a69b3ec6148327664705a41;hpb=fd6b8dadbaa0614671bef1508c23d6a932e25081;p=dygraphs.git diff --git a/src/dygraph.js b/src/dygraph.js index 8e6d6e0..1de4485 100644 --- a/src/dygraph.js +++ b/src/dygraph.js @@ -89,7 +89,7 @@ var Dygraph = function(div, data, opts) { }; Dygraph.NAME = "Dygraph"; -Dygraph.VERSION = "2.0.0"; +Dygraph.VERSION = "2.1.0"; // Various default values Dygraph.DEFAULT_ROLL_PERIOD = 1; @@ -861,7 +861,9 @@ Dygraph.prototype.resizeElements_ = function() { this.graphDiv.style.width = this.width_ + "px"; this.graphDiv.style.height = this.height_ + "px"; - var canvasScale = utils.getContextPixelRatio(this.canvas_ctx_); + var pixelRatioOption = this.getNumericOption('pixelRatio') + + var canvasScale = pixelRatioOption || utils.getContextPixelRatio(this.canvas_ctx_); this.canvas_.width = this.width_ * canvasScale; this.canvas_.height = this.height_ * canvasScale; this.canvas_.style.width = this.width_ + "px"; // for IE @@ -870,7 +872,7 @@ Dygraph.prototype.resizeElements_ = function() { this.canvas_ctx_.scale(canvasScale, canvasScale); } - var hiddenScale = utils.getContextPixelRatio(this.hidden_ctx_); + var hiddenScale = pixelRatioOption || utils.getContextPixelRatio(this.hidden_ctx_); this.hidden_.width = this.width_ * hiddenScale; this.hidden_.height = this.height_ * hiddenScale; this.hidden_.style.width = this.width_ + "px"; // for IE @@ -1350,6 +1352,7 @@ Dygraph.prototype.resetZoom = function() { const zoomCallback = this.getFunctionOption('zoomCallback'); // TODO(danvk): merge this block w/ the code below. + // TODO(danvk): factor out a generic, public zoomTo method. if (!animatedZooms) { this.dateWindow_ = null; this.axes_.forEach(axis => { @@ -3010,6 +3013,7 @@ Dygraph.prototype.parseDataTable_ = function(data) { /** * Signals to plugins that the chart data has updated. * This happens after the data has updated but before the chart has redrawn. + * @private */ Dygraph.prototype.cascadeDataDidUpdateEvent_ = function() { // TODO(danvk): there are some issues checking xAxisRange() and using @@ -3124,7 +3128,7 @@ Dygraph.prototype.updateOptions = function(input_attrs, block_redraw) { if (file) { // This event indicates that the data is about to change, but hasn't yet. - // TODO(danvk): support cancelation of the update via this event. + // TODO(danvk): support cancellation of the update via this event. this.cascadeEvents_('dataWillUpdate', {}); this.file_ = file; @@ -3142,6 +3146,7 @@ Dygraph.prototype.updateOptions = function(input_attrs, block_redraw) { /** * Make a copy of input attributes, removing file as a convenience. + * @private */ Dygraph.copyUserAttrs_ = function(attrs) { var my_attrs = {};