* Still tightly coupled to Dygraphs, we could remove some of that, you know.
*/
+/*jshint globalstrict:true, sub:true */
+/*global Dygraph:false */
"use strict";
/*
throw "Dygraphs only supports two y-axes, indexed from 0-1.";
}
if (typeof(axis) == "object") {
- throw "Using objects for axis specification "
- + "is not supported inside the 'series' option.";
+ throw "Using objects for axis specification " +
+ "is not supported inside the 'series' option.";
}
if (axis) {
throw "Unknown axis : " + axis;
return Dygraph.DEFAULT_ATTRS[name];
}
return null;
-}
+};
/**
* Get a value for a specific axis. If there is no specific value for the axis,
* middle of the years.
*/
-/*jshint globalstrict: true */
+/*jshint globalstrict:true, sub:true */
/*global Dygraph:false */
"use strict";
repeatFn(maxFrameArg); // Ensure final call with maxFrameArg.
cleanupFn();
} else {
- if (frameDelta != 0) { // Don't call repeatFn with duplicate frames.
+ if (frameDelta !== 0) { // Don't call repeatFn with duplicate frames.
repeatFn(frameNumber);
}
loop();
*/
/*jshint globalstrict: true */
-/*global DygraphLayout:false, DygraphCanvasRenderer:false, G_vmlCanvasManager:false */
+/*global DygraphLayout:false, DygraphCanvasRenderer:false, DygraphOptions:false, G_vmlCanvasManager:false */
"use strict";
/**
Dygraph.prototype.getOptionForAxis = function(name, axis) {
return this.attributes_.getForAxis(name, axis);
-}
+};
+
/**
* @private
* @param String} axis The name of the axis (i.e. 'x', 'y' or 'y2')
var includeZero = this.attributes_.getForAxis("includeZero", i);
series = this.attributes_.seriesForAxis(i);
- if (series.length == 0) {
+ if (series.length === 0) {
// If no series are defined or visible then use a reasonable default
axis.extremeRange = [0, 1];
} else {
this.attrs_.axes.x.ticker = Dygraph.numericLinearTicks;
this.attrs_.axes.x.axisLabelFormatter = this.attrs_.axes.x.valueFormatter;
}
-}
+};
/**
* Parses the value as a floating point number. This is like the parseFloat()
lineHeight: "normal", // Something other than "normal" line-height screws up label positioning.
overflow: "hidden"
};
- }
+ };
var labelStyles = {
x : makeLabelStyle('x'),
y : makeLabelStyle('y'),
- y2 : makeLabelStyle('y2'),
+ y2 : makeLabelStyle('y2')
};
var makeDiv = function(txt, axis, prec_axis) {
setTimeout(function() { dygraph.width_ = 0; dygraph.resize(); }, 1);
}
return enabled;
-}
+};
/**
* @private
// THE SOFTWARE.
-/**
+/**
* @fileoverview Plug-in for providing unzoom-on-hover.
*
* @author konigsberg@google.com (Robert Konigsberg)
*/
Dygraph.Plugins.Unzoom = (function() {
-
+
"use strict";
-
+
/**
* Create a new instance.
*
// because the unzoom button state can change even when the
// mouse-over state hasn't.
this.over_ = false;
- };
-
+ };
+
unzoom.prototype.toString = function() {
- return 'Unzoom Plugin';
+ return 'Unzoom Plugin';
};
unzoom.prototype.activate = function(g) {
unzoom.prototype.willDrawChart = function(e) {
var g = e.dygraph;
- if (this.button_ != null) {
+ if (this.button_ !== null) {
// short-circuit: show the button only when we're moused over, and zoomed in.
var showButton = g.isZoomed() && this.over_;
this.show(showButton);
var self = this;
this.button_.onclick = function() {
g.resetZoom();
- }
+ };
g.addEvent(parent, 'mouseover', function() {
if (g.isZoomed()) {