*/
/**
- * @fileoverview DygraphOptions is responsible for parsing and returning information about options.
- *
- * Still tightly coupled to Dygraphs, we could remove some of that, you know.
+ * @fileoverview DygraphOptions is responsible for parsing and returning
+ * information about options.
*/
-var DygraphOptions = (function() {
-/*jshint strict:false */
-
-// For "production" code, this gets set to false by uglifyjs.
-// Need to define it outside of "use strict", hence the nested IIFEs.
-if (typeof(DEBUG) === 'undefined') DEBUG=true;
-
-return (function() {
-
// TODO: remove this jshint directive & fix the warnings.
/*jshint sub:true */
/*global Dygraph:false */
"use strict";
+import * as utils from './dygraph-utils';
+import DEFAULT_ATTRS from './dygraph-default-attrs';
+
/*
* Interesting member variables: (REMOVING THIS LIST AS I CLOSURIZE)
* global_ - global attributes (common among all graphs, AIUI)
}
var axis_opts = this.user_["axes"] || {};
- Dygraph.update(this.yAxes_[0].options, axis_opts["y"] || {});
+ utils.update(this.yAxes_[0].options, axis_opts["y"] || {});
if (this.yAxes_.length > 1) {
- Dygraph.update(this.yAxes_[1].options, axis_opts["y2"] || {});
+ utils.update(this.yAxes_[1].options, axis_opts["y2"] || {});
}
- Dygraph.update(this.xAxis_.options, axis_opts["x"] || {});
+ utils.update(this.xAxis_.options, axis_opts["x"] || {});
- if (DEBUG) this.validateOptions_();
+ // if (DEBUG) this.validateOptions_();
};
/**
if (this.global_.hasOwnProperty(name)) {
return this.global_[name];
}
- if (Dygraph.DEFAULT_ATTRS.hasOwnProperty(name)) {
- return Dygraph.DEFAULT_ATTRS[name];
+ if (DEFAULT_ATTRS.hasOwnProperty(name)) {
+ return DEFAULT_ATTRS[name];
}
return null;
};
}
}
// Default axis options third.
- var defaultAxisOptions = Dygraph.DEFAULT_ATTRS.axes[axisString];
+ var defaultAxisOptions = DEFAULT_ATTRS.axes[axisString];
if (defaultAxisOptions.hasOwnProperty(name)) {
return defaultAxisOptions[name];
}
return this.labels_;
};
-if (DEBUG) {
+// TODO: fix this
+// if (DEBUG) {
+if (false) {
/**
* Validate all options.
}
-return DygraphOptions;
-
-})();
-})();
+export default DygraphOptions;