/** @type{!Array.<!DygraphPlotterType>} */
var plotters;
- if (!Dygraph.isArrayLike(plotters)) {
+ if (!Dygraph.isArrayLike(plotter_attr)) {
plotters = [plotters];
} else {
plotters = /** @type {!Array.<!DygraphPlotterType>} */(plotter_attr);
ctx.save();
ctx.strokeStyle = color;
ctx.lineWidth = strokeWidth;
- // TODO(danvk): add an @typedef for this Object.
p({
points: points,
setName: setName,
/**
* Plotter which draws the central lines for a series.
+ * @param {DygraphPlotterArguments} e Plotter inputs.
* @private
*/
linePlotter_ = function(e) {
* Draws the shaded error bars/confidence intervals for each series.
* This happens before the center lines are drawn, since the center lines
* need to be drawn on top of the error bars for all series.
+ * @param {DygraphPlotterArguments} e Plotter inputs.
* @private
*/
errorPlotter_ = function(e) {
* simultaneously. So this plotter plots all the points on the first series
* it's asked to draw, then ignores all the other series.
*
+ * @param {DygraphPlotterArguments} e Plotter inputs.
* @private
*/
fillPlotter_ = function(e) {
*/
var DygraphAxisType;
+
+/**
+ * @typedef {{
+ * dygraph: !Dygraph,
+ * points: Array,
+ * setName: string,
+ * drawingContext: !CanvasRenderingContext2D,
+ * color: string,
+ * strokeWidth: number,
+ * axis: Object,
+ * plotArea: DygraphRect,
+ * seriesIndex: number,
+ * seriesCount: number,
+ * singleSeriesName: (string|undefined),
+ * allSeriesPoints: Array
+ * }}
+ */
+var DygraphPlotterArguments;
+
/**
* TODO(danvk): be more specific than "Object".
- * @typedef {function(Object)}
+ * @typedef {function(DygraphPlotterArguments)}
*/
var DygraphPlotterType;
}
// Default axis options third.
- var defaultAxisOptions = Dygraph.DEFAULT_ATTRS.axes[axisString];
+ var defaultAxisOptions = Dygraph.DEFAULT_ATTRS['axes'][axisString];
if (defaultAxisOptions.hasOwnProperty(name)) {
return defaultAxisOptions[name];
}
}
var seriesObj = this.series_[series];
- var seriesOptions = seriesObj["options"];
+ var seriesOptions = seriesObj.options;
if (seriesOptions.hasOwnProperty(name)) {
return seriesOptions[name];
}
- return this.getForAxis(name, seriesObj["yAxis"]);
+ return this.getForAxis(name, seriesObj.yAxis);
};
/**
Dygraph.prototype.optionsViewForAxis_ = function(axis) {
var self = this;
return function(opt) {
- var axis_opts = self.user_attrs_.axes;
+ var axis_opts = self.user_attrs_['axes'];
if (axis_opts && axis_opts[axis] && axis_opts[axis].hasOwnProperty(opt)) {
return axis_opts[axis][opt];
}
return self.user_attrs_[opt];
}
- axis_opts = self.attrs_.axes;
+ axis_opts = self.attrs_['axes'];
if (axis_opts && axis_opts[axis] && axis_opts[axis].hasOwnProperty(opt)) {
return axis_opts[axis][opt];
}
v = opts("valueRange");
if (v) this.axes_[axis].valueRange = v;
} else { // To keep old behavior
- var axes = this.user_attrs_.axes;
- if (axes && axes.y2) {
- v = axes.y2.valueRange;
- if (v) this.axes_[axis].valueRange = v;
+ var axes = this.user_attrs_['axes'];
+ if (axes && axes['y2']) {
+ v = axes['y2']['valueRange'];
+ if (v) this.axes_[axis]['valueRange'] = v;
}
}
}
Dygraph.prototype.setXAxisOptions_ = function(isDate) {
if (isDate) {
- this.attrs_.xValueParser = Dygraph.dateParser;
- this.attrs_.axes.x.valueFormatter = Dygraph.dateString_;
- this.attrs_.axes.x.ticker = Dygraph.dateTicker;
- this.attrs_.axes.x.axisLabelFormatter = dateAxisFormatter_;
+ this.attrs_['xValueParser'] = Dygraph.dateParser;
+ this.attrs_['axes']['x']['valueFormatter'] = Dygraph.dateString_;
+ this.attrs_['axes']['x']['ticker'] = Dygraph.dateTicker;
+ this.attrs_['axes']['x']['axisLabelFormatter'] = dateAxisFormatter_;
} else {
/** @private (shut up, jsdoc!) */
- this.attrs_.xValueParser = function(x) { return parseFloat(x); };
+ this.attrs_['xValueParser'] = function(x) { return parseFloat(x); };
// TODO(danvk): use numberValueFormatter_ here?
/** @private (shut up, jsdoc!) */
- this.attrs_.axes.x.valueFormatter = function(x) { return x; };
- this.attrs_.axes.x.ticker = Dygraph.numericLinearTicks;
- this.attrs_.axes.x.axisLabelFormatter = this.attrs_.axes.x.valueFormatter;
+ this.attrs_['axes']['x']['valueFormatter'] = function(x) { return x; };
+ this.attrs_['axes']['x']['ticker'] = Dygraph.numericLinearTicks;
+ this.attrs_['axes']['x']['axisLabelFormatter'] = this.attrs_['axes']['x']['valueFormatter'];
}
};
CatMinified () {
Copyright
CatSources \
- | java -jar ../../closure-compiler-read-only/build/compiler.jar --js ../../closure-library-read-only/closure/goog/base.js --js - --js dygraph-exports.js --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --externs dygraph-externs.js --externs gviz-api.js --output_wrapper='(function() {%output%})();'
+ | java -jar ../../closure-compiler-read-only/build/compiler.jar --js ../../closure-library-read-only/closure/goog/base.js --js - --js dygraph-exports.js --compilation_level ADVANCED_OPTIMIZATIONS --warning_level VERBOSE --externs dygraph-externs.js --externs gviz-api.js --formatting PRETTY_PRINT --output_wrapper='(function() {%output%})();'
#| uglifyjs - -c 'warnings=false' -m
# | java -jar yuicompressor-2.4.2.jar --type js