- plugin-free code is 59756 compiled; for uglifyjs it's 83031 (30% savings)
- How to deal with types for callback attributes? Always repeat?
Any way to declare these statically?
+
+
+TODO:
+- Make all plugins @implements DygraphPluginType
+- plugins/annotations.js -- annotation properties are likely getting mangled.
+- don't forget to remove "--formatting PRETTY_PRINT" before pulling.
+- Some of the changing from method -> local function is unnecessary now:
+ DygraphOptions.axisToIndex_
+ various methods in DygraphCanvas
+- Need to export symbols within Dygraph.Plotters ?
+- Really need a single canonical source of JS files.
+ -> Has to be dygraph-dev.js, since shell can read JS but not vice versa.
+- Anything else to move into dygraph-constant.js?
+- Big question: does Dygraph.toRGB_ work in IE?
}
var color = this.colors[setName];
- var strokeWidth = /** @type{number}*/(this.dygraph_.getOption("strokeWidth", setName));
+ var strokeWidth = this.dygraph_.getNumericOption("strokeWidth", setName);
ctx.save();
ctx.strokeStyle = color;
goog.exportSymbol('Dygraph.prototype.numAxes', Dygraph.prototype.numAxes);
goog.exportSymbol('Dygraph.prototype.numColumns', Dygraph.prototype.numColumns);
goog.exportSymbol('Dygraph.prototype.numRows', Dygraph.prototype.numRows);
+goog.exportSymbol('Dygraph.prototype.ready', Dygraph.prototype.ready);
goog.exportSymbol('Dygraph.prototype.resetZoom', Dygraph.prototype.resetZoom);
goog.exportSymbol('Dygraph.prototype.resize', Dygraph.prototype.resize);
goog.exportSymbol('Dygraph.prototype.rollPeriod', Dygraph.prototype.rollPeriod);
* width: (number|undefined),
* height: (number|undefined),
* shortText: (string|undefined),
- * text: (string|undefined)
+ * text: (string|undefined),
+ * attachAtBottom: (boolean|undefined),
+ * div: (!HTMLDivElement|undefined),
+ * cssClass: (string|undefined),
+ * tickHeight: (number|undefined),
+ * canvasx: (number|undefined),
+ * canvasy: (number|undefined)
* }}
*/
var DygraphAnnotationType;
var console = {};
/** @param {...} varargs */
console.log = function(varargs) {};
+
if (g.attr_("panEdgeFraction")) {
var size = g.size();
- var maxXPixelsToDraw = size.width * /**@type{number}*/(g.getOption("panEdgeFraction"));
+ var maxXPixelsToDraw = size.width * g.getNumericOption("panEdgeFraction");
var xExtremes = g.xAxisExtremes(); // I REALLY WANT TO CALL THIS xTremes!
var boundedLeftX = g.toDomXCoord(xExtremes[0]) - maxXPixelsToDraw;
context.boundedDates = [boundedLeftDate, boundedRightDate];
var boundedValues = [];
- var maxYPixelsToDraw = size.height * /**@type{number}*/(g.attr_("panEdgeFraction"));
+ var maxYPixelsToDraw = size.height * g.getNumericOption("panEdgeFraction");
for (i = 0; i < g.axes_.length; i++) {
axis = g.axes_[i];
// Add the annotations to the point to which they belong.
// Make a map from (setName, xval) to annotation for quick lookups.
var i;
+ /** @type {Object.<!DygraphAnnotationType>} */
var annotations = {};
for (i = 0; i < this.annotations.length; i++) {
var a = this.annotations[i];
echo "$F"
done
}
-# plugins/*.js \
-# dygraph-plugin-install.js
# Pack all the JS together.
CatSources () {
*/
+/**
+ * @constructor
+ * @implements DygraphPluginType
+ */
var annotations = function() {
+ /** @type {Array.<HTMLDivElement>} */
this.annotations_ = [];
};
+/** @override */
annotations.prototype.toString = function() {
return "Annotations Plugin";
};
+/** @override */
annotations.prototype.activate = function(g) {
return {
'clearChart': this.clearChart,
var g = e.dygraph;
// Early out in the (common) case of zero annotations.
+ /** @type {Array.<DygraphAnnotationType>} */
var points = g.layout_.annotated_points;
if (!points || points.length === 0) return;
+ console.log(points);
+
var containerDiv = e.canvas.parentNode;
var annotationStyle = {
"position": "absolute",
}
};
+/** @override */
annotations.prototype.destroy = function() {
this.detachLabels();
};
-->
<!--
For production (minified) code, use:
- <script type="text/javascript" src="dygraph-combined.js"></script>
- -->
<script type="text/javascript" src="../dygraph-dev.js"></script>
+ -->
+ <script type="text/javascript" src="../dygraph-combined.js"></script>
<style type="text/css">
.annotation {