can generate jsdoc; private methods marked as such
authorDan Vanderkam <dan@dygraphs.com>
Mon, 9 May 2011 14:15:18 +0000 (07:15 -0700)
committerDan Vanderkam <dan@dygraphs.com>
Mon, 9 May 2011 14:15:18 +0000 (07:15 -0700)
116 files changed:
dygraph.js
jsdoc-toolkit/README.txt [new file with mode: 0644]
jsdoc-toolkit/app/frame.js [new file with mode: 0644]
jsdoc-toolkit/app/frame/Chain.js [new file with mode: 0644]
jsdoc-toolkit/app/frame/Dumper.js [new file with mode: 0644]
jsdoc-toolkit/app/frame/Hash.js [new file with mode: 0644]
jsdoc-toolkit/app/frame/Link.js [new file with mode: 0644]
jsdoc-toolkit/app/frame/Namespace.js [new file with mode: 0644]
jsdoc-toolkit/app/frame/Opt.js [new file with mode: 0644]
jsdoc-toolkit/app/frame/Reflection.js [new file with mode: 0644]
jsdoc-toolkit/app/frame/String.js [new file with mode: 0644]
jsdoc-toolkit/app/frame/Testrun.js [new file with mode: 0644]
jsdoc-toolkit/app/handlers/FOODOC.js [new file with mode: 0644]
jsdoc-toolkit/app/handlers/XMLDOC.js [new file with mode: 0755]
jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js [new file with mode: 0755]
jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js [new file with mode: 0755]
jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js [new file with mode: 0755]
jsdoc-toolkit/app/lib/JSDOC.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/DocComment.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/DocTag.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/JsDoc.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/JsPlate.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/Lang.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/Parser.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/PluginManager.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/Symbol.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/TextStream.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/Token.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/TokenReader.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/TokenStream.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/Util.js [new file with mode: 0644]
jsdoc-toolkit/app/lib/JSDOC/Walker.js [new file with mode: 0644]
jsdoc-toolkit/app/main.js [new file with mode: 0644]
jsdoc-toolkit/app/plugins/commentSrcJson.js [new file with mode: 0644]
jsdoc-toolkit/app/plugins/frameworkPrototype.js [new file with mode: 0644]
jsdoc-toolkit/app/plugins/functionCall.js [new file with mode: 0644]
jsdoc-toolkit/app/plugins/publishSrcHilite.js [new file with mode: 0644]
jsdoc-toolkit/app/plugins/symbolLink.js [new file with mode: 0644]
jsdoc-toolkit/app/plugins/tagParamConfig.js [new file with mode: 0644]
jsdoc-toolkit/app/plugins/tagSynonyms.js [new file with mode: 0644]
jsdoc-toolkit/app/run.js [new file with mode: 0644]
jsdoc-toolkit/app/t/TestDoc.js [new file with mode: 0644]
jsdoc-toolkit/app/t/runner.js [new file with mode: 0644]
jsdoc-toolkit/app/test.js [new file with mode: 0644]
jsdoc-toolkit/app/test/addon.js [new file with mode: 0644]
jsdoc-toolkit/app/test/anon_inner.js [new file with mode: 0644]
jsdoc-toolkit/app/test/augments.js [new file with mode: 0644]
jsdoc-toolkit/app/test/augments2.js [new file with mode: 0644]
jsdoc-toolkit/app/test/borrows.js [new file with mode: 0644]
jsdoc-toolkit/app/test/borrows2.js [new file with mode: 0644]
jsdoc-toolkit/app/test/config.js [new file with mode: 0644]
jsdoc-toolkit/app/test/constructs.js [new file with mode: 0644]
jsdoc-toolkit/app/test/encoding.js [new file with mode: 0644]
jsdoc-toolkit/app/test/encoding_other.js [new file with mode: 0644]
jsdoc-toolkit/app/test/event.js [new file with mode: 0644]
jsdoc-toolkit/app/test/exports.js [new file with mode: 0644]
jsdoc-toolkit/app/test/functions_anon.js [new file with mode: 0644]
jsdoc-toolkit/app/test/functions_nested.js [new file with mode: 0644]
jsdoc-toolkit/app/test/global.js [new file with mode: 0644]
jsdoc-toolkit/app/test/globals.js [new file with mode: 0644]
jsdoc-toolkit/app/test/ignore.js [new file with mode: 0644]
jsdoc-toolkit/app/test/inner.js [new file with mode: 0644]
jsdoc-toolkit/app/test/jsdoc_test.js [new file with mode: 0644]
jsdoc-toolkit/app/test/lend.js [new file with mode: 0644]
jsdoc-toolkit/app/test/memberof.js [new file with mode: 0644]
jsdoc-toolkit/app/test/memberof2.js [new file with mode: 0644]
jsdoc-toolkit/app/test/memberof3.js [new file with mode: 0644]
jsdoc-toolkit/app/test/memberof_constructor.js [new file with mode: 0644]
jsdoc-toolkit/app/test/module.js [new file with mode: 0644]
jsdoc-toolkit/app/test/multi_methods.js [new file with mode: 0644]
jsdoc-toolkit/app/test/name.js [new file with mode: 0644]
jsdoc-toolkit/app/test/namespace_nested.js [new file with mode: 0644]
jsdoc-toolkit/app/test/nocode.js [new file with mode: 0644]
jsdoc-toolkit/app/test/oblit_anon.js [new file with mode: 0644]
jsdoc-toolkit/app/test/overview.js [new file with mode: 0644]
jsdoc-toolkit/app/test/param_inline.js [new file with mode: 0644]
jsdoc-toolkit/app/test/params_optional.js [new file with mode: 0644]
jsdoc-toolkit/app/test/prototype.js [new file with mode: 0644]
jsdoc-toolkit/app/test/prototype_nested.js [new file with mode: 0644]
jsdoc-toolkit/app/test/prototype_oblit.js [new file with mode: 0644]
jsdoc-toolkit/app/test/prototype_oblit_constructor.js [new file with mode: 0644]
jsdoc-toolkit/app/test/public.js [new file with mode: 0644]
jsdoc-toolkit/app/test/scripts/code.js [new file with mode: 0644]
jsdoc-toolkit/app/test/scripts/notcode.txt [new file with mode: 0644]
jsdoc-toolkit/app/test/shared.js [new file with mode: 0644]
jsdoc-toolkit/app/test/shared2.js [new file with mode: 0644]
jsdoc-toolkit/app/test/shortcuts.js [new file with mode: 0644]
jsdoc-toolkit/app/test/static_this.js [new file with mode: 0644]
jsdoc-toolkit/app/test/synonyms.js [new file with mode: 0644]
jsdoc-toolkit/app/test/tosource.js [new file with mode: 0644]
jsdoc-toolkit/app/test/variable_redefine.js [new file with mode: 0644]
jsdoc-toolkit/changes.txt [new file with mode: 0644]
jsdoc-toolkit/conf/sample.conf [new file with mode: 0644]
jsdoc-toolkit/java/build.xml [new file with mode: 0644]
jsdoc-toolkit/java/build_1.4.xml [new file with mode: 0644]
jsdoc-toolkit/java/classes/js.jar [new file with mode: 0644]
jsdoc-toolkit/java/src/JsDebugRun.java [new file with mode: 0755]
jsdoc-toolkit/java/src/JsRun.java [new file with mode: 0644]
jsdoc-toolkit/jsdebug.jar [new file with mode: 0644]
jsdoc-toolkit/jsrun.jar [new file with mode: 0644]
jsdoc-toolkit/jsrun.sh [new file with mode: 0644]
jsdoc-toolkit/out/jsdoc/files.html [new file with mode: 0644]
jsdoc-toolkit/out/jsdoc/index.html [new file with mode: 0644]
jsdoc-toolkit/out/jsdoc/symbols/Dygraph.html [new file with mode: 0644]
jsdoc-toolkit/out/jsdoc/symbols/_global_.html [new file with mode: 0644]
jsdoc-toolkit/out/jsdoc/symbols/src/dygraph.js.html [new file with mode: 0644]
jsdoc-toolkit/templates/jsdoc/allclasses.tmpl [new file with mode: 0644]
jsdoc-toolkit/templates/jsdoc/allfiles.tmpl [new file with mode: 0644]
jsdoc-toolkit/templates/jsdoc/class.tmpl [new file with mode: 0644]
jsdoc-toolkit/templates/jsdoc/index.tmpl [new file with mode: 0644]
jsdoc-toolkit/templates/jsdoc/publish.js [new file with mode: 0644]
jsdoc-toolkit/templates/jsdoc/static/default.css [new file with mode: 0644]
jsdoc-toolkit/templates/jsdoc/static/header.html [new file with mode: 0644]
jsdoc-toolkit/templates/jsdoc/static/index.html [new file with mode: 0644]
jsdoc-toolkit/templates/jsdoc/symbol.tmpl [new file with mode: 0644]

index 794b796..78f933d 100644 (file)
  */
 
 /**
- * An interactive, zoomable graph
- * @param {String | Function} file A file containing CSV data or a function that
- * returns this data. The expected format for each line is
- * YYYYMMDD,val1,val2,... or, if attrs.errorBars is set,
- * YYYYMMDD,val1,stddev1,val2,stddev2,...
+ * Creates an interactive, zoomable chart.
+ *
+ * @constructor
+ * @param {div | String} div A div or the id of a div into which to construct
+ * the chart.
+ * @param {String | Function} file A file containing CSV data or a function
+ * that returns this data. The most basic expected format for each line is
+ * "YYYY/MM/DD,val1,val2,...". For more information, see
+ * http://dygraphs.com/data.html.
  * @param {Object} attrs Various other attributes, e.g. errorBars determines
- * whether the input data contains error ranges.
+ * whether the input data contains error ranges. For a complete list of
+ * options, see http://dygraphs.com/options.html.
  */
 Dygraph = function(div, data, opts) {
   if (arguments.length > 0) {
@@ -68,6 +73,10 @@ Dygraph.VERSION = "1.2";
 Dygraph.__repr__ = function() {
   return "[" + this.NAME + " " + this.VERSION + "]";
 };
+
+/**
+ * Returns information about the Dygraph class.
+ */
 Dygraph.toString = function() {
   return this.__repr__();
 };
@@ -80,6 +89,9 @@ Dygraph.AXIS_LINE_WIDTH = 0.3;
 
 Dygraph.LOG_SCALE = 10;
 Dygraph.LN_TEN = Math.log(Dygraph.LOG_SCALE);
+/**
+ * @private
+ */
 Dygraph.log10 = function(x) {
   return Math.log(x) / Dygraph.LN_TEN;
 }
@@ -162,6 +174,7 @@ Dygraph.VERTICAL = 2;
 Dygraph.addedAnnotationCSS = false;
 
 /**
+ * @private
  * Return the 2d context for a dygraph canvas.
  *
  * This method is only exposed for the sake of replacing the function in
@@ -307,12 +320,26 @@ Dygraph.prototype.isZoomed = function(axis) {
   throw "axis parameter to Dygraph.isZoomed must be missing, 'x' or 'y'.";
 };
 
+/**
+ * Returns information about the Dygraph object, including its containing ID.
+ */
 Dygraph.prototype.toString = function() {
   var maindiv = this.maindiv_;
   var id = (maindiv && maindiv.id) ? maindiv.id : maindiv
   return "[Dygraph " + id + "]";
 }
 
+/**
+ * @private
+ * Returns the value of an option. This may be set by the user (either in the
+ * constructor or by calling updateOptions) or by dygraphs, and may be set to a
+ * per-series value.
+ * @param { String } name The name of the option, e.g. 'rollPeriod'.
+ * @param { String } [seriesName] The name of the series to which the option
+ * will be applied. If no per-series value of this option is available, then
+ * the global value is returned. This is optional.
+ * @return { ... } The value of the option.
+ */
 Dygraph.prototype.attr_ = function(name, seriesName) {
 // <REMOVE_FOR_COMBINED>
   if (typeof(Dygraph.OPTIONS_REFERENCE) === 'undefined') {
@@ -339,6 +366,12 @@ Dygraph.prototype.attr_ = function(name, seriesName) {
 };
 
 // TODO(danvk): any way I can get the line numbers to be this.warn call?
+/**
+ * @private
+ * Log an error on the JS console at the given severity.
+ * @param { Integer } severity One of Dygraph.{DEBUG,INFO,WARNING,ERROR}
+ * @param { String } The message to log.
+ */
 Dygraph.prototype.log = function(severity, message) {
   if (typeof(console) != 'undefined') {
     switch (severity) {
@@ -356,16 +389,28 @@ Dygraph.prototype.log = function(severity, message) {
         break;
     }
   }
-}
+};
+
+/**
+ * @private
+ */
 Dygraph.prototype.info = function(message) {
   this.log(Dygraph.INFO, message);
-}
+};
+
+/**
+ * @private
+ */
 Dygraph.prototype.warn = function(message) {
   this.log(Dygraph.WARNING, message);
-}
+};
+
+/**
+ * @private
+ */
 Dygraph.prototype.error = function(message) {
   this.log(Dygraph.ERROR, message);
-}
+};
 
 /**
  * Returns the current rolling period, as set by the user or an option.
@@ -551,6 +596,10 @@ Dygraph.prototype.toDataYCoord = function(y, axis) {
  *
  * If y is null, this returns null.
  * if axis is null, this uses the first axis.
+ *
+ * @param { Number } y The data y-coordinate.
+ * @param { Number } [axis] The axis number on which the data coordinate lives.
+ * @return { Number } A fraction in [0, 1] where 0 = the top edge.
  */
 Dygraph.prototype.toPercentYCoord = function(y, axis) {
   if (y == null) {
@@ -584,6 +633,8 @@ Dygraph.prototype.toPercentYCoord = function(y, axis) {
  * values can fall outside the canvas.
  *
  * If x is null, this returns null.
+ * @param { Number } x The data x-coordinate.
+ * @return { Number } A fraction in [0, 1] where 0 = the left edge.
  */
 Dygraph.prototype.toPercentXCoord = function(x) {
   if (x == null) {
@@ -592,10 +643,11 @@ Dygraph.prototype.toPercentXCoord = function(x) {
 
   var xRange = this.xAxisRange();
   return (x - xRange[0]) / (xRange[1] - xRange[0]);
-}
+};
 
 /**
  * Returns the number of columns (including the independent variable).
+ * @return { Integer } The number of columns.
  */
 Dygraph.prototype.numColumns = function() {
   return this.rawData_[0].length;
@@ -603,6 +655,7 @@ Dygraph.prototype.numColumns = function() {
 
 /**
  * Returns the number of rows (excluding any header/label row).
+ * @return { Integer } The number of rows, less any header.
  */
 Dygraph.prototype.numRows = function() {
   return this.rawData_.length;
@@ -612,6 +665,11 @@ Dygraph.prototype.numRows = function() {
  * Returns the value in the given row and column. If the row and column exceed
  * the bounds on the data, returns null. Also returns null if the value is
  * missing.
+ * @param { Number} row The row number of the data (0-based). Row 0 is the
+ * first row of data, not a header row.
+ * @param { Number} col The column number of the data (0-based)
+ * @return { Number } The value in the specified cell or null if the row/col
+ * were out of range.
  */
 Dygraph.prototype.getValue = function(row, col) {
   if (row < 0 || row > this.rawData_.length) return null;
@@ -620,6 +678,15 @@ Dygraph.prototype.getValue = function(row, col) {
   return this.rawData_[row][col];
 };
 
+/**
+ * @private
+ * Add an event handler. This smooths a difference between IE and the rest of
+ * the world.
+ * @param { DOM element } el The element to add the event to.
+ * @param { String } evt The name of the event, e.g. 'click' or 'mousemove'.
+ * @param { Function } fn The function to call on the event. The function takes
+ * one parameter: the event object.
+ */
 Dygraph.addEvent = function(el, evt, fn) {
   var normed_fn = function(e) {
     if (!e) var e = window.event;
@@ -633,8 +700,14 @@ Dygraph.addEvent = function(el, evt, fn) {
 };
 
 
-// Based on the article at
-// http://www.switchonthecode.com/tutorials/javascript-tutorial-the-scroll-wheel
+/**
+ * @private
+ * Cancels further processing of an event. This is useful to prevent default
+ * browser actions, e.g. highlighting text on a double-click.
+ * Based on the article at
+ * http://www.switchonthecode.com/tutorials/javascript-tutorial-the-scroll-wheel
+ * @param { Event } e The event whose normal behavior should be canceled.
+ */
 Dygraph.cancelEvent = function(e) {
   e = e ? e : window.event;
   if (e.stopPropagation) {
@@ -647,7 +720,7 @@ Dygraph.cancelEvent = function(e) {
   e.cancel = true;
   e.returnValue = false;
   return false;
-}
+};
 
 
 /**
@@ -742,8 +815,9 @@ Dygraph.prototype.destroy = function() {
 };
 
 /**
- * Creates the canvas containing the PlotKit graph. Only plotkit ever draws on
- * this particular canvas. All Dygraph work is done on this.canvas_.
+ * Creates the canvas on which the chart will be drawn. Only the Renderer ever
+ * draws on this particular canvas. All Dygraph work (i.e. drawing hover dots
+ * or the zoom rectangles) is done on this.canvas_.
  * @param {Object} canvas The Dygraph canvas over which to overlay the plot
  * @return {Object} The newly-created canvas
  * @private
@@ -763,7 +837,16 @@ Dygraph.prototype.createPlotKitCanvas_ = function(canvas) {
   return h;
 };
 
-// Taken from MochiKit.Color
+/**
+ * Convert hsv values to an rgb(r,g,b) string. Taken from MochiKit.Color. This
+ * is used to generate default series colors which are evenly spaced on the
+ * color wheel.
+ * @param { Number } hue Range is 0.0-1.0.
+ * @param { Number } saturation Range is 0.0-1.0.
+ * @param { Number } value Range is 0.0-1.0.
+ * @return { String } "rgb(r,g,b)" where r, g and b range from 0-255.
+ * @private
+ */
 Dygraph.hsvToRGB = function (hue, saturation, value) {
   var red;
   var green;
@@ -832,11 +915,11 @@ Dygraph.prototype.setColors_ = function() {
   Dygraph.update(this.plotter_.options, this.renderOptions_);
   Dygraph.update(this.layoutOptions_, this.user_attrs_);
   Dygraph.update(this.layoutOptions_, this.attrs_);
-}
+};
 
 /**
  * Return the list of colors. This is either the list of colors passed in the
- * attributes, or the autogenerated list of rgb(r,g,b) strings.
+ * attributes or the autogenerated list of rgb(r,g,b) strings.
  * @return {Array<string>} The list of colors.
  */
 Dygraph.prototype.getColors = function() {
@@ -846,6 +929,10 @@ Dygraph.prototype.getColors = function() {
 // The following functions are from quirksmode.org with a modification for Safari from
 // http://blog.firetree.net/2005/07/04/javascript-find-position/
 // http://www.quirksmode.org/js/findpos.html
+
+/**
+ * @private
+ */
 Dygraph.findPosX = function(obj) {
   var curleft = 0;
   if(obj.offsetParent)
@@ -861,6 +948,10 @@ Dygraph.findPosX = function(obj) {
   return curleft;
 };
 
+
+/**
+ * @private
+ */
 Dygraph.findPosY = function(obj) {
   var curtop = 0;
   if(obj.offsetParent)
@@ -877,7 +968,6 @@ Dygraph.findPosY = function(obj) {
 };
 
 
-
 /**
  * Create the div that contains information on the selected point(s)
  * This goes in the top right of the canvas, unless an external div has already
@@ -918,6 +1008,7 @@ Dygraph.prototype.createStatusMessage_ = function() {
  * Position the labels div so that:
  * - its right edge is flush with the right edge of the charting area
  * - its top edge is flush with the top edge of the charting area
+ * @private
  */
 Dygraph.prototype.positionLabelsDiv_ = function() {
   // Don't touch a user-specified labelsDiv.
@@ -963,7 +1054,12 @@ Dygraph.prototype.createRollInterface_ = function() {
   this.roller_.onchange = function() { dygraph.adjustRoll(dygraph.roller_.value); };
 };
 
-// These functions are taken from MochiKit.Signal
+/**
+ * @private
+ * Returns the x-coordinate of the event in a coordinate system where the
+ * top-left corner of the page (not the window) is (0,0).
+ * Taken from MochiKit.Signal
+ */
 Dygraph.pageX = function(e) {
   if (e.pageX) {
     return (!e.pageX || e.pageX < 0) ? 0 : e.pageX;
@@ -976,6 +1072,12 @@ Dygraph.pageX = function(e) {
   }
 };
 
+/**
+ * @private
+ * Returns the y-coordinate of the event in a coordinate system where the
+ * top-left corner of the page (not the window) is (0,0).
+ * Taken from MochiKit.Signal
+ */
 Dygraph.pageY = function(e) {
   if (e.pageY) {
     return (!e.pageY || e.pageY < 0) ? 0 : e.pageY;
@@ -988,21 +1090,37 @@ Dygraph.pageY = function(e) {
   }
 };
 
+/**
+ * @private
+ * Converts page the x-coordinate of the event to pixel x-coordinates on the
+ * canvas (i.e. DOM Coords).
+ */
 Dygraph.prototype.dragGetX_ = function(e, context) {
   return Dygraph.pageX(e) - context.px
 };
 
+/**
+ * @private
+ * Converts page the y-coordinate of the event to pixel y-coordinates on the
+ * canvas (i.e. DOM Coords).
+ */
 Dygraph.prototype.dragGetY_ = function(e, context) {
   return Dygraph.pageY(e) - context.py
 };
 
-// Called in response to an interaction model operation that
-// should start the default panning behavior.
-//
-// It's used in the default callback for "mousedown" operations.
-// Custom interaction model builders can use it to provide the default
-// panning behavior.
-//
+/**
+ * Called in response to an interaction model operation that
+ * should start the default panning behavior.
+ *
+ * It's used in the default callback for "mousedown" operations.
+ * Custom interaction model builders can use it to provide the default
+ * panning behavior.
+ *
+ * @param { Event } event the event object which led to the startPan call.
+ * @param { Dygraph} g The dygraph on which to act.
+ * @param { Object} context The dragging context object (with
+ * dragStartX/dragStartY/etc. properties). This function modifies the context.
+ */
 Dygraph.startPan = function(event, g, context) {
   context.isPanning = true;
   var xRange = g.xAxisRange();
@@ -1061,13 +1179,19 @@ Dygraph.startPan = function(event, g, context) {
   }
 };
 
-// Called in response to an interaction model operation that
-// responds to an event that pans the view.
-//
-// It's used in the default callback for "mousemove" operations.
-// Custom interaction model builders can use it to provide the default
-// panning behavior.
-//
+/**
+ * Called in response to an interaction model operation that
+ * responds to an event that pans the view.
+ *
+ * It's used in the default callback for "mousemove" operations.
+ * Custom interaction model builders can use it to provide the default
+ * panning behavior.
+ *
+ * @param { Event } event the event object which led to the movePan call.
+ * @param { Dygraph} g The dygraph on which to act.
+ * @param { Object} context The dragging context object (with
+ * dragStartX/dragStartY/etc. properties). This function modifies the context.
+ */
 Dygraph.movePan = function(event, g, context) {
   context.dragEndX = g.dragGetX_(event, context);
   context.dragEndY = g.dragGetY_(event, context);
@@ -1122,15 +1246,21 @@ Dygraph.movePan = function(event, g, context) {
   }
 
   g.drawGraph_();
-}
+};
 
-// Called in response to an interaction model operation that
-// responds to an event that ends panning.
-//
-// It's used in the default callback for "mouseup" operations.
-// Custom interaction model builders can use it to provide the default
-// panning behavior.
-//
+/**
+ * Called in response to an interaction model operation that
+ * responds to an event that ends panning.
+ *
+ * It's used in the default callback for "mouseup" operations.
+ * Custom interaction model builders can use it to provide the default
+ * panning behavior.
+ *
+ * @param { Event } event the event object which led to the startZoom call.
+ * @param { Dygraph} g The dygraph on which to act.
+ * @param { Object} context The dragging context object (with
+ * dragStartX/dragStartY/etc. properties). This function modifies the context.
+ */
 Dygraph.endPan = function(event, g, context) {
   // TODO(konigsberg): Clear the context data from the axis.
   // TODO(konigsberg): mouseup should just delete the
@@ -1142,26 +1272,38 @@ Dygraph.endPan = function(event, g, context) {
   context.valueRange = null;
   context.boundedDates = null;
   context.boundedValues = null;
-}
+};
 
-// Called in response to an interaction model operation that
-// responds to an event that starts zooming.
-//
-// It's used in the default callback for "mousedown" operations.
-// Custom interaction model builders can use it to provide the default
-// zooming behavior.
-//
+/**
+ * Called in response to an interaction model operation that
+ * responds to an event that starts zooming.
+ *
+ * It's used in the default callback for "mousedown" operations.
+ * Custom interaction model builders can use it to provide the default
+ * zooming behavior.
+ *
+ * @param { Event } event the event object which led to the startZoom call.
+ * @param { Dygraph} g The dygraph on which to act.
+ * @param { Object} context The dragging context object (with
+ * dragStartX/dragStartY/etc. properties). This function modifies the context.
+ */
 Dygraph.startZoom = function(event, g, context) {
   context.isZooming = true;
-}
+};
 
-// Called in response to an interaction model operation that
-// responds to an event that defines zoom boundaries.
-//
-// It's used in the default callback for "mousemove" operations.
-// Custom interaction model builders can use it to provide the default
-// zooming behavior.
-//
+/**
+ * Called in response to an interaction model operation that
+ * responds to an event that defines zoom boundaries.
+ *
+ * It's used in the default callback for "mousemove" operations.
+ * Custom interaction model builders can use it to provide the default
+ * zooming behavior.
+ *
+ * @param { Event } event the event object which led to the moveZoom call.
+ * @param { Dygraph} g The dygraph on which to act.
+ * @param { Object} context The dragging context object (with
+ * dragStartX/dragStartY/etc. properties). This function modifies the context.
+ */
 Dygraph.moveZoom = function(event, g, context) {
   context.dragEndX = g.dragGetX_(event, context);
   context.dragEndY = g.dragGetY_(event, context);
@@ -1185,17 +1327,24 @@ Dygraph.moveZoom = function(event, g, context) {
   context.prevEndX = context.dragEndX;
   context.prevEndY = context.dragEndY;
   context.prevDragDirection = context.dragDirection;
-}
+};
 
-// Called in response to an interaction model operation that
-// responds to an event that performs a zoom based on previously defined
-// bounds..
-//
-// It's used in the default callback for "mouseup" operations.
-// Custom interaction model builders can use it to provide the default
-// zooming behavior.
-//
+/**
+ * Called in response to an interaction model operation that
+ * responds to an event that performs a zoom based on previously defined
+ * bounds..
+ *
+ * It's used in the default callback for "mouseup" operations.
+ * Custom interaction model builders can use it to provide the default
+ * zooming behavior.
+ *
+ * @param { Event } event the event object which led to the endZoom call.
+ * @param { Dygraph} g The dygraph on which to end the zoom.
+ * @param { Object} context The dragging context object (with
+ * dragStartX/dragStartY/etc. properties). This function modifies the context.
+ */
 Dygraph.endZoom = function(event, g, context) {
+  // TODO(konigsberg): Refactor or rename this fn -- it deals with clicks, too.
   context.isZooming = false;
   context.dragEndX = g.dragGetX_(event, context);
   context.dragEndY = g.dragGetY_(event, context);
@@ -1241,8 +1390,17 @@ Dygraph.endZoom = function(event, g, context) {
   }
   context.dragStartX = null;
   context.dragStartY = null;
-}
+};
 
+/**
+ * Default interation model for dygraphs. You can refer to specific elements of
+ * this when constructing your own interaction model, e.g.:
+ * g.updateOptions( {
+ *   interactionModel: {
+ *     mousedown: Dygraph.defaultInteractionModel.mousedown
+ *   }
+ * } );
+ */
 Dygraph.defaultInteractionModel = {
   // Track the beginning of drag events
   mousedown: function(event, g, context) {
@@ -1632,11 +1790,25 @@ Dygraph.prototype.idxToRow_ = function(idx) {
   return -1;
 };
 
+/**
+ * @private
+ * @param { Number } x The number to consider.
+ * @return { Boolean } Whether the number is zero or NaN.
+ */
 // TODO(danvk): rename this function to something like 'isNonZeroNan'.
 Dygraph.isOK = function(x) {
   return x && !isNaN(x);
 };
 
+/**
+ * @private
+ * Generates HTML for the legend which is displayed when hovering over the
+ * chart. If no selected points are specified, a default legend is returned
+ * (this may just be the empty string).
+ * @param { Number } [x] The x-value of the selected points.
+ * @param { [Object] } [sel_points] List of selected points for the given
+ * x-value. Should have properties like 'name', 'yval' and 'canvasy'.
+ */
 Dygraph.prototype.generateLegendHTML_ = function(x, sel_points) {
   // If no points are selected, we display a default legend. Traditionally,
   // this has been blank. But a better default would be a conventional legend,
@@ -1678,6 +1850,14 @@ Dygraph.prototype.generateLegendHTML_ = function(x, sel_points) {
   return html;
 };
 
+/**
+ * @private
+ * Displays information about the selected points in the legend. If there is no
+ * selection, the legend will be cleared.
+ * @param { Number } [x] The x-value of the selected points.
+ * @param { [Object] } [sel_points] List of selected points for the given
+ * x-value. Should have properties like 'name', 'yval' and 'canvasy'.
+ */
 Dygraph.prototype.setLegendHTML_ = function(x, sel_points) {
   var html = this.generateLegendHTML_(x, sel_points);
   var labelsDiv = this.attr_("labelsDiv");
@@ -1738,10 +1918,11 @@ Dygraph.prototype.updateSelection_ = function() {
 };
 
 /**
- * Set manually set selected dots, and display information about them
- * @param int row number that should by highlighted
- *            false value clears the selection
- * @public
+ * Manually set the selected points and display information about them in the
+ * legend. The selection can be cleared using clearSelection() and queried
+ * using getSelection().
+ * @param { Integer } row number that should be highlighted (i.e. appear with
+ * hover dots on the chart). Set to false to clear any selection.
  */
 Dygraph.prototype.setSelection = function(row) {
   // Extract the points we've selected
@@ -1792,8 +1973,8 @@ Dygraph.prototype.mouseOut_ = function(event) {
 };
 
 /**
- * Remove all selection from the canvas
- * @public
+ * Clears the current selection (i.e. points that were highlighted by moving
+ * the mouse over the chart).
  */
 Dygraph.prototype.clearSelection = function() {
   // Get rid of the overlay data
@@ -1804,9 +1985,9 @@ Dygraph.prototype.clearSelection = function() {
 }
 
 /**
- * Returns the number of the currently selected row
- * @return int row number, of -1 if nothing is selected
- * @public
+ * Returns the number of the currently selected row. To get data for this row,
+ * you can use the getValue method.
+ * @return { Integer } row number, or -1 if nothing is selected
  */
 Dygraph.prototype.getSelection = function() {
   if (!this.selPoints_ || this.selPoints_.length < 1) {
@@ -1864,6 +2045,7 @@ Dygraph.floatFormat = function(x, opt_precision) {
 };
 
 /**
+ * @private
  * Return a string version of a number. This respects the digitsAfterDecimal
  * and maxNumberWidth options.
  * @param {Number} x The number to be formatted
@@ -1890,6 +2072,10 @@ Dygraph.numberFormatter = function(x, g) {
   }
 };
 
+/**
+ * @private
+ * Converts '9' to '09' (useful for dates)
+ */
 Dygraph.zeropad = function(x) {
   if (x < 10) return "0" + x; else return "" + x;
 };
@@ -2043,11 +2229,11 @@ Dygraph.SHORT_SPACINGS[Dygraph.SIX_HOURLY]      = 1000 * 3600 * 6;
 Dygraph.SHORT_SPACINGS[Dygraph.DAILY]           = 1000 * 86400;
 Dygraph.SHORT_SPACINGS[Dygraph.WEEKLY]          = 1000 * 604800;
 
-// NumXTicks()
-//
-//   If we used this time granularity, how many ticks would there be?
-//   This is only an approximation, but it's generally good enough.
-//
+/**
+ * @private
+ * If we used this time granularity, how many ticks would there be?
+ * This is only an approximation, but it's generally good enough.
+ */
 Dygraph.prototype.NumXTicks = function(start_time, end_time, granularity) {
   if (granularity < Dygraph.MONTHLY) {
     // Generate one tick mark for every fixed interval of time.
@@ -2068,13 +2254,14 @@ Dygraph.prototype.NumXTicks = function(start_time, end_time, granularity) {
   }
 };
 
-// GetXAxis()
-//
-//   Construct an x-axis of nicely-formatted times on meaningful boundaries
-//   (e.g. 'Jan 09' rather than 'Jan 22, 2009').
-//
-//   Returns an array containing {v: millis, label: label} dictionaries.
-//
+/**
+ * @private
+ *
+ * Construct an x-axis of nicely-formatted times on meaningful boundaries
+ * (e.g. 'Jan 09' rather than 'Jan 22, 2009').
+ *
+ * Returns an array containing {v: millis, label: label} dictionaries.
+ */
 Dygraph.prototype.GetXAxis = function(start_time, end_time, granularity) {
   var formatter = this.attr_("xAxisLabelFormatter");
   var ticks = [];
@@ -2162,10 +2349,12 @@ Dygraph.prototype.GetXAxis = function(start_time, end_time, granularity) {
  * Add ticks to the x-axis based on a date range.
  * @param {Number} startDate Start of the date window (millis since epoch)
  * @param {Number} endDate End of the date window (millis since epoch)
- * @return {Array.<Object>} Array of {label, value} tuples.
+ * @param {Dygraph} self The dygraph object
+ * @return { [Object] } Array of {label, value} tuples.
  * @public
  */
 Dygraph.dateTicker = function(startDate, endDate, self) {
+  // TODO(danvk): why does this take 'self' as a param?
   var chosen = -1;
   for (var i = 0; i < Dygraph.NUM_GRANULARITIES; i++) {
     var num_ticks = self.NumXTicks(startDate, endDate, i);
@@ -2182,10 +2371,13 @@ Dygraph.dateTicker = function(startDate, endDate, self) {
   }
 };
 
-// This is a list of human-friendly values at which to show tick marks on a log
-// scale. It is k * 10^n, where k=1..9 and n=-39..+39, so:
-// ..., 1, 2, 3, 4, 5, ..., 9, 10, 20, 30, ..., 90, 100, 200, 300, ...
-// NOTE: this assumes that Dygraph.LOG_SCALE = 10.
+/**
+ * @private
+ * This is a list of human-friendly values at which to show tick marks on a log
+ * scale. It is k * 10^n, where k=1..9 and n=-39..+39, so:
+ * ..., 1, 2, 3, 4, 5, ..., 9, 10, 20, 30, ..., 90, 100, 200, 300, ...
+ * NOTE: this assumes that Dygraph.LOG_SCALE = 10.
+ */
 Dygraph.PREFERRED_LOG_TICK_VALUES = function() {
   var vals = [];
   for (var power = -39; power <= 39; power++) {
@@ -2198,12 +2390,18 @@ Dygraph.PREFERRED_LOG_TICK_VALUES = function() {
   return vals;
 }();
 
-// val is the value to search for
-// arry is the value over which to search
-// if abs > 0, find the lowest entry greater than val
-// if abs < 0, find the highest entry less than val
-// if abs == 0, find the entry that equals val.
-// Currently does not work when val is outside the range of arry's values.
+/**
+ * @private
+ * Implementation of binary search over an array.
+ * Currently does not work when val is outside the range of arry's values.
+ * @param { Integer } val the value to search for
+ * @param { Integer[] } arry is the value over which to search
+ * @param { Integer } abs If abs > 0, find the lowest entry greater than val
+ * If abs < 0, find the highest entry less than val.
+ * if abs == 0, find the entry that equals val.
+ * @param { Integer } [low] The first index in arry to consider (optional)
+ * @param { Integer } [high] The last index in arry to consider (optional)
+ */
 Dygraph.binarySearch = function(val, arry, abs, low, high) {
   if (low == null || high == null) {
     low = 0;
@@ -2245,16 +2443,15 @@ Dygraph.binarySearch = function(val, arry, abs, low, high) {
   }
 };
 
+// TODO(konigsberg): Update comment.
 /**
  * Add ticks when the x axis has numbers on it (instead of dates)
- * TODO(konigsberg): Update comment.
  *
  * @param {Number} minV minimum value
  * @param {Number} maxV maximum value
  * @param self
  * @param {function} attribute accessor function.
- * @return {Array.<Object>} Array of {label, value} tuples.
- * @public
+ * @return {[Object]} Array of {label, value} tuples.
  */
 Dygraph.numericTicks = function(minV, maxV, self, axis_props, vals) {
   var attr = function(k) {
@@ -2391,10 +2588,13 @@ Dygraph.numericTicks = function(minV, maxV, self, axis_props, vals) {
   return ticks;
 };
 
-// Computes the range of the data series (including confidence intervals).
-// series is either [ [x1, y1], [x2, y2], ... ] or
-// [ [x1, [y1, dev_low, dev_high]], [x2, [y2, dev_low, dev_high]], ...
-// Returns [low, high]
+/**
+ * @private
+ * Computes the range of the data series (including confidence intervals).
+ * @param { [Array] } series either [ [x1, y1], [x2, y2], ... ] or
+ * [ [x1, [y1, dev_low, dev_high]], [x2, [y2, dev_low, dev_high]], ...
+ * @return [low, high]
+ */
 Dygraph.prototype.extremeValues_ = function(series) {
   var minY = null, maxY = null;
 
@@ -2432,6 +2632,7 @@ Dygraph.prototype.extremeValues_ = function(series) {
 };
 
 /**
+ * @private
  * This function is called once when the chart's data is changed or the options
  * dictionary is updated. It is _not_ called when the user pans or zooms. The
  * idea is that values derived from the chart's data can be computed here,
@@ -2627,6 +2828,7 @@ Dygraph.prototype.drawGraph_ = function() {
 };
 
 /**
+ * @private
  * Determine properties of the y-axes which are independent of the data
  * currently being displayed. This includes things like the number of axes and
  * the style of the axes. It does not include the range of each axis and its
@@ -2730,6 +2932,7 @@ Dygraph.prototype.numAxes = function() {
 };
 
 /**
+ * @private
  * Determine the value range and tick marks for each axis.
  * @param {Object} extremes A mapping from seriesName -> [low, high]
  * This fills in the valueRange and ticks fields in each entry of this.axes_.
@@ -2843,6 +3046,7 @@ Dygraph.prototype.computeYAxisRanges_ = function(extremes) {
 };
  
 /**
+ * @private
  * Calculates the rolling average of a data set.
  * If originalData is [label, val], rolls the average of those.
  * If originalData is [label, [, it's interpreted as [value, stddev]
@@ -2979,12 +3183,12 @@ Dygraph.prototype.rollingAverage = function(originalData, rollPeriod) {
 };
 
 /**
+ * @private
  * Parses a date, returning the number of milliseconds since epoch. This can be
  * passed in as an xValueParser in the Dygraph constructor.
  * TODO(danvk): enumerate formats that this understands.
  * @param {String} A date in YYYYMMDD format.
  * @return {Number} Milliseconds since epoch.
- * @public
  */
 Dygraph.dateParser = function(dateStr, self) {
   var dateStrSlashed;
@@ -3078,15 +3282,15 @@ Dygraph.prototype.parseFloat_ = function(x, opt_line_no, opt_line) {
 };
 
 /**
+ * @private
  * Parses a string in a special csv format.  We expect a csv file where each
  * line is a date point, and the first field in each line is the date string.
  * We also expect that all remaining fields represent series.
  * if the errorBars attribute is set, then interpret the fields as:
  * date, series1, stddev1, series2, stddev2, ...
- * @param {Array.<Object>} data See above.
- * @private
+ * @param {[Object]} data See above.
  *
- * @return Array.<Object> An array with one entry for each row. These entries
+ * @return [Object] An array with one entry for each row. These entries
  * are an array of cells in that row. The first entry is the parsed x-value for
  * the row. The second, third, etc. are the y-values. These can take on one of
  * three forms, depending on the CSV and constructor parameters:
@@ -3220,11 +3424,12 @@ Dygraph.prototype.parseCSV_ = function(data) {
 };
 
 /**
+ * @private
  * The user has provided their data as a pre-packaged JS array. If the x values
  * are numeric, this is the same as dygraphs' internal format. If the x values
  * are dates, we need to convert them from Date objects to ms since epoch.
- * @param {Array.<Object>} data
- * @return {Array.<Object>} data with numeric x values.
+ * @param {[Object]} data
+ * @return {[Object]} data with numeric x values.
  */
 Dygraph.prototype.parseArray_ = function(data) {
   // Peek at the first x value to see if it's numeric.
@@ -3282,7 +3487,7 @@ Dygraph.prototype.parseArray_ = function(data) {
  * number. All subsequent columns must be numbers. If there is a clear mismatch
  * between this.xValueParser_ and the type of the first column, it will be
  * fixed. Fills out rawData_.
- * @param {Array.<Object>} data See above.
+ * @param {[Object]} data See above.
  * @private
  */
 Dygraph.prototype.parseDataTable_ = function(data) {
@@ -3402,14 +3607,22 @@ Dygraph.prototype.parseDataTable_ = function(data) {
   }
 }
 
-// This is identical to JavaScript's built-in Date.parse() method, except that
-// it doesn't get replaced with an incompatible method by aggressive JS
-// libraries like MooTools or Joomla.
+/**
+ * @private
+ * This is identical to JavaScript's built-in Date.parse() method, except that
+ * it doesn't get replaced with an incompatible method by aggressive JS
+ * libraries like MooTools or Joomla.
+ * @param { String } str The date string, e.g. "2011/05/06"
+ * @return { Integer } millis since epoch
+ */
 Dygraph.dateStrToMillis = function(str) {
   return new Date(str).getTime();
 };
 
 // These functions are all based on MochiKit.
+/**
+ * @private
+ */
 Dygraph.update = function (self, o) {
   if (typeof(o) != 'undefined' && o !== null) {
     for (var k in o) {
@@ -3421,6 +3634,9 @@ Dygraph.update = function (self, o) {
   return self;
 };
 
+/**
+ * @private
+ */
 Dygraph.isArrayLike = function (o) {
   var typ = typeof(o);
   if (
@@ -3435,6 +3651,9 @@ Dygraph.isArrayLike = function (o) {
   return true;
 };
 
+/**
+ * @private
+ */
 Dygraph.isDateLike = function (o) {
   if (typeof(o) != "object" || o === null ||
       typeof(o.getTime) != 'function') {
@@ -3443,6 +3662,9 @@ Dygraph.isDateLike = function (o) {
   return true;
 };
 
+/**
+ * @private
+ */
 Dygraph.clone = function(o) {
   // TODO(danvk): figure out how MochiKit's version works
   var r = [];
@@ -3551,8 +3773,8 @@ Dygraph.prototype.updateOptions = function(attrs) {
  * This is far more efficient than destroying and re-instantiating a
  * Dygraph, since it doesn't have to reparse the underlying data.
  *
- * @param {Number} width Width (in pixels)
- * @param {Number} height Height (in pixels)
+ * @param {Number} [width] Width (in pixels)
+ * @param {Number} [height] Height (in pixels)
  */
 Dygraph.prototype.resize = function(width, height) {
   if (this.resize_lock) {
@@ -3656,6 +3878,12 @@ Dygraph.prototype.indexFromSetName = function(name) {
   return null;
 };
 
+/**
+ * @private
+ * Adds a default style for the annotation CSS classes to the document. This is
+ * only executed when annotations are actually used. It is designed to only be
+ * called once -- all calls after the first will return immediately.
+ */
 Dygraph.addAnnotationRule = function() {
   if (Dygraph.addedAnnotationCSS) return;
 
@@ -3692,6 +3920,7 @@ Dygraph.addAnnotationRule = function() {
 }
 
 /**
+ * @private
  * Create a new canvas element. This is more complex than a simple
  * document.createElement("canvas") because of IE and excanvas.
  */
diff --git a/jsdoc-toolkit/README.txt b/jsdoc-toolkit/README.txt
new file mode 100644 (file)
index 0000000..3782da8
--- /dev/null
@@ -0,0 +1,183 @@
+======================================================================
+
+DESCRIPTION:
+
+This is the source code for JsDoc Toolkit, an automatic documentation
+generation tool for JavaScript. It is written in JavaScript and is run
+from a command line (or terminal) using Java and Mozilla's Rhino
+JavaScript runtime engine.
+
+Using this tool you can automatically turn JavaDoc-like comments in
+your JavaScript source code into published output files, such as HTML
+or XML.
+
+For more information, to report a bug, or to browse the technical
+documentation for this tool please visit the official JsDoc Toolkit
+project homepage at http://code.google.com/p/jsdoc-toolkit/
+
+For the most up-to-date documentation on JsDoc Toolkit see the 
+official wiki at http://code.google.com/p/jsdoc-toolkit/w/list
+
+======================================================================
+
+REQUIREMENTS:
+
+JsDoc Toolkit is known to work with:
+java version "1.6.0_03"
+Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
+on Windows XP,
+and java version "1.5.0_19"
+Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-304)
+on Mac OS X 10.5.
+
+Other versions of java may or may not work with JsDoc Toolkit.
+
+======================================================================
+
+USAGE:
+
+Running JsDoc Toolkit requires you to have Java installed on your
+computer. For more information see http://www.java.com/getjava/
+
+Before running the JsDoc Toolkit app you should change your current
+working directory to the jsdoc-toolkit folder. Then follow the
+examples below, or as shown on the project wiki.
+
+On a computer running Windows a valid command line to run JsDoc
+Toolkit might look like this:
+
+> java -jar jsrun.jar app\run.js -a -t=templates\jsdoc mycode.js
+
+On Mac OS X or Linux the same command would look like this:
+
+$ java -jar jsrun.jar app/run.js -a -t=templates/jsdoc mycode.js
+
+The above assumes your current working directory contains jsrun.jar,
+the "app" and "templates" subdirectories from the standard JsDoc
+Toolkit distribution and that the relative path to the code you wish
+to document is "mycode.js".
+
+The output documentation files will be saved to a new directory named
+"out" (by default) in the current directory, or if you specify a
+-d=somewhere_else option, to the somewhere_else directory.
+
+For help (usage notes) enter this on the command line:
+
+$ java -jar jsrun.jar app/run.js --help
+
+More information about the various command line options used by JsDoc
+Toolkit are available on the project wiki.
+
+======================================================================
+
+RUNNING VIA SHELL SCRIPT
+
+Avi Deitcher has contributed the file jsrun.sh with the following usage notes:
+
+A script to simplify running jsdoc from the command-line, especially when
+running from within a development or build environment such as ant.
+
+Normally, to run jsdoc, you need a command-line as the following:
+java -Djsdoc.dir=/some/long/dir/path/to/jsdoc -jar
+/some/long/dir/path/to/jsdoc/jsrun.jar /some/long/dir/path/to/jsdoc/app/run.js
+-t=template -r=4 /some/long/dir/path/to/my/src/code
+
+This can get tedious to redo time and again, and difficult to use from within a build environment.
+
+To simplify the process, jsrun.sh will automatically run this path, as well as passing through any arguments.
+
+Usage: jsrun.sh <run.js arguments>
+
+All <run.js arguments> will be passed through.
+Additionally, jsrun.sh will take the following actions:
+1) If the environment variable JSDOCDIR is set, it will add
+"-Djsdoc.dir=$JSDOCDIR" to the command-line
+2) If the environment variable JSDOCTEMPLATEDIR is set, it will add
+"-Djsdoc.template.dir=$JSDOCTEMPLATEDIR" to the command-line
+3) java with the appropriate path to jsrun.jar and run.js will be instantiated
+
+If not variables are set, it is assumed that the path to jsrun.jar and app/ is in the current working directory.
+
+Example:
+# jsrun.sh ./src/
+Assuming JSDOCDIR=/some/path/to/my/jsdoc will cause the following command to
+execute:
+java -Djsdoc.dir=/some/path/to/my/jsdoc -jar /some/path/to/my/jsdoc/jsrun.jar
+/some/path/to/my/jsdoc/app/run.js ./src/
+
+======================================================================
+
+TESTING:
+
+To run the suite of unit tests included with JsDoc Toolkit enter this
+on the command line:
+
+$ java -jar jsrun.jar app/run.js -T
+
+To see a dump of the internal data structure that JsDoc Toolkit has
+built from your source files use this command:
+
+$ java -jar jsrun.jar app/run.js mycode.js -Z
+
+======================================================================
+
+LICENSE:
+
+JSDoc.pm
+
+This project is based on the JSDoc.pm tool, created by Michael
+Mathews and Gabriel Reid. More information on JsDoc.pm can
+be found on the JSDoc.pm homepage: http://jsdoc.sourceforge.net/
+
+Complete documentation on JsDoc Toolkit can be found on the project
+wiki at http://code.google.com/p/jsdoc-toolkit/w/list
+
+Rhino
+
+Rhino (JavaScript in Java) is open source and licensed by Mozilla
+under the MPL 1.1 or later/GPL 2.0 or later licenses, the text of
+which is available at http://www.mozilla.org/MPL/
+
+You can obtain the source code for Rhino from the Mozilla web site at
+http://www.mozilla.org/rhino/download.html
+
+JsDoc Toolkit is a larger work that uses the Rhino JavaScript engine
+but is not derived from it in any way. The Rhino library is used 
+without modification and without any claims whatsoever.
+
+The Rhino Debugger
+
+You can obtain more information about the Rhino Debugger from the 
+Mozilla web site at http://www.mozilla.org/rhino/debugger.html
+
+JsDoc Toolkit is a larger work that uses the Rhino Debugger but
+is not derived from it in any way. The Rhino Debugger is used
+without modification and without any claims whatsoever.
+
+JsDoc Toolkit
+
+All code specific to JsDoc Toolkit are free, open source and licensed
+for use under the X11/MIT License.
+
+JsDoc Toolkit is Copyright (c)2009 Michael Mathews <micmath@gmail.com>
+
+This program is free software; you can redistribute it and/or
+modify it under the terms below.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions: The above copyright notice and this
+permission notice must be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/jsdoc-toolkit/app/frame.js b/jsdoc-toolkit/app/frame.js
new file mode 100644 (file)
index 0000000..1beb405
--- /dev/null
@@ -0,0 +1,33 @@
+IO.include("frame/Opt.js");
+IO.include("frame/Chain.js");
+IO.include("frame/Link.js");
+IO.include("frame/String.js");
+IO.include("frame/Hash.js");
+IO.include("frame/Namespace.js");
+//IO.include("frame/Reflection.js");
+
+/** A few helper functions to make life a little easier. */
+
+function defined(o) {
+       return (o !== undefined);
+}
+
+function copy(o) { // todo check for circular refs
+       if (o == null || typeof(o) != 'object') return o;
+       var c = new o.constructor();
+       for(var p in o) c[p] = copy(o[p]);
+       return c;
+}
+
+function isUnique(arr) {
+       var l = arr.length;
+       for(var i = 0; i < l; i++ ) {
+               if (arr.lastIndexOf(arr[i]) > i) return false;
+       }
+       return true;
+}
+
+/** Returns the given string with all regex meta characters backslashed. */
+RegExp.escapeMeta = function(str) {
+       return str.replace(/([$^\\\/()|?+*\[\]{}.-])/g, "\\$1");
+}
diff --git a/jsdoc-toolkit/app/frame/Chain.js b/jsdoc-toolkit/app/frame/Chain.js
new file mode 100644 (file)
index 0000000..506469d
--- /dev/null
@@ -0,0 +1,102 @@
+/**@constructor*/
+function ChainNode(object, link) {
+       this.value = object;
+       this.link = link; // describes this node's relationship to the previous node
+}
+
+/**@constructor*/
+function Chain(valueLinks) {
+       this.nodes = [];
+       this.cursor = -1;
+       
+       if (valueLinks && valueLinks.length > 0) {
+               this.push(valueLinks[0], "//");
+               for (var i = 1, l = valueLinks.length; i < l; i+=2) {
+                       this.push(valueLinks[i+1], valueLinks[i]);
+               }
+       }
+}
+
+Chain.prototype.push = function(o, link) {
+       if (this.nodes.length > 0 && link) this.nodes.push(new ChainNode(o, link));
+       else this.nodes.push(new ChainNode(o));
+}
+
+Chain.prototype.unshift = function(o, link) {
+       if (this.nodes.length > 0 && link) this.nodes[0].link = link;
+       this.nodes.unshift(new ChainNode(o));
+       this.cursor++;
+}
+
+Chain.prototype.get = function() {
+       if (this.cursor < 0 || this.cursor > this.nodes.length-1) return null;
+       return this.nodes[this.cursor];
+}
+
+Chain.prototype.first = function() {
+       this.cursor = 0;
+       return this.get();
+}
+
+Chain.prototype.last = function() {
+       this.cursor = this.nodes.length-1;
+       return this.get();
+}
+
+Chain.prototype.next = function() {
+       this.cursor++;
+       return this.get();
+}
+
+Chain.prototype.prev = function() {
+       this.cursor--;
+       return this.get();
+}
+
+Chain.prototype.toString = function() {
+       var string = "";
+       for (var i = 0, l = this.nodes.length; i < l; i++) {
+               if (this.nodes[i].link) string += " -("+this.nodes[i].link+")-> ";
+               string += this.nodes[i].value.toString();
+       }
+       return string;
+}
+
+Chain.prototype.joinLeft = function() {
+       var result = "";
+       for (var i = 0, l = this.cursor; i < l; i++) {
+               if (result && this.nodes[i].link) result += this.nodes[i].link;
+               result += this.nodes[i].value.toString();
+       }
+       return result;
+}
+
+
+/* USAGE:
+
+var path = "one/two/three.four/five-six";
+var pathChain = new Chain(path.split(/([\/.-])/));
+print(pathChain);
+
+var lineage = new Chain();
+lineage.push("Port");
+lineage.push("Les", "son");
+lineage.push("Dawn", "daughter");
+lineage.unshift("Purdie", "son");
+
+print(lineage);
+
+// walk left
+for (var node = lineage.last(); node !== null; node = lineage.prev()) {
+       print("< "+node.value);
+}
+
+// walk right
+var node = lineage.first()
+while (node !== null) {
+       print(node.value);
+       node = lineage.next();
+       if (node && node.link) print("had a "+node.link+" named");
+}
+
+*/
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/frame/Dumper.js b/jsdoc-toolkit/app/frame/Dumper.js
new file mode 100644 (file)
index 0000000..d8b007b
--- /dev/null
@@ -0,0 +1,144 @@
+/**
+ * @class
+<pre>
+This is a lightly modified version of Kevin Jones' JavaScript
+library Data.Dump. To download the original visit:
+    <a href="http://openjsan.org/doc/k/ke/kevinj/Data/Dump/">http://openjsan.org/doc/k/ke/kevinj/Data/Dump/</a>
+
+AUTHORS
+
+The Data.Dump JavaScript module is written by Kevin Jones 
+(kevinj@cpan.org), based on Data::Dump by Gisle Aas (gisle@aas.no),
+based on Data::Dumper by Gurusamy Sarathy (gsar@umich.edu).
+
+COPYRIGHT
+
+Copyright 2007 Kevin Jones. Copyright 1998-2000,2003-2004 Gisle Aas.
+Copyright 1996-1998 Gurusamy Sarathy.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the Perl Artistic License
+
+See http://www.perl.com/perl/misc/Artistic.html
+</pre>
+ * @static
+ */
+Dumper = {
+       /** @param [...] The objects to dump. */
+       dump: function () {
+           if (arguments.length > 1)
+               return this._dump(arguments);
+           else if (arguments.length == 1)
+               return this._dump(arguments[0]);
+           else
+               return "()";
+       },
+       
+       _dump: function (obj) {
+               if (typeof obj == 'undefined') return 'undefined';
+               var out;
+               if (obj.serialize) { return obj.serialize(); }
+               var type = this._typeof(obj);
+               if (obj.circularReference) obj.circularReference++;
+               switch (type) {
+                       case 'circular':
+                               out = "{ //circularReference\n}";
+                               break;
+                       case 'object':
+                               var pairs = new Array;
+                               
+                               for (var prop in obj) {
+                                       if (prop != "circularReference" && obj.hasOwnProperty(prop)) { //hide inherited properties
+                                               pairs.push(prop + ': ' + this._dump(obj[prop]));
+                                       }
+                               }
+       
+                               out = '{' + this._format_list(pairs) + '}';
+                               break;
+       
+                       case 'string':
+                               for (var prop in Dumper.ESC) {
+                                       if (Dumper.ESC.hasOwnProperty(prop)) {
+                                               obj = obj.replace(prop, Dumper.ESC[prop]);
+                                       }
+                               }
+       
+                       // Escape UTF-8 Strings
+                               if (obj.match(/^[\x00-\x7f]*$/)) {
+                                       out = '"' + obj.replace(/\"/g, "\\\"").replace(/([\n\r]+)/g, "\\$1") + '"';
+                               }
+                               else {
+                                       out = "unescape('"+escape(obj)+"')";
+                               }
+                               break;
+       
+                       case 'array':
+                               var elems = new Array;
+       
+                               for (var i=0; i<obj.length; i++) {
+                                       elems.push( this._dump(obj[i]) );
+                               }
+       
+                               out = '[' + this._format_list(elems) + ']';
+                               break;
+       
+                       case 'date':
+                       // firefox returns GMT strings from toUTCString()...
+                       var utc_string = obj.toUTCString().replace(/GMT/,'UTC');
+                               out = 'new Date("' + utc_string + '")';
+                               break;
+       
+                       case 'element':
+                               // DOM element
+                               out = this._dump_dom(obj);
+                               break;
+               
+                               default:
+                                       out = obj;
+               }
+       
+               out = String(out).replace(/\n/g, '\n    ');
+               out = out.replace(/\n    (.*)$/,"\n$1");
+       
+               return out;
+       },
+       
+       _format_list: function (list) {
+               if (!list.length) return '';
+               var nl = list.toString().length > 60 ? '\n' : ' ';
+               return nl + list.join(',' + nl) + nl;
+    },
+    
+    _typeof: function (obj) {
+       if (obj && obj.circularReference && obj.circularReference > 1) return 'circular';
+               if (Array.prototype.isPrototypeOf(obj)) return 'array';
+               if (Date.prototype.isPrototypeOf(obj)) return 'date';
+               if (typeof obj.nodeType != 'undefined') return 'element';
+               return typeof(obj);
+       },
+       
+       _dump_dom: function (obj) {
+               return '"' + Dumper.nodeTypes[obj.nodeType] + '"';
+       }
+};
+
+Dumper.ESC = {
+    "\t": "\\t",
+    "\n": "\\n",
+    "\f": "\\f"
+};
+
+Dumper.nodeTypes = {
+    1: "ELEMENT_NODE",
+    2: "ATTRIBUTE_NODE",
+    3: "TEXT_NODE",
+    4: "CDATA_SECTION_NODE",
+    5: "ENTITY_REFERENCE_NODE",
+    6: "ENTITY_NODE",
+    7: "PROCESSING_INSTRUCTION_NODE",
+    8: "COMMENT_NODE",
+    9: "DOCUMENT_NODE",
+    10: "DOCUMENT_TYPE_NODE",
+    11: "DOCUMENT_FRAGMENT_NODE",
+    12: "NOTATION_NODE"
+};
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/frame/Hash.js b/jsdoc-toolkit/app/frame/Hash.js
new file mode 100644 (file)
index 0000000..62cfad6
--- /dev/null
@@ -0,0 +1,84 @@
+/**
+       @constructor
+       @example
+       var _index = new Hash();
+       _index.set("a", "apple");
+       _index.set("b", "blue");
+       _index.set("c", "coffee");
+
+       for (var p = _index.first(); p; p = _index.next()) {
+               print(p.key+" is for "+p.value);
+       }
+       
+ */
+var Hash = function() {
+       this._map = {};
+       this._keys = [];
+       this._vals = [];
+       this.reset();
+}
+
+Hash.prototype.set = function(k, v) {
+       if (k != "") {
+               this._keys.push(k);
+               this._map["="+k] = this._vals.length;
+               this._vals.push(v);
+       }
+}
+
+Hash.prototype.replace = function(k, k2, v) {
+       if (k == k2) return;
+
+       var offset = this._map["="+k];
+       this._keys[offset] = k2;
+       if (typeof v != "undefined") this._vals[offset] = v;
+       this._map["="+k2] = offset;
+       delete(this._map["="+k]);
+}
+
+Hash.prototype.drop = function(k) {
+       if (k != "") {
+               var offset = this._map["="+k];
+               this._keys.splice(offset, 1);
+               this._vals.splice(offset, 1);
+               delete(this._map["="+k]);
+               for (var p in this._map) {
+                       if (this._map[p] >= offset) this._map[p]--;
+               }
+               if (this._cursor >= offset && this._cursor > 0) this._cursor--;
+       }
+}
+
+Hash.prototype.get = function(k) {
+       if (k != "") {
+               return this._vals[this._map["="+k]];
+       }
+}
+
+Hash.prototype.keys = function() {
+       return this._keys;
+}
+
+Hash.prototype.hasKey = function(k) {
+       if (k != "") {
+               return (typeof this._map["="+k] != "undefined");
+       }
+}
+
+Hash.prototype.values = function() {
+       return this._vals;
+}
+
+Hash.prototype.reset = function() {
+       this._cursor = 0;
+}
+
+Hash.prototype.first = function() {
+       this.reset();
+       return this.next();
+}
+
+Hash.prototype.next = function() {
+       if (this._cursor++ < this._keys.length)
+               return {key: this._keys[this._cursor-1], value: this._vals[this._cursor-1]};
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/frame/Link.js b/jsdoc-toolkit/app/frame/Link.js
new file mode 100644 (file)
index 0000000..1e6241b
--- /dev/null
@@ -0,0 +1,173 @@
+/** Handle the creation of HTML links to documented symbols.
+       @constructor
+*/
+function Link() {
+       this.alias = "";
+       this.src = "";
+       this.file = "";
+       this.text = "";
+       this.innerName = "";
+       this.classLink = false;
+       this.targetName = "";
+       
+       this.target = function(targetName) {
+               if (defined(targetName)) this.targetName = targetName;
+               return this;
+       }
+       this.inner = function(inner) {
+               if (defined(inner)) this.innerName = inner;
+               return this;
+       }
+       this.withText = function(text) {
+               if (defined(text)) this.text = text;
+               return this;
+       }
+       this.toSrc = function(filename) {
+               if (defined(filename)) this.src = filename;
+               return this;
+       }
+       this.toSymbol = function(alias) {
+               if (defined(alias)) this.alias = new String(alias);
+               return this;
+       }
+       this.toClass = function(alias) {
+               this.classLink = true;
+               return this.toSymbol(alias);
+       }
+       this.toFile = function(file) {
+               if (defined(file)) this.file = file;
+               return this;
+       }
+       
+       this.toString = function() {
+               var linkString;
+               var thisLink = this;
+
+               if (this.alias) {
+                       linkString = this.alias.replace(/(^|[^a-z$0-9_#.:^-])([|a-z$0-9_#.:^-]+)($|[^a-z$0-9_#.:^-])/i,
+                               function(match, prematch, symbolName, postmatch) {
+                                       var symbolNames = symbolName.split("|");
+                                       var links = [];
+                                       for (var i = 0, l = symbolNames.length; i < l; i++) {
+                                               thisLink.alias = symbolNames[i];
+                                               links.push(thisLink._makeSymbolLink(symbolNames[i]));
+                                       }
+                                       return prematch+links.join("|")+postmatch;
+                               }
+                       );
+               }
+               else if (this.src) {
+                       linkString = thisLink._makeSrcLink(this.src);
+               }
+               else if (this.file) {
+                       linkString = thisLink._makeFileLink(this.file);
+               }
+
+               return linkString;
+       }
+}
+
+/** prefixed for hashes */
+Link.hashPrefix = "";
+
+/** Appended to the front of relative link paths. */
+Link.base = "";
+
+Link.symbolNameToLinkName = function(symbol) {
+       var linker = "",
+               ns = "";
+       
+       if (symbol.isStatic) linker = ".";
+       else if (symbol.isInner) linker = "-";
+       
+       if (symbol.isEvent && !/^event:/.test(symbol.name)) {
+               ns = "event:";
+       }
+       return Link.hashPrefix+linker+ns+symbol.name;
+}
+
+Link.getSymbol= function(alias) {
+    var symbol= Link.symbolSet.getSymbol(alias);
+    
+    if (symbol)
+        return symbol;
+        
+    if ('#'!==alias.charAt(0) || !Link.currentSymbol)
+        return null;
+    
+    //  resolve relative name
+    var container= Link.currentSymbol;
+    
+    while (container)
+    {
+        symbol= Link.symbolSet.getSymbol(container.alias + alias);
+        if (symbol)
+            return symbol;
+        
+        //  No superclass
+        if (!container.augments.length)
+            return null;
+        
+        container= Link.symbolSet.getSymbol(container.augments[0].desc);
+    }
+    
+    return null;
+}
+
+/** Create a link to another symbol. */
+Link.prototype._makeSymbolLink = function(alias) {
+       var linkBase = Link.base+publish.conf.symbolsDir;
+       var linkTo = Link.getSymbol(alias);
+       var linkPath;
+       var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
+
+       // if there is no symbol by that name just return the name unaltered
+       if (!linkTo)
+           return this.text || alias;
+       
+       // it's a symbol in another file
+       else {
+               if (!linkTo.is("CONSTRUCTOR") && !linkTo.isNamespace) { // it's a method or property
+                       linkPath= (Link.filemap) ? Link.filemap[linkTo.memberOf] :
+                                     escape(linkTo.memberOf) || "_global_";
+                               linkPath += publish.conf.ext + "#" + Link.symbolNameToLinkName(linkTo);
+               }
+               else {
+                       linkPath = (Link.filemap)? Link.filemap[linkTo.alias] : escape(linkTo.alias);
+                       linkPath += publish.conf.ext;// + (this.classLink? "":"#" + Link.hashPrefix + "constructor");
+               }
+               linkPath = linkBase + linkPath
+       }
+        
+       var linkText= this.text || alias;
+    
+       var link = {linkPath: linkPath, linkText: linkText, linkInner: (this.innerName? "#"+this.innerName : "")};
+       
+       if (typeof JSDOC.PluginManager != "undefined") {
+               JSDOC.PluginManager.run("onSymbolLink", link);
+       }
+       
+       return "<a href=\""+link.linkPath+link.linkInner+"\""+target+">"+link.linkText+"</a>";
+}
+
+/** Create a link to a source file. */
+Link.prototype._makeSrcLink = function(srcFilePath) {
+       var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
+               
+       // transform filepath into a filename
+       var srcFile = srcFilePath.replace(/\.\.?[\\\/]/g, "").replace(/[:\\\/]/g, "_");
+       var outFilePath = Link.base + publish.conf.srcDir + srcFile + publish.conf.ext;
+
+       if (!this.text) this.text = FilePath.fileName(srcFilePath);
+       return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>";
+}
+
+/** Create a link to a source file. */
+Link.prototype._makeFileLink = function(filePath) {
+       var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
+               
+       var outFilePath =  Link.base + filePath;
+
+       if (!this.text) this.text = filePath;
+       return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>";
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/frame/Namespace.js b/jsdoc-toolkit/app/frame/Namespace.js
new file mode 100644 (file)
index 0000000..fa1e41d
--- /dev/null
@@ -0,0 +1,10 @@
+_global_ = this;
+
+function Namespace(name, f) {
+       var n = name.split(".");
+       for (var o = _global_, i = 0, l = n.length; i < l; i++) {
+               o = o[n[i]] = o[n[i]] || {};
+       }
+       
+       if (f) f();
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/frame/Opt.js b/jsdoc-toolkit/app/frame/Opt.js
new file mode 100644 (file)
index 0000000..352f159
--- /dev/null
@@ -0,0 +1,134 @@
+/** @namespace */
+Opt = {
+       /**
+        * Get commandline option values.
+        * @param {Array} args Commandline arguments. Like ["-a=xml", "-b", "--class=new", "--debug"]
+        * @param {object} optNames Map short names to long names. Like {a:"accept", b:"backtrace", c:"class", d:"debug"}.
+        * @return {object} Short names and values. Like {a:"xml", b:true, c:"new", d:true}
+        */
+       get: function(args, optNames) {
+               var opt = {"_": []}; // the unnamed option allows multiple values
+               for (var i = 0; i < args.length; i++) {
+                       var arg = new String(args[i]);
+                       var name;
+                       var value;
+                       if (arg.charAt(0) == "-") {
+                               if (arg.charAt(1) == "-") { // it's a longname like --foo
+                                       arg = arg.substring(2);
+                                       var m = arg.split("=");
+                                       name = m.shift();
+                                       value = m.shift();
+                                       if (typeof value == "undefined") value = true;
+                                       
+                                       for (var n in optNames) { // convert it to a shortname
+                                               if (name == optNames[n]) {
+                                                       name = n;
+                                               }
+                                       }
+                               }
+                               else { // it's a shortname like -f
+                                       arg = arg.substring(1);
+                                       var m = arg.split("=");
+                                       name = m.shift();
+                                       value = m.shift();
+                                       if (typeof value == "undefined") value = true;
+                                       
+                                       for (var n in optNames) { // find the matching key
+                                               if (name == n || name+'[]' == n) {
+                                                       name = n;
+                                                       break;
+                                               }
+                                       }
+                               }
+                               if (name.match(/(.+)\[\]$/)) { // it's an array type like n[]
+                                       name = RegExp.$1;
+                                       if (!opt[name]) opt[name] = [];
+                               }
+                               
+                               if (opt[name] && opt[name].push) {
+                                       opt[name].push(value);
+                               }
+                               else {
+                                       opt[name] = value;
+                               }
+                       }
+                       else { // not associated with any optname
+                               opt._.push(args[i]);
+                       }
+               }
+               return opt;
+       }
+}
+
+/*t:
+       plan(11, "Testing Opt.");
+       
+       is(
+               typeof Opt,
+               "object",
+               "Opt is an object."
+       );
+       
+       is(
+               typeof Opt.get,
+               "function",
+               "Opt.get is a function."
+       );
+       
+       var optNames = {a:"accept", b:"backtrace", c:"class", d:"debug", "e[]":"exceptions"};
+       var t_options = Opt.get(["-a=xml", "-b", "--class=new", "--debug", "-e=one", "-e=two", "foo", "bar"], optNames);
+       
+       is(
+               t_options.a,
+               "xml",
+               "an option defined with a short name can be accessed by its short name."
+       );
+       
+       is(
+               t_options.b,
+               true,
+               "an option defined with a short name and no value are true."
+       );
+       
+       is(
+               t_options.c,
+               "new",
+               "an option defined with a long name can be accessed by its short name."
+       );
+       
+       is(
+               t_options.d,
+               true,
+               "an option defined with a long name and no value are true."
+       );
+       
+       is(
+               typeof t_options.e,
+               "object",
+               "an option that can accept multiple values is defined."
+       );
+       
+       is(
+               t_options.e.length,
+               2,
+               "an option that can accept multiple values can have more than one value."
+       );
+       
+       is(
+               t_options.e[1],
+               "two",
+               "an option that can accept multiple values can be accessed as an array."
+       );
+       
+       is(
+               typeof t_options._,
+               "object",
+               "the property '_' is defined for unnamed options."
+       );
+       
+       is(
+               t_options._[0],
+               "foo",
+               "the property '_' can be accessed as an array."
+       );
+ */
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/frame/Reflection.js b/jsdoc-toolkit/app/frame/Reflection.js
new file mode 100644 (file)
index 0000000..0968f1c
--- /dev/null
@@ -0,0 +1,26 @@
+/**@constructor*/
+function Reflection(obj) {
+       this.obj = obj;
+}
+
+Reflection.prototype.getConstructorName = function() {
+       if (this.obj.constructor.name) return this.obj.constructor.name;
+       var src = this.obj.constructor.toSource();
+       var name = src.substring(name.indexOf("function")+8, src.indexOf('(')).replace(/ /g,'');
+       return name;
+}
+
+Reflection.prototype.getMethod = function(name) {
+       for (var p in this.obj) {
+               if (p == name && typeof(this.obj[p]) == "function") return this.obj[p];
+       }
+       return null;
+}
+
+Reflection.prototype.getParameterNames = function() {
+       var src = this.obj.toSource();
+       src = src.substring(
+               src.indexOf("(", 8)+1, src.indexOf(")")
+       );
+       return src.split(/, ?/);
+}
diff --git a/jsdoc-toolkit/app/frame/String.js b/jsdoc-toolkit/app/frame/String.js
new file mode 100644 (file)
index 0000000..c183c27
--- /dev/null
@@ -0,0 +1,93 @@
+/**
+       @name String
+       @class Additions to the core string object.
+*/
+
+/** @author Steven Levithan, released as public domain. */
+String.prototype.trim = function() {
+       var str = this.replace(/^\s+/, '');
+       for (var i = str.length - 1; i >= 0; i--) {
+               if (/\S/.test(str.charAt(i))) {
+                       str = str.substring(0, i + 1);
+                       break;
+               }
+       }
+       return str;
+}
+/*t:
+       plan(6, "Testing String.prototype.trim.");
+       
+       var s = "   a bc   ".trim();
+       is(s, "a bc", "multiple spaces front and back are trimmed.");
+
+       s = "a bc\n\n".trim();
+       is(s, "a bc", "newlines only in back are trimmed.");
+       
+       s = "\ta bc".trim();
+       is(s, "a bc", "tabs only in front are trimmed.");
+       
+       s = "\n \t".trim();
+       is(s, "", "an all-space string is trimmed to empty.");
+       
+       s = "a b\nc".trim();
+       is(s, "a b\nc", "a string with no spaces in front or back is trimmed to itself.");
+       
+       s = "".trim();
+       is(s, "", "an empty string is trimmed to empty.");
+
+*/
+
+String.prototype.balance = function(open, close) {
+       var i = 0;
+       while (this.charAt(i) != open) {
+               if (i == this.length) return [-1, -1];
+               i++;
+       }
+       
+       var j = i+1;
+       var balance = 1;
+       while (j < this.length) {
+               if (this.charAt(j) == open) balance++;
+               if (this.charAt(j) == close) balance--;
+               if (balance == 0) break;
+               j++;
+               if (j == this.length) return [-1, -1];
+       }
+       
+       return [i, j];
+}
+/*t:
+       plan(16, "Testing String.prototype.balance.");
+       
+       var s = "{abc}".balance("{","}");
+       is(s[0], 0, "opener in first is found.");
+       is(s[1], 4, "closer in last is found.");
+       
+       s = "ab{c}de".balance("{","}");
+       is(s[0], 2, "opener in middle is found.");
+       is(s[1], 4, "closer in middle is found.");
+       
+       s = "a{b{c}de}f".balance("{","}");
+       is(s[0], 1, "nested opener is found.");
+       is(s[1], 8, "nested closer is found.");
+       
+       s = "{}".balance("{","}");
+       is(s[0], 0, "opener with no content is found.");
+       is(s[1], 1, "closer with no content is found.");
+       
+       s = "".balance("{","}");
+       is(s[0], -1, "empty string opener is -1.");
+       is(s[1], -1, "empty string closer is -1.");
+       
+       s = "{abc".balance("{","}");
+       is(s[0], -1, "opener with no closer returns -1.");
+       is(s[1], -1, "no closer returns -1.");
+       
+       s = "abc".balance("{","}");
+       is(s[0], -1, "no opener or closer returns -1 for opener.");
+       is(s[1], -1, "no opener or closer returns -1 for closer.");
+       
+       s = "a<bc}de".balance("<","}");
+       is(s[0], 1, "unmatching opener is found.");
+       is(s[1], 4, "unmatching closer is found.");
+*/
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/frame/Testrun.js b/jsdoc-toolkit/app/frame/Testrun.js
new file mode 100644 (file)
index 0000000..a33bb41
--- /dev/null
@@ -0,0 +1,129 @@
+/**
+ * @fileOverview
+ * @name JsTestrun
+ * @author Michael Mathews micmath@gmail.com
+ * @url $HeadURL: https://jsdoc-toolkit.googlecode.com/svn/tags/jsdoc_toolkit-2.4.0/jsdoc-toolkit/app/frame/Testrun.js $
+ * @revision $Id: Testrun.js 418 2008-01-15 21:40:33Z micmath $
+ * @license <a href="http://en.wikipedia.org/wiki/MIT_License">X11/MIT License</a>
+ *          (See the accompanying README file for full details.)
+ */
+/**
+       Yet another unit testing tool for JavaScript.
+       @author Michael Mathews <a href="mailto:micmath@gmail.com">micmath@gmail.com</a>
+       @param {object} testCases Properties are testcase names, values are functions to execute as tests.
+*/
+function testrun(testCases) {
+       var ran = 0;
+       for (t in testCases) {
+               var result = testCases[t]();
+               ran++;
+       }
+       
+       return testrun.reportOut+"-------------------------------\n"+((testrun.fails>0)? ":( Failed "+testrun.fails+"/" : ":) Passed all ")+testrun.count+" test"+((testrun.count == 1)? "":"s")+".\n";
+}
+
+
+testrun.count = 0;
+testrun.current = null;
+testrun.passes = 0;
+testrun.fails = 0;
+testrun.reportOut = "";
+
+/** @private */
+testrun.report = function(text) {
+       testrun.reportOut += text+"\n";
+}
+
+/**
+       Check if test evaluates to true.
+       @param {string} test To be evaluated.
+       @param {string} message Optional. To be displayed in the report.
+       @return {boolean} True if the string test evaluates to true.
+*/
+ok = function(test, message) {
+       testrun.count++;
+       
+       var result;
+       try {
+               result = eval(test);
+               
+               if (result) {
+                       testrun.passes++;
+                       testrun.report("    OK "+testrun.count+" - "+((message != null)? message : ""));
+               }
+               else {
+                       testrun.fails++;
+                       testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
+               }
+       }
+       catch(e) {
+               testrun.fails++
+               testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
+
+       }
+}
+
+/**
+       Check if test is same as expected.
+       @param {string} test To be evaluated.
+       @param {string} expected
+       @param {string} message Optional. To be displayed in the report. 
+       @return {boolean} True if (test == expected). Note that the comparison is not a strict equality check.
+*/
+is = function(test, expected, message) {
+       testrun.count++;
+       
+       var result;
+       try {
+               result = eval(test);
+               
+               if (result == expected) {
+                       testrun.passes++
+                       testrun.report("    OK "+testrun.count+" - "+((message != null)? message : ""));
+               }
+               else {
+                       testrun.fails++
+                       testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
+                       testrun.report("expected: "+expected);
+                       testrun.report("     got: "+result);
+               }
+       }
+       catch(e) {
+               testrun.fails++
+               testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
+               testrun.report("expected: "+expected);
+               testrun.report("     got: "+result);}
+}
+
+/**
+       Check if test matches pattern.
+       @param {string} test To be evaluated.
+       @param {string} pattern Used to create a RegExp.
+       @param {string} message Optional. To be displayed in the report.
+       @return {boolean} True if test matches pattern.
+*/
+like = function(test, pattern, message) {
+       testrun.count++;
+
+       var result;
+       try {
+               result = eval(test);
+               var rgx = new RegExp(pattern);
+               
+               if (rgx.test(result)) {
+                       testrun.passes++
+                       testrun.report("    OK "+testrun.count+" - "+((message != null)? message : ""));
+               }
+               else {
+                       testrun.fails++
+                       testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
+                       testrun.report("       this: "+result);
+                       testrun.report("is not like: "+pattern);
+               }
+       }
+       catch(e) {
+               testrun.fails++
+               testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
+       }
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/handlers/FOODOC.js b/jsdoc-toolkit/app/handlers/FOODOC.js
new file mode 100644 (file)
index 0000000..b208f55
--- /dev/null
@@ -0,0 +1,26 @@
+/**
+   This is the main container for the FOODOC handler.
+   @namespace
+*/
+FOODOC = {
+};
+
+/** The current version string of this application. */
+FOODOC.VERSION = "1.0";
+
+FOODOC.handle = function(srcFile, src) {
+       LOG.inform("Handling file '" + srcFile + "'");
+       
+       return [
+               new JSDOC.Symbol(
+                       "foo",
+                       [],
+                       "VIRTUAL",
+                       new JSDOC.DocComment("/** This is a foo. */")
+               )
+       ];
+};
+
+FOODOC.publish = function(symbolgroup) {
+       LOG.inform("Publishing symbolgroup.");
+};
diff --git a/jsdoc-toolkit/app/handlers/XMLDOC.js b/jsdoc-toolkit/app/handlers/XMLDOC.js
new file mode 100755 (executable)
index 0000000..40f87b3
--- /dev/null
@@ -0,0 +1,26 @@
+/**
+ * This is the main container for the XMLDOC handler.
+ * @namespace
+ * @author Brett Fattori (bfattori@fry.com)
+ * @version $Revision: 498 $
+ */
+XMLDOC = {
+       
+};
+
+/** The current version string of this application. */
+XMLDOC.VERSION = "1.0";
+
+/** Include the library necessary to handle XML files */
+IO.includeDir("handlers/XMLDOC/");
+
+/**
+ * @type Symbol[]
+ */
+XMLDOC.handle = function(srcFile, src) {
+       
+};
+
+XMLDOC.publish = function(symbolgroup) {
+       
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js b/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js
new file mode 100755 (executable)
index 0000000..240563d
--- /dev/null
@@ -0,0 +1,159 @@
+LOG.inform("XMLDOC.DomReader loaded");
+
+XMLDOC.DomReader = function(root) {
+
+   this.dom = root;
+
+   /**
+    * The current node the reader is on
+    */
+   this.node = root;
+
+   /**
+    * Get the current node the reader is on
+    * @type XMLDOC.Parser.node
+    */
+   XMLDOC.DomReader.prototype.getNode = function() {
+      return this.node;
+   };
+
+   /**
+    * Set the node the reader should be positioned on.
+    * @param node {XMLDOC.Parser.node}
+    */
+   XMLDOC.DomReader.prototype.setNode = function(node) {
+      this.node = node;
+   };
+
+   /**
+    * A helper method to make sure the current node will
+    * never return null, unless null is passed as the root.
+    * @param step {String} An expression to evaluate - should return a node or null
+    */
+   XMLDOC.DomReader.prototype.navigate = function(step) {
+      var n;
+      if ((n = step) != null)
+      {
+         this.node = n;
+         return this.node;
+      }
+      return null;
+   };
+
+   /**
+    * Get the root node of the current node's document.
+    */
+   XMLDOC.DomReader.prototype.root = function() {
+      this.navigate(this.dom);
+   };
+
+   /**
+    * Get the parent of the current node.
+    */
+   XMLDOC.DomReader.prototype.parent = function() {
+      return this.navigate(this.node.parentNode());
+   };
+
+   /**
+    * Get the first child of the current node.
+    */
+   XMLDOC.DomReader.prototype.firstChild = function() {
+      return this.navigate(this.node.firstChild());
+   };
+
+   /**
+    * Get the last child of the current node.
+    */
+   XMLDOC.DomReader.prototype.lastChild = function() {
+      return this.navigate(this.node.lastChild());
+   };
+
+   /**
+    * Get the next sibling of the current node.
+    */
+   XMLDOC.DomReader.prototype.nextSibling = function() {
+      return this.navigate(this.node.nextSibling());
+   };
+
+   /**
+    * Get the previous sibling of the current node.
+    */
+   XMLDOC.DomReader.prototype.prevSibling = function() {
+      return this.navigate(this.node.prevSibling());
+   };
+
+   //===============================================================================================
+   // Support methods
+
+   /**
+    * Walk the tree starting with the current node, calling the plug-in for
+    * each node visited.  Each time the plug-in is called, the DomReader
+    * is passed as the only parameter.  Use the {@link XMLDOC.DomReader#getNode} method
+    * to access the current node.   <i>This method uses a depth first traversal pattern.</i>
+    *
+    * @param srcFile {String} The source file being evaluated
+    */
+   XMLDOC.DomReader.prototype.getSymbols = function(srcFile)
+   {
+      XMLDOC.DomReader.symbols = [];
+      XMLDOC.DomReader.currentFile = srcFile;
+      JSDOC.Symbol.srcFile = (srcFile || "");
+
+      if (defined(JSDOC.PluginManager)) {
+         JSDOC.PluginManager.run("onDomGetSymbols", this);
+      }
+
+      return XMLDOC.DomReader.symbols;
+   };
+
+   /**
+    * Find the node with the given name using a depth first traversal.
+    * Does not modify the DomReader's current node.
+    *
+    * @param name {String} The name of the node to find
+    * @return the node that was found, or null if not found
+    */
+   XMLDOC.DomReader.prototype.findNode = function(name)
+   {
+      var findNode = null;
+
+      // Start at the current node and move into the subtree,
+      // looking for the node with the given name
+      function deeper(node, find)
+      {
+         var look = null;
+
+         if (node) {
+            if (node.name == find)
+            {
+               return node;
+            }
+
+            if (node.firstChild())
+            {
+               look = deeper(node.firstChild(), find);
+            }
+
+            if (!look && node.nextSibling())
+            {
+               look = deeper(node.nextSibling(), find);
+            }
+         }
+
+         return look;
+      }
+
+      return deeper(this.getNode().firstChild(), name);
+   };
+
+   /**
+    * Find the next node with the given name using a depth first traversal.
+    *
+    * @param name {String} The name of the node to find
+    */
+   XMLDOC.DomReader.prototype.findPreviousNode = function(name)
+   {
+   };
+
+};
+
diff --git a/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js b/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js
new file mode 100755 (executable)
index 0000000..e9b3e3c
--- /dev/null
@@ -0,0 +1,16 @@
+LOG.inform("XMLDOC.symbolize loaded");
+
+/**
+ * Convert the source file to a set of symbols
+ */
+XMLDOC.symbolize = function(srcFile, src) {
+
+   LOG.inform("Symbolizing file '" + srcFile + "'");
+
+   // XML files already have a defined structure, so we don't need to
+   // do anything but parse them.  The DOM reader can create a symbol
+   // table from the parsed XML.
+   var dr = new XMLDOC.DomReader(XMLDOC.Parser.parse(src));
+   return dr.getSymbols(srcFile);
+
+};
diff --git a/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js b/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js
new file mode 100755 (executable)
index 0000000..78e8f45
--- /dev/null
@@ -0,0 +1,292 @@
+LOG.inform("XMLDOC.Parser loaded");
+
+/**
+ * XML Parser object.  Returns an {@link #XMLDOC.Parser.node} which is
+ * the root element of the parsed document.
+ * <p/>
+ * By default, this parser will only handle well formed XML.  To
+ * allow the parser to handle HTML, set the <tt>XMLDOC.Parser.strictMode</tt>
+ * variable to <tt>false</tt> before calling <tt>XMLDOC.Parser.parse()</tt>.
+ * <p/>
+ * <i>Note: If you pass poorly formed XML, it will cause the parser to throw
+ * an exception.</i>
+ *
+ * @author Brett Fattori (bfattori@fry.com)
+ * @author $Author: micmath $
+ * @version $Revision: 497 $
+ */
+XMLDOC.Parser = {};
+
+/**
+ * Strict mode setting.  Setting this to false allows HTML-style source to
+ * be parsed.  Normally, well formed XML has defined end tags, or empty tags
+ * are properly formed.  Default: <tt>true</tt>
+ * @type Boolean
+ */
+XMLDOC.Parser.strictMode = true;
+
+/**
+ * A node in an XML Document.  Node types are ROOT, ELEMENT, COMMENT, PI, and TEXT.
+ * @param parent {XMLDOC.Parser.node} The parent node
+ * @param name {String} The node name
+ * @param type {String} One of the types
+ */
+XMLDOC.Parser.node = function(parent, name, type)
+{
+   this.name = name;
+   this.type = type || "ELEMENT";
+   this.parent = parent;
+   this.charData = "";
+   this.attrs = {};
+   this.nodes = [];
+   this.cPtr = 0;
+
+   XMLDOC.Parser.node.prototype.getAttributeNames = function() {
+      var a = [];
+      for (var o in this.attrs)
+      {
+         a.push(o);
+      }
+
+      return a;
+   };
+
+   XMLDOC.Parser.node.prototype.getAttribute = function(attr) {
+      return this.attrs[attr];
+   };
+
+   XMLDOC.Parser.node.prototype.setAttribute = function(attr, val) {
+      this.attrs[attr] = val;
+   };
+
+   XMLDOC.Parser.node.prototype.getChild = function(idx) {
+      return this.nodes[idx];
+   };
+
+   XMLDOC.Parser.node.prototype.parentNode = function() {
+      return this.parent;
+   };
+
+   XMLDOC.Parser.node.prototype.firstChild = function() {
+      return this.nodes[0];
+   };
+
+   XMLDOC.Parser.node.prototype.lastChild = function() {
+      return this.nodes[this.nodes.length - 1];
+   };
+
+   XMLDOC.Parser.node.prototype.nextSibling = function() {
+      var p = this.parent;
+      if (p && (p.nodes.indexOf(this) + 1 != p.nodes.length))
+      {
+         return p.getChild(p.nodes.indexOf(this) + 1);
+      }
+      return null;
+   };
+
+   XMLDOC.Parser.node.prototype.prevSibling = function() {
+      var p = this.parent;
+      if (p && (p.nodes.indexOf(this) - 1 >= 0))
+      {
+         return p.getChild(p.nodes.indexOf(this) - 1);
+      }
+      return null;
+   };
+};
+
+/**
+ * Parse an XML Document from the specified source.  The XML should be
+ * well formed, unless strict mode is disabled, then the parser will
+ * handle HTML-style XML documents.
+ * @param src {String} The source to parse
+ */
+XMLDOC.Parser.parse = function(src)
+{
+   var A = [];
+
+   // Normailize whitespace
+   A = src.split("\r\n");
+   src = A.join("\n");
+   A = src.split("\r");
+   src = A.join("\n");
+
+   // Remove XML and DOCTYPE specifier
+   src.replace(/<\?XML .*\?>/i, "");
+   src.replace(/<!DOCTYPE .*\>/i, "");
+
+   // The document is the root node and cannot be modified or removed
+   var doc = new XMLDOC.Parser.node(null, "ROOT", "DOCUMENT");
+
+   // Let's break it down
+   XMLDOC.Parser.eat(doc, src);
+
+   return doc;
+};
+
+/**
+ * The XML fragment processing routine.  This method is private and should not be called
+ * directly.
+ * @param parentNode {XMLDOC.Parser.node} The node which is the parent of this fragment
+ * @param src {String} The source within the fragment to process
+ * @private
+ */
+XMLDOC.Parser.eat = function(parentNode, src)
+{
+   // A simple tag def
+   var reTag = new RegExp("<(!|)(\\?|--|)((.|\\s)*?)\\2>","g");
+
+   // Special tag types
+   var reCommentTag = /<!--((.|\s)*?)-->/;
+   var rePITag = /<\?((.|\s)*?)\?>/;
+
+   // A start tag (with potential empty marker)
+   var reStartTag = /<(.*?)( +([\w_\-]*)=(\"|')(.*)\4)*(\/)?>/;
+
+   // An empty HTML style tag (not proper XML, but we'll accept it so we can process HTML)
+   var reHTMLEmptyTag = /<(.*?)( +([\w_\-]*)=(\"|')(.*)\4)*>/;
+
+   // Fully enclosing tag with nested tags
+   var reEnclosingTag = /<(.*?)( +([\w_\-]*)=(\"|')(.*?)\4)*>((.|\s)*?)<\/\1>/;
+
+   // Breaks down attributes
+   var reAttributes = new RegExp(" +([\\w_\\-]*)=(\"|')(.*?)\\2","g");
+
+   // Find us a tag
+   var tag;
+   while ((tag = reTag.exec(src)) != null)
+   {
+      if (tag.index > 0)
+      {
+         // The next tag has some text before it
+         var text = src.substring(0, tag.index).replace(/^[ \t\n]+((.|\n)*?)[ \t\n]+$/, "$1");
+
+         if (text.length > 0 && (text != "\n"))
+         {
+            var txtnode = new XMLDOC.Parser.node(parentNode, "", "TEXT");
+            txtnode.charData = text;
+
+            // Append the new text node
+            parentNode.nodes.push(txtnode);
+         }
+
+         // Reset the lastIndex of reTag
+         reTag.lastIndex -= src.substring(0, tag.index).length;
+
+         // Eat the text
+         src = src.substring(tag.index);
+      }
+
+      if (reCommentTag.test(tag[0]))
+      {
+         // Is this a comment?
+         var comment = new XMLDOC.Parser.node(parentNode, "", "COMMENT");
+         comment.charData = reCommentTag.exec(tag[0])[1];
+
+         // Append the comment
+         parentNode.nodes.push(comment);
+
+         // Move the lastIndex of reTag
+         reTag.lastIndex -= tag[0].length;
+
+         // Eat the tag
+         src = src.replace(reCommentTag, "");
+      }
+      else if (rePITag.test(tag[0]))
+      {
+         // Is this a processing instruction?
+         var pi = new XMLDOC.Parser.node(parentNode, "", "PI");
+         pi.charData = rePITag.exec(tag[0])[1];
+
+         // Append the processing instruction
+         parentNode.nodes.push(pi);
+
+         // Move the lastIndex of reTag
+         reTag.lastIndex -= tag[0].length;
+
+         // Eat the tag
+         src = src.replace(rePITag, "");
+      }
+      else if (reStartTag.test(tag[0]))
+      {
+         // Break it down
+         var e = reStartTag.exec(tag[0]);
+         var elem = new XMLDOC.Parser.node(parentNode, e[1], "ELEMENT");
+
+         // Get attributes from the tag
+         var a;
+         while ((a = reAttributes.exec(e[2])) != null )
+         {
+            elem.attrs[a[1]] = a[3];
+         }
+
+         // Is this an empty XML-style tag?
+         if (e[6] == "/")
+         {
+            // Append the empty element
+            parentNode.nodes.push(elem);
+
+            // Move the lastIndex of reTag (include the start tag length)
+            reTag.lastIndex -= e[0].length;
+
+            // Eat the tag
+            src = src.replace(reStartTag, "");
+         }
+         else
+         {
+            // Check for malformed XML tags
+            var htmlParsed = false;
+            var htmlStartTag = reHTMLEmptyTag.exec(src);
+
+            // See if there isn't an end tag within this block
+            var reHTMLEndTag = new RegExp("</" + htmlStartTag[1] + ">");
+            var htmlEndTag = reHTMLEndTag.exec(src);
+
+            if (XMLDOC.Parser.strictMode && htmlEndTag == null)
+            {
+               // Poorly formed XML fails in strict mode
+               var err = new Error("Malformed XML passed to XMLDOC.Parser... Error contains malformed 'src'");
+               err.src = src;
+               throw err;
+            }
+            else if (htmlEndTag == null)
+            {
+               // This is an HTML-style empty tag, store the element for it in non-strict mode
+               parentNode.nodes.push(elem);
+
+               // Eat the tag
+               src = src.replace(reHTMLEmptyTag, "");
+               htmlParsed = true;
+            }
+
+            // If we didn't parse HTML-style, it must be an enclosing tag
+            if (!htmlParsed)
+            {
+               var enc = reEnclosingTag.exec(src);
+
+               // Go deeper into the document
+               XMLDOC.Parser.eat(elem, enc[6]);
+
+               // Append the new element node
+               parentNode.nodes.push(elem);
+
+               // Eat the tag
+               src = src.replace(reEnclosingTag, "");
+            }
+         }
+
+         // Reset the lastIndex of reTag
+         reTag.lastIndex = 0;
+      }
+   }
+
+   // No tag was found... append the text if there is any
+   src = src.replace(/^[ \t\n]+((.|\n)*?)[ \t\n]+$/, "$1");
+   if (src.length > 0 && (src != "\n"))
+   {
+      var txtNode = new XMLDOC.Parser.node(parentNode, "", "TEXT");
+      txtNode.charData = src;
+
+      // Append the new text node
+      parentNode.nodes.push(txtNode);
+   }
+};
diff --git a/jsdoc-toolkit/app/lib/JSDOC.js b/jsdoc-toolkit/app/lib/JSDOC.js
new file mode 100644 (file)
index 0000000..5de7b9e
--- /dev/null
@@ -0,0 +1,106 @@
+/**
+       @overview
+       @date $Date: 2010-06-13 22:02:44 +0100 (Sun, 13 Jun 2010) $
+       @version $Revision: 837 $ 
+       @location $HeadURL: https://jsdoc-toolkit.googlecode.com/svn/tags/jsdoc_toolkit-2.4.0/jsdoc-toolkit/app/lib/JSDOC.js $
+       @name JSDOC.js
+ */
+
+/**
+       This is the main container for the JSDOC application.
+       @namespace
+*/
+JSDOC = {
+};
+
+/**
+       @requires Opt
+ */
+if (typeof arguments == "undefined") arguments = [];
+JSDOC.opt = Opt.get(
+       arguments, 
+       {
+               a: "allfunctions", 
+               c: "conf",
+               d: "directory",
+               "D[]": "define",
+               e: "encoding",
+               "E[]": "exclude",
+               h: "help",
+               m: "multiple",
+               n: "nocode",
+               o: "out",
+               p: "private",
+               q: "quiet",
+               r: "recurse",
+               S: "securemodules",
+               s: "suppress",
+               t: "template",
+               T: "testmode",
+               u: "unique",
+               v: "verbose",
+               x: "ext"
+       }
+);
+
+/** The current version string of this application. */
+JSDOC.VERSION = "2.4.0";
+
+/** Print out usage information and quit. */
+JSDOC.usage = function() {
+       print("USAGE: java -jar jsrun.jar app/run.js [OPTIONS] <SRC_DIR> <SRC_FILE> ...");
+       print("");
+       print("OPTIONS:");
+       print("  -a or --allfunctions\n          Include all functions, even undocumented ones.\n");
+       print("  -c or --conf\n          Load a configuration file.\n");
+       print("  -d=<PATH> or --directory=<PATH>\n          Output to this directory (defaults to \"out\").\n");
+       print("  -D=\"myVar:My value\" or --define=\"myVar:My value\"\n          Multiple. Define a variable, available in JsDoc as JSDOC.opt.D.myVar.\n");
+       print("  -e=<ENCODING> or --encoding=<ENCODING>\n          Use this encoding to read and write files.\n");
+       print("  -E=\"REGEX\" or --exclude=\"REGEX\"\n          Multiple. Exclude files based on the supplied regex.\n");
+       print("  -h or --help\n          Show this message and exit.\n");
+       print("  -m or --multiples\n          Don't warn about symbols being documented more than once.\n");
+       print("  -n or --nocode\n          Ignore all code, only document comments with @name tags.\n");
+       print("  -o=<PATH> or --out=<PATH>\n          Print log messages to a file (defaults to stdout).\n");
+       print("  -p or --private\n          Include symbols tagged as private, underscored and inner symbols.\n");
+       print("  -q or --quiet\n          Do not output any messages, not even warnings.\n");
+       print("  -r=<DEPTH> or --recurse=<DEPTH>\n          Descend into src directories.\n");
+       print("  -s or --suppress\n          Suppress source code output.\n");
+       print("  -S or --securemodules\n          Use Secure Modules mode to parse source code.\n");
+       print("  -t=<PATH> or --template=<PATH>\n          Required. Use this template to format the output.\n");
+       print("  -T or --test\n          Run all unit tests and exit.\n");
+       print("  -u or --unique\n          Force file names to be unique, but not based on symbol names.\n");
+       print("  -v or --verbose\n          Provide verbose feedback about what is happening.\n");
+       print("  -x=<EXT>[,EXT]... or --ext=<EXT>[,EXT]...\n          Scan source files with the given extension/s (defaults to js).\n");
+       
+       quit();
+}
+
+/*t:
+       plan(4, "Testing JSDOC namespace.");
+       
+       is(
+               typeof JSDOC,
+               "object",
+               "JSDOC.usage is a function."
+       );
+       
+       is(
+               typeof JSDOC.VERSION,
+               "string",
+               "JSDOC.VERSION is a string."
+       );
+       
+       is(
+               typeof JSDOC.usage,
+               "function",
+               "JSDOC.usage is a function."
+       );
+       
+       is(
+               typeof JSDOC.opt,
+               "object",
+               "JSDOC.opt is a object."
+       );
+ */
+
+if (this.IO) IO.includeDir("lib/JSDOC/");
diff --git a/jsdoc-toolkit/app/lib/JSDOC/DocComment.js b/jsdoc-toolkit/app/lib/JSDOC/DocComment.js
new file mode 100644 (file)
index 0000000..4b21cd7
--- /dev/null
@@ -0,0 +1,204 @@
+if (typeof JSDOC == "undefined") JSDOC = {};
+
+/**
+       Create a new DocComment. This takes a raw documentation comment,
+       and wraps it in useful accessors.
+       @class Represents a documentation comment object.
+ */ 
+JSDOC.DocComment = function(/**String*/comment) {
+       this.init();
+       if (typeof comment != "undefined") {
+               this.parse(comment);
+       }
+}
+
+JSDOC.DocComment.prototype.init = function() {
+       this.isUserComment = true;
+       this.src           = "";
+       this.meta          = "";
+       this.tagTexts      = [];
+       this.tags          = [];
+}
+
+/**
+       @requires JSDOC.DocTag
+ */
+JSDOC.DocComment.prototype.parse = function(/**String*/comment) {
+       if (comment == "") {
+               comment = "/** @desc */";
+               this.isUserComment = false;
+       }
+       
+       this.src = JSDOC.DocComment.unwrapComment(comment);
+       
+       this.meta = "";
+       if (this.src.indexOf("#") == 0) {
+               this.src.match(/#(.+[+-])([\s\S]*)$/);
+               if (RegExp.$1) this.meta = RegExp.$1;
+               if (RegExp.$2) this.src = RegExp.$2;
+       }
+       
+       if (typeof JSDOC.PluginManager != "undefined") {
+               JSDOC.PluginManager.run("onDocCommentSrc", this);
+       }
+       
+       this.fixDesc();
+
+       this.src = JSDOC.DocComment.shared+"\n"+this.src;
+       
+       this.tagTexts = 
+               this.src
+               .split(/(^|[\r\n])\s*@/)
+               .filter(function($){return $.match(/\S/)});
+       
+       /**
+               The tags found in the comment.
+               @type JSDOC.DocTag[]
+        */
+       this.tags = this.tagTexts.map(function($){return new JSDOC.DocTag($)});
+       
+       if (typeof JSDOC.PluginManager != "undefined") {
+               JSDOC.PluginManager.run("onDocCommentTags", this);
+       }
+}
+
+/*t:
+       plan(5, "testing JSDOC.DocComment");
+       requires("../frame/String.js");
+       requires("../lib/JSDOC/DocTag.js");
+       
+       var com = new JSDOC.DocComment("/**@foo some\n* comment here*"+"/");
+       is(com.tagTexts[0], "foo some\ncomment here", "first tag text is found.");
+       is(com.tags[0].title, "foo", "the title is found in a comment with one tag.");
+       
+       var com = new JSDOC.DocComment("/** @foo first\n* @bar second*"+"/");
+       is(com.getTag("bar").length, 1, "getTag() returns one tag by that title.");
+       
+       JSDOC.DocComment.shared = "@author John Smith";
+       var com = new JSDOC.DocComment("/**@foo some\n* comment here*"+"/");
+       is(com.tags[0].title, "author", "shared comment is added.");
+       is(com.tags[1].title, "foo", "shared comment is added to existing tag.");
+*/
+
+/**
+       If no @desc tag is provided, this function will add it.
+ */
+JSDOC.DocComment.prototype.fixDesc = function() {
+       if (this.meta && this.meta != "@+") return;
+       if (/^\s*[^@\s]/.test(this.src)) {                              
+               this.src = "@desc "+this.src;
+       }
+}
+
+/*t:
+       plan(5, "testing JSDOC.DocComment#fixDesc");
+       
+       var com = new JSDOC.DocComment();
+       
+       com.src = "this is a desc\n@author foo";
+       com.fixDesc();
+       is(com.src, "@desc this is a desc\n@author foo", "if no @desc tag is provided one is added.");
+
+       com.src = "x";
+       com.fixDesc();
+       is(com.src, "@desc x", "if no @desc tag is provided one is added to a single character.");
+
+       com.src = "\nx";
+       com.fixDesc();
+       is(com.src, "@desc \nx", "if no @desc tag is provided one is added to return and character.");
+       
+       com.src = " ";
+       com.fixDesc();
+       is(com.src, " ", "if no @desc tag is provided one is not added to just whitespace.");
+
+       com.src = "";
+       com.fixDesc();
+       is(com.src, "", "if no @desc tag is provided one is not added to empty.");
+*/
+
+/**
+       Remove slash-star comment wrapper from a raw comment string.
+       @type String
+ */
+JSDOC.DocComment.unwrapComment = function(/**String*/comment) {
+       if (!comment) return "";
+       var unwrapped = comment.replace(/(^\/\*\*|\*\/$)/g, "").replace(/^\s*\* ?/gm, "");
+       return unwrapped;
+}
+
+/*t:
+       plan(5, "testing JSDOC.DocComment.unwrapComment");
+       
+       var com = "/**x*"+"/";
+       var unwrapped = JSDOC.DocComment.unwrapComment(com);
+       is(unwrapped, "x", "a single character jsdoc is found.");
+       
+       com = "/***x*"+"/";
+       unwrapped = JSDOC.DocComment.unwrapComment(com);
+       is(unwrapped, "x", "three stars are allowed in the opener.");
+       
+       com = "/****x*"+"/";
+       unwrapped = JSDOC.DocComment.unwrapComment(com);
+       is(unwrapped, "*x", "fourth star in the opener is kept.");
+       
+       com = "/**x\n * y\n*"+"/";
+       unwrapped = JSDOC.DocComment.unwrapComment(com);
+       is(unwrapped, "x\ny\n", "leading stars and spaces are trimmed.");
+       
+       com = "/**x\n *   y\n*"+"/";
+       unwrapped = JSDOC.DocComment.unwrapComment(com);
+       is(unwrapped, "x\n  y\n", "only first space after leading stars are trimmed.");
+*/
+
+/**
+       Provides a printable version of the comment.
+       @type String
+ */
+JSDOC.DocComment.prototype.toString = function() {
+       return this.src;
+}
+
+/*t:
+       plan(1, "testing JSDOC.DocComment#fixDesc");
+       var com = new JSDOC.DocComment();
+       com.src = "foo";
+       is(""+com, "foo", "stringifying a comment returns the unwrapped src.");
+*/
+
+/**
+       Given the title of a tag, returns all tags that have that title.
+       @type JSDOC.DocTag[]
+ */
+JSDOC.DocComment.prototype.getTag = function(/**String*/tagTitle) {
+       return this.tags.filter(function($){return $.title == tagTitle});
+}
+
+JSDOC.DocComment.prototype.deleteTag = function(/**String*/tagTitle) {
+       this.tags = this.tags.filter(function($){return $.title != tagTitle})
+}
+
+/*t:
+       plan(1, "testing JSDOC.DocComment#getTag");
+       requires("../frame/String.js");
+       requires("../lib/JSDOC/DocTag.js");
+       
+       var com = new JSDOC.DocComment("/**@foo some\n* @bar\n* @bar*"+"/");
+       is(com.getTag("bar").length, 2, "getTag returns expected number of tags.");
+*/
+
+/**
+       Used to store the currently shared tag text.
+*/
+JSDOC.DocComment.shared = "";
+
+/*t:
+       plan(2, "testing JSDOC.DocComment.shared");
+       requires("../frame/String.js");
+       requires("../lib/JSDOC/DocTag.js");
+       
+       JSDOC.DocComment.shared = "@author Michael";
+       
+       var com = new JSDOC.DocComment("/**@foo\n* @foo*"+"/");
+       is(com.getTag("author").length, 1, "getTag returns shared tag.");
+       is(com.getTag("foo").length, 2, "getTag returns unshared tags too.");
+*/
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/lib/JSDOC/DocTag.js b/jsdoc-toolkit/app/lib/JSDOC/DocTag.js
new file mode 100644 (file)
index 0000000..77ec07c
--- /dev/null
@@ -0,0 +1,294 @@
+if (typeof JSDOC == "undefined") JSDOC = {};
+
+/**
+       @constructor
+ */
+JSDOC.DocTag = function(src) {
+       this.init();
+       if (typeof src != "undefined") {
+               this.parse(src);
+       }
+}
+
+/**
+       Create and initialize the properties of this.
+ */
+JSDOC.DocTag.prototype.init = function() {
+       this.title        = "";
+       this.type         = "";
+       this.name         = "";
+       this.isOptional   = false;
+       this.defaultValue = "";
+       this.desc         = "";
+       
+       return this;
+}
+
+/**
+       Populate the properties of this from the given tag src.
+       @param {string} src
+ */
+JSDOC.DocTag.prototype.parse = function(src) {
+       if (typeof src != "string") throw "src must be a string not "+(typeof src);
+
+       try {
+               src = this.nibbleTitle(src);
+               if (JSDOC.PluginManager) {
+                       JSDOC.PluginManager.run("onDocTagSynonym", this);
+               }
+               
+               src = this.nibbleType(src);
+               
+               // only some tags are allowed to have names.
+               if (this.title == "param" || this.title == "property" || this.title == "config") { // @config is deprecated
+                       src = this.nibbleName(src);
+               }
+       }
+       catch(e) {
+               if (LOG) LOG.warn(e);
+               else throw e;
+       }
+       this.desc = src; // whatever is left
+       
+       // example tags need to have whitespace preserved
+       if (this.title != "example") this.desc = this.desc.trim();
+       
+       if (JSDOC.PluginManager) {
+               JSDOC.PluginManager.run("onDocTag", this);
+       }
+}
+
+/**
+       Automatically called when this is stringified.
+ */
+JSDOC.DocTag.prototype.toString = function() {
+       return this.desc;
+}
+
+/*t:
+       plan(1, "testing JSDOC.DocTag#toString");
+       
+       var tag = new JSDOC.DocTag("param {object} date A valid date.");
+       is(""+tag, "A valid date.", "stringifying a tag returns the desc.");
+ */
+
+/**
+       Find and shift off the title of a tag.
+       @param {string} src
+       @return src
+ */
+JSDOC.DocTag.prototype.nibbleTitle = function(src) {
+       if (typeof src != "string") throw "src must be a string not "+(typeof src);
+       
+       var parts = src.match(/^\s*(\S+)(?:\s([\s\S]*))?$/);
+
+       if (parts && parts[1]) this.title = parts[1];
+       if (parts && parts[2]) src = parts[2];
+       else src = "";
+       
+       return src;
+}
+
+/*t:
+       plan(8, "testing JSDOC.DocTag#nibbleTitle");
+       
+       var tag = new JSDOC.DocTag();
+       
+       tag.init().nibbleTitle("aTitleGoesHere");
+       is(tag.title, "aTitleGoesHere", "a title can be found in a single-word string.");
+       
+       var src = tag.init().nibbleTitle("aTitleGoesHere and the rest");
+       is(tag.title, "aTitleGoesHere", "a title can be found in a multi-word string.");
+       is(src, "and the rest", "the rest is returned when the title is nibbled off.");
+       
+       src = tag.init().nibbleTitle("");
+       is(tag.title, "", "given an empty string the title is empty.");
+       is(src, "", "the rest is empty when the tag is empty.");
+
+       var src = tag.init().nibbleTitle(" aTitleGoesHere\n  a description");
+       is(tag.title, "aTitleGoesHere", "leading and trailing spaces are not part of the title.");
+       is(src, "  a description", "leading spaces (less one) are part of the description.");
+
+       tag.init().nibbleTitle("a.Title::Goes_Here foo");
+       is(tag.title, "a.Title::Goes_Here", "titles with punctuation are allowed.");
+ */
+
+/**
+       Find and shift off the type of a tag.
+       @requires frame/String.js
+       @param {string} src
+       @return src
+ */
+JSDOC.DocTag.prototype.nibbleType = function(src) {
+       if (typeof src != "string") throw "src must be a string not "+(typeof src);
+       
+       if (src.match(/^\s*\{/)) {
+               var typeRange = src.balance("{", "}");
+               if (typeRange[1] == -1) {
+                       throw "Malformed comment tag ignored. Tag type requires an opening { and a closing }: "+src;
+               }
+               this.type = src.substring(typeRange[0]+1, typeRange[1]).trim();
+               this.type = this.type.replace(/\s*,\s*/g, "|"); // multiples can be separated by , or |
+               src = src.substring(typeRange[1]+1);
+       }
+       
+       return src;
+}
+
+/*t:
+       plan(5, "testing JSDOC.DocTag.parser.nibbleType");
+       requires("../frame/String.js");
+       
+       var tag = new JSDOC.DocTag();
+       
+       tag.init().nibbleType("{String[]} aliases");
+       is(tag.type, "String[]", "type can have non-alpha characters.");
+       
+       tag.init().nibbleType("{ aTypeGoesHere  } etc etc");
+       is(tag.type, "aTypeGoesHere", "type is trimmed.");
+       
+       tag.init().nibbleType("{ oneType, twoType ,\n threeType  } etc etc");
+       is(tag.type, "oneType|twoType|threeType", "multiple types can be separated by commas.");
+       
+       var error;
+       try { tag.init().nibbleType("{widget foo"); }
+       catch(e) { error = e; }
+       is(typeof error, "string", "malformed tag type throws error.");
+       isnt(error.indexOf("Malformed"), -1, "error message tells tag is malformed.");
+ */
+
+/**
+       Find and shift off the name of a tag.
+       @requires frame/String.js
+       @param {string} src
+       @return src
+ */
+JSDOC.DocTag.prototype.nibbleName = function(src) {
+       if (typeof src != "string") throw "src must be a string not "+(typeof src);
+       
+       src = src.trim();
+       
+       // is optional?
+       if (src.charAt(0) == "[") {
+               var nameRange = src.balance("[", "]");
+               if (nameRange[1] == -1) {
+                       throw "Malformed comment tag ignored. Tag optional name requires an opening [ and a closing ]: "+src;
+               }
+               this.name = src.substring(nameRange[0]+1, nameRange[1]).trim();
+               this.isOptional = true;
+               
+               src = src.substring(nameRange[1]+1);
+               
+               // has default value?
+               var nameAndValue = this.name.split("=");
+               if (nameAndValue.length) {
+                       this.name = nameAndValue.shift().trim();
+                       this.defaultValue = nameAndValue.join("=");
+               }
+       }
+       else {
+               var parts = src.match(/^(\S+)(?:\s([\s\S]*))?$/);
+               if (parts) {
+                       if (parts[1]) this.name = parts[1];
+                       if (parts[2]) src = parts[2].trim();
+                       else src = "";
+               }
+       }       
+
+       return src;
+}
+
+/*t:
+       requires("../frame/String.js");
+       plan(9, "testing JSDOC.DocTag.parser.nibbleName");
+       
+       var tag = new JSDOC.DocTag();
+       
+       tag.init().nibbleName("[foo] This is a description.");
+       is(tag.isOptional, true, "isOptional syntax is detected.");
+       is(tag.name, "foo", "optional param name is found.");
+       
+       tag.init().nibbleName("[foo] This is a description.");
+       is(tag.isOptional, true, "isOptional syntax is detected when no type.");
+       is(tag.name, "foo", "optional param name is found when no type.");
+       
+       tag.init().nibbleName("[foo=7] This is a description.");
+       is(tag.name, "foo", "optional param name is found when default value.");
+       is(tag.defaultValue, 7, "optional param default value is found when default value.");
+       
+       //tag.init().nibbleName("[foo= a value] This is a description.");
+       //is(tag.defaultValue, " a value", "optional param default value is found when default value has spaces (issue #112).");
+       
+       tag.init().nibbleName("[foo=[]] This is a description.");
+       is(tag.defaultValue, "[]", "optional param default value is found when default value is [] (issue #95).");
+       
+       tag.init().nibbleName("[foo=a=b] This is a description.");
+       is(tag.name, "foo", "optional param name is found when default value is a=b.");
+       is(tag.defaultValue, "a=b", "optional param default value is found when default value is a=b.")
+ */
+
+/*t:
+       plan(32, "Testing JSDOC.DocTag.parser.");
+       requires("../frame/String.js");
+       
+       var tag = new JSDOC.DocTag();
+       
+       is(typeof tag, "object", "JSDOC.DocTag.parser with an empty string returns an object.");
+       is(typeof tag.title, "string", "returned object has a string property 'title'.");
+       is(typeof tag.type, "string", "returned object has a string property 'type'.");
+       is(typeof tag.name, "string", "returned object has a string property 'name'.");
+       is(typeof tag.defaultValue, "string", "returned object has a string property 'defaultValue'.");
+       is(typeof tag.isOptional, "boolean", "returned object has a boolean property 'isOptional'.");
+       is(typeof tag.desc, "string", "returned object has a string property 'desc'.");
+  
+       tag = new JSDOC.DocTag("param {widget} foo");
+       is(tag.title, "param", "param title is found.");
+       is(tag.name, "foo", "param name is found when desc is missing.");
+       is(tag.desc, "", "param desc is empty when missing.");
+       
+       tag = new JSDOC.DocTag("param {object} date A valid date.");
+       is(tag.name, "date", "param name is found with a type.");
+       is(tag.type, "object", "param type is found.");
+       is(tag.desc, "A valid date.", "param desc is found with a type.");
+       
+       tag = new JSDOC.DocTag("param aName a description goes\n    here.");
+       is(tag.name, "aName", "param name is found without a type.");
+       is(tag.desc, "a description goes\n    here.", "param desc is found without a type.");
+       
+       tag = new JSDOC.DocTag("param {widget}");
+       is(tag.name, "", "param name is empty when it is not given.");
+       
+       tag = new JSDOC.DocTag("param {widget} [foo] This is a description.");
+       is(tag.name, "foo", "optional param name is found.");
+       
+       tag = new JSDOC.DocTag("return {aType} This is a description.");
+       is(tag.type, "aType", "when return tag has no name, type is found.");
+       is(tag.desc, "This is a description.", "when return tag has no name, desc is found.");
+       
+       tag = new JSDOC.DocTag("author Joe Coder <jcoder@example.com>");
+       is(tag.title, "author", "author tag has a title.");
+       is(tag.type, "", "the author tag has no type.");
+       is(tag.name, "", "the author tag has no name.");
+       is(tag.desc, "Joe Coder <jcoder@example.com>", "author tag has desc.");
+       
+       tag = new JSDOC.DocTag("private \t\n  ");
+       is(tag.title, "private", "private tag has a title.");
+       is(tag.type, "", "the private tag has no type.");
+       is(tag.name, "", "the private tag has no name.");
+       is(tag.desc, "", "private tag has no desc.");
+
+       tag = new JSDOC.DocTag("example\n   example(code);\n   more();");
+       is(tag.desc, "   example(code);\n   more();", "leading whitespace (less one) in examples code is preserved.");
+       
+       tag = new JSDOC.DocTag("param theName  \n");
+       is(tag.name, "theName", "name only is found.");
+       
+       tag = new JSDOC.DocTag("type theDesc  \n");
+       is(tag.desc, "theDesc", "desc only is found.");
+       
+       tag = new JSDOC.DocTag("type {theType} \n");
+       is(tag.type, "theType", "type only is found.");
+       
+       tag = new JSDOC.DocTag("");
+       is(tag.title, "", "title is empty when tag is empty.");
+ */
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js b/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js
new file mode 100644 (file)
index 0000000..02275a6
--- /dev/null
@@ -0,0 +1,140 @@
+/**
+       @constructor
+       @param [opt] Used to override the commandline options. Useful for testing.
+       @version $Id: JsDoc.js 831 2010-03-09 14:24:56Z micmath $
+*/
+JSDOC.JsDoc = function(/**object*/ opt) {
+       if (opt) {
+               JSDOC.opt = opt;
+       }
+       
+       if (JSDOC.opt.h) {
+               JSDOC.usage();
+               quit();
+       }
+       
+       // defend against options that are not sane 
+       if (JSDOC.opt._.length == 0) {
+               LOG.warn("No source files to work on. Nothing to do.");
+               quit();
+       }
+       if (JSDOC.opt.t === true || JSDOC.opt.d === true) {
+               JSDOC.usage();
+       }
+       
+       if (typeof JSDOC.opt.d == "string") {
+               if (!JSDOC.opt.d.charAt(JSDOC.opt.d.length-1).match(/[\\\/]/)) {
+                       JSDOC.opt.d = JSDOC.opt.d+"/";
+               }
+               LOG.inform("Output directory set to '"+JSDOC.opt.d+"'.");
+               IO.mkPath(JSDOC.opt.d);
+       }
+       if (JSDOC.opt.e) IO.setEncoding(JSDOC.opt.e);
+       
+       // the -r option: scan source directories recursively
+       if (typeof JSDOC.opt.r == "boolean") JSDOC.opt.r = 10;
+       else if (!isNaN(parseInt(JSDOC.opt.r))) JSDOC.opt.r = parseInt(JSDOC.opt.r);
+       else JSDOC.opt.r = 1;
+       
+       // the -D option: define user variables
+       var D = {};
+       if (JSDOC.opt.D) {
+               for (var i = 0; i < JSDOC.opt.D.length; i++) {
+                       var param = JSDOC.opt.D[i];
+                       // remove first and last character if both == "
+                       if ( 
+                               param.length > 1
+                               && param.charAt(0) == '"'
+                               && param.charAt(param.length-1) == '"'
+                       ) {
+                               param = param.substr(1, param.length-2);
+                       }
+                       var defineParts = param.split(":");
+                       if (defineParts && defineParts.length > 1) {
+                               for ( var dpIdx = 2; dpIdx < defineParts.length; dpIdx++ ) {
+                                       defineParts[1] += ':' + defineParts[dpIdx];
+                               }
+                               D[defineParts[0]] = defineParts[1];
+                       }
+               }
+       }
+       JSDOC.opt.D = D;
+       // combine any conf file D options with the commandline D options
+       if (defined(JSDOC.conf)) for (var c in JSDOC.conf.D) {
+               if (!defined(JSDOC.opt.D[c])) {
+                       JSDOC.opt.D[c] = JSDOC.conf.D[c];
+               }
+       }
+       
+       // Give plugins a chance to initialize
+       if (defined(JSDOC.PluginManager)) {
+               JSDOC.PluginManager.run("onInit", JSDOC.opt);
+       }
+
+       JSDOC.opt.srcFiles = JSDOC.JsDoc._getSrcFiles();
+       JSDOC.JsDoc._parseSrcFiles();
+       JSDOC.JsDoc.symbolSet = JSDOC.Parser.symbols;
+}
+
+/**
+       Retrieve source file list.
+       @returns {String[]} The pathnames of the files to be parsed.
+ */
+JSDOC.JsDoc._getSrcFiles = function() {
+       JSDOC.JsDoc.srcFiles = [];
+       
+       var ext = ["js"];
+       if (JSDOC.opt.x) {
+               ext = JSDOC.opt.x.split(",").map(function($) {return $.toLowerCase()});
+       }
+       
+       for (var i = 0; i < JSDOC.opt._.length; i++) {
+               JSDOC.JsDoc.srcFiles = JSDOC.JsDoc.srcFiles.concat(
+                       IO.ls(JSDOC.opt._[i], JSDOC.opt.r).filter(
+                               function($) {
+                                       var thisExt = $.split(".").pop().toLowerCase();
+                                       
+                                       if (JSDOC.opt.E) {
+                                               for(var n = 0; n < JSDOC.opt.E.length; n++) {
+                                                       if ($.match(new RegExp(JSDOC.opt.E[n]))) {
+                                                               LOG.inform("Excluding " + $);
+                                                               return false; // if the file matches the regex then it's excluded.
+                                                       }
+                                               }
+                                       }
+                                       
+                                       return (ext.indexOf(thisExt) > -1); // we're only interested in files with certain extensions
+                               }
+                       )
+               );
+       }
+       
+       return JSDOC.JsDoc.srcFiles;
+}
+
+JSDOC.JsDoc._parseSrcFiles = function() {
+       JSDOC.Parser.init();
+       for (var i = 0, l = JSDOC.JsDoc.srcFiles.length; i < l; i++) {
+               var srcFile = JSDOC.JsDoc.srcFiles[i];
+               
+               if (JSDOC.opt.v) LOG.inform("Parsing file: " + srcFile);
+               
+               try {
+                       var src = IO.readFile(srcFile);
+               }
+               catch(e) {
+                       LOG.warn("Can't read source file '"+srcFile+"': "+e.message);
+               }
+
+               var tr = new JSDOC.TokenReader();
+               var ts = new JSDOC.TokenStream(tr.tokenize(new JSDOC.TextStream(src)));
+
+               JSDOC.Parser.parse(ts, srcFile);
+
+       }
+       JSDOC.Parser.finish();
+
+       if (JSDOC.PluginManager) {
+               JSDOC.PluginManager.run("onFinishedParsing", JSDOC.Parser.symbols);
+       }
+}
diff --git a/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js b/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js
new file mode 100644 (file)
index 0000000..bcaebc9
--- /dev/null
@@ -0,0 +1,109 @@
+/**
+       @constructor
+*/
+JSDOC.JsPlate = function(templateFile) {
+       if (templateFile) this.template = IO.readFile(templateFile);
+       
+       this.templateFile = templateFile;
+       this.code = "";
+       this.parse();
+}
+
+JSDOC.JsPlate.prototype.parse = function() {
+       this.template = this.template.replace(/\{#[\s\S]+?#\}/gi, "");
+       this.code = "var output=\u001e"+this.template;
+
+       this.code = this.code.replace(
+               /<for +each="(.+?)" +in="(.+?)" *>/gi, 
+               function (match, eachName, inName) {
+                       return "\u001e;\rvar $"+eachName+"_keys = keys("+inName+");\rfor(var $"+eachName+"_i = 0; $"+eachName+"_i < $"+eachName+"_keys.length; $"+eachName+"_i++) {\rvar $"+eachName+"_last = ($"+eachName+"_i == $"+eachName+"_keys.length-1);\rvar $"+eachName+"_key = $"+eachName+"_keys[$"+eachName+"_i];\rvar "+eachName+" = "+inName+"[$"+eachName+"_key];\routput+=\u001e";
+               }
+       );      
+       this.code = this.code.replace(/<if test="(.+?)">/g, "\u001e;\rif ($1) { output+=\u001e");
+       this.code = this.code.replace(/<elseif test="(.+?)"\s*\/>/g, "\u001e;}\relse if ($1) { output+=\u001e");
+       this.code = this.code.replace(/<else\s*\/>/g, "\u001e;}\relse { output+=\u001e");
+       this.code = this.code.replace(/<\/(if|for)>/g, "\u001e;\r};\routput+=\u001e");
+       this.code = this.code.replace(
+               /\{\+\s*([\s\S]+?)\s*\+\}/gi,
+               function (match, code) {
+                       code = code.replace(/"/g, "\u001e"); // prevent qoute-escaping of inline code
+                       code = code.replace(/(\r?\n)/g, " ");
+                       return "\u001e+ ("+code+") +\u001e";
+               }
+       );
+       this.code = this.code.replace(
+               /\{!\s*([\s\S]+?)\s*!\}/gi,
+               function (match, code) {
+                       code = code.replace(/"/g, "\u001e"); // prevent qoute-escaping of inline code
+                       code = code.replace(/(\n)/g, " ");
+                       return "\u001e; "+code+";\routput+=\u001e";
+               }
+       );
+       this.code = this.code+"\u001e;";
+
+       this.code = this.code.replace(/(\r?\n)/g, "\\n");
+       this.code = this.code.replace(/"/g, "\\\"");
+       this.code = this.code.replace(/\u001e/g, "\"");
+}
+
+JSDOC.JsPlate.prototype.toCode = function() {
+       return this.code;
+}
+
+JSDOC.JsPlate.keys = function(obj) {
+       var keys = [];
+       if (obj.constructor.toString().indexOf("Array") > -1) {
+               for (var i = 0; i < obj.length; i++) {
+                       keys.push(i);
+               }
+       }
+       else {
+               for (var i in obj) {
+                       keys.push(i);
+               }
+       }
+       return keys;
+};
+
+JSDOC.JsPlate.values = function(obj) {
+       var values = [];
+       if (obj.constructor.toString().indexOf("Array") > -1) {
+               for (var i = 0; i < obj.length; i++) {
+                       values.push(obj[i]);
+               }
+       }
+       else {
+               for (var i in obj) {
+                       values.push(obj[i]);
+               }
+       }
+       return values;
+};
+
+JSDOC.JsPlate.prototype.process = function(data, compact) {
+       var keys = JSDOC.JsPlate.keys;
+       var values = JSDOC.JsPlate.values;
+       
+       try {
+               eval(this.code);
+       }
+       catch (e) {
+               print(">> There was an error evaluating the compiled code from template: "+this.templateFile);
+               print("   The error was on line "+e.lineNumber+" "+e.name+": "+e.message);
+               var lines = this.code.split("\r");
+               if (e.lineNumber-2 >= 0) print("line "+(e.lineNumber-1)+": "+lines[e.lineNumber-2]);
+               print("line "+e.lineNumber+": "+lines[e.lineNumber-1]);
+               print("");
+       }
+       
+       if (compact) { // patch by mcbain.asm
+               // Remove lines that contain only space-characters, usually left by lines in the template
+               // which originally only contained JSPlate tags or code. This makes it easier to write
+               // non-tricky templates which still put out nice code (not bloated with extra lines).
+               // Lines purposely left blank (just a line ending) are left alone.
+               output = output.replace(/\s+?(\r?)\n/g, "$1\n");
+       }
+       
+       /*debug*///print(this.code);
+       return output;
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/lib/JSDOC/Lang.js b/jsdoc-toolkit/app/lib/JSDOC/Lang.js
new file mode 100644 (file)
index 0000000..62919d7
--- /dev/null
@@ -0,0 +1,144 @@
+/**
+       @namespace
+*/
+JSDOC.Lang = {
+}
+
+JSDOC.Lang.isBuiltin = function(name) {
+       return (JSDOC.Lang.isBuiltin.coreObjects.indexOf(name) > -1);
+}
+JSDOC.Lang.isBuiltin.coreObjects = ['_global_', 'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object', 'RegExp', 'String'];
+
+JSDOC.Lang.whitespace = function(ch) {
+       return JSDOC.Lang.whitespace.names[ch];
+}
+JSDOC.Lang.whitespace.names = {
+       " ":      "SPACE",
+       "\f":     "FORMFEED",
+       "\t":     "TAB",
+       "\u0009": "UNICODE_TAB",
+       "\u000A": "UNICODE_NBR",
+       "\u0008": "VERTICAL_TAB"
+};
+
+JSDOC.Lang.newline = function(ch) {
+       return JSDOC.Lang.newline.names[ch];
+}
+JSDOC.Lang.newline.names = {
+       "\n":     "NEWLINE",
+       "\r":     "RETURN",
+       "\u000A": "UNICODE_LF",
+       "\u000D": "UNICODE_CR",
+       "\u2029": "UNICODE_PS",
+       "\u2028": "UNICODE_LS"
+};
+
+JSDOC.Lang.keyword = function(word) {
+       return JSDOC.Lang.keyword.names["="+word];
+}
+JSDOC.Lang.keyword.names = {
+       "=break":      "BREAK",
+       "=case":       "CASE",
+       "=catch":      "CATCH",
+       "=const":      "VAR",
+       "=continue":   "CONTINUE",
+       "=default":    "DEFAULT",
+       "=delete":     "DELETE",
+       "=do":         "DO",
+       "=else":       "ELSE",
+       "=false":      "FALSE",
+       "=finally":    "FINALLY",
+       "=for":        "FOR",
+       "=function":   "FUNCTION",
+       "=if":         "IF",
+       "=in":         "IN",
+       "=instanceof": "INSTANCEOF",
+       "=new":        "NEW",
+       "=null":       "NULL",
+       "=return":     "RETURN",
+       "=switch":     "SWITCH",
+       "=this":       "THIS",
+       "=throw":      "THROW",
+       "=true":       "TRUE",
+       "=try":        "TRY",
+       "=typeof":     "TYPEOF",
+       "=void":       "VOID",
+       "=while":      "WHILE",
+       "=with":       "WITH",
+       "=var":        "VAR"
+};
+
+JSDOC.Lang.punc = function(ch) {
+       return JSDOC.Lang.punc.names[ch];
+}
+JSDOC.Lang.punc.names = {
+       ";":   "SEMICOLON",
+       ",":   "COMMA",
+       "?":   "HOOK",
+       ":":   "COLON",
+       "||":  "OR", 
+       "&&":  "AND",
+       "|":   "BITWISE_OR",
+       "^":   "BITWISE_XOR",
+       "&":   "BITWISE_AND",
+       "===": "STRICT_EQ", 
+       "==":  "EQ",
+       "=":   "ASSIGN",
+       "!==": "STRICT_NE",
+       "!=":  "NE",
+       "<<":  "LSH",
+       "<=":  "LE", 
+       "<":   "LT",
+       ">>>": "URSH",
+       ">>":  "RSH",
+       ">=":  "GE",
+       ">":   "GT", 
+       "++":  "INCREMENT",
+       "--":  "DECREMENT",
+       "+":   "PLUS",
+       "-":   "MINUS",
+       "*":   "MUL",
+       "/":   "DIV", 
+       "%":   "MOD",
+       "!":   "NOT",
+       "~":   "BITWISE_NOT",
+       ".":   "DOT",
+       "[":   "LEFT_BRACKET",
+       "]":   "RIGHT_BRACKET",
+       "{":   "LEFT_CURLY",
+       "}":   "RIGHT_CURLY",
+       "(":   "LEFT_PAREN",
+       ")":   "RIGHT_PAREN"
+};
+
+JSDOC.Lang.matching = function(name) {
+       return JSDOC.Lang.matching.names[name];
+}
+JSDOC.Lang.matching.names = {
+       "LEFT_PAREN": "RIGHT_PAREN",
+       "RIGHT_PAREN": "LEFT_PAREN",
+       "LEFT_CURLY": "RIGHT_CURLY",
+       "RIGHT_CURLY": "LEFT_CURLY",
+       "LEFT_BRACE": "RIGHT_BRACE",
+       "RIGHT_BRACE": "LEFT_BRACE"
+}
+
+JSDOC.Lang.isNumber = function(str) {
+       return /^(\.[0-9]|[0-9]+\.|[0-9])[0-9]*([eE][+-][0-9]+)?$/i.test(str);
+}
+
+JSDOC.Lang.isHexDec = function(str) {
+       return /^0x[0-9A-F]+$/i.test(str);
+}
+
+JSDOC.Lang.isWordChar = function(str) {
+       return /^[a-zA-Z0-9$_.]+$/.test(str);
+}
+
+JSDOC.Lang.isSpace = function(str) {
+       return (typeof JSDOC.Lang.whitespace(str) != "undefined");
+}
+
+JSDOC.Lang.isNewline = function(str) {
+       return (typeof JSDOC.Lang.newline(str) != "undefined");
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/lib/JSDOC/Parser.js b/jsdoc-toolkit/app/lib/JSDOC/Parser.js
new file mode 100644 (file)
index 0000000..e489c61
--- /dev/null
@@ -0,0 +1,146 @@
+if (typeof JSDOC == "undefined") JSDOC = {};
+
+/**
+       @namespace
+       @requires JSDOC.Walker
+       @requires JSDOC.Symbol
+       @requires JSDOC.DocComment
+*/
+JSDOC.Parser = {
+       conf: {
+               ignoreCode:               JSDOC.opt.n,
+               ignoreAnonymous:           true, // factory: true
+               treatUnderscoredAsPrivate: true, // factory: true
+               explain:                   false // factory: false
+       },
+       
+       addSymbol: function(symbol) {
+
+               if (JSDOC.Parser.rename) {
+                       for (var n in JSDOC.Parser.rename) {
+                               if (symbol.alias.indexOf(n) == 0) {
+                                       if (symbol.name == symbol.alias) {
+                                               symbol.name = symbol.name.replace(n, JSDOC.Parser.rename[n]);
+                                       }
+                                       symbol.alias = symbol.alias.replace(n, JSDOC.Parser.rename[n]);
+                               }
+                       }
+               }
+               
+               if (JSDOC.opt.S) {
+                       if (typeof JSDOC.Parser.secureModules == "undefined") JSDOC.Parser.secureModules = {};
+                       if (/^exports\./.test(symbol.alias)) {
+                               symbol.srcFile.match(/(^|[\\\/])([^\\\/]+)\.js/i);
+                               var fileNS = RegExp.$2;
+                               
+                               // need to create the namespace associated with this file first
+                               if (!JSDOC.Parser.secureModules[fileNS]) {
+                                       JSDOC.Parser.secureModules[fileNS] = 1;
+                                       var nsSymbol = new JSDOC.Symbol(fileNS, [], "GLOBAL", new JSDOC.DocComment(""));
+                                       nsSymbol.isNamespace = true;
+                                       nsSymbol.srcFile = "";
+                                       nsSymbol.isPrivate = false;
+                                       nsSymbol.srcFile = symbol.srcFile;
+                                       nsSymbol.desc = (JSDOC.Parser.symbols.getSymbol(symbol.srcFile) || {desc: ""}).desc;
+                                       JSDOC.Parser.addSymbol(nsSymbol);
+                               }
+                               
+                               symbol.alias = symbol.alias.replace(/^exports\./, fileNS + '.');
+                               symbol.name = symbol.name.replace(/^exports\./, '');
+                               symbol.memberOf = fileNS;
+                               symbol.isStatic = true;
+                       }
+               }
+
+               // if a symbol alias is documented more than once the first one with the user docs wins
+               if (JSDOC.Parser.symbols.hasSymbol(symbol.alias)) {
+                       var oldSymbol = JSDOC.Parser.symbols.getSymbol(symbol.alias);
+                       if (oldSymbol.comment.isUserComment) {
+                               if (JSDOC.opt.m) return;
+                               if (symbol.comment.isUserComment) { // old and new are both documented
+                                       LOG.warn("The symbol '"+symbol.alias+"' is documented more than once.");
+                                       return;
+                               }
+                               else { // old is documented but new isn't
+                                       return;
+                               }
+                       }
+               }
+               
+               // we don't document anonymous things
+               if (JSDOC.Parser.conf.ignoreAnonymous && symbol.name.match(/\$anonymous\b/)) return;
+
+               // uderscored things may be treated as if they were marked private, this cascades
+               if (JSDOC.Parser.conf.treatUnderscoredAsPrivate && symbol.name.match(/[.#-]_[^.#-]+$/)) {
+                       if (!symbol.comment.getTag("public").length > 0) symbol.isPrivate = true;
+               }
+               
+               // -p flag is required to document private things
+               if (!JSDOC.opt.p && symbol.isPrivate) return; // issue #161 fixed by mcbain.asm
+               
+               // ignored things are not documented, this doesn't cascade
+               if (symbol.isIgnored) return;
+               JSDOC.Parser.symbols.addSymbol(symbol);
+       },
+       
+       addBuiltin: function(name) {
+               var builtin = new JSDOC.Symbol(name, [], "CONSTRUCTOR", new JSDOC.DocComment(""));
+               builtin.isNamespace = true;
+               builtin.srcFile = "";
+               builtin.isPrivate = false;
+               JSDOC.Parser.addSymbol(builtin);
+               return builtin;
+       },
+       
+       init: function() {
+               JSDOC.Parser.symbols = new JSDOC.SymbolSet();
+               JSDOC.Parser.walker = new JSDOC.Walker();
+       },
+       
+       finish: function() {
+               JSDOC.Parser.symbols.relate();          
+               
+               // make a litle report about what was found
+               if (JSDOC.Parser.conf.explain) {
+                       var symbols = JSDOC.Parser.symbols.toArray();
+                       var srcFile = "";
+                       for (var i = 0, l = symbols.length; i < l; i++) {
+                               var symbol = symbols[i];
+                               if (srcFile != symbol.srcFile) {
+                                       srcFile = symbol.srcFile;
+                                       print("\n"+srcFile+"\n-------------------");
+                               }
+                               print(i+":\n  alias => "+symbol.alias + "\n  name => "+symbol.name+ "\n  isa => "+symbol.isa + "\n  memberOf => " + symbol.memberOf + "\n  isStatic => " + symbol.isStatic + ",  isInner => " + symbol.isInner+ ",  isPrivate => " + symbol.isPrivate);
+                       }
+                       print("-------------------\n");
+               }
+       }
+}
+
+JSDOC.Parser.parse = function(/**JSDOC.TokenStream*/ts, /**String*/srcFile) {
+       JSDOC.Symbol.srcFile = (srcFile || "");
+       JSDOC.DocComment.shared = ""; // shared comments don't cross file boundaries
+       
+       if (!JSDOC.Parser.walker) JSDOC.Parser.init();
+       JSDOC.Parser.walker.walk(ts); // adds to our symbols
+       
+       // filter symbols by option
+       for (var p = JSDOC.Parser.symbols._index.first(); p; p = JSDOC.Parser.symbols._index.next()) {
+               var symbol = p.value;
+               
+               if (!symbol) continue;
+               
+               if (symbol.is("FILE") || symbol.is("GLOBAL")) {
+                       continue;
+               }
+               else if (!JSDOC.opt.a && !symbol.comment.isUserComment) {
+                       JSDOC.Parser.symbols.deleteSymbol(symbol.alias);
+               }
+               
+               if (/#$/.test(symbol.alias)) { // we don't document prototypes
+                       JSDOC.Parser.symbols.deleteSymbol(symbol.alias);
+               }
+       }
+       
+       return JSDOC.Parser.symbols.toArray();
+}
diff --git a/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js b/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js
new file mode 100644 (file)
index 0000000..9c91193
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+       @namespace Holds functionality related to running plugins.
+*/
+JSDOC.PluginManager = {
+}
+
+/**
+       @param name A unique name that identifies that plugin.
+       @param handlers A collection of named functions. The names correspond to hooks in the core code.
+*/
+JSDOC.PluginManager.registerPlugin = function(/**String*/name, /**Object*/handlers) {
+       if (!defined(JSDOC.PluginManager.plugins))
+               /** The collection of all plugins. Requires a unique name for each.
+               */
+               JSDOC.PluginManager.plugins = {};
+       
+       
+       JSDOC.PluginManager.plugins[name] = handlers;
+}
+
+/**
+       @param hook The name of the hook that is being caught.
+       @param target Any object. This will be passed as the only argument to the handler whose
+       name matches the hook name. Handlers cannot return a value, so must modify the target
+       object to have an effect.
+*/
+JSDOC.PluginManager.run = function(/**String*/hook, /**Mixed*/target) {
+       for (var name in JSDOC.PluginManager.plugins) {
+               if (defined(JSDOC.PluginManager.plugins[name][hook])) {
+                       JSDOC.PluginManager.plugins[name][hook](target);
+               }
+       }
+}
diff --git a/jsdoc-toolkit/app/lib/JSDOC/Symbol.js b/jsdoc-toolkit/app/lib/JSDOC/Symbol.js
new file mode 100644 (file)
index 0000000..1aa44da
--- /dev/null
@@ -0,0 +1,644 @@
+if (typeof JSDOC == "undefined") JSDOC = {};
+
+/**
+       Create a new Symbol.
+       @class Represents a symbol in the source code.
+ */
+JSDOC.Symbol = function() {
+       this.init();
+       if (arguments.length) this.populate.apply(this, arguments);
+}
+
+JSDOC.Symbol.count = 0;
+
+JSDOC.Symbol.prototype.init = function() {
+       this._name = "";
+       this._params = [];
+       this.$args = [];
+       this.addOn = "";
+       this.alias = "";
+       this.augments = [];
+       this.author = "";
+       this.classDesc = "";
+       this.comment = {};
+       this.defaultValue = undefined;
+       this.deprecated = "";
+       this.desc = "";
+       this.example = [];
+       this.exceptions = [];
+       this.fires = [];
+       this.id = JSDOC.Symbol.count++;
+       this.inherits = [];
+       this.inheritsFrom = [];
+       this.isa = "OBJECT";
+       this.isConstant = false;
+       this.isEvent = false;
+       this.isIgnored = false;
+       this.isInner = false;
+       this.isNamespace = false;
+       this.isPrivate = false;
+       this.isStatic = false;
+       this.memberOf = "";
+       this.methods = [];
+       this.properties = [];
+       this.requires = [];
+       this.returns = [];
+       this.see = [];
+       this.since = "";
+       this.srcFile = {};
+       this.type = "";
+       this.version = "";
+}
+
+JSDOC.Symbol.prototype.serialize = function() {
+       var keys = [];
+       for (var p in this) {
+               keys.push (p);
+       }
+       keys = keys.sort();
+       
+       var out = "";
+       for (var i in keys) {
+               if (typeof this[keys[i]] == "function") continue;
+               out += keys[i]+" => "+Dumper.dump(this[keys[i]])+",\n";
+       }
+       return "\n{\n" + out + "}\n";
+}
+
+JSDOC.Symbol.prototype.clone = function() {
+       var clone = new JSDOC.Symbol();
+       clone.populate.apply(clone, this.$args); // repopulate using the original arguments
+       clone.srcFile = this.srcFile; // not the current srcFile, the one when the original was made
+       return clone;
+}
+
+JSDOC.Symbol.prototype.__defineSetter__("name",
+       function(n) { n = n.replace(/^_global_[.#-]/, ""); n = n.replace(/\.prototype\.?/g, '#'); this._name = n; }
+);
+JSDOC.Symbol.prototype.__defineGetter__("name",
+       function() { return this._name; }
+);
+JSDOC.Symbol.prototype.__defineSetter__("params", 
+       function(v) {
+               for (var i = 0, l = v.length; i < l; i++) {
+                       if (v[i].constructor != JSDOC.DocTag) { // may be a generic object parsed from signature, like {type:..., name:...}
+                               this._params[i] = new JSDOC.DocTag("param"+((v[i].type)?" {"+v[i].type+"}":"")+" "+v[i].name);
+                       }
+                       else {
+                               this._params[i] = v[i];
+                       }
+               }
+       }
+);
+JSDOC.Symbol.prototype.__defineGetter__("params",
+       function() { return this._params; }
+);
+
+JSDOC.Symbol.prototype.getEvents = function() {
+       var events = [];
+       for (var i = 0, l = this.methods.length; i < l; i++) {
+               if (this.methods[i].isEvent) {
+                       this.methods[i].name = this.methods[i].name.replace("event:", "");
+                       events.push(this.methods[i]);
+               }
+       }
+       return events;
+}
+
+JSDOC.Symbol.prototype.getMethods = function() {
+       var nonEvents = [];
+       for (var i = 0, l = this.methods.length; i < l; i++) {
+               if (!this.methods[i].isEvent) {
+                       nonEvents.push(this.methods[i]);
+               }
+       }
+       return nonEvents;
+}
+
+
+JSDOC.Symbol.prototype.populate = function(
+               /** String */ name,
+               /** Object[] */ params,
+               /** String */ isa,
+               /** JSDOC.DocComment */ comment
+) {
+       this.$args = arguments;
+       
+       this.name = name;
+       this.alias = this.name;
+       
+       this.params = params;
+       this.isa = (isa == "VIRTUAL")? "OBJECT":isa;
+       this.comment = comment || new JSDOC.DocComment("");
+       this.srcFile = JSDOC.Symbol.srcFile;
+       
+       if (this.is("FILE") && !this.alias) this.alias = this.srcFile;
+
+       this.setTags();
+       
+       if (typeof JSDOC.PluginManager != "undefined") {
+               JSDOC.PluginManager.run("onSymbol", this);
+       }
+}
+
+JSDOC.Symbol.prototype.setTags = function() {
+       // @author
+       var authors = this.comment.getTag("author");
+       if (authors.length) {
+               this.author = authors.map(function($){return $.desc;}).join(", ");
+       }
+       
+       /*t:
+               plan(34, "testing JSDOC.Symbol");
+               
+               requires("../lib/JSDOC/DocComment.js");
+               requires("../frame/String.js");
+               requires("../lib/JSDOC/DocTag.js");
+
+               var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@author Joe Smith*"+"/"));
+               is(sym.author, "Joe Smith", "@author tag, author is found.");
+       */
+       
+       // @desc
+       var descs = this.comment.getTag("desc");
+       if (descs.length) {
+               this.desc = descs.map(function($){return $.desc;}).join("\n"); // multiple descriptions are concatenated into one
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@desc This is a description.*"+"/"));
+               is(sym.desc, "This is a description.", "@desc tag, description is found.");
+       */
+       
+       // @overview
+       if (this.is("FILE")) {
+               if (!this.alias) this.alias = this.srcFile;
+               
+               var overviews = this.comment.getTag("overview");
+               if (overviews.length) {
+                       this.desc = [this.desc].concat(overviews.map(function($){return $.desc;})).join("\n");
+               }
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@overview This is an overview.*"+"/"));
+               is(sym.desc, "\nThis is an overview.", "@overview tag, description is found.");
+       */
+       
+       // @since
+       var sinces = this.comment.getTag("since");
+       if (sinces.length) {
+               this.since = sinces.map(function($){return $.desc;}).join(", ");
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@since 1.01*"+"/"));
+               is(sym.since, "1.01", "@since tag, description is found.");
+       */
+       
+       // @constant
+       if (this.comment.getTag("constant").length) {
+               this.isConstant = true;
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@constant*"+"/"));
+               is(sym.isConstant, true, "@constant tag, isConstant set.");
+       */
+       
+       // @version
+       var versions = this.comment.getTag("version");
+       if (versions.length) {
+               this.version = versions.map(function($){return $.desc;}).join(", ");
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@version 2.0x*"+"/"));
+               is(sym.version, "2.0x", "@version tag, version is found.");
+       */
+       
+       // @deprecated
+       var deprecateds = this.comment.getTag("deprecated");
+       if (deprecateds.length) {
+               this.deprecated = deprecateds.map(function($){return $.desc;}).join("\n");
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@deprecated Use other method.*"+"/"));
+               is(sym.deprecated, "Use other method.", "@deprecated tag, desc is found.");
+       */
+       
+       // @example
+       var examples = this.comment.getTag("example");
+       if (examples.length) {
+               this.example = examples.map(
+                       // trim trailing whitespace
+                       function($) {
+                               $.desc = $.desc.replace(/\s+$/, "");
+                               return $;
+                       }
+               );
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@example This\n  is an example. \n*"+"/"));
+               isnt(typeof sym.example[0], "undefined", "@example tag, creates sym.example array.");
+               is(sym.example[0], "This\n  is an example.", "@example tag, desc is found.");
+       */
+       
+       // @see
+       var sees = this.comment.getTag("see");
+       if (sees.length) {
+               var thisSee = this.see;
+               sees.map(function($){thisSee.push($.desc);});
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@see The other thing.*"+"/"));
+               is(sym.see, "The other thing.", "@see tag, desc is found.");
+       */
+       
+       // @class
+       var classes = this.comment.getTag("class");
+       if (classes.length) {
+               this.isa = "CONSTRUCTOR";
+               this.classDesc = classes[0].desc; // desc can't apply to the constructor as there is none.
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@class This describes the class.*"+"/"));
+               is(sym.isa, "CONSTRUCTOR", "@class tag, makes symbol a constructor.");
+               is(sym.classDesc, "This describes the class.", "@class tag, class description is found.");
+       */
+       
+       // @namespace
+       var namespaces = this.comment.getTag("namespace");
+       if (namespaces.length) {
+               this.classDesc = namespaces[0].desc;
+               this.isNamespace = true;
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@namespace This describes the namespace.*"+"/"));
+               is(sym.classDesc, "This describes the namespace.", "@namespace tag, class description is found.");
+       */
+       
+       // @param
+       var params = this.comment.getTag("param");
+       if (params.length) {
+               // user-defined params overwrite those with same name defined by the parser
+               var thisParams = this.params;
+
+               if (thisParams.length == 0) { // none exist yet, so just bung all these user-defined params straight in
+                       this.params = params;
+               }
+               else { // need to overlay these user-defined params on to existing parser-defined params
+                       for (var i = 0, l = params.length; i < l; i++) {
+                               if (thisParams[i]) {
+                                       if (params[i].type) thisParams[i].type = params[i].type;
+                                       thisParams[i].name = params[i].name;
+                                       thisParams[i].desc = params[i].desc;
+                                       thisParams[i].isOptional = params[i].isOptional;
+                                       thisParams[i].defaultValue = params[i].defaultValue;
+                               }
+                               else thisParams[i] = params[i];
+                       }
+               }
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [{type: "array", name: "pages"}], "FUNCTION", new JSDOC.DocComment("/**Description.*"+"/"));
+               is(sym.params.length, 1, "parser defined param is found.");
+               
+               sym = new JSDOC.Symbol("foo", [], "FUNCTION", new JSDOC.DocComment("/**Description.\n@param {array} pages*"+"/"));
+               is(sym.params.length, 1, "user defined param is found.");
+               is(sym.params[0].type, "array", "user defined param type is found.");
+               is(sym.params[0].name, "pages", "user defined param name is found.");
+               
+               sym = new JSDOC.Symbol("foo", [{type: "array", name: "pages"}], "FUNCTION", new JSDOC.DocComment("/**Description.\n@param {string} uid*"+"/"));
+               is(sym.params.length, 1, "user defined param overwrites parser defined param.");
+               is(sym.params[0].type, "string", "user defined param type overwrites parser defined param type.");
+               is(sym.params[0].name, "uid", "user defined param name overwrites parser defined param name.");
+       
+               sym = new JSDOC.Symbol("foo", [{type: "array", name: "pages"}, {type: "number", name: "count"}], "FUNCTION", new JSDOC.DocComment("/**Description.\n@param {string} uid*"+"/"));
+               is(sym.params.length, 2, "user defined params  overlay parser defined params.");
+               is(sym.params[1].type, "number", "user defined param type overlays parser defined param type.");
+               is(sym.params[1].name, "count", "user defined param name overlays parser defined param name.");
+
+               sym = new JSDOC.Symbol("foo", [], "FUNCTION", new JSDOC.DocComment("/**Description.\n@param {array} pages The pages description.*"+"/"));
+               is(sym.params.length, 1, "user defined param with description is found.");
+               is(sym.params[0].desc, "The pages description.", "user defined param description is found.");
+       */
+       
+       // @constructor
+       if (this.comment.getTag("constructor").length) {
+               this.isa = "CONSTRUCTOR";
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@constructor*"+"/"));
+               is(sym.isa, "CONSTRUCTOR", "@constructor tag, makes symbol a constructor.");
+       */
+       
+       // @static
+       if (this.comment.getTag("static").length) {
+               this.isStatic = true;
+               if (this.isa == "CONSTRUCTOR") {
+                       this.isNamespace = true;
+               }
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@static\n@constructor*"+"/"));
+               is(sym.isStatic, true, "@static tag, makes isStatic true.");
+               is(sym.isNamespace, true, "@static and @constructor tag, makes isNamespace true.");
+       */
+       
+       // @inner
+       if (this.comment.getTag("inner").length) {
+               this.isInner = true;
+               this.isStatic = false;
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@inner*"+"/"));
+               is(sym.isStatic, false, "@inner tag, makes isStatic false.");
+               is(sym.isInner, true, "@inner makes isInner true.");
+       */
+       
+       // @name
+       var names = this.comment.getTag("name");
+       if (names.length) {
+               this.name = names[0].desc;
+       }
+       
+       /*t:
+               // todo
+       */
+       
+       // @field
+       if (this.comment.getTag("field").length) {
+               this.isa = "OBJECT";
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "FUNCTION", new JSDOC.DocComment("/**@field*"+"/"));
+               is(sym.isa, "OBJECT", "@field tag, makes symbol an object.");
+       */
+       
+       // @function
+       if (this.comment.getTag("function").length) {
+               this.isa = "FUNCTION";
+               if (/event:/.test(this.alias)) this.isEvent = true;
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@function*"+"/"));
+               is(sym.isa, "FUNCTION", "@function tag, makes symbol a function.");
+       */
+       
+       // @event
+       var events = this.comment.getTag("event");
+       if (events.length) {
+               this.isa = "FUNCTION";
+               this.isEvent = true;
+               if (!/event:/.test(this.alias))
+                       this.alias = this.alias.replace(/^(.*[.#-])([^.#-]+)$/, "$1event:$2");
+       }
+       
+       /*t:
+               var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@event*"+"/"));
+               is(sym.isa, "FUNCTION", "@event tag, makes symbol a function.");
+               is(sym.isEvent, true, "@event makes isEvent true.");
+       */
+       
+       // @fires
+       var fires = this.comment.getTag("fires");
+       if (fires.length) {
+               for (var i = 0; i < fires.length; i++) {
+                       this.fires.push(fires[i].desc);
+               }
+       }
+       
+       /*t:
+               // todo
+       */
+       
+       // @property
+       var properties = this.comment.getTag("property");
+       if (properties.length) {
+               thisProperties = this.properties;
+               for (var i = 0; i < properties.length; i++) {
+                       var property = new JSDOC.Symbol(this.alias+"#"+properties[i].name, [], "OBJECT", new JSDOC.DocComment("/**"+properties[i].desc+"*/"));
+                       // TODO: shouldn't the following happen in the addProperty method of Symbol?
+                       if (properties[i].type) property.type = properties[i].type;
+                       if (properties[i].defaultValue) property.defaultValue = properties[i].defaultValue;
+                       this.addProperty(property);
+                       if (!JSDOC.Parser.symbols.getSymbolByName(property.name))
+                               JSDOC.Parser.addSymbol(property);
+               }
+       }
+       
+       /*t:
+               // todo
+       */
+
+       // @return
+       var returns = this.comment.getTag("return");
+       if (returns.length) { // there can be many return tags in a single doclet
+               this.returns = returns;
+               this.type = returns.map(function($){return $.type}).join(", ");
+       }
+       
+       /*t:
+               // todo
+       */
+       
+       // @exception
+       this.exceptions = this.comment.getTag("throws");
+       
+       /*t:
+               // todo
+       */
+       
+       // @requires
+       var requires = this.comment.getTag("requires");
+       if (requires.length) {
+               this.requires = requires.map(function($){return $.desc});
+       }
+       
+       /*t:
+               // todo
+       */
+       
+       // @type
+       var types = this.comment.getTag("type");
+       if (types.length) {
+               this.type = types[0].desc; //multiple type tags are ignored
+       }
+       
+       /*t:
+               // todo
+       */
+       
+       // @private
+       if (this.comment.getTag("private").length || this.isInner) {
+               this.isPrivate = true;
+       }
+       
+       // @ignore
+       if (this.comment.getTag("ignore").length) {
+               this.isIgnored = true;
+       }
+       
+       /*t:
+               // todo
+       */
+       
+       // @inherits ... as ...
+       var inherits = this.comment.getTag("inherits");
+       if (inherits.length) {
+               for (var i = 0; i < inherits.length; i++) {
+                       if (/^\s*([a-z$0-9_.#:-]+)(?:\s+as\s+([a-z$0-9_.#:-]+))?/i.test(inherits[i].desc)) {
+                               var inAlias = RegExp.$1;
+                               var inAs = RegExp.$2 || inAlias;
+
+                               if (inAlias) inAlias = inAlias.replace(/\.prototype\.?/g, "#");
+                               
+                               if (inAs) {
+                                       inAs = inAs.replace(/\.prototype\.?/g, "#");
+                                       inAs = inAs.replace(/^this\.?/, "#");
+                               }
+
+                               if (inAs.indexOf(inAlias) != 0) { //not a full namepath
+                                       var joiner = ".";
+                                       if (this.alias.charAt(this.alias.length-1) == "#" || inAs.charAt(0) == "#") {
+                                               joiner = "";
+                                       }
+                                       inAs = this.alias + joiner + inAs;
+                               }
+                       }
+                       this.inherits.push({alias: inAlias, as: inAs});
+               }
+       }
+       
+       /*t:
+               // todo
+       */
+       
+       // @augments
+       this.augments = this.comment.getTag("augments");
+       
+       // @default
+       var defaults = this.comment.getTag("default");
+       if (defaults.length) {
+               if (this.is("OBJECT")) {
+                       this.defaultValue = defaults[0].desc;
+               }
+       }
+       
+       /*t:
+               // todo
+       */
+       
+       // @memberOf
+       var memberOfs = this.comment.getTag("memberOf");
+       if (memberOfs.length) {
+               this.memberOf = memberOfs[0].desc;
+               this.memberOf = this.memberOf.replace(/\.prototype\.?/g, "#");
+       }
+
+       /*t:
+               // todo
+       */
+       
+       // @public
+       if (this.comment.getTag("public").length) {
+               this.isPrivate = false;
+       }
+       
+       /*t:
+               // todo
+       */
+               
+       if (JSDOC.PluginManager) {
+               JSDOC.PluginManager.run("onSetTags", this);
+       }
+}
+
+JSDOC.Symbol.prototype.is = function(what) {
+       return this.isa === what;
+}
+
+JSDOC.Symbol.prototype.isBuiltin = function() {
+       return JSDOC.Lang.isBuiltin(this.alias);
+}
+
+JSDOC.Symbol.prototype.setType = function(/**String*/comment, /**Boolean*/overwrite) {
+       if (!overwrite && this.type) return;
+       var typeComment = JSDOC.DocComment.unwrapComment(comment);
+       this.type = typeComment;
+}
+
+JSDOC.Symbol.prototype.inherit = function(symbol) {
+       if (!this.hasMember(symbol.name) && !symbol.isInner) {
+               if (symbol.is("FUNCTION"))
+                       this.methods.push(symbol);
+               else if (symbol.is("OBJECT"))
+                       this.properties.push(symbol);
+       }
+}
+
+JSDOC.Symbol.prototype.hasMember = function(name) {
+       return (this.hasMethod(name) || this.hasProperty(name));
+}
+
+JSDOC.Symbol.prototype.addMember = function(symbol) {
+       if (symbol.is("FUNCTION")) { this.addMethod(symbol); }
+       else if (symbol.is("OBJECT")) { this.addProperty(symbol); }
+}
+
+JSDOC.Symbol.prototype.hasMethod = function(name) {
+       var thisMethods = this.methods;
+       for (var i = 0, l = thisMethods.length; i < l; i++) {
+               if (thisMethods[i].name == name) return true;
+               if (thisMethods[i].alias == name) return true;
+       }
+       return false;
+}
+
+JSDOC.Symbol.prototype.addMethod = function(symbol) {
+       var methodAlias = symbol.alias;
+       var thisMethods = this.methods;
+       for (var i = 0, l = thisMethods.length; i < l; i++) {
+               if (thisMethods[i].alias == methodAlias) {
+                       thisMethods[i] = symbol; // overwriting previous method
+                       return;
+               }
+       }
+       thisMethods.push(symbol); // new method with this alias
+}
+
+JSDOC.Symbol.prototype.hasProperty = function(name) {
+       var thisProperties = this.properties;
+       for (var i = 0, l = thisProperties.length; i < l; i++) {
+               if (thisProperties[i].name == name) return true;
+               if (thisProperties[i].alias == name) return true;
+       }
+       return false;
+}
+
+JSDOC.Symbol.prototype.addProperty = function(symbol) {
+       var propertyAlias = symbol.alias;
+       var thisProperties = this.properties;
+       for (var i = 0, l = thisProperties.length; i < l; i++) {
+               if (thisProperties[i].alias == propertyAlias) {
+                       thisProperties[i] = symbol; // overwriting previous property
+                       return;
+               }
+       }
+
+       thisProperties.push(symbol); // new property with this alias
+}
+
+JSDOC.Symbol.srcFile = ""; //running reference to the current file being parsed
diff --git a/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js b/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js
new file mode 100644 (file)
index 0000000..8e3a2eb
--- /dev/null
@@ -0,0 +1,243 @@
+/** @constructor */
+JSDOC.SymbolSet = function() {
+       this.init();
+}
+
+JSDOC.SymbolSet.prototype.init = function() {
+       this._index = new Hash();
+}
+
+JSDOC.SymbolSet.prototype.keys = function() {
+       return this._index.keys();
+}
+
+JSDOC.SymbolSet.prototype.hasSymbol = function(alias) {
+       return this._index.hasKey(alias);
+}
+
+JSDOC.SymbolSet.prototype.addSymbol = function(symbol) {
+       if (JSDOC.opt.a && this.hasSymbol(symbol.alias)) {
+               LOG.warn("Overwriting symbol documentation for: " + symbol.alias + ".");
+               this.deleteSymbol(symbol.alias);
+       }
+       this._index.set(symbol.alias, symbol);
+}
+
+JSDOC.SymbolSet.prototype.getSymbol = function(alias) {
+       if (this.hasSymbol(alias)) return this._index.get(alias);
+}
+
+JSDOC.SymbolSet.prototype.getSymbolByName = function(name) {
+       for (var p = this._index.first(); p; p = this._index.next()) {
+               var symbol = p.value;
+               if (symbol.name == name) return symbol;
+       }
+}
+
+JSDOC.SymbolSet.prototype.toArray = function() {
+       return this._index.values();
+}
+
+JSDOC.SymbolSet.prototype.deleteSymbol = function(alias) {
+       if (!this.hasSymbol(alias)) return;
+       this._index.drop(alias);
+}
+
+JSDOC.SymbolSet.prototype.renameSymbol = function(oldName, newName) {
+       // todo: should check if oldname or newname already exist
+       this._index.replace(oldName, newName);
+       this._index.get(newName).alias = newName;
+       return newName;
+}
+
+JSDOC.SymbolSet.prototype.relate = function() {
+       this.resolveBorrows();
+       this.resolveMemberOf();
+       this.resolveAugments();
+}
+
+JSDOC.SymbolSet.prototype.resolveBorrows = function() {
+       for (var p = this._index.first(); p; p = this._index.next()) {
+               var symbol = p.value;
+               if (symbol.is("FILE") || symbol.is("GLOBAL")) continue;
+               
+               var borrows = symbol.inherits;
+               for (var i = 0; i < borrows.length; i++) {
+               
+if (/#$/.test(borrows[i].alias)) {
+       LOG.warn("Attempted to borrow entire instance of "+borrows[i].alias+" but that feature is not yet implemented.");
+       return;
+}
+                       var borrowed = this.getSymbol(borrows[i].alias);
+                       
+                       if (!borrowed) {
+                               LOG.warn("Can't borrow undocumented "+borrows[i].alias+".");
+                               continue;
+                       }
+
+                       if (borrows[i].as == borrowed.alias) {
+                               var assumedName = borrowed.name.split(/([#.-])/).pop();
+                               borrows[i].as = symbol.name+RegExp.$1+assumedName;
+                               LOG.inform("Assuming borrowed as name is "+borrows[i].as+" but that feature is experimental.");
+                       }
+                       
+                       var borrowAsName = borrows[i].as;
+                       var borrowAsAlias = borrowAsName;
+                       if (!borrowAsName) {
+                               LOG.warn("Malformed @borrow, 'as' is required.");
+                               continue;
+                       }
+                       
+                       if (borrowAsName.length > symbol.alias.length && borrowAsName.indexOf(symbol.alias) == 0) {
+                               borrowAsName = borrowAsName.replace(borrowed.alias, "")
+                       }
+                       else {
+                               var joiner = "";
+                               if (borrowAsName.charAt(0) != "#") joiner = ".";
+                               borrowAsAlias = borrowed.alias + joiner + borrowAsName;
+                       }
+                       
+                       borrowAsName = borrowAsName.replace(/^[#.]/, "");
+                                       
+                       if (this.hasSymbol(borrowAsAlias)) continue;
+
+                       var clone = borrowed.clone();
+                       clone.name = borrowAsName;
+                       clone.alias = borrowAsAlias;
+                       this.addSymbol(clone);
+               }
+       }
+}
+
+JSDOC.SymbolSet.prototype.resolveMemberOf = function() {
+       for (var p = this._index.first(); p; p = this._index.next()) {
+               var symbol = p.value;
+
+               if (symbol.is("FILE") || symbol.is("GLOBAL")) continue;
+               
+               // the memberOf value was provided in the @memberOf tag
+               else if (symbol.memberOf) {                     
+                       // like foo.bar is a memberOf foo
+                       if (symbol.alias.indexOf(symbol.memberOf) == 0) {
+                               var memberMatch = new RegExp("^("+symbol.memberOf+")[.#-]?(.+)$");
+                               var aliasParts = symbol.alias.match(memberMatch);
+                               
+                               if (aliasParts) {
+                                       symbol.memberOf = aliasParts[1];
+                                       symbol.name = aliasParts[2];
+                               }
+                               
+                               var nameParts = symbol.name.match(memberMatch);
+
+                               if (nameParts) {
+                                       symbol.name = nameParts[2];
+                               }
+                       }
+                       // like bar is a memberOf foo
+                       else {
+                               var joiner = symbol.memberOf.charAt(symbol.memberOf.length-1);
+                               if (!/[.#-]/.test(joiner)) symbol.memberOf += ".";
+                               this.renameSymbol(symbol.alias, symbol.memberOf + symbol.name);
+                       }
+               }
+               // the memberOf must be calculated
+               else {
+                       var parts = symbol.alias.match(/^(.*[.#-])([^.#-]+)$/);
+
+                       if (parts) {
+                               symbol.memberOf = parts[1];
+                               symbol.name = parts[2];                         
+                       }
+               }
+
+               // set isStatic, isInner
+               if (symbol.memberOf) {
+                       switch (symbol.memberOf.charAt(symbol.memberOf.length-1)) {
+                               case '#' :
+                                       symbol.isStatic = false;
+                                       symbol.isInner = false;
+                               break;
+                               case '.' :
+                                       symbol.isStatic = true;
+                                       symbol.isInner = false;
+                               break;
+                               case '-' :
+                                       symbol.isStatic = false;
+                                       symbol.isInner = true;
+                               break;
+                               default: // memberOf ends in none of the above
+                                       symbol.isStatic = true;
+                               break;
+                       }
+               }
+               
+               // unowned methods and fields belong to the global object
+               if (!symbol.is("CONSTRUCTOR") && !symbol.isNamespace && symbol.memberOf == "") {
+                       symbol.memberOf = "_global_";
+               }
+
+               // clean up
+               if (symbol.memberOf.match(/[.#-]$/)) {
+                       symbol.memberOf = symbol.memberOf.substr(0, symbol.memberOf.length-1);
+               }
+               // add to parent's methods or properties list
+               if (symbol.memberOf) {
+
+                       var container = this.getSymbol(symbol.memberOf);
+                       if (!container) {
+                               if (JSDOC.Lang.isBuiltin(symbol.memberOf)) container = JSDOC.Parser.addBuiltin(symbol.memberOf);
+                               else {
+                                       LOG.warn("Trying to document "+symbol.name +" as a member of undocumented symbol "+symbol.memberOf+".");
+                               }
+                       }
+                       
+                       if (container) container.addMember(symbol);
+               }
+       }
+}
+
+JSDOC.SymbolSet.prototype.resolveAugments = function() {
+       for (var p = this._index.first(); p; p = this._index.next()) {
+               var symbol = p.value;
+               
+               if (symbol.alias == "_global_" || symbol.is("FILE")) continue;
+               JSDOC.SymbolSet.prototype.walk.apply(this, [symbol]);
+       }
+}
+
+JSDOC.SymbolSet.prototype.walk = function(symbol) {
+       var augments = symbol.augments;
+       for(var i = 0; i < augments.length; i++) {
+               var contributer = this.getSymbol(augments[i]);
+               if (!contributer && JSDOC.Lang.isBuiltin(''+augments[i])) {
+                       contributer = new JSDOC.Symbol("_global_."+augments[i], [], augments[i], new JSDOC.DocComment("Built in."));
+                       contributer.isNamespace = true;
+                       contributer.srcFile = "";
+                       contributer.isPrivate = false;
+                       JSDOC.Parser.addSymbol(contributer);
+               }
+               
+               if (contributer) {                      
+                       if (contributer.augments.length) {
+                               JSDOC.SymbolSet.prototype.walk.apply(this, [contributer]);
+                       }
+                       
+                       symbol.inheritsFrom.push(contributer.alias);
+                       //if (!isUnique(symbol.inheritsFrom)) {
+                       //      LOG.warn("Can't resolve augments: Circular reference: "+symbol.alias+" inherits from "+contributer.alias+" more than once.");
+                       //}
+                       //else {
+                               var cmethods = contributer.methods;
+                               var cproperties = contributer.properties;
+                               
+                               for (var ci = 0, cl = cmethods.length; ci < cl; ci++) {
+                                       if (!cmethods[ci].isStatic) symbol.inherit(cmethods[ci]);
+                               }
+                               for (var ci = 0, cl = cproperties.length; ci < cl; ci++) {
+                                       if (!cproperties[ci].isStatic) symbol.inherit(cproperties[ci]);
+                               }       
+                       //}
+               }
+               else LOG.warn("Can't augment contributer: "+augments[i]+", not found.");
+       }
+}
diff --git a/jsdoc-toolkit/app/lib/JSDOC/TextStream.js b/jsdoc-toolkit/app/lib/JSDOC/TextStream.js
new file mode 100644 (file)
index 0000000..ccc48a8
--- /dev/null
@@ -0,0 +1,41 @@
+
+/**
+       @constructor
+*/
+JSDOC.TextStream = function(text) {
+       if (typeof(text) == "undefined") text = "";
+       text = ""+text;
+       this.text = text;
+       this.cursor = 0;
+}
+
+JSDOC.TextStream.prototype.look = function(n) {
+       if (typeof n == "undefined") n = 0;
+       
+       if (this.cursor+n < 0 || this.cursor+n >= this.text.length) {
+               var result = new String("");
+               result.eof = true;
+               return result;
+       }
+       return this.text.charAt(this.cursor+n);
+}
+
+JSDOC.TextStream.prototype.next = function(n) {
+       if (typeof n == "undefined") n = 1;
+       if (n < 1) return null;
+       
+       var pulled = "";
+       for (var i = 0; i < n; i++) {
+               if (this.cursor+i < this.text.length) {
+                       pulled += this.text.charAt(this.cursor+i);
+               }
+               else {
+                       var result = new String("");
+                       result.eof = true;
+                       return result;
+               }
+       }
+
+       this.cursor += n;
+       return pulled;
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/lib/JSDOC/Token.js b/jsdoc-toolkit/app/lib/JSDOC/Token.js
new file mode 100644 (file)
index 0000000..fb7f9d9
--- /dev/null
@@ -0,0 +1,18 @@
+if (typeof JSDOC == "undefined") JSDOC = {};
+
+/**
+       @constructor
+*/
+JSDOC.Token = function(data, type, name) {
+       this.data = data;
+       this.type = type;
+       this.name = name;
+}
+
+JSDOC.Token.prototype.toString = function() { 
+       return "<"+this.type+" name=\""+this.name+"\">"+this.data+"</"+this.type+">";
+}
+
+JSDOC.Token.prototype.is = function(what) {
+       return this.name === what || this.type === what;
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js b/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js
new file mode 100644 (file)
index 0000000..9f658fb
--- /dev/null
@@ -0,0 +1,332 @@
+if (typeof JSDOC == "undefined") JSDOC = {};
+
+/**
+       @class Search a {@link JSDOC.TextStream} for language tokens.
+*/
+JSDOC.TokenReader = function() {
+       this.keepDocs = true;
+       this.keepWhite = false;
+       this.keepComments = false;
+}
+
+/**
+       @type {JSDOC.Token[]}
+ */
+JSDOC.TokenReader.prototype.tokenize = function(/**JSDOC.TextStream*/stream) {
+       var tokens = [];
+       /**@ignore*/ tokens.last    = function() { return tokens[tokens.length-1]; }
+       /**@ignore*/ tokens.lastSym = function() {
+               for (var i = tokens.length-1; i >= 0; i--) {
+                       if (!(tokens[i].is("WHIT") || tokens[i].is("COMM"))) return tokens[i];
+               }
+       }
+
+       while (!stream.look().eof) {
+               if (this.read_mlcomment(stream, tokens)) continue;
+               if (this.read_slcomment(stream, tokens)) continue;
+               if (this.read_dbquote(stream, tokens))   continue;
+               if (this.read_snquote(stream, tokens))   continue;
+               if (this.read_regx(stream, tokens))      continue;
+               if (this.read_numb(stream, tokens))      continue;
+               if (this.read_punc(stream, tokens))      continue;
+               if (this.read_newline(stream, tokens))   continue;
+               if (this.read_space(stream, tokens))     continue;
+               if (this.read_word(stream, tokens))      continue;
+               
+               // if execution reaches here then an error has happened
+               tokens.push(new JSDOC.Token(stream.next(), "TOKN", "UNKNOWN_TOKEN"));
+       }
+       return tokens;
+}
+
+/**
+       @returns {Boolean} Was the token found?
+ */
+JSDOC.TokenReader.prototype.read_word = function(/**JSDOC.TokenStream*/stream, tokens) {
+       var found = "";
+       while (!stream.look().eof && JSDOC.Lang.isWordChar(stream.look())) {
+               found += stream.next();
+       }
+       
+       if (found === "") {
+               return false;
+       }
+       else {
+               var name;
+               if ((name = JSDOC.Lang.keyword(found))) tokens.push(new JSDOC.Token(found, "KEYW", name));
+               else tokens.push(new JSDOC.Token(found, "NAME", "NAME"));
+               return true;
+       }
+}
+
+/**
+       @returns {Boolean} Was the token found?
+ */
+JSDOC.TokenReader.prototype.read_punc = function(/**JSDOC.TokenStream*/stream, tokens) {
+       var found = "";
+       var name;
+       while (!stream.look().eof && JSDOC.Lang.punc(found+stream.look())) {
+               found += stream.next();
+       }
+       
+       if (found === "") {
+               return false;
+       }
+       else {
+               tokens.push(new JSDOC.Token(found, "PUNC", JSDOC.Lang.punc(found)));
+               return true;
+       }
+}
+
+/**
+       @returns {Boolean} Was the token found?
+ */
+JSDOC.TokenReader.prototype.read_space = function(/**JSDOC.TokenStream*/stream, tokens) {
+       var found = "";
+       
+       while (!stream.look().eof && JSDOC.Lang.isSpace(stream.look())) {
+               found += stream.next();
+       }
+       
+       if (found === "") {
+               return false;
+       }
+       else {
+               if (this.collapseWhite) found = " ";
+               if (this.keepWhite) tokens.push(new JSDOC.Token(found, "WHIT", "SPACE"));
+               return true;
+       }
+}
+
+/**
+       @returns {Boolean} Was the token found?
+ */
+JSDOC.TokenReader.prototype.read_newline = function(/**JSDOC.TokenStream*/stream, tokens) {
+       var found = "";
+       
+       while (!stream.look().eof && JSDOC.Lang.isNewline(stream.look())) {
+               found += stream.next();
+       }
+       
+       if (found === "") {
+               return false;
+       }
+       else {
+               if (this.collapseWhite) found = "\n";
+               if (this.keepWhite) tokens.push(new JSDOC.Token(found, "WHIT", "NEWLINE"));
+               return true;
+       }
+}
+
+/**
+       @returns {Boolean} Was the token found?
+ */
+JSDOC.TokenReader.prototype.read_mlcomment = function(/**JSDOC.TokenStream*/stream, tokens) {
+       if (stream.look() == "/" && stream.look(1) == "*") {
+               var found = stream.next(2);
+               
+               while (!stream.look().eof && !(stream.look(-1) == "/" && stream.look(-2) == "*")) {
+                       found += stream.next();
+               }
+               
+               // to start doclet we allow /** or /*** but not /**/ or /****
+               if (/^\/\*\*([^\/]|\*[^*])/.test(found) && this.keepDocs) tokens.push(new JSDOC.Token(found, "COMM", "JSDOC"));
+               else if (this.keepComments) tokens.push(new JSDOC.Token(found, "COMM", "MULTI_LINE_COMM"));
+               return true;
+       }
+       return false;
+}
+
+/**
+       @returns {Boolean} Was the token found?
+ */
+JSDOC.TokenReader.prototype.read_slcomment = function(/**JSDOC.TokenStream*/stream, tokens) {
+       var found;
+       if (
+               (stream.look() == "/" && stream.look(1) == "/" && (found=stream.next(2)))
+               || 
+               (stream.look() == "<" && stream.look(1) == "!" && stream.look(2) == "-" && stream.look(3) == "-" && (found=stream.next(4)))
+       ) {
+               
+               while (!stream.look().eof && !JSDOC.Lang.isNewline(stream.look())) {
+                       found += stream.next();
+               }
+               
+               if (this.keepComments) {
+                       tokens.push(new JSDOC.Token(found, "COMM", "SINGLE_LINE_COMM"));
+               }
+               return true;
+       }
+       return false;
+}
+
+/**
+       @returns {Boolean} Was the token found?
+ */
+JSDOC.TokenReader.prototype.read_dbquote = function(/**JSDOC.TokenStream*/stream, tokens) {
+       if (stream.look() == "\"") {
+               // find terminator
+               var string = stream.next();
+               
+               while (!stream.look().eof) {
+                       if (stream.look() == "\\") {
+                               if (JSDOC.Lang.isNewline(stream.look(1))) {
+                                       do {
+                                               stream.next();
+                                       } while (!stream.look().eof && JSDOC.Lang.isNewline(stream.look()));
+                                       string += "\\\n";
+                               }
+                               else {
+                                       string += stream.next(2);
+                               }
+                       }
+                       else if (stream.look() == "\"") {
+                               string += stream.next();
+                               tokens.push(new JSDOC.Token(string, "STRN", "DOUBLE_QUOTE"));
+                               return true;
+                       }
+                       else {
+                               string += stream.next();
+                       }
+               }
+       }
+       return false; // error! unterminated string
+}
+
+/**
+       @returns {Boolean} Was the token found?
+ */
+JSDOC.TokenReader.prototype.read_snquote = function(/**JSDOC.TokenStream*/stream, tokens) {
+       if (stream.look() == "'") {
+               // find terminator
+               var string = stream.next();
+               
+               while (!stream.look().eof) {
+                       if (stream.look() == "\\") { // escape sequence
+                               string += stream.next(2);
+                       }
+                       else if (stream.look() == "'") {
+                               string += stream.next();
+                               tokens.push(new JSDOC.Token(string, "STRN", "SINGLE_QUOTE"));
+                               return true;
+                       }
+                       else {
+                               string += stream.next();
+                       }
+               }
+       }
+       return false; // error! unterminated string
+}
+
+/**
+       @returns {Boolean} Was the token found?
+ */
+JSDOC.TokenReader.prototype.read_numb = function(/**JSDOC.TokenStream*/stream, tokens) {
+       if (stream.look() === "0" && stream.look(1) == "x") {
+               return this.read_hex(stream, tokens);
+       }
+       
+       var found = "";
+       
+       while (!stream.look().eof && JSDOC.Lang.isNumber(found+stream.look())){
+               found += stream.next();
+       }
+       
+       if (found === "") {
+               return false;
+       }
+       else {
+               if (/^0[0-7]/.test(found)) tokens.push(new JSDOC.Token(found, "NUMB", "OCTAL"));
+               else tokens.push(new JSDOC.Token(found, "NUMB", "DECIMAL"));
+               return true;
+       }
+}
+/*t:
+       requires("../lib/JSDOC/TextStream.js");
+       requires("../lib/JSDOC/Token.js");
+       requires("../lib/JSDOC/Lang.js");
+       
+       plan(3, "testing JSDOC.TokenReader.prototype.read_numb");
+       
+       //// setup
+       var src = "function foo(num){while (num+8.0 >= 0x20 && num < 0777){}}";
+       var tr = new JSDOC.TokenReader();
+       var tokens = tr.tokenize(new JSDOC.TextStream(src));
+       
+       var hexToken, octToken, decToken;
+       for (var i = 0; i < tokens.length; i++) {
+               if (tokens[i].name == "HEX_DEC") hexToken = tokens[i];
+               if (tokens[i].name == "OCTAL") octToken = tokens[i];
+               if (tokens[i].name == "DECIMAL") decToken = tokens[i];
+       }
+       ////
+       
+       is(decToken.data, "8.0", "decimal number is found in source.");
+       is(hexToken.data, "0x20", "hexdec number is found in source (issue #99).");
+       is(octToken.data, "0777", "octal number is found in source.");
+*/
+
+/**
+       @returns {Boolean} Was the token found?
+ */
+JSDOC.TokenReader.prototype.read_hex = function(/**JSDOC.TokenStream*/stream, tokens) {
+       var found = stream.next(2);
+       
+       while (!stream.look().eof) {
+               if (JSDOC.Lang.isHexDec(found) && !JSDOC.Lang.isHexDec(found+stream.look())) { // done
+                       tokens.push(new JSDOC.Token(found, "NUMB", "HEX_DEC"));
+                       return true;
+               }
+               else {
+                       found += stream.next();
+               }
+       }
+       return false;
+}
+
+/**
+       @returns {Boolean} Was the token found?
+ */
+JSDOC.TokenReader.prototype.read_regx = function(/**JSDOC.TokenStream*/stream, tokens) {
+       var last;
+       if (
+               stream.look() == "/"
+               && 
+               (
+                       
+                       (
+                               !(last = tokens.lastSym()) // there is no last, the regex is the first symbol
+                               || 
+                               (
+                                          !last.is("NUMB")
+                                       && !last.is("NAME")
+                                       && !last.is("RIGHT_PAREN")
+                                       && !last.is("RIGHT_BRACKET")
+                               )
+                       )
+               )
+       ) {
+               var regex = stream.next();
+               
+               while (!stream.look().eof) {
+                       if (stream.look() == "\\") { // escape sequence
+                               regex += stream.next(2);
+                       }
+                       else if (stream.look() == "/") {
+                               regex += stream.next();
+                               
+                               while (/[gmi]/.test(stream.look())) {
+                                       regex += stream.next();
+                               }
+                               
+                               tokens.push(new JSDOC.Token(regex, "REGX", "REGX"));
+                               return true;
+                       }
+                       else {
+                               regex += stream.next();
+                       }
+               }
+               // error: unterminated regex
+       }
+       return false;
+}
diff --git a/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js b/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js
new file mode 100644 (file)
index 0000000..1eeb44c
--- /dev/null
@@ -0,0 +1,133 @@
+if (typeof JSDOC == "undefined") JSDOC = {};
+
+/**
+       @constructor
+*/
+JSDOC.TokenStream = function(tokens) {
+       this.tokens = (tokens || []);
+       this.rewind();
+}
+
+/**
+       @constructor
+       @private
+*/
+function VoidToken(/**String*/type) {
+       this.toString = function() {return "<VOID type=\""+type+"\">"};
+       this.is = function(){return false;}
+}
+
+JSDOC.TokenStream.prototype.rewind = function() {
+       this.cursor = -1;
+}
+
+/**
+       @type JSDOC.Token
+*/
+JSDOC.TokenStream.prototype.look = function(/**Number*/n, /**Boolean*/considerWhitespace) {
+       if (typeof n == "undefined") n = 0;
+
+       if (considerWhitespace == true) {
+               if (this.cursor+n < 0 || this.cursor+n > this.tokens.length) return {};
+               return this.tokens[this.cursor+n];
+       }
+       else {
+               var count = 0;
+               var i = this.cursor;
+
+               while (true) {
+                       if (i < 0) return new JSDOC.Token("", "VOID", "START_OF_STREAM");
+                       else if (i > this.tokens.length) return new JSDOC.Token("", "VOID", "END_OF_STREAM");
+
+                       if (i != this.cursor && (this.tokens[i] === undefined || this.tokens[i].is("WHIT"))) {
+                               if (n < 0) i--; else i++;
+                               continue;
+                       }
+                       
+                       if (count == Math.abs(n)) {
+                               return this.tokens[i];
+                       }
+                       count++;
+                       (n < 0)? i-- : i++;
+               }
+
+               return new JSDOC.Token("", "VOID", "STREAM_ERROR"); // because null isn't an object and caller always expects an object
+       }
+}
+
+/**
+       @type JSDOC.Token|JSDOC.Token[]
+*/
+JSDOC.TokenStream.prototype.next = function(/**Number*/howMany) {
+       if (typeof howMany == "undefined") howMany = 1;
+       if (howMany < 1) return null;
+       var got = [];
+
+       for (var i = 1; i <= howMany; i++) {
+               if (this.cursor+i >= this.tokens.length) {
+                       return null;
+               }
+               got.push(this.tokens[this.cursor+i]);
+       }
+       this.cursor += howMany;
+
+       if (howMany == 1) {
+               return got[0];
+       }
+       else return got;
+}
+
+/**
+       @type JSDOC.Token[]
+*/
+JSDOC.TokenStream.prototype.balance = function(/**String*/start, /**String*/stop) {
+       if (!stop) stop = JSDOC.Lang.matching(start);
+       
+       var depth = 0;
+       var got = [];
+       var started = false;
+       
+       while ((token = this.look())) {
+               if (token.is(start)) {
+                       depth++;
+                       started = true;
+               }
+               
+               if (started) {
+                       got.push(token);
+               }
+               
+               if (token.is(stop)) {
+                       depth--;
+                       if (depth == 0) return got;
+               }
+               if (!this.next()) break;
+       }
+}
+
+JSDOC.TokenStream.prototype.getMatchingToken = function(/**String*/start, /**String*/stop) {
+       var depth = 0;
+       var cursor = this.cursor;
+       
+       if (!start) {
+               start = JSDOC.Lang.matching(stop);
+               depth = 1;
+       }
+       if (!stop) stop = JSDOC.Lang.matching(start);
+       
+       while ((token = this.tokens[cursor])) {
+               if (token.is(start)) {
+                       depth++;
+               }
+               
+               if (token.is(stop) && cursor) {
+                       depth--;
+                       if (depth == 0) return this.tokens[cursor];
+               }
+               cursor++;
+       }
+}
+
+JSDOC.TokenStream.prototype.insertAhead = function(/**JSDOC.Token*/token) {
+       this.tokens.splice(this.cursor+1, 0, token);
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/lib/JSDOC/Util.js b/jsdoc-toolkit/app/lib/JSDOC/Util.js
new file mode 100644 (file)
index 0000000..6d7edb3
--- /dev/null
@@ -0,0 +1,32 @@
+/**
+ * @namespace
+ * @deprecated Use {@link FilePath} instead.
+ */
+JSDOC.Util = {
+}
+
+/**
+ * @deprecated Use {@link FilePath.fileName} instead.
+ */
+JSDOC.Util.fileName = function(path) {
+       LOG.warn("JSDOC.Util.fileName is deprecated. Use FilePath.fileName instead.");
+       var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
+       return path.substring(nameStart);
+}
+
+/**
+ * @deprecated Use {@link FilePath.fileExtension} instead.
+ */
+JSDOC.Util.fileExtension = function(filename) {
+       LOG.warn("JSDOC.Util.fileExtension is deprecated. Use FilePath.fileExtension instead.");
+       return filename.split(".").pop().toLowerCase();
+};
+
+/**
+ * @deprecated Use {@link FilePath.dir} instead.
+ */
+JSDOC.Util.dir = function(path) {
+       LOG.warn("JSDOC.Util.dir is deprecated. Use FilePath.dir instead.");
+       var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
+       return path.substring(0, nameStart-1);
+}
diff --git a/jsdoc-toolkit/app/lib/JSDOC/Walker.js b/jsdoc-toolkit/app/lib/JSDOC/Walker.js
new file mode 100644 (file)
index 0000000..6ecaea8
--- /dev/null
@@ -0,0 +1,507 @@
+if (typeof JSDOC == "undefined") JSDOC = {};
+
+/** @constructor */
+JSDOC.Walker = function(/**JSDOC.TokenStream*/ts) {
+       this.init();
+       if (typeof ts != "undefined") {
+               this.walk(ts);
+       }
+}
+
+JSDOC.Walker.prototype.init = function() {
+       this.ts = null;
+
+       var globalSymbol = new JSDOC.Symbol("_global_", [], "GLOBAL", new JSDOC.DocComment(""));
+       globalSymbol.isNamespace = true;
+       globalSymbol.srcFile = "";
+       globalSymbol.isPrivate = false;
+       JSDOC.Parser.addSymbol(globalSymbol);
+       this.lastDoc = null;
+       this.token = null;
+       
+       /**
+               The chain of symbols under which we are currently nested.
+               @type Array
+       */
+       this.namescope = [globalSymbol];
+       this.namescope.last = function(n){ if (!n) n = 0; return this[this.length-(1+n)] || "" };
+}
+
+JSDOC.Walker.prototype.walk = function(/**JSDOC.TokenStream*/ts) {
+       this.ts = ts;
+       while (this.token = this.ts.look()) {
+               if (this.token.popNamescope) {
+                       
+                       var symbol = this.namescope.pop();
+                       if (symbol.is("FUNCTION")) {
+                               if (this.ts.look(1).is("LEFT_PAREN") && symbol.comment.getTag("function").length == 0) {
+                                       symbol.isa = "OBJECT";
+                               }
+                       }
+               }
+               this.step();
+               if (!this.ts.next()) break;
+       }
+}
+
+JSDOC.Walker.prototype.step = function() {
+       if (this.token.is("JSDOC")) { // it's a doc comment
+       
+               var doc = new JSDOC.DocComment(this.token.data);
+               
+                               
+               if (doc.getTag("exports").length > 0) {
+                       var exports = doc.getTag("exports")[0];
+
+                       exports.desc.match(/(\S+) as (\S+)/i);
+                       var n1 = RegExp.$1;
+                       var n2 = RegExp.$2;
+                       
+                       if (!n1 && n2) throw "@exports tag requires a value like: 'name as ns.name'";
+                       
+                       JSDOC.Parser.rename = (JSDOC.Parser.rename || {});      
+                       JSDOC.Parser.rename[n1] = n2
+               }
+               
+               if (doc.getTag("lends").length > 0) {
+                       var lends = doc.getTag("lends")[0];
+
+                       var name = lends.desc
+                       if (!name) throw "@lends tag requires a value.";
+                       
+                       var symbol = new JSDOC.Symbol(name, [], "OBJECT", doc);
+                       
+                       this.namescope.push(symbol);
+                       
+                       var matching = this.ts.getMatchingToken("LEFT_CURLY");
+                       if (matching) matching.popNamescope = name;
+                       else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
+                       
+                       this.lastDoc = null;
+                       return true;
+               }
+               else if (doc.getTag("name").length > 0 && doc.getTag("overview").length == 0) { // it's a virtual symbol
+                       var virtualName = doc.getTag("name")[0].desc;
+                       if (!virtualName) throw "@name tag requires a value.";
+                       
+                       if (doc.getTag("memberOf").length > 0) {
+                               virtualName = (doc.getTag("memberOf")[0] + "." + virtualName)
+                                       .replace(/([#.])\./, "$1");
+                               doc.deleteTag("memberOf");
+                       }
+
+                       var symbol = new JSDOC.Symbol(virtualName, [], "VIRTUAL", doc);
+                       
+                       JSDOC.Parser.addSymbol(symbol);
+                       
+                       this.lastDoc = null;
+                       return true;
+               }
+               else if (doc.meta) { // it's a meta doclet
+                       if (doc.meta == "@+") JSDOC.DocComment.shared = doc.src;
+                       else if (doc.meta == "@-") JSDOC.DocComment.shared = "";
+                       else if (doc.meta == "nocode+") JSDOC.Parser.conf.ignoreCode = true;
+                       else if (doc.meta == "nocode-") JSDOC.Parser.conf.ignoreCode = JSDOC.opt.n;
+                       else throw "Unrecognized meta comment: "+doc.meta;
+                       
+                       this.lastDoc = null;
+                       return true;
+               }
+               else if (doc.getTag("overview").length > 0) { // it's a file overview
+                       symbol = new JSDOC.Symbol("", [], "FILE", doc);
+                       
+                       JSDOC.Parser.addSymbol(symbol);
+                       
+                       this.lastDoc = null;
+                       return true;
+               }
+               else {
+                       this.lastDoc = doc;
+                       return false;
+               }
+       }
+       else if (!JSDOC.Parser.conf.ignoreCode) { // it's code
+               if (this.token.is("NAME")) { // it's the name of something
+                       var symbol;
+                       var name = this.token.data;
+                       var doc = null; if (this.lastDoc) doc = this.lastDoc;
+                       var params = [];
+               
+                       // it's inside an anonymous object
+                       if (this.ts.look(1).is("COLON") && this.ts.look(-1).is("LEFT_CURLY") && !(this.ts.look(-2).is("JSDOC") || this.namescope.last().comment.getTag("lends").length || this.ts.look(-2).is("ASSIGN") || this.ts.look(-2).is("COLON"))) {
+                               name = "$anonymous";
+                               name = this.namescope.last().alias+"-"+name
+                                       
+                               params = [];
+                               
+                               symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
+
+                               JSDOC.Parser.addSymbol(symbol);
+                               
+                               this.namescope.push(symbol);
+                               
+                               var matching = this.ts.getMatchingToken(null, "RIGHT_CURLY");
+                               if (matching) matching.popNamescope = name;
+                               else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
+                       }
+                       // function foo() {}
+                       else if (this.ts.look(-1).is("FUNCTION") && this.ts.look(1).is("LEFT_PAREN")) {
+                               var isInner;
+                               
+                               if (this.lastDoc) doc = this.lastDoc;
+                               
+                               if (doc && doc.getTag("memberOf").length > 0) {
+                                       name = (doc.getTag("memberOf")[0]+"."+name).replace("#.", "#");
+                                       doc.deleteTag("memberOf");
+                               }
+                               else {
+                                       name = this.namescope.last().alias+"-"+name;
+                                       if (!this.namescope.last().is("GLOBAL")) isInner = true;
+                               }
+                               
+                               if (!this.namescope.last().is("GLOBAL")) isInner = true;
+                               
+                               params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
+
+                               symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc);
+                               if (isInner) symbol.isInner = true;
+
+                               if (this.ts.look(1).is("JSDOC")) {
+                                       var inlineReturn = ""+this.ts.look(1).data;
+                                       inlineReturn = inlineReturn.replace(/(^\/\*\* *| *\*\/$)/g, "");
+                                       symbol.type = inlineReturn;
+                               }
+                               
+                               JSDOC.Parser.addSymbol(symbol);
+                               
+                               this.namescope.push(symbol);
+                               
+                               var matching = this.ts.getMatchingToken("LEFT_CURLY");
+                               if (matching) matching.popNamescope = name;
+                               else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
+                       }
+                       // foo = function() {}
+                       else if (this.ts.look(1).is("ASSIGN") && this.ts.look(2).is("FUNCTION")) {
+                               var constructs;
+                               var isConstructor = false;
+                               if (doc && (constructs = doc.getTag("constructs")) && constructs.length) {
+                                       if (constructs[0].desc) {
+                                               name = constructs[0].desc;
+                                               isConstructor = true;
+                                       }
+                               }
+                                       
+                               var isInner;
+                               if (this.ts.look(-1).is("VAR") || this.isInner) {
+                                       if (doc && doc.getTag("memberOf").length > 0) {
+                                               name = (doc.getTag("memberOf")[0]+"."+name).replace("#.", "#");
+                                               doc.deleteTag("memberOf");
+                                       }
+                                       else {
+                                               name = this.namescope.last().alias+"-"+name;
+                                               if (!this.namescope.last().is("GLOBAL")) isInner = true;
+                                       }
+                                       if (!this.namescope.last().is("GLOBAL")) isInner = true;
+                               }
+                               else if (name.indexOf("this.") == 0) {
+                                       name = this.resolveThis(name);
+                               }
+
+                               if (this.lastDoc) doc = this.lastDoc;
+                               params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
+                               
+                               symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc);
+
+                               if (isInner) symbol.isInner = true;
+                               if (isConstructor) symbol.isa = "CONSTRUCTOR";
+                               
+                               if (this.ts.look(1).is("JSDOC")) {
+                                       var inlineReturn = ""+this.ts.look(1).data;
+                                       inlineReturn = inlineReturn.replace(/(^\/\*\* *| *\*\/$)/g, "");
+                                       symbol.type = inlineReturn;
+                               }
+
+                               JSDOC.Parser.addSymbol(symbol);
+                               
+                               this.namescope.push(symbol);
+                               
+                               var matching = this.ts.getMatchingToken("LEFT_CURLY");
+                               if (matching) matching.popNamescope = name;
+                               else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
+                       }
+                       // foo = new function() {} or foo = (function() {}
+                       else if (this.ts.look(1).is("ASSIGN") && (this.ts.look(2).is("NEW") || this.ts.look(2).is("LEFT_PAREN")) && this.ts.look(3).is("FUNCTION")) {
+                               var isInner;
+                               if (this.ts.look(-1).is("VAR") || this.isInner) {
+                                       name = this.namescope.last().alias+"-"+name
+                                       if (!this.namescope.last().is("GLOBAL")) isInner = true;
+                               }
+                               else if (name.indexOf("this.") == 0) {
+                                       name = this.resolveThis(name);
+                               }
+
+                               this.ts.next(3); // advance past the "new" or "("
+                               
+                               if (this.lastDoc) doc = this.lastDoc;
+                               params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
+                               
+                               symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
+                               if (isInner) symbol.isInner = true;
+                               
+                               if (this.ts.look(1).is("JSDOC")) {
+                                       var inlineReturn = ""+this.ts.look(1).data;
+                                       inlineReturn = inlineReturn.replace(/(^\/\*\* *| *\*\/$)/g, "");
+                                       symbol.type = inlineReturn;
+                               }
+                               
+                               JSDOC.Parser.addSymbol(symbol);
+                               
+                               symbol.scopeType = "INSTANCE";
+                               this.namescope.push(symbol);
+                               
+                               var matching = this.ts.getMatchingToken("LEFT_CURLY");
+                               if (matching) matching.popNamescope = name;
+                               else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
+                       }
+                       // foo: function() {}
+                       else if (this.ts.look(1).is("COLON") && this.ts.look(2).is("FUNCTION")) {
+                               name = (this.namescope.last().alias+"."+name).replace("#.", "#");
+                               
+                               if (this.lastDoc) doc = this.lastDoc;
+                               params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
+                               
+                               if (doc && doc.getTag("constructs").length) {
+                                       name = name.replace(/\.prototype(\.|$)/, "#");
+                                       
+                                       if (name.indexOf("#") > -1) name = name.match(/(^[^#]+)/)[0];
+                                       else name = this.namescope.last().alias;
+
+                                       symbol = new JSDOC.Symbol(name, params, "CONSTRUCTOR", doc);
+                               }
+                               else {
+                                       symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc);
+                               }
+                               
+                               if (this.ts.look(1).is("JSDOC")) {
+                                       var inlineReturn = ""+this.ts.look(1).data;
+                                       inlineReturn = inlineReturn.replace(/(^\/\*\* *| *\*\/$)/g, "");
+                                       symbol.type = inlineReturn;
+                               }
+                               
+                               JSDOC.Parser.addSymbol(symbol);
+                               
+                               this.namescope.push(symbol);
+                               
+                               var matching = this.ts.getMatchingToken("LEFT_CURLY");
+                               if (matching) matching.popNamescope = name;
+                               else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
+                       }
+                       // foo = {}
+                       else if (this.ts.look(1).is("ASSIGN") && this.ts.look(2).is("LEFT_CURLY")) {
+                               var isInner;
+                               if (this.ts.look(-1).is("VAR") || this.isInner) {
+                                       name = this.namescope.last().alias+"-"+name
+                                       if (!this.namescope.last().is("GLOBAL")) isInner = true;
+                               }
+                               else if (name.indexOf("this.") == 0) {
+                                       name = this.resolveThis(name);
+                               }
+                               
+                               if (this.lastDoc) doc = this.lastDoc;
+                               
+                               symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
+                               if (isInner) symbol.isInner = true;
+                               
+                       
+                               if (doc) JSDOC.Parser.addSymbol(symbol);
+
+                               this.namescope.push(symbol);
+                               
+                               var matching = this.ts.getMatchingToken("LEFT_CURLY");
+                               if (matching) matching.popNamescope = name;
+                               else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
+                       }
+                       // var foo;
+                       else if (this.ts.look(1).is("SEMICOLON")) {
+                               var isInner;
+
+                               if (this.ts.look(-1).is("VAR") || this.isInner) {
+                                       name = this.namescope.last().alias+"-"+name
+                                       if (!this.namescope.last().is("GLOBAL")) isInner = true;
+                                       
+                                       if (this.lastDoc) doc = this.lastDoc;
+                               
+                                       symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
+                                       if (isInner) symbol.isInner = true;
+                                       
+                               
+                                       if (doc) JSDOC.Parser.addSymbol(symbol);
+                               }
+                       }
+                       // foo = x
+                       else if (this.ts.look(1).is("ASSIGN")) {                                
+                               var isInner;
+                               if (this.ts.look(-1).is("VAR") || this.isInner) {
+                                       name = this.namescope.last().alias+"-"+name
+                                       if (!this.namescope.last().is("GLOBAL")) isInner = true;
+                               }
+                               else if (name.indexOf("this.") == 0) {
+                                       name = this.resolveThis(name);
+                               }
+                               
+                               if (this.lastDoc) doc = this.lastDoc;
+                               
+                               symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
+                               if (isInner) symbol.isInner = true;
+                               
+                       
+                               if (doc) JSDOC.Parser.addSymbol(symbol);
+                       }
+                       // foo: {}
+                       else if (this.ts.look(1).is("COLON") && this.ts.look(2).is("LEFT_CURLY")) {
+                               name = (this.namescope.last().alias+"."+name).replace("#.", "#");
+                               
+                               if (this.lastDoc) doc = this.lastDoc;
+                               
+                               symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
+                               
+                       
+                               if (doc) JSDOC.Parser.addSymbol(symbol);
+                               
+                               this.namescope.push(symbol);
+                               
+                               var matching = this.ts.getMatchingToken("LEFT_CURLY");
+                               if (matching) matching.popNamescope = name;
+                               else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
+                       }
+                       // foo: x
+                       else if (this.ts.look(1).is("COLON")) {
+                               name = (this.namescope.last().alias+"."+name).replace("#.", "#");;
+                               
+                               if (this.lastDoc) doc = this.lastDoc;
+                               
+                               symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
+                               
+                       
+                               if (doc) JSDOC.Parser.addSymbol(symbol);
+                       }
+                       // foo(...)
+                       else if (this.ts.look(1).is("LEFT_PAREN")) {
+                               if (typeof JSDOC.PluginManager != "undefined") {
+                                       var functionCall = {name: name};
+                               
+                                       var cursor = this.ts.cursor;
+                                       params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
+                                       this.ts.cursor = cursor;
+                                       
+                                       for (var i = 0; i < params.length; i++)
+                                               functionCall["arg" + (i + 1)] = params[i].name;
+                               
+                                       JSDOC.PluginManager.run("onFunctionCall", functionCall);
+                                       if (functionCall.doc) {
+                                               this.ts.insertAhead(new JSDOC.Token(functionCall.doc, "COMM", "JSDOC"));
+                                       }
+                               }
+                       }
+                       this.lastDoc = null;
+               }
+               else if (this.token.is("FUNCTION")) { // it's an anonymous function
+                       if (
+                               (!this.ts.look(-1).is("COLON") || !this.ts.look(-1).is("ASSIGN"))
+                               && !this.ts.look(1).is("NAME")
+                       ) {
+                               if (this.lastDoc) doc = this.lastDoc;
+                               
+                               name = "$anonymous";
+                               name = this.namescope.last().alias+"-"+name
+                               
+                               params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
+                               
+                               symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc);
+                               
+                               JSDOC.Parser.addSymbol(symbol);
+                               
+                               this.namescope.push(symbol);
+                               
+                               var matching = this.ts.getMatchingToken("LEFT_CURLY");
+                               if (matching) matching.popNamescope = name;
+                               else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
+                       }
+               }
+       }
+       return true;
+}
+
+/**
+       Resolves what "this." means when it appears in a name.
+       @param name The name that starts with "this.".
+       @returns The name with "this." resolved.
+ */
+JSDOC.Walker.prototype.resolveThis = function(name) {
+       name.match(/^this\.(.+)$/)
+       var nameFragment = RegExp.$1;
+       if (!nameFragment) return name;
+       
+       var symbol = this.namescope.last();
+       var scopeType = symbol.scopeType || symbol.isa;
+
+       // if we are in a constructor function, `this` means the instance
+       if (scopeType == "CONSTRUCTOR") {
+               name = symbol.alias+"#"+nameFragment;
+       }
+       
+       // if we are in an anonymous constructor function, `this` means the instance
+       else if (scopeType == "INSTANCE") {
+               name = symbol.alias+"."+nameFragment;
+       }
+       
+       // if we are in a function, `this` means the container (possibly the global)
+       else if (scopeType == "FUNCTION") {
+               // in a method of a prototype, so `this` means the constructor
+               if (symbol.alias.match(/(^.*)[#.-][^#.-]+/)) {
+                       var parentName = RegExp.$1;
+                       var parent = JSDOC.Parser.symbols.getSymbol(parentName);
+
+                       if (!parent) {
+                               if (JSDOC.Lang.isBuiltin(parentName)) parent = JSDOC.Parser.addBuiltin(parentName);
+                               else {
+                                       if (symbol.alias.indexOf("$anonymous") < 0) // these will be ignored eventually
+                                               LOG.warn("Trying to document "+symbol.alias+" without first documenting "+parentName+".");
+                               }
+                       }
+                       if (parent) name = parentName+(parent.is("CONSTRUCTOR")?"#":".")+nameFragment;
+               }
+               else {
+                       parent = this.namescope.last(1);
+                       name = parent.alias+(parent.is("CONSTRUCTOR")?"#":".")+nameFragment;
+               }
+       }
+       // otherwise it means the global
+       else {
+               name = nameFragment;
+       }
+       
+       return name;
+}
+
+JSDOC.Walker.onParamList = function(/**Array*/paramTokens) {
+       if (!paramTokens) {
+               LOG.warn("Malformed parameter list. Can't parse code.");
+               return [];
+       }
+       var params = [];
+       for (var i = 0, l = paramTokens.length; i < l; i++) {
+               if (paramTokens[i].is("JSDOC")) {
+                       var paramType = paramTokens[i].data.replace(/(^\/\*\* *| *\*\/$)/g, "");
+                       
+                       if (paramTokens[i+1] && paramTokens[i+1].is("NAME")) {
+                               i++;
+                               params.push({type: paramType, name: paramTokens[i].data});
+                       }
+               }
+               else if (paramTokens[i].is("NAME")) {
+                       params.push({name: paramTokens[i].data});
+               }
+       }
+       return params;
+}
diff --git a/jsdoc-toolkit/app/main.js b/jsdoc-toolkit/app/main.js
new file mode 100644 (file)
index 0000000..f9008c8
--- /dev/null
@@ -0,0 +1,111 @@
+/**
+ * @version $Id: main.js 818 2009-11-08 14:51:41Z micmath $
+ */
+
+function main() {
+       IO.include("lib/JSDOC.js");
+       IO.includeDir("plugins/");
+       
+       // process the options
+       
+       // the -c option: options are defined in a configuration file
+       if (JSDOC.opt.c) {
+               eval("JSDOC.conf = " + IO.readFile(JSDOC.opt.c));
+               
+               LOG.inform("Using configuration file at '"+JSDOC.opt.c+"'.");
+               
+               for (var c in JSDOC.conf) {
+                       if (c !== "D" && !defined(JSDOC.opt[c])) { // commandline overrules config file
+                               JSDOC.opt[c] = JSDOC.conf[c];
+                       }
+               }
+               
+               if (typeof JSDOC.conf["_"] != "undefined") {
+                       JSDOC.opt["_"] = JSDOC.opt["_"].concat(JSDOC.conf["_"]);
+               }
+               
+               LOG.inform("With configuration: ");
+               for (var o in JSDOC.opt) {
+                       LOG.inform("    "+o+": "+JSDOC.opt[o]);
+               }
+       }
+       
+       // be verbose
+       if (JSDOC.opt.v) LOG.verbose = true;
+       
+       // send log messages to a file
+       if (JSDOC.opt.o) LOG.out = IO.open(JSDOC.opt.o);
+       
+       // run the unit tests
+       if (JSDOC.opt.T) {
+               LOG.inform("JsDoc Toolkit running in test mode at "+new Date()+".");
+               IO.include("frame/Testrun.js");
+               IO.include("test.js");
+       }
+       else {
+               // a template must be defined and must be a directory path
+               if (!JSDOC.opt.t && System.getProperty("jsdoc.template.dir")) {
+                       JSDOC.opt.t = System.getProperty("jsdoc.template.dir");
+               }
+               if (JSDOC.opt.t && SYS.slash != JSDOC.opt.t.slice(-1)) {
+                       JSDOC.opt.t += SYS.slash;
+               }
+               
+               // verbose messages about the options we were given
+               LOG.inform("JsDoc Toolkit main() running at "+new Date()+".");
+               LOG.inform("With options: ");
+               for (var o in JSDOC.opt) {
+                       LOG.inform("    "+o+": "+JSDOC.opt[o]);
+               }
+               
+               // initialize and build a symbolSet from your code
+               JSDOC.JsDoc();
+               
+               // debugger's option: dump the entire symbolSet produced from your code
+               if (JSDOC.opt.Z) {
+                       LOG.warn("So you want to see the data structure, eh? This might hang if you have circular refs...");
+                       IO.include("frame/Dumper.js");
+                       var symbols = JSDOC.JsDoc.symbolSet.toArray();
+                       for (var i = 0, l = symbols.length; i < l; i++) {
+                               var symbol = symbols[i];
+                               print("// symbol: " + symbol.alias);
+                               print(symbol.serialize());
+                       }
+               }
+               else {
+                       if (typeof JSDOC.opt.t != "undefined") {
+                               try {
+                                       // a file named "publish.js" must exist in the template directory
+                                       load(JSDOC.opt.t+"publish.js");
+                                       
+                                       // and must define a function named "publish"
+                                       if (!publish) {
+                                               LOG.warn("No publish() function is defined in that template so nothing to do.");
+                                       }
+                                       else {
+                                               // which will be called with the symbolSet produced from your code
+                                               publish(JSDOC.JsDoc.symbolSet);
+                                       }
+                               }
+                               catch(e) {
+                                       LOG.warn("Sorry, that doesn't seem to be a valid template: "+JSDOC.opt.t+"publish.js : "+e);
+                               }
+                       }
+                       else {
+                               LOG.warn("No template given. Might as well read the usage notes.");
+                               JSDOC.usage();
+                       }
+               }
+       }
+       
+       // notify of any warnings
+       if (!JSDOC.opt.q && LOG.warnings.length) {
+               print(LOG.warnings.length+" warning"+(LOG.warnings.length != 1? "s":"")+".");
+       }
+       
+       // stop sending log messages to a file
+       if (LOG.out) {
+               LOG.out.flush();
+               LOG.out.close();
+       }
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/plugins/commentSrcJson.js b/jsdoc-toolkit/app/plugins/commentSrcJson.js
new file mode 100644 (file)
index 0000000..e826b57
--- /dev/null
@@ -0,0 +1,20 @@
+JSDOC.PluginManager.registerPlugin(
+       "JSDOC.commentSrcJson",
+       {
+               onDocCommentSrc: function(comment) {
+                       var json;
+                       if (/^\s*@json\b/.test(comment)) {
+                               comment.src = new String(comment.src).replace("@json", "");
+
+                               eval("json = "+comment.src);
+                               var tagged = "";
+                               for (var i in json) {
+                                       var tag = json[i];
+                                       // todo handle cases where tag is an object
+                                       tagged += "@"+i+" "+tag+"\n";
+                               }
+                               comment.src = tagged;
+                       }
+               }
+       }
+);
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/plugins/frameworkPrototype.js b/jsdoc-toolkit/app/plugins/frameworkPrototype.js
new file mode 100644 (file)
index 0000000..9c41751
--- /dev/null
@@ -0,0 +1,16 @@
+JSDOC.PluginManager.registerPlugin(
+       "JSDOC.frameworkPrototype",
+       {
+               onPrototypeClassCreate: function(classCreator) {
+                       var desc = "";
+                       if (classCreator.comment) {
+                               desc = classCreator.comment;
+                       }
+                       var insert = desc+"/** @name "+classCreator.name+"\n@constructor\n@scope "+classCreator.name+".prototype */"
+                       
+                       insert = insert.replace(/\*\/\/\*\*/g, "\n");
+                       /*DEBUG*///print("insert is "+insert);
+                       classCreator.addComment.data = insert;
+               }
+       }
+);
diff --git a/jsdoc-toolkit/app/plugins/functionCall.js b/jsdoc-toolkit/app/plugins/functionCall.js
new file mode 100644 (file)
index 0000000..6f87705
--- /dev/null
@@ -0,0 +1,10 @@
+JSDOC.PluginManager.registerPlugin(
+       "JSDOC.functionCall",
+       {
+               onFunctionCall: function(functionCall) {
+                       if (functionCall.name == "dojo.define" && functionCall.arg1) {
+                               functionCall.doc = "/** @lends "+eval(functionCall.arg1)+".prototype */";
+                       }
+               }
+       }
+);
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/plugins/publishSrcHilite.js b/jsdoc-toolkit/app/plugins/publishSrcHilite.js
new file mode 100644 (file)
index 0000000..65514f2
--- /dev/null
@@ -0,0 +1,62 @@
+JSDOC.PluginManager.registerPlugin(
+       "JSDOC.publishSrcHilite",
+       {
+               onPublishSrc: function(src) {
+                       if (src.path in JsHilite.cache) {
+                               return; // already generated src code
+                       }
+                       else JsHilite.cache[src.path] = true;
+               
+                       try {
+                               var sourceCode = IO.readFile(src.path);
+                       }
+                       catch(e) {
+                               print(e.message);
+                               quit();
+                       }
+
+                       var hiliter = new JsHilite(sourceCode, src.charset);
+                       src.hilited = hiliter.hilite();
+               }
+       }
+);
+
+function JsHilite(src, charset) {
+
+       var tr = new JSDOC.TokenReader();
+       
+       tr.keepComments = true;
+       tr.keepDocs = true;
+       tr.keepWhite = true;
+       
+       this.tokens = tr.tokenize(new JSDOC.TextStream(src));
+       
+       // TODO is redefining toString() the best way?
+       JSDOC.Token.prototype.toString = function() { 
+               return "<span class=\""+this.type+"\">"+this.data.replace(/</g, "&lt;")+"</span>";
+       }
+       
+       if (!charset) charset = "utf-8";
+       
+       this.header = '<html><head><meta http-equiv="content-type" content="text/html; charset='+charset+'"> '+
+       "<style>\n\
+       .KEYW {color: #933;}\n\
+       .COMM {color: #bbb; font-style: italic;}\n\
+       .NUMB {color: #393;}\n\
+       .STRN {color: #393;}\n\
+       .REGX {color: #339;}\n\
+       .line {border-right: 1px dotted #666; color: #666; font-style: normal;}\n\
+       </style></head><body><pre>";
+       this.footer = "</pre></body></html>";
+       this.showLinenumbers = true;
+}
+
+JsHilite.cache = {};
+
+JsHilite.prototype.hilite = function() {
+       var hilited = this.tokens.join("");
+       var line = 1;
+       if (this.showLinenumbers) hilited = hilited.replace(/(^|\n)/g, function(m){return m+"<span class='line'>"+((line<10)? " ":"")+((line<100)? " ":"")+(line++)+"</span> "});
+       
+       return this.header+hilited+this.footer;
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/plugins/symbolLink.js b/jsdoc-toolkit/app/plugins/symbolLink.js
new file mode 100644 (file)
index 0000000..c87f1ca
--- /dev/null
@@ -0,0 +1,10 @@
+JSDOC.PluginManager.registerPlugin(
+       "JSDOC.symbolLink",
+       {
+               onSymbolLink: function(link) {
+                       // modify link.linkPath (the href part of the link)
+                       // or link.linkText (the text displayed)
+                       // or link.linkInner (the #name part of the link)
+               }
+       }
+);
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/plugins/tagParamConfig.js b/jsdoc-toolkit/app/plugins/tagParamConfig.js
new file mode 100644 (file)
index 0000000..3ea8a1b
--- /dev/null
@@ -0,0 +1,31 @@
+JSDOC.PluginManager.registerPlugin(
+       "JSDOC.tagParamConfig",
+       {
+               onDocCommentTags: function(comment) {
+                       var currentParam = null;
+                       var tags = comment.tags;
+                       for (var i = 0, l = tags.length; i < l; i++) {
+                               
+                               if (tags[i].title == "param") {
+                                       if (tags[i].name.indexOf(".") == -1) {
+                                               currentParam = i;
+                                       }
+                               }
+                               else if (tags[i].title == "config") {
+                                       tags[i].title = "param";
+                                       if (currentParam == null) {
+                                               tags[i].name = "arguments"+"."+tags[i].name;
+                                       }
+                                       else if (tags[i].name.indexOf(tags[currentParam].name+".") != 0) {
+                                               tags[i].name = tags[currentParam].name+"."+tags[i].name;
+                                       }
+                                       currentParam != null
+                                       //tags[currentParam].properties.push(tags[i]);
+                               }
+                               else {
+                                       currentParam = null;
+                               }
+                       }
+               }
+       }
+);
diff --git a/jsdoc-toolkit/app/plugins/tagSynonyms.js b/jsdoc-toolkit/app/plugins/tagSynonyms.js
new file mode 100644 (file)
index 0000000..49a874f
--- /dev/null
@@ -0,0 +1,43 @@
+JSDOC.PluginManager.registerPlugin(
+       "JSDOC.tagSynonyms",
+       {
+               onDocCommentSrc: function(comment) {
+                       comment.src = comment.src.replace(/@methodOf\b/i, "@function\n@memberOf");
+                       comment.src = comment.src.replace(/@fieldOf\b/i, "@field\n@memberOf");
+               },
+               
+               onDocCommentTags: function(comment) {
+                       for (var i = 0, l = comment.tags.length; i < l; i++) {
+                               var title = comment.tags[i].title.toLowerCase();
+                               var syn;
+                               if ((syn = JSDOC.tagSynonyms.synonyms["="+title])) {
+                                       comment.tags[i].title = syn;
+                               }
+                       }
+               }
+       }
+);
+
+new Namespace(
+       "JSDOC.tagSynonyms",
+       function() {
+               JSDOC.tagSynonyms.synonyms = {
+                       "=member":             "memberOf",
+                       "=memberof":           "memberOf",
+                       "=description":        "desc",
+                       "=exception":          "throws",
+                       "=argument":           "param",
+                       "=returns":            "return",
+                       "=classdescription":   "class",
+                       "=fileoverview":       "overview",
+                       "=extends":            "augments",
+                       "=base":               "augments",
+                       "=projectdescription": "overview",
+                       "=classdescription":   "class",
+                       "=link":               "see",
+                       "=borrows":            "inherits",
+                       "=scope":              "lends",
+                       "=construct":          "constructor"
+               }
+       }
+);
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/run.js b/jsdoc-toolkit/app/run.js
new file mode 100644 (file)
index 0000000..1f875cd
--- /dev/null
@@ -0,0 +1,348 @@
+/**
+ * @fileOverview
+ * A bootstrap script that creates some basic required objects
+ * for loading other scripts.
+ * @author Michael Mathews, micmath@gmail.com
+ * @version $Id: run.js 756 2009-01-07 21:32:58Z micmath $
+ */
+
+/**
+ * @namespace Keep track of any messages from the running script.
+ */
+LOG = {
+       warn: function(msg, e) {
+               if (JSDOC.opt.q) return;
+               if (e) msg = e.fileName+", line "+e.lineNumber+": "+msg;
+               
+               msg = ">> WARNING: "+msg;
+               LOG.warnings.push(msg);
+               if (LOG.out) LOG.out.write(msg+"\n");
+               else print(msg);
+       },
+
+       inform: function(msg) {
+               if (JSDOC.opt.q) return;
+               msg = " > "+msg;
+               if (LOG.out) LOG.out.write(msg+"\n");
+               else if (typeof LOG.verbose != "undefined" && LOG.verbose) print(msg);
+       }
+};
+LOG.warnings = [];
+LOG.verbose = false
+LOG.out = undefined;
+
+/**
+ *     @class Manipulate a filepath.
+ */
+function FilePath(absPath, separator) {
+       this.slash =  separator || "/"; 
+       this.root = this.slash;
+       this.path = [];
+       this.file = "";
+       
+       var parts = absPath.split(/[\\\/]/);
+       if (parts) {
+               if (parts.length) this.root = parts.shift() + this.slash;
+               if (parts.length) this.file =  parts.pop()
+               if (parts.length) this.path = parts;
+       }
+       
+       this.path = this.resolvePath();
+}
+
+/** Collapse any dot-dot or dot items in a filepath. */
+FilePath.prototype.resolvePath = function() {
+       var resolvedPath = [];
+       for (var i = 0; i < this.path.length; i++) {
+               if (this.path[i] == "..") resolvedPath.pop();
+               else if (this.path[i] != ".") resolvedPath.push(this.path[i]);
+       }
+       return resolvedPath;
+}
+
+/** Trim off the filename. */
+FilePath.prototype.toDir = function() {
+       if (this.file) this.file = "";
+       return this;
+}
+
+/** Go up a directory. */
+FilePath.prototype.upDir = function() {
+       this.toDir();
+       if (this.path.length) this.path.pop();
+       return this;
+}
+
+FilePath.prototype.toString = function() {
+       return this.root
+               + this.path.join(this.slash)
+               + ((this.path.length > 0)? this.slash : "")
+               + this.file;
+}
+
+/**
+ * Turn a path into just the name of the file.
+ */
+FilePath.fileName = function(path) {
+       var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
+       return path.substring(nameStart);
+}
+
+/**
+ * Get the extension of a filename
+ */
+FilePath.fileExtension = function(filename) {
+   return filename.split(".").pop().toLowerCase();
+};
+
+/**
+ * Turn a path into just the directory part.
+ */
+FilePath.dir = function(path) {
+       var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
+       return path.substring(0, nameStart-1);
+}
+
+
+importClass(java.lang.System);
+
+/**
+ * @namespace A collection of information about your system.
+ */
+SYS = {
+       /**
+        * Information about your operating system: arch, name, version.
+        * @type string
+        */
+       os: [
+               new String(System.getProperty("os.arch")),
+               new String(System.getProperty("os.name")),
+               new String(System.getProperty("os.version"))
+       ].join(", "),
+       
+       /**
+        * Which way does your slash lean.
+        * @type string
+        */
+       slash: System.getProperty("file.separator")||"/",
+       
+       /**
+        * The path to the working directory where you ran java.
+        * @type string
+        */
+       userDir: new String(System.getProperty("user.dir")),
+       
+       /**
+        * Where is Java's home folder.
+        * @type string
+        */
+       javaHome: new String(System.getProperty("java.home")),
+       
+       /**
+        * The absolute path to the directory containing this script.
+        * @type string
+        */
+       pwd: undefined
+};
+
+// jsrun appends an argument, with the path to here.
+if (arguments[arguments.length-1].match(/^-j=(.+)/)) {
+       if (RegExp.$1.charAt(0) == SYS.slash || RegExp.$1.charAt(1) == ":") { // absolute path to here
+               SYS.pwd = new FilePath(RegExp.$1).toDir().toString();
+       }
+       else { // relative path to here
+               SYS.pwd = new FilePath(SYS.userDir + SYS.slash + RegExp.$1).toDir().toString();
+       }
+       arguments.pop();
+}
+else {
+       print("The run.js script requires you use jsrun.jar.");
+       quit();
+}
+
+// shortcut
+var File = Packages.java.io.File;
+
+/**
+ * @namespace A collection of functions that deal with reading a writing to disk.
+ */
+IO = {
+
+       /**
+        * Create a new file in the given directory, with the given name and contents.
+        */
+       saveFile: function(/**string*/ outDir, /**string*/ fileName, /**string*/ content) {
+               var out = new Packages.java.io.PrintWriter(
+                       new Packages.java.io.OutputStreamWriter(
+                               new Packages.java.io.FileOutputStream(outDir+SYS.slash+fileName),
+                               IO.encoding
+                       )
+               );
+               out.write(content);
+               out.flush();
+               out.close();
+       },
+       
+       /**
+        * @type string
+        */
+       readFile: function(/**string*/ path) {
+               if (!IO.exists(path)) {
+                       throw "File doesn't exist there: "+path;
+               }
+               return readFile(path, IO.encoding);
+       },
+
+       /**
+        * @param inFile 
+        * @param outDir
+        * @param [fileName=The original filename]
+        */
+       copyFile: function(/**string*/ inFile, /**string*/ outDir, /**string*/ fileName) {
+               if (fileName == null) fileName = FilePath.fileName(inFile);
+       
+               var inFile = new File(inFile);
+               var outFile = new File(outDir+SYS.slash+fileName);
+               
+               var bis = new Packages.java.io.BufferedInputStream(new Packages.java.io.FileInputStream(inFile), 4096);
+               var bos = new Packages.java.io.BufferedOutputStream(new Packages.java.io.FileOutputStream(outFile), 4096);
+               var theChar;
+               while ((theChar = bis.read()) != -1) {
+                       bos.write(theChar);
+               }
+               bos.close();
+               bis.close();
+       },
+
+       /**
+        * Creates a series of nested directories.
+        */
+       mkPath: function(/**Array*/ path) {
+               if (path.constructor != Array) path = path.split(/[\\\/]/);
+               var make = "";
+               for (var i = 0, l = path.length; i < l; i++) {
+                       make += path[i] + SYS.slash;
+                       if (! IO.exists(make)) {
+                               IO.makeDir(make);
+                       }
+               }
+       },
+       
+       /**
+        * Creates a directory at the given path.
+        */
+       makeDir: function(/**string*/ path) {
+               (new File(path)).mkdir();
+       },
+
+       /**
+        * @type string[]
+        * @param dir The starting directory to look in.
+        * @param [recurse=1] How many levels deep to scan.
+        * @returns An array of all the paths to files in the given dir.
+        */
+       ls: function(/**string*/ dir, /**number*/ recurse, _allFiles, _path) {
+               if (_path === undefined) { // initially
+                       var _allFiles = [];
+                       var _path = [dir];
+               }
+               if (_path.length == 0) return _allFiles;
+               if (recurse === undefined) recurse = 1;
+               
+               dir = new File(dir);
+               if (!dir.directory) return [String(dir)];
+               var files = dir.list();
+               
+               for (var f = 0; f < files.length; f++) {
+                       var file = String(files[f]);
+                       if (file.match(/^\.[^\.\/\\]/)) continue; // skip dot files
+       
+                       if ((new File(_path.join(SYS.slash)+SYS.slash+file)).list()) { // it's a directory
+                               _path.push(file);
+                               if (_path.length-1 < recurse) IO.ls(_path.join(SYS.slash), recurse, _allFiles, _path);
+                               _path.pop();
+                       }
+                       else {
+                               _allFiles.push((_path.join(SYS.slash)+SYS.slash+file).replace(SYS.slash+SYS.slash, SYS.slash));
+                       }
+               }
+       
+               return _allFiles;
+       },
+
+       /**
+        * @type boolean
+        */
+       exists: function(/**string*/ path) {
+               file = new File(path);
+       
+               if (file.isDirectory()){
+                       return true;
+               }
+               if (!file.exists()){
+                       return false;
+               }
+               if (!file.canRead()){
+                       return false;
+               }
+               return true;
+       },
+
+       /**
+        * 
+        */
+       open: function(/**string*/ path, /**string*/ append) {
+               var append = true;
+               var outFile = new File(path);
+               var out = new Packages.java.io.PrintWriter(
+                       new Packages.java.io.OutputStreamWriter(
+                               new Packages.java.io.FileOutputStream(outFile, append),
+                               IO.encoding
+                       )
+               );
+               return out;
+       },
+
+       /**
+        * Sets {@link IO.encoding}.
+        * Encoding is used when reading and writing text to files,
+        * and in the meta tags of HTML output.
+        */
+       setEncoding: function(/**string*/ encoding) {
+               if (/ISO-8859-([0-9]+)/i.test(encoding)) {
+                       IO.encoding = "ISO8859_"+RegExp.$1;
+               }
+               else {
+                       IO.encoding = encoding;
+               }
+       },
+
+       /**
+        * @default "utf-8"
+        * @private
+        */
+       encoding: "utf-8",
+       
+       /**
+        * Load the given script.
+        */
+       include: function(relativePath) {
+               load(SYS.pwd+relativePath);
+       },
+       
+       /**
+        * Loads all scripts from the given directory path.
+        */
+       includeDir: function(path) {
+               if (!path) return;
+               
+               for (var lib = IO.ls(SYS.pwd+path), i = 0; i < lib.length; i++) 
+                       if (/\.js$/i.test(lib[i])) load(lib[i]);
+       }
+}
+
+// now run the application
+IO.include("frame.js");
+IO.include("main.js");
+
+main();
diff --git a/jsdoc-toolkit/app/t/TestDoc.js b/jsdoc-toolkit/app/t/TestDoc.js
new file mode 100644 (file)
index 0000000..c0768b7
--- /dev/null
@@ -0,0 +1,144 @@
+var TestDoc = {
+       fails: 0,
+       plans: 0,
+       passes: 0,
+       results: []
+};
+
+TestDoc.record = function(result) {
+       TestDoc.results.push(result);
+       if (typeof result.verdict == "boolean") {
+               if (result.verdict === false) TestDoc.fails++;
+               if (result.verdict === true) TestDoc.passes++;
+       }
+}
+
+TestDoc.prove = function(filePath) {
+       if (typeof document != "undefined" && typeof document.write != "undefined") {
+               if (TestDoc.console) print = function(s) { TestDoc.console.appendChild(document.createTextNode(s+"\n")); }
+               else print = function(s) { document.write(s+"<br />"); }
+       }
+       TestDoc.run(TestDoc.readFile(filePath));
+}
+
+TestDoc.run = function(src) {
+       try { eval(src); } catch(e) { print("# ERROR! "+e); }
+       
+       var chunks = src.split(/\/\*t:/);
+       
+       var run = function(chunk) {
+               // local shortcuts
+               var is = TestDoc.assertEquals;
+               var isnt = TestDoc.assertNotEquals;
+               var plan = TestDoc.plan;
+               var requires = TestDoc.requires;
+               
+               try { eval(chunk); } catch(e) { print("# ERROR! "+e); }
+       }
+       for (var start = -1, end = 0; (start = src.indexOf("/*t:", end)) > end; start = end) {
+               run(
+                       src.substring(
+                               start+4,
+                               (end = src.indexOf("*/", start))
+                       )
+               );
+       }
+}
+
+TestDoc.Result = function(verdict, message) {
+       this.verdict = verdict;
+       this.message = message;
+}
+
+TestDoc.Result.prototype.toString = function() {
+       if (typeof this.verdict == "boolean") {
+               return (this.verdict? "ok" : "not ok") + " " + (++TestDoc.report.counter) + " - " + this.message;
+       }
+       
+       return "# " + this.message;
+}
+
+TestDoc.requires = function(file) {
+       if (!TestDoc.requires.loaded[file]) {
+               load(file);
+               TestDoc.requires.loaded[file] = true;
+       }
+}
+TestDoc.requires.loaded = {};
+
+TestDoc.report = function() {
+       TestDoc.report.counter = 0;
+       print("1.."+TestDoc.plans);
+       for (var i = 0; i < TestDoc.results.length; i++) {
+               print(TestDoc.results[i]);
+       }
+       print("----------------------------------------");
+       if (TestDoc.fails == 0 && TestDoc.passes == TestDoc.plans) {
+               print("All tests successful.");
+       }
+       else {
+               print("Failed " + TestDoc.fails + "/" + TestDoc.plans + " tests, "+((TestDoc.plans == 0)? 0 : Math.round(TestDoc.passes/(TestDoc.passes+TestDoc.fails)*10000)/100)+"% okay. Planned to run "+TestDoc.plans+", did run "+(TestDoc.passes+TestDoc.fails)+".")
+       }
+}
+
+TestDoc.plan = function(n, message) {
+       TestDoc.plans += n;
+       TestDoc.record(new TestDoc.Result(null, message+" ("+n+" tests)"));
+}
+
+TestDoc.assertEquals = function(a, b, message) {
+       var result = (a == b);
+       if (!result) message += "\n#\n# " + a + " does not equal " + b + "\n#";
+       TestDoc.record(new TestDoc.Result(result, message));
+}
+
+TestDoc.assertNotEquals = function(a, b, message) {
+       var result = (a != b);
+       if (!result) message += "\n#\n# " + a + " equals " + b + "\n#";
+       TestDoc.record(new TestDoc.Result(result, message));
+}
+
+TestDoc.readFile = (function(){
+       // rhino
+       if (typeof readFile == "function") {
+               return function(url) {
+                       var text = readFile(url);
+                       return text || "";
+               }
+       }
+
+       // a web browser
+       else {
+               return function(url) {
+                       var httpRequest;
+               
+                       if (window.XMLHttpRequest) { // Mozilla, Safari, etc
+                               httpRequest = new XMLHttpRequest();
+                       } 
+                       else if (window.ActiveXObject) { // IE
+                               try {
+                                       httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
+                               } 
+                               catch (e) {
+                                  try {
+                                               httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
+                                       } 
+                                       catch (e) {
+                                       }
+                               }
+                       }
+               
+                       if (!httpRequest) { throw "Cannot create HTTP Request."; }
+                       
+                       httpRequest.open('GET', url, false);
+                       httpRequest.send('');
+                       if (httpRequest.readyState == 4) {
+                               if (httpRequest.status >= 400) {
+                                       throw "The HTTP Request returned an error code: "+httpRequest.status;
+                               }
+                       }
+                       
+                       return httpRequest.responseText || "";
+               }
+       }
+})();
diff --git a/jsdoc-toolkit/app/t/runner.js b/jsdoc-toolkit/app/t/runner.js
new file mode 100644 (file)
index 0000000..3f9fb4c
--- /dev/null
@@ -0,0 +1,13 @@
+// try: java -jar ../../jsrun.jar runner.js
+
+load("TestDoc.js");
+
+TestDoc.prove("../frame/Opt.js");
+TestDoc.prove("../lib/JSDOC.js");
+TestDoc.prove("../frame/String.js");
+TestDoc.prove("../lib/JSDOC/DocTag.js");
+TestDoc.prove("../lib/JSDOC/DocComment.js");
+TestDoc.prove("../lib/JSDOC/TokenReader.js");
+TestDoc.prove("../lib/JSDOC/Symbol.js");
+
+TestDoc.report();
diff --git a/jsdoc-toolkit/app/test.js b/jsdoc-toolkit/app/test.js
new file mode 100644 (file)
index 0000000..8b2dc8b
--- /dev/null
@@ -0,0 +1,342 @@
+load("app/frame/Dumper.js");
+function symbolize(opt) {
+       symbols = null;
+       JSDOC.JsDoc(opt);
+       symbols = JSDOC.JsDoc.symbolSet;
+}
+
+var testCases = [
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/overview.js"]});
+               //print(Dumper.dump(symbols));  
+               is('symbols.getSymbolByName("My Cool Library").name', 'My Cool Library', 'File overview can be found by alias.');               
+       }
+       ,
+       function() {
+               symbolize({_: [SYS.pwd+"test/name.js"]});
+
+               is('symbols.getSymbol("Response").name', "Response", 'Virtual class name is found.');
+               is('symbols.getSymbol("Response#text").alias', "Response#text", 'Virtual method name is found.');
+               is('symbols.getSymbol("Response#text").memberOf', "Response", 'Virtual method parent name is found.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/prototype.js"]});
+
+               is('symbols.getSymbol("Article").name', "Article", 'Function set to constructor prototype with inner constructor name is found.');
+               is('symbols.getSymbol("Article").hasMethod("init")', true, 'The initializer method name of prototype function is correct.');
+               is('symbols.getSymbol("Article").hasMember("counter")', true, 'A static property set in the prototype definition is found.');
+               is('symbols.getSymbol("Article").hasMember("title")', true, 'An instance property set in the prototype is found.');
+               is('symbols.getSymbol("Article#title").isStatic', false, 'An instance property has isStatic set to false.');
+               is('symbols.getSymbol("Article.counter").name', "counter", 'A static property set in the initializer has the name set correctly.');
+               is('symbols.getSymbol("Article.counter").memberOf', "Article", 'A static property set in the initializer has the memberOf set correctly.');
+               is('symbols.getSymbol("Article.counter").isStatic', true, 'A static property set in the initializer has isStatic set to true.');
+       }
+       ,
+       function() {
+               symbolize({a:true, _: [SYS.pwd+"test/prototype_oblit.js"]});
+               
+               is('symbols.getSymbol("Article").name', "Article", 'Oblit set to constructor prototype name is found.');
+               is('typeof symbols.getSymbol("Article.prototype")', "undefined", 'The prototype oblit is not a symbol.');
+               is('symbols.getSymbol("Article#getTitle").name', "getTitle", 'The nonstatic method name of prototype oblit is correct.');
+               is('symbols.getSymbol("Article#getTitle").alias', "Article#getTitle", 'The alias of non-static method of prototype oblit is correct.');
+               is('symbols.getSymbol("Article#getTitle").isStatic', false, 'The isStatic of a nonstatic method of prototype oblit is correct.');
+               is('symbols.getSymbol("Article.getTitle").name', "getTitle", 'The static method name of prototype oblit is correct.');
+               is('symbols.getSymbol("Article.getTitle").isStatic', true, 'The isStatic of a static method of prototype oblit is correct.');
+               is('symbols.getSymbol("Article#getTitle").isa', "FUNCTION", 'The isa of non-static method of prototype oblit is correct.');
+               is('symbols.getSymbol("Article.getTitle").alias', "Article.getTitle", 'The alias of a static method of prototype oblit is correct.');
+               is('symbols.getSymbol("Article.getTitle").isa', "FUNCTION", 'The isa of static method of prototype oblit is correct.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/prototype_oblit_constructor.js"]});
+               
+               is('symbols.getSymbol("Article").name', "Article", 'Oblit set to constructor prototype with inner constructor name is found.');
+               is('symbols.getSymbol("Article#init").name', "init", 'The initializer method name of prototype oblit is correct.');
+               is('symbols.getSymbol("Article").hasMember("pages")', true, 'Property set by initializer method "this" is on the outer constructor.');
+               is('symbols.getSymbol("Article#Title").name', "Title", 'Name of the inner constructor name is found.');
+               is('symbols.getSymbol("Article#Title").memberOf', "Article", 'The memberOf of the inner constructor name is found.');
+               is('symbols.getSymbol("Article#Title").isa', "CONSTRUCTOR", 'The isa of the inner constructor name is constructor.');
+               is('symbols.getSymbol("Article#Title").hasMember("title")', true, 'A property set on the inner constructor "this"  is on the inner constructor.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/inner.js"]});
+               
+               is('symbols.getSymbol("Outer").name', "Outer", 'Outer constructor prototype name is found.');
+               is('symbols.getSymbol("Outer").methods.length', 1, 'Inner function doesnt appear as a method of the outer.');
+               is('symbols.getSymbol("Outer").hasMethod("open")', true, 'Outer constructors methods arent affected by inner function.');
+               is('symbols.getSymbol("Outer-Inner").alias', "Outer-Inner", 'Alias of inner function is found.');
+               is('symbols.getSymbol("Outer-Inner").isa', "CONSTRUCTOR", 'isa of inner function constructor is found.');
+               is('symbols.getSymbol("Outer-Inner").memberOf', "Outer", 'The memberOf of inner function is found.');
+               is('symbols.getSymbol("Outer-Inner").name', "Inner", 'The name of inner function is found.');
+               is('symbols.getSymbol("Outer-Inner#name").name', "name", 'A member of the inner function constructor, attached to "this" is found on inner.');
+               is('symbols.getSymbol("Outer-Inner#name").memberOf', "Outer-Inner", 'The memberOf of an inner function member is found.');              
+       }
+       ,
+       function() {
+               symbolize({a:true, _: [SYS.pwd+"test/prototype_nested.js"]});
+               
+               is('symbols.getSymbol("Word").name', "Word", 'Base constructor name is found.');
+               is('symbols.getSymbol("Word").hasMethod("reverse")', true, 'Base constructor method is found.');
+               is('symbols.getSymbol("Word").methods.length', 1, 'Base constructor has only one method.');
+               is('symbols.getSymbol("Word").memberOf', "", 'Base constructor memberOf is empty.');
+               is('symbols.getSymbol("Word#reverse").name', "reverse", 'Member of constructor prototype name is found.');
+               is('symbols.getSymbol("Word#reverse").memberOf', "Word", 'Member of constructor prototype memberOf is found.');
+               is('symbols.getSymbol("Word#reverse.utf8").name', "utf8", 'Member of constructor prototype method name is found.');
+               is('symbols.getSymbol("Word#reverse.utf8").memberOf', "Word#reverse", 'Static nested member memberOf is found.');
+       }
+       ,
+       function() {
+               symbolize({a:true, _: [SYS.pwd+"test/namespace_nested.js"]});
+               
+               is('symbols.getSymbol("ns1").name', "ns1", 'Base namespace name is found.');
+               is('symbols.getSymbol("ns1").memberOf', "", 'Base namespace memberOf is empty (its a constructor).');
+               is('symbols.getSymbol("ns1.ns2").name', "ns2", 'Nested namespace name is found.');
+               is('symbols.getSymbol("ns1.ns2").alias', "ns1.ns2", 'Nested namespace alias is found.');
+               is('symbols.getSymbol("ns1.ns2").memberOf', "ns1", 'Nested namespace memberOf is found.');
+               is('symbols.getSymbol("ns1.ns2.Function1").name', "Function1", 'Method of nested namespace name is found.');
+               is('symbols.getSymbol("ns1.ns2.Function1").memberOf', "ns1.ns2", 'Constructor of nested namespace memberOf is found.');                 
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/functions_nested.js"]});
+               
+               is('symbols.getSymbol("Zop").name', "Zop", 'Any constructor name is found.');
+               is('symbols.getSymbol("Zop").isa', "CONSTRUCTOR", 'It isa constructor.');
+               is('symbols.getSymbol("Zop").hasMethod("zap")', true, 'Its method name, set later, is in methods array.');
+               is('symbols.getSymbol("Foo").name', "Foo", 'The containing constructor name is found.');
+               is('symbols.getSymbol("Foo").hasMethod("methodOne")', true, 'Its method name is found.');
+               is('symbols.getSymbol("Foo").hasMethod("methodTwo")', true, 'Its second method name is found.');
+               is('symbols.getSymbol("Foo#methodOne").alias', "Foo#methodOne", 'A methods alias is found.');
+               is('symbols.getSymbol("Foo#methodOne").isStatic', false, 'A methods is not static.');
+               is('symbols.getSymbol("Bar").name', "Bar", 'A global function declared inside another function is found.');
+               is('symbols.getSymbol("Bar").isa', "FUNCTION", 'It isa function.');
+               is('symbols.getSymbol("Bar").memberOf', "_global_", 'It is global.');
+               is('symbols.getSymbol("Foo-inner").name', "inner", 'An inner functions name is found.');
+               is('symbols.getSymbol("Foo-inner").memberOf', "Foo", 'It is member of the outer function.');
+               is('symbols.getSymbol("Foo-inner").isInner', true, 'It is an inner function.');
+       }
+       ,
+       function() {
+               symbolize({a:true, _: [SYS.pwd+"test/memberof_constructor.js"]});
+               
+               is('symbols.getSymbol("Circle#Tangent").name', "Tangent", 'Constructor set on prototype using @member has correct name.');
+               is('symbols.getSymbol("Circle#Tangent").memberOf', "Circle", 'Constructor set on prototype using @member has correct memberOf.');
+               is('symbols.getSymbol("Circle#Tangent").alias', "Circle#Tangent", 'Constructor set on prototype using @member has correct alias.');
+               is('symbols.getSymbol("Circle#Tangent").isa', "CONSTRUCTOR", 'Constructor set on prototype using @member has correct isa.');
+               is('symbols.getSymbol("Circle#Tangent").isStatic', false, 'Constructor set on prototype using @member is not static.');
+               is('symbols.getSymbol("Circle#Tangent#getDiameter").name', "getDiameter", 'Method set on prototype using @member has correct name.');
+               is('symbols.getSymbol("Circle#Tangent#getDiameter").memberOf', "Circle#Tangent", 'Method set on prototype using @member has correct memberOf.');
+               is('symbols.getSymbol("Circle#Tangent#getDiameter").alias', "Circle#Tangent#getDiameter", 'Method set on prototype using @member has correct alias.');
+               is('symbols.getSymbol("Circle#Tangent#getDiameter").isa', "FUNCTION", 'Method set on prototype using @member has correct isa.');
+               is('symbols.getSymbol("Circle#Tangent#getDiameter").isStatic', false, 'Method set on prototype using @member is not static.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p: true,  _: [SYS.pwd+"test/memberof.js"]});
+               
+               is('symbols.getSymbol("pack.install").alias', "pack.install", 'Using @memberOf sets alias, when parent name is in memberOf tag.');
+               is('symbols.getSymbol("pack.install.overwrite").name', "install.overwrite", 'Using @memberOf sets name, even if the name is dotted.');
+               is('symbols.getSymbol("pack.install.overwrite").memberOf', "pack", 'Using @memberOf sets memberOf.');
+               is('symbols.getSymbol("pack.install.overwrite").isStatic', true, 'Using @memberOf with value not ending in octothorp sets isStatic to true.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p: true,  _: [SYS.pwd+"test/memberof2.js"]});
+               
+               is('symbols.getSymbol("Foo#bar").alias', "Foo#bar", 'An inner function can be documented as an instance method.');
+               is('symbols.getSymbol("Foo.zip").alias', "Foo.zip", 'An inner function can be documented as a static method.');
+               is('symbols.getSymbol("Foo.Fiz").alias', "Foo.Fiz", 'An inner function can be documented as a static constructor.');
+               is('symbols.getSymbol("Foo.Fiz#fipple").alias', "Foo.Fiz#fipple", 'An inner function can be documented as a static constructor with a method.');
+               is('symbols.getSymbol("Foo#blat").alias', "Foo#blat", 'An global function can be documented as an instance method.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p: true,  _: [SYS.pwd+"test/memberof3.js"]});
+               
+               is('symbols.getSymbol("Foo#bar").alias', "Foo#bar", 'A virtual field can be documented as an instance method.');
+               is('symbols.getSymbol("Foo2#bar").alias', "Foo2#bar", 'A virtual field with the same name can be documented as an instance method.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/borrows.js"]});
+
+               is('symbols.getSymbol("Layout").name', "Layout", 'Constructor can be found.');
+               is('symbols.getSymbol("Layout").hasMethod("init")', true, 'Constructor method name can be found.');
+               is('symbols.getSymbol("Layout").hasMember("orientation")', true, 'Constructor property name can be found.');
+               
+               is('symbols.getSymbol("Page").hasMethod("reset")', true, 'Second constructor method name can be found.');
+               is('symbols.getSymbol("Page").hasMember("orientation")', true, 'Second constructor borrowed property name can be found in properties.');
+               is('symbols.getSymbol("Page#orientation").memberOf', "Page", 'Second constructor borrowed property memberOf can be found.');
+               is('symbols.getSymbol("Page-getInnerElements").alias', "Page-getInnerElements", 'Can borrow an inner function and it is still inner.');
+               is('symbols.getSymbol("Page.units").alias', "Page.units", 'Can borrow a static function and it is still static.');
+               
+               is('symbols.getSymbol("ThreeColumnPage#init").alias', "ThreeColumnPage#init", 'Third constructor method can be found even though method with same name is borrowed.');
+               is('symbols.getSymbol("ThreeColumnPage#reset").alias', "ThreeColumnPage#reset", 'Borrowed method can be found.');
+               is('symbols.getSymbol("ThreeColumnPage#orientation").alias', "ThreeColumnPage#orientation", 'Twice borrowed method can be found.');
+       
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/borrows2.js"]});
+
+               is('symbols.getSymbol("Foo").hasMethod("my_zop")', true, 'Borrowed method can be found.');              
+               is('symbols.getSymbol("Bar").hasMethod("my_zip")', true, 'Second borrowed method can be found.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/constructs.js"]});
+
+               is('symbols.getSymbol("Person").hasMethod("say")', true, 'The constructs tag creates a class that lends can add a method to.');         
+       }
+       ,
+       function() {
+               symbolize({a: true, _: [SYS.pwd+"test/augments.js", SYS.pwd+"test/augments2.js"]});
+               
+               is('symbols.getSymbol("Page").augments[0]', "Layout", 'An augmented class can be found.');
+               is('symbols.getSymbol("Page#reset").alias', "Page#reset", 'Method of augmenter can be found.');
+               is('symbols.getSymbol("Page").hasMethod("Layout#init")', true, 'Method from augmented can be found.');
+               is('symbols.getSymbol("Page").hasMember("Layout#orientation")', true, 'Property from augmented can be found.');
+               is('symbols.getSymbol("Page").methods.length', 3, 'Methods of augmented class are included in methods array.');
+       
+               is('symbols.getSymbol("ThreeColumnPage").augments[0]', "Page", 'The extends tag is a synonym for augments.');
+               is('symbols.getSymbol("ThreeColumnPage").hasMethod("ThreeColumnPage#init")', true, 'Local method overrides augmented method of same name.');
+               is('symbols.getSymbol("ThreeColumnPage").methods.length', 3, 'Local method count is right.');
+               
+               is('symbols.getSymbol("NewsletterPage").augments[0]', "ThreeColumnPage", 'Can augment across file boundaries.');
+               is('symbols.getSymbol("NewsletterPage").augments.length', 2, 'Multiple augments are supported.');
+               is('symbols.getSymbol("NewsletterPage").inherits[0].alias', "Junkmail#annoy", 'Inherited method with augments.');
+               is('symbols.getSymbol("NewsletterPage").methods.length', 6, 'Methods of augmented class are included in methods array across files.');
+               is('symbols.getSymbol("NewsletterPage").properties.length', 1, 'Properties of augmented class are included in properties array across files.');
+       }
+       ,
+       function() {
+               symbolize({a:true, _: [SYS.pwd+"test/static_this.js"]});
+               
+               is('symbols.getSymbol("box.holder").name', "holder", 'Static namespace name can be found.');
+               is('symbols.getSymbol("box.holder.foo").name', "foo", 'Static namespace method name can be found.');
+               is('symbols.getSymbol("box.holder").isStatic', true, 'Static namespace method is static.');
+               
+               is('symbols.getSymbol("box.holder.counter").name', "counter", 'Instance namespace property name set on "this" can be found.');
+               is('symbols.getSymbol("box.holder.counter").alias', "box.holder.counter", 'Instance namespace property alias set on "this" can be found.');
+               is('symbols.getSymbol("box.holder.counter").memberOf', "box.holder", 'Static namespace property memberOf set on "this" can be found.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p: true, _: [SYS.pwd+"test/lend.js"]});
+
+               is('symbols.getSymbol("Person").name', "Person", 'Class defined in lend comment is found.');
+               is('symbols.getSymbol("Person").hasMethod("initialize")', true, 'Lent instance method name can be found.');
+               is('symbols.getSymbol("Person").hasMethod("say")', true, 'Second instance method can be found.');
+               is('symbols.getSymbol("Person#sing").isStatic', false, 'Instance method is known to be not static.');
+               
+               is('symbols.getSymbol("Person.getCount").name', "getCount", 'Static method name from second lend comment can be found.');
+               is('symbols.getSymbol("Person.getCount").isStatic', true, 'Static method from second lend comment is known to be static.');
+       
+               is('LOG.warnings.filter(function($){if($.indexOf("notok") > -1) return $}).length', 1, 'A warning is emitted when lending to an undocumented parent.');
+       }
+       ,
+       function() {
+               symbolize({a:true, _: [SYS.pwd+"test/param_inline.js"]});
+       
+               is('symbols.getSymbol("Layout").params[0].type', "int", 'Inline param name is set.');
+               is('symbols.getSymbol("Layout").params[0].desc', "The number of columns.", 'Inline param desc is set from comment.');
+               is('symbols.getSymbol("Layout#getElement").params[0].name', "id", 'User defined param documentation takes precedence over parser defined.');
+               is('symbols.getSymbol("Layout#getElement").params[0].isOptional', true, 'Default for param is to not be optional.');
+               is('symbols.getSymbol("Layout#getElement").params[1].isOptional', false, 'Can mark a param as being optional.');
+               is('symbols.getSymbol("Layout#getElement").params[1].type', "number|string", 'Type of inline param doc can have multiple values.');
+               is('symbols.getSymbol("Layout#Canvas").params[0].type', "", 'Type can be not defined for some params.');
+               is('symbols.getSymbol("Layout#Canvas").params[2].type', "int", 'Type can be defined inline for only some params.');
+               is('symbols.getSymbol("Layout#rotate").params.length', 0, 'Docomments inside function sig is ignored without a param.');
+               is('symbols.getSymbol("Layout#init").params[2].type', "zoppler", 'Doc comment type overrides inline type for param with same name.');
+       }
+       ,
+       function() {
+               symbolize({a: true, _: [SYS.pwd+"test/shared.js", SYS.pwd+"test/shared2.js"]});
+
+               is('symbols.getSymbol("Array#some").name', 'some', 'The name of a symbol in a shared section is found.');
+               is('symbols.getSymbol("Array#some").alias', 'Array#some', 'The alias of a symbol in a shared section is found.');
+               is('symbols.getSymbol("Array#some").desc', "Extension to builtin array.", 'A description can be shared.');
+               is('symbols.getSymbol("Array#filter").desc', "Extension to builtin array.\nChange every element of an array.", 'A shared description is appended.');
+               is('symbols.getSymbol("Queue").desc', "A first in, first out data structure.", 'A description is not shared when outside a shared section.');
+               is('symbols.getSymbol("Queue.rewind").alias', "Queue.rewind", 'Second shared tag can be started.');
+               is('symbols.getSymbol("startOver").alias', "startOver", 'Shared tag doesnt cross over files.');
+       }
+       ,
+       function() {
+               symbolize({a: true, _: [SYS.pwd+"test/config.js"]});
+               is('symbols.getSymbol("Contact").params[0].name', 'person', 'The name of a param is found.');
+               is('symbols.getSymbol("Contact").params[1].name', 'person.name', 'The name of a param set with a dot name is found.');
+               is('symbols.getSymbol("Contact").params[2].name', 'person.age', 'The name of a second param set with a dot name is found.');
+               is('symbols.getSymbol("Contact").params[4].name', 'connection', 'The name of a param after config is found.');
+               
+               is('symbols.getSymbol("Family").params[0].name', 'persons', 'Another name of a param is found.');
+               is('symbols.getSymbol("Family").params[1].name', 'persons.Father', 'The name of a param+config is found.');
+               is('symbols.getSymbol("Family").params[2].name', 'persons.Mother', 'The name of a second param+config is found.');
+               is('symbols.getSymbol("Family").params[3].name', 'persons.Children', 'The name of a third param+config is found.');     
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/ignore.js"]});
+               is('LOG.warnings.filter(function($){if($.indexOf("undocumented symbol Ignored") > -1) return $}).length', 1, 'A warning is emitted when documenting members of an ignored parent.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/functions_anon.js"]});
+               is('symbols.getSymbol("a.b").alias', 'a.b', 'In anonymous constructor this is found to be the container object.');
+               is('symbols.getSymbol("a.f").alias', 'a.f', 'In anonymous constructor this can have a method.');
+               is('symbols.getSymbol("a.c").alias', 'a.c', 'In anonymous constructor method this is found to be the container object.');
+               is('symbols.getSymbol("g").alias', 'g', 'In anonymous function executed inline this is the global.');
+               is('symbols.getSymbol("bar2.p").alias', 'bar2.p', 'In named constructor executed inline this is the container object.');
+               is('symbols.getSymbol("module.pub").alias', 'module.pub', 'In parenthesized anonymous function executed inline function scoped variables arent documented.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/oblit_anon.js"]});
+               is('symbols.getSymbol("opt").name', 'opt', 'Anonymous object properties are created.');
+               is('symbols.getSymbol("opt.conf.keep").alias', 'opt.conf.keep', 'Anonymous object first property is assigned to $anonymous.');
+               is('symbols.getSymbol("opt.conf.base").alias', 'opt.conf.base', 'Anonymous object second property is assigned to $anonymous.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/params_optional.js"]});
+               is('symbols.getSymbol("Document").params.length', 3, 'Correct number of params are found when optional param syntax is used.');
+               is('symbols.getSymbol("Document").params[1].name', "id", 'Name of optional param is found.');
+               is('symbols.getSymbol("Document").params[1].isOptional', true, 'Optional param is marked isOptional.');
+               is('symbols.getSymbol("Document").params[2].name', "title", 'Name of optional param with default value is found.');
+               is('symbols.getSymbol("Document").params[2].isOptional', true, 'Optional param with default value is marked isOptional.');
+               is('symbols.getSymbol("Document").params[2].defaultValue', " This is untitled.", 'Optional param default value is found.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/synonyms.js"]});
+               is('symbols.getSymbol("myObject.myFunc").type', 'function', 'Type can be set to function.');
+       }
+       ,
+       function() {
+               symbolize({a:true, p:true, _: [SYS.pwd+"test/event.js"]});
+               is('symbols.getSymbol("Kitchen#event:cakeEaten").isEvent', true, 'Function with event prefix is an event.');
+               is('symbols.getSymbol("Kitchen#cakeEaten").isa', "FUNCTION", 'Function with same name as event isa function.');
+       }
+       ,
+       function() {
+               symbolize({x:"js", a:true, _: [SYS.pwd+"test/scripts/"]});
+               is('JSDOC.JsDoc.srcFiles.length', 1, 'Only js files are scanned when -x=js.');
+       }
+       ,
+       function() {
+               symbolize({x:"js", a:true, _: [SYS.pwd+"test/exports.js"]});
+               is('symbols.getSymbol("mxn.Map#doThings").name', 'doThings', 'Exports creates a documentation alias that can have methods.');
+       }
+       ,
+       function() {
+               symbolize({p:true, a:true, _: [SYS.pwd+"test/module.js"]});
+               is('symbols.getSymbol("myProject.myModule.myPublicMethod").name', 'myPublicMethod', 'A function wrapped in parens can be recognized.');
+               is('symbols.getSymbol("myProject.myModule-myPrivateMethod").name', 'myPrivateMethod', 'A private method in the scope of a function wrapped in parens can be recognized.');
+               is('symbols.getSymbol("myProject.myModule-myPrivateVar").name', 'myPrivateVar', 'A private member in the scope of a function wrapped in parens can be recognized.');
+       }
+];
+
+//// run and print results
+print(testrun(testCases));
diff --git a/jsdoc-toolkit/app/test/addon.js b/jsdoc-toolkit/app/test/addon.js
new file mode 100644 (file)
index 0000000..8886205
--- /dev/null
@@ -0,0 +1,24 @@
+String.prototype.reverse = function() {
+}
+
+String.prototype.reverse.utf8 = function() {
+}
+
+Function.count = function() {
+}
+
+/** @memberOf Function */
+Function.count.reset = function() {
+}
+
+/** @memberOf Function */
+count.getValue = function() {
+}
+
+/** @memberOf Function.prototype */
+getSig = function() {
+}
+
+/** @memberOf Function.prototype */
+Function.prototype.getProps = function() {
+}
diff --git a/jsdoc-toolkit/app/test/anon_inner.js b/jsdoc-toolkit/app/test/anon_inner.js
new file mode 100644 (file)
index 0000000..227eeee
--- /dev/null
@@ -0,0 +1,14 @@
+/**
+ * @name bar
+ * @namespace
+ */
+new function() {
+    /**
+     * @name bar-foo
+     * @function
+     * @param {number} x
+     */
+    function foo(x) {
+    }
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/augments.js b/jsdoc-toolkit/app/test/augments.js
new file mode 100644 (file)
index 0000000..12e706e
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+@constructor
+*/
+function Layout(p) {
+       this.init = function(p) {
+       }
+       
+       this.getId = function() {
+       }
+       
+       /** @type Page */
+       this.orientation = "landscape";
+}
+
+/**
+@constructor
+@augments Layout
+*/
+function Page() {
+       this.reset = function(b) {
+       }
+}
+
+/**
+@extends Page
+@constructor
+*/
+function ThreeColumnPage() {
+       this.init = function(resetCode) {
+       }
+}
diff --git a/jsdoc-toolkit/app/test/augments2.js b/jsdoc-toolkit/app/test/augments2.js
new file mode 100644 (file)
index 0000000..e8388f0
--- /dev/null
@@ -0,0 +1,26 @@
+/**
+@constructor
+*/
+function LibraryItem() {
+       this.reserve = function() {
+       }
+}
+
+/**
+@constructor
+*/
+function Junkmail() {
+       this.annoy = function() {
+       }
+}
+
+/**
+@inherits Junkmail.prototype.annoy as pester
+@augments ThreeColumnPage
+@augments LibraryItem
+@constructor
+*/
+function NewsletterPage() {
+       this.getHeadline = function() {
+       }
+}
diff --git a/jsdoc-toolkit/app/test/borrows.js b/jsdoc-toolkit/app/test/borrows.js
new file mode 100644 (file)
index 0000000..a5d8ea4
--- /dev/null
@@ -0,0 +1,46 @@
+/**
+@constructor
+*/
+function Layout(p) {
+       /** initilize 1 */
+       this.init = function(p) {
+       }
+       
+       /** get the id */
+       this.getId = function() {
+       }
+       
+       /** @type string */
+       this.orientation = "landscape";
+       
+       function getInnerElements(elementSecretId){
+       }
+}
+
+/** A static method. */
+Layout.units = function() {
+}
+
+/**
+@constructor
+@borrows Layout#orientation
+@borrows Layout-getInnerElements
+@borrows Layout.units
+*/
+function Page() {
+       /** reset the page */
+       this.reset = function(b) {
+       }
+}
+
+/**
+@constructor
+@borrows Layout.prototype.orientation as this.orientation
+@borrows Layout.prototype.init as #init
+@inherits Page.prototype.reset as #reset
+*/
+function ThreeColumnPage() {
+       /** initilize 2 */
+       this.init = function(p) {
+       }
+}
diff --git a/jsdoc-toolkit/app/test/borrows2.js b/jsdoc-toolkit/app/test/borrows2.js
new file mode 100644 (file)
index 0000000..c0d5ea2
--- /dev/null
@@ -0,0 +1,23 @@
+// testing circular borrows
+
+/**
+       @class
+       @borrows Bar#zop as this.my_zop
+*/
+function Foo() {
+       /** this is a zip. */
+       this.zip = function() {}
+       
+       this.my_zop = new Bar().zop;
+}
+
+/**
+       @class
+       @borrows Foo#zip as this.my_zip
+*/
+function Bar() {
+       /** this is a zop. */
+       this.zop = function() {}
+       
+       this.my_zip = new Foo().zip;
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/config.js b/jsdoc-toolkit/app/test/config.js
new file mode 100644 (file)
index 0000000..0748a21
--- /dev/null
@@ -0,0 +1,22 @@
+/**
+ * @constructor
+ * @param person The person.
+ * @param {string} person.name The person's name.
+ * @config {integer} age The person's age.
+ * @config [id=1] Optional id number to use.
+ * @param connection
+ */
+function Contact(person, connection) {
+
+}
+
+/**
+ * @constructor
+ * @param persons
+ * @config {string} Father The paternal person.
+ * @config {string} Mother The maternal person.
+ * @config {string[]} Children And the rest.
+ */
+function Family(/**Object*/persons) {
+
+}
diff --git a/jsdoc-toolkit/app/test/constructs.js b/jsdoc-toolkit/app/test/constructs.js
new file mode 100644 (file)
index 0000000..cca5dbd
--- /dev/null
@@ -0,0 +1,18 @@
+var Person = makeClass(
+    /**
+      @scope Person
+    */
+    {
+        /**
+               This is just another way to define a constructor.
+               @constructs
+               @param {string} name The name of the person.
+         */
+        initialize: function(name) {
+            this.name = name;
+        },
+        say: function(message) {
+            return this.name + " says: " + message;
+        }
+    }
+);
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/encoding.js b/jsdoc-toolkit/app/test/encoding.js
new file mode 100644 (file)
index 0000000..ba64219
--- /dev/null
@@ -0,0 +1,10 @@
+
+/**
+ * @Constructor
+ * @desc 配置文件
+ * @class 什么也不返回
+ */
+function Test(conf) {
+    // do something;
+}
+
diff --git a/jsdoc-toolkit/app/test/encoding_other.js b/jsdoc-toolkit/app/test/encoding_other.js
new file mode 100644 (file)
index 0000000..b144da4
--- /dev/null
@@ -0,0 +1,12 @@
+
+/**
+ * @Constructor
+ * @desc ðïîÛ
+ * @class ßàáâãäåæçèçìëêíîï °±²³´µ¡¶·¸¹
+ */
+function Test(conf) {
+    // do something;
+}
+
+// run with commanline option -e=iso-8859-5
+
diff --git a/jsdoc-toolkit/app/test/event.js b/jsdoc-toolkit/app/test/event.js
new file mode 100644 (file)
index 0000000..7e41d6f
--- /dev/null
@@ -0,0 +1,54 @@
+/**
+ * @name Kitchen
+ * @constructor
+ * @fires Bakery#event:donutOrdered
+ */
+
+/**
+ * Fired when some cake is eaten.
+ * @name Kitchen#event:cakeEaten
+ * @function
+ * @param {Number} pieces The number of pieces eaten.
+ */
+
+/**
+ * Find out if cake was eaten.
+ * @name Kitchen#cakeEaten
+ * @function
+ * @param {Boolean} wasEaten
+ */
+
+/**
+ * @name getDesert
+ * @function
+ * @fires Kitchen#event:cakeEaten
+ */
+/**
+ * @name Bakery
+ * @constructor
+ * @extends Kitchen
+ */
+
+/**
+ * Fired when a donut order is made.
+ * @name Bakery#event:donutOrdered
+ * @event
+ * @param {Event} e The event object.
+ * @param {String} [e.topping] Optional sprinkles.
+ */
+
+/**
+ * @constructor
+ * @borrows Bakery#event:donutOrdered as this.event:cakeOrdered
+ */
+function CakeShop() {
+}
+
+/** @event */
+CakeShop.prototype.icingReady = function(isPink) {
+}
+
+/** @event */
+function amHungry(/**Boolean*/enoughToEatAHorse) {
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/exports.js b/jsdoc-toolkit/app/test/exports.js
new file mode 100644 (file)
index 0000000..63a87cb
--- /dev/null
@@ -0,0 +1,14 @@
+/** @namespace */
+var mxn = {};
+
+(function(){ 
+    /** @exports Map as mxn.Map */
+    var Map =
+        /** @constructor */
+        mxn.Map = function() {
+        };
+    
+    /** A method. */
+    Map.prototype.doThings = function() {
+    };
+})();
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/functions_anon.js b/jsdoc-toolkit/app/test/functions_anon.js
new file mode 100644 (file)
index 0000000..e9dd6c1
--- /dev/null
@@ -0,0 +1,39 @@
+/** an anonymous constructor executed inline */
+a = new function() {
+       /** a.b*/
+    this.b = 1;
+    /** a.f */
+    this.f = function() {
+       /** a.c */
+       this.c = 2;
+    }
+}
+
+
+/**
+       named function executed inline
+*/
+bar1 = function Zoola1() {
+       /** property of global */
+       this.g = 1;
+}();
+
+/**
+       named constructor executed inline
+*/
+bar2 = new function Zoola2() {
+       /** property of bar */
+       this.p = 1;
+};
+
+/** module pattern */
+module = (function () {
+       /** won't appear in documentation */
+       var priv = 1;
+       
+       /** @scope module */
+       return {
+               /** will appear as a property of module */
+               pub: 1
+       }
+})();
diff --git a/jsdoc-toolkit/app/test/functions_nested.js b/jsdoc-toolkit/app/test/functions_nested.js
new file mode 100644 (file)
index 0000000..f044faf
--- /dev/null
@@ -0,0 +1,33 @@
+/** @constructor */
+function Zop() {
+}
+
+/**
+ @class
+*/
+Foo = function(id) {
+       // this is a bit twisted, but if you call Foo() you will then
+       // modify Foo(). This is kinda, sorta non-insane, because you
+       // would have to call Foo() 100% of the time to use Foo's methods
+       Foo.prototype.methodOne = function(bar) {
+         alert(bar);
+       };
+       
+       // same again
+       Foo.prototype.methodTwo = function(bar2) {
+         alert(bar2);
+       };
+       
+       // and these are only executed if the enclosing function is actually called
+       // and who knows if that will ever happen?
+       Bar = function(pez) {
+         alert(pez);
+       };
+       Zop.prototype.zap = function(p){
+               alert(p);
+       };
+       
+       // but this is only visible inside Foo
+       function inner() {
+       }
+};
diff --git a/jsdoc-toolkit/app/test/global.js b/jsdoc-toolkit/app/test/global.js
new file mode 100644 (file)
index 0000000..5ea4894
--- /dev/null
@@ -0,0 +1,13 @@
+/** ecks */
+var x = [1, 2, 4];
+
+var y = {
+       foo: function(){
+       }
+}
+
+bar = function() {
+}
+
+function zop() {
+}
diff --git a/jsdoc-toolkit/app/test/globals.js b/jsdoc-toolkit/app/test/globals.js
new file mode 100644 (file)
index 0000000..3f83fb1
--- /dev/null
@@ -0,0 +1,25 @@
+function example(/**Circle*/a, b) {
+       /** a global defined in function  */
+       var number = a;
+       
+       var hideNumber = function(){
+       }
+       
+       setNumber = function(){
+       }
+       alert('You have chosen: ' + b);
+}
+
+function initPage() {
+       var supported = document.createElement && document.getElementsByTagName;
+       if (!supported) return;
+       // start of DOM script
+       var x = document.getElementById('writeroot');
+       // etc.
+}
+
+/** an example var */
+var document = new Document(x, y);
+
+var getNumber = function(){
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/ignore.js b/jsdoc-toolkit/app/test/ignore.js
new file mode 100644 (file)
index 0000000..d3fac9e
--- /dev/null
@@ -0,0 +1,10 @@
+/**
+ * A test constructor.
+ * @constructor
+ * @ignore
+ */
+function Ignored() {
+       /** a method */
+    this.bar = function() {
+    }
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/inner.js b/jsdoc-toolkit/app/test/inner.js
new file mode 100644 (file)
index 0000000..37cfa9d
--- /dev/null
@@ -0,0 +1,16 @@
+/**
+ * @constructor
+ */
+function Outer() {
+  /**
+   * @constructor
+   */
+  function Inner(name) {
+    /** The name of this. */
+    this.name = name;
+  }
+
+  this.open = function(name) {
+    return (new Inner(name));
+  }
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/jsdoc_test.js b/jsdoc-toolkit/app/test/jsdoc_test.js
new file mode 100644 (file)
index 0000000..0817712
--- /dev/null
@@ -0,0 +1,477 @@
+/** 
+ * @fileoverview This file is to be used for testing the JSDoc parser
+ * It is not intended to be an example of good JavaScript OO-programming,
+ * nor is it intended to fulfill any specific purpose apart from 
+ * demonstrating the functionality of the 
+ * <a href='http://sourceforge.net/projects/jsdoc'>JSDoc</a> parser
+ *
+ * @author Gabriel Reid gab_reid@users.sourceforge.net
+ * @version 0.1 
+ */
+
+
+/**
+ * Construct a new Shape object.
+ * @class This is the basic Shape class.  
+ * It can be considered an abstract class, even though no such thing
+ * really existing in JavaScript
+ * @constructor
+ * @throws MemoryException if there is no more memory 
+ * @throws GeneralShapeException rarely (if ever)
+ * @return {Shape|Coordinate} A new shape.
+ */
+function Shape(){
+  
+   /**
+    * This is an example of a function that is not given as a property
+    * of a prototype, but instead it is assigned within a constructor.
+    * For inner functions like this to be picked up by the parser, the
+    * function that acts as a constructor <b>must</b> be denoted with
+    * the <b>&#64;constructor</b> tag in its comment.
+    * @type String
+    */
+   this.getClassName = function(){
+      return "Shape";
+   }
+
+   /** 
+    * This is an inner method, just used here as an example
+    * @since version 0.5
+    * @author Sue Smart
+    */
+   function addReference(){
+       // Do nothing...
+   }
+   
+}
+
+/**
+ * Create a new Hexagon instance.
+ * @extends Shape
+ * @class Hexagon is a class that is a <i>logical</i> sublcass of 
+ * {@link Shape} (thanks to the <code>&#64;extends</code> tag), but in 
+ * reality it is completely unrelated to Shape.
+ * @param {int} sideLength The length of one side for the new Hexagon
+ * @example
+ * var h = new Hexagon(2);
+ * @example
+ * if (hasHex) {
+ *     hex   = new Hexagon(5);
+ *     color = hex.getColor();
+ * }
+ */
+function Hexagon(sideLength) {
+}
+
+
+/**
+ * This is an unattached (static) function that adds two integers together.
+ * @param {int} One The first number to add 
+ * @param {int} Two The second number to add 
+ * @author Gabriel Reid
+ * @deprecated So you shouldn't use it anymore! Use {@link Shape#getClassName} instead.
+ */
+function Add(One, Two){
+    return One + Two;
+}
+
+
+/**
+ * The color of this shape
+ * @type Color
+ */
+Shape.prototype.color = null;
+
+/**
+ * The border of this shape. 
+ * @field
+ * @type int
+ */
+Shape.prototype.border = function(){return border;};
+
+/*
+ * These are all the instance method implementations for Shape
+ */
+
+/**
+ * Get the coordinates of this shape. It is assumed that we're always talking
+ * about shapes in a 2D location here.
+ * @requires The {@link Shape} class
+ * @returns A Coordinate object representing the location of this Shape
+ * @type Coordinate[]
+ */
+Shape.prototype.getCoords = function(){
+   return this.coords;
+}
+
+/**
+ * Get the color of this shape.
+ * @see #setColor
+ * @see The <a href="http://example.com">Color</a> library.
+ * @link Shape
+ * @type Color
+ */
+Shape.prototype.getColor = function(){
+   return this.color;
+}
+
+/**
+ * Set the coordinates for this Shape
+ * @param {Coordinate} coordinates The coordinates to set for this Shape
+ */
+Shape.prototype.setCoords = function(coordinates){
+   this.coords = coordinates;
+}
+
+/**
+ * Set the color for this Shape
+ * @param {Color} color The color to set for this Shape
+ * @param other There is no other param, but it can still be documented if
+ *              optional parameters are used
+ * @throws NonExistantColorException (no, not really!)
+ * @see #getColor
+ */
+Shape.prototype.setColor = function(color){
+   this.color = color;
+}
+
+/**
+ * Clone this shape
+ * @returns A copy of this shape
+ * @type Shape
+ * @author Gabriel Reid
+ */
+Shape.prototype.clone = function(){
+   return new Shape();
+}
+
+/**
+ * Create a new Rectangle instance. 
+ * @class A basic rectangle class, inherits from Shape.
+ * This class could be considered a concrete implementation class
+ * @constructor
+ * @param {int} width The optional width for this Rectangle
+ * @param {int} height Thie optional height for this Rectangle
+ * @author Gabriel Reid
+ * @see Shape is the base class for this
+ * @augments Shape
+ * @hilited
+ */
+function Rectangle(width, // This is the width 
+                  height // This is the height
+                  ){
+   if (width){
+      this.width = width;
+      if (height){
+        this.height = height;
+      }
+   }
+}
+
+
+/* Inherit from Shape */
+Rectangle.prototype = new Shape();
+
+/**
+ * Value to represent the width of the Rectangle.
+ * <br>Text in <b>bold</b> and <i>italic</i> and a 
+ * link to <a href="http://sf.net">SourceForge</a>
+ * @private
+ * @type int
+ */
+Rectangle.prototype.width = 0;
+
+/**
+ * Value to represent the height of the Rectangle
+ * @private
+ * @type int
+ */
+Rectangle.prototype.height = 0;
+
+/**
+ * Get the type of this object. 
+ * @type String
+ */
+Rectangle.prototype.getClassName= function(){
+    return "Rectangle";
+}
+
+/**
+ * Get the value of the width for the Rectangle
+ * @type int
+ * @see Rectangle#setWidth
+ */
+Rectangle.prototype.getWidth = function(){
+   return this.width;
+}
+
+/**
+ * Get the value of the height for the Rectangle.
+ * Another getter is the {@link Shape#getColor} method in the 
+ * {@link Shape} base class.  
+ * @return The height of this Rectangle
+ * @type int
+ * @see Rectangle#setHeight
+ */
+Rectangle.prototype.getHeight = function(){
+    return this.height;
+}
+
+/**
+ * Set the width value for this Rectangle.
+ * @param {int} width The width value to be set
+ * @see #setWidth
+ */
+Rectangle.prototype.setWidth = function(width){
+   this.width = width;
+}
+
+/**
+ * Set the height value for this Rectangle.
+ * @param {int} height The height value to be set
+ * @see #getHeight
+ */
+Rectangle.prototype.setHeight = function(height){
+   this.height = height;
+}
+
+/**
+ * Get the value for the total area of this Rectangle
+ * @return total area of this Rectangle
+ * @type int
+ */
+Rectangle.prototype.getArea = function(){
+   return width * height;
+}
+
+
+/**
+ * Create a new Square instance.
+ * @class A Square is a subclass of {@link Rectangle}
+ * @param {int} width The optional width for this Rectangle
+ * @param {int} height The optional height for this Rectangle
+ * @augments Rectangle
+ */
+function Square(width, height){
+   if (width){
+      this.width = width;
+      if (height){
+        this.height = height;
+      }
+   } 
+   
+}
+
+/* Square is a subclass of Rectangle */
+Square.prototype = new Rectangle();
+
+/**
+ * Set the width value for this Shape.
+ * @param {int} width The width value to be set
+ * @see #getWidth
+ */
+Square.prototype.setWidth = function(width){
+   this.width = this.height = width;
+}
+
+/**
+ * Set the height value for this Shape 
+ * Sets the {@link Rectangle#height} attribute in the Rectangle.
+ * @param {int} height The height value to be set
+ */
+Square.prototype.setHeight = function(height){
+   this.height = this.width = height;
+}
+
+
+/**
+ * Create a new Circle instance based on a radius.
+ * @class Circle class is another subclass of Shape
+ * @extends Shape
+ * @param {int} radius The optional radius of this {@link Circle }
+ * @mixin Square.prototype.setWidth as this.setDiameter
+ */
+function Circle(radius){
+   if (radius) {
+      /** The radius of the this Circle. */
+      this.radius = radius;
+   }
+}
+
+/* Circle inherits from {@link Shape} */
+Circle.prototype = new Shape();
+
+/** 
+ * The radius value for this Circle 
+ * @private
+ * @type int
+ */
+Circle.prototype.radius = 0;
+
+/** 
+ * A very simple class (static) field that is also a constant
+ * @final
+ * @type float
+ */
+Circle.PI = 3.14;
+
+/**
+ * Get the radius value for this Circle
+ * @type int
+ * @see #setRadius
+ */
+Circle.prototype.getRadius = function(){
+   return this.radius;
+}
+
+/** 
+ * Set the radius value for this Circle
+ * @param {int} radius The {@link Circle#radius} value to set
+ * @see #getRadius
+ */
+Circle.prototype.setRadius = function(radius){
+   this.radius = radius;
+}
+
+/** 
+ * An example of a  class (static) method that acts as a factory for Circle
+ * objects. Given a radius value, this method creates a new Circle.
+ * @param {int} radius The radius value to use for the new Circle.
+ * @type Circle
+ */
+Circle.createCircle = function(radius){
+    return new Circle(radius);
+}
+
+
+/**
+ * Create a new Coordinate instance based on x and y grid data.
+ * @class Coordinate is a class that can encapsulate location information.
+ * @param {int} [x=0] The optional x portion of the Coordinate
+ * @param {int} [y=0] The optinal y portion of the Coordinate
+ */
+function Coordinate(x, y){
+   if (x){
+      this.x = x;
+      if (y){
+        this.y = y;
+      }
+   }
+}
+
+/** 
+ * The x portion of the Coordinate 
+ * @type int
+ * @see #getX
+ * @see #setX
+ */
+Coordinate.prototype.x = 0;
+
+/** 
+ * The y portion of the Coordinate 
+ * @type int
+ * @see #getY
+ * @see #setY
+ */
+Coordinate.prototype.y = 0;
+
+/**
+ * Gets the x portion of the Coordinate.
+ * @type int
+ * @see #setX
+ */
+Coordinate.prototype.getX = function(){
+   return this.x;
+}
+
+/** 
+ * Get the y portion of the Coordinate.
+ * @type int
+ * @see #setY
+ */
+Coordinate.prototype.getY = function(){
+   return this.y;
+}
+
+/**
+ * Sets the x portion of the Coordinate.
+ * @param {int} x The x value to set
+ * @see #getX
+ */
+Coordinate.prototype.setX = function(x){
+   this.x = x;
+}
+
+/** 
+ * Sets the y portion of the Coordinate.
+ * @param {int} y The y value to set
+ * @see #getY
+ */
+Coordinate.prototype.setY = function(y){
+   this.y = y;
+}
+
+/**
+ * @class This class exists to demonstrate the assignment of a class prototype
+ * as an anonymous block.
+ */
+function ShapeFactory(){
+}
+
+ShapeFactory.prototype = {
+   /** 
+    * Creates a new {@link Shape} instance.
+    * @return A new {@link Shape}
+    * @type Shape
+    */
+   createShape: function(){
+      return new Shape();
+   }
+}
+
+/**
+ * An example of a singleton class
+ * @param ... Arguments represent {@link coordinate}s in the shape.
+ * @constructor
+ */
+MySingletonShapeFactory = function(){
+
+   /**
+    * Get the next {@link Shape}
+    * @type Shape
+    * @return A new {@link Shape}
+    */
+   this.getShape = function(){ 
+      return null; 
+   }
+
+}
+
+
+/** 
+ * Create a new Foo instance.
+ * @class This is the Foo class. It exists to demonstrate 'nested' classes.
+ * @constructor 
+ * @see Foo.Bar
+ */
+function Foo(){}
+
+/** 
+ * Creates a new instance of Bar.
+ * @class This class exists to demonstrate 'nested' classes.
+ * @constructor 
+ * @see Foo.Bar
+ */
+function Bar(){}
+
+/** 
+ * Nested class
+ * @constructor 
+ */
+Foo.Bar = function(){
+       /** The x. */ this.x = 2;
+}
+
+Foo.Bar.prototype = new Bar();
+/** The y. */ 
+Foo.Bar.prototype.y = '3';
diff --git a/jsdoc-toolkit/app/test/lend.js b/jsdoc-toolkit/app/test/lend.js
new file mode 100644 (file)
index 0000000..92b15d5
--- /dev/null
@@ -0,0 +1,33 @@
+ /** @class  */
+var Person = Class.create(
+    /**
+      @lends Person.prototype
+    */
+    {
+      initialize: function(name) {
+            this.name = name;
+        },
+        say: function(message) {
+            return this.name + ': ' + message;
+        }
+    }
+ );
+
+/** @lends Person.prototype */
+{
+       /** like say but more musical */
+       sing: function(song) {
+       }
+}
+
+/** @lends Person */
+{
+       getCount: function() {
+       }
+}
+
+/** @lends Unknown.prototype */
+{
+       notok: function() {
+       }
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/memberof.js b/jsdoc-toolkit/app/test/memberof.js
new file mode 100644 (file)
index 0000000..883bbde
--- /dev/null
@@ -0,0 +1,19 @@
+/** @constructor */
+pack = function() {
+       this.init = function(){}
+       function config(){}
+}
+ pack.build = function(task) {};
+
+/** @memberOf pack */
+pack.install = function() {}
+
+/** @memberOf pack */
+pack.install.overwrite = function() {}
+
+/** @memberOf pack */
+clean = function() {}
+
+/** @memberOf pack-config */
+install = function() {};
diff --git a/jsdoc-toolkit/app/test/memberof2.js b/jsdoc-toolkit/app/test/memberof2.js
new file mode 100644 (file)
index 0000000..bc3d9d8
--- /dev/null
@@ -0,0 +1,38 @@
+/**
+ * @constructor
+ */
+function Foo() {
+    /**
+       @memberOf Foo.prototype
+    */
+    function bar(a, b) {
+    }
+    
+    /**
+       @memberOf Foo
+    */
+    var zip = function(p, q) {
+    }
+    
+    /**
+       @memberOf Foo
+    */
+    function zop( x,y ) {
+    }
+    
+    /**
+       @memberOf Foo
+       @constructor
+    */
+    function Fiz() {
+       /** A method of Foo#Fiz. */
+       this.fipple = function(fop){}
+    }
+}
+
+/**
+       @memberOf Foo#
+ */
+var blat = function() {
+
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/memberof3.js b/jsdoc-toolkit/app/test/memberof3.js
new file mode 100644 (file)
index 0000000..8c25942
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+* @name Foo
+* @class
+*/
+
+/**#@+
+* @memberOf Foo#
+* @field
+*/
+
+/**
+* @name bar
+* @type Object[]
+*/
+
+/**#@-*/
+
+/**
+* @name Foo2
+* @class
+*/
+
+/**#@+
+* @memberOf Foo2#
+* @field
+*/
+
+/**
+* @name bar
+* @type Object[]
+*/
+
+/**#@-*/
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/memberof_constructor.js b/jsdoc-toolkit/app/test/memberof_constructor.js
new file mode 100644 (file)
index 0000000..80fde73
--- /dev/null
@@ -0,0 +1,17 @@
+/** @constructor */
+function Circle(){}
+
+/**
+       @constructor
+       @memberOf Circle#
+ */
+Circle.prototype.Tangent = function(){};
+
+// renaming Circle#Tangent to Circle#Circle#Tangent
+
+/**
+       @memberOf Circle#Tangent#
+ */
+Circle.prototype.Tangent.prototype.getDiameter = function(){};
+
+
diff --git a/jsdoc-toolkit/app/test/module.js b/jsdoc-toolkit/app/test/module.js
new file mode 100644 (file)
index 0000000..5b3fe42
--- /dev/null
@@ -0,0 +1,17 @@
+/** @namespace */
+myProject = myProject || {};
+
+/** @namespace */
+myProject.myModule = (function () {
+       /** describe myPrivateVar here */
+       var myPrivateVar = "";
+
+       var myPrivateMethod = function () {
+       }
+
+       /** @scope myProject.myModule */
+       return {
+               myPublicMethod: function () {
+               }
+       };
+})();
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/multi_methods.js b/jsdoc-toolkit/app/test/multi_methods.js
new file mode 100644 (file)
index 0000000..bab35c7
--- /dev/null
@@ -0,0 +1,25 @@
+
+/**
+       Get the entire flavor.
+       @name flavor^3
+       @function
+       @returns {Object} The entire flavor hash.
+*/
+/**
+       Get a named flavor.
+       @name flavor^2
+       @function
+       @param {String} name The name of the flavor to get.
+       @returns {String} The value of that flavor.
+*/
+/**
+       Set the flavor.
+       @param {String} name The name of the flavor to set.
+       @param {String} value The value of the flavor.
+       @returns {String} The value of that flavor.
+*/
+function flavor(name, value) {
+       if (arguments.length > 1) flavor[name] = value;
+       else if (arguments.length == 1) return flavor[name];
+       else return flavor;
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/name.js b/jsdoc-toolkit/app/test/name.js
new file mode 100644 (file)
index 0000000..e88a51a
--- /dev/null
@@ -0,0 +1,19 @@
+/**
+ @name Response
+ @class
+*/
+
+Response.prototype = {
+       /**
+        @name Response#text
+        @function
+        @description
+               Gets the body of the response as plain text
+        @returns {String}
+               Response as text
+       */
+
+       text: function() {
+               return this.nativeResponse.responseText;
+       }
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/namespace_nested.js b/jsdoc-toolkit/app/test/namespace_nested.js
new file mode 100644 (file)
index 0000000..46cafa2
--- /dev/null
@@ -0,0 +1,23 @@
+/** 
+       @namespace This is the first namespace.
+*/
+ns1 = {};
+
+/** 
+       This is the second namespace.
+       @namespace
+*/
+ns1.ns2 = {};
+
+/**
+       This part of ns1.ns2
+       @constructor
+*/
+ns1.ns2.Function1 = function() {
+};
+
+ns1.staticFunction = function() {
+};
+
+/** A static field in a namespace. */
+ns1.ns2.staticField = 1;
diff --git a/jsdoc-toolkit/app/test/nocode.js b/jsdoc-toolkit/app/test/nocode.js
new file mode 100644 (file)
index 0000000..1cf99bc
--- /dev/null
@@ -0,0 +1,13 @@
+/**#nocode+*/
+    /**
+      @name star
+      @function
+    */
+    function blahblah() {
+    
+    }
+/**#nocode-*/
+
+function yaddayadda() {
+
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/oblit_anon.js b/jsdoc-toolkit/app/test/oblit_anon.js
new file mode 100644 (file)
index 0000000..8d9e941
--- /dev/null
@@ -0,0 +1,20 @@
+/** the options */
+opt = Opt.get(
+       arguments, 
+       {
+        d: "directory",
+        c: "conf",
+        "D[]": "define"
+       }
+);
+
+/** configuration */
+opt.conf = {
+       /** keep */
+       keep: true,
+       /** base */
+       base: getBase(this, {p: properties})
+}
+
+
+
diff --git a/jsdoc-toolkit/app/test/overview.js b/jsdoc-toolkit/app/test/overview.js
new file mode 100644 (file)
index 0000000..1dfc09b
--- /dev/null
@@ -0,0 +1,20 @@
+/**
+ * @overview This "library" contains a 
+ *               lot of classes and functions.
+ * @example
+ <pre>
+       var x (x < 1);
+       alert("This 'is' \"code\"");
+ </pre>
+ * @name My Cool Library
+ * @author     Joe Smith jsmith@company.com
+ * @version    0.1 
+ */
+/** 
+ * Gets the current foo 
+ * @param {String} fooId       The unique identifier for the foo.
+ * @return {Object}    Returns the current foo.
+ */
+function getFoo(fooID){
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/param_inline.js b/jsdoc-toolkit/app/test/param_inline.js
new file mode 100644 (file)
index 0000000..09845b2
--- /dev/null
@@ -0,0 +1,37 @@
+/**
+       @constructor
+       @param columns The number of columns.
+*/
+function Layout(/**int*/columns){
+       /**
+               @param [id] The id of the element.
+               @param elName The name of the element.
+       */
+       this.getElement = function(
+               /** string */ elName,
+               /** number|string */ id
+       ) {
+       };
+       
+       /** 
+               @constructor
+        */
+       this.Canvas = function(top, left, /**int*/width, height) {
+               /** Is it initiated yet? */
+               this.initiated = true;
+       }
+       
+       this.rotate = function(/**nothing*/) {
+       }
+       
+       /** 
+       @param x
+       @param y
+       @param {zoppler} z*/
+       this.init = function(x, y, /**abbler*/z) {
+               /** The xyz. */
+               this.xyz = x+y+z;
+               this.getXyz = function() {
+               }
+       }
+}
diff --git a/jsdoc-toolkit/app/test/params_optional.js b/jsdoc-toolkit/app/test/params_optional.js
new file mode 100644 (file)
index 0000000..18bf598
--- /dev/null
@@ -0,0 +1,8 @@
+
+/**
+ * @param {Page[]} pages
+ * @param {number} [id] Specifies the id, if applicable.
+ * @param {String} [title = This is untitled.] Specifies the title.
+ */
+function Document(pages, id, title){
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/prototype.js b/jsdoc-toolkit/app/test/prototype.js
new file mode 100644 (file)
index 0000000..1147008
--- /dev/null
@@ -0,0 +1,17 @@
+/** @constructor */
+function Article() {
+}
+
+Article.prototype.init = function(title) {
+       /** the instance title */
+       this.title = title;
+       
+       /** the static counter */
+       Article.counter = 1;
+}
+
+a = new Article();
+a.Init("my title");
+
+print(a.title);
+print(Article.counter);
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/prototype_nested.js b/jsdoc-toolkit/app/test/prototype_nested.js
new file mode 100644 (file)
index 0000000..e8ca1ce
--- /dev/null
@@ -0,0 +1,9 @@
+/** @constructor */
+function Word() {
+}
+
+Word.prototype.reverse = function() {
+}
+
+Word.prototype.reverse.utf8 = function() {
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/prototype_oblit.js b/jsdoc-toolkit/app/test/prototype_oblit.js
new file mode 100644 (file)
index 0000000..6cfc39c
--- /dev/null
@@ -0,0 +1,13 @@
+/** @constructor */
+function Article() {
+}
+
+Article.prototype = {
+       /** instance get title */
+       getTitle: function(){
+       }
+}
+
+/** static get title */
+Article.getTitle = function(){
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/prototype_oblit_constructor.js b/jsdoc-toolkit/app/test/prototype_oblit_constructor.js
new file mode 100644 (file)
index 0000000..9248248
--- /dev/null
@@ -0,0 +1,24 @@
+/** @constructor */
+function Article() {
+}
+
+Article.prototype = {
+       /** @constructor */
+       Title: function(title) {
+               /** the value of the Title instance */
+               this.title = title;
+       },
+       
+       init: function(pages) {
+               /** the value of the pages of the Article instance */
+               this.pages = pages;
+       }
+}
+
+f = new Article();
+f.init("one two three");
+
+t = new f.Title("my title");
+
+print(f.pages);
+print(t.title);
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/public.js b/jsdoc-toolkit/app/test/public.js
new file mode 100644 (file)
index 0000000..35d34f6
--- /dev/null
@@ -0,0 +1,10 @@
+/**@constructor*/
+function Foo() {
+       /**
+               @public
+               @static
+               @field
+       */
+       var bar = function(x) {
+       }
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/scripts/code.js b/jsdoc-toolkit/app/test/scripts/code.js
new file mode 100644 (file)
index 0000000..e9d7ed2
--- /dev/null
@@ -0,0 +1,5 @@
+/**
+       @class
+ */
+function thisiscode() {
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/scripts/notcode.txt b/jsdoc-toolkit/app/test/scripts/notcode.txt
new file mode 100644 (file)
index 0000000..fcd737e
--- /dev/null
@@ -0,0 +1,5 @@
+(This is not code)
+function foo(){{{{
+(
+!
+@
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/shared.js b/jsdoc-toolkit/app/test/shared.js
new file mode 100644 (file)
index 0000000..e1c277a
--- /dev/null
@@ -0,0 +1,42 @@
+
+/**
+ * Builtin object.
+ * @class
+ * @name Array
+ */
+/**#@+
+ * Extension to builtin array.
+ * @memberOf Array
+ * @method
+ */
+/**
+ * @returns Boolen if some array members...
+ */
+Array.prototype.some = function(){};
+
+/**
+ * Change every element of an array.
+ * @returns Filtered array copy.
+ */
+Array.prototype.filter = function(){};
+
+/**#@-*/
+
+
+/**
+ * A first in, first out data structure.
+ * @constructor
+ */
+Queue = function(){};
+
+/**#@+
+ * Extension to Queue.
+ * @memberOf Queue
+ */
+
+rewind = function(){
+}
+
+// should close automatically here.
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/shared2.js b/jsdoc-toolkit/app/test/shared2.js
new file mode 100644 (file)
index 0000000..3f7736a
--- /dev/null
@@ -0,0 +1,2 @@
+startOver = function(){
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/shortcuts.js b/jsdoc-toolkit/app/test/shortcuts.js
new file mode 100644 (file)
index 0000000..f738f1e
--- /dev/null
@@ -0,0 +1,22 @@
+// /**#=+
+//  * {
+//  *  'D': 'Date.prototype',
+//  *  '$N': 'Number'
+//  * }
+//  */
+// var D = Date.prototype,
+// $N = Number;
+// 
+// D.locale = function(){
+// };
+// 
+// /**
+//     @return {string} The cardinal number string.
+// */
+// $N.nth = function(n){
+// };
+// 
+// LOAD.file = function(){
+// }
+// 
+// /**#=-*/
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/static_this.js b/jsdoc-toolkit/app/test/static_this.js
new file mode 100644 (file)
index 0000000..9407b20
--- /dev/null
@@ -0,0 +1,13 @@
+/** the parent */
+var box = {};
+
+/** @namespace */
+box.holder = {}
+
+box.holder.foo = function() {
+       /** the counter */
+       this.counter = 1;
+}
+
+box.holder.foo();
+print(box.holder.counter);
diff --git a/jsdoc-toolkit/app/test/synonyms.js b/jsdoc-toolkit/app/test/synonyms.js
new file mode 100644 (file)
index 0000000..09066b9
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+       @class
+       @inherits Bar#zop as #my_zop
+*/
+function Foo() {
+       /** this is a zip. */
+       this.zip = function() {}
+       
+       /** from Bar */
+       this.my_zop = new Bar().zop;
+}
+
+/**
+       @class
+       @borrows Foo#zip as this.my_zip
+*/
+function Bar() {
+       /** this is a zop. */
+       this.zop = function() {}
+       
+       /** from Foo */
+       this.my_zip = new Foo().zip;
+}
+
+/** @namespace */
+var myObject = {
+       /**
+               @type function
+       */
+       myFunc: getFunction()
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/tosource.js b/jsdoc-toolkit/app/test/tosource.js
new file mode 100644 (file)
index 0000000..706d476
--- /dev/null
@@ -0,0 +1,23 @@
+/**
+ * @param {Object} object
+ * @return {string}
+ */
+function valueOf(object) {}
+
+/**
+ * @param {Object} object
+ * @return {string}
+ */
+function toString(object) {}
+
+/**
+ * @param {Object} object
+ * @return {string}
+ */
+function toSource(object) {}
+
+/**
+ * @param {Object} object
+ * @return {string}
+ */
+function constructor(object) {}
\ No newline at end of file
diff --git a/jsdoc-toolkit/app/test/variable_redefine.js b/jsdoc-toolkit/app/test/variable_redefine.js
new file mode 100644 (file)
index 0000000..2c07da0
--- /dev/null
@@ -0,0 +1,14 @@
+/** @constructor */
+function Foo() {
+       var bar = 1;
+       bar = 2; // redefining a private
+       
+       this.baz = 1;
+       baz = 2; // global
+       
+       /** a private */
+       var blap = {
+               /** in here */
+               tada: 1
+       }
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/changes.txt b/jsdoc-toolkit/changes.txt
new file mode 100644 (file)
index 0000000..b0acbab
--- /dev/null
@@ -0,0 +1,124 @@
+== 2.4.0 ==
+
+  * Fixed bug that added mutiple symbols with the same name to docs.
+  * Added support for the -m option to suppress warnings for multiple docs.
+  * Added patch by brownsea42 to support quoted user variables on the command line. ( issue #281 )
+  * Fixed bug that sometimes caused links to events to be incorrect. ( issue #292 )
+  
+== 2.3.3 ==
+
+  * Fixed bug that made all fields declared with the @property tag static. ( issue #262 )
+  * Minor fix to better handle trailing slash on path to template (from jwmetrocat). ( issue #237 )
+  * Fix for @memberOf when applied to inner members. ( issue #264 )
+  * Fix for @memberOf when applied to symbols documented with @name. ( issue #260 )
+  * Applied patch from kunhualqk, fix for bug where @link to borrowed member did not resolve to parent class. ( issue #218 )
+  * Fix for @requires not linking back to the required class
+  * Added experimental support for @constructs to have an argument, the class name, when applied to a function assignment.
+  
+== 2.3.2 ==
+
+ * Minor update to the usage notes and corrected the version number displayed in the output.
+
+== 2.3.1 ==
+
+ * Fixed HTML typo in allfiles template. ( issue #228 )
+ * Modified template to display version information for classes.
+ * Modified template to better support multiple methods with the same name.
+ * Fixed bug that caused template to error when backtick characters appeared around class names.
+
+== 2.3.0 ==
+
+  * Added option -u, --unique to avoid bug that causes multiple symbols with names that differ only by case to overwrite each others output on case-insensitive filesystems. ( issue #162 )
+  * Fixed bug where {@links} in @deprecated tags did not resolve. ( issue #220 )
+  * Fixed bug that caused parens around a function to make it to be unrecognized. ( issue #213 )
+  * Fixed bug prevented explicit links to named anchors from working (thanks katgao.pku). ( issue #215 )
+  * Fixed bug that prevented full description from appearing in file overview. ( issue #224 )
+  
+== 2.2.1 ==
+
+  * Fixed bug with class template, where sorting of methods was accidentally removed (thanks dezfowler).
+  * Added missing test files for the @exports unit tests.
+
+== 2.2.0 ==
+
+  * Fixed bug that caused exception when given a folder containing non-js files, even with the x commandline option set to "js". ( issue #193 )
+  * Fixed typo in index template [patch submitted by olle]. ( issue #198 )
+  * Modified @borrows tag experimentally to allow for missing "as ..." clause.
+  * Added support for the @exports tag, to allow one symbol to be documented as another.
+  * Added support for the -S option to document code following the Secure Modules pattern.
+  
+== 2.1.0 ==
+
+  * Added support for the @event tag.
+  * Fixed bug that prevented the : character from appearing in symbol names.
+  * Fixed bug that prevented underscored symbols marked with @public being tagged as private. (issue #184 )
+  * Fixed bug that randomly affected the @memberOf tag when the name of the symbol did not include the parent name.
+  * Fixed bug that prevented templates that were not in the jsdoc-toolkit folder from being found. ( issue #176 )
+  * Added ability to check for trailing slash on template path. ( issue #177 )
+  * Modified classDesc so that it no longer is appended with the constructor desc.
+  * Fixed call to plugin onDocCommentSrc.
+  * Added missing support for inline doc comments for function return types. ( issue #189 )
+  * Added command line option -q, --quiet.
+  * Added command line option -E, --exclude. ( issue #143 )
+  * Added 2 more hooks for plugins. ( issue #163 )
+  * Added support for extending built-ins. ( issue #160 )
+  * Added "compact" option to JSDOC.JsPlate.prototype.process. ( issue #159 )
+  * @augments no longer documents static members as inherited. ( issue #138 )
+  * @link to a class now goes to the page for that class, not the constructor. ( issue #178 )
+  * Warnings of mismatched curly brace now include filename. ( issue #166 )
+  * Fixed bug affecting template paths loaded via a configuration file when the trailing slash is missing. ( issue #191 )
+  * Minor optimizations.
+
+== 2.0.2 ==
+
+  * Fixed bug that sometimes caused an example of division in the source code to be interpretted as a regex by the JsDoc Toolkit analyzer. ( issue #158 )
+  * Fixed a bug that prevented private variables marked as @public from appearing in the documentation. ( issue #161 )
+  * Fixed bug that prevented variable names with underscored properties from appearing in summaries. ( issue #173 )
+
+== 2.0.1 ==
+
+  * Fixed bug that prevented @fileOverview tag from being recognized.
+  * Added support for @fieldOf as a synonym for @field plus @memberOf.
+  * Added support for @name tag in a @fileOverview comment to control the displayed name of the file.
+  * Added support for multiple @example tags. ( issue #152 )
+  * Modified style sheet of jsdoc template to make more readable. ( issue #151 )
+  * Fixed bug that prevented @since documentation from displaying correctly when it appeared in a class. ( issue #150 )
+  * Fixed bug that caused inhertited properties to sometimes not resolve correctly. ( issue #144 )
+  * Modified so that trailing whitespace in @example is always trimmed. ( issue #153 )
+  * Added support for elseif to JsPlate. (hat tip to fredck)
+  * Added support for @location urls in the @overview comment to the jsdoc template.
+
+== Changes From Versions 1.4.0 to 2.0.0 ==
+
+  * Upgraded included version of Rhino from 1.6 to 1.7R1.
+  * Removed circular references in parsed documentation objects.
+  * Improved inheritance handling, now properties and events can be inherited same as methods.
+  * Improved handling of cross-file relationships, now having two related objects in separate files is not a problem.
+  * Improved ability to recognize membership of previously defined objects.
+  * Added ability to redefine parsing behavior with plugins.
+  * @methodOf is a synonym for @function and @memberOf.
+  * Added @default to document default values of members that are objects.
+  * Added ability to parse and refer to inner functions.
+  * Fixed bug that appeared when calling a method to set properties of the instance referred to by "this".
+  * Added ability to automatically create links to other symbols.
+  * New "jsdoc" template now produces fully W3C valid XHTML.
+  * Inline parameter type hint comments are now documented.
+  * Fixed error: Locally scoped variables (declared with var) no longer appear as global.
+  * It is now possible to run JsDoc Toolkit from any directory.
+  * Added support for inline {@link ...} tags.
+  * Added support for the -H command-line option to allow for custom content handlers.
+  * Tag names @inherits and @scope changed to @borrows and @lends.
+  ? Combining @constructor in a doclet with @lends now supported.
+  * Multiple @lend tags now supported.
+  * Added support for the @constructs tag, used inside a @lends block.
+  * Added support for the @constant tag.
+  * Fixed bug that prevented the use of [] as a default value.
+  * Added support for the @field tag.
+  * Added support for the @public tag (applied to inner functions).
+  * @namespace tag can now be applied to functions, not just object literals.
+  * Added support for the -s command line option to suppress source code output.
+  * Added new unit test framework.
+  * Underscored symbols are now treated as if they have a @private tag by default.
+  * Improved support for anonymous constructors.
+  * Added support for the nocode meta tag.
+  
\ No newline at end of file
diff --git a/jsdoc-toolkit/conf/sample.conf b/jsdoc-toolkit/conf/sample.conf
new file mode 100644 (file)
index 0000000..ad0f08e
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+       This is an example of one way you could set up a configuration file to more
+       conveniently define some commandline options. You might like to do this if
+       you frequently reuse the same options. Note that you don't need to define
+       every option in this file, you can combine a configuration file with
+       additional options on the commandline if your wish.
+       
+       You would include this configuration file by running JsDoc Toolkit like so:
+       java -jar jsrun.jar app/run.js -c=conf/sample.conf
+
+*/
+
+{
+       // source files to use
+       _: ['app/test/jsdoc_test.js'],
+       
+       // document all functions, even uncommented ones
+       a: true,
+       
+       // including those marked @private
+       p: true,
+       
+       // some extra variables I want to include
+       D: {generatedBy: "Michael Mathews", copyright: "2008"},
+       
+       // use this directory as the output directory
+       d: "docs",
+       
+       // use this template
+       t: "templates/jsdoc"
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/java/build.xml b/jsdoc-toolkit/java/build.xml
new file mode 100644 (file)
index 0000000..bb845ce
--- /dev/null
@@ -0,0 +1,36 @@
+<project>
+   <target name="clean">
+        <delete dir="build"/>
+    </target>
+
+    <target name="compile">
+        <mkdir dir="build/classes"/>
+        <javac 
+         srcdir="src" destdir="build/classes"
+         classpath="./classes/js.jar"
+        />
+    </target>
+
+    <target name="jar">
+        <mkdir dir="build/jar"/>
+        <jar destfile="build/jar/jsrun.jar" basedir="build/classes">
+            <manifest>
+               <attribute name="Main-Class" value="JsRun"/>
+               <attribute name="Class-Path" value="./java/classes/js.jar"/>
+            </manifest>
+        </jar>
+    </target>
+    
+    <target name="debugjar">
+        <mkdir dir="build/jar"/>
+        <jar destfile="build/jar/jsdebug.jar" basedir="build/classes">
+            <manifest>
+               <attribute name="Main-Class" value="JsDebugRun"/>
+               <attribute name="Class-Path" value="./java/classes/js.jar"/>
+            </manifest>
+        </jar>
+    </target>
+
+    <target name="clean-build" depends="clean,compile,jar"/>
+    <target name="clean-debug" depends="clean,compile,debugjar"/>
+</project>
\ No newline at end of file
diff --git a/jsdoc-toolkit/java/build_1.4.xml b/jsdoc-toolkit/java/build_1.4.xml
new file mode 100644 (file)
index 0000000..ab408a4
--- /dev/null
@@ -0,0 +1,36 @@
+<project default="clean-build"><!-- use this build script if you are stuck with ant version 1.4 -->
+   <target name="clean">
+        <delete dir="build"/>
+    </target>
+
+    <target name="compile">
+        <mkdir dir="build/classes"/>
+        <javac 
+         srcdir="src" destdir="build/classes"
+         classpath="./classes/js.jar"
+        />
+    </target>
+
+    <target name="jar">
+        <mkdir dir="build/jar"/>
+        <jar jarfile="build/jar/jsrun.jar" basedir="build/classes">
+            <manifest>
+               <attribute name="Main-Class" value="JsRun"/>
+               <attribute name="Class-Path" value="./java/classes/js.jar"/>
+            </manifest>
+        </jar>
+    </target>
+    
+    <target name="debugjar">
+        <mkdir dir="build/jar"/>
+        <jar jarfile="build/jar/jsdebug.jar" basedir="build/classes">
+            <manifest>
+               <attribute name="Main-Class" value="JsDebugRun"/>
+               <attribute name="Class-Path" value="./java/classes/js.jar"/>
+            </manifest>
+        </jar>
+    </target>
+
+    <target name="clean-build" depends="clean,compile,jar"/>
+    <target name="clean-debug" depends="clean,compile,debugjar"/>
+</project>
diff --git a/jsdoc-toolkit/java/classes/js.jar b/jsdoc-toolkit/java/classes/js.jar
new file mode 100644 (file)
index 0000000..0352cb1
Binary files /dev/null and b/jsdoc-toolkit/java/classes/js.jar differ
diff --git a/jsdoc-toolkit/java/src/JsDebugRun.java b/jsdoc-toolkit/java/src/JsDebugRun.java
new file mode 100755 (executable)
index 0000000..319a5c6
--- /dev/null
@@ -0,0 +1,21 @@
+/**
+ * A trivial bootstrap class that simply adds the path to the
+ * .js file as an argument to the Rhino call. This little hack
+ * allows the code in the .js file to have access to it's own 
+ * path via the Rhino arguments object. This is necessary to 
+ * allow the .js code to find resource files in a location 
+ * relative to itself.
+ *
+ * USAGE: java -jar jsdebug.jar path/to/file.js
+ */
+public class JsDebugRun {
+       public static void main(String[] args) {
+               String[] jsargs = {"-j="+args[0]};
+               
+               String[] allArgs = new String[jsargs.length + args.length];
+               System.arraycopy(args, 0, allArgs, 0, args.length);
+               System.arraycopy(jsargs, 0, allArgs, args.length ,jsargs.length);
+
+               org.mozilla.javascript.tools.debugger.Main.main(allArgs);
+    }
+}
diff --git a/jsdoc-toolkit/java/src/JsRun.java b/jsdoc-toolkit/java/src/JsRun.java
new file mode 100644 (file)
index 0000000..25f519a
--- /dev/null
@@ -0,0 +1,21 @@
+/**
+ * A trivial bootstrap class that simply adds the path to the
+ * .js file as an argument to the Rhino call. This little hack
+ * allows the code in the .js file to have access to it's own 
+ * path via the Rhino arguments object. This is necessary to 
+ * allow the .js code to find resource files in a location 
+ * relative to itself.
+ *
+ * USAGE: java -jar jsrun.jar path/to/file.js
+ */
+public class JsRun {
+       public static void main(String[] args) {
+               String[] jsargs = {"-j="+args[0]};
+               
+               String[] allArgs = new String[jsargs.length + args.length];
+               System.arraycopy(args, 0, allArgs, 0, args.length);
+               System.arraycopy(jsargs, 0, allArgs, args.length ,jsargs.length);
+
+               org.mozilla.javascript.tools.shell.Main.main(allArgs);
+    }
+}
diff --git a/jsdoc-toolkit/jsdebug.jar b/jsdoc-toolkit/jsdebug.jar
new file mode 100644 (file)
index 0000000..a0ac7da
Binary files /dev/null and b/jsdoc-toolkit/jsdebug.jar differ
diff --git a/jsdoc-toolkit/jsrun.jar b/jsdoc-toolkit/jsrun.jar
new file mode 100644 (file)
index 0000000..49c03f4
Binary files /dev/null and b/jsdoc-toolkit/jsrun.jar differ
diff --git a/jsdoc-toolkit/jsrun.sh b/jsdoc-toolkit/jsrun.sh
new file mode 100644 (file)
index 0000000..74ca79c
--- /dev/null
@@ -0,0 +1,52 @@
+#!/bin/ksh
+
+# launcher script for jsdoc
+# Author: Avi Deitcher
+#
+# This program is released under the MIT License as follows:
+
+# Copyright (c) 2008-2009 Atomic Inc <avi@jsorm.com>
+#
+#Permission is hereby granted, free of charge, to any person
+#obtaining a copy of this software and associated documentation
+#files (the "Software"), to deal in the Software without
+#restriction, including without limitation the rights to use,
+#copy, modify, merge, publish, distribute, sublicense, and/or sell
+#copies of the Software, and to permit persons to whom the
+#Software is furnished to do so, subject to the following
+#conditions:
+##
+#The above copyright notice and this permission notice shall be
+#included in all copies or substantial portions of the Software.
+#
+#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+#EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+#OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+#NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+#HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+#WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+#FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+#OTHER DEALINGS IN THE SOFTWARE.
+#
+
+
+if [[ -n "$JSDOCDIR" ]]; then
+        _DOCDIR="-Djsdoc.dir=$JSDOCDIR"
+        _APPDIR="$JSDOCDIR/app"
+       _BASEDIR="$JSDOCDIR"
+else
+        _DOCDIR=""
+        _APPDIR="./app"
+       _BASEDIR="."
+fi
+
+if [[ -n "$JSDOCTEMPLATEDIR" ]]; then
+        _TDIR="-Djsdoc.template.dir=$JSDOCTEMPLATEDIR"
+else
+        _TDIR=""
+fi
+
+CMD="java $_DOCDIR $_TDIR -jar $_BASEDIR/jsrun.jar $_APPDIR/run.js $@"
+echo $CMD
+$CMD
+
diff --git a/jsdoc-toolkit/out/jsdoc/files.html b/jsdoc-toolkit/out/jsdoc/files.html
new file mode 100644 (file)
index 0000000..03e954f
--- /dev/null
@@ -0,0 +1,255 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+               
+               <title>JsDoc Reference - File Index</title>
+               <meta name="generator" content="JsDoc Toolkit" />
+               
+               <style type="text/css">
+               /* default.css */
+body
+{
+       font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+       width: 800px;
+}
+
+.header
+{
+       clear: both;
+       background-color: #ccc;
+       padding: 8px;
+}
+
+h1
+{
+       font-size: 150%;
+       font-weight: bold;
+       padding: 0;
+       margin: 1em 0 0 .3em;
+}
+
+hr
+{
+       border: none 0;
+       border-top: 1px solid #7F8FB1;
+       height: 1px;
+}
+
+pre.code
+{
+       display: block;
+       padding: 8px;
+       border: 1px dashed #ccc;
+}
+
+#index
+{
+       margin-top: 24px;
+       float: left;
+       width: 160px;
+       position: absolute;
+       left: 8px;
+       background-color: #F3F3F3;
+       padding: 8px;
+}
+
+#content
+{
+       margin-left: 190px;
+       width: 600px;
+}
+
+.classList
+{
+       list-style-type: none;
+       padding: 0;
+       margin: 0 0 0 8px;
+       font-family: arial, sans-serif;
+       font-size: 1em;
+       overflow: auto;
+}
+
+.classList li
+{
+       padding: 0;
+       margin: 0 0 8px 0;
+}
+
+.summaryTable { width: 100%; }
+
+h1.classTitle
+{
+       font-size:170%;
+       line-height:130%;
+}
+
+h2 { font-size: 110%; }
+caption, div.sectionTitle
+{
+       background-color: #7F8FB1;
+       color: #fff;
+       font-size:130%;
+       text-align: left;
+       padding: 2px 6px 2px 6px;
+       border: 1px #7F8FB1 solid;
+}
+
+div.sectionTitle { margin-bottom: 8px; }
+.summaryTable thead { display: none; }
+
+.summaryTable td
+{
+       vertical-align: top;
+       padding: 4px;
+       border-bottom: 1px #7F8FB1 solid;
+       border-right: 1px #7F8FB1 solid;
+}
+
+/*col#summaryAttributes {}*/
+.summaryTable td.attributes
+{
+       border-left: 1px #7F8FB1 solid;
+       width: 140px;
+       text-align: right;
+}
+
+td.attributes, .fixedFont
+{
+       line-height: 15px;
+       color: #002EBE;
+       font-family: "Courier New",Courier,monospace;
+       font-size: 13px;
+}
+
+.summaryTable td.nameDescription
+{
+       text-align: left;
+       font-size: 13px;
+       line-height: 15px;
+}
+
+.summaryTable td.nameDescription, .description
+{
+       line-height: 15px;
+       padding: 4px;
+       padding-left: 4px;
+}
+
+.summaryTable { margin-bottom: 8px; }
+
+ul.inheritsList
+{
+       list-style: square;
+       margin-left: 20px;
+       padding-left: 0;
+}
+
+.detailList {
+       margin-left: 20px; 
+       line-height: 15px;
+}
+.detailList dt { margin-left: 20px; }
+
+.detailList .heading
+{
+       font-weight: bold;
+       padding-bottom: 6px;
+       margin-left: 0;
+}
+
+.light, td.attributes, .light a:link, .light a:visited
+{
+       color: #777;
+       font-style: italic;
+}
+
+.fineprint
+{
+       text-align: right;
+       font-size: 10px;
+}
+               </style>
+       </head>
+       
+       <body>
+               <div id="header">
+</div>
+               
+               <div id="index">
+                       <div align="center"><a href="index.html">Class Index</a>
+| <a href="files.html">File Index</a></div>
+<hr />
+<h2>Classes</h2>
+<ul class="classList">
+       
+       <li><i><a href="symbols/_global_.html">_global_</a></i></li>
+       
+       <li><a href="symbols/Dygraph.html">Dygraph</a></li>
+       
+</ul>
+<hr />
+               </div>
+               
+               <div id="content">
+                       <h1 class="classTitle">File Index</h1>
+                       
+                       
+                       <div>
+                               <h2><a href="symbols/src/dygraph.js.html">dygraph.js</a></h2>
+                               
+Creates an interactive, zoomable graph based on a CSV file or
+string. Dygraph can handle multiple series with or without error bars. The
+date/value ranges will be automatically set. Dygraph uses the
+&lt;canvas&gt; tag, so it only works in FF1.5+.
+                               <dl>
+                                       
+                                               <dt class="heading">Author:</dt>
+                                               <dd>danvdk@gmail.com (Dan Vanderkam)
+
+  Usage:
+   <div id="graphdiv" style="width:800px; height:500px;"></div>
+   <script type="text/javascript">
+     new Dygraph(document.getElementById("graphdiv"),
+                 "datafile.csv",  // CSV file with headers
+                 { }); // options
+   </script>
+
+ The CSV file is of the form
+
+   Date,SeriesA,SeriesB,SeriesC
+   YYYYMMDD,A1,B1,C1
+   YYYYMMDD,A2,B2,C2
+
+ If the 'errorBars' option is set in the constructor, the input should be of
+ the form
+   Date,SeriesA,SeriesB,...
+   YYYYMMDD,A1,sigmaA1,B1,sigmaB1,...
+   YYYYMMDD,A2,sigmaA2,B2,sigmaB2,...
+
+ If the 'fractions' option is set, the input should be of the form:
+
+   Date,SeriesA,SeriesB,...
+   YYYYMMDD,A1/B1,A2/B2,...
+   YYYYMMDD,A1/B1,A2/B2,...
+
+ And error bars will be calculated automatically using a binomial distribution.
+
+ For further documentation and examples, see http://dygraphs.com/</dd>
+                                       
+                                       
+                                       
+                                       
+                               </dl>
+                       </div>
+                       <hr />
+                       
+                       
+               </div>
+               <div class="fineprint" style="clear:both">
+                       
+                       Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Mon May 09 2011 07:12:49 GMT-0700 (PDT)
+               </div>
+       </body>
+</html>
\ No newline at end of file
diff --git a/jsdoc-toolkit/out/jsdoc/index.html b/jsdoc-toolkit/out/jsdoc/index.html
new file mode 100644 (file)
index 0000000..c32dce5
--- /dev/null
@@ -0,0 +1,218 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+               
+               <title>JsDoc Reference - Index</title>
+               <meta name="generator" content="JsDoc Toolkit" />
+               
+               <style type="text/css">
+               /* default.css */
+body
+{
+       font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+       width: 800px;
+}
+
+.header
+{
+       clear: both;
+       background-color: #ccc;
+       padding: 8px;
+}
+
+h1
+{
+       font-size: 150%;
+       font-weight: bold;
+       padding: 0;
+       margin: 1em 0 0 .3em;
+}
+
+hr
+{
+       border: none 0;
+       border-top: 1px solid #7F8FB1;
+       height: 1px;
+}
+
+pre.code
+{
+       display: block;
+       padding: 8px;
+       border: 1px dashed #ccc;
+}
+
+#index
+{
+       margin-top: 24px;
+       float: left;
+       width: 160px;
+       position: absolute;
+       left: 8px;
+       background-color: #F3F3F3;
+       padding: 8px;
+}
+
+#content
+{
+       margin-left: 190px;
+       width: 600px;
+}
+
+.classList
+{
+       list-style-type: none;
+       padding: 0;
+       margin: 0 0 0 8px;
+       font-family: arial, sans-serif;
+       font-size: 1em;
+       overflow: auto;
+}
+
+.classList li
+{
+       padding: 0;
+       margin: 0 0 8px 0;
+}
+
+.summaryTable { width: 100%; }
+
+h1.classTitle
+{
+       font-size:170%;
+       line-height:130%;
+}
+
+h2 { font-size: 110%; }
+caption, div.sectionTitle
+{
+       background-color: #7F8FB1;
+       color: #fff;
+       font-size:130%;
+       text-align: left;
+       padding: 2px 6px 2px 6px;
+       border: 1px #7F8FB1 solid;
+}
+
+div.sectionTitle { margin-bottom: 8px; }
+.summaryTable thead { display: none; }
+
+.summaryTable td
+{
+       vertical-align: top;
+       padding: 4px;
+       border-bottom: 1px #7F8FB1 solid;
+       border-right: 1px #7F8FB1 solid;
+}
+
+/*col#summaryAttributes {}*/
+.summaryTable td.attributes
+{
+       border-left: 1px #7F8FB1 solid;
+       width: 140px;
+       text-align: right;
+}
+
+td.attributes, .fixedFont
+{
+       line-height: 15px;
+       color: #002EBE;
+       font-family: "Courier New",Courier,monospace;
+       font-size: 13px;
+}
+
+.summaryTable td.nameDescription
+{
+       text-align: left;
+       font-size: 13px;
+       line-height: 15px;
+}
+
+.summaryTable td.nameDescription, .description
+{
+       line-height: 15px;
+       padding: 4px;
+       padding-left: 4px;
+}
+
+.summaryTable { margin-bottom: 8px; }
+
+ul.inheritsList
+{
+       list-style: square;
+       margin-left: 20px;
+       padding-left: 0;
+}
+
+.detailList {
+       margin-left: 20px; 
+       line-height: 15px;
+}
+.detailList dt { margin-left: 20px; }
+
+.detailList .heading
+{
+       font-weight: bold;
+       padding-bottom: 6px;
+       margin-left: 0;
+}
+
+.light, td.attributes, .light a:link, .light a:visited
+{
+       color: #777;
+       font-style: italic;
+}
+
+.fineprint
+{
+       text-align: right;
+       font-size: 10px;
+}
+               </style>
+       </head>
+       
+       <body>
+               <div id="header">
+</div>
+               
+               <div id="index">
+                       <div align="center"><a href="index.html">Class Index</a>
+| <a href="files.html">File Index</a></div>
+<hr />
+<h2>Classes</h2>
+<ul class="classList">
+       
+       <li><i><a href="symbols/_global_.html">_global_</a></i></li>
+       
+       <li><a href="symbols/Dygraph.html">Dygraph</a></li>
+       
+</ul>
+<hr />
+               </div>
+               
+               <div id="content">
+                       <h1 class="classTitle">Class Index</h1>
+                       
+                       
+                       <div>
+                               <h2><a href="symbols/_global_.html">_global_</a></h2>
+                               
+                       </div>
+                       <hr />
+                       
+                       <div>
+                               <h2><a href="symbols/Dygraph.html">Dygraph</a></h2>
+                               
+                       </div>
+                       <hr />
+                       
+                       
+               </div>
+               <div class="fineprint" style="clear:both">
+                       
+                       Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> 2.4.0 on Mon May 09 2011 07:12:49 GMT-0700 (PDT)
+               </div>
+       </body>
+</html>
\ No newline at end of file
diff --git a/jsdoc-toolkit/out/jsdoc/symbols/Dygraph.html b/jsdoc-toolkit/out/jsdoc/symbols/Dygraph.html
new file mode 100644 (file)
index 0000000..bf40cde
--- /dev/null
@@ -0,0 +1,2586 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+               <meta name="generator" content="JsDoc Toolkit" />
+               
+               <title>JsDoc Reference - Dygraph</title>
+
+               <style type="text/css">
+                       /* default.css */
+body
+{
+       font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+       width: 800px;
+}
+
+.header
+{
+       clear: both;
+       background-color: #ccc;
+       padding: 8px;
+}
+
+h1
+{
+       font-size: 150%;
+       font-weight: bold;
+       padding: 0;
+       margin: 1em 0 0 .3em;
+}
+
+hr
+{
+       border: none 0;
+       border-top: 1px solid #7F8FB1;
+       height: 1px;
+}
+
+pre.code
+{
+       display: block;
+       padding: 8px;
+       border: 1px dashed #ccc;
+}
+
+#index
+{
+       margin-top: 24px;
+       float: left;
+       width: 160px;
+       position: absolute;
+       left: 8px;
+       background-color: #F3F3F3;
+       padding: 8px;
+}
+
+#content
+{
+       margin-left: 190px;
+       width: 600px;
+}
+
+.classList
+{
+       list-style-type: none;
+       padding: 0;
+       margin: 0 0 0 8px;
+       font-family: arial, sans-serif;
+       font-size: 1em;
+       overflow: auto;
+}
+
+.classList li
+{
+       padding: 0;
+       margin: 0 0 8px 0;
+}
+
+.summaryTable { width: 100%; }
+
+h1.classTitle
+{
+       font-size:170%;
+       line-height:130%;
+}
+
+h2 { font-size: 110%; }
+caption, div.sectionTitle
+{
+       background-color: #7F8FB1;
+       color: #fff;
+       font-size:130%;
+       text-align: left;
+       padding: 2px 6px 2px 6px;
+       border: 1px #7F8FB1 solid;
+}
+
+div.sectionTitle { margin-bottom: 8px; }
+.summaryTable thead { display: none; }
+
+.summaryTable td
+{
+       vertical-align: top;
+       padding: 4px;
+       border-bottom: 1px #7F8FB1 solid;
+       border-right: 1px #7F8FB1 solid;
+}
+
+/*col#summaryAttributes {}*/
+.summaryTable td.attributes
+{
+       border-left: 1px #7F8FB1 solid;
+       width: 140px;
+       text-align: right;
+}
+
+td.attributes, .fixedFont
+{
+       line-height: 15px;
+       color: #002EBE;
+       font-family: "Courier New",Courier,monospace;
+       font-size: 13px;
+}
+
+.summaryTable td.nameDescription
+{
+       text-align: left;
+       font-size: 13px;
+       line-height: 15px;
+}
+
+.summaryTable td.nameDescription, .description
+{
+       line-height: 15px;
+       padding: 4px;
+       padding-left: 4px;
+}
+
+.summaryTable { margin-bottom: 8px; }
+
+ul.inheritsList
+{
+       list-style: square;
+       margin-left: 20px;
+       padding-left: 0;
+}
+
+.detailList {
+       margin-left: 20px; 
+       line-height: 15px;
+}
+.detailList dt { margin-left: 20px; }
+
+.detailList .heading
+{
+       font-weight: bold;
+       padding-bottom: 6px;
+       margin-left: 0;
+}
+
+.light, td.attributes, .light a:link, .light a:visited
+{
+       color: #777;
+       font-style: italic;
+}
+
+.fineprint
+{
+       text-align: right;
+       font-size: 10px;
+}
+               </style>
+       </head>
+
+       <body>
+<!-- ============================== header ================================= -->       
+               <!-- begin static/header.html -->
+               <div id="header">
+</div>
+               <!-- end static/header.html -->
+
+<!-- ============================== classes index ============================ -->
+               <div id="index">
+                       <!-- begin publish.classesIndex -->
+                       <div align="center"><a href="../index.html">Class Index</a>
+| <a href="../files.html">File Index</a></div>
+<hr />
+<h2>Classes</h2>
+<ul class="classList">
+       
+       <li><i><a href="../symbols/_global_.html">_global_</a></i></li>
+       
+       <li><a href="../symbols/Dygraph.html">Dygraph</a></li>
+       
+</ul>
+<hr />
+                       <!-- end publish.classesIndex -->
+               </div>
+               
+               <div id="content">
+<!-- ============================== class title ============================ -->
+                       <h1 class="classTitle">
+                               
+                               Class Dygraph
+                       </h1>
+
+<!-- ============================== class summary ========================== -->                       
+                       <p class="description">
+                               
+                               
+                       
+                               
+                               
+                               
+                                       <br /><i>Defined in: </i> <a href="../symbols/src/dygraph.js.html">dygraph.js</a>.
+                               
+                       </p>
+
+<!-- ============================== constructor summary ==================== -->                       
+                       
+                       <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class Dygraph.">
+                               <caption>Class Summary</caption>
+                               <thead>
+                                       <tr>
+                                               <th scope="col">Constructor Attributes</th>
+                                               <th scope="col">Constructor Name and Description</th>
+                                       </tr>
+                               </thead>
+                               <tbody>
+                                       <tr>
+                                               <td class="attributes">&nbsp;</td>
+                                               <td class="nameDescription" >
+                                                       <div class="fixedFont">
+                                                               <b><a href="../symbols/Dygraph.html#constructor">Dygraph</a></b>(div, file, attrs)
+                                                       </div>
+                                                       <div class="description">Creates an interactive, zoomable chart.</div>
+                                               </td>
+                                       </tr>
+                               </tbody>
+                       </table>
+                       
+
+<!-- ============================== properties summary ===================== -->
+                       
+                               
+                               
+                               <table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class Dygraph.">
+                                       <caption>Field Summary</caption>
+                                       <thead>
+                                               <tr>
+                                                       <th scope="col">Field Attributes</th>
+                                                       <th scope="col">Field Name and Description</th>
+                                               </tr>
+                                       </thead>
+                                       <tbody>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&lt;static&gt; &nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">
+                                                               Dygraph.<b><a href="../symbols/Dygraph.html#.defaultInteractionModel">defaultInteractionModel</a></b>
+                                                               </div>
+                                                               <div class="description">Default interation model for dygraphs.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                       </tbody>
+                               </table>
+                               
+                               
+                               
+                       
+
+<!-- ============================== methods summary ======================== -->
+                       
+                               
+                               
+                               <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class Dygraph.">
+                                       <caption>Method Summary</caption>
+                                       <thead>
+                                               <tr>
+                                                       <th scope="col">Method Attributes</th>
+                                                       <th scope="col">Method Name and Description</th>
+                                               </tr>
+                                       </thead>
+                                       <tbody>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#adjustRoll">adjustRoll</a></b>(length)
+                                                               </div>
+                                                               <div class="description">Adjusts the number of points in the rolling average.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#annotations">annotations</a></b>()
+                                                               </div>
+                                                               <div class="description">Return the list of annotations.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#clearSelection">clearSelection</a></b>()
+                                                               </div>
+                                                               <div class="description">Clears the current selection (i.e.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&lt;static&gt; &nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.dateTicker">dateTicker</a></b>(startDate, endDate, self)
+                                                               </div>
+                                                               <div class="description">Add ticks to the x-axis based on a date range.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#destroy">destroy</a></b>()
+                                                               </div>
+                                                               <div class="description">Detach DOM elements in the dygraph and null out all data references.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&lt;static&gt; &nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.endPan">endPan</a></b>(event, g, context)
+                                                               </div>
+                                                               <div class="description">Called in response to an interaction model operation that
+responds to an event that ends panning.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&lt;static&gt; &nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.endZoom">endZoom</a></b>(event, g, context)
+                                                               </div>
+                                                               <div class="description">Called in response to an interaction model operation that
+responds to an event that performs a zoom based on previously defined
+bounds.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&lt;static&gt; &nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.floatFormat">floatFormat</a></b>(x, opt_precision)
+                                                               </div>
+                                                               <div class="description">Number formatting function which mimicks the behavior of %g in printf, i.e.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#getColors">getColors</a></b>()
+                                                               </div>
+                                                               <div class="description">Return the list of colors.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#getSelection">getSelection</a></b>()
+                                                               </div>
+                                                               <div class="description">Returns the number of the currently selected row.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#getValue">getValue</a></b>(row, col)
+                                                               </div>
+                                                               <div class="description">Returns the value in the given row and column.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&lt;static&gt; &nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.GVizChart">GVizChart</a></b>(container)
+                                                               </div>
+                                                               <div class="description">A wrapper around Dygraph that implements the gviz API.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#indexFromSetName">indexFromSetName</a></b>(name)
+                                                               </div>
+                                                               <div class="description">Get the index of a series (column) given its name.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#isZoomed">isZoomed</a></b>(axis)
+                                                               </div>
+                                                               <div class="description">Returns the zoomed status of the chart for one or both axes.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&lt;static&gt; &nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.movePan">movePan</a></b>(event, g, context)
+                                                               </div>
+                                                               <div class="description">Called in response to an interaction model operation that
+responds to an event that pans the view.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&lt;static&gt; &nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.moveZoom">moveZoom</a></b>(event, g, context)
+                                                               </div>
+                                                               <div class="description">Called in response to an interaction model operation that
+responds to an event that defines zoom boundaries.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#numAxes">numAxes</a></b>()
+                                                               </div>
+                                                               <div class="description">Returns the number of y-axes on the chart.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#numColumns">numColumns</a></b>()
+                                                               </div>
+                                                               <div class="description">Returns the number of columns (including the independent variable).</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&lt;static&gt; &nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.numericTicks">numericTicks</a></b>(minV, maxV, self, attribute, vals)
+                                                               </div>
+                                                               <div class="description">Add ticks when the x axis has numbers on it (instead of dates)</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#numRows">numRows</a></b>()
+                                                               </div>
+                                                               <div class="description">Returns the number of rows (excluding any header/label row).</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#resize">resize</a></b>(width, height)
+                                                               </div>
+                                                               <div class="description">Resizes the dygraph.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#rollPeriod">rollPeriod</a></b>()
+                                                               </div>
+                                                               <div class="description">Returns the current rolling period, as set by the user or an option.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#setAnnotations">setAnnotations</a></b>(ann, suppressDraw)
+                                                               </div>
+                                                               <div class="description">Update the list of annotations and redraw the chart.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#setSelection">setSelection</a></b>(row)
+                                                               </div>
+                                                               <div class="description">Manually set the selected points and display information about them in the
+legend.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#setVisibility">setVisibility</a></b>(num, value)
+                                                               </div>
+                                                               <div class="description">Changes the visiblity of a series.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&lt;static&gt; &nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.startPan">startPan</a></b>(event, g, context)
+                                                               </div>
+                                                               <div class="description">Called in response to an interaction model operation that
+should start the default panning behavior.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&lt;static&gt; &nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.startZoom">startZoom</a></b>(event, g, context)
+                                                               </div>
+                                                               <div class="description">Called in response to an interaction model operation that
+responds to an event that starts zooming.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toDataCoords">toDataCoords</a></b>(x, y, axis)
+                                                               </div>
+                                                               <div class="description">Convert from canvas/div coords to data coordinates.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toDataXCoord">toDataXCoord</a></b>(x)
+                                                               </div>
+                                                               <div class="description">Convert from canvas/div x coordinate to data coordinate.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toDataYCoord">toDataYCoord</a></b>(y, axis)
+                                                               </div>
+                                                               <div class="description">Convert from canvas/div y coord to value.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toDomCoords">toDomCoords</a></b>(x, y, axis)
+                                                               </div>
+                                                               <div class="description">Convert from data coordinates to canvas/div X/Y coordinates.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toDomXCoord">toDomXCoord</a></b>(x)
+                                                               </div>
+                                                               <div class="description">Convert from data x coordinates to canvas/div X coordinate.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toDomYCoord">toDomYCoord</a></b>(y, axis)
+                                                               </div>
+                                                               <div class="description">Convert from data x coordinates to canvas/div Y coordinate and optional
+axis.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toPercentXCoord">toPercentXCoord</a></b>(x)
+                                                               </div>
+                                                               <div class="description">Converts an x value to a percentage from the left to the right of
+the drawing area.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toPercentYCoord">toPercentYCoord</a></b>(y, axis)
+                                                               </div>
+                                                               <div class="description">Converts a y for an axis to a percentage from the top to the
+bottom of the drawing area.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#toString">toString</a></b>()
+                                                               </div>
+                                                               <div class="description">Returns information about the Dygraph object, including its containing ID.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&lt;static&gt; &nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">Dygraph.<b><a href="../symbols/Dygraph.html#.toString">toString</a></b>()
+                                                               </div>
+                                                               <div class="description">Returns information about the Dygraph class.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#updateOptions">updateOptions</a></b>(attrs)
+                                                               </div>
+                                                               <div class="description">Changes various properties of the graph.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#visibility">visibility</a></b>()
+                                                               </div>
+                                                               <div class="description">Returns a boolean array of visibility statuses.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#xAxisExtremes">xAxisExtremes</a></b>()
+                                                               </div>
+                                                               <div class="description">Returns the lower- and upper-bound x-axis values of the
+data set.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#xAxisRange">xAxisRange</a></b>()
+                                                               </div>
+                                                               <div class="description">Returns the currently-visible x-range.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#yAxisRange">yAxisRange</a></b>(idx)
+                                                               </div>
+                                                               <div class="description">Returns the currently-visible y-range for an axis.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                               <tr>
+                                                       <td class="attributes">&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><b><a href="../symbols/Dygraph.html#yAxisRanges">yAxisRanges</a></b>()
+                                                               </div>
+                                                               <div class="description">Returns the currently-visible y-ranges for each axis.</div>
+                                                       </td>
+                                               </tr>
+                                       
+                                       </tbody>
+                               </table>
+                               
+                               
+                               
+                       
+<!-- ============================== events summary ======================== -->
+                       
+
+<!-- ============================== constructor details ==================== -->               
+                       
+                       <div class="details"><a name="constructor"> </a>
+                               <div class="sectionTitle">
+                                       Class Detail
+                               </div>
+                               
+                               <div class="fixedFont">
+                                               <b>Dygraph</b>(div, file, attrs)
+                               </div>
+                               
+                               <div class="description">
+                                       Creates an interactive, zoomable chart.
+                                       
+                               </div>
+                               
+                               
+                               
+                               
+                                       
+                                               <dl class="detailList">
+                                               <dt class="heading">Parameters:</dt>
+                                               
+                                                       <dt>
+                                                               <span class="light fixedFont">{div | String}</span>  <b>div</b>
+                                                               
+                                                       </dt>
+                                                               <dd>A div or the id of a div into which to construct
+the chart.</dd>
+                                               
+                                                       <dt>
+                                                               <span class="light fixedFont">{String | Function}</span>  <b>file</b>
+                                                               
+                                                       </dt>
+                                                               <dd>A file containing CSV data or a function
+that returns this data. The most basic expected format for each line is
+"YYYY/MM/DD,val1,val2,...". For more information, see
+http://dygraphs.com/data.html.</dd>
+                                               
+                                                       <dt>
+                                                               <span class="light fixedFont">{Object}</span>  <b>attrs</b>
+                                                               
+                                                       </dt>
+                                                               <dd>Various other attributes, e.g. errorBars determines
+whether the input data contains error ranges. For a complete list of
+options, see http://dygraphs.com/options.html.</dd>
+                                               
+                                               </dl>
+                                       
+                                       
+                                       
+                                       
+                                       
+                                       
+                                       
+
+                       </div>
+                       
+
+<!-- ============================== field details ========================== -->               
+                       
+                               <div class="sectionTitle">
+                                       Field Detail
+                               </div>
+                               
+                                       <a name=".defaultInteractionModel"> </a>
+                                       <div class="fixedFont">&lt;static&gt; 
+                                       
+                                       
+                                       <span class="light">Dygraph.</span><b>defaultInteractionModel</b>
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Default interation model for dygraphs. You can refer to specific elements of
+this when constructing your own interaction model, e.g.:
+g.updateOptions( {
+  interactionModel: {
+    mousedown: Dygraph.defaultInteractionModel.mousedown
+  }
+} );
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+
+                                               
+                                               
+                                               
+                                               
+
+                                       
+                               
+                       
+
+<!-- ============================== method details ========================= -->               
+                       
+                               <div class="sectionTitle">
+                                       Method Detail
+                               </div>
+                               
+                                       <a name="adjustRoll"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>adjustRoll</b>(length)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Adjusts the number of points in the rolling average. Updates the graph to
+reflect the new averaging period.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>length</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>Number of points over which to average the data.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="annotations"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>annotations</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Return the list of annotations.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="clearSelection"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>clearSelection</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Clears the current selection (i.e. points that were highlighted by moving
+the mouse over the chart).
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name=".dateTicker"> </a>
+                                       <div class="fixedFont">&lt;static&gt; 
+                                       
+                                       <span class="light">{[Object]}</span>
+                                       <span class="light">Dygraph.</span><b>dateTicker</b>(startDate, endDate, self)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Add ticks to the x-axis based on a date range.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>startDate</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>Start of the date window (millis since epoch)</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>endDate</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>End of the date window (millis since epoch)</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>self</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dygraph object</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       
+                                                               <dd><span class="light fixedFont">{[Object]}</span> Array of {label, value} tuples.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="destroy"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>destroy</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Detach DOM elements in the dygraph and null out all data references.
+Calling this when you're done with a dygraph can dramatically reduce memory
+usage. See, e.g., the tests/perf.html example.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name=".endPan"> </a>
+                                       <div class="fixedFont">&lt;static&gt; 
+                                       
+                                       
+                                       <span class="light">Dygraph.</span><b>endPan</b>(event, g, context)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Called in response to an interaction model operation that
+responds to an event that ends panning.
+
+It's used in the default callback for "mouseup" operations.
+Custom interaction model builders can use it to provide the default
+panning behavior.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Event}</span> <b>event</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>the event object which led to the startZoom call.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>g</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dygraph on which to act.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Object}</span> <b>context</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dragging context object (with
+dragStartX/dragStartY/etc. properties). This function modifies the context.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name=".endZoom"> </a>
+                                       <div class="fixedFont">&lt;static&gt; 
+                                       
+                                       
+                                       <span class="light">Dygraph.</span><b>endZoom</b>(event, g, context)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Called in response to an interaction model operation that
+responds to an event that performs a zoom based on previously defined
+bounds..
+
+It's used in the default callback for "mouseup" operations.
+Custom interaction model builders can use it to provide the default
+zooming behavior.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Event}</span> <b>event</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>the event object which led to the endZoom call.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>g</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dygraph on which to end the zoom.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Object}</span> <b>context</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dragging context object (with
+dragStartX/dragStartY/etc. properties). This function modifies the context.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name=".floatFormat"> </a>
+                                       <div class="fixedFont">&lt;static&gt; 
+                                       
+                                       <span class="light">{String}</span>
+                                       <span class="light">Dygraph.</span><b>floatFormat</b>(x, opt_precision)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Number formatting function which mimicks the behavior of %g in printf, i.e.
+either exponential or fixed format (without trailing 0s) is used depending on
+the length of the generated string.  The advantage of this format is that
+there is a predictable upper bound on the resulting string length,
+significant figures are not dropped, and normal numbers are not displayed in
+exponential notation.
+
+NOTE: JavaScript's native toPrecision() is NOT a drop-in replacement for %g.
+It creates strings which are too long for absolute values between 10^-4 and
+10^-6, e.g. '0.00001' instead of '1e-5'. See tests/number-format.html for
+output examples.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>x</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The number to format</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>opt_precision</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The precision to use, default 2.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       
+                                                               <dd><span class="light fixedFont">{String}</span> A string formatted like %g in printf.  The max generated
+                 string length should be precision + 6 (e.g 1.123e+300).</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="getColors"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       <span class="light">{Array<string>}</span>
+                                       <b>getColors</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Return the list of colors. This is either the list of colors passed in the
+attributes or the autogenerated list of rgb(r,g,b) strings.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       
+                                                               <dd><span class="light fixedFont">{Array<string>}</span> The list of colors.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="getSelection"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       <span class="light">{Integer}</span>
+                                       <b>getSelection</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns the number of the currently selected row. To get data for this row,
+you can use the getValue method.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       
+                                                               <dd><span class="light fixedFont">{Integer}</span> row number, or -1 if nothing is selected</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="getValue"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       <span class="light">{Number}</span>
+                                       <b>getValue</b>(row, col)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns the value in the given row and column. If the row and column exceed
+the bounds on the data, returns null. Also returns null if the value is
+missing.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>row</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The row number of the data (0-based). Row 0 is the
+first row of data, not a header row.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>col</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The column number of the data (0-based)</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       
+                                                               <dd><span class="light fixedFont">{Number}</span> The value in the specified cell or null if the row/col
+were out of range.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name=".GVizChart"> </a>
+                                       <div class="fixedFont">&lt;static&gt; 
+                                       
+                                       
+                                       <span class="light">Dygraph.</span><b>GVizChart</b>(container)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               A wrapper around Dygraph that implements the gviz API.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Object}</span> <b>container</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The DOM object the visualization should live in.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="indexFromSetName"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>indexFromSetName</b>(name)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Get the index of a series (column) given its name. The first column is the
+x-axis, so the data series start with index 1.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <b>name</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="isZoomed"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>isZoomed</b>(axis)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns the zoomed status of the chart for one or both axes.
+
+Axis is an optional parameter. Can be set to 'x' or 'y'.
+
+The zoomed status for an axis is set whenever a user zooms using the mouse
+or when the dateWindow or valueRange are updated (unless the isZoomedIgnoreProgrammaticZoom
+option is also specified).
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <b>axis</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name=".movePan"> </a>
+                                       <div class="fixedFont">&lt;static&gt; 
+                                       
+                                       
+                                       <span class="light">Dygraph.</span><b>movePan</b>(event, g, context)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Called in response to an interaction model operation that
+responds to an event that pans the view.
+
+It's used in the default callback for "mousemove" operations.
+Custom interaction model builders can use it to provide the default
+panning behavior.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Event}</span> <b>event</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>the event object which led to the movePan call.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>g</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dygraph on which to act.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Object}</span> <b>context</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dragging context object (with
+dragStartX/dragStartY/etc. properties). This function modifies the context.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name=".moveZoom"> </a>
+                                       <div class="fixedFont">&lt;static&gt; 
+                                       
+                                       
+                                       <span class="light">Dygraph.</span><b>moveZoom</b>(event, g, context)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Called in response to an interaction model operation that
+responds to an event that defines zoom boundaries.
+
+It's used in the default callback for "mousemove" operations.
+Custom interaction model builders can use it to provide the default
+zooming behavior.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Event}</span> <b>event</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>the event object which led to the moveZoom call.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>g</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dygraph on which to act.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Object}</span> <b>context</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dragging context object (with
+dragStartX/dragStartY/etc. properties). This function modifies the context.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="numAxes"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       <span class="light">{Number}</span>
+                                       <b>numAxes</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns the number of y-axes on the chart.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       
+                                                               <dd><span class="light fixedFont">{Number}</span> the number of axes.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="numColumns"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       <span class="light">{Integer}</span>
+                                       <b>numColumns</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns the number of columns (including the independent variable).
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       
+                                                               <dd><span class="light fixedFont">{Integer}</span> The number of columns.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name=".numericTicks"> </a>
+                                       <div class="fixedFont">&lt;static&gt; 
+                                       
+                                       <span class="light">{[Object]}</span>
+                                       <span class="light">Dygraph.</span><b>numericTicks</b>(minV, maxV, self, attribute, vals)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Add ticks when the x axis has numbers on it (instead of dates)
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>minV</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>minimum value</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>maxV</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>maximum value</dd>
+                                                       
+                                                               <dt>
+                                                                       <b>self</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{function}</span> <b>attribute</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>accessor function.</dd>
+                                                       
+                                                               <dt>
+                                                                       <b>vals</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       
+                                                               <dd><span class="light fixedFont">{[Object]}</span> Array of {label, value} tuples.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="numRows"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       <span class="light">{Integer}</span>
+                                       <b>numRows</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns the number of rows (excluding any header/label row).
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       
+                                                               <dd><span class="light fixedFont">{Integer}</span> The number of rows, less any header.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="resize"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>resize</b>(width, height)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Resizes the dygraph. If no parameters are specified, resizes to fill the
+containing div (which has presumably changed size since the dygraph was
+instantiated. If the width/height are specified, the div will be resized.
+
+This is far more efficient than destroying and re-instantiating a
+Dygraph, since it doesn't have to reparse the underlying data.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>width</b>
+                                                                       <i>Optional</i>
+                                                               </dt>
+                                                               <dd>Width (in pixels)</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>height</b>
+                                                                       <i>Optional</i>
+                                                               </dt>
+                                                               <dd>Height (in pixels)</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="rollPeriod"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       <span class="light">{Number}</span>
+                                       <b>rollPeriod</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns the current rolling period, as set by the user or an option.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       
+                                                               <dd><span class="light fixedFont">{Number}</span> The number of points in the rolling window</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="setAnnotations"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>setAnnotations</b>(ann, suppressDraw)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Update the list of annotations and redraw the chart.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <b>ann</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                               <dt>
+                                                                       <b>suppressDraw</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="setSelection"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>setSelection</b>(row)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Manually set the selected points and display information about them in the
+legend. The selection can be cleared using clearSelection() and queried
+using getSelection().
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Integer}</span> <b>row</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>number that should be highlighted (i.e. appear with
+hover dots on the chart). Set to false to clear any selection.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="setVisibility"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>setVisibility</b>(num, value)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Changes the visiblity of a series.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <b>num</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                               <dt>
+                                                                       <b>value</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name=".startPan"> </a>
+                                       <div class="fixedFont">&lt;static&gt; 
+                                       
+                                       
+                                       <span class="light">Dygraph.</span><b>startPan</b>(event, g, context)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Called in response to an interaction model operation that
+should start the default panning behavior.
+
+It's used in the default callback for "mousedown" operations.
+Custom interaction model builders can use it to provide the default
+panning behavior.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Event}</span> <b>event</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>the event object which led to the startPan call.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>g</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dygraph on which to act.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Object}</span> <b>context</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dragging context object (with
+dragStartX/dragStartY/etc. properties). This function modifies the context.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name=".startZoom"> </a>
+                                       <div class="fixedFont">&lt;static&gt; 
+                                       
+                                       
+                                       <span class="light">Dygraph.</span><b>startZoom</b>(event, g, context)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Called in response to an interaction model operation that
+responds to an event that starts zooming.
+
+It's used in the default callback for "mousedown" operations.
+Custom interaction model builders can use it to provide the default
+zooming behavior.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Event}</span> <b>event</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>the event object which led to the startZoom call.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{<a href="../symbols/Dygraph.html">Dygraph</a>}</span> <b>g</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dygraph on which to act.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Object}</span> <b>context</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The dragging context object (with
+dragStartX/dragStartY/etc. properties). This function modifies the context.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="toDataCoords"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>toDataCoords</b>(x, y, axis)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Convert from canvas/div coords to data coordinates.
+If specified, do this conversion for the coordinate system of a particular
+axis. Uses the first axis by default.
+Returns a two-element array: [X, Y].
+
+Note: use toDataXCoord instead of toDataCoords(x, null) and use toDataYCoord
+instead of toDataCoords(null, y, axis).
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <b>x</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                               <dt>
+                                                                       <b>y</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                               <dt>
+                                                                       <b>axis</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="toDataXCoord"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>toDataXCoord</b>(x)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Convert from canvas/div x coordinate to data coordinate.
+
+If x is null, this returns null.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <b>x</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="toDataYCoord"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>toDataYCoord</b>(y, axis)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Convert from canvas/div y coord to value.
+
+If y is null, this returns null.
+if axis is null, this uses the first axis.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <b>y</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                               <dt>
+                                                                       <b>axis</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="toDomCoords"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>toDomCoords</b>(x, y, axis)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Convert from data coordinates to canvas/div X/Y coordinates.
+If specified, do this conversion for the coordinate system of a particular
+axis. Uses the first axis by default.
+Returns a two-element array: [X, Y]
+
+Note: use toDomXCoord instead of toDomCoords(x, null) and use toDomYCoord
+instead of toDomCoords(null, y, axis).
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <b>x</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                               <dt>
+                                                                       <b>y</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                               <dt>
+                                                                       <b>axis</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="toDomXCoord"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>toDomXCoord</b>(x)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Convert from data x coordinates to canvas/div X coordinate.
+If specified, do this conversion for the coordinate system of a particular
+axis.
+Returns a single value or null if x is null.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <b>x</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="toDomYCoord"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>toDomYCoord</b>(y, axis)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Convert from data x coordinates to canvas/div Y coordinate and optional
+axis. Uses the first axis by default.
+
+returns a single value or null if y is null.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <b>y</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                               <dt>
+                                                                       <b>axis</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="toPercentXCoord"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       <span class="light">{Number}</span>
+                                       <b>toPercentXCoord</b>(x)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Converts an x value to a percentage from the left to the right of
+the drawing area.
+
+If the coordinate represents a value visible on the canvas, then
+the value will be between 0 and 1, where 0 is the left of the canvas.
+However, this method will return values outside the range, as
+values can fall outside the canvas.
+
+If x is null, this returns null.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>x</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The data x-coordinate.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       
+                                                               <dd><span class="light fixedFont">{Number}</span> A fraction in [0, 1] where 0 = the left edge.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="toPercentYCoord"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       <span class="light">{Number}</span>
+                                       <b>toPercentYCoord</b>(y, axis)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Converts a y for an axis to a percentage from the top to the
+bottom of the drawing area.
+
+If the coordinate represents a value visible on the canvas, then
+the value will be between 0 and 1, where 0 is the top of the canvas.
+However, this method will return values outside the range, as
+values can fall outside the canvas.
+
+If y is null, this returns null.
+if axis is null, this uses the first axis.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>y</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The data y-coordinate.</dd>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Number}</span> <b>axis</b>
+                                                                       <i>Optional</i>
+                                                               </dt>
+                                                               <dd>The axis number on which the data coordinate lives.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       
+                                                               <dd><span class="light fixedFont">{Number}</span> A fraction in [0, 1] where 0 = the top edge.</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="toString"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>toString</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns information about the Dygraph object, including its containing ID.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name=".toString"> </a>
+                                       <div class="fixedFont">&lt;static&gt; 
+                                       
+                                       
+                                       <span class="light">Dygraph.</span><b>toString</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns information about the Dygraph class.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="updateOptions"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>updateOptions</b>(attrs)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Changes various properties of the graph. These can include:
+<ul>
+<li>file: changes the source data for the graph</li>
+<li>errorBars: changes whether the data contains stddev</li>
+</ul>
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <span class="light fixedFont">{Object}</span> <b>attrs</b>
+                                                                       
+                                                               </dt>
+                                                               <dd>The new properties and values</dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="visibility"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>visibility</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns a boolean array of visibility statuses.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="xAxisExtremes"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>xAxisExtremes</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns the lower- and upper-bound x-axis values of the
+data set.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="xAxisRange"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>xAxisRange</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns the currently-visible x-range. This can be affected by zooming,
+panning or a call to updateOptions.
+Returns a two-element array: [left, right].
+If the Dygraph has dates on the x-axis, these will be millis since epoch.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="yAxisRange"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>yAxisRange</b>(idx)
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns the currently-visible y-range for an axis. This can be affected by
+zooming, panning or a call to updateOptions. Axis indices are zero-based. If
+called with no arguments, returns the range of the first axis.
+Returns a two-element array: [bottom, top].
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       
+                                                               <dt>
+                                                                       <b>idx</b>
+                                                                       
+                                                               </dt>
+                                                               <dd></dd>
+                                                       
+                                                       </dl>
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       <hr />
+                               
+                                       <a name="yAxisRanges"> </a>
+                                       <div class="fixedFont">
+                                       
+                                       
+                                       <b>yAxisRanges</b>()
+                                       
+                                       </div>
+                                       <div class="description">
+                                               Returns the currently-visible y-ranges for each axis. This can be affected by
+zooming, panning, calls to updateOptions, etc.
+Returns an array of [bottom, top] pairs, one for each y-axis.
+                                               
+                                               
+                                       </div>
+                                       
+                                       
+                                       
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+                                               
+
+                                       
+                               
+                       
+                       
+<!-- ============================== event details ========================= -->                
+                       
+                       
+                       <hr />
+               </div>
+
+               
+<!-- ============================== footer ================================= -->
+               <div class="fineprint" style="clear:both">
+                       
+                       Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Mon May 09 2011 07:12:49 GMT-0700 (PDT)
+               </div>
+       </body>
+</html>
diff --git a/jsdoc-toolkit/out/jsdoc/symbols/_global_.html b/jsdoc-toolkit/out/jsdoc/symbols/_global_.html
new file mode 100644 (file)
index 0000000..a43c452
--- /dev/null
@@ -0,0 +1,251 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+               <meta name="generator" content="JsDoc Toolkit" />
+               
+               <title>JsDoc Reference - _global_</title>
+
+               <style type="text/css">
+                       /* default.css */
+body
+{
+       font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+       width: 800px;
+}
+
+.header
+{
+       clear: both;
+       background-color: #ccc;
+       padding: 8px;
+}
+
+h1
+{
+       font-size: 150%;
+       font-weight: bold;
+       padding: 0;
+       margin: 1em 0 0 .3em;
+}
+
+hr
+{
+       border: none 0;
+       border-top: 1px solid #7F8FB1;
+       height: 1px;
+}
+
+pre.code
+{
+       display: block;
+       padding: 8px;
+       border: 1px dashed #ccc;
+}
+
+#index
+{
+       margin-top: 24px;
+       float: left;
+       width: 160px;
+       position: absolute;
+       left: 8px;
+       background-color: #F3F3F3;
+       padding: 8px;
+}
+
+#content
+{
+       margin-left: 190px;
+       width: 600px;
+}
+
+.classList
+{
+       list-style-type: none;
+       padding: 0;
+       margin: 0 0 0 8px;
+       font-family: arial, sans-serif;
+       font-size: 1em;
+       overflow: auto;
+}
+
+.classList li
+{
+       padding: 0;
+       margin: 0 0 8px 0;
+}
+
+.summaryTable { width: 100%; }
+
+h1.classTitle
+{
+       font-size:170%;
+       line-height:130%;
+}
+
+h2 { font-size: 110%; }
+caption, div.sectionTitle
+{
+       background-color: #7F8FB1;
+       color: #fff;
+       font-size:130%;
+       text-align: left;
+       padding: 2px 6px 2px 6px;
+       border: 1px #7F8FB1 solid;
+}
+
+div.sectionTitle { margin-bottom: 8px; }
+.summaryTable thead { display: none; }
+
+.summaryTable td
+{
+       vertical-align: top;
+       padding: 4px;
+       border-bottom: 1px #7F8FB1 solid;
+       border-right: 1px #7F8FB1 solid;
+}
+
+/*col#summaryAttributes {}*/
+.summaryTable td.attributes
+{
+       border-left: 1px #7F8FB1 solid;
+       width: 140px;
+       text-align: right;
+}
+
+td.attributes, .fixedFont
+{
+       line-height: 15px;
+       color: #002EBE;
+       font-family: "Courier New",Courier,monospace;
+       font-size: 13px;
+}
+
+.summaryTable td.nameDescription
+{
+       text-align: left;
+       font-size: 13px;
+       line-height: 15px;
+}
+
+.summaryTable td.nameDescription, .description
+{
+       line-height: 15px;
+       padding: 4px;
+       padding-left: 4px;
+}
+
+.summaryTable { margin-bottom: 8px; }
+
+ul.inheritsList
+{
+       list-style: square;
+       margin-left: 20px;
+       padding-left: 0;
+}
+
+.detailList {
+       margin-left: 20px; 
+       line-height: 15px;
+}
+.detailList dt { margin-left: 20px; }
+
+.detailList .heading
+{
+       font-weight: bold;
+       padding-bottom: 6px;
+       margin-left: 0;
+}
+
+.light, td.attributes, .light a:link, .light a:visited
+{
+       color: #777;
+       font-style: italic;
+}
+
+.fineprint
+{
+       text-align: right;
+       font-size: 10px;
+}
+               </style>
+       </head>
+
+       <body>
+<!-- ============================== header ================================= -->       
+               <!-- begin static/header.html -->
+               <div id="header">
+</div>
+               <!-- end static/header.html -->
+
+<!-- ============================== classes index ============================ -->
+               <div id="index">
+                       <!-- begin publish.classesIndex -->
+                       <div align="center"><a href="../index.html">Class Index</a>
+| <a href="../files.html">File Index</a></div>
+<hr />
+<h2>Classes</h2>
+<ul class="classList">
+       
+       <li><i><a href="../symbols/_global_.html">_global_</a></i></li>
+       
+       <li><a href="../symbols/Dygraph.html">Dygraph</a></li>
+       
+</ul>
+<hr />
+                       <!-- end publish.classesIndex -->
+               </div>
+               
+               <div id="content">
+<!-- ============================== class title ============================ -->
+                       <h1 class="classTitle">
+                               
+                               Built-In Namespace _global_
+                       </h1>
+
+<!-- ============================== class summary ========================== -->                       
+                       <p class="description">
+                               
+                               
+                       
+                               
+                               
+                               
+                       </p>
+
+<!-- ============================== constructor summary ==================== -->                       
+                       
+
+<!-- ============================== properties summary ===================== -->
+                       
+
+<!-- ============================== methods summary ======================== -->
+                       
+<!-- ============================== events summary ======================== -->
+                       
+
+<!-- ============================== constructor details ==================== -->               
+                       
+
+<!-- ============================== field details ========================== -->               
+                       
+
+<!-- ============================== method details ========================= -->               
+                       
+                       
+<!-- ============================== event details ========================= -->                
+                       
+                       
+                       <hr />
+               </div>
+
+               
+<!-- ============================== footer ================================= -->
+               <div class="fineprint" style="clear:both">
+                       
+                       Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Mon May 09 2011 07:12:49 GMT-0700 (PDT)
+               </div>
+       </body>
+</html>
diff --git a/jsdoc-toolkit/out/jsdoc/symbols/src/dygraph.js.html b/jsdoc-toolkit/out/jsdoc/symbols/src/dygraph.js.html
new file mode 100644 (file)
index 0000000..e8272b5
--- /dev/null
@@ -0,0 +1,4530 @@
+<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
+       .KEYW {color: #933;}
+       .COMM {color: #bbb; font-style: italic;}
+       .NUMB {color: #393;}
+       .STRN {color: #393;}
+       .REGX {color: #339;}
+       .line {border-right: 1px dotted #666; color: #666; font-style: normal;}
+       </style></head><body><pre><span class='line'>  1</span> <span class="COMM">// Copyright 2006 Dan Vanderkam (danvdk@gmail.com)</span><span class="WHIT">
+<span class='line'>  2</span> </span><span class="COMM">// All Rights Reserved.</span><span class="WHIT">
+<span class='line'>  3</span> 
+<span class='line'>  4</span> </span><span class="COMM">/**
+<span class='line'>  5</span>  * @fileoverview Creates an interactive, zoomable graph based on a CSV file or
+<span class='line'>  6</span>  * string. Dygraph can handle multiple series with or without error bars. The
+<span class='line'>  7</span>  * date/value ranges will be automatically set. Dygraph uses the
+<span class='line'>  8</span>  * &lt;canvas&gt; tag, so it only works in FF1.5+.
+<span class='line'>  9</span>  * @author danvdk@gmail.com (Dan Vanderkam)
+<span class='line'> 10</span> 
+<span class='line'> 11</span>   Usage:
+<span class='line'> 12</span>    &lt;div id="graphdiv" style="width:800px; height:500px;">&lt;/div>
+<span class='line'> 13</span>    &lt;script type="text/javascript">
+<span class='line'> 14</span>      new Dygraph(document.getElementById("graphdiv"),
+<span class='line'> 15</span>                  "datafile.csv",  // CSV file with headers
+<span class='line'> 16</span>                  { }); // options
+<span class='line'> 17</span>    &lt;/script>
+<span class='line'> 18</span> 
+<span class='line'> 19</span>  The CSV file is of the form
+<span class='line'> 20</span> 
+<span class='line'> 21</span>    Date,SeriesA,SeriesB,SeriesC
+<span class='line'> 22</span>    YYYYMMDD,A1,B1,C1
+<span class='line'> 23</span>    YYYYMMDD,A2,B2,C2
+<span class='line'> 24</span> 
+<span class='line'> 25</span>  If the 'errorBars' option is set in the constructor, the input should be of
+<span class='line'> 26</span>  the form
+<span class='line'> 27</span>    Date,SeriesA,SeriesB,...
+<span class='line'> 28</span>    YYYYMMDD,A1,sigmaA1,B1,sigmaB1,...
+<span class='line'> 29</span>    YYYYMMDD,A2,sigmaA2,B2,sigmaB2,...
+<span class='line'> 30</span> 
+<span class='line'> 31</span>  If the 'fractions' option is set, the input should be of the form:
+<span class='line'> 32</span> 
+<span class='line'> 33</span>    Date,SeriesA,SeriesB,...
+<span class='line'> 34</span>    YYYYMMDD,A1/B1,A2/B2,...
+<span class='line'> 35</span>    YYYYMMDD,A1/B1,A2/B2,...
+<span class='line'> 36</span> 
+<span class='line'> 37</span>  And error bars will be calculated automatically using a binomial distribution.
+<span class='line'> 38</span> 
+<span class='line'> 39</span>  For further documentation and examples, see http://dygraphs.com/
+<span class='line'> 40</span> 
+<span class='line'> 41</span>  */</span><span class="WHIT">
+<span class='line'> 42</span> 
+<span class='line'> 43</span> </span><span class="COMM">/**
+<span class='line'> 44</span>  * Creates an interactive, zoomable chart.
+<span class='line'> 45</span>  *
+<span class='line'> 46</span>  * @constructor
+<span class='line'> 47</span>  * @param {div | String} div A div or the id of a div into which to construct
+<span class='line'> 48</span>  * the chart.
+<span class='line'> 49</span>  * @param {String | Function} file A file containing CSV data or a function
+<span class='line'> 50</span>  * that returns this data. The most basic expected format for each line is
+<span class='line'> 51</span>  * "YYYY/MM/DD,val1,val2,...". For more information, see
+<span class='line'> 52</span>  * http://dygraphs.com/data.html.
+<span class='line'> 53</span>  * @param {Object} attrs Various other attributes, e.g. errorBars determines
+<span class='line'> 54</span>  * whether the input data contains error ranges. For a complete list of
+<span class='line'> 55</span>  * options, see http://dygraphs.com/options.html.
+<span class='line'> 56</span>  */</span><span class="WHIT">
+<span class='line'> 57</span> </span><span class="NAME">Dygraph</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">div</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">opts</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'> 58</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">arguments.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'> 59</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">arguments.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'> 60</span> </span><span class="WHIT">      </span><span class="COMM">// Old versions of dygraphs took in the series labels as a constructor</span><span class="WHIT">
+<span class='line'> 61</span> </span><span class="WHIT">      </span><span class="COMM">// parameter. This doesn't make sense anymore, but it's easy to continue</span><span class="WHIT">
+<span class='line'> 62</span> </span><span class="WHIT">      </span><span class="COMM">// to support this usage.</span><span class="WHIT">
+<span class='line'> 63</span> </span><span class="WHIT">      </span><span class="NAME">this.warn</span><span class="PUNC">(</span><span class="STRN">"Using deprecated four-argument dygraph constructor"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 64</span> </span><span class="WHIT">      </span><span class="NAME">this.__old_init__</span><span class="PUNC">(</span><span class="NAME">div</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arguments</span><span class="PUNC">[</span><span class="NUMB">3</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 65</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'> 66</span> </span><span class="WHIT">      </span><span class="NAME">this.__init__</span><span class="PUNC">(</span><span class="NAME">div</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">opts</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 67</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'> 68</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'> 69</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 70</span> 
+<span class='line'> 71</span> </span><span class="NAME">Dygraph.NAME</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"Dygraph"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 72</span> </span><span class="NAME">Dygraph.VERSION</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"1.2"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 73</span> </span><span class="NAME">Dygraph.__repr__</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'> 74</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"["</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.NAME</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.VERSION</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 75</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 76</span> 
+<span class='line'> 77</span> </span><span class="COMM">/**
+<span class='line'> 78</span>  * Returns information about the Dygraph class.
+<span class='line'> 79</span>  */</span><span class="WHIT">
+<span class='line'> 80</span> </span><span class="NAME">Dygraph.toString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'> 81</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.__repr__</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 82</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 83</span> 
+<span class='line'> 84</span> </span><span class="COMM">// Various default values</span><span class="WHIT">
+<span class='line'> 85</span> </span><span class="NAME">Dygraph.DEFAULT_ROLL_PERIOD</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 86</span> </span><span class="NAME">Dygraph.DEFAULT_WIDTH</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">480</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 87</span> </span><span class="NAME">Dygraph.DEFAULT_HEIGHT</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">320</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 88</span> </span><span class="NAME">Dygraph.AXIS_LINE_WIDTH</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0.3</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 89</span> 
+<span class='line'> 90</span> </span><span class="NAME">Dygraph.LOG_SCALE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 91</span> </span><span class="NAME">Dygraph.LN_TEN</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.log</span><span class="PUNC">(</span><span class="NAME">Dygraph.LOG_SCALE</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 92</span> </span><span class="COMM">/**
+<span class='line'> 93</span>  * @private
+<span class='line'> 94</span>  */</span><span class="WHIT">
+<span class='line'> 95</span> </span><span class="NAME">Dygraph.log10</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'> 96</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Math.log</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">Dygraph.LN_TEN</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'> 97</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'> 98</span> 
+<span class='line'> 99</span> </span><span class="COMM">// Default attribute values.</span><span class="WHIT">
+<span class='line'>100</span> </span><span class="NAME">Dygraph.DEFAULT_ATTRS</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>101</span> </span><span class="WHIT">  </span><span class="NAME">highlightCircleSize</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>102</span> </span><span class="WHIT">  </span><span class="NAME">pixelsPerXLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>103</span> </span><span class="WHIT">  </span><span class="NAME">pixelsPerYLabel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">30</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>104</span> 
+<span class='line'>105</span> </span><span class="WHIT">  </span><span class="NAME">labelsDivWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">250</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>106</span> </span><span class="WHIT">  </span><span class="NAME">labelsDivStyles</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>107</span> </span><span class="WHIT">    </span><span class="COMM">// TODO(danvk): move defaults from createStatusMessage_ here.</span><span class="WHIT">
+<span class='line'>108</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>109</span> </span><span class="WHIT">  </span><span class="NAME">labelsSeparateLines</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>110</span> </span><span class="WHIT">  </span><span class="NAME">labelsShowZeroValues</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>111</span> </span><span class="WHIT">  </span><span class="NAME">labelsKMB</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>112</span> </span><span class="WHIT">  </span><span class="NAME">labelsKMG2</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>113</span> </span><span class="WHIT">  </span><span class="NAME">showLabelsOnHighlight</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>114</span> 
+<span class='line'>115</span> </span><span class="WHIT">  </span><span class="NAME">yValueFormatter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Dygraph.numberFormatter</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="NAME">b</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>116</span> </span><span class="WHIT">  </span><span class="NAME">digitsAfterDecimal</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>117</span> </span><span class="WHIT">  </span><span class="NAME">maxNumberWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>118</span> </span><span class="WHIT">  </span><span class="NAME">sigFigs</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>119</span> 
+<span class='line'>120</span> </span><span class="WHIT">  </span><span class="NAME">strokeWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1.0</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>121</span> 
+<span class='line'>122</span> </span><span class="WHIT">  </span><span class="NAME">axisTickSize</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>123</span> </span><span class="WHIT">  </span><span class="NAME">axisLabelFontSize</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">14</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>124</span> </span><span class="WHIT">  </span><span class="NAME">xAxisLabelWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">50</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>125</span> </span><span class="WHIT">  </span><span class="NAME">yAxisLabelWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">50</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>126</span> </span><span class="WHIT">  </span><span class="NAME">xAxisLabelFormatter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateAxisFormatter</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>127</span> </span><span class="WHIT">  </span><span class="NAME">rightGap</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>128</span> 
+<span class='line'>129</span> </span><span class="WHIT">  </span><span class="NAME">showRoller</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>130</span> </span><span class="WHIT">  </span><span class="NAME">xValueFormatter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateString_</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>131</span> </span><span class="WHIT">  </span><span class="NAME">xValueParser</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateParser</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>132</span> </span><span class="WHIT">  </span><span class="NAME">xTicker</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateTicker</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>133</span> 
+<span class='line'>134</span> </span><span class="WHIT">  </span><span class="NAME">delimiter</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">','</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>135</span> 
+<span class='line'>136</span> </span><span class="WHIT">  </span><span class="NAME">sigma</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">2.0</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>137</span> </span><span class="WHIT">  </span><span class="NAME">errorBars</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>138</span> </span><span class="WHIT">  </span><span class="NAME">fractions</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>139</span> </span><span class="WHIT">  </span><span class="NAME">wilsonInterval</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="COMM">// only relevant if fractions is true</span><span class="WHIT">
+<span class='line'>140</span> </span><span class="WHIT">  </span><span class="NAME">customBars</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>141</span> </span><span class="WHIT">  </span><span class="NAME">fillGraph</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>142</span> </span><span class="WHIT">  </span><span class="NAME">fillAlpha</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0.15</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>143</span> </span><span class="WHIT">  </span><span class="NAME">connectSeparatedPoints</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>144</span> 
+<span class='line'>145</span> </span><span class="WHIT">  </span><span class="NAME">stackedGraph</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>146</span> </span><span class="WHIT">  </span><span class="NAME">hideOverlayOnMouseOut</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>147</span> 
+<span class='line'>148</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): support 'onmouseover' and 'never', and remove synonyms.</span><span class="WHIT">
+<span class='line'>149</span> </span><span class="WHIT">  </span><span class="NAME">legend</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'onmouseover'</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="COMM">// the only relevant value at the moment is 'always'.</span><span class="WHIT">
+<span class='line'>150</span> 
+<span class='line'>151</span> </span><span class="WHIT">  </span><span class="NAME">stepPlot</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>152</span> </span><span class="WHIT">  </span><span class="NAME">avoidMinZero</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>153</span> 
+<span class='line'>154</span> </span><span class="WHIT">  </span><span class="COMM">// Sizes of the various chart labels.</span><span class="WHIT">
+<span class='line'>155</span> </span><span class="WHIT">  </span><span class="NAME">titleHeight</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">28</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>156</span> </span><span class="WHIT">  </span><span class="NAME">xLabelHeight</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">18</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>157</span> </span><span class="WHIT">  </span><span class="NAME">yLabelWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">18</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>158</span> 
+<span class='line'>159</span> </span><span class="WHIT">  </span><span class="NAME">interactionModel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT">  </span><span class="COMM">// will be set to Dygraph.defaultInteractionModel.</span><span class="WHIT">
+<span class='line'>160</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>161</span> 
+<span class='line'>162</span> </span><span class="COMM">// Various logging levels.</span><span class="WHIT">
+<span class='line'>163</span> </span><span class="NAME">Dygraph.DEBUG</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>164</span> </span><span class="NAME">Dygraph.INFO</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>165</span> </span><span class="NAME">Dygraph.WARNING</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>166</span> </span><span class="NAME">Dygraph.ERROR</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>167</span> 
+<span class='line'>168</span> </span><span class="COMM">// Directions for panning and zooming. Use bit operations when combined</span><span class="WHIT">
+<span class='line'>169</span> </span><span class="COMM">// values are possible.</span><span class="WHIT">
+<span class='line'>170</span> </span><span class="NAME">Dygraph.HORIZONTAL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>171</span> </span><span class="NAME">Dygraph.VERTICAL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>172</span> 
+<span class='line'>173</span> </span><span class="COMM">// Used for initializing annotation CSS rules only once.</span><span class="WHIT">
+<span class='line'>174</span> </span><span class="NAME">Dygraph.addedAnnotationCSS</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>175</span> 
+<span class='line'>176</span> </span><span class="COMM">/**
+<span class='line'>177</span>  * @private
+<span class='line'>178</span>  * Return the 2d context for a dygraph canvas.
+<span class='line'>179</span>  *
+<span class='line'>180</span>  * This method is only exposed for the sake of replacing the function in
+<span class='line'>181</span>  * automated tests, e.g.
+<span class='line'>182</span>  *
+<span class='line'>183</span>  * var oldFunc = Dygraph.getContext();
+<span class='line'>184</span>  * Dygraph.getContext = function(canvas) {
+<span class='line'>185</span>  *   var realContext = oldFunc(canvas);
+<span class='line'>186</span>  *   return new Proxy(realContext);
+<span class='line'>187</span>  * };
+<span class='line'>188</span>  */</span><span class="WHIT">
+<span class='line'>189</span> </span><span class="NAME">Dygraph.getContext</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">canvas</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>190</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">canvas.getContext</span><span class="PUNC">(</span><span class="STRN">"2d"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>191</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>192</span> 
+<span class='line'>193</span> </span><span class="NAME">Dygraph.prototype.__old_init__</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">div</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">labels</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>194</span> </span><span class="WHIT">  </span><span class="COMM">// Labels is no longer a constructor parameter, since it's typically set</span><span class="WHIT">
+<span class='line'>195</span> </span><span class="WHIT">  </span><span class="COMM">// directly from the data source. It also conains a name for the x-axis,</span><span class="WHIT">
+<span class='line'>196</span> </span><span class="WHIT">  </span><span class="COMM">// which the previous constructor form did not.</span><span class="WHIT">
+<span class='line'>197</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">labels</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>198</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">new_labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Date"</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>199</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">labels.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">new_labels.push</span><span class="PUNC">(</span><span class="NAME">labels</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>200</span> </span><span class="WHIT">    </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">attrs</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="STRN">'labels'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">new_labels</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>201</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>202</span> </span><span class="WHIT">  </span><span class="NAME">this.__init__</span><span class="PUNC">(</span><span class="NAME">div</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>203</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>204</span> 
+<span class='line'>205</span> </span><span class="COMM">/**
+<span class='line'>206</span>  * Initializes the Dygraph. This creates a new DIV and constructs the PlotKit
+<span class='line'>207</span>  * and context &lt;canvas&gt; inside of it. See the constructor for details.
+<span class='line'>208</span>  * on the parameters.
+<span class='line'>209</span>  * @param {Element} div the Element to render the graph into.
+<span class='line'>210</span>  * @param {String | Function} file Source data
+<span class='line'>211</span>  * @param {Object} attrs Miscellaneous other options
+<span class='line'>212</span>  * @private
+<span class='line'>213</span>  */</span><span class="WHIT">
+<span class='line'>214</span> </span><span class="NAME">Dygraph.prototype.__init__</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">div</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>215</span> </span><span class="WHIT">  </span><span class="COMM">// Hack for IE: if we're using excanvas and the document hasn't finished</span><span class="WHIT">
+<span class='line'>216</span> </span><span class="WHIT">  </span><span class="COMM">// loading yet (and hence may not have initialized whatever it needs to</span><span class="WHIT">
+<span class='line'>217</span> </span><span class="WHIT">  </span><span class="COMM">// initialize), then keep calling this routine periodically until it has.</span><span class="WHIT">
+<span class='line'>218</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="REGX">/MSIE/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">navigator.userAgent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">window.opera</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
+<span class='line'>219</span> </span><span class="WHIT">      </span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">G_vmlCanvasManager</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
+<span class='line'>220</span> </span><span class="WHIT">      </span><span class="NAME">document.readyState</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'complete'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>221</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>222</span> </span><span class="WHIT">    </span><span class="NAME">setTimeout</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">self.__init__</span><span class="PUNC">(</span><span class="NAME">div</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">file</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>223</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>224</span> 
+<span class='line'>225</span> </span><span class="WHIT">  </span><span class="COMM">// Support two-argument constructor</span><span class="WHIT">
+<span class='line'>226</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">attrs</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>227</span> 
+<span class='line'>228</span> </span><span class="WHIT">  </span><span class="COMM">// Copy the important bits into the object</span><span class="WHIT">
+<span class='line'>229</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): most of these should just stay in the attrs_ dictionary.</span><span class="WHIT">
+<span class='line'>230</span> </span><span class="WHIT">  </span><span class="NAME">this.maindiv_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">div</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>231</span> </span><span class="WHIT">  </span><span class="NAME">this.file_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">file</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>232</span> </span><span class="WHIT">  </span><span class="NAME">this.rollPeriod_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attrs.rollPeriod</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">Dygraph.DEFAULT_ROLL_PERIOD</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>233</span> </span><span class="WHIT">  </span><span class="NAME">this.previousVerticalX_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>234</span> </span><span class="WHIT">  </span><span class="NAME">this.fractions_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attrs.fractions</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>235</span> </span><span class="WHIT">  </span><span class="NAME">this.dateWindow_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attrs.dateWindow</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>236</span> 
+<span class='line'>237</span> </span><span class="WHIT">  </span><span class="NAME">this.wilsonInterval_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attrs.wilsonInterval</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>238</span> </span><span class="WHIT">  </span><span class="NAME">this.is_initial_draw_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>239</span> </span><span class="WHIT">  </span><span class="NAME">this.annotations_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>240</span> 
+<span class='line'>241</span> </span><span class="WHIT">  </span><span class="COMM">// Zoomed indicators - These indicate when the graph has been zoomed and on what axis.</span><span class="WHIT">
+<span class='line'>242</span> </span><span class="WHIT">  </span><span class="NAME">this.zoomed_x_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>243</span> </span><span class="WHIT">  </span><span class="NAME">this.zoomed_y_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>244</span> 
+<span class='line'>245</span> </span><span class="WHIT">  </span><span class="COMM">// Clear the div. This ensure that, if multiple dygraphs are passed the same</span><span class="WHIT">
+<span class='line'>246</span> </span><span class="WHIT">  </span><span class="COMM">// div, then only one will be drawn.</span><span class="WHIT">
+<span class='line'>247</span> </span><span class="WHIT">  </span><span class="NAME">div.innerHTML</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>248</span> 
+<span class='line'>249</span> </span><span class="WHIT">  </span><span class="COMM">// If the div isn't already sized then inherit from our attrs or</span><span class="WHIT">
+<span class='line'>250</span> </span><span class="WHIT">  </span><span class="COMM">// give it a default size.</span><span class="WHIT">
+<span class='line'>251</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">div.style.width</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>252</span> </span><span class="WHIT">    </span><span class="NAME">div.style.width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">attrs.width</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">Dygraph.DEFAULT_WIDTH</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>253</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>254</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">div.style.height</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>255</span> </span><span class="WHIT">    </span><span class="NAME">div.style.height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">attrs.height</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">Dygraph.DEFAULT_HEIGHT</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>256</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>257</span> </span><span class="WHIT">  </span><span class="NAME">this.width_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">div.style.width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>258</span> </span><span class="WHIT">  </span><span class="NAME">this.height_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">div.style.height</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>259</span> </span><span class="WHIT">  </span><span class="COMM">// The div might have been specified as percent of the current window size,</span><span class="WHIT">
+<span class='line'>260</span> </span><span class="WHIT">  </span><span class="COMM">// convert that to an appropriate number of pixels.</span><span class="WHIT">
+<span class='line'>261</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">div.style.width.indexOf</span><span class="PUNC">(</span><span class="STRN">"%"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">div.style.width.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>262</span> </span><span class="WHIT">    </span><span class="NAME">this.width_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">div.offsetWidth</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>263</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>264</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">div.style.height.indexOf</span><span class="PUNC">(</span><span class="STRN">"%"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">div.style.height.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>265</span> </span><span class="WHIT">    </span><span class="NAME">this.height_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">div.offsetHeight</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>266</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>267</span> 
+<span class='line'>268</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.width_</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>269</span> </span><span class="WHIT">    </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">"dygraph has zero width. Please specify a width in pixels."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>270</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>271</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.height_</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>272</span> </span><span class="WHIT">    </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">"dygraph has zero height. Please specify a height in pixels."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>273</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>274</span> 
+<span class='line'>275</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): set fillGraph to be part of attrs_ here, not user_attrs_.</span><span class="WHIT">
+<span class='line'>276</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">attrs</span><span class="PUNC">[</span><span class="STRN">'stackedGraph'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>277</span> </span><span class="WHIT">    </span><span class="NAME">attrs</span><span class="PUNC">[</span><span class="STRN">'fillGraph'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>278</span> </span><span class="WHIT">    </span><span class="COMM">// TODO(nikhilk): Add any other stackedGraph checks here.</span><span class="WHIT">
+<span class='line'>279</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>280</span> 
+<span class='line'>281</span> </span><span class="WHIT">  </span><span class="COMM">// Dygraphs has many options, some of which interact with one another.</span><span class="WHIT">
+<span class='line'>282</span> </span><span class="WHIT">  </span><span class="COMM">// To keep track of everything, we maintain two sets of options:</span><span class="WHIT">
+<span class='line'>283</span> </span><span class="WHIT">  </span><span class="COMM">//</span><span class="WHIT">
+<span class='line'>284</span> </span><span class="WHIT">  </span><span class="COMM">//  this.user_attrs_   only options explicitly set by the user.</span><span class="WHIT">
+<span class='line'>285</span> </span><span class="WHIT">  </span><span class="COMM">//  this.attrs_        defaults, options derived from user_attrs_, data.</span><span class="WHIT">
+<span class='line'>286</span> </span><span class="WHIT">  </span><span class="COMM">//</span><span class="WHIT">
+<span class='line'>287</span> </span><span class="WHIT">  </span><span class="COMM">// Options are then accessed this.attr_('attr'), which first looks at</span><span class="WHIT">
+<span class='line'>288</span> </span><span class="WHIT">  </span><span class="COMM">// user_attrs_ and then computed attrs_. This way Dygraphs can set intelligent</span><span class="WHIT">
+<span class='line'>289</span> </span><span class="WHIT">  </span><span class="COMM">// defaults without overriding behavior that the user specifically asks for.</span><span class="WHIT">
+<span class='line'>290</span> </span><span class="WHIT">  </span><span class="NAME">this.user_attrs_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>291</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">this.user_attrs_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>292</span> 
+<span class='line'>293</span> </span><span class="WHIT">  </span><span class="NAME">this.attrs_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>294</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">this.attrs_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Dygraph.DEFAULT_ATTRS</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>295</span> 
+<span class='line'>296</span> </span><span class="WHIT">  </span><span class="NAME">this.boundaryIds_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>297</span> 
+<span class='line'>298</span> </span><span class="WHIT">  </span><span class="COMM">// Make a note of whether labels will be pulled from the CSV file.</span><span class="WHIT">
+<span class='line'>299</span> </span><span class="WHIT">  </span><span class="NAME">this.labelsFromCSV_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labels"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>300</span> 
+<span class='line'>301</span> </span><span class="WHIT">  </span><span class="COMM">// Create the containing DIV and other interactive elements</span><span class="WHIT">
+<span class='line'>302</span> </span><span class="WHIT">  </span><span class="NAME">this.createInterface_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>303</span> 
+<span class='line'>304</span> </span><span class="WHIT">  </span><span class="NAME">this.start_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>305</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>306</span> 
+<span class='line'>307</span> </span><span class="COMM">/**
+<span class='line'>308</span>  * Returns the zoomed status of the chart for one or both axes.
+<span class='line'>309</span>  *
+<span class='line'>310</span>  * Axis is an optional parameter. Can be set to 'x' or 'y'.
+<span class='line'>311</span>  *
+<span class='line'>312</span>  * The zoomed status for an axis is set whenever a user zooms using the mouse
+<span class='line'>313</span>  * or when the dateWindow or valueRange are updated (unless the isZoomedIgnoreProgrammaticZoom
+<span class='line'>314</span>  * option is also specified).
+<span class='line'>315</span>  */</span><span class="WHIT">
+<span class='line'>316</span> </span><span class="NAME">Dygraph.prototype.isZoomed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>317</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.zoomed_x_</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.zoomed_y_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>318</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'x'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.zoomed_x_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>319</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'y'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.zoomed_y_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>320</span> </span><span class="WHIT">  </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"axis parameter to Dygraph.isZoomed must be missing, 'x' or 'y'."</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>321</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>322</span> 
+<span class='line'>323</span> </span><span class="COMM">/**
+<span class='line'>324</span>  * Returns information about the Dygraph object, including its containing ID.
+<span class='line'>325</span>  */</span><span class="WHIT">
+<span class='line'>326</span> </span><span class="NAME">Dygraph.prototype.toString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>327</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maindiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.maindiv_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>328</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">maindiv</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">maindiv.id</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">maindiv.id</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">maindiv</span><span class="WHIT">
+<span class='line'>329</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"[Dygraph "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"]"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>330</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>331</span> 
+<span class='line'>332</span> </span><span class="COMM">/**
+<span class='line'>333</span>  * @private
+<span class='line'>334</span>  * Returns the value of an option. This may be set by the user (either in the
+<span class='line'>335</span>  * constructor or by calling updateOptions) or by dygraphs, and may be set to a
+<span class='line'>336</span>  * per-series value.
+<span class='line'>337</span>  * @param { String } name The name of the option, e.g. 'rollPeriod'.
+<span class='line'>338</span>  * @param { String } [seriesName] The name of the series to which the option
+<span class='line'>339</span>  * will be applied. If no per-series value of this option is available, then
+<span class='line'>340</span>  * the global value is returned. This is optional.
+<span class='line'>341</span>  * @return { ... } The value of the option.
+<span class='line'>342</span>  */</span><span class="WHIT">
+<span class='line'>343</span> </span><span class="NAME">Dygraph.prototype.attr_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">seriesName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>344</span> </span><span class="COMM">// &lt;REMOVE_FOR_COMBINED></span><span class="WHIT">
+<span class='line'>345</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">Dygraph.OPTIONS_REFERENCE</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>346</span> </span><span class="WHIT">    </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">'Must include options reference JS for testing'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>347</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">Dygraph.OPTIONS_REFERENCE.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>348</span> </span><span class="WHIT">    </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">'Dygraphs is using property '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">', which has no entry '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>349</span> </span><span class="WHIT">               </span><span class="STRN">'in the Dygraphs.OPTIONS_REFERENCE listing.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>350</span> </span><span class="WHIT">    </span><span class="COMM">// Only log this error once.</span><span class="WHIT">
+<span class='line'>351</span> </span><span class="WHIT">    </span><span class="NAME">Dygraph.OPTIONS_REFERENCE</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>352</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>353</span> </span><span class="COMM">// &lt;/REMOVE_FOR_COMBINED></span><span class="WHIT">
+<span class='line'>354</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">seriesName</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
+<span class='line'>355</span> </span><span class="WHIT">      </span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">this.user_attrs_</span><span class="PUNC">[</span><span class="NAME">seriesName</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
+<span class='line'>356</span> </span><span class="WHIT">      </span><span class="NAME">this.user_attrs_</span><span class="PUNC">[</span><span class="NAME">seriesName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
+<span class='line'>357</span> </span><span class="WHIT">      </span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">this.user_attrs_</span><span class="PUNC">[</span><span class="NAME">seriesName</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>358</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.user_attrs_</span><span class="PUNC">[</span><span class="NAME">seriesName</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>359</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">this.user_attrs_</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>360</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.user_attrs_</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>361</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">this.attrs_</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>362</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.attrs_</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>363</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>364</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>365</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>366</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>367</span> 
+<span class='line'>368</span> </span><span class="COMM">// TODO(danvk): any way I can get the line numbers to be this.warn call?</span><span class="WHIT">
+<span class='line'>369</span> </span><span class="COMM">/**
+<span class='line'>370</span>  * @private
+<span class='line'>371</span>  * Log an error on the JS console at the given severity.
+<span class='line'>372</span>  * @param { Integer } severity One of Dygraph.{DEBUG,INFO,WARNING,ERROR}
+<span class='line'>373</span>  * @param { String } The message to log.
+<span class='line'>374</span>  */</span><span class="WHIT">
+<span class='line'>375</span> </span><span class="NAME">Dygraph.prototype.log</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">severity</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>376</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">console</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>377</span> </span><span class="WHIT">    </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">severity</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>378</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Dygraph.DEBUG</span><span class="PUNC">:</span><span class="WHIT">
+<span class='line'>379</span> </span><span class="WHIT">        </span><span class="NAME">console.debug</span><span class="PUNC">(</span><span class="STRN">'dygraphs: '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>380</span> </span><span class="WHIT">        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>381</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Dygraph.INFO</span><span class="PUNC">:</span><span class="WHIT">
+<span class='line'>382</span> </span><span class="WHIT">        </span><span class="NAME">console.info</span><span class="PUNC">(</span><span class="STRN">'dygraphs: '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>383</span> </span><span class="WHIT">        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>384</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Dygraph.WARNING</span><span class="PUNC">:</span><span class="WHIT">
+<span class='line'>385</span> </span><span class="WHIT">        </span><span class="NAME">console.warn</span><span class="PUNC">(</span><span class="STRN">'dygraphs: '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>386</span> </span><span class="WHIT">        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>387</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NAME">Dygraph.ERROR</span><span class="PUNC">:</span><span class="WHIT">
+<span class='line'>388</span> </span><span class="WHIT">        </span><span class="NAME">console.error</span><span class="PUNC">(</span><span class="STRN">'dygraphs: '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>389</span> </span><span class="WHIT">        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>390</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>391</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>392</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>393</span> 
+<span class='line'>394</span> </span><span class="COMM">/**
+<span class='line'>395</span>  * @private
+<span class='line'>396</span>  */</span><span class="WHIT">
+<span class='line'>397</span> </span><span class="NAME">Dygraph.prototype.info</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>398</span> </span><span class="WHIT">  </span><span class="NAME">this.log</span><span class="PUNC">(</span><span class="NAME">Dygraph.INFO</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>399</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>400</span> 
+<span class='line'>401</span> </span><span class="COMM">/**
+<span class='line'>402</span>  * @private
+<span class='line'>403</span>  */</span><span class="WHIT">
+<span class='line'>404</span> </span><span class="NAME">Dygraph.prototype.warn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>405</span> </span><span class="WHIT">  </span><span class="NAME">this.log</span><span class="PUNC">(</span><span class="NAME">Dygraph.WARNING</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>406</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>407</span> 
+<span class='line'>408</span> </span><span class="COMM">/**
+<span class='line'>409</span>  * @private
+<span class='line'>410</span>  */</span><span class="WHIT">
+<span class='line'>411</span> </span><span class="NAME">Dygraph.prototype.error</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">message</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>412</span> </span><span class="WHIT">  </span><span class="NAME">this.log</span><span class="PUNC">(</span><span class="NAME">Dygraph.ERROR</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">message</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>413</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>414</span> 
+<span class='line'>415</span> </span><span class="COMM">/**
+<span class='line'>416</span>  * Returns the current rolling period, as set by the user or an option.
+<span class='line'>417</span>  * @return {Number} The number of points in the rolling window
+<span class='line'>418</span>  */</span><span class="WHIT">
+<span class='line'>419</span> </span><span class="NAME">Dygraph.prototype.rollPeriod</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>420</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.rollPeriod_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>421</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>422</span> 
+<span class='line'>423</span> </span><span class="COMM">/**
+<span class='line'>424</span>  * Returns the currently-visible x-range. This can be affected by zooming,
+<span class='line'>425</span>  * panning or a call to updateOptions.
+<span class='line'>426</span>  * Returns a two-element array: [left, right].
+<span class='line'>427</span>  * If the Dygraph has dates on the x-axis, these will be millis since epoch.
+<span class='line'>428</span>  */</span><span class="WHIT">
+<span class='line'>429</span> </span><span class="NAME">Dygraph.prototype.xAxisRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>430</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.dateWindow_</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">this.dateWindow_</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.xAxisExtremes</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>431</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>432</span> 
+<span class='line'>433</span> </span><span class="COMM">/**
+<span class='line'>434</span>  * Returns the lower- and upper-bound x-axis values of the
+<span class='line'>435</span>  * data set.
+<span class='line'>436</span>  */</span><span class="WHIT">
+<span class='line'>437</span> </span><span class="NAME">Dygraph.prototype.xAxisExtremes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>438</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">left</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.rawData_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>439</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">right</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.rawData_</span><span class="PUNC">[</span><span class="NAME">this.rawData_.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>440</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">left</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">right</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>441</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>442</span> 
+<span class='line'>443</span> </span><span class="COMM">/**
+<span class='line'>444</span>  * Returns the currently-visible y-range for an axis. This can be affected by
+<span class='line'>445</span>  * zooming, panning or a call to updateOptions. Axis indices are zero-based. If
+<span class='line'>446</span>  * called with no arguments, returns the range of the first axis.
+<span class='line'>447</span>  * Returns a two-element array: [bottom, top].
+<span class='line'>448</span>  */</span><span class="WHIT">
+<span class='line'>449</span> </span><span class="NAME">Dygraph.prototype.yAxisRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>450</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>451</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">this.axes_.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>452</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">this.axes_</span><span class="PUNC">[</span><span class="NAME">idx</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">computedValueRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>453</span> </span><span class="WHIT">           </span><span class="NAME">this.axes_</span><span class="PUNC">[</span><span class="NAME">idx</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">computedValueRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>454</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>455</span> 
+<span class='line'>456</span> </span><span class="COMM">/**
+<span class='line'>457</span>  * Returns the currently-visible y-ranges for each axis. This can be affected by
+<span class='line'>458</span>  * zooming, panning, calls to updateOptions, etc.
+<span class='line'>459</span>  * Returns an array of [bottom, top] pairs, one for each y-axis.
+<span class='line'>460</span>  */</span><span class="WHIT">
+<span class='line'>461</span> </span><span class="NAME">Dygraph.prototype.yAxisRanges</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>462</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>463</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.axes_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>464</span> </span><span class="WHIT">    </span><span class="NAME">ret.push</span><span class="PUNC">(</span><span class="NAME">this.yAxisRange</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>465</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>466</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>467</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>468</span> 
+<span class='line'>469</span> </span><span class="COMM">// TODO(danvk): use these functions throughout dygraphs.</span><span class="WHIT">
+<span class='line'>470</span> </span><span class="COMM">/**
+<span class='line'>471</span>  * Convert from data coordinates to canvas/div X/Y coordinates.
+<span class='line'>472</span>  * If specified, do this conversion for the coordinate system of a particular
+<span class='line'>473</span>  * axis. Uses the first axis by default.
+<span class='line'>474</span>  * Returns a two-element array: [X, Y]
+<span class='line'>475</span>  *
+<span class='line'>476</span>  * Note: use toDomXCoord instead of toDomCoords(x, null) and use toDomYCoord
+<span class='line'>477</span>  * instead of toDomCoords(null, y, axis).
+<span class='line'>478</span>  */</span><span class="WHIT">
+<span class='line'>479</span> </span><span class="NAME">Dygraph.prototype.toDomCoords</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>480</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">this.toDomXCoord</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.toDomYCoord</span><span class="PUNC">(</span><span class="NAME">y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>481</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>482</span> 
+<span class='line'>483</span> </span><span class="COMM">/**
+<span class='line'>484</span>  * Convert from data x coordinates to canvas/div X coordinate.
+<span class='line'>485</span>  * If specified, do this conversion for the coordinate system of a particular
+<span class='line'>486</span>  * axis.
+<span class='line'>487</span>  * Returns a single value or null if x is null.
+<span class='line'>488</span>  */</span><span class="WHIT">
+<span class='line'>489</span> </span><span class="NAME">Dygraph.prototype.toDomXCoord</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>490</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>491</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>492</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>493</span> 
+<span class='line'>494</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">area</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.plotter_.area</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>495</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.xAxisRange</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>496</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">area.x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">area.w</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>497</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>498</span> 
+<span class='line'>499</span> </span><span class="COMM">/**
+<span class='line'>500</span>  * Convert from data x coordinates to canvas/div Y coordinate and optional
+<span class='line'>501</span>  * axis. Uses the first axis by default.
+<span class='line'>502</span>  *
+<span class='line'>503</span>  * returns a single value or null if y is null.
+<span class='line'>504</span>  */</span><span class="WHIT">
+<span class='line'>505</span> </span><span class="NAME">Dygraph.prototype.toDomYCoord</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>506</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pct</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.toPercentYCoord</span><span class="PUNC">(</span><span class="NAME">y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>507</span> 
+<span class='line'>508</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">pct</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>509</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>510</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>511</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">area</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.plotter_.area</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>512</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">area.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">pct</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">area.h</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>513</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>514</span> 
+<span class='line'>515</span> </span><span class="COMM">/**
+<span class='line'>516</span>  * Convert from canvas/div coords to data coordinates.
+<span class='line'>517</span>  * If specified, do this conversion for the coordinate system of a particular
+<span class='line'>518</span>  * axis. Uses the first axis by default.
+<span class='line'>519</span>  * Returns a two-element array: [X, Y].
+<span class='line'>520</span>  *
+<span class='line'>521</span>  * Note: use toDataXCoord instead of toDataCoords(x, null) and use toDataYCoord
+<span class='line'>522</span>  * instead of toDataCoords(null, y, axis).
+<span class='line'>523</span>  */</span><span class="WHIT">
+<span class='line'>524</span> </span><span class="NAME">Dygraph.prototype.toDataCoords</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>525</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">this.toDataXCoord</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.toDataYCoord</span><span class="PUNC">(</span><span class="NAME">y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>526</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>527</span> 
+<span class='line'>528</span> </span><span class="COMM">/**
+<span class='line'>529</span>  * Convert from canvas/div x coordinate to data coordinate.
+<span class='line'>530</span>  *
+<span class='line'>531</span>  * If x is null, this returns null.
+<span class='line'>532</span>  */</span><span class="WHIT">
+<span class='line'>533</span> </span><span class="NAME">Dygraph.prototype.toDataXCoord</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>534</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>535</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>536</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>537</span> 
+<span class='line'>538</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">area</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.plotter_.area</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>539</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.xAxisRange</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>540</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">area.x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">area.w</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>541</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>542</span> 
+<span class='line'>543</span> </span><span class="COMM">/**
+<span class='line'>544</span>  * Convert from canvas/div y coord to value.
+<span class='line'>545</span>  *
+<span class='line'>546</span>  * If y is null, this returns null.
+<span class='line'>547</span>  * if axis is null, this uses the first axis.
+<span class='line'>548</span>  */</span><span class="WHIT">
+<span class='line'>549</span> </span><span class="NAME">Dygraph.prototype.toDataYCoord</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>550</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>551</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>552</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>553</span> 
+<span class='line'>554</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">area</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.plotter_.area</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>555</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">yRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.yAxisRange</span><span class="PUNC">(</span><span class="NAME">axis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>556</span> 
+<span class='line'>557</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>558</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.axes_</span><span class="PUNC">[</span><span class="NAME">axis</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">logscale</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>559</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">area.h</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">area.h</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>560</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>561</span> </span><span class="WHIT">    </span><span class="COMM">// Computing the inverse of toDomCoord.</span><span class="WHIT">
+<span class='line'>562</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pct</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">area.y</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">area.h</span><span class="WHIT">
+<span class='line'>563</span> 
+<span class='line'>564</span> </span><span class="WHIT">    </span><span class="COMM">// Computing the inverse of toPercentYCoord. The function was arrived at with</span><span class="WHIT">
+<span class='line'>565</span> </span><span class="WHIT">    </span><span class="COMM">// the following steps:</span><span class="WHIT">
+<span class='line'>566</span> </span><span class="WHIT">    </span><span class="COMM">//</span><span class="WHIT">
+<span class='line'>567</span> </span><span class="WHIT">    </span><span class="COMM">// Original calcuation:</span><span class="WHIT">
+<span class='line'>568</span> </span><span class="WHIT">    </span><span class="COMM">// pct = (logr1 - Dygraph.log10(y)) / (logr1 - Dygraph.log10(yRange[0]));</span><span class="WHIT">
+<span class='line'>569</span> </span><span class="WHIT">    </span><span class="COMM">//</span><span class="WHIT">
+<span class='line'>570</span> </span><span class="WHIT">    </span><span class="COMM">// Move denominator to both sides:</span><span class="WHIT">
+<span class='line'>571</span> </span><span class="WHIT">    </span><span class="COMM">// pct * (logr1 - Dygraph.log10(yRange[0])) = logr1 - Dygraph.log10(y);</span><span class="WHIT">
+<span class='line'>572</span> </span><span class="WHIT">    </span><span class="COMM">//</span><span class="WHIT">
+<span class='line'>573</span> </span><span class="WHIT">    </span><span class="COMM">// subtract logr1, and take the negative value.</span><span class="WHIT">
+<span class='line'>574</span> </span><span class="WHIT">    </span><span class="COMM">// logr1 - (pct * (logr1 - Dygraph.log10(yRange[0]))) = Dygraph.log10(y);</span><span class="WHIT">
+<span class='line'>575</span> </span><span class="WHIT">    </span><span class="COMM">//</span><span class="WHIT">
+<span class='line'>576</span> </span><span class="WHIT">    </span><span class="COMM">// Swap both sides of the equation, and we can compute the log of the</span><span class="WHIT">
+<span class='line'>577</span> </span><span class="WHIT">    </span><span class="COMM">// return value. Which means we just need to use that as the exponent in</span><span class="WHIT">
+<span class='line'>578</span> </span><span class="WHIT">    </span><span class="COMM">// e^exponent.</span><span class="WHIT">
+<span class='line'>579</span> </span><span class="WHIT">    </span><span class="COMM">// Dygraph.log10(y) = logr1 - (pct * (logr1 - Dygraph.log10(yRange[0])));</span><span class="WHIT">
+<span class='line'>580</span> 
+<span class='line'>581</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">logr1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.log10</span><span class="PUNC">(</span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>582</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">exponent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">logr1</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">pct</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">logr1</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">Dygraph.log10</span><span class="PUNC">(</span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>583</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.pow</span><span class="PUNC">(</span><span class="NAME">Dygraph.LOG_SCALE</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">exponent</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>584</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>585</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>586</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>587</span> 
+<span class='line'>588</span> </span><span class="COMM">/**
+<span class='line'>589</span>  * Converts a y for an axis to a percentage from the top to the
+<span class='line'>590</span>  * bottom of the drawing area.
+<span class='line'>591</span>  *
+<span class='line'>592</span>  * If the coordinate represents a value visible on the canvas, then
+<span class='line'>593</span>  * the value will be between 0 and 1, where 0 is the top of the canvas.
+<span class='line'>594</span>  * However, this method will return values outside the range, as
+<span class='line'>595</span>  * values can fall outside the canvas.
+<span class='line'>596</span>  *
+<span class='line'>597</span>  * If y is null, this returns null.
+<span class='line'>598</span>  * if axis is null, this uses the first axis.
+<span class='line'>599</span>  *
+<span class='line'>600</span>  * @param { Number } y The data y-coordinate.
+<span class='line'>601</span>  * @param { Number } [axis] The axis number on which the data coordinate lives.
+<span class='line'>602</span>  * @return { Number } A fraction in [0, 1] where 0 = the top edge.
+<span class='line'>603</span>  */</span><span class="WHIT">
+<span class='line'>604</span> </span><span class="NAME">Dygraph.prototype.toPercentYCoord</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>605</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>606</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>607</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>608</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"undefined"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>609</span> 
+<span class='line'>610</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">area</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.plotter_.area</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>611</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">yRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.yAxisRange</span><span class="PUNC">(</span><span class="NAME">axis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>612</span> 
+<span class='line'>613</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pct</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>614</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.axes_</span><span class="PUNC">[</span><span class="NAME">axis</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">logscale</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>615</span> </span><span class="WHIT">    </span><span class="COMM">// yRange[1] - y is unit distance from the bottom.</span><span class="WHIT">
+<span class='line'>616</span> </span><span class="WHIT">    </span><span class="COMM">// yRange[1] - yRange[0] is the scale of the range.</span><span class="WHIT">
+<span class='line'>617</span> </span><span class="WHIT">    </span><span class="COMM">// (yRange[1] - y) / (yRange[1] - yRange[0]) is the % from the bottom.</span><span class="WHIT">
+<span class='line'>618</span> </span><span class="WHIT">    </span><span class="NAME">pct</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>619</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>620</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">logr1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.log10</span><span class="PUNC">(</span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>621</span> </span><span class="WHIT">    </span><span class="NAME">pct</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">logr1</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">Dygraph.log10</span><span class="PUNC">(</span><span class="NAME">y</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">logr1</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">Dygraph.log10</span><span class="PUNC">(</span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>622</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>623</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">pct</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>624</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>625</span> 
+<span class='line'>626</span> </span><span class="COMM">/**
+<span class='line'>627</span>  * Converts an x value to a percentage from the left to the right of
+<span class='line'>628</span>  * the drawing area.
+<span class='line'>629</span>  *
+<span class='line'>630</span>  * If the coordinate represents a value visible on the canvas, then
+<span class='line'>631</span>  * the value will be between 0 and 1, where 0 is the left of the canvas.
+<span class='line'>632</span>  * However, this method will return values outside the range, as
+<span class='line'>633</span>  * values can fall outside the canvas.
+<span class='line'>634</span>  *
+<span class='line'>635</span>  * If x is null, this returns null.
+<span class='line'>636</span>  * @param { Number } x The data x-coordinate.
+<span class='line'>637</span>  * @return { Number } A fraction in [0, 1] where 0 = the left edge.
+<span class='line'>638</span>  */</span><span class="WHIT">
+<span class='line'>639</span> </span><span class="NAME">Dygraph.prototype.toPercentXCoord</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>640</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>641</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>642</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>643</span> 
+<span class='line'>644</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.xAxisRange</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>645</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>646</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>647</span> 
+<span class='line'>648</span> </span><span class="COMM">/**
+<span class='line'>649</span>  * Returns the number of columns (including the independent variable).
+<span class='line'>650</span>  * @return { Integer } The number of columns.
+<span class='line'>651</span>  */</span><span class="WHIT">
+<span class='line'>652</span> </span><span class="NAME">Dygraph.prototype.numColumns</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>653</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.rawData_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>654</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>655</span> 
+<span class='line'>656</span> </span><span class="COMM">/**
+<span class='line'>657</span>  * Returns the number of rows (excluding any header/label row).
+<span class='line'>658</span>  * @return { Integer } The number of rows, less any header.
+<span class='line'>659</span>  */</span><span class="WHIT">
+<span class='line'>660</span> </span><span class="NAME">Dygraph.prototype.numRows</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>661</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.rawData_.length</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>662</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>663</span> 
+<span class='line'>664</span> </span><span class="COMM">/**
+<span class='line'>665</span>  * Returns the value in the given row and column. If the row and column exceed
+<span class='line'>666</span>  * the bounds on the data, returns null. Also returns null if the value is
+<span class='line'>667</span>  * missing.
+<span class='line'>668</span>  * @param { Number} row The row number of the data (0-based). Row 0 is the
+<span class='line'>669</span>  * first row of data, not a header row.
+<span class='line'>670</span>  * @param { Number} col The column number of the data (0-based)
+<span class='line'>671</span>  * @return { Number } The value in the specified cell or null if the row/col
+<span class='line'>672</span>  * were out of range.
+<span class='line'>673</span>  */</span><span class="WHIT">
+<span class='line'>674</span> </span><span class="NAME">Dygraph.prototype.getValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">row</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">col</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>675</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">this.rawData_.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>676</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">col</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">col</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">this.rawData_</span><span class="PUNC">[</span><span class="NAME">row</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>677</span> 
+<span class='line'>678</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.rawData_</span><span class="PUNC">[</span><span class="NAME">row</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">col</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>679</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>680</span> 
+<span class='line'>681</span> </span><span class="COMM">/**
+<span class='line'>682</span>  * @private
+<span class='line'>683</span>  * Add an event handler. This smooths a difference between IE and the rest of
+<span class='line'>684</span>  * the world.
+<span class='line'>685</span>  * @param { DOM element } el The element to add the event to.
+<span class='line'>686</span>  * @param { String } evt The name of the event, e.g. 'click' or 'mousemove'.
+<span class='line'>687</span>  * @param { Function } fn The function to call on the event. The function takes
+<span class='line'>688</span>  * one parameter: the event object.
+<span class='line'>689</span>  */</span><span class="WHIT">
+<span class='line'>690</span> </span><span class="NAME">Dygraph.addEvent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">el</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">evt</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">fn</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>691</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">normed_fn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>692</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">window.event</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>693</span> </span><span class="WHIT">    </span><span class="NAME">fn</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>694</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>695</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">window.addEventListener</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">// Mozilla, Netscape, Firefox</span><span class="WHIT">
+<span class='line'>696</span> </span><span class="WHIT">    </span><span class="NAME">el.addEventListener</span><span class="PUNC">(</span><span class="NAME">evt</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">normed_fn</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>697</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">// IE</span><span class="WHIT">
+<span class='line'>698</span> </span><span class="WHIT">    </span><span class="NAME">el.attachEvent</span><span class="PUNC">(</span><span class="STRN">'on'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">evt</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">normed_fn</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>699</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>700</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>701</span> 
+<span class='line'>702</span> 
+<span class='line'>703</span> </span><span class="COMM">/**
+<span class='line'>704</span>  * @private
+<span class='line'>705</span>  * Cancels further processing of an event. This is useful to prevent default
+<span class='line'>706</span>  * browser actions, e.g. highlighting text on a double-click.
+<span class='line'>707</span>  * Based on the article at
+<span class='line'>708</span>  * http://www.switchonthecode.com/tutorials/javascript-tutorial-the-scroll-wheel
+<span class='line'>709</span>  * @param { Event } e The event whose normal behavior should be canceled.
+<span class='line'>710</span>  */</span><span class="WHIT">
+<span class='line'>711</span> </span><span class="NAME">Dygraph.cancelEvent</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>712</span> </span><span class="WHIT">  </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">e</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">window.event</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>713</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.stopPropagation</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>714</span> </span><span class="WHIT">    </span><span class="NAME">e.stopPropagation</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>715</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>716</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.preventDefault</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>717</span> </span><span class="WHIT">    </span><span class="NAME">e.preventDefault</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>718</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>719</span> </span><span class="WHIT">  </span><span class="NAME">e.cancelBubble</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>720</span> </span><span class="WHIT">  </span><span class="NAME">e.cancel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>721</span> </span><span class="WHIT">  </span><span class="NAME">e.returnValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>722</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>723</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>724</span> 
+<span class='line'>725</span> 
+<span class='line'>726</span> </span><span class="COMM">/**
+<span class='line'>727</span>  * Generates interface elements for the Dygraph: a containing div, a div to
+<span class='line'>728</span>  * display the current point, and a textbox to adjust the rolling average
+<span class='line'>729</span>  * period. Also creates the Renderer/Layout elements.
+<span class='line'>730</span>  * @private
+<span class='line'>731</span>  */</span><span class="WHIT">
+<span class='line'>732</span> </span><span class="NAME">Dygraph.prototype.createInterface_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>733</span> </span><span class="WHIT">  </span><span class="COMM">// Create the all-enclosing graph div</span><span class="WHIT">
+<span class='line'>734</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">enclosing</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.maindiv_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>735</span> 
+<span class='line'>736</span> </span><span class="WHIT">  </span><span class="NAME">this.graphDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"div"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>737</span> </span><span class="WHIT">  </span><span class="NAME">this.graphDiv.style.width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.width_</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>738</span> </span><span class="WHIT">  </span><span class="NAME">this.graphDiv.style.height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.height_</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>739</span> </span><span class="WHIT">  </span><span class="NAME">enclosing.appendChild</span><span class="PUNC">(</span><span class="NAME">this.graphDiv</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>740</span> 
+<span class='line'>741</span> </span><span class="WHIT">  </span><span class="COMM">// Create the canvas for interactive parts of the chart.</span><span class="WHIT">
+<span class='line'>742</span> </span><span class="WHIT">  </span><span class="NAME">this.canvas_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.createCanvas</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>743</span> </span><span class="WHIT">  </span><span class="NAME">this.canvas_.style.position</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"absolute"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>744</span> </span><span class="WHIT">  </span><span class="NAME">this.canvas_.width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.width_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>745</span> </span><span class="WHIT">  </span><span class="NAME">this.canvas_.height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.height_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>746</span> </span><span class="WHIT">  </span><span class="NAME">this.canvas_.style.width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.width_</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">;</span><span class="WHIT">    </span><span class="COMM">// for IE</span><span class="WHIT">
+<span class='line'>747</span> </span><span class="WHIT">  </span><span class="NAME">this.canvas_.style.height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.height_</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// for IE</span><span class="WHIT">
+<span class='line'>748</span> 
+<span class='line'>749</span> </span><span class="WHIT">  </span><span class="NAME">this.canvas_ctx_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.getContext</span><span class="PUNC">(</span><span class="NAME">this.canvas_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>750</span> 
+<span class='line'>751</span> </span><span class="WHIT">  </span><span class="COMM">// ... and for static parts of the chart.</span><span class="WHIT">
+<span class='line'>752</span> </span><span class="WHIT">  </span><span class="NAME">this.hidden_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.createPlotKitCanvas_</span><span class="PUNC">(</span><span class="NAME">this.canvas_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>753</span> </span><span class="WHIT">  </span><span class="NAME">this.hidden_ctx_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.getContext</span><span class="PUNC">(</span><span class="NAME">this.hidden_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>754</span> 
+<span class='line'>755</span> </span><span class="WHIT">  </span><span class="COMM">// The interactive parts of the graph are drawn on top of the chart.</span><span class="WHIT">
+<span class='line'>756</span> </span><span class="WHIT">  </span><span class="NAME">this.graphDiv.appendChild</span><span class="PUNC">(</span><span class="NAME">this.hidden_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>757</span> </span><span class="WHIT">  </span><span class="NAME">this.graphDiv.appendChild</span><span class="PUNC">(</span><span class="NAME">this.canvas_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>758</span> </span><span class="WHIT">  </span><span class="NAME">this.mouseEventElement_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.canvas_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>759</span> 
+<span class='line'>760</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dygraph</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>761</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.addEvent</span><span class="PUNC">(</span><span class="NAME">this.mouseEventElement_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'mousemove'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>762</span> </span><span class="WHIT">    </span><span class="NAME">dygraph.mouseMove_</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>763</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>764</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.addEvent</span><span class="PUNC">(</span><span class="NAME">this.mouseEventElement_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'mouseout'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>765</span> </span><span class="WHIT">    </span><span class="NAME">dygraph.mouseOut_</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>766</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>767</span> 
+<span class='line'>768</span> </span><span class="WHIT">  </span><span class="COMM">// Create the grapher</span><span class="WHIT">
+<span class='line'>769</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): why does the Layout need its own set of options?</span><span class="WHIT">
+<span class='line'>770</span> </span><span class="WHIT">  </span><span class="NAME">this.layoutOptions_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="STRN">'xOriginIsZero'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>771</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">this.layoutOptions_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.attrs_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>772</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">this.layoutOptions_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.user_attrs_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>773</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">this.layoutOptions_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>774</span> </span><span class="WHIT">    </span><span class="STRN">'errorBars'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"errorBars"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"customBars"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>775</span> 
+<span class='line'>776</span> </span><span class="WHIT">  </span><span class="NAME">this.layout_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">DygraphLayout</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.layoutOptions_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>777</span> 
+<span class='line'>778</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): why does the Renderer need its own set of options?</span><span class="WHIT">
+<span class='line'>779</span> </span><span class="WHIT">  </span><span class="NAME">this.renderOptions_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">colorScheme</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.colors_</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>780</span> </span><span class="WHIT">                          </span><span class="NAME">strokeColor</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>781</span> </span><span class="WHIT">                          </span><span class="NAME">axisLineWidth</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Dygraph.AXIS_LINE_WIDTH</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>782</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">this.renderOptions_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.attrs_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>783</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">this.renderOptions_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.user_attrs_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>784</span> 
+<span class='line'>785</span> </span><span class="WHIT">  </span><span class="NAME">this.createStatusMessage_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>786</span> </span><span class="WHIT">  </span><span class="NAME">this.createDragInterface_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>787</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>788</span> 
+<span class='line'>789</span> </span><span class="COMM">/**
+<span class='line'>790</span>  * Detach DOM elements in the dygraph and null out all data references.
+<span class='line'>791</span>  * Calling this when you're done with a dygraph can dramatically reduce memory
+<span class='line'>792</span>  * usage. See, e.g., the tests/perf.html example.
+<span class='line'>793</span>  */</span><span class="WHIT">
+<span class='line'>794</span> </span><span class="NAME">Dygraph.prototype.destroy</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>795</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">removeRecursive</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">node</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>796</span> </span><span class="WHIT">    </span><span class="KEYW">while</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">node.hasChildNodes</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>797</span> </span><span class="WHIT">      </span><span class="NAME">removeRecursive</span><span class="PUNC">(</span><span class="NAME">node.firstChild</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>798</span> </span><span class="WHIT">      </span><span class="NAME">node.removeChild</span><span class="PUNC">(</span><span class="NAME">node.firstChild</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>799</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>800</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>801</span> </span><span class="WHIT">  </span><span class="NAME">removeRecursive</span><span class="PUNC">(</span><span class="NAME">this.maindiv_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>802</span> 
+<span class='line'>803</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nullOut</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>804</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">n</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>805</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">n</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>806</span> </span><span class="WHIT">        </span><span class="NAME">obj</span><span class="PUNC">[</span><span class="NAME">n</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>807</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>808</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>809</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>810</span> 
+<span class='line'>811</span> </span><span class="WHIT">  </span><span class="COMM">// These may not all be necessary, but it can't hurt...</span><span class="WHIT">
+<span class='line'>812</span> </span><span class="WHIT">  </span><span class="NAME">nullOut</span><span class="PUNC">(</span><span class="NAME">this.layout_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>813</span> </span><span class="WHIT">  </span><span class="NAME">nullOut</span><span class="PUNC">(</span><span class="NAME">this.plotter_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>814</span> </span><span class="WHIT">  </span><span class="NAME">nullOut</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>815</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>816</span> 
+<span class='line'>817</span> </span><span class="COMM">/**
+<span class='line'>818</span>  * Creates the canvas on which the chart will be drawn. Only the Renderer ever
+<span class='line'>819</span>  * draws on this particular canvas. All Dygraph work (i.e. drawing hover dots
+<span class='line'>820</span>  * or the zoom rectangles) is done on this.canvas_.
+<span class='line'>821</span>  * @param {Object} canvas The Dygraph canvas over which to overlay the plot
+<span class='line'>822</span>  * @return {Object} The newly-created canvas
+<span class='line'>823</span>  * @private
+<span class='line'>824</span>  */</span><span class="WHIT">
+<span class='line'>825</span> </span><span class="NAME">Dygraph.prototype.createPlotKitCanvas_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">canvas</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>826</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.createCanvas</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>827</span> </span><span class="WHIT">  </span><span class="NAME">h.style.position</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"absolute"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>828</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): h should be offset from canvas. canvas needs to include</span><span class="WHIT">
+<span class='line'>829</span> </span><span class="WHIT">  </span><span class="COMM">// some extra area to make it easier to zoom in on the far left and far</span><span class="WHIT">
+<span class='line'>830</span> </span><span class="WHIT">  </span><span class="COMM">// right. h needs to be precisely the plot area, so that clipping occurs.</span><span class="WHIT">
+<span class='line'>831</span> </span><span class="WHIT">  </span><span class="NAME">h.style.top</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">canvas.style.top</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>832</span> </span><span class="WHIT">  </span><span class="NAME">h.style.left</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">canvas.style.left</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>833</span> </span><span class="WHIT">  </span><span class="NAME">h.width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.width_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>834</span> </span><span class="WHIT">  </span><span class="NAME">h.height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.height_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>835</span> </span><span class="WHIT">  </span><span class="NAME">h.style.width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.width_</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">;</span><span class="WHIT">    </span><span class="COMM">// for IE</span><span class="WHIT">
+<span class='line'>836</span> </span><span class="WHIT">  </span><span class="NAME">h.style.height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.height_</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// for IE</span><span class="WHIT">
+<span class='line'>837</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">h</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>838</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>839</span> 
+<span class='line'>840</span> </span><span class="COMM">/**
+<span class='line'>841</span>  * Convert hsv values to an rgb(r,g,b) string. Taken from MochiKit.Color. This
+<span class='line'>842</span>  * is used to generate default series colors which are evenly spaced on the
+<span class='line'>843</span>  * color wheel.
+<span class='line'>844</span>  * @param { Number } hue Range is 0.0-1.0.
+<span class='line'>845</span>  * @param { Number } saturation Range is 0.0-1.0.
+<span class='line'>846</span>  * @param { Number } value Range is 0.0-1.0.
+<span class='line'>847</span>  * @return { String } "rgb(r,g,b)" where r, g and b range from 0-255.
+<span class='line'>848</span>  * @private
+<span class='line'>849</span>  */</span><span class="WHIT">
+<span class='line'>850</span> </span><span class="NAME">Dygraph.hsvToRGB</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">saturation</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>851</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">red</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>852</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">green</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>853</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">blue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>854</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">saturation</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>855</span> </span><span class="WHIT">    </span><span class="NAME">red</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>856</span> </span><span class="WHIT">    </span><span class="NAME">green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>857</span> </span><span class="WHIT">    </span><span class="NAME">blue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>858</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>859</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.floor</span><span class="PUNC">(</span><span class="NAME">hue</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>860</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">f</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hue</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>861</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">saturation</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>862</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">q</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">saturation</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">f</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>863</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">saturation</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">f</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>864</span> </span><span class="WHIT">    </span><span class="KEYW">switch</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>865</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">red</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">q</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">blue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>866</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">red</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">blue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>867</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">red</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">q</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">blue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>868</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">red</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">blue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>869</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">red</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">blue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">q</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>870</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="COMM">// fall through</span><span class="WHIT">
+<span class='line'>871</span> </span><span class="WHIT">      </span><span class="KEYW">case</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">red</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">t</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">blue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>872</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>873</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>874</span> </span><span class="WHIT">  </span><span class="NAME">red</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.floor</span><span class="PUNC">(</span><span class="NUMB">255</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">red</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">0.5</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>875</span> </span><span class="WHIT">  </span><span class="NAME">green</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.floor</span><span class="PUNC">(</span><span class="NUMB">255</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">green</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">0.5</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>876</span> </span><span class="WHIT">  </span><span class="NAME">blue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.floor</span><span class="PUNC">(</span><span class="NUMB">255</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">blue</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">0.5</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>877</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">'rgb('</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">red</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">','</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">green</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">','</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">blue</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">')'</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>878</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>879</span> 
+<span class='line'>880</span> 
+<span class='line'>881</span> </span><span class="COMM">/**
+<span class='line'>882</span>  * Generate a set of distinct colors for the data series. This is done with a
+<span class='line'>883</span>  * color wheel. Saturation/Value are customizable, and the hue is
+<span class='line'>884</span>  * equally-spaced around the color wheel. If a custom set of colors is
+<span class='line'>885</span>  * specified, that is used instead.
+<span class='line'>886</span>  * @private
+<span class='line'>887</span>  */</span><span class="WHIT">
+<span class='line'>888</span> </span><span class="NAME">Dygraph.prototype.setColors_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>889</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): compute this directly into this.attrs_['colorScheme'] and do</span><span class="WHIT">
+<span class='line'>890</span> </span><span class="WHIT">  </span><span class="COMM">// away with this.renderOptions_.</span><span class="WHIT">
+<span class='line'>891</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">num</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labels"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>892</span> </span><span class="WHIT">  </span><span class="NAME">this.colors_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>893</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">colors</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'colors'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>894</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">colors</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>895</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'colorSaturation'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">1.0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>896</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'colorValue'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">0.5</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>897</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">half</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.ceil</span><span class="PUNC">(</span><span class="NAME">num</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>898</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">num</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>899</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.visibility</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>900</span> </span><span class="WHIT">      </span><span class="COMM">// alternate colors for high contrast.</span><span class="WHIT">
+<span class='line'>901</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">%</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">Math.ceil</span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">half</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>902</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1.0</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">/</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">num</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>903</span> </span><span class="WHIT">      </span><span class="NAME">this.colors_.push</span><span class="PUNC">(</span><span class="NAME">Dygraph.hsvToRGB</span><span class="PUNC">(</span><span class="NAME">hue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sat</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>904</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>905</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>906</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">num</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>907</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.visibility</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>908</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">colorStr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">colors</span><span class="PUNC">[</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">%</span><span class="WHIT"> </span><span class="NAME">colors.length</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>909</span> </span><span class="WHIT">      </span><span class="NAME">this.colors_.push</span><span class="PUNC">(</span><span class="NAME">colorStr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>910</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>911</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>912</span> 
+<span class='line'>913</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): update this w/r/t/ the new options system.</span><span class="WHIT">
+<span class='line'>914</span> </span><span class="WHIT">  </span><span class="NAME">this.renderOptions_.colorScheme</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.colors_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>915</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">this.plotter_.options</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.renderOptions_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>916</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">this.layoutOptions_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.user_attrs_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>917</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">this.layoutOptions_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.attrs_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>918</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>919</span> 
+<span class='line'>920</span> </span><span class="COMM">/**
+<span class='line'>921</span>  * Return the list of colors. This is either the list of colors passed in the
+<span class='line'>922</span>  * attributes or the autogenerated list of rgb(r,g,b) strings.
+<span class='line'>923</span>  * @return {Array&lt;string>} The list of colors.
+<span class='line'>924</span>  */</span><span class="WHIT">
+<span class='line'>925</span> </span><span class="NAME">Dygraph.prototype.getColors</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>926</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.colors_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>927</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>928</span> 
+<span class='line'>929</span> </span><span class="COMM">// The following functions are from quirksmode.org with a modification for Safari from</span><span class="WHIT">
+<span class='line'>930</span> </span><span class="COMM">// http://blog.firetree.net/2005/07/04/javascript-find-position/</span><span class="WHIT">
+<span class='line'>931</span> </span><span class="COMM">// http://www.quirksmode.org/js/findpos.html</span><span class="WHIT">
+<span class='line'>932</span> 
+<span class='line'>933</span> </span><span class="COMM">/**
+<span class='line'>934</span>  * @private
+<span class='line'>935</span>  */</span><span class="WHIT">
+<span class='line'>936</span> </span><span class="NAME">Dygraph.findPosX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>937</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">curleft</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>938</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">obj.offsetParent</span><span class="PUNC">)</span><span class="WHIT">
+<span class='line'>939</span> </span><span class="WHIT">    </span><span class="KEYW">while</span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT">
+<span class='line'>940</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>941</span> </span><span class="WHIT">      </span><span class="NAME">curleft</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj.offsetLeft</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>942</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">obj.offsetParent</span><span class="PUNC">)</span><span class="WHIT">
+<span class='line'>943</span> </span><span class="WHIT">        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>944</span> </span><span class="WHIT">      </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj.offsetParent</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>945</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>946</span> </span><span class="WHIT">  </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">obj.x</span><span class="PUNC">)</span><span class="WHIT">
+<span class='line'>947</span> </span><span class="WHIT">    </span><span class="NAME">curleft</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj.x</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>948</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">curleft</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>949</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>950</span> 
+<span class='line'>951</span> 
+<span class='line'>952</span> </span><span class="COMM">/**
+<span class='line'>953</span>  * @private
+<span class='line'>954</span>  */</span><span class="WHIT">
+<span class='line'>955</span> </span><span class="NAME">Dygraph.findPosY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">obj</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>956</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">curtop</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>957</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">obj.offsetParent</span><span class="PUNC">)</span><span class="WHIT">
+<span class='line'>958</span> </span><span class="WHIT">    </span><span class="KEYW">while</span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT">
+<span class='line'>959</span> </span><span class="WHIT">    </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>960</span> </span><span class="WHIT">      </span><span class="NAME">curtop</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj.offsetTop</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>961</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">obj.offsetParent</span><span class="PUNC">)</span><span class="WHIT">
+<span class='line'>962</span> </span><span class="WHIT">        </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>963</span> </span><span class="WHIT">      </span><span class="NAME">obj</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj.offsetParent</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>964</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>965</span> </span><span class="WHIT">  </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="PUNC">(</span><span class="NAME">obj.y</span><span class="PUNC">)</span><span class="WHIT">
+<span class='line'>966</span> </span><span class="WHIT">    </span><span class="NAME">curtop</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">obj.y</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>967</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">curtop</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>968</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>969</span> 
+<span class='line'>970</span> 
+<span class='line'>971</span> </span><span class="COMM">/**
+<span class='line'>972</span>  * Create the div that contains information on the selected point(s)
+<span class='line'>973</span>  * This goes in the top right of the canvas, unless an external div has already
+<span class='line'>974</span>  * been specified.
+<span class='line'>975</span>  * @private
+<span class='line'>976</span>  */</span><span class="WHIT">
+<span class='line'>977</span> </span><span class="NAME">Dygraph.prototype.createStatusMessage_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>978</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">userLabelsDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.user_attrs_</span><span class="PUNC">[</span><span class="STRN">"labelsDiv"</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>979</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">userLabelsDiv</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">userLabelsDiv</span><span class="WHIT">
+<span class='line'>980</span> </span><span class="WHIT">    </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">userLabelsDiv</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">userLabelsDiv</span><span class="WHIT"> </span><span class="KEYW">instanceof</span><span class="WHIT"> </span><span class="NAME">String</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>981</span> </span><span class="WHIT">    </span><span class="NAME">this.user_attrs_</span><span class="PUNC">[</span><span class="STRN">"labelsDiv"</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.getElementById</span><span class="PUNC">(</span><span class="NAME">userLabelsDiv</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>982</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>983</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labelsDiv"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>984</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">divWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'labelsDivWidth'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>985</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">messagestyle</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>986</span> </span><span class="WHIT">      </span><span class="STRN">"position"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"absolute"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>987</span> </span><span class="WHIT">      </span><span class="STRN">"fontSize"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"14px"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>988</span> </span><span class="WHIT">      </span><span class="STRN">"zIndex"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>989</span> </span><span class="WHIT">      </span><span class="STRN">"width"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">divWidth</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>990</span> </span><span class="WHIT">      </span><span class="STRN">"top"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"0px"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>991</span> </span><span class="WHIT">      </span><span class="STRN">"left"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.width_</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">divWidth</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>992</span> </span><span class="WHIT">      </span><span class="STRN">"background"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"white"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>993</span> </span><span class="WHIT">      </span><span class="STRN">"textAlign"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"left"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>994</span> </span><span class="WHIT">      </span><span class="STRN">"overflow"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"hidden"</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>995</span> </span><span class="WHIT">    </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">messagestyle</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'labelsDivStyles'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>996</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">div</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"div"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>997</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">messagestyle</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>998</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">messagestyle.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>999</span> </span><span class="WHIT">        </span><span class="NAME">div.style</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">messagestyle</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1000</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1001</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1002</span> </span><span class="WHIT">    </span><span class="NAME">this.graphDiv.appendChild</span><span class="PUNC">(</span><span class="NAME">div</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1003</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.labelsDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">div</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1004</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1005</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1006</span> 
+<span class='line'>1007</span> </span><span class="COMM">/**
+<span class='line'>1008</span>  * Position the labels div so that:
+<span class='line'>1009</span>  * - its right edge is flush with the right edge of the charting area
+<span class='line'>1010</span>  * - its top edge is flush with the top edge of the charting area
+<span class='line'>1011</span>  * @private
+<span class='line'>1012</span>  */</span><span class="WHIT">
+<span class='line'>1013</span> </span><span class="NAME">Dygraph.prototype.positionLabelsDiv_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1014</span> </span><span class="WHIT">  </span><span class="COMM">// Don't touch a user-specified labelsDiv.</span><span class="WHIT">
+<span class='line'>1015</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.user_attrs_.hasOwnProperty</span><span class="PUNC">(</span><span class="STRN">"labelsDiv"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1016</span> 
+<span class='line'>1017</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">area</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.plotter_.area</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1018</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">div</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labelsDiv"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1019</span> </span><span class="WHIT">  </span><span class="NAME">div.style.left</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">area.x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">area.w</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labelsDivWidth"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1020</span> </span><span class="WHIT">  </span><span class="NAME">div.style.top</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">area.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1021</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1022</span> 
+<span class='line'>1023</span> </span><span class="COMM">/**
+<span class='line'>1024</span>  * Create the text box to adjust the averaging period
+<span class='line'>1025</span>  * @private
+<span class='line'>1026</span>  */</span><span class="WHIT">
+<span class='line'>1027</span> </span><span class="NAME">Dygraph.prototype.createRollInterface_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1028</span> </span><span class="WHIT">  </span><span class="COMM">// Create a roller if one doesn't exist already.</span><span class="WHIT">
+<span class='line'>1029</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.roller_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1030</span> </span><span class="WHIT">    </span><span class="NAME">this.roller_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"input"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1031</span> </span><span class="WHIT">    </span><span class="NAME">this.roller_.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"text"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1032</span> </span><span class="WHIT">    </span><span class="NAME">this.roller_.style.display</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"none"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1033</span> </span><span class="WHIT">    </span><span class="NAME">this.graphDiv.appendChild</span><span class="PUNC">(</span><span class="NAME">this.roller_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1034</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1035</span> 
+<span class='line'>1036</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">display</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'showRoller'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'block'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">'none'</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1037</span> 
+<span class='line'>1038</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">area</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.plotter_.area</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1039</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">textAttr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="STRN">"position"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"absolute"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1040</span> </span><span class="WHIT">                   </span><span class="STRN">"zIndex"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1041</span> </span><span class="WHIT">                   </span><span class="STRN">"top"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">area.y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">area.h</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">25</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1042</span> </span><span class="WHIT">                   </span><span class="STRN">"left"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">area.x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1043</span> </span><span class="WHIT">                   </span><span class="STRN">"display"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">display</span><span class="WHIT">
+<span class='line'>1044</span> </span><span class="WHIT">                  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1045</span> </span><span class="WHIT">  </span><span class="NAME">this.roller_.size</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"2"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1046</span> </span><span class="WHIT">  </span><span class="NAME">this.roller_.value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.rollPeriod_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1047</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">name</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">textAttr</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1048</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">textAttr.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1049</span> </span><span class="WHIT">      </span><span class="NAME">this.roller_.style</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">textAttr</span><span class="PUNC">[</span><span class="NAME">name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1050</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1051</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1052</span> 
+<span class='line'>1053</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dygraph</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1054</span> </span><span class="WHIT">  </span><span class="NAME">this.roller_.onchange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">dygraph.adjustRoll</span><span class="PUNC">(</span><span class="NAME">dygraph.roller_.value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1055</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1056</span> 
+<span class='line'>1057</span> </span><span class="COMM">/**
+<span class='line'>1058</span>  * @private
+<span class='line'>1059</span>  * Returns the x-coordinate of the event in a coordinate system where the
+<span class='line'>1060</span>  * top-left corner of the page (not the window) is (0,0).
+<span class='line'>1061</span>  * Taken from MochiKit.Signal
+<span class='line'>1062</span>  */</span><span class="WHIT">
+<span class='line'>1063</span> </span><span class="NAME">Dygraph.pageX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1064</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.pageX</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1065</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">e.pageX</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">e.pageX</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">e.pageX</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1066</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1067</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">de</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1068</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.body</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1069</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">e.clientX</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>1070</span> </span><span class="WHIT">        </span><span class="PUNC">(</span><span class="NAME">de.scrollLeft</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">b.scrollLeft</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT">
+<span class='line'>1071</span> </span><span class="WHIT">        </span><span class="PUNC">(</span><span class="NAME">de.clientLeft</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1072</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1073</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1074</span> 
+<span class='line'>1075</span> </span><span class="COMM">/**
+<span class='line'>1076</span>  * @private
+<span class='line'>1077</span>  * Returns the y-coordinate of the event in a coordinate system where the
+<span class='line'>1078</span>  * top-left corner of the page (not the window) is (0,0).
+<span class='line'>1079</span>  * Taken from MochiKit.Signal
+<span class='line'>1080</span>  */</span><span class="WHIT">
+<span class='line'>1081</span> </span><span class="NAME">Dygraph.pageY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1082</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">e.pageY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1083</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">e.pageY</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">e.pageY</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">e.pageY</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1084</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1085</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">de</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1086</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">b</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.body</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1087</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">e.clientY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>1088</span> </span><span class="WHIT">        </span><span class="PUNC">(</span><span class="NAME">de.scrollTop</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">b.scrollTop</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT">
+<span class='line'>1089</span> </span><span class="WHIT">        </span><span class="PUNC">(</span><span class="NAME">de.clientTop</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1090</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1091</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1092</span> 
+<span class='line'>1093</span> </span><span class="COMM">/**
+<span class='line'>1094</span>  * @private
+<span class='line'>1095</span>  * Converts page the x-coordinate of the event to pixel x-coordinates on the
+<span class='line'>1096</span>  * canvas (i.e. DOM Coords).
+<span class='line'>1097</span>  */</span><span class="WHIT">
+<span class='line'>1098</span> </span><span class="NAME">Dygraph.prototype.dragGetX_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1099</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Dygraph.pageX</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">context.px</span><span class="WHIT">
+<span class='line'>1100</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1101</span> 
+<span class='line'>1102</span> </span><span class="COMM">/**
+<span class='line'>1103</span>  * @private
+<span class='line'>1104</span>  * Converts page the y-coordinate of the event to pixel y-coordinates on the
+<span class='line'>1105</span>  * canvas (i.e. DOM Coords).
+<span class='line'>1106</span>  */</span><span class="WHIT">
+<span class='line'>1107</span> </span><span class="NAME">Dygraph.prototype.dragGetY_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1108</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Dygraph.pageY</span><span class="PUNC">(</span><span class="NAME">e</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">context.py</span><span class="WHIT">
+<span class='line'>1109</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1110</span> 
+<span class='line'>1111</span> </span><span class="COMM">/**
+<span class='line'>1112</span>  * Called in response to an interaction model operation that
+<span class='line'>1113</span>  * should start the default panning behavior.
+<span class='line'>1114</span>  *
+<span class='line'>1115</span>  * It's used in the default callback for "mousedown" operations.
+<span class='line'>1116</span>  * Custom interaction model builders can use it to provide the default
+<span class='line'>1117</span>  * panning behavior.
+<span class='line'>1118</span>  *
+<span class='line'>1119</span>  * @param { Event } event the event object which led to the startPan call.
+<span class='line'>1120</span>  * @param { Dygraph} g The dygraph on which to act.
+<span class='line'>1121</span>  * @param { Object} context The dragging context object (with
+<span class='line'>1122</span>  * dragStartX/dragStartY/etc. properties). This function modifies the context.
+<span class='line'>1123</span>  */</span><span class="WHIT">
+<span class='line'>1124</span> </span><span class="NAME">Dygraph.startPan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1125</span> </span><span class="WHIT">  </span><span class="NAME">context.isPanning</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1126</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.xAxisRange</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1127</span> </span><span class="WHIT">  </span><span class="NAME">context.dateRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1128</span> </span><span class="WHIT">  </span><span class="NAME">context.initialLeftmostDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1129</span> </span><span class="WHIT">  </span><span class="NAME">context.xUnitsPerPixel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">context.dateRange</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">g.plotter_.area.w</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1130</span> 
+<span class='line'>1131</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">g.attr_</span><span class="PUNC">(</span><span class="STRN">"panEdgeFraction"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1132</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxXPixelsToDraw</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.width_</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">g.attr_</span><span class="PUNC">(</span><span class="STRN">"panEdgeFraction"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1133</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xExtremes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.xAxisExtremes</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// I REALLY WANT TO CALL THIS xTremes!</span><span class="WHIT">
+<span class='line'>1134</span> 
+<span class='line'>1135</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">boundedLeftX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.toDomXCoord</span><span class="PUNC">(</span><span class="NAME">xExtremes</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">maxXPixelsToDraw</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1136</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">boundedRightX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.toDomXCoord</span><span class="PUNC">(</span><span class="NAME">xExtremes</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">maxXPixelsToDraw</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1137</span> 
+<span class='line'>1138</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">boundedLeftDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.toDataXCoord</span><span class="PUNC">(</span><span class="NAME">boundedLeftX</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1139</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">boundedRightDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.toDataXCoord</span><span class="PUNC">(</span><span class="NAME">boundedRightX</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1140</span> </span><span class="WHIT">    </span><span class="NAME">context.boundedDates</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">boundedLeftDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">boundedRightDate</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1141</span> 
+<span class='line'>1142</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">boundedValues</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1143</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxYPixelsToDraw</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.height_</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">g.attr_</span><span class="PUNC">(</span><span class="STRN">"panEdgeFraction"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1144</span> 
+<span class='line'>1145</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">g.axes_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1146</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.axes_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1147</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">yExtremes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">axis.extremeRange</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1148</span> 
+<span class='line'>1149</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">boundedTopY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.toDomYCoord</span><span class="PUNC">(</span><span class="NAME">yExtremes</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">maxYPixelsToDraw</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1150</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">boundedBottomY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.toDomYCoord</span><span class="PUNC">(</span><span class="NAME">yExtremes</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">maxYPixelsToDraw</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1151</span> 
+<span class='line'>1152</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">boundedTopValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.toDataYCoord</span><span class="PUNC">(</span><span class="NAME">boundedTopY</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1153</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">boundedBottomValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.toDataYCoord</span><span class="PUNC">(</span><span class="NAME">boundedBottomY</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1154</span> 
+<span class='line'>1155</span> </span><span class="WHIT">      </span><span class="NAME">boundedValues</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">boundedTopValue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">boundedBottomValue</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1156</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1157</span> </span><span class="WHIT">    </span><span class="NAME">context.boundedValues</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">boundedValues</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1158</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1159</span> 
+<span class='line'>1160</span> </span><span class="WHIT">  </span><span class="COMM">// Record the range of each y-axis at the start of the drag.</span><span class="WHIT">
+<span class='line'>1161</span> </span><span class="WHIT">  </span><span class="COMM">// If any axis has a valueRange or valueWindow, then we want a 2D pan.</span><span class="WHIT">
+<span class='line'>1162</span> </span><span class="WHIT">  </span><span class="NAME">context.is2DPan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1163</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">g.axes_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1164</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.axes_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1165</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">yRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.yAxisRange</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1166</span> </span><span class="WHIT">    </span><span class="COMM">// TODO(konigsberg): These values should be in |context|.</span><span class="WHIT">
+<span class='line'>1167</span> </span><span class="WHIT">    </span><span class="COMM">// In log scale, initialTopValue, dragValueRange and unitsPerPixel are log scale.</span><span class="WHIT">
+<span class='line'>1168</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis.logscale</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1169</span> </span><span class="WHIT">      </span><span class="NAME">axis.initialTopValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.log10</span><span class="PUNC">(</span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1170</span> </span><span class="WHIT">      </span><span class="NAME">axis.dragValueRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.log10</span><span class="PUNC">(</span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">Dygraph.log10</span><span class="PUNC">(</span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1171</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1172</span> </span><span class="WHIT">      </span><span class="NAME">axis.initialTopValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1173</span> </span><span class="WHIT">      </span><span class="NAME">axis.dragValueRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">yRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1174</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1175</span> </span><span class="WHIT">    </span><span class="NAME">axis.unitsPerPixel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">axis.dragValueRange</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">g.plotter_.area.h</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1176</span> 
+<span class='line'>1177</span> </span><span class="WHIT">    </span><span class="COMM">// While calculating axes, set 2dpan.</span><span class="WHIT">
+<span class='line'>1178</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis.valueWindow</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">axis.valueRange</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">context.is2DPan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1179</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1180</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1181</span> 
+<span class='line'>1182</span> </span><span class="COMM">/**
+<span class='line'>1183</span>  * Called in response to an interaction model operation that
+<span class='line'>1184</span>  * responds to an event that pans the view.
+<span class='line'>1185</span>  *
+<span class='line'>1186</span>  * It's used in the default callback for "mousemove" operations.
+<span class='line'>1187</span>  * Custom interaction model builders can use it to provide the default
+<span class='line'>1188</span>  * panning behavior.
+<span class='line'>1189</span>  *
+<span class='line'>1190</span>  * @param { Event } event the event object which led to the movePan call.
+<span class='line'>1191</span>  * @param { Dygraph} g The dygraph on which to act.
+<span class='line'>1192</span>  * @param { Object} context The dragging context object (with
+<span class='line'>1193</span>  * dragStartX/dragStartY/etc. properties). This function modifies the context.
+<span class='line'>1194</span>  */</span><span class="WHIT">
+<span class='line'>1195</span> </span><span class="NAME">Dygraph.movePan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1196</span> </span><span class="WHIT">  </span><span class="NAME">context.dragEndX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.dragGetX_</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1197</span> </span><span class="WHIT">  </span><span class="NAME">context.dragEndY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.dragGetY_</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1198</span> 
+<span class='line'>1199</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">context.initialLeftmostDate</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT">
+<span class='line'>1200</span> </span><span class="WHIT">    </span><span class="PUNC">(</span><span class="NAME">context.dragEndX</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">context.dragStartX</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">context.xUnitsPerPixel</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1201</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">context.boundedDates</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1202</span> </span><span class="WHIT">    </span><span class="NAME">minDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.max</span><span class="PUNC">(</span><span class="NAME">minDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context.boundedDates</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1203</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1204</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">minDate</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">context.dateRange</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1205</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">context.boundedDates</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1206</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">maxDate</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">context.boundedDates</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1207</span> </span><span class="WHIT">      </span><span class="COMM">// Adjust minDate, and recompute maxDate.</span><span class="WHIT">
+<span class='line'>1208</span> </span><span class="WHIT">      </span><span class="NAME">minDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">minDate</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">maxDate</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">context.boundedDates</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1209</span> </span><span class="WHIT">      </span><span class="NAME">maxDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">minDate</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">context.dateRange</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1210</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1211</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1212</span> 
+<span class='line'>1213</span> </span><span class="WHIT">  </span><span class="NAME">g.dateWindow_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">minDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxDate</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1214</span> 
+<span class='line'>1215</span> </span><span class="WHIT">  </span><span class="COMM">// y-axis scaling is automatic unless this is a full 2D pan.</span><span class="WHIT">
+<span class='line'>1216</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">context.is2DPan</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1217</span> </span><span class="WHIT">    </span><span class="COMM">// Adjust each axis appropriately.</span><span class="WHIT">
+<span class='line'>1218</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">g.axes_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1219</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.axes_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1220</span> 
+<span class='line'>1221</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pixelsDragged</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">context.dragEndY</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">context.dragStartY</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1222</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">unitsDragged</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pixelsDragged</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">axis.unitsPerPixel</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1223</span> </span><span class="WHIT"> 
+<span class='line'>1224</span>       </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">boundedValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">context.boundedValues</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">context.boundedValues</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1225</span> 
+<span class='line'>1226</span> </span><span class="WHIT">      </span><span class="COMM">// In log scale, maxValue and minValue are the logs of those values.</span><span class="WHIT">
+<span class='line'>1227</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">axis.initialTopValue</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">unitsDragged</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1228</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">boundedValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1229</span> </span><span class="WHIT">        </span><span class="NAME">maxValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.min</span><span class="PUNC">(</span><span class="NAME">maxValue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">boundedValue</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1230</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1231</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">maxValue</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">axis.dragValueRange</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1232</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">boundedValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1233</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minValue</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">boundedValue</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1234</span> </span><span class="WHIT">          </span><span class="COMM">// Adjust maxValue, and recompute minValue.</span><span class="WHIT">
+<span class='line'>1235</span> </span><span class="WHIT">          </span><span class="NAME">maxValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">maxValue</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minValue</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">boundedValue</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1236</span> </span><span class="WHIT">          </span><span class="NAME">minValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">maxValue</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">axis.dragValueRange</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1237</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1238</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1239</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis.logscale</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1240</span> </span><span class="WHIT">        </span><span class="NAME">axis.valueWindow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">Math.pow</span><span class="PUNC">(</span><span class="NAME">Dygraph.LOG_SCALE</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">minValue</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1241</span> </span><span class="WHIT">                             </span><span class="NAME">Math.pow</span><span class="PUNC">(</span><span class="NAME">Dygraph.LOG_SCALE</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxValue</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1242</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1243</span> </span><span class="WHIT">        </span><span class="NAME">axis.valueWindow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">minValue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxValue</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1244</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1245</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1246</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1247</span> 
+<span class='line'>1248</span> </span><span class="WHIT">  </span><span class="NAME">g.drawGraph_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1249</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1250</span> 
+<span class='line'>1251</span> </span><span class="COMM">/**
+<span class='line'>1252</span>  * Called in response to an interaction model operation that
+<span class='line'>1253</span>  * responds to an event that ends panning.
+<span class='line'>1254</span>  *
+<span class='line'>1255</span>  * It's used in the default callback for "mouseup" operations.
+<span class='line'>1256</span>  * Custom interaction model builders can use it to provide the default
+<span class='line'>1257</span>  * panning behavior.
+<span class='line'>1258</span>  *
+<span class='line'>1259</span>  * @param { Event } event the event object which led to the startZoom call.
+<span class='line'>1260</span>  * @param { Dygraph} g The dygraph on which to act.
+<span class='line'>1261</span>  * @param { Object} context The dragging context object (with
+<span class='line'>1262</span>  * dragStartX/dragStartY/etc. properties). This function modifies the context.
+<span class='line'>1263</span>  */</span><span class="WHIT">
+<span class='line'>1264</span> </span><span class="NAME">Dygraph.endPan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1265</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(konigsberg): Clear the context data from the axis.</span><span class="WHIT">
+<span class='line'>1266</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(konigsberg): mouseup should just delete the</span><span class="WHIT">
+<span class='line'>1267</span> </span><span class="WHIT">  </span><span class="COMM">// context object, and mousedown should create a new one.</span><span class="WHIT">
+<span class='line'>1268</span> </span><span class="WHIT">  </span><span class="NAME">context.isPanning</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1269</span> </span><span class="WHIT">  </span><span class="NAME">context.is2DPan</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1270</span> </span><span class="WHIT">  </span><span class="NAME">context.initialLeftmostDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1271</span> </span><span class="WHIT">  </span><span class="NAME">context.dateRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1272</span> </span><span class="WHIT">  </span><span class="NAME">context.valueRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1273</span> </span><span class="WHIT">  </span><span class="NAME">context.boundedDates</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1274</span> </span><span class="WHIT">  </span><span class="NAME">context.boundedValues</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1275</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1276</span> 
+<span class='line'>1277</span> </span><span class="COMM">/**
+<span class='line'>1278</span>  * Called in response to an interaction model operation that
+<span class='line'>1279</span>  * responds to an event that starts zooming.
+<span class='line'>1280</span>  *
+<span class='line'>1281</span>  * It's used in the default callback for "mousedown" operations.
+<span class='line'>1282</span>  * Custom interaction model builders can use it to provide the default
+<span class='line'>1283</span>  * zooming behavior.
+<span class='line'>1284</span>  *
+<span class='line'>1285</span>  * @param { Event } event the event object which led to the startZoom call.
+<span class='line'>1286</span>  * @param { Dygraph} g The dygraph on which to act.
+<span class='line'>1287</span>  * @param { Object} context The dragging context object (with
+<span class='line'>1288</span>  * dragStartX/dragStartY/etc. properties). This function modifies the context.
+<span class='line'>1289</span>  */</span><span class="WHIT">
+<span class='line'>1290</span> </span><span class="NAME">Dygraph.startZoom</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1291</span> </span><span class="WHIT">  </span><span class="NAME">context.isZooming</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1292</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1293</span> 
+<span class='line'>1294</span> </span><span class="COMM">/**
+<span class='line'>1295</span>  * Called in response to an interaction model operation that
+<span class='line'>1296</span>  * responds to an event that defines zoom boundaries.
+<span class='line'>1297</span>  *
+<span class='line'>1298</span>  * It's used in the default callback for "mousemove" operations.
+<span class='line'>1299</span>  * Custom interaction model builders can use it to provide the default
+<span class='line'>1300</span>  * zooming behavior.
+<span class='line'>1301</span>  *
+<span class='line'>1302</span>  * @param { Event } event the event object which led to the moveZoom call.
+<span class='line'>1303</span>  * @param { Dygraph} g The dygraph on which to act.
+<span class='line'>1304</span>  * @param { Object} context The dragging context object (with
+<span class='line'>1305</span>  * dragStartX/dragStartY/etc. properties). This function modifies the context.
+<span class='line'>1306</span>  */</span><span class="WHIT">
+<span class='line'>1307</span> </span><span class="NAME">Dygraph.moveZoom</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1308</span> </span><span class="WHIT">  </span><span class="NAME">context.dragEndX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.dragGetX_</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1309</span> </span><span class="WHIT">  </span><span class="NAME">context.dragEndY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.dragGetY_</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1310</span> 
+<span class='line'>1311</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xDelta</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">context.dragStartX</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">context.dragEndX</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1312</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">yDelta</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">context.dragStartY</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">context.dragEndY</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1313</span> 
+<span class='line'>1314</span> </span><span class="WHIT">  </span><span class="COMM">// drag direction threshold for y axis is twice as large as x axis</span><span class="WHIT">
+<span class='line'>1315</span> </span><span class="WHIT">  </span><span class="NAME">context.dragDirection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">xDelta</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">yDelta</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">Dygraph.VERTICAL</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">Dygraph.HORIZONTAL</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1316</span> 
+<span class='line'>1317</span> </span><span class="WHIT">  </span><span class="NAME">g.drawZoomRect_</span><span class="PUNC">(</span><span class="WHIT">
+<span class='line'>1318</span> </span><span class="WHIT">      </span><span class="NAME">context.dragDirection</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1319</span> </span><span class="WHIT">      </span><span class="NAME">context.dragStartX</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1320</span> </span><span class="WHIT">      </span><span class="NAME">context.dragEndX</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1321</span> </span><span class="WHIT">      </span><span class="NAME">context.dragStartY</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1322</span> </span><span class="WHIT">      </span><span class="NAME">context.dragEndY</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1323</span> </span><span class="WHIT">      </span><span class="NAME">context.prevDragDirection</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1324</span> </span><span class="WHIT">      </span><span class="NAME">context.prevEndX</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1325</span> </span><span class="WHIT">      </span><span class="NAME">context.prevEndY</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1326</span> 
+<span class='line'>1327</span> </span><span class="WHIT">  </span><span class="NAME">context.prevEndX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">context.dragEndX</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1328</span> </span><span class="WHIT">  </span><span class="NAME">context.prevEndY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">context.dragEndY</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1329</span> </span><span class="WHIT">  </span><span class="NAME">context.prevDragDirection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">context.dragDirection</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1330</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1331</span> 
+<span class='line'>1332</span> </span><span class="COMM">/**
+<span class='line'>1333</span>  * Called in response to an interaction model operation that
+<span class='line'>1334</span>  * responds to an event that performs a zoom based on previously defined
+<span class='line'>1335</span>  * bounds..
+<span class='line'>1336</span>  *
+<span class='line'>1337</span>  * It's used in the default callback for "mouseup" operations.
+<span class='line'>1338</span>  * Custom interaction model builders can use it to provide the default
+<span class='line'>1339</span>  * zooming behavior.
+<span class='line'>1340</span>  *
+<span class='line'>1341</span>  * @param { Event } event the event object which led to the endZoom call.
+<span class='line'>1342</span>  * @param { Dygraph} g The dygraph on which to end the zoom.
+<span class='line'>1343</span>  * @param { Object} context The dragging context object (with
+<span class='line'>1344</span>  * dragStartX/dragStartY/etc. properties). This function modifies the context.
+<span class='line'>1345</span>  */</span><span class="WHIT">
+<span class='line'>1346</span> </span><span class="NAME">Dygraph.endZoom</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1347</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(konigsberg): Refactor or rename this fn -- it deals with clicks, too.</span><span class="WHIT">
+<span class='line'>1348</span> </span><span class="WHIT">  </span><span class="NAME">context.isZooming</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1349</span> </span><span class="WHIT">  </span><span class="NAME">context.dragEndX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.dragGetX_</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1350</span> </span><span class="WHIT">  </span><span class="NAME">context.dragEndY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.dragGetY_</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1351</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">regionWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">context.dragEndX</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">context.dragStartX</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1352</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">regionHeight</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">context.dragEndY</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">context.dragStartY</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1353</span> 
+<span class='line'>1354</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">regionWidth</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">regionHeight</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
+<span class='line'>1355</span> </span><span class="WHIT">      </span><span class="NAME">g.lastx_</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">g.lastx_</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1356</span> </span><span class="WHIT">    </span><span class="COMM">// TODO(danvk): pass along more info about the points, e.g. 'x'</span><span class="WHIT">
+<span class='line'>1357</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">g.attr_</span><span class="PUNC">(</span><span class="STRN">'clickCallback'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1358</span> </span><span class="WHIT">      </span><span class="NAME">g.attr_</span><span class="PUNC">(</span><span class="STRN">'clickCallback'</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g.lastx_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g.selPoints_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1359</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1360</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">g.attr_</span><span class="PUNC">(</span><span class="STRN">'pointClickCallback'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1361</span> </span><span class="WHIT">      </span><span class="COMM">// check if the click was on a particular point.</span><span class="WHIT">
+<span class='line'>1362</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">closestIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1363</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">closestDistance</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1364</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">g.selPoints_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1365</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.selPoints_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1366</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">distance</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.pow</span><span class="PUNC">(</span><span class="NAME">p.canvasx</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">context.dragEndX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>1367</span> </span><span class="WHIT">                       </span><span class="NAME">Math.pow</span><span class="PUNC">(</span><span class="NAME">p.canvasy</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">context.dragEndY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1368</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">closestIdx</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">distance</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">closestDistance</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1369</span> </span><span class="WHIT">          </span><span class="NAME">closestDistance</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">distance</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1370</span> </span><span class="WHIT">          </span><span class="NAME">closestIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1371</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1372</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1373</span> 
+<span class='line'>1374</span> </span><span class="WHIT">      </span><span class="COMM">// Allow any click within two pixels of the dot.</span><span class="WHIT">
+<span class='line'>1375</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">radius</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.attr_</span><span class="PUNC">(</span><span class="STRN">'highlightCircleSize'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1376</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">closestDistance</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1377</span> </span><span class="WHIT">        </span><span class="NAME">g.attr_</span><span class="PUNC">(</span><span class="STRN">'pointClickCallback'</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g.selPoints_</span><span class="PUNC">[</span><span class="NAME">closestIdx</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1378</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1379</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1380</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1381</span> 
+<span class='line'>1382</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">regionWidth</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">context.dragDirection</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.HORIZONTAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1383</span> </span><span class="WHIT">    </span><span class="NAME">g.doZoomX_</span><span class="PUNC">(</span><span class="NAME">Math.min</span><span class="PUNC">(</span><span class="NAME">context.dragStartX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context.dragEndX</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1384</span> </span><span class="WHIT">               </span><span class="NAME">Math.max</span><span class="PUNC">(</span><span class="NAME">context.dragStartX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context.dragEndX</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1385</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">regionHeight</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">context.dragDirection</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.VERTICAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1386</span> </span><span class="WHIT">    </span><span class="NAME">g.doZoomY_</span><span class="PUNC">(</span><span class="NAME">Math.min</span><span class="PUNC">(</span><span class="NAME">context.dragStartY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context.dragEndY</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1387</span> </span><span class="WHIT">               </span><span class="NAME">Math.max</span><span class="PUNC">(</span><span class="NAME">context.dragStartY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context.dragEndY</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1388</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1389</span> </span><span class="WHIT">    </span><span class="NAME">g.canvas_ctx_.clearRect</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g.canvas_.width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g.canvas_.height</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1390</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1391</span> </span><span class="WHIT">  </span><span class="NAME">context.dragStartX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1392</span> </span><span class="WHIT">  </span><span class="NAME">context.dragStartY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1393</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1394</span> 
+<span class='line'>1395</span> </span><span class="COMM">/**
+<span class='line'>1396</span>  * Default interation model for dygraphs. You can refer to specific elements of
+<span class='line'>1397</span>  * this when constructing your own interaction model, e.g.:
+<span class='line'>1398</span>  * g.updateOptions( {
+<span class='line'>1399</span>  *   interactionModel: {
+<span class='line'>1400</span>  *     mousedown: Dygraph.defaultInteractionModel.mousedown
+<span class='line'>1401</span>  *   }
+<span class='line'>1402</span>  * } );
+<span class='line'>1403</span>  */</span><span class="WHIT">
+<span class='line'>1404</span> </span><span class="NAME">Dygraph.defaultInteractionModel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1405</span> </span><span class="WHIT">  </span><span class="COMM">// Track the beginning of drag events</span><span class="WHIT">
+<span class='line'>1406</span> </span><span class="WHIT">  </span><span class="NAME">mousedown</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1407</span> </span><span class="WHIT">    </span><span class="NAME">context.initializeMouseDown</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1408</span> 
+<span class='line'>1409</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">event.altKey</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">event.shiftKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1410</span> </span><span class="WHIT">      </span><span class="NAME">Dygraph.startPan</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1411</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1412</span> </span><span class="WHIT">      </span><span class="NAME">Dygraph.startZoom</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1413</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1414</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1415</span> 
+<span class='line'>1416</span> </span><span class="WHIT">  </span><span class="COMM">// Draw zoom rectangles when the mouse is down and the user moves around</span><span class="WHIT">
+<span class='line'>1417</span> </span><span class="WHIT">  </span><span class="NAME">mousemove</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1418</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">context.isZooming</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1419</span> </span><span class="WHIT">      </span><span class="NAME">Dygraph.moveZoom</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1420</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">context.isPanning</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1421</span> </span><span class="WHIT">      </span><span class="NAME">Dygraph.movePan</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1422</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1423</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1424</span> 
+<span class='line'>1425</span> </span><span class="WHIT">  </span><span class="NAME">mouseup</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1426</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">context.isZooming</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1427</span> </span><span class="WHIT">      </span><span class="NAME">Dygraph.endZoom</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1428</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">context.isPanning</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1429</span> </span><span class="WHIT">      </span><span class="NAME">Dygraph.endPan</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1430</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1431</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1432</span> 
+<span class='line'>1433</span> </span><span class="WHIT">  </span><span class="COMM">// Temporarily cancel the dragging event when the mouse leaves the graph</span><span class="WHIT">
+<span class='line'>1434</span> </span><span class="WHIT">  </span><span class="NAME">mouseout</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1435</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">context.isZooming</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1436</span> </span><span class="WHIT">      </span><span class="NAME">context.dragEndX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1437</span> </span><span class="WHIT">      </span><span class="NAME">context.dragEndY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1438</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1439</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1440</span> 
+<span class='line'>1441</span> </span><span class="WHIT">  </span><span class="COMM">// Disable zooming out if panning.</span><span class="WHIT">
+<span class='line'>1442</span> </span><span class="WHIT">  </span><span class="NAME">dblclick</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1443</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">event.altKey</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">event.shiftKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1444</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1445</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1446</span> </span><span class="WHIT">    </span><span class="COMM">// TODO(konigsberg): replace g.doUnzoom()_ with something that is</span><span class="WHIT">
+<span class='line'>1447</span> </span><span class="WHIT">    </span><span class="COMM">// friendlier to public use.</span><span class="WHIT">
+<span class='line'>1448</span> </span><span class="WHIT">    </span><span class="NAME">g.doUnzoom_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1449</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1450</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1451</span> 
+<span class='line'>1452</span> </span><span class="NAME">Dygraph.DEFAULT_ATTRS.interactionModel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.defaultInteractionModel</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1453</span> 
+<span class='line'>1454</span> </span><span class="COMM">/**
+<span class='line'>1455</span>  * Set up all the mouse handlers needed to capture dragging behavior for zoom
+<span class='line'>1456</span>  * events.
+<span class='line'>1457</span>  * @private
+<span class='line'>1458</span>  */</span><span class="WHIT">
+<span class='line'>1459</span> </span><span class="NAME">Dygraph.prototype.createDragInterface_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1460</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">context</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1461</span> </span><span class="WHIT">    </span><span class="COMM">// Tracks whether the mouse is down right now</span><span class="WHIT">
+<span class='line'>1462</span> </span><span class="WHIT">    </span><span class="NAME">isZooming</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1463</span> </span><span class="WHIT">    </span><span class="NAME">isPanning</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">  </span><span class="COMM">// is this drag part of a pan?</span><span class="WHIT">
+<span class='line'>1464</span> </span><span class="WHIT">    </span><span class="NAME">is2DPan</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">,</span><span class="WHIT">    </span><span class="COMM">// if so, is that pan 1- or 2-dimensional?</span><span class="WHIT">
+<span class='line'>1465</span> </span><span class="WHIT">    </span><span class="NAME">dragStartX</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1466</span> </span><span class="WHIT">    </span><span class="NAME">dragStartY</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1467</span> </span><span class="WHIT">    </span><span class="NAME">dragEndX</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1468</span> </span><span class="WHIT">    </span><span class="NAME">dragEndY</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1469</span> </span><span class="WHIT">    </span><span class="NAME">dragDirection</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1470</span> </span><span class="WHIT">    </span><span class="NAME">prevEndX</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1471</span> </span><span class="WHIT">    </span><span class="NAME">prevEndY</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1472</span> </span><span class="WHIT">    </span><span class="NAME">prevDragDirection</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1473</span> 
+<span class='line'>1474</span> </span><span class="WHIT">    </span><span class="COMM">// The value on the left side of the graph when a pan operation starts.</span><span class="WHIT">
+<span class='line'>1475</span> </span><span class="WHIT">    </span><span class="NAME">initialLeftmostDate</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1476</span> 
+<span class='line'>1477</span> </span><span class="WHIT">    </span><span class="COMM">// The number of units each pixel spans. (This won't be valid for log</span><span class="WHIT">
+<span class='line'>1478</span> </span><span class="WHIT">    </span><span class="COMM">// scales)</span><span class="WHIT">
+<span class='line'>1479</span> </span><span class="WHIT">    </span><span class="NAME">xUnitsPerPixel</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1480</span> 
+<span class='line'>1481</span> </span><span class="WHIT">    </span><span class="COMM">// TODO(danvk): update this comment</span><span class="WHIT">
+<span class='line'>1482</span> </span><span class="WHIT">    </span><span class="COMM">// The range in second/value units that the viewport encompasses during a</span><span class="WHIT">
+<span class='line'>1483</span> </span><span class="WHIT">    </span><span class="COMM">// panning operation.</span><span class="WHIT">
+<span class='line'>1484</span> </span><span class="WHIT">    </span><span class="NAME">dateRange</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1485</span> 
+<span class='line'>1486</span> </span><span class="WHIT">    </span><span class="COMM">// Utility function to convert page-wide coordinates to canvas coords</span><span class="WHIT">
+<span class='line'>1487</span> </span><span class="WHIT">    </span><span class="NAME">px</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1488</span> </span><span class="WHIT">    </span><span class="NAME">py</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1489</span> 
+<span class='line'>1490</span> </span><span class="WHIT">    </span><span class="COMM">// Values for use with panEdgeFraction, which limit how far outside the</span><span class="WHIT">
+<span class='line'>1491</span> </span><span class="WHIT">    </span><span class="COMM">// graph's data boundaries it can be panned.</span><span class="WHIT">
+<span class='line'>1492</span> </span><span class="WHIT">    </span><span class="NAME">boundedDates</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// [minDate, maxDate]</span><span class="WHIT">
+<span class='line'>1493</span> </span><span class="WHIT">    </span><span class="NAME">boundedValues</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="COMM">// [[minValue, maxValue] ...]</span><span class="WHIT">
+<span class='line'>1494</span> 
+<span class='line'>1495</span> </span><span class="WHIT">    </span><span class="NAME">initializeMouseDown</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1496</span> </span><span class="WHIT">      </span><span class="COMM">// prevents mouse drags from selecting page text.</span><span class="WHIT">
+<span class='line'>1497</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">event.preventDefault</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1498</span> </span><span class="WHIT">        </span><span class="NAME">event.preventDefault</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// Firefox, Chrome, etc.</span><span class="WHIT">
+<span class='line'>1499</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1500</span> </span><span class="WHIT">        </span><span class="NAME">event.returnValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// IE</span><span class="WHIT">
+<span class='line'>1501</span> </span><span class="WHIT">        </span><span class="NAME">event.cancelBubble</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1502</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1503</span> 
+<span class='line'>1504</span> </span><span class="WHIT">      </span><span class="NAME">context.px</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.findPosX</span><span class="PUNC">(</span><span class="NAME">g.canvas_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1505</span> </span><span class="WHIT">      </span><span class="NAME">context.py</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.findPosY</span><span class="PUNC">(</span><span class="NAME">g.canvas_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1506</span> </span><span class="WHIT">      </span><span class="NAME">context.dragStartX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.dragGetX_</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1507</span> </span><span class="WHIT">      </span><span class="NAME">context.dragStartY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.dragGetY_</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1508</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1509</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1510</span> 
+<span class='line'>1511</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">interactionModel</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"interactionModel"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1512</span> 
+<span class='line'>1513</span> </span><span class="WHIT">  </span><span class="COMM">// Self is the graph.</span><span class="WHIT">
+<span class='line'>1514</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">self</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1515</span> 
+<span class='line'>1516</span> </span><span class="WHIT">  </span><span class="COMM">// Function that binds the graph and context to the handler.</span><span class="WHIT">
+<span class='line'>1517</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bindHandler</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">handler</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1518</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1519</span> </span><span class="WHIT">      </span><span class="NAME">handler</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">context</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1520</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1521</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1522</span> 
+<span class='line'>1523</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">interactionModel</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1524</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">interactionModel.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">eventName</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1525</span> </span><span class="WHIT">    </span><span class="NAME">Dygraph.addEvent</span><span class="PUNC">(</span><span class="NAME">this.mouseEventElement_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">eventName</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1526</span> </span><span class="WHIT">        </span><span class="NAME">bindHandler</span><span class="PUNC">(</span><span class="NAME">interactionModel</span><span class="PUNC">[</span><span class="NAME">eventName</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1527</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1528</span> 
+<span class='line'>1529</span> </span><span class="WHIT">  </span><span class="COMM">// If the user releases the mouse button during a drag, but not over the</span><span class="WHIT">
+<span class='line'>1530</span> </span><span class="WHIT">  </span><span class="COMM">// canvas, then it doesn't count as a zooming action.</span><span class="WHIT">
+<span class='line'>1531</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.addEvent</span><span class="PUNC">(</span><span class="NAME">document</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'mouseup'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1532</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">context.isZooming</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">context.isPanning</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1533</span> </span><span class="WHIT">      </span><span class="NAME">context.isZooming</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1534</span> </span><span class="WHIT">      </span><span class="NAME">context.dragStartX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1535</span> </span><span class="WHIT">      </span><span class="NAME">context.dragStartY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1536</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1537</span> 
+<span class='line'>1538</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">context.isPanning</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1539</span> </span><span class="WHIT">      </span><span class="NAME">context.isPanning</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1540</span> </span><span class="WHIT">      </span><span class="NAME">context.draggingDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1541</span> </span><span class="WHIT">      </span><span class="NAME">context.dateRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1542</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">self.axes_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1543</span> </span><span class="WHIT">        </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">self.axes_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">draggingValue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1544</span> </span><span class="WHIT">        </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">self.axes_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">dragValueRange</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1545</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1546</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1547</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1548</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1549</span> 
+<span class='line'>1550</span> 
+<span class='line'>1551</span> </span><span class="COMM">/**
+<span class='line'>1552</span>  * Draw a gray zoom rectangle over the desired area of the canvas. Also clears
+<span class='line'>1553</span>  * up any previous zoom rectangles that were drawn. This could be optimized to
+<span class='line'>1554</span>  * avoid extra redrawing, but it's tricky to avoid interactions with the status
+<span class='line'>1555</span>  * dots.
+<span class='line'>1556</span>  * 
+<span class='line'>1557</span>  * @param {Number} direction the direction of the zoom rectangle. Acceptable
+<span class='line'>1558</span>  * values are Dygraph.HORIZONTAL and Dygraph.VERTICAL.
+<span class='line'>1559</span>  * @param {Number} startX The X position where the drag started, in canvas
+<span class='line'>1560</span>  * coordinates.
+<span class='line'>1561</span>  * @param {Number} endX The current X position of the drag, in canvas coords.
+<span class='line'>1562</span>  * @param {Number} startY The Y position where the drag started, in canvas
+<span class='line'>1563</span>  * coordinates.
+<span class='line'>1564</span>  * @param {Number} endY The current Y position of the drag, in canvas coords.
+<span class='line'>1565</span>  * @param {Number} prevDirection the value of direction on the previous call to
+<span class='line'>1566</span>  * this function. Used to avoid excess redrawing
+<span class='line'>1567</span>  * @param {Number} prevEndX The value of endX on the previous call to this
+<span class='line'>1568</span>  * function. Used to avoid excess redrawing
+<span class='line'>1569</span>  * @param {Number} prevEndY The value of endY on the previous call to this
+<span class='line'>1570</span>  * function. Used to avoid excess redrawing
+<span class='line'>1571</span>  * @private
+<span class='line'>1572</span>  */</span><span class="WHIT">
+<span class='line'>1573</span> </span><span class="NAME">Dygraph.prototype.drawZoomRect_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">direction</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">startX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">endX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">startY</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1574</span> </span><span class="WHIT">                                           </span><span class="NAME">endY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">prevDirection</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">prevEndX</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1575</span> </span><span class="WHIT">                                           </span><span class="NAME">prevEndY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1576</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ctx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.canvas_ctx_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1577</span> 
+<span class='line'>1578</span> </span><span class="WHIT">  </span><span class="COMM">// Clean up from the previous rect if necessary</span><span class="WHIT">
+<span class='line'>1579</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">prevDirection</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.HORIZONTAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1580</span> </span><span class="WHIT">    </span><span class="NAME">ctx.clearRect</span><span class="PUNC">(</span><span class="NAME">Math.min</span><span class="PUNC">(</span><span class="NAME">startX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">prevEndX</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1581</span> </span><span class="WHIT">                  </span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">startX</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">prevEndX</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.height_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1582</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">prevDirection</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.VERTICAL</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1583</span> </span><span class="WHIT">    </span><span class="NAME">ctx.clearRect</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Math.min</span><span class="PUNC">(</span><span class="NAME">startY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">prevEndY</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1584</span> </span><span class="WHIT">                  </span><span class="NAME">this.width_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">startY</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">prevEndY</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1585</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1586</span> 
+<span class='line'>1587</span> </span><span class="WHIT">  </span><span class="COMM">// Draw a light-grey rectangle to show the new viewing area</span><span class="WHIT">
+<span class='line'>1588</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">direction</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.HORIZONTAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1589</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">endX</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">startX</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1590</span> </span><span class="WHIT">      </span><span class="NAME">ctx.fillStyle</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"rgba(128,128,128,0.33)"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1591</span> </span><span class="WHIT">      </span><span class="NAME">ctx.fillRect</span><span class="PUNC">(</span><span class="NAME">Math.min</span><span class="PUNC">(</span><span class="NAME">startX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">endX</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1592</span> </span><span class="WHIT">                   </span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">endX</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">startX</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.height_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1593</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1594</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1595</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">direction</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.VERTICAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1596</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">endY</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">startY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1597</span> </span><span class="WHIT">      </span><span class="NAME">ctx.fillStyle</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"rgba(128,128,128,0.33)"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1598</span> </span><span class="WHIT">      </span><span class="NAME">ctx.fillRect</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Math.min</span><span class="PUNC">(</span><span class="NAME">startY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">endY</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1599</span> </span><span class="WHIT">                   </span><span class="NAME">this.width_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">endY</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">startY</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1600</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1601</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1602</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1603</span> 
+<span class='line'>1604</span> </span><span class="COMM">/**
+<span class='line'>1605</span>  * Zoom to something containing [lowX, highX]. These are pixel coordinates in
+<span class='line'>1606</span>  * the canvas. The exact zoom window may be slightly larger if there are no data
+<span class='line'>1607</span>  * points near lowX or highX. Don't confuse this function with doZoomXDates,
+<span class='line'>1608</span>  * which accepts dates that match the raw data. This function redraws the graph.
+<span class='line'>1609</span>  *
+<span class='line'>1610</span>  * @param {Number} lowX The leftmost pixel value that should be visible.
+<span class='line'>1611</span>  * @param {Number} highX The rightmost pixel value that should be visible.
+<span class='line'>1612</span>  * @private
+<span class='line'>1613</span>  */</span><span class="WHIT">
+<span class='line'>1614</span> </span><span class="NAME">Dygraph.prototype.doZoomX_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">lowX</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">highX</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1615</span> </span><span class="WHIT">  </span><span class="COMM">// Find the earliest and latest dates contained in this canvasx range.</span><span class="WHIT">
+<span class='line'>1616</span> </span><span class="WHIT">  </span><span class="COMM">// Convert the call to date ranges of the raw data.</span><span class="WHIT">
+<span class='line'>1617</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.toDataXCoord</span><span class="PUNC">(</span><span class="NAME">lowX</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1618</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.toDataXCoord</span><span class="PUNC">(</span><span class="NAME">highX</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1619</span> </span><span class="WHIT">  </span><span class="NAME">this.doZoomXDates_</span><span class="PUNC">(</span><span class="NAME">minDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxDate</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1620</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1621</span> 
+<span class='line'>1622</span> </span><span class="COMM">/**
+<span class='line'>1623</span>  * Zoom to something containing [minDate, maxDate] values. Don't confuse this
+<span class='line'>1624</span>  * method with doZoomX which accepts pixel coordinates. This function redraws
+<span class='line'>1625</span>  * the graph.
+<span class='line'>1626</span>  *
+<span class='line'>1627</span>  * @param {Number} minDate The minimum date that should be visible.
+<span class='line'>1628</span>  * @param {Number} maxDate The maximum date that should be visible.
+<span class='line'>1629</span>  * @private
+<span class='line'>1630</span>  */</span><span class="WHIT">
+<span class='line'>1631</span> </span><span class="NAME">Dygraph.prototype.doZoomXDates_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">minDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxDate</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1632</span> </span><span class="WHIT">  </span><span class="NAME">this.dateWindow_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">minDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxDate</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1633</span> </span><span class="WHIT">  </span><span class="NAME">this.zoomed_x_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1634</span> </span><span class="WHIT">  </span><span class="NAME">this.drawGraph_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1635</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"zoomCallback"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1636</span> </span><span class="WHIT">    </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"zoomCallback"</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">minDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.yAxisRanges</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1637</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1638</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1639</span> 
+<span class='line'>1640</span> </span><span class="COMM">/**
+<span class='line'>1641</span>  * Zoom to something containing [lowY, highY]. These are pixel coordinates in
+<span class='line'>1642</span>  * the canvas. This function redraws the graph.
+<span class='line'>1643</span>  *
+<span class='line'>1644</span>  * @param {Number} lowY The topmost pixel value that should be visible.
+<span class='line'>1645</span>  * @param {Number} highY The lowest pixel value that should be visible.
+<span class='line'>1646</span>  * @private
+<span class='line'>1647</span>  */</span><span class="WHIT">
+<span class='line'>1648</span> </span><span class="NAME">Dygraph.prototype.doZoomY_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">lowY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">highY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1649</span> </span><span class="WHIT">  </span><span class="COMM">// Find the highest and lowest values in pixel range for each axis.</span><span class="WHIT">
+<span class='line'>1650</span> </span><span class="WHIT">  </span><span class="COMM">// Note that lowY (in pixels) corresponds to the max Value (in data coords).</span><span class="WHIT">
+<span class='line'>1651</span> </span><span class="WHIT">  </span><span class="COMM">// This is because pixels increase as you go down on the screen, whereas data</span><span class="WHIT">
+<span class='line'>1652</span> </span><span class="WHIT">  </span><span class="COMM">// coordinates increase as you go up the screen.</span><span class="WHIT">
+<span class='line'>1653</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">valueRanges</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1654</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.axes_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1655</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hi</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.toDataYCoord</span><span class="PUNC">(</span><span class="NAME">lowY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1656</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.toDataYCoord</span><span class="PUNC">(</span><span class="NAME">highY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1657</span> </span><span class="WHIT">    </span><span class="NAME">this.axes_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">valueWindow</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">low</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">hi</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1658</span> </span><span class="WHIT">    </span><span class="NAME">valueRanges.push</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="NAME">low</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">hi</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1659</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1660</span> 
+<span class='line'>1661</span> </span><span class="WHIT">  </span><span class="NAME">this.zoomed_y_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1662</span> </span><span class="WHIT">  </span><span class="NAME">this.drawGraph_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1663</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"zoomCallback"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1664</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.xAxisRange</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1665</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">yRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.yAxisRange</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1666</span> </span><span class="WHIT">    </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"zoomCallback"</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">xRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.yAxisRanges</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1667</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1668</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1669</span> 
+<span class='line'>1670</span> </span><span class="COMM">/**
+<span class='line'>1671</span>  * Reset the zoom to the original view coordinates. This is the same as
+<span class='line'>1672</span>  * double-clicking on the graph.
+<span class='line'>1673</span>  *
+<span class='line'>1674</span>  * @private
+<span class='line'>1675</span>  */</span><span class="WHIT">
+<span class='line'>1676</span> </span><span class="NAME">Dygraph.prototype.doUnzoom_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1677</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dirty</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1678</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.dateWindow_</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1679</span> </span><span class="WHIT">    </span><span class="NAME">dirty</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1680</span> </span><span class="WHIT">    </span><span class="NAME">this.dateWindow_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1681</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1682</span> 
+<span class='line'>1683</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.axes_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1684</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.axes_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">valueWindow</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1685</span> </span><span class="WHIT">      </span><span class="NAME">dirty</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1686</span> </span><span class="WHIT">      </span><span class="KEYW">delete</span><span class="WHIT"> </span><span class="NAME">this.axes_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">valueWindow</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1687</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1688</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1689</span> 
+<span class='line'>1690</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dirty</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1691</span> </span><span class="WHIT">    </span><span class="COMM">// Putting the drawing operation before the callback because it resets</span><span class="WHIT">
+<span class='line'>1692</span> </span><span class="WHIT">    </span><span class="COMM">// yAxisRange.</span><span class="WHIT">
+<span class='line'>1693</span> </span><span class="WHIT">    </span><span class="NAME">this.zoomed_x_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1694</span> </span><span class="WHIT">    </span><span class="NAME">this.zoomed_y_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1695</span> </span><span class="WHIT">    </span><span class="NAME">this.drawGraph_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1696</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"zoomCallback"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1697</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.rawData_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1698</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.rawData_</span><span class="PUNC">[</span><span class="NAME">this.rawData_.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1699</span> </span><span class="WHIT">      </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"zoomCallback"</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">minDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.yAxisRanges</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1700</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1701</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1702</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1703</span> 
+<span class='line'>1704</span> </span><span class="COMM">/**
+<span class='line'>1705</span>  * When the mouse moves in the canvas, display information about a nearby data
+<span class='line'>1706</span>  * point and draw dots over those points in the data series. This function
+<span class='line'>1707</span>  * takes care of cleanup of previously-drawn dots.
+<span class='line'>1708</span>  * @param {Object} event The mousemove event from the browser.
+<span class='line'>1709</span>  * @private
+<span class='line'>1710</span>  */</span><span class="WHIT">
+<span class='line'>1711</span> </span><span class="NAME">Dygraph.prototype.mouseMove_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1712</span> </span><span class="WHIT">  </span><span class="COMM">// This prevents JS errors when mousing over the canvas before data loads.</span><span class="WHIT">
+<span class='line'>1713</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">points</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.layout_.points</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1714</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">points</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1715</span> 
+<span class='line'>1716</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">canvasx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.pageX</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">Dygraph.findPosX</span><span class="PUNC">(</span><span class="NAME">this.mouseEventElement_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1717</span> 
+<span class='line'>1718</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lastx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1719</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lasty</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1720</span> 
+<span class='line'>1721</span> </span><span class="WHIT">  </span><span class="COMM">// Loop through all the points and find the date nearest to our current</span><span class="WHIT">
+<span class='line'>1722</span> </span><span class="WHIT">  </span><span class="COMM">// location.</span><span class="WHIT">
+<span class='line'>1723</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minDist</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="NAME">e</span><span class="PUNC">+</span><span class="NUMB">100</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1724</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1725</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">points.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1726</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">point</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">points</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1727</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">point</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1728</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dist</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">point.canvasx</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">canvasx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1729</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dist</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">minDist</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1730</span> </span><span class="WHIT">    </span><span class="NAME">minDist</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dist</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1731</span> </span><span class="WHIT">    </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1732</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1733</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">lastx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">points</span><span class="PUNC">[</span><span class="NAME">idx</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">xval</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1734</span> 
+<span class='line'>1735</span> </span><span class="WHIT">  </span><span class="COMM">// Extract the points we've selected</span><span class="WHIT">
+<span class='line'>1736</span> </span><span class="WHIT">  </span><span class="NAME">this.selPoints_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1737</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">points.length</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1738</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"stackedGraph"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1739</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">l</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1740</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">points</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">xval</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">lastx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1741</span> </span><span class="WHIT">        </span><span class="NAME">this.selPoints_.push</span><span class="PUNC">(</span><span class="NAME">points</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1742</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1743</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1744</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1745</span> </span><span class="WHIT">    </span><span class="COMM">// Need to 'unstack' points starting from the bottom</span><span class="WHIT">
+<span class='line'>1746</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cumulative_sum</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1747</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">--</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1748</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">points</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">xval</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">lastx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1749</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// Clone the point since we modify it</span><span class="WHIT">
+<span class='line'>1750</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">points</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1751</span> </span><span class="WHIT">          </span><span class="NAME">p</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">points</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1752</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1753</span> </span><span class="WHIT">        </span><span class="NAME">p.yval</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cumulative_sum</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1754</span> </span><span class="WHIT">        </span><span class="NAME">cumulative_sum</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p.yval</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1755</span> </span><span class="WHIT">        </span><span class="NAME">this.selPoints_.push</span><span class="PUNC">(</span><span class="NAME">p</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1756</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1757</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1758</span> </span><span class="WHIT">    </span><span class="NAME">this.selPoints_.reverse</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1759</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1760</span> 
+<span class='line'>1761</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"highlightCallback"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1762</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">px</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.lastx_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1763</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">px</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">lastx</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">px</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1764</span> </span><span class="WHIT">      </span><span class="COMM">// only fire if the selected point has changed.</span><span class="WHIT">
+<span class='line'>1765</span> </span><span class="WHIT">      </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"highlightCallback"</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">lastx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.selPoints_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.idxToRow_</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1766</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1767</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1768</span> 
+<span class='line'>1769</span> </span><span class="WHIT">  </span><span class="COMM">// Save last x position for callbacks.</span><span class="WHIT">
+<span class='line'>1770</span> </span><span class="WHIT">  </span><span class="NAME">this.lastx_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">lastx</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1771</span> 
+<span class='line'>1772</span> </span><span class="WHIT">  </span><span class="NAME">this.updateSelection_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1773</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1774</span> 
+<span class='line'>1775</span> </span><span class="COMM">/**
+<span class='line'>1776</span>  * Transforms layout_.points index into data row number.
+<span class='line'>1777</span>  * @param int layout_.points index
+<span class='line'>1778</span>  * @return int row number, or -1 if none could be found.
+<span class='line'>1779</span>  * @private
+<span class='line'>1780</span>  */</span><span class="WHIT">
+<span class='line'>1781</span> </span><span class="NAME">Dygraph.prototype.idxToRow_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1782</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1783</span> 
+<span class='line'>1784</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">this.layout_.datasets</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1785</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.layout_.datasets</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1786</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.boundaryIds_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">+</span><span class="NAME">idx</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1787</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1788</span> </span><span class="WHIT">    </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.layout_.datasets</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1789</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1790</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1791</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1792</span> 
+<span class='line'>1793</span> </span><span class="COMM">/**
+<span class='line'>1794</span>  * @private
+<span class='line'>1795</span>  * @param { Number } x The number to consider.
+<span class='line'>1796</span>  * @return { Boolean } Whether the number is zero or NaN.
+<span class='line'>1797</span>  */</span><span class="WHIT">
+<span class='line'>1798</span> </span><span class="COMM">// TODO(danvk): rename this function to something like 'isNonZeroNan'.</span><span class="WHIT">
+<span class='line'>1799</span> </span><span class="NAME">Dygraph.isOK</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1800</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1801</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1802</span> 
+<span class='line'>1803</span> </span><span class="COMM">/**
+<span class='line'>1804</span>  * @private
+<span class='line'>1805</span>  * Generates HTML for the legend which is displayed when hovering over the
+<span class='line'>1806</span>  * chart. If no selected points are specified, a default legend is returned
+<span class='line'>1807</span>  * (this may just be the empty string).
+<span class='line'>1808</span>  * @param { Number } [x] The x-value of the selected points.
+<span class='line'>1809</span>  * @param { [Object] } [sel_points] List of selected points for the given
+<span class='line'>1810</span>  * x-value. Should have properties like 'name', 'yval' and 'canvasy'.
+<span class='line'>1811</span>  */</span><span class="WHIT">
+<span class='line'>1812</span> </span><span class="NAME">Dygraph.prototype.generateLegendHTML_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel_points</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1813</span> </span><span class="WHIT">  </span><span class="COMM">// If no points are selected, we display a default legend. Traditionally,</span><span class="WHIT">
+<span class='line'>1814</span> </span><span class="WHIT">  </span><span class="COMM">// this has been blank. But a better default would be a conventional legend,</span><span class="WHIT">
+<span class='line'>1815</span> </span><span class="WHIT">  </span><span class="COMM">// which provides essential information for a non-interactive chart.</span><span class="WHIT">
+<span class='line'>1816</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1817</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'legend'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'always'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1818</span> 
+<span class='line'>1819</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sepLines</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'labelsSeparateLines'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1820</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'labels'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1821</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">html</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1822</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">labels.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1823</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.visibility</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1824</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">c</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.plotter_.colors</span><span class="PUNC">[</span><span class="NAME">labels</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1825</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">html</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">html</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sepLines</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="STRN">'&lt;br/>'</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">' '</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1826</span> </span><span class="WHIT">      </span><span class="NAME">html</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"&lt;b>&lt;span style='color: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">c</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">";'>&mdash;"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">labels</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>1827</span> </span><span class="WHIT">        </span><span class="STRN">"&lt;/span>&lt;/b>"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1828</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1829</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">html</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1830</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1831</span> 
+<span class='line'>1832</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">html</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'xValueFormatter'</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">":"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1833</span> 
+<span class='line'>1834</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fmtFunc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'yValueFormatter'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1835</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">showZeros</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labelsShowZeroValues"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1836</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sepLines</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labelsSeparateLines"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1837</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.selPoints_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1838</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.selPoints_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1839</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">pt.yval</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">showZeros</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1840</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">Dygraph.isOK</span><span class="PUNC">(</span><span class="NAME">pt.canvasy</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1841</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sepLines</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">html</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"&lt;br/>"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1842</span> 
+<span class='line'>1843</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">c</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.plotter_.colors</span><span class="PUNC">[</span><span class="NAME">pt.name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1844</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">yval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">fmtFunc</span><span class="PUNC">(</span><span class="NAME">pt.yval</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1845</span> </span><span class="WHIT">    </span><span class="COMM">// TODO(danvk): use a template string here and make it an attribute.</span><span class="WHIT">
+<span class='line'>1846</span> </span><span class="WHIT">    </span><span class="NAME">html</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">" &lt;b>&lt;span style='color: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">c</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">";'>"</span><span class="WHIT">
+<span class='line'>1847</span> </span><span class="WHIT">      </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">pt.name</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"&lt;/span>&lt;/b>:"</span><span class="WHIT">
+<span class='line'>1848</span> </span><span class="WHIT">      </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">yval</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1849</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1850</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">html</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1851</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1852</span> 
+<span class='line'>1853</span> </span><span class="COMM">/**
+<span class='line'>1854</span>  * @private
+<span class='line'>1855</span>  * Displays information about the selected points in the legend. If there is no
+<span class='line'>1856</span>  * selection, the legend will be cleared.
+<span class='line'>1857</span>  * @param { Number } [x] The x-value of the selected points.
+<span class='line'>1858</span>  * @param { [Object] } [sel_points] List of selected points for the given
+<span class='line'>1859</span>  * x-value. Should have properties like 'name', 'yval' and 'canvasy'.
+<span class='line'>1860</span>  */</span><span class="WHIT">
+<span class='line'>1861</span> </span><span class="NAME">Dygraph.prototype.setLegendHTML_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel_points</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1862</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">html</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.generateLegendHTML_</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sel_points</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1863</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">labelsDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labelsDiv"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1864</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">labelsDiv</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1865</span> </span><span class="WHIT">    </span><span class="NAME">labelsDiv.innerHTML</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">html</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1866</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1867</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">this.shown_legend_error_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1868</span> </span><span class="WHIT">      </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">'labelsDiv is set to something nonexistent; legend will not be shown.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1869</span> </span><span class="WHIT">      </span><span class="NAME">this.shown_legend_error_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1870</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1871</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1872</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1873</span> 
+<span class='line'>1874</span> </span><span class="COMM">/**
+<span class='line'>1875</span>  * Draw dots over the selectied points in the data series. This function
+<span class='line'>1876</span>  * takes care of cleanup of previously-drawn dots.
+<span class='line'>1877</span>  * @private
+<span class='line'>1878</span>  */</span><span class="WHIT">
+<span class='line'>1879</span> </span><span class="NAME">Dygraph.prototype.updateSelection_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1880</span> </span><span class="WHIT">  </span><span class="COMM">// Clear the previously drawn vertical, if there is one</span><span class="WHIT">
+<span class='line'>1881</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ctx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.canvas_ctx_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1882</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.previousVerticalX_</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1883</span> </span><span class="WHIT">    </span><span class="COMM">// Determine the maximum highlight circle size.</span><span class="WHIT">
+<span class='line'>1884</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxCircleSize</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1885</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'labels'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1886</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">labels.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1887</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'highlightCircleSize'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">labels</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1888</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">maxCircleSize</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">maxCircleSize</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1889</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1890</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">px</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.previousVerticalX_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1891</span> </span><span class="WHIT">    </span><span class="NAME">ctx.clearRect</span><span class="PUNC">(</span><span class="NAME">px</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">maxCircleSize</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>1892</span> </span><span class="WHIT">                  </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">maxCircleSize</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.height_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1893</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1894</span> 
+<span class='line'>1895</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.selPoints_.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1896</span> </span><span class="WHIT">    </span><span class="COMM">// Set the status message to indicate the selected point(s)</span><span class="WHIT">
+<span class='line'>1897</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'showLabelsOnHighlight'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1898</span> </span><span class="WHIT">      </span><span class="NAME">this.setLegendHTML_</span><span class="PUNC">(</span><span class="NAME">this.lastx_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.selPoints_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1899</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1900</span> 
+<span class='line'>1901</span> </span><span class="WHIT">    </span><span class="COMM">// Draw colored circles over the center of each selected point</span><span class="WHIT">
+<span class='line'>1902</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">canvasx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.selPoints_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">canvasx</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1903</span> </span><span class="WHIT">    </span><span class="NAME">ctx.save</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1904</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.selPoints_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1905</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.selPoints_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1906</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">Dygraph.isOK</span><span class="PUNC">(</span><span class="NAME">pt.canvasy</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1907</span> 
+<span class='line'>1908</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">circleSize</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'highlightCircleSize'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pt.name</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1909</span> </span><span class="WHIT">      </span><span class="NAME">ctx.beginPath</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1910</span> </span><span class="WHIT">      </span><span class="NAME">ctx.fillStyle</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.plotter_.colors</span><span class="PUNC">[</span><span class="NAME">pt.name</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1911</span> </span><span class="WHIT">      </span><span class="NAME">ctx.arc</span><span class="PUNC">(</span><span class="NAME">canvasx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pt.canvasy</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">circleSize</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">Math.PI</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1912</span> </span><span class="WHIT">      </span><span class="NAME">ctx.fill</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1913</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1914</span> </span><span class="WHIT">    </span><span class="NAME">ctx.restore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1915</span> 
+<span class='line'>1916</span> </span><span class="WHIT">    </span><span class="NAME">this.previousVerticalX_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">canvasx</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1917</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1918</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1919</span> 
+<span class='line'>1920</span> </span><span class="COMM">/**
+<span class='line'>1921</span>  * Manually set the selected points and display information about them in the
+<span class='line'>1922</span>  * legend. The selection can be cleared using clearSelection() and queried
+<span class='line'>1923</span>  * using getSelection().
+<span class='line'>1924</span>  * @param { Integer } row number that should be highlighted (i.e. appear with
+<span class='line'>1925</span>  * hover dots on the chart). Set to false to clear any selection.
+<span class='line'>1926</span>  */</span><span class="WHIT">
+<span class='line'>1927</span> </span><span class="NAME">Dygraph.prototype.setSelection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">row</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1928</span> </span><span class="WHIT">  </span><span class="COMM">// Extract the points we've selected</span><span class="WHIT">
+<span class='line'>1929</span> </span><span class="WHIT">  </span><span class="NAME">this.selPoints_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1930</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pos</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1931</span> 
+<span class='line'>1932</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1933</span> </span><span class="WHIT">    </span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">row</span><span class="PUNC">-</span><span class="NAME">this.boundaryIds_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1934</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1935</span> 
+<span class='line'>1936</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1937</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">this.layout_.datasets</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1938</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.layout_.datasets</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1939</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">point</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.layout_.points</span><span class="PUNC">[</span><span class="NAME">pos</span><span class="PUNC">+</span><span class="NAME">row</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1940</span> </span><span class="WHIT">        
+<span class='line'>1941</span>         </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"stackedGraph"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1942</span> </span><span class="WHIT">          </span><span class="NAME">point</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.layout_.unstackPointAtIndex</span><span class="PUNC">(</span><span class="NAME">pos</span><span class="PUNC">+</span><span class="NAME">row</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1943</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1944</span> </span><span class="WHIT">        
+<span class='line'>1945</span>         </span><span class="NAME">this.selPoints_.push</span><span class="PUNC">(</span><span class="NAME">point</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1946</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1947</span> </span><span class="WHIT">      </span><span class="NAME">pos</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.layout_.datasets</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1948</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1949</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1950</span> 
+<span class='line'>1951</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.selPoints_.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1952</span> </span><span class="WHIT">    </span><span class="NAME">this.lastx_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.selPoints_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">xval</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1953</span> </span><span class="WHIT">    </span><span class="NAME">this.updateSelection_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1954</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1955</span> </span><span class="WHIT">    </span><span class="NAME">this.clearSelection</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1956</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1957</span> 
+<span class='line'>1958</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1959</span> 
+<span class='line'>1960</span> </span><span class="COMM">/**
+<span class='line'>1961</span>  * The mouse has left the canvas. Clear out whatever artifacts remain
+<span class='line'>1962</span>  * @param {Object} event the mouseout event from the browser.
+<span class='line'>1963</span>  * @private
+<span class='line'>1964</span>  */</span><span class="WHIT">
+<span class='line'>1965</span> </span><span class="NAME">Dygraph.prototype.mouseOut_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1966</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"unhighlightCallback"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1967</span> </span><span class="WHIT">    </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"unhighlightCallback"</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">event</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1968</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1969</span> 
+<span class='line'>1970</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"hideOverlayOnMouseOut"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1971</span> </span><span class="WHIT">    </span><span class="NAME">this.clearSelection</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1972</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1973</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1974</span> 
+<span class='line'>1975</span> </span><span class="COMM">/**
+<span class='line'>1976</span>  * Clears the current selection (i.e. points that were highlighted by moving
+<span class='line'>1977</span>  * the mouse over the chart).
+<span class='line'>1978</span>  */</span><span class="WHIT">
+<span class='line'>1979</span> </span><span class="NAME">Dygraph.prototype.clearSelection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1980</span> </span><span class="WHIT">  </span><span class="COMM">// Get rid of the overlay data</span><span class="WHIT">
+<span class='line'>1981</span> </span><span class="WHIT">  </span><span class="NAME">this.canvas_ctx_.clearRect</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.width_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.height_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1982</span> </span><span class="WHIT">  </span><span class="NAME">this.setLegendHTML_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1983</span> </span><span class="WHIT">  </span><span class="NAME">this.selPoints_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1984</span> </span><span class="WHIT">  </span><span class="NAME">this.lastx_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1985</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1986</span> 
+<span class='line'>1987</span> </span><span class="COMM">/**
+<span class='line'>1988</span>  * Returns the number of the currently selected row. To get data for this row,
+<span class='line'>1989</span>  * you can use the getValue method.
+<span class='line'>1990</span>  * @return { Integer } row number, or -1 if nothing is selected
+<span class='line'>1991</span>  */</span><span class="WHIT">
+<span class='line'>1992</span> </span><span class="NAME">Dygraph.prototype.getSelection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1993</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.selPoints_</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.selPoints_.length</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1994</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>1995</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>1996</span> 
+<span class='line'>1997</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">row</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">row</span><span class="PUNC">&lt;</span><span class="NAME">this.layout_.points.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">row</span><span class="PUNC">++</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1998</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.layout_.points</span><span class="PUNC">[</span><span class="NAME">row</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">this.selPoints_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>1999</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.boundaryIds_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2000</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2001</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2002</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2003</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2004</span> 
+<span class='line'>2005</span> </span><span class="COMM">/**
+<span class='line'>2006</span>  * Number formatting function which mimicks the behavior of %g in printf, i.e.
+<span class='line'>2007</span>  * either exponential or fixed format (without trailing 0s) is used depending on
+<span class='line'>2008</span>  * the length of the generated string.  The advantage of this format is that
+<span class='line'>2009</span>  * there is a predictable upper bound on the resulting string length,
+<span class='line'>2010</span>  * significant figures are not dropped, and normal numbers are not displayed in
+<span class='line'>2011</span>  * exponential notation.
+<span class='line'>2012</span>  *
+<span class='line'>2013</span>  * NOTE: JavaScript's native toPrecision() is NOT a drop-in replacement for %g.
+<span class='line'>2014</span>  * It creates strings which are too long for absolute values between 10^-4 and
+<span class='line'>2015</span>  * 10^-6, e.g. '0.00001' instead of '1e-5'. See tests/number-format.html for
+<span class='line'>2016</span>  * output examples.
+<span class='line'>2017</span>  *
+<span class='line'>2018</span>  * @param {Number} x The number to format
+<span class='line'>2019</span>  * @param {Number} opt_precision The precision to use, default 2.
+<span class='line'>2020</span>  * @return {String} A string formatted like %g in printf.  The max generated
+<span class='line'>2021</span>  *                  string length should be precision + 6 (e.g 1.123e+300).
+<span class='line'>2022</span>  */</span><span class="WHIT">
+<span class='line'>2023</span> </span><span class="NAME">Dygraph.floatFormat</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">opt_precision</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2024</span> </span><span class="WHIT">  </span><span class="COMM">// Avoid invalid precision values; [1, 21] is the valid range.</span><span class="WHIT">
+<span class='line'>2025</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.min</span><span class="PUNC">(</span><span class="NAME">Math.max</span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">opt_precision</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">21</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2026</span> 
+<span class='line'>2027</span> </span><span class="WHIT">  </span><span class="COMM">// This is deceptively simple.  The actual algorithm comes from:</span><span class="WHIT">
+<span class='line'>2028</span> </span><span class="WHIT">  </span><span class="COMM">//</span><span class="WHIT">
+<span class='line'>2029</span> </span><span class="WHIT">  </span><span class="COMM">// Max allowed length = p + 4</span><span class="WHIT">
+<span class='line'>2030</span> </span><span class="WHIT">  </span><span class="COMM">// where 4 comes from 'e+n' and '.'.</span><span class="WHIT">
+<span class='line'>2031</span> </span><span class="WHIT">  </span><span class="COMM">//</span><span class="WHIT">
+<span class='line'>2032</span> </span><span class="WHIT">  </span><span class="COMM">// Length of fixed format = 2 + y + p</span><span class="WHIT">
+<span class='line'>2033</span> </span><span class="WHIT">  </span><span class="COMM">// where 2 comes from '0.' and y = # of leading zeroes.</span><span class="WHIT">
+<span class='line'>2034</span> </span><span class="WHIT">  </span><span class="COMM">//</span><span class="WHIT">
+<span class='line'>2035</span> </span><span class="WHIT">  </span><span class="COMM">// Equating the two and solving for y yields y = 2, or 0.00xxxx which is</span><span class="WHIT">
+<span class='line'>2036</span> </span><span class="WHIT">  </span><span class="COMM">// 1.0e-3.</span><span class="WHIT">
+<span class='line'>2037</span> </span><span class="WHIT">  </span><span class="COMM">//</span><span class="WHIT">
+<span class='line'>2038</span> </span><span class="WHIT">  </span><span class="COMM">// Since the behavior of toPrecision() is identical for larger numbers, we</span><span class="WHIT">
+<span class='line'>2039</span> </span><span class="WHIT">  </span><span class="COMM">// don't have to worry about the other bound.</span><span class="WHIT">
+<span class='line'>2040</span> </span><span class="WHIT">  </span><span class="COMM">//</span><span class="WHIT">
+<span class='line'>2041</span> </span><span class="WHIT">  </span><span class="COMM">// Finally, the argument for toExponential() is the number of trailing digits,</span><span class="WHIT">
+<span class='line'>2042</span> </span><span class="WHIT">  </span><span class="COMM">// so we take off 1 for the value before the '.'.</span><span class="WHIT">
+<span class='line'>2043</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">1.0</span><span class="NAME">e</span><span class="PUNC">-</span><span class="NUMB">3</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NUMB">0.0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT">
+<span class='line'>2044</span> </span><span class="WHIT">      </span><span class="NAME">x.toExponential</span><span class="PUNC">(</span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">x.toPrecision</span><span class="PUNC">(</span><span class="NAME">p</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2045</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2046</span> 
+<span class='line'>2047</span> </span><span class="COMM">/**
+<span class='line'>2048</span>  * @private
+<span class='line'>2049</span>  * Return a string version of a number. This respects the digitsAfterDecimal
+<span class='line'>2050</span>  * and maxNumberWidth options.
+<span class='line'>2051</span>  * @param {Number} x The number to be formatted
+<span class='line'>2052</span>  * @param {Dygraph} g The dygraph object
+<span class='line'>2053</span>  */</span><span class="WHIT">
+<span class='line'>2054</span> </span><span class="NAME">Dygraph.numberFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2055</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sigFigs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.attr_</span><span class="PUNC">(</span><span class="STRN">'sigFigs'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2056</span> 
+<span class='line'>2057</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">sigFigs</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2058</span> </span><span class="WHIT">    </span><span class="COMM">// User has opted for a fixed number of significant figures.</span><span class="WHIT">
+<span class='line'>2059</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Dygraph.floatFormat</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sigFigs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2060</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2061</span> 
+<span class='line'>2062</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">digits</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.attr_</span><span class="PUNC">(</span><span class="STRN">'digitsAfterDecimal'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2063</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxNumberWidth</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">g.attr_</span><span class="PUNC">(</span><span class="STRN">'maxNumberWidth'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2064</span> 
+<span class='line'>2065</span> </span><span class="WHIT">  </span><span class="COMM">// switch to scientific notation if we underflow or overflow fixed display.</span><span class="WHIT">
+<span class='line'>2066</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">0.0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
+<span class='line'>2067</span> </span><span class="WHIT">      </span><span class="PUNC">(</span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">Math.pow</span><span class="PUNC">(</span><span class="NUMB">10</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxNumberWidth</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
+<span class='line'>2068</span> </span><span class="WHIT">       </span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">Math.pow</span><span class="PUNC">(</span><span class="NUMB">10</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NAME">digits</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2069</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">x.toExponential</span><span class="PUNC">(</span><span class="NAME">digits</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2070</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2071</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">''</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">Dygraph.round_</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">digits</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2072</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2073</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2074</span> 
+<span class='line'>2075</span> </span><span class="COMM">/**
+<span class='line'>2076</span>  * @private
+<span class='line'>2077</span>  * Converts '9' to '09' (useful for dates)
+<span class='line'>2078</span>  */</span><span class="WHIT">
+<span class='line'>2079</span> </span><span class="NAME">Dygraph.zeropad</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2080</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"0"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">""</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2081</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2082</span> 
+<span class='line'>2083</span> </span><span class="COMM">/**
+<span class='line'>2084</span>  * Return a string version of the hours, minutes and seconds portion of a date.
+<span class='line'>2085</span>  * @param {Number} date The JavaScript date (ms since epoch)
+<span class='line'>2086</span>  * @return {String} A time of the form "HH:MM:SS"
+<span class='line'>2087</span>  * @private
+<span class='line'>2088</span>  */</span><span class="WHIT">
+<span class='line'>2089</span> </span><span class="NAME">Dygraph.hmsString_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">date</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2090</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">zeropad</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.zeropad</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2091</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="NAME">date</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2092</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">d.getSeconds</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2093</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">zeropad</span><span class="PUNC">(</span><span class="NAME">d.getHours</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">":"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>2094</span> </span><span class="WHIT">           </span><span class="NAME">zeropad</span><span class="PUNC">(</span><span class="NAME">d.getMinutes</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">":"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>2095</span> </span><span class="WHIT">           </span><span class="NAME">zeropad</span><span class="PUNC">(</span><span class="NAME">d.getSeconds</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2096</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2097</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">zeropad</span><span class="PUNC">(</span><span class="NAME">d.getHours</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">":"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">zeropad</span><span class="PUNC">(</span><span class="NAME">d.getMinutes</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2098</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2099</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2100</span> 
+<span class='line'>2101</span> </span><span class="COMM">/**
+<span class='line'>2102</span>  * Convert a JS date to a string appropriate to display on an axis that
+<span class='line'>2103</span>  * is displaying values at the stated granularity.
+<span class='line'>2104</span>  * @param {Date} date The date to format
+<span class='line'>2105</span>  * @param {Number} granularity One of the Dygraph granularity constants
+<span class='line'>2106</span>  * @return {String} The formatted date
+<span class='line'>2107</span>  * @private
+<span class='line'>2108</span>  */</span><span class="WHIT">
+<span class='line'>2109</span> </span><span class="NAME">Dygraph.dateAxisFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">date</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">granularity</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2110</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">Dygraph.DECADAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2111</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">date.strftime</span><span class="PUNC">(</span><span class="STRN">'%Y'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2112</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">Dygraph.MONTHLY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2113</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">date.strftime</span><span class="PUNC">(</span><span class="STRN">'%b %y'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2114</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2115</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">frac</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">date.getHours</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">3600</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">date.getMinutes</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">date.getSeconds</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">date.getMilliseconds</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2116</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">frac</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">Dygraph.DAILY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2117</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="NAME">date.getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">3600</span><span class="PUNC">*</span><span class="NUMB">1000</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">strftime</span><span class="PUNC">(</span><span class="STRN">'%d%b'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2118</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2119</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Dygraph.hmsString_</span><span class="PUNC">(</span><span class="NAME">date.getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2120</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2121</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2122</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2123</span> 
+<span class='line'>2124</span> </span><span class="COMM">/**
+<span class='line'>2125</span>  * Convert a JS date (millis since epoch) to YYYY/MM/DD
+<span class='line'>2126</span>  * @param {Number} date The JavaScript date (ms since epoch)
+<span class='line'>2127</span>  * @return {String} A date of the form "YYYY/MM/DD"
+<span class='line'>2128</span>  * @private
+<span class='line'>2129</span>  */</span><span class="WHIT">
+<span class='line'>2130</span> </span><span class="NAME">Dygraph.dateString_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">date</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2131</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">zeropad</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.zeropad</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2132</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="NAME">date</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2133</span> 
+<span class='line'>2134</span> </span><span class="WHIT">  </span><span class="COMM">// Get the year:</span><span class="WHIT">
+<span class='line'>2135</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">year</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">d.getFullYear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2136</span> </span><span class="WHIT">  </span><span class="COMM">// Get a 0 padded month string</span><span class="WHIT">
+<span class='line'>2137</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">month</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">zeropad</span><span class="PUNC">(</span><span class="NAME">d.getMonth</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">//months are 0-offset, sigh</span><span class="WHIT">
+<span class='line'>2138</span> </span><span class="WHIT">  </span><span class="COMM">// Get a 0 padded day string</span><span class="WHIT">
+<span class='line'>2139</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">day</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">zeropad</span><span class="PUNC">(</span><span class="NAME">d.getDate</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2140</span> 
+<span class='line'>2141</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2142</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">frac</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d.getHours</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">3600</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">d.getMinutes</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">d.getSeconds</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2143</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">frac</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">" "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">Dygraph.hmsString_</span><span class="PUNC">(</span><span class="NAME">date</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2144</span> 
+<span class='line'>2145</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">year</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">month</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">day</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2146</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2147</span> 
+<span class='line'>2148</span> </span><span class="COMM">/**
+<span class='line'>2149</span>  * Round a number to the specified number of digits past the decimal point.
+<span class='line'>2150</span>  * @param {Number} num The number to round
+<span class='line'>2151</span>  * @param {Number} places The number of decimals to which to round
+<span class='line'>2152</span>  * @return {Number} The rounded number
+<span class='line'>2153</span>  * @private
+<span class='line'>2154</span>  */</span><span class="WHIT">
+<span class='line'>2155</span> </span><span class="NAME">Dygraph.round_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">num</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">places</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2156</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">shift</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.pow</span><span class="PUNC">(</span><span class="NUMB">10</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">places</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2157</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Math.round</span><span class="PUNC">(</span><span class="NAME">num</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">shift</span><span class="PUNC">)</span><span class="PUNC">/</span><span class="NAME">shift</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2158</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2159</span> 
+<span class='line'>2160</span> </span><span class="COMM">/**
+<span class='line'>2161</span>  * Fires when there's data available to be graphed.
+<span class='line'>2162</span>  * @param {String} data Raw CSV data to be plotted
+<span class='line'>2163</span>  * @private
+<span class='line'>2164</span>  */</span><span class="WHIT">
+<span class='line'>2165</span> </span><span class="NAME">Dygraph.prototype.loadedEvent_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2166</span> </span><span class="WHIT">  </span><span class="NAME">this.rawData_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.parseCSV_</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2167</span> </span><span class="WHIT">  </span><span class="NAME">this.predraw_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2168</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2169</span> 
+<span class='line'>2170</span> </span><span class="NAME">Dygraph.prototype.months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">  </span><span class="PUNC">[</span><span class="STRN">"Jan"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Feb"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Mar"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Apr"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"May"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Jun"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2171</span> </span><span class="WHIT">                             </span><span class="STRN">"Jul"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Aug"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Sep"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Oct"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Nov"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Dec"</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2172</span> </span><span class="NAME">Dygraph.prototype.quarters</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Jan"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Apr"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Jul"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Oct"</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2173</span> 
+<span class='line'>2174</span> </span><span class="COMM">/**
+<span class='line'>2175</span>  * Add ticks on the x-axis representing years, months, quarters, weeks, or days
+<span class='line'>2176</span>  * @private
+<span class='line'>2177</span>  */</span><span class="WHIT">
+<span class='line'>2178</span> </span><span class="NAME">Dygraph.prototype.addXTicks_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2179</span> </span><span class="WHIT">  </span><span class="COMM">// Determine the correct ticks scale on the x-axis: quarterly, monthly, ...</span><span class="WHIT">
+<span class='line'>2180</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">range</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2181</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.dateWindow_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2182</span> </span><span class="WHIT">    </span><span class="NAME">range</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.dateWindow_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.dateWindow_</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2183</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2184</span> </span><span class="WHIT">    </span><span class="NAME">range</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.rawData_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.rawData_</span><span class="PUNC">[</span><span class="NAME">this.rawData_.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2185</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2186</span> 
+<span class='line'>2187</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xTicks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'xTicker'</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="NAME">range</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">range</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2188</span> </span><span class="WHIT">  </span><span class="NAME">this.layout_.updateOptions</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">xTicks</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">xTicks</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2189</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2190</span> 
+<span class='line'>2191</span> </span><span class="COMM">// Time granularity enumeration</span><span class="WHIT">
+<span class='line'>2192</span> </span><span class="NAME">Dygraph.SECONDLY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2193</span> </span><span class="NAME">Dygraph.TWO_SECONDLY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2194</span> </span><span class="NAME">Dygraph.FIVE_SECONDLY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2195</span> </span><span class="NAME">Dygraph.TEN_SECONDLY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2196</span> </span><span class="NAME">Dygraph.THIRTY_SECONDLY</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2197</span> </span><span class="NAME">Dygraph.MINUTELY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2198</span> </span><span class="NAME">Dygraph.TWO_MINUTELY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2199</span> </span><span class="NAME">Dygraph.FIVE_MINUTELY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">7</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2200</span> </span><span class="NAME">Dygraph.TEN_MINUTELY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">8</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2201</span> </span><span class="NAME">Dygraph.THIRTY_MINUTELY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">9</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2202</span> </span><span class="NAME">Dygraph.HOURLY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2203</span> </span><span class="NAME">Dygraph.TWO_HOURLY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">11</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2204</span> </span><span class="NAME">Dygraph.SIX_HOURLY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">12</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2205</span> </span><span class="NAME">Dygraph.DAILY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">13</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2206</span> </span><span class="NAME">Dygraph.WEEKLY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">14</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2207</span> </span><span class="NAME">Dygraph.MONTHLY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">15</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2208</span> </span><span class="NAME">Dygraph.QUARTERLY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2209</span> </span><span class="NAME">Dygraph.BIANNUAL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">17</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2210</span> </span><span class="NAME">Dygraph.ANNUAL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">18</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2211</span> </span><span class="NAME">Dygraph.DECADAL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">19</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2212</span> </span><span class="NAME">Dygraph.CENTENNIAL</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">20</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2213</span> </span><span class="NAME">Dygraph.NUM_GRANULARITIES</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">21</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2214</span> 
+<span class='line'>2215</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2216</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.SECONDLY</span><span class="PUNC">]</span><span class="WHIT">        </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2217</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.TWO_SECONDLY</span><span class="PUNC">]</span><span class="WHIT">    </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2218</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.FIVE_SECONDLY</span><span class="PUNC">]</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2219</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.TEN_SECONDLY</span><span class="PUNC">]</span><span class="WHIT">    </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2220</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.THIRTY_SECONDLY</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">30</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2221</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.MINUTELY</span><span class="PUNC">]</span><span class="WHIT">        </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2222</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.TWO_MINUTELY</span><span class="PUNC">]</span><span class="WHIT">    </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2223</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.FIVE_MINUTELY</span><span class="PUNC">]</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2224</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.TEN_MINUTELY</span><span class="PUNC">]</span><span class="WHIT">    </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2225</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.THIRTY_MINUTELY</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">30</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2226</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.HOURLY</span><span class="PUNC">]</span><span class="WHIT">          </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">3600</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2227</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.TWO_HOURLY</span><span class="PUNC">]</span><span class="WHIT">      </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">3600</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2228</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.SIX_HOURLY</span><span class="PUNC">]</span><span class="WHIT">      </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">3600</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2229</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.DAILY</span><span class="PUNC">]</span><span class="WHIT">           </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">86400</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2230</span> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">Dygraph.WEEKLY</span><span class="PUNC">]</span><span class="WHIT">          </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">604800</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2231</span> 
+<span class='line'>2232</span> </span><span class="COMM">/**
+<span class='line'>2233</span>  * @private
+<span class='line'>2234</span>  * If we used this time granularity, how many ticks would there be?
+<span class='line'>2235</span>  * This is only an approximation, but it's generally good enough.
+<span class='line'>2236</span>  */</span><span class="WHIT">
+<span class='line'>2237</span> </span><span class="NAME">Dygraph.prototype.NumXTicks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">start_time</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">end_time</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">granularity</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2238</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">Dygraph.MONTHLY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2239</span> </span><span class="WHIT">    </span><span class="COMM">// Generate one tick mark for every fixed interval of time.</span><span class="WHIT">
+<span class='line'>2240</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spacing</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">granularity</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2241</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Math.floor</span><span class="PUNC">(</span><span class="NUMB">0.5</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1.0</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">end_time</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">start_time</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">spacing</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2242</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2243</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">year_mod</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// e.g. to only print one point every 10 years.</span><span class="WHIT">
+<span class='line'>2244</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">num_months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">12</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2245</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.QUARTERLY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">num_months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2246</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.BIANNUAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">num_months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2247</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.ANNUAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">num_months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2248</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.DECADAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">num_months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">year_mod</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2249</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.CENTENNIAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">num_months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">year_mod</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2250</span> 
+<span class='line'>2251</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">msInYear</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">365.2524</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">24</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">3600</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2252</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">num_years</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1.0</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">end_time</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">start_time</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">msInYear</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2253</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Math.floor</span><span class="PUNC">(</span><span class="NUMB">0.5</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1.0</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">num_years</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">num_months</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">year_mod</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2254</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2255</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2256</span> 
+<span class='line'>2257</span> </span><span class="COMM">/**
+<span class='line'>2258</span>  * @private
+<span class='line'>2259</span>  *
+<span class='line'>2260</span>  * Construct an x-axis of nicely-formatted times on meaningful boundaries
+<span class='line'>2261</span>  * (e.g. 'Jan 09' rather than 'Jan 22, 2009').
+<span class='line'>2262</span>  *
+<span class='line'>2263</span>  * Returns an array containing {v: millis, label: label} dictionaries.
+<span class='line'>2264</span>  */</span><span class="WHIT">
+<span class='line'>2265</span> </span><span class="NAME">Dygraph.prototype.GetXAxis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">start_time</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">end_time</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">granularity</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2266</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">formatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"xAxisLabelFormatter"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2267</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ticks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2268</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">Dygraph.MONTHLY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2269</span> </span><span class="WHIT">    </span><span class="COMM">// Generate one tick mark for every fixed interval of time.</span><span class="WHIT">
+<span class='line'>2270</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spacing</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.SHORT_SPACINGS</span><span class="PUNC">[</span><span class="NAME">granularity</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2271</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">format</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'%d%b'</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// e.g. "1Jan"</span><span class="WHIT">
+<span class='line'>2272</span> 
+<span class='line'>2273</span> </span><span class="WHIT">    </span><span class="COMM">// Find a time less than start_time which occurs on a "nice" time boundary</span><span class="WHIT">
+<span class='line'>2274</span> </span><span class="WHIT">    </span><span class="COMM">// for this granularity.</span><span class="WHIT">
+<span class='line'>2275</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">g</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spacing</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2276</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="NAME">start_time</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2277</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">g</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">// seconds</span><span class="WHIT">
+<span class='line'>2278</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d.getSeconds</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">d.setSeconds</span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">%</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2279</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2280</span> </span><span class="WHIT">      </span><span class="NAME">d.setSeconds</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2281</span> </span><span class="WHIT">      </span><span class="NAME">g</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2282</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">g</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">// minutes</span><span class="WHIT">
+<span class='line'>2283</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d.getMinutes</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">d.setMinutes</span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">%</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2284</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2285</span> </span><span class="WHIT">        </span><span class="NAME">d.setMinutes</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2286</span> </span><span class="WHIT">        </span><span class="NAME">g</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">60</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2287</span> 
+<span class='line'>2288</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">g</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NUMB">24</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">// days</span><span class="WHIT">
+<span class='line'>2289</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d.getHours</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">d.setHours</span><span class="PUNC">(</span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">%</span><span class="WHIT"> </span><span class="NAME">g</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2290</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2291</span> </span><span class="WHIT">          </span><span class="NAME">d.setHours</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2292</span> </span><span class="WHIT">          </span><span class="NAME">g</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">24</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2293</span> 
+<span class='line'>2294</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">g</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">7</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">// one week</span><span class="WHIT">
+<span class='line'>2295</span> </span><span class="WHIT">            </span><span class="NAME">d.setDate</span><span class="PUNC">(</span><span class="NAME">d.getDate</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">d.getDay</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2296</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2297</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2298</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2299</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2300</span> </span><span class="WHIT">    </span><span class="NAME">start_time</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">d.getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2301</span> 
+<span class='line'>2302</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">start_time</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">end_time</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">spacing</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2303</span> </span><span class="WHIT">      </span><span class="NAME">ticks.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">:</span><span class="NAME">t</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">label</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">formatter</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="NAME">t</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">granularity</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2304</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2305</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2306</span> </span><span class="WHIT">    </span><span class="COMM">// Display a tick mark on the first of a set of months of each year.</span><span class="WHIT">
+<span class='line'>2307</span> </span><span class="WHIT">    </span><span class="COMM">// Years get a tick mark iff y % year_mod == 0. This is useful for</span><span class="WHIT">
+<span class='line'>2308</span> </span><span class="WHIT">    </span><span class="COMM">// displaying a tick mark once every 10 years, say, on long time scales.</span><span class="WHIT">
+<span class='line'>2309</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">months</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2310</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">year_mod</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// e.g. to only print one point every 10 years.</span><span class="WHIT">
+<span class='line'>2311</span> 
+<span class='line'>2312</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.MONTHLY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2313</span> </span><span class="WHIT">      </span><span class="NAME">months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">7</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">8</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">9</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">11</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">12</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2314</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.QUARTERLY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2315</span> </span><span class="WHIT">      </span><span class="NAME">months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">9</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2316</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.BIANNUAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2317</span> </span><span class="WHIT">      </span><span class="NAME">months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2318</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.ANNUAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2319</span> </span><span class="WHIT">      </span><span class="NAME">months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2320</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.DECADAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2321</span> </span><span class="WHIT">      </span><span class="NAME">months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2322</span> </span><span class="WHIT">      </span><span class="NAME">year_mod</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">10</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2323</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">granularity</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Dygraph.CENTENNIAL</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2324</span> </span><span class="WHIT">      </span><span class="NAME">months</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2325</span> </span><span class="WHIT">      </span><span class="NAME">year_mod</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">100</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2326</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2327</span> </span><span class="WHIT">      </span><span class="NAME">this.warn</span><span class="PUNC">(</span><span class="STRN">"Span of dates is too long"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2328</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2329</span> 
+<span class='line'>2330</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">start_year</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="NAME">start_time</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getFullYear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2331</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">end_year</span><span class="WHIT">   </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="NAME">end_time</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getFullYear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2332</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">zeropad</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.zeropad</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2333</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">start_year</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">end_year</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2334</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">%</span><span class="WHIT"> </span><span class="NAME">year_mod</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2335</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">months.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2336</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">date_str</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">zeropad</span><span class="PUNC">(</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">months</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/01"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2337</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateStrToMillis</span><span class="PUNC">(</span><span class="NAME">date_str</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2338</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">start_time</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">t</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">end_time</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2339</span> </span><span class="WHIT">        </span><span class="NAME">ticks.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">:</span><span class="NAME">t</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">label</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">formatter</span><span class="PUNC">(</span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="NAME">t</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">granularity</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2340</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2341</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2342</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2343</span> 
+<span class='line'>2344</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">ticks</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2345</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2346</span> 
+<span class='line'>2347</span> 
+<span class='line'>2348</span> </span><span class="COMM">/**
+<span class='line'>2349</span>  * Add ticks to the x-axis based on a date range.
+<span class='line'>2350</span>  * @param {Number} startDate Start of the date window (millis since epoch)
+<span class='line'>2351</span>  * @param {Number} endDate End of the date window (millis since epoch)
+<span class='line'>2352</span>  * @param {Dygraph} self The dygraph object
+<span class='line'>2353</span>  * @return { [Object] } Array of {label, value} tuples.
+<span class='line'>2354</span>  * @public
+<span class='line'>2355</span>  */</span><span class="WHIT">
+<span class='line'>2356</span> </span><span class="NAME">Dygraph.dateTicker</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">startDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">endDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2357</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): why does this take 'self' as a param?</span><span class="WHIT">
+<span class='line'>2358</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">chosen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2359</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">Dygraph.NUM_GRANULARITIES</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2360</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">num_ticks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.NumXTicks</span><span class="PUNC">(</span><span class="NAME">startDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">endDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2361</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self.width_</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">num_ticks</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">self.attr_</span><span class="PUNC">(</span><span class="STRN">'pixelsPerXLabel'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2362</span> </span><span class="WHIT">      </span><span class="NAME">chosen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2363</span> </span><span class="WHIT">      </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2364</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2365</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2366</span> 
+<span class='line'>2367</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">chosen</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2368</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">self.GetXAxis</span><span class="PUNC">(</span><span class="NAME">startDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">endDate</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">chosen</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2369</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2370</span> </span><span class="WHIT">    </span><span class="COMM">// TODO(danvk): signal error.</span><span class="WHIT">
+<span class='line'>2371</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2372</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2373</span> 
+<span class='line'>2374</span> </span><span class="COMM">/**
+<span class='line'>2375</span>  * @private
+<span class='line'>2376</span>  * This is a list of human-friendly values at which to show tick marks on a log
+<span class='line'>2377</span>  * scale. It is k * 10^n, where k=1..9 and n=-39..+39, so:
+<span class='line'>2378</span>  * ..., 1, 2, 3, 4, 5, ..., 9, 10, 20, 30, ..., 90, 100, 200, 300, ...
+<span class='line'>2379</span>  * NOTE: this assumes that Dygraph.LOG_SCALE = 10.
+<span class='line'>2380</span>  */</span><span class="WHIT">
+<span class='line'>2381</span> </span><span class="NAME">Dygraph.PREFERRED_LOG_TICK_VALUES</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2382</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">vals</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2383</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">power</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">39</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">power</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NUMB">39</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">power</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2384</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">range</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.pow</span><span class="PUNC">(</span><span class="NUMB">10</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">power</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2385</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">mult</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NUMB">9</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">mult</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2386</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">range</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">mult</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2387</span> </span><span class="WHIT">      </span><span class="NAME">vals.push</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2388</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2389</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2390</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">vals</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2391</span> </span><span class="PUNC">}</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2392</span> 
+<span class='line'>2393</span> </span><span class="COMM">/**
+<span class='line'>2394</span>  * @private
+<span class='line'>2395</span>  * Implementation of binary search over an array.
+<span class='line'>2396</span>  * Currently does not work when val is outside the range of arry's values.
+<span class='line'>2397</span>  * @param { Integer } val the value to search for
+<span class='line'>2398</span>  * @param { Integer[] } arry is the value over which to search
+<span class='line'>2399</span>  * @param { Integer } abs If abs > 0, find the lowest entry greater than val
+<span class='line'>2400</span>  * If abs &lt; 0, find the highest entry less than val.
+<span class='line'>2401</span>  * if abs == 0, find the entry that equals val.
+<span class='line'>2402</span>  * @param { Integer } [low] The first index in arry to consider (optional)
+<span class='line'>2403</span>  * @param { Integer } [high] The last index in arry to consider (optional)
+<span class='line'>2404</span>  */</span><span class="WHIT">
+<span class='line'>2405</span> </span><span class="NAME">Dygraph.binarySearch</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arry</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">abs</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">low</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">high</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2406</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">high</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2407</span> </span><span class="WHIT">    </span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2408</span> </span><span class="WHIT">    </span><span class="NAME">high</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arry.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2409</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2410</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">high</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2411</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2412</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2413</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">abs</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2414</span> </span><span class="WHIT">    </span><span class="NAME">abs</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2415</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2416</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">validIndex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2417</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">arry.length</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2418</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2419</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">high</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2420</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">element</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">arry</span><span class="PUNC">[</span><span class="NAME">mid</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2421</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">element</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2422</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">mid</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2423</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2424</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">element</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2425</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">abs</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2426</span> </span><span class="WHIT">      </span><span class="COMM">// Accept if element > val, but also if prior element &lt; val.</span><span class="WHIT">
+<span class='line'>2427</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mid</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2428</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">validIndex</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">arry</span><span class="PUNC">[</span><span class="NAME">idx</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2429</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">mid</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2430</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2431</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2432</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Dygraph.binarySearch</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arry</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">abs</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">low</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mid</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2433</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2434</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">element</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2435</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">abs</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2436</span> </span><span class="WHIT">      </span><span class="COMM">// Accept if element &lt; val, but also if prior element > val.</span><span class="WHIT">
+<span class='line'>2437</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mid</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2438</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">validIndex</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">arry</span><span class="PUNC">[</span><span class="NAME">idx</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2439</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">mid</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2440</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2441</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2442</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">Dygraph.binarySearch</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">arry</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">abs</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mid</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">high</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2443</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2444</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2445</span> 
+<span class='line'>2446</span> </span><span class="COMM">// TODO(konigsberg): Update comment.</span><span class="WHIT">
+<span class='line'>2447</span> </span><span class="COMM">/**
+<span class='line'>2448</span>  * Add ticks when the x axis has numbers on it (instead of dates)
+<span class='line'>2449</span>  *
+<span class='line'>2450</span>  * @param {Number} minV minimum value
+<span class='line'>2451</span>  * @param {Number} maxV maximum value
+<span class='line'>2452</span>  * @param self
+<span class='line'>2453</span>  * @param {function} attribute accessor function.
+<span class='line'>2454</span>  * @return {[Object]} Array of {label, value} tuples.
+<span class='line'>2455</span>  */</span><span class="WHIT">
+<span class='line'>2456</span> </span><span class="NAME">Dygraph.numericTicks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">minV</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxV</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis_props</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">vals</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2457</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">attr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2458</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis_props</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">axis_props.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">axis_props</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2459</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">self.attr_</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2460</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2461</span> 
+<span class='line'>2462</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ticks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2463</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">vals</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2464</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">vals.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2465</span> </span><span class="WHIT">      </span><span class="NAME">ticks.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">v</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">vals</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2466</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2467</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2468</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis_props</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">"logscale"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2469</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pixelsPerTick</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'pixelsPerYLabel'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2470</span> </span><span class="WHIT">      </span><span class="COMM">// NOTE(konigsberg): Dan, should self.height_ be self.plotter_.area.h?</span><span class="WHIT">
+<span class='line'>2471</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">nTicks</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.floor</span><span class="PUNC">(</span><span class="NAME">self.height_</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">pixelsPerTick</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2472</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.binarySearch</span><span class="PUNC">(</span><span class="NAME">minV</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Dygraph.PREFERRED_LOG_TICK_VALUES</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2473</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.binarySearch</span><span class="PUNC">(</span><span class="NAME">maxV</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">Dygraph.PREFERRED_LOG_TICK_VALUES</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2474</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minIdx</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2475</span> </span><span class="WHIT">        </span><span class="NAME">minIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2476</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2477</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">maxIdx</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2478</span> </span><span class="WHIT">        </span><span class="NAME">maxIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.PREFERRED_LOG_TICK_VALUES.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2479</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2480</span> </span><span class="WHIT">      </span><span class="COMM">// Count the number of tick values would appear, if we can get at least</span><span class="WHIT">
+<span class='line'>2481</span> </span><span class="WHIT">      </span><span class="COMM">// nTicks / 4 accept them.</span><span class="WHIT">
+<span class='line'>2482</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lastDisplayed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2483</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">maxIdx</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">minIdx</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">nTicks</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2484</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">axisId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">axis_props.yAxisId</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2485</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">maxIdx</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">minIdx</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">--</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2486</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tickValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.PREFERRED_LOG_TICK_VALUES</span><span class="PUNC">[</span><span class="NAME">idx</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2487</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">domCoord</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">axis_props.g.toDomYCoord</span><span class="PUNC">(</span><span class="NAME">tickValue</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axisId</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2488</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tick</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">tickValue</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2489</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">lastDisplayed</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2490</span> </span><span class="WHIT">            </span><span class="NAME">lastDisplayed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2491</span> </span><span class="WHIT">              </span><span class="NAME">tickValue</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">tickValue</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2492</span> </span><span class="WHIT">              </span><span class="NAME">domCoord</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">domCoord</span><span class="WHIT">
+<span class='line'>2493</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2494</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2495</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">domCoord</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">lastDisplayed.domCoord</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">pixelsPerTick</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2496</span> </span><span class="WHIT">              </span><span class="NAME">lastDisplayed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2497</span> </span><span class="WHIT">                </span><span class="NAME">tickValue</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">tickValue</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2498</span> </span><span class="WHIT">                </span><span class="NAME">domCoord</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">domCoord</span><span class="WHIT">
+<span class='line'>2499</span> </span><span class="WHIT">              </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2500</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2501</span> </span><span class="WHIT">              </span><span class="NAME">tick.label</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2502</span> </span><span class="WHIT">            </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2503</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2504</span> </span><span class="WHIT">          </span><span class="NAME">ticks.push</span><span class="PUNC">(</span><span class="NAME">tick</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2505</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2506</span> </span><span class="WHIT">        </span><span class="COMM">// Since we went in backwards order.</span><span class="WHIT">
+<span class='line'>2507</span> </span><span class="WHIT">        </span><span class="NAME">ticks.reverse</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2508</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2509</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2510</span> 
+<span class='line'>2511</span> </span><span class="WHIT">    </span><span class="COMM">// ticks.length won't be 0 if the log scale function finds values to insert.</span><span class="WHIT">
+<span class='line'>2512</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ticks.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2513</span> </span><span class="WHIT">      </span><span class="COMM">// Basic idea:</span><span class="WHIT">
+<span class='line'>2514</span> </span><span class="WHIT">      </span><span class="COMM">// Try labels every 1, 2, 5, 10, 20, 50, 100, etc.</span><span class="WHIT">
+<span class='line'>2515</span> </span><span class="WHIT">      </span><span class="COMM">// Calculate the resulting tick spacing (i.e. this.height_ / nTicks).</span><span class="WHIT">
+<span class='line'>2516</span> </span><span class="WHIT">      </span><span class="COMM">// The first spacing greater than pixelsPerYLabel is what we use.</span><span class="WHIT">
+<span class='line'>2517</span> </span><span class="WHIT">      </span><span class="COMM">// TODO(danvk): version that works on a log scale.</span><span class="WHIT">
+<span class='line'>2518</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">"labelsKMG2"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2519</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">8</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2520</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2521</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mults</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2522</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2523</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">low_val</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">high_val</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">nTicks</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2524</span> </span><span class="WHIT">      </span><span class="COMM">// TODO(danvk): make it possible to set this for x- and y-axes independently.</span><span class="WHIT">
+<span class='line'>2525</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pixelsPerTick</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'pixelsPerYLabel'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2526</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">10</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">50</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2527</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">"labelsKMG2"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2528</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">base_scale</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.pow</span><span class="PUNC">(</span><span class="NUMB">16</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2529</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2530</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">base_scale</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.pow</span><span class="PUNC">(</span><span class="NUMB">10</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2531</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2532</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">mults.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2533</span> </span><span class="WHIT">          </span><span class="NAME">scale</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">base_scale</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">mults</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2534</span> </span><span class="WHIT">          </span><span class="NAME">low_val</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.floor</span><span class="PUNC">(</span><span class="NAME">minV</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2535</span> </span><span class="WHIT">          </span><span class="NAME">high_val</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.ceil</span><span class="PUNC">(</span><span class="NAME">maxV</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2536</span> </span><span class="WHIT">          </span><span class="NAME">nTicks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">high_val</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">low_val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2537</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">spacing</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">self.height_</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">nTicks</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2538</span> </span><span class="WHIT">          </span><span class="COMM">// wish I could break out of both loops at once...</span><span class="WHIT">
+<span class='line'>2539</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">spacing</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">pixelsPerTick</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2540</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2541</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">spacing</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">pixelsPerTick</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2542</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2543</span> 
+<span class='line'>2544</span> </span><span class="WHIT">      </span><span class="COMM">// Construct the set of ticks.</span><span class="WHIT">
+<span class='line'>2545</span> </span><span class="WHIT">      </span><span class="COMM">// Allow reverse y-axis if it's explicitly requested.</span><span class="WHIT">
+<span class='line'>2546</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">low_val</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">high_val</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2547</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">nTicks</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2548</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tickV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">low_val</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2549</span> </span><span class="WHIT">        </span><span class="NAME">ticks.push</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="NAME">v</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">tickV</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2550</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2551</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2552</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2553</span> 
+<span class='line'>2554</span> </span><span class="WHIT">  </span><span class="COMM">// Add formatted labels to the ticks.</span><span class="WHIT">
+<span class='line'>2555</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2556</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">k_labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2557</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">"labelsKMB"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2558</span> </span><span class="WHIT">    </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1000</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2559</span> </span><span class="WHIT">    </span><span class="NAME">k_labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="STRN">"K"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"M"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"B"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"T"</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2560</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2561</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">"labelsKMG2"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2562</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">self.warn</span><span class="PUNC">(</span><span class="STRN">"Setting both labelsKMB and labelsKMG2. Pick one!"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2563</span> </span><span class="WHIT">    </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1024</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2564</span> </span><span class="WHIT">    </span><span class="NAME">k_labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="STRN">"k"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"M"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"G"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"T"</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2565</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2566</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">formatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'yAxisLabelFormatter'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT">
+<span class='line'>2567</span> </span><span class="WHIT">      </span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'yAxisLabelFormatter'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'yValueFormatter'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2568</span> 
+<span class='line'>2569</span> </span><span class="WHIT">  </span><span class="COMM">// Add labels to the ticks.</span><span class="WHIT">
+<span class='line'>2570</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">ticks.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2571</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ticks</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">label</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// Use current label.</span><span class="WHIT">
+<span class='line'>2572</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tickV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ticks</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">v</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2573</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">absTickV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.abs</span><span class="PUNC">(</span><span class="NAME">tickV</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2574</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">label</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">formatter</span><span class="PUNC">(</span><span class="NAME">tickV</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2575</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">k_labels.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2576</span> </span><span class="WHIT">      </span><span class="COMM">// Round up to an appropriate unit.</span><span class="WHIT">
+<span class='line'>2577</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">*</span><span class="NAME">k</span><span class="PUNC">*</span><span class="NAME">k</span><span class="PUNC">*</span><span class="NAME">k</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2578</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">--</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2579</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">absTickV</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">n</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2580</span> </span><span class="WHIT">          </span><span class="NAME">label</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.round_</span><span class="PUNC">(</span><span class="NAME">tickV</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">n</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">attr</span><span class="PUNC">(</span><span class="STRN">'digitsAfterDecimal'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">k_labels</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2581</span> </span><span class="WHIT">          </span><span class="KEYW">break</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2582</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2583</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2584</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2585</span> </span><span class="WHIT">    </span><span class="NAME">ticks</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">label</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">label</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2586</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2587</span> 
+<span class='line'>2588</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">ticks</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2589</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2590</span> 
+<span class='line'>2591</span> </span><span class="COMM">/**
+<span class='line'>2592</span>  * @private
+<span class='line'>2593</span>  * Computes the range of the data series (including confidence intervals).
+<span class='line'>2594</span>  * @param { [Array] } series either [ [x1, y1], [x2, y2], ... ] or
+<span class='line'>2595</span>  * [ [x1, [y1, dev_low, dev_high]], [x2, [y2, dev_low, dev_high]], ...
+<span class='line'>2596</span>  * @return [low, high]
+<span class='line'>2597</span>  */</span><span class="WHIT">
+<span class='line'>2598</span> </span><span class="NAME">Dygraph.prototype.extremeValues_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">series</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2599</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2600</span> 
+<span class='line'>2601</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bars</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"errorBars"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"customBars"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2602</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">bars</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2603</span> </span><span class="WHIT">    </span><span class="COMM">// With custom bars, maxY is the max of the high values.</span><span class="WHIT">
+<span class='line'>2604</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">series.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2605</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2606</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">y</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2607</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2608</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">high</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2609</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">;</span><span class="WHIT">    </span><span class="COMM">// this can happen with custom bars,</span><span class="WHIT">
+<span class='line'>2610</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">high</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">high</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// e.g. in tests/custom-bars.html</span><span class="WHIT">
+<span class='line'>2611</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">high</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2612</span> </span><span class="WHIT">        </span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">high</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2613</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2614</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2615</span> </span><span class="WHIT">        </span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">low</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2616</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2617</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2618</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2619</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">series.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2620</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2621</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">y</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2622</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2623</span> </span><span class="WHIT">        </span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2624</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2625</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2626</span> </span><span class="WHIT">        </span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2627</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2628</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2629</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2630</span> 
+<span class='line'>2631</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">minY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2632</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2633</span> 
+<span class='line'>2634</span> </span><span class="COMM">/**
+<span class='line'>2635</span>  * @private
+<span class='line'>2636</span>  * This function is called once when the chart's data is changed or the options
+<span class='line'>2637</span>  * dictionary is updated. It is _not_ called when the user pans or zooms. The
+<span class='line'>2638</span>  * idea is that values derived from the chart's data can be computed here,
+<span class='line'>2639</span>  * rather than every time the chart is drawn. This includes things like the
+<span class='line'>2640</span>  * number of axes, rolling averages, etc.
+<span class='line'>2641</span>  */</span><span class="WHIT">
+<span class='line'>2642</span> </span><span class="NAME">Dygraph.prototype.predraw_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2643</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): move more computations out of drawGraph_ and into here.</span><span class="WHIT">
+<span class='line'>2644</span> </span><span class="WHIT">  </span><span class="NAME">this.computeYAxes_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2645</span> 
+<span class='line'>2646</span> </span><span class="WHIT">  </span><span class="COMM">// Create a new plotter.</span><span class="WHIT">
+<span class='line'>2647</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.plotter_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.plotter_.clear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2648</span> </span><span class="WHIT">  </span><span class="NAME">this.plotter_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">DygraphCanvasRenderer</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2649</span> </span><span class="WHIT">                                            </span><span class="NAME">this.hidden_</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2650</span> </span><span class="WHIT">                                            </span><span class="NAME">this.hidden_ctx_</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2651</span> </span><span class="WHIT">                                            </span><span class="NAME">this.layout_</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2652</span> </span><span class="WHIT">                                            </span><span class="NAME">this.renderOptions_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2653</span> 
+<span class='line'>2654</span> </span><span class="WHIT">  </span><span class="COMM">// The roller sits in the bottom left corner of the chart. We don't know where</span><span class="WHIT">
+<span class='line'>2655</span> </span><span class="WHIT">  </span><span class="COMM">// this will be until the options are available, so it's positioned here.</span><span class="WHIT">
+<span class='line'>2656</span> </span><span class="WHIT">  </span><span class="NAME">this.createRollInterface_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2657</span> 
+<span class='line'>2658</span> </span><span class="WHIT">  </span><span class="COMM">// Same thing applies for the labelsDiv. It's right edge should be flush with</span><span class="WHIT">
+<span class='line'>2659</span> </span><span class="WHIT">  </span><span class="COMM">// the right edge of the charting area (which may not be the same as the right</span><span class="WHIT">
+<span class='line'>2660</span> </span><span class="WHIT">  </span><span class="COMM">// edge of the div, if we have two y-axes.</span><span class="WHIT">
+<span class='line'>2661</span> </span><span class="WHIT">  </span><span class="NAME">this.positionLabelsDiv_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2662</span> 
+<span class='line'>2663</span> </span><span class="WHIT">  </span><span class="COMM">// If the data or options have changed, then we'd better redraw.</span><span class="WHIT">
+<span class='line'>2664</span> </span><span class="WHIT">  </span><span class="NAME">this.drawGraph_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2665</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2666</span> 
+<span class='line'>2667</span> </span><span class="COMM">/**
+<span class='line'>2668</span>  * Update the graph with new data. This method is called when the viewing area
+<span class='line'>2669</span>  * has changed. If the underlying data or options have changed, predraw_ will
+<span class='line'>2670</span>  * be called before drawGraph_ is called.
+<span class='line'>2671</span>  * @private
+<span class='line'>2672</span>  */</span><span class="WHIT">
+<span class='line'>2673</span> </span><span class="NAME">Dygraph.prototype.drawGraph_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2674</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">data</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.rawData_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2675</span> 
+<span class='line'>2676</span> </span><span class="WHIT">  </span><span class="COMM">// This is used to set the second parameter to drawCallback, below.</span><span class="WHIT">
+<span class='line'>2677</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">is_initial_draw</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.is_initial_draw_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2678</span> </span><span class="WHIT">  </span><span class="NAME">this.is_initial_draw_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2679</span> 
+<span class='line'>2680</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2681</span> </span><span class="WHIT">  </span><span class="NAME">this.layout_.removeAllDatasets</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2682</span> </span><span class="WHIT">  </span><span class="NAME">this.setColors_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2683</span> </span><span class="WHIT">  </span><span class="NAME">this.attrs_</span><span class="PUNC">[</span><span class="STRN">'pointSize'</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0.5</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'highlightCircleSize'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2684</span> 
+<span class='line'>2685</span> </span><span class="WHIT">  </span><span class="COMM">// Loop over the fields (series).  Go from the last to the first,</span><span class="WHIT">
+<span class='line'>2686</span> </span><span class="WHIT">  </span><span class="COMM">// because if they're stacked that's how we accumulate the values.</span><span class="WHIT">
+<span class='line'>2687</span> 
+<span class='line'>2688</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cumulative_y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// For stacked series.</span><span class="WHIT">
+<span class='line'>2689</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">datasets</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2690</span> 
+<span class='line'>2691</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">extremes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// series name -> [low, high]</span><span class="WHIT">
+<span class='line'>2692</span> 
+<span class='line'>2693</span> </span><span class="WHIT">  </span><span class="COMM">// Loop over all fields and create datasets</span><span class="WHIT">
+<span class='line'>2694</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">--</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2695</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.visibility</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2696</span> 
+<span class='line'>2697</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seriesName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labels"</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2698</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">connectSeparatedPoints</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'connectSeparatedPoints'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2699</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">logScale</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'logscale'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2700</span> 
+<span class='line'>2701</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">series</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2702</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">data.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2703</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">date</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2704</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">point</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2705</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">logScale</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2706</span> </span><span class="WHIT">        </span><span class="COMM">// On the log scale, points less than zero do not exist.</span><span class="WHIT">
+<span class='line'>2707</span> </span><span class="WHIT">        </span><span class="COMM">// This will create a gap in the chart. Note that this ignores</span><span class="WHIT">
+<span class='line'>2708</span> </span><span class="WHIT">        </span><span class="COMM">// connectSeparatedPoints.</span><span class="WHIT">
+<span class='line'>2709</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">point</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2710</span> </span><span class="WHIT">          </span><span class="NAME">point</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2711</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2712</span> </span><span class="WHIT">        </span><span class="NAME">series.push</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="NAME">date</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">point</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2713</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2714</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">point</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">connectSeparatedPoints</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2715</span> </span><span class="WHIT">          </span><span class="NAME">series.push</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="NAME">date</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">point</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2716</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2717</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2718</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2719</span> 
+<span class='line'>2720</span> </span><span class="WHIT">    </span><span class="COMM">// TODO(danvk): move this into predraw_. It's insane to do it here.</span><span class="WHIT">
+<span class='line'>2721</span> </span><span class="WHIT">    </span><span class="NAME">series</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.rollingAverage</span><span class="PUNC">(</span><span class="NAME">series</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.rollPeriod_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2722</span> 
+<span class='line'>2723</span> </span><span class="WHIT">    </span><span class="COMM">// Prune down to the desired range, if necessary (for zooming)</span><span class="WHIT">
+<span class='line'>2724</span> </span><span class="WHIT">    </span><span class="COMM">// Because there can be lines going to points outside of the visible area,</span><span class="WHIT">
+<span class='line'>2725</span> </span><span class="WHIT">    </span><span class="COMM">// we actually prune to visible points, plus one on either side.</span><span class="WHIT">
+<span class='line'>2726</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bars</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"errorBars"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"customBars"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2727</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.dateWindow_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2728</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.dateWindow_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2729</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">high</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.dateWindow_</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2730</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pruned</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2731</span> </span><span class="WHIT">      </span><span class="COMM">// TODO(danvk): do binary search instead of linear search.</span><span class="WHIT">
+<span class='line'>2732</span> </span><span class="WHIT">      </span><span class="COMM">// TODO(danvk): pass firstIdx and lastIdx directly to the renderer.</span><span class="WHIT">
+<span class='line'>2733</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">firstIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">lastIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2734</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">series.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2735</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">firstIdx</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2736</span> </span><span class="WHIT">          </span><span class="NAME">firstIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2737</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2738</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">high</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2739</span> </span><span class="WHIT">          </span><span class="NAME">lastIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2740</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2741</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2742</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">firstIdx</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">firstIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2743</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">firstIdx</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">firstIdx</span><span class="PUNC">--</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2744</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">lastIdx</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">lastIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">series.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2745</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">lastIdx</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">series.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">lastIdx</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2746</span> </span><span class="WHIT">      </span><span class="NAME">this.boundaryIds_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">firstIdx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">lastIdx</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2747</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">firstIdx</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">lastIdx</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2748</span> </span><span class="WHIT">        </span><span class="NAME">pruned.push</span><span class="PUNC">(</span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2749</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2750</span> </span><span class="WHIT">      </span><span class="NAME">series</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pruned</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2751</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2752</span> </span><span class="WHIT">      </span><span class="NAME">this.boundaryIds_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">series.length</span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2753</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2754</span> 
+<span class='line'>2755</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seriesExtremes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.extremeValues_</span><span class="PUNC">(</span><span class="NAME">series</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2756</span> 
+<span class='line'>2757</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">bars</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2758</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">=</span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">&lt;</span><span class="NAME">series.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2759</span> </span><span class="WHIT">        </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2760</span> </span><span class="WHIT">        </span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2761</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2762</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"stackedGraph"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2763</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">l</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">series.length</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2764</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">actual_y</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2765</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">l</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2766</span> </span><span class="WHIT">        </span><span class="COMM">// If one data set has a NaN, let all subsequent stacked</span><span class="WHIT">
+<span class='line'>2767</span> </span><span class="WHIT">        </span><span class="COMM">// sets inherit the NaN -- only start at 0 for the first set.</span><span class="WHIT">
+<span class='line'>2768</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2769</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">cumulative_y</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2770</span> </span><span class="WHIT">          </span><span class="NAME">cumulative_y</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2771</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2772</span> 
+<span class='line'>2773</span> </span><span class="WHIT">        </span><span class="NAME">actual_y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2774</span> </span><span class="WHIT">        </span><span class="NAME">cumulative_y</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">actual_y</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2775</span> 
+<span class='line'>2776</span> </span><span class="WHIT">        </span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">cumulative_y</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT">
+<span class='line'>2777</span> 
+<span class='line'>2778</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">cumulative_y</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">seriesExtremes</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2779</span> </span><span class="WHIT">          </span><span class="NAME">seriesExtremes</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cumulative_y</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2780</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2781</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">cumulative_y</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">seriesExtremes</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2782</span> </span><span class="WHIT">          </span><span class="NAME">seriesExtremes</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">cumulative_y</span><span class="PUNC">[</span><span class="NAME">x</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2783</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2784</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2785</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2786</span> </span><span class="WHIT">    </span><span class="NAME">extremes</span><span class="PUNC">[</span><span class="NAME">seriesName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">seriesExtremes</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2787</span> 
+<span class='line'>2788</span> </span><span class="WHIT">    </span><span class="NAME">datasets</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2789</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2790</span> 
+<span class='line'>2791</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">datasets.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2792</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.visibility</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2793</span> </span><span class="WHIT">    </span><span class="NAME">this.layout_.addDataset</span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labels"</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">datasets</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2794</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2795</span> 
+<span class='line'>2796</span> </span><span class="WHIT">  </span><span class="NAME">this.computeYAxisRanges_</span><span class="PUNC">(</span><span class="NAME">extremes</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2797</span> </span><span class="WHIT">  </span><span class="NAME">this.layout_.updateOptions</span><span class="PUNC">(</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">yAxes</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.axes_</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2798</span> </span><span class="WHIT">                                </span><span class="NAME">seriesToAxisMap</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.seriesToAxisMap_</span><span class="WHIT">
+<span class='line'>2799</span> </span><span class="WHIT">                              </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2800</span> </span><span class="WHIT">  </span><span class="NAME">this.addXTicks_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2801</span> 
+<span class='line'>2802</span> </span><span class="WHIT">  </span><span class="COMM">// Save the X axis zoomed status as the updateOptions call will tend to set it errorneously</span><span class="WHIT">
+<span class='line'>2803</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tmp_zoomed_x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.zoomed_x_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2804</span> </span><span class="WHIT">  </span><span class="COMM">// Tell PlotKit to use this new data and render itself</span><span class="WHIT">
+<span class='line'>2805</span> </span><span class="WHIT">  </span><span class="NAME">this.layout_.updateOptions</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">dateWindow</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.dateWindow_</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2806</span> </span><span class="WHIT">  </span><span class="NAME">this.zoomed_x_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">tmp_zoomed_x</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2807</span> </span><span class="WHIT">  </span><span class="NAME">this.layout_.evaluateWithError</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2808</span> </span><span class="WHIT">  </span><span class="NAME">this.plotter_.clear</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2809</span> </span><span class="WHIT">  </span><span class="NAME">this.plotter_.render</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2810</span> </span><span class="WHIT">  </span><span class="NAME">this.canvas_.getContext</span><span class="PUNC">(</span><span class="STRN">'2d'</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">clearRect</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.canvas_.width</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2811</span> </span><span class="WHIT">                                          </span><span class="NAME">this.canvas_.height</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2812</span> 
+<span class='line'>2813</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">is_initial_draw</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2814</span> </span><span class="WHIT">    </span><span class="COMM">// Generate a static legend before any particular point is selected.</span><span class="WHIT">
+<span class='line'>2815</span> </span><span class="WHIT">    </span><span class="NAME">this.setLegendHTML_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2816</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2817</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">this.selPoints_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this.selPoints_.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2818</span> </span><span class="WHIT">      </span><span class="NAME">this.lastx_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.selPoints_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">xval</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2819</span> </span><span class="WHIT">      </span><span class="NAME">this.updateSelection_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2820</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2821</span> </span><span class="WHIT">      </span><span class="NAME">this.clearSelection</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2822</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2823</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2824</span> 
+<span class='line'>2825</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"drawCallback"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2826</span> </span><span class="WHIT">    </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"drawCallback"</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">is_initial_draw</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2827</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2828</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2829</span> 
+<span class='line'>2830</span> </span><span class="COMM">/**
+<span class='line'>2831</span>  * @private
+<span class='line'>2832</span>  * Determine properties of the y-axes which are independent of the data
+<span class='line'>2833</span>  * currently being displayed. This includes things like the number of axes and
+<span class='line'>2834</span>  * the style of the axes. It does not include the range of each axis and its
+<span class='line'>2835</span>  * tick marks.
+<span class='line'>2836</span>  * This fills in this.axes_ and this.seriesToAxisMap_.
+<span class='line'>2837</span>  * axes_ = [ { options } ]
+<span class='line'>2838</span>  * seriesToAxisMap_ = { seriesName: 0, seriesName2: 1, ... }
+<span class='line'>2839</span>  *   indices are into the axes_ array.
+<span class='line'>2840</span>  */</span><span class="WHIT">
+<span class='line'>2841</span> </span><span class="NAME">Dygraph.prototype.computeYAxes_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2842</span> </span><span class="WHIT">  </span><span class="NAME">this.axes_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">yAxisId</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">g</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// always have at least one y-axis.</span><span class="WHIT">
+<span class='line'>2843</span> </span><span class="WHIT">  </span><span class="NAME">this.seriesToAxisMap_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2844</span> 
+<span class='line'>2845</span> </span><span class="WHIT">  </span><span class="COMM">// Get a list of series names.</span><span class="WHIT">
+<span class='line'>2846</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labels"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2847</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">series</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2848</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">labels.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">labels</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2849</span> 
+<span class='line'>2850</span> </span><span class="WHIT">  </span><span class="COMM">// all options which could be applied per-axis:</span><span class="WHIT">
+<span class='line'>2851</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">axisOptions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
+<span class='line'>2852</span> </span><span class="WHIT">    </span><span class="STRN">'includeZero'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2853</span> </span><span class="WHIT">    </span><span class="STRN">'valueRange'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2854</span> </span><span class="WHIT">    </span><span class="STRN">'labelsKMB'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2855</span> </span><span class="WHIT">    </span><span class="STRN">'labelsKMG2'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2856</span> </span><span class="WHIT">    </span><span class="STRN">'pixelsPerYLabel'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2857</span> </span><span class="WHIT">    </span><span class="STRN">'yAxisLabelWidth'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2858</span> </span><span class="WHIT">    </span><span class="STRN">'axisLabelFontSize'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2859</span> </span><span class="WHIT">    </span><span class="STRN">'axisTickSize'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>2860</span> </span><span class="WHIT">    </span><span class="STRN">'logscale'</span><span class="WHIT">
+<span class='line'>2861</span> </span><span class="WHIT">  </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2862</span> 
+<span class='line'>2863</span> </span><span class="WHIT">  </span><span class="COMM">// Copy global axis options over to the first axis.</span><span class="WHIT">
+<span class='line'>2864</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">axisOptions.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2865</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">axisOptions</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2866</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2867</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">v</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">this.axes_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">v</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2868</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2869</span> 
+<span class='line'>2870</span> </span><span class="WHIT">  </span><span class="COMM">// Go through once and add all the axes.</span><span class="WHIT">
+<span class='line'>2871</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seriesName</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2872</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">series.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">seriesName</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2873</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"axis"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">seriesName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2874</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2875</span> </span><span class="WHIT">      </span><span class="NAME">this.seriesToAxisMap_</span><span class="PUNC">[</span><span class="NAME">seriesName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2876</span> </span><span class="WHIT">      </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2877</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2878</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2879</span> </span><span class="WHIT">      </span><span class="COMM">// Add a new axis, making a copy of its per-axis options.</span><span class="WHIT">
+<span class='line'>2880</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">opts</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2881</span> </span><span class="WHIT">      </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">opts</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.axes_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2882</span> </span><span class="WHIT">      </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">opts</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">valueRange</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// shouldn't inherit this.</span><span class="WHIT">
+<span class='line'>2883</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">yAxisId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.axes_.length</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2884</span> </span><span class="WHIT">      </span><span class="NAME">opts.yAxisId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">yAxisId</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2885</span> </span><span class="WHIT">      </span><span class="NAME">opts.g</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2886</span> </span><span class="WHIT">      </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">opts</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2887</span> </span><span class="WHIT">      </span><span class="NAME">this.axes_.push</span><span class="PUNC">(</span><span class="NAME">opts</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2888</span> </span><span class="WHIT">      </span><span class="NAME">this.seriesToAxisMap_</span><span class="PUNC">[</span><span class="NAME">seriesName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">yAxisId</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2889</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2890</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2891</span> 
+<span class='line'>2892</span> </span><span class="WHIT">  </span><span class="COMM">// Go through one more time and assign series to an axis defined by another</span><span class="WHIT">
+<span class='line'>2893</span> </span><span class="WHIT">  </span><span class="COMM">// series, e.g. { 'Y1: { axis: {} }, 'Y2': { axis: 'Y1' } }</span><span class="WHIT">
+<span class='line'>2894</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seriesName</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">series</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2895</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">series.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">seriesName</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2896</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"axis"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">seriesName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2897</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2898</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.seriesToAxisMap_.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">axis</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2899</span> </span><span class="WHIT">        </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">"Series "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">seriesName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" wants to share a y-axis with "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>2900</span> </span><span class="WHIT">                   </span><span class="STRN">"series "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">", which does not define its own axis."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2901</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2902</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2903</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.seriesToAxisMap_</span><span class="PUNC">[</span><span class="NAME">axis</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2904</span> </span><span class="WHIT">      </span><span class="NAME">this.seriesToAxisMap_</span><span class="PUNC">[</span><span class="NAME">seriesName</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2905</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2906</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2907</span> 
+<span class='line'>2908</span> </span><span class="WHIT">  </span><span class="COMM">// Now we remove series from seriesToAxisMap_ which are not visible. We do</span><span class="WHIT">
+<span class='line'>2909</span> </span><span class="WHIT">  </span><span class="COMM">// this last so that hiding the first series doesn't destroy the axis</span><span class="WHIT">
+<span class='line'>2910</span> </span><span class="WHIT">  </span><span class="COMM">// properties of the primary axis.</span><span class="WHIT">
+<span class='line'>2911</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seriesToAxisFiltered</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2912</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">vis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.visibility</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2913</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">labels.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2914</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">labels</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2915</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">vis</span><span class="PUNC">[</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">seriesToAxisFiltered</span><span class="PUNC">[</span><span class="NAME">s</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.seriesToAxisMap_</span><span class="PUNC">[</span><span class="NAME">s</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2916</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2917</span> </span><span class="WHIT">  </span><span class="NAME">this.seriesToAxisMap_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">seriesToAxisFiltered</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2918</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2919</span> 
+<span class='line'>2920</span> </span><span class="COMM">/**
+<span class='line'>2921</span>  * Returns the number of y-axes on the chart.
+<span class='line'>2922</span>  * @return {Number} the number of axes.
+<span class='line'>2923</span>  */</span><span class="WHIT">
+<span class='line'>2924</span> </span><span class="NAME">Dygraph.prototype.numAxes</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2925</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">last_axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2926</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">series</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">this.seriesToAxisMap_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2927</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.seriesToAxisMap_.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">series</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2928</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.seriesToAxisMap_</span><span class="PUNC">[</span><span class="NAME">series</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2929</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NAME">last_axis</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">last_axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2930</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2931</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">last_axis</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2932</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2933</span> 
+<span class='line'>2934</span> </span><span class="COMM">/**
+<span class='line'>2935</span>  * @private
+<span class='line'>2936</span>  * Determine the value range and tick marks for each axis.
+<span class='line'>2937</span>  * @param {Object} extremes A mapping from seriesName -> [low, high]
+<span class='line'>2938</span>  * This fills in the valueRange and ticks fields in each entry of this.axes_.
+<span class='line'>2939</span>  */</span><span class="WHIT">
+<span class='line'>2940</span> </span><span class="NAME">Dygraph.prototype.computeYAxisRanges_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">extremes</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2941</span> </span><span class="WHIT">  </span><span class="COMM">// Build a map from axis number -> [list of series names]</span><span class="WHIT">
+<span class='line'>2942</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">seriesForAxis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2943</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">series</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">this.seriesToAxisMap_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2944</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.seriesToAxisMap_.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">series</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2945</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.seriesToAxisMap_</span><span class="PUNC">[</span><span class="NAME">series</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2946</span> </span><span class="WHIT">    </span><span class="KEYW">while</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">seriesForAxis.length</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">seriesForAxis.push</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2947</span> </span><span class="WHIT">    </span><span class="NAME">seriesForAxis</span><span class="PUNC">[</span><span class="NAME">idx</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">push</span><span class="PUNC">(</span><span class="NAME">series</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2948</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2949</span> 
+<span class='line'>2950</span> </span><span class="WHIT">  </span><span class="COMM">// Compute extreme values, a span and tick marks for each axis.</span><span class="WHIT">
+<span class='line'>2951</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.axes_.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2952</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.axes_</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2953</span> </span><span class="WHIT"> 
+<span class='line'>2954</span>     </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">seriesForAxis</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2955</span> </span><span class="WHIT">      </span><span class="COMM">// If no series are defined or visible then use a reasonable default</span><span class="WHIT">
+<span class='line'>2956</span> </span><span class="WHIT">      </span><span class="NAME">axis.extremeRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2957</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2958</span> </span><span class="WHIT">      </span><span class="COMM">// Calculate the extremes of extremes.</span><span class="WHIT">
+<span class='line'>2959</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">series</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">seriesForAxis</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2960</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Infinity</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// extremes[series[0]][0];</span><span class="WHIT">
+<span class='line'>2961</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NAME">Infinity</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// extremes[series[0]][1];</span><span class="WHIT">
+<span class='line'>2962</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">extremeMinY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">extremeMaxY</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2963</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">series.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2964</span> </span><span class="WHIT">        </span><span class="COMM">// Only use valid extremes to stop null data series' from corrupting the scale.</span><span class="WHIT">
+<span class='line'>2965</span> </span><span class="WHIT">        </span><span class="NAME">extremeMinY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">extremes</span><span class="PUNC">[</span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2966</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extremeMinY</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2967</span> </span><span class="WHIT">          </span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.min</span><span class="PUNC">(</span><span class="NAME">extremeMinY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2968</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2969</span> </span><span class="WHIT">        </span><span class="NAME">extremeMaxY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">extremes</span><span class="PUNC">[</span><span class="NAME">series</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2970</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extremeMaxY</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2971</span> </span><span class="WHIT">          </span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.max</span><span class="PUNC">(</span><span class="NAME">extremeMaxY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2972</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2973</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2974</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis.includeZero</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2975</span> 
+<span class='line'>2976</span> </span><span class="WHIT">      </span><span class="COMM">// Ensure we have a valid scale, otherwise defualt to zero for safety.</span><span class="WHIT">
+<span class='line'>2977</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">Infinity</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2978</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NAME">Infinity</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2979</span> 
+<span class='line'>2980</span> </span><span class="WHIT">      </span><span class="COMM">// Add some padding and round up to an integer to be human-friendly.</span><span class="WHIT">
+<span class='line'>2981</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">span</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2982</span> </span><span class="WHIT">      </span><span class="COMM">// special case: if we have no sense of scale, use +/-10% of the sole value.</span><span class="WHIT">
+<span class='line'>2983</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">span</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">span</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2984</span> 
+<span class='line'>2985</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxAxisY</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2986</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minAxisY</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2987</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis.logscale</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2988</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxAxisY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">0.1</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">span</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2989</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minAxisY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2990</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2991</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">maxAxisY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">0.1</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">span</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2992</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">minAxisY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">0.1</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">span</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2993</span> 
+<span class='line'>2994</span> </span><span class="WHIT">        </span><span class="COMM">// Try to include zero and make it minAxisY (or maxAxisY) if it makes sense.</span><span class="WHIT">
+<span class='line'>2995</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"avoidMinZero"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>2996</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minAxisY</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">minAxisY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2997</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">maxAxisY</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">maxAxisY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>2998</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>2999</span> 
+<span class='line'>3000</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"includeZero"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3001</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">maxY</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">maxAxisY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3002</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">minY</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">minAxisY</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3003</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3004</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3005</span> </span><span class="WHIT">      </span><span class="NAME">axis.extremeRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">minAxisY</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">maxAxisY</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3006</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3007</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis.valueWindow</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3008</span> </span><span class="WHIT">      </span><span class="COMM">// This is only set if the user has zoomed on the y-axis. It is never set</span><span class="WHIT">
+<span class='line'>3009</span> </span><span class="WHIT">      </span><span class="COMM">// by a user. It takes precedence over axis.valueRange because, if you set</span><span class="WHIT">
+<span class='line'>3010</span> </span><span class="WHIT">      </span><span class="COMM">// valueRange, you'd still expect to be able to pan.</span><span class="WHIT">
+<span class='line'>3011</span> </span><span class="WHIT">      </span><span class="NAME">axis.computedValueRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">axis.valueWindow</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis.valueWindow</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3012</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">axis.valueRange</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3013</span> </span><span class="WHIT">      </span><span class="COMM">// This is a user-set value range for this axis.</span><span class="WHIT">
+<span class='line'>3014</span> </span><span class="WHIT">      </span><span class="NAME">axis.computedValueRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">axis.valueRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis.valueRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3015</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3016</span> </span><span class="WHIT">      </span><span class="NAME">axis.computedValueRange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">axis.extremeRange</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3017</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3018</span> 
+<span class='line'>3019</span> </span><span class="WHIT">    </span><span class="COMM">// Add ticks. By default, all axes inherit the tick positions of the</span><span class="WHIT">
+<span class='line'>3020</span> </span><span class="WHIT">    </span><span class="COMM">// primary axis. However, if an axis is specifically marked as having</span><span class="WHIT">
+<span class='line'>3021</span> </span><span class="WHIT">    </span><span class="COMM">// independent ticks, then that is permissible as well.</span><span class="WHIT">
+<span class='line'>3022</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">axis.independentTicks</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3023</span> </span><span class="WHIT">      </span><span class="NAME">axis.ticks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
+<span class='line'>3024</span> </span><span class="WHIT">        </span><span class="NAME">Dygraph.numericTicks</span><span class="PUNC">(</span><span class="NAME">axis.computedValueRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3025</span> </span><span class="WHIT">                             </span><span class="NAME">axis.computedValueRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3026</span> </span><span class="WHIT">                             </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3027</span> </span><span class="WHIT">                             </span><span class="NAME">axis</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3028</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3029</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p_axis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.axes_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3030</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p_ticks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p_axis.ticks</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3031</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p_scale</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">p_axis.computedValueRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">p_axis.computedValueRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3032</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">axis.computedValueRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">axis.computedValueRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3033</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">tick_values</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3034</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">p_ticks.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3035</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">y_frac</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">p_ticks</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">v</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">p_axis.computedValueRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">p_scale</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3036</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">y_val</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">axis.computedValueRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">y_frac</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">scale</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3037</span> </span><span class="WHIT">        </span><span class="NAME">tick_values.push</span><span class="PUNC">(</span><span class="NAME">y_val</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3038</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3039</span> 
+<span class='line'>3040</span> </span><span class="WHIT">      </span><span class="NAME">axis.ticks</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
+<span class='line'>3041</span> </span><span class="WHIT">        </span><span class="NAME">Dygraph.numericTicks</span><span class="PUNC">(</span><span class="NAME">axis.computedValueRange</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3042</span> </span><span class="WHIT">                             </span><span class="NAME">axis.computedValueRange</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3043</span> </span><span class="WHIT">                             </span><span class="KEYW">this</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">axis</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">tick_values</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3044</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3045</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3046</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3047</span> </span><span class="WHIT"> 
+<span class='line'>3048</span> </span><span class="COMM">/**
+<span class='line'>3049</span>  * @private
+<span class='line'>3050</span>  * Calculates the rolling average of a data set.
+<span class='line'>3051</span>  * If originalData is [label, val], rolls the average of those.
+<span class='line'>3052</span>  * If originalData is [label, [, it's interpreted as [value, stddev]
+<span class='line'>3053</span>  *   and the roll is returned in the same form, with appropriately reduced
+<span class='line'>3054</span>  *   stddev for each value.
+<span class='line'>3055</span>  * Note that this is where fractional input (i.e. '5/10') is converted into
+<span class='line'>3056</span>  *   decimal values.
+<span class='line'>3057</span>  * @param {Array} originalData The data in the appropriate format (see above)
+<span class='line'>3058</span>  * @param {Number} rollPeriod The number of points over which to average the
+<span class='line'>3059</span>  *                            data
+<span class='line'>3060</span>  */</span><span class="WHIT">
+<span class='line'>3061</span> </span><span class="NAME">Dygraph.prototype.rollingAverage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">originalData</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rollPeriod</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3062</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">originalData.length</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT">
+<span class='line'>3063</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3064</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rollPeriod</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.min</span><span class="PUNC">(</span><span class="NAME">rollPeriod</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">originalData.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3065</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rollingData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3066</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sigma</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"sigma"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3067</span> 
+<span class='line'>3068</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.fractions_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3069</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">num</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3070</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">den</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// numerator/denominator</span><span class="WHIT">
+<span class='line'>3071</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mult</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">100.0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3072</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">originalData.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3073</span> </span><span class="WHIT">      </span><span class="NAME">num</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3074</span> </span><span class="WHIT">      </span><span class="NAME">den</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3075</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">rollPeriod</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3076</span> </span><span class="WHIT">        </span><span class="NAME">num</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">rollPeriod</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3077</span> </span><span class="WHIT">        </span><span class="NAME">den</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">rollPeriod</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3078</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3079</span> 
+<span class='line'>3080</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">date</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3081</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">den</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">num</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">den</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0.0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3082</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"errorBars"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3083</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.wilsonInterval_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3084</span> </span><span class="WHIT">          </span><span class="COMM">// For more details on this confidence interval, see:</span><span class="WHIT">
+<span class='line'>3085</span> </span><span class="WHIT">          </span><span class="COMM">// http://en.wikipedia.org/wiki/Binomial_confidence_interval</span><span class="WHIT">
+<span class='line'>3086</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">den</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3087</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">den</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3088</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pm</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sigma</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">Math.sqrt</span><span class="PUNC">(</span><span class="NAME">p</span><span class="PUNC">*</span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">-</span><span class="NAME">p</span><span class="PUNC">)</span><span class="PUNC">/</span><span class="NAME">n</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">sigma</span><span class="PUNC">*</span><span class="NAME">sigma</span><span class="PUNC">/</span><span class="PUNC">(</span><span class="NUMB">4</span><span class="PUNC">*</span><span class="NAME">n</span><span class="PUNC">*</span><span class="NAME">n</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3089</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">denom</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">sigma</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">sigma</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">den</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3090</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">low</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">sigma</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">sigma</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">den</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">pm</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">denom</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3091</span> </span><span class="WHIT">            </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">high</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">sigma</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">sigma</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">den</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">pm</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">denom</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3092</span> </span><span class="WHIT">            </span><span class="NAME">rollingData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">date</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3093</span> </span><span class="WHIT">                              </span><span class="PUNC">[</span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">mult</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">p</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">low</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">mult</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">high</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">p</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">mult</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3094</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3095</span> </span><span class="WHIT">            </span><span class="NAME">rollingData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">date</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3096</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3097</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3098</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">stddev</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">den</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">sigma</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">Math.sqrt</span><span class="PUNC">(</span><span class="NAME">value</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">den</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">1.0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3099</span> </span><span class="WHIT">          </span><span class="NAME">rollingData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">date</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">mult</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mult</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">stddev</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mult</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">stddev</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3100</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3101</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3102</span> </span><span class="WHIT">        </span><span class="NAME">rollingData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">date</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">mult</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3103</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3104</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3105</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"customBars"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3106</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3107</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3108</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">high</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3109</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">count</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3110</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">originalData.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3111</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">data</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3112</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3113</span> </span><span class="WHIT">      </span><span class="NAME">rollingData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">y</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3114</span> 
+<span class='line'>3115</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">y</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3116</span> </span><span class="WHIT">        </span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3117</span> </span><span class="WHIT">        </span><span class="NAME">mid</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">y</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3118</span> </span><span class="WHIT">        </span><span class="NAME">high</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3119</span> </span><span class="WHIT">        </span><span class="NAME">count</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3120</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3121</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">rollPeriod</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3122</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">prev</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">rollPeriod</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3123</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">prev</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">prev</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3124</span> </span><span class="WHIT">          </span><span class="NAME">low</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">prev</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3125</span> </span><span class="WHIT">          </span><span class="NAME">mid</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">prev</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3126</span> </span><span class="WHIT">          </span><span class="NAME">high</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">prev</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3127</span> </span><span class="WHIT">          </span><span class="NAME">count</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3128</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3129</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3130</span> </span><span class="WHIT">      </span><span class="NAME">rollingData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NUMB">1.0</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">mid</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">count</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3131</span> </span><span class="WHIT">                                              </span><span class="NUMB">1.0</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">mid</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">low</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">count</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3132</span> </span><span class="WHIT">                                              </span><span class="NUMB">1.0</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">high</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">mid</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">count</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3133</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3134</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3135</span> </span><span class="WHIT">    </span><span class="COMM">// Calculate the rolling average for the first rollPeriod - 1 points where</span><span class="WHIT">
+<span class='line'>3136</span> </span><span class="WHIT">    </span><span class="COMM">// there is not enough data to roll over the full number of points</span><span class="WHIT">
+<span class='line'>3137</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">num_init_points</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.min</span><span class="PUNC">(</span><span class="NAME">rollPeriod</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">originalData.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3138</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"errorBars"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3139</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">rollPeriod</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3140</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3141</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3142</span> 
+<span class='line'>3143</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">originalData.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3144</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sum</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3145</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">num_ok</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3146</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.max</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">rollPeriod</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3147</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3148</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">y</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3149</span> </span><span class="WHIT">          </span><span class="NAME">num_ok</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3150</span> </span><span class="WHIT">          </span><span class="NAME">sum</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3151</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3152</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">num_ok</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3153</span> </span><span class="WHIT">          </span><span class="NAME">rollingData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sum</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">num_ok</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3154</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3155</span> </span><span class="WHIT">          </span><span class="NAME">rollingData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3156</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3157</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3158</span> 
+<span class='line'>3159</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3160</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">originalData.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3161</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sum</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3162</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">variance</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3163</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">num_ok</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3164</span> </span><span class="WHIT">        </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.max</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">rollPeriod</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3165</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3166</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">y</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">y</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3167</span> </span><span class="WHIT">          </span><span class="NAME">num_ok</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3168</span> </span><span class="WHIT">          </span><span class="NAME">sum</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3169</span> </span><span class="WHIT">          </span><span class="NAME">variance</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.pow</span><span class="PUNC">(</span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3170</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3171</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">num_ok</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3172</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">stddev</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Math.sqrt</span><span class="PUNC">(</span><span class="NAME">variance</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">num_ok</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3173</span> </span><span class="WHIT">          </span><span class="NAME">rollingData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3174</span> </span><span class="WHIT">                            </span><span class="PUNC">[</span><span class="NAME">sum</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NAME">num_ok</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sigma</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">stddev</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">sigma</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">stddev</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3175</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3176</span> </span><span class="WHIT">          </span><span class="NAME">rollingData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">originalData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3177</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3178</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3179</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3180</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3181</span> 
+<span class='line'>3182</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">rollingData</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3183</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3184</span> 
+<span class='line'>3185</span> </span><span class="COMM">/**
+<span class='line'>3186</span>  * @private
+<span class='line'>3187</span>  * Parses a date, returning the number of milliseconds since epoch. This can be
+<span class='line'>3188</span>  * passed in as an xValueParser in the Dygraph constructor.
+<span class='line'>3189</span>  * TODO(danvk): enumerate formats that this understands.
+<span class='line'>3190</span>  * @param {String} A date in YYYYMMDD format.
+<span class='line'>3191</span>  * @return {Number} Milliseconds since epoch.
+<span class='line'>3192</span>  */</span><span class="WHIT">
+<span class='line'>3193</span> </span><span class="NAME">Dygraph.dateParser</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">dateStr</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3194</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dateStrSlashed</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3195</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">d</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3196</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dateStr.search</span><span class="PUNC">(</span><span class="STRN">"-"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">// e.g. '2009-7-12' or '2009-07-12'</span><span class="WHIT">
+<span class='line'>3197</span> </span><span class="WHIT">    </span><span class="NAME">dateStrSlashed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dateStr.replace</span><span class="PUNC">(</span><span class="STRN">"-"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"g"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3198</span> </span><span class="WHIT">    </span><span class="KEYW">while</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dateStrSlashed.search</span><span class="PUNC">(</span><span class="STRN">"-"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3199</span> </span><span class="WHIT">      </span><span class="NAME">dateStrSlashed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dateStrSlashed.replace</span><span class="PUNC">(</span><span class="STRN">"-"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3200</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3201</span> </span><span class="WHIT">    </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateStrToMillis</span><span class="PUNC">(</span><span class="NAME">dateStrSlashed</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3202</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">dateStr.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">8</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">// e.g. '20090712'</span><span class="WHIT">
+<span class='line'>3203</span> </span><span class="WHIT">    </span><span class="COMM">// TODO(danvk): remove support for this format. It's confusing.</span><span class="WHIT">
+<span class='line'>3204</span> </span><span class="WHIT">    </span><span class="NAME">dateStrSlashed</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">dateStr.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="NUMB">4</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">dateStr.substr</span><span class="PUNC">(</span><span class="NUMB">4</span><span class="PUNC">,</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT">
+<span class='line'>3205</span> </span><span class="WHIT">                       </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">dateStr.substr</span><span class="PUNC">(</span><span class="NUMB">6</span><span class="PUNC">,</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3206</span> </span><span class="WHIT">    </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateStrToMillis</span><span class="PUNC">(</span><span class="NAME">dateStrSlashed</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3207</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3208</span> </span><span class="WHIT">    </span><span class="COMM">// Any format that Date.parse will accept, e.g. "2009/07/12" or</span><span class="WHIT">
+<span class='line'>3209</span> </span><span class="WHIT">    </span><span class="COMM">// "2009/07/12 12:34:56"</span><span class="WHIT">
+<span class='line'>3210</span> </span><span class="WHIT">    </span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateStrToMillis</span><span class="PUNC">(</span><span class="NAME">dateStr</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3211</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3212</span> 
+<span class='line'>3213</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">d</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">d</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3214</span> </span><span class="WHIT">    </span><span class="NAME">self.error</span><span class="PUNC">(</span><span class="STRN">"Couldn't parse "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">dateStr</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" as a date"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3215</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3216</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">d</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3217</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3218</span> 
+<span class='line'>3219</span> </span><span class="COMM">/**
+<span class='line'>3220</span>  * Detects the type of the str (date or numeric) and sets the various
+<span class='line'>3221</span>  * formatting attributes in this.attrs_ based on this type.
+<span class='line'>3222</span>  * @param {String} str An x value.
+<span class='line'>3223</span>  * @private
+<span class='line'>3224</span>  */</span><span class="WHIT">
+<span class='line'>3225</span> </span><span class="NAME">Dygraph.prototype.detectTypeFromString_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3226</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">isDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3227</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">str.indexOf</span><span class="PUNC">(</span><span class="STRN">'-'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
+<span class='line'>3228</span> </span><span class="WHIT">      </span><span class="NAME">str.indexOf</span><span class="PUNC">(</span><span class="STRN">'/'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
+<span class='line'>3229</span> </span><span class="WHIT">      </span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">parseFloat</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3230</span> </span><span class="WHIT">    </span><span class="NAME">isDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3231</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">str.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">8</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="STRN">'19700101'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">str</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="STRN">'20371231'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3232</span> </span><span class="WHIT">    </span><span class="COMM">// TODO(danvk): remove support for this format.</span><span class="WHIT">
+<span class='line'>3233</span> </span><span class="WHIT">    </span><span class="NAME">isDate</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3234</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3235</span> 
+<span class='line'>3236</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">isDate</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3237</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xValueFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateString_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3238</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xValueParser</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateParser</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3239</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xTicker</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateTicker</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3240</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xAxisLabelFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateAxisFormatter</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3241</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3242</span> </span><span class="WHIT">    </span><span class="COMM">// TODO(danvk): use Dygraph.numberFormatter here?</span><span class="WHIT">
+<span class='line'>3243</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xValueFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3244</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xValueParser</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">parseFloat</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3245</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xTicker</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.numericTicks</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3246</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xAxisLabelFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attrs_.xValueFormatter</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3247</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3248</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3249</span> 
+<span class='line'>3250</span> </span><span class="COMM">/**
+<span class='line'>3251</span>  * Parses the value as a floating point number. This is like the parseFloat()
+<span class='line'>3252</span>  * built-in, but with a few differences:
+<span class='line'>3253</span>  * - the empty string is parsed as null, rather than NaN.
+<span class='line'>3254</span>  * - if the string cannot be parsed at all, an error is logged.
+<span class='line'>3255</span>  * If the string can't be parsed, this method returns null.
+<span class='line'>3256</span>  * @param {String} x The string to be parsed
+<span class='line'>3257</span>  * @param {Number} opt_line_no The line number from which the string comes.
+<span class='line'>3258</span>  * @param {String} opt_line The text of the line from which the string comes.
+<span class='line'>3259</span>  * @private
+<span class='line'>3260</span>  */</span><span class="WHIT">
+<span class='line'>3261</span> 
+<span class='line'>3262</span> </span><span class="COMM">// Parse the x as a float or return null if it's not a number.</span><span class="WHIT">
+<span class='line'>3263</span> </span><span class="NAME">Dygraph.prototype.parseFloat_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">opt_line_no</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">opt_line</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3264</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseFloat</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3265</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">val</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3266</span> 
+<span class='line'>3267</span> </span><span class="WHIT">  </span><span class="COMM">// Try to figure out what happeend.</span><span class="WHIT">
+<span class='line'>3268</span> </span><span class="WHIT">  </span><span class="COMM">// If the value is the empty string, parse it as null.</span><span class="WHIT">
+<span class='line'>3269</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="REGX">/^ *$/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3270</span> 
+<span class='line'>3271</span> </span><span class="WHIT">  </span><span class="COMM">// If it was actually "NaN", return it as NaN.</span><span class="WHIT">
+<span class='line'>3272</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="REGX">/^ *nan *$/i</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">NaN</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3273</span> 
+<span class='line'>3274</span> </span><span class="WHIT">  </span><span class="COMM">// Looks like a parsing error.</span><span class="WHIT">
+<span class='line'>3275</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">msg</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"Unable to parse '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"' as a number"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3276</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">opt_line</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">opt_line_no</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3277</span> </span><span class="WHIT">    </span><span class="NAME">msg</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">" on line "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">+</span><span class="NAME">opt_line_no</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" ('"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">opt_line</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"') of CSV."</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3278</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3279</span> </span><span class="WHIT">  </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="NAME">msg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3280</span> 
+<span class='line'>3281</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3282</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3283</span> 
+<span class='line'>3284</span> </span><span class="COMM">/**
+<span class='line'>3285</span>  * @private
+<span class='line'>3286</span>  * Parses a string in a special csv format.  We expect a csv file where each
+<span class='line'>3287</span>  * line is a date point, and the first field in each line is the date string.
+<span class='line'>3288</span>  * We also expect that all remaining fields represent series.
+<span class='line'>3289</span>  * if the errorBars attribute is set, then interpret the fields as:
+<span class='line'>3290</span>  * date, series1, stddev1, series2, stddev2, ...
+<span class='line'>3291</span>  * @param {[Object]} data See above.
+<span class='line'>3292</span>  *
+<span class='line'>3293</span>  * @return [Object] An array with one entry for each row. These entries
+<span class='line'>3294</span>  * are an array of cells in that row. The first entry is the parsed x-value for
+<span class='line'>3295</span>  * the row. The second, third, etc. are the y-values. These can take on one of
+<span class='line'>3296</span>  * three forms, depending on the CSV and constructor parameters:
+<span class='line'>3297</span>  * 1. numeric value
+<span class='line'>3298</span>  * 2. [ value, stddev ]
+<span class='line'>3299</span>  * 3. [ low value, center value, high value ]
+<span class='line'>3300</span>  */</span><span class="WHIT">
+<span class='line'>3301</span> </span><span class="NAME">Dygraph.prototype.parseCSV_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3302</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3303</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data.split</span><span class="PUNC">(</span><span class="STRN">"\n"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3304</span> 
+<span class='line'>3305</span> </span><span class="WHIT">  </span><span class="COMM">// Use the default delimiter or fall back to a tab if that makes sense.</span><span class="WHIT">
+<span class='line'>3306</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">delim</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'delimiter'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3307</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">lines</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">indexOf</span><span class="PUNC">(</span><span class="NAME">delim</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">indexOf</span><span class="PUNC">(</span><span class="STRN">'\t'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3308</span> </span><span class="WHIT">    </span><span class="NAME">delim</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">'\t'</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3309</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3310</span> 
+<span class='line'>3311</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">start</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3312</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.labelsFromCSV_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3313</span> </span><span class="WHIT">    </span><span class="NAME">start</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3314</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">split</span><span class="PUNC">(</span><span class="NAME">delim</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3315</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3316</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">line_no</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3317</span> 
+<span class='line'>3318</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">xParser</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3319</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">defaultParserSet</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// attempt to auto-detect x value type</span><span class="WHIT">
+<span class='line'>3320</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">expectedCols</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labels"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3321</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">outOfOrder</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3322</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">start</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">lines.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3323</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">line</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">lines</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3324</span> </span><span class="WHIT">    </span><span class="NAME">line_no</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3325</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">line.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// skip blank lines</span><span class="WHIT">
+<span class='line'>3326</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">line</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'#'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">    </span><span class="COMM">// skip comment lines</span><span class="WHIT">
+<span class='line'>3327</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">inFields</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">line.split</span><span class="PUNC">(</span><span class="NAME">delim</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3328</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">inFields.length</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3329</span> 
+<span class='line'>3330</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">fields</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3331</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">defaultParserSet</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3332</span> </span><span class="WHIT">      </span><span class="NAME">this.detectTypeFromString_</span><span class="PUNC">(</span><span class="NAME">inFields</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3333</span> </span><span class="WHIT">      </span><span class="NAME">xParser</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"xValueParser"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3334</span> </span><span class="WHIT">      </span><span class="NAME">defaultParserSet</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3335</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3336</span> </span><span class="WHIT">    </span><span class="NAME">fields</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">xParser</span><span class="PUNC">(</span><span class="NAME">inFields</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3337</span> 
+<span class='line'>3338</span> </span><span class="WHIT">    </span><span class="COMM">// If fractions are expected, parse the numbers as "A/B"</span><span class="WHIT">
+<span class='line'>3339</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.fractions_</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3340</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">inFields.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3341</span> </span><span class="WHIT">        </span><span class="COMM">// TODO(danvk): figure out an appropriate way to flag parse errors.</span><span class="WHIT">
+<span class='line'>3342</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">vals</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">inFields</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">split</span><span class="PUNC">(</span><span class="STRN">"/"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3343</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">vals.length</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3344</span> </span><span class="WHIT">          </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">'Expected fractional "num/den" values in CSV data '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3345</span> </span><span class="WHIT">                     </span><span class="STRN">"but found a value '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">inFields</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"' on line "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3346</span> </span><span class="WHIT">                     </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" ('"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">line</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"') which is not of this form."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3347</span> </span><span class="WHIT">          </span><span class="NAME">fields</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3348</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3349</span> </span><span class="WHIT">          </span><span class="NAME">fields</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.parseFloat_</span><span class="PUNC">(</span><span class="NAME">vals</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">line</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3350</span> </span><span class="WHIT">                       </span><span class="NAME">this.parseFloat_</span><span class="PUNC">(</span><span class="NAME">vals</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">line</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3351</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3352</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3353</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"errorBars"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3354</span> </span><span class="WHIT">      </span><span class="COMM">// If there are error bars, values are (value, stddev) pairs</span><span class="WHIT">
+<span class='line'>3355</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">inFields.length</span><span class="WHIT"> </span><span class="PUNC">%</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3356</span> </span><span class="WHIT">        </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">'Expected alternating (value, stdev.) pairs in CSV data '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3357</span> </span><span class="WHIT">                   </span><span class="STRN">'but line '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' has an odd number of values ('</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3358</span> </span><span class="WHIT">                   </span><span class="PUNC">(</span><span class="NAME">inFields.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"): '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">line</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"'"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3359</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3360</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">inFields.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3361</span> </span><span class="WHIT">        </span><span class="NAME">fields</span><span class="PUNC">[</span><span class="PUNC">(</span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">/</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">this.parseFloat_</span><span class="PUNC">(</span><span class="NAME">inFields</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">line</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3362</span> </span><span class="WHIT">                               </span><span class="NAME">this.parseFloat_</span><span class="PUNC">(</span><span class="NAME">inFields</span><span class="PUNC">[</span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">line</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3363</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3364</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"customBars"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3365</span> </span><span class="WHIT">      </span><span class="COMM">// Bars are a low;center;high tuple</span><span class="WHIT">
+<span class='line'>3366</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">inFields.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3367</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">inFields</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3368</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="REGX">/^ *$/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">val</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3369</span> </span><span class="WHIT">          </span><span class="NAME">fields</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3370</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3371</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">vals</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">val.split</span><span class="PUNC">(</span><span class="STRN">";"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3372</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">vals.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3373</span> </span><span class="WHIT">            </span><span class="NAME">fields</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">this.parseFloat_</span><span class="PUNC">(</span><span class="NAME">vals</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">line</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3374</span> </span><span class="WHIT">                          </span><span class="NAME">this.parseFloat_</span><span class="PUNC">(</span><span class="NAME">vals</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">line</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>3375</span> </span><span class="WHIT">                          </span><span class="NAME">this.parseFloat_</span><span class="PUNC">(</span><span class="NAME">vals</span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">line</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3376</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3377</span> </span><span class="WHIT">            </span><span class="NAME">this.warning</span><span class="PUNC">(</span><span class="STRN">'When using customBars, values must be either blank '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3378</span> </span><span class="WHIT">                         </span><span class="STRN">'or "low;center;high" tuples (got "'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">val</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3379</span> </span><span class="WHIT">                         </span><span class="STRN">'" on line '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="PUNC">+</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3380</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3381</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3382</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3383</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3384</span> </span><span class="WHIT">      </span><span class="COMM">// Values are just numbers</span><span class="WHIT">
+<span class='line'>3385</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">inFields.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3386</span> </span><span class="WHIT">        </span><span class="NAME">fields</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.parseFloat_</span><span class="PUNC">(</span><span class="NAME">inFields</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">line</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3387</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3388</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3389</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ret.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">fields</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="PUNC">[</span><span class="NAME">ret.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3390</span> </span><span class="WHIT">      </span><span class="NAME">outOfOrder</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3391</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3392</span> 
+<span class='line'>3393</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">fields.length</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NAME">expectedCols</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3394</span> </span><span class="WHIT">      </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">"Number of columns in line "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" ("</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">fields.length</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3395</span> </span><span class="WHIT">                 </span><span class="STRN">") does not agree with number of labels ("</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">expectedCols</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3396</span> </span><span class="WHIT">                 </span><span class="STRN">") "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">line</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3397</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3398</span> 
+<span class='line'>3399</span> </span><span class="WHIT">    </span><span class="COMM">// If the user specified the 'labels' option and none of the cells of the</span><span class="WHIT">
+<span class='line'>3400</span> </span><span class="WHIT">    </span><span class="COMM">// first row parsed correctly, then they probably double-specified the</span><span class="WHIT">
+<span class='line'>3401</span> </span><span class="WHIT">    </span><span class="COMM">// labels. We go with the values set in the option, discard this row and</span><span class="WHIT">
+<span class='line'>3402</span> </span><span class="WHIT">    </span><span class="COMM">// log a warning to the JS console.</span><span class="WHIT">
+<span class='line'>3403</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'labels'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3404</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">all_null</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3405</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">all_null</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">fields.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3406</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">fields</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">all_null</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3407</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3408</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">all_null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3409</span> </span><span class="WHIT">        </span><span class="NAME">this.warn</span><span class="PUNC">(</span><span class="STRN">"The dygraphs 'labels' option is set, but the first row of "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3410</span> </span><span class="WHIT">                  </span><span class="STRN">"CSV data ('"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">line</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"') appears to also contain labels. "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3411</span> </span><span class="WHIT">                  </span><span class="STRN">"Will drop the CSV labels and use the option labels."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3412</span> </span><span class="WHIT">        </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3413</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3414</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3415</span> </span><span class="WHIT">    </span><span class="NAME">ret.push</span><span class="PUNC">(</span><span class="NAME">fields</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3416</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3417</span> 
+<span class='line'>3418</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">outOfOrder</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3419</span> </span><span class="WHIT">    </span><span class="NAME">this.warn</span><span class="PUNC">(</span><span class="STRN">"CSV is out of order; order it correctly to speed loading."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3420</span> </span><span class="WHIT">    </span><span class="NAME">ret.sort</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3421</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3422</span> 
+<span class='line'>3423</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3424</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3425</span> 
+<span class='line'>3426</span> </span><span class="COMM">/**
+<span class='line'>3427</span>  * @private
+<span class='line'>3428</span>  * The user has provided their data as a pre-packaged JS array. If the x values
+<span class='line'>3429</span>  * are numeric, this is the same as dygraphs' internal format. If the x values
+<span class='line'>3430</span>  * are dates, we need to convert them from Date objects to ms since epoch.
+<span class='line'>3431</span>  * @param {[Object]} data
+<span class='line'>3432</span>  * @return {[Object]} data with numeric x values.
+<span class='line'>3433</span>  */</span><span class="WHIT">
+<span class='line'>3434</span> </span><span class="NAME">Dygraph.prototype.parseArray_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3435</span> </span><span class="WHIT">  </span><span class="COMM">// Peek at the first x value to see if it's numeric.</span><span class="WHIT">
+<span class='line'>3436</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">data.length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3437</span> </span><span class="WHIT">    </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">"Can't plot empty data set"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3438</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3439</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3440</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3441</span> </span><span class="WHIT">    </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">"Data set cannot contain an empty row"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3442</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3443</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3444</span> 
+<span class='line'>3445</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labels"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3446</span> </span><span class="WHIT">    </span><span class="NAME">this.warn</span><span class="PUNC">(</span><span class="STRN">"Using default labels. Set labels explicitly via 'labels' "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3447</span> </span><span class="WHIT">              </span><span class="STRN">"in the options parameter"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3448</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> </span><span class="STRN">"X"</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3449</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3450</span> </span><span class="WHIT">      </span><span class="NAME">this.attrs_.labels.push</span><span class="PUNC">(</span><span class="STRN">"Y"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3451</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3452</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3453</span> 
+<span class='line'>3454</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Dygraph.isDateLike</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3455</span> </span><span class="WHIT">    </span><span class="COMM">// Some intelligent defaults for a date x-axis.</span><span class="WHIT">
+<span class='line'>3456</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xValueFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateString_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3457</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xAxisLabelFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateAxisFormatter</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3458</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xTicker</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateTicker</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3459</span> 
+<span class='line'>3460</span> </span><span class="WHIT">    </span><span class="COMM">// Assume they're all dates.</span><span class="WHIT">
+<span class='line'>3461</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">parsedData</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.clone</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3462</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">data.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3463</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">parsedData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3464</span> </span><span class="WHIT">        </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">"Row "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" of data is empty"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3465</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3466</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3467</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">parsedData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT">
+<span class='line'>3468</span> </span><span class="WHIT">          </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">parsedData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="WHIT">
+<span class='line'>3469</span> </span><span class="WHIT">          </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">isNaN</span><span class="PUNC">(</span><span class="NAME">parsedData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3470</span> </span><span class="WHIT">        </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">"x value in row "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" is not a Date"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3471</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3472</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3473</span> </span><span class="WHIT">      </span><span class="NAME">parsedData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parsedData</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3474</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3475</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">parsedData</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3476</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3477</span> </span><span class="WHIT">    </span><span class="COMM">// Some intelligent defaults for a numeric x-axis.</span><span class="WHIT">
+<span class='line'>3478</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xValueFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3479</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xTicker</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.numericTicks</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3480</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3481</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3482</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3483</span> 
+<span class='line'>3484</span> </span><span class="COMM">/**
+<span class='line'>3485</span>  * Parses a DataTable object from gviz.
+<span class='line'>3486</span>  * The data is expected to have a first column that is either a date or a
+<span class='line'>3487</span>  * number. All subsequent columns must be numbers. If there is a clear mismatch
+<span class='line'>3488</span>  * between this.xValueParser_ and the type of the first column, it will be
+<span class='line'>3489</span>  * fixed. Fills out rawData_.
+<span class='line'>3490</span>  * @param {[Object]} data See above.
+<span class='line'>3491</span>  * @private
+<span class='line'>3492</span>  */</span><span class="WHIT">
+<span class='line'>3493</span> </span><span class="NAME">Dygraph.prototype.parseDataTable_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3494</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cols</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data.getNumberOfColumns</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3495</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rows</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data.getNumberOfRows</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3496</span> 
+<span class='line'>3497</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">indepType</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data.getColumnType</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3498</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">indepType</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'date'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">indepType</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'datetime'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3499</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xValueFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateString_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3500</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xValueParser</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateParser</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3501</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xTicker</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateTicker</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3502</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xAxisLabelFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.dateAxisFormatter</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3503</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">indepType</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3504</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xValueFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3505</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xValueParser</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">parseFloat</span><span class="PUNC">(</span><span class="NAME">x</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3506</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xTicker</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.numericTicks</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3507</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_.xAxisLabelFormatter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attrs_.xValueFormatter</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3508</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3509</span> </span><span class="WHIT">    </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">"only 'date', 'datetime' and 'number' types are supported for "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3510</span> </span><span class="WHIT">               </span><span class="STRN">"column 1 of DataTable input (Got '"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">indepType</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"')"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3511</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3512</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3513</span> 
+<span class='line'>3514</span> </span><span class="WHIT">  </span><span class="COMM">// Array of the column indices which contain data (and not annotations).</span><span class="WHIT">
+<span class='line'>3515</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">colIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3516</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">annotationCols</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// data index -> [annotation cols]</span><span class="WHIT">
+<span class='line'>3517</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hasAnnotations</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3518</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">cols</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3519</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data.getColumnType</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3520</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3521</span> </span><span class="WHIT">      </span><span class="NAME">colIdx.push</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3522</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">type</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">'displayAnnotations'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3523</span> </span><span class="WHIT">      </span><span class="COMM">// This is OK -- it's an annotation column.</span><span class="WHIT">
+<span class='line'>3524</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">dataIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">colIdx</span><span class="PUNC">[</span><span class="NAME">colIdx.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3525</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">annotationCols.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">dataIdx</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3526</span> </span><span class="WHIT">        </span><span class="NAME">annotationCols</span><span class="PUNC">[</span><span class="NAME">dataIdx</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3527</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3528</span> </span><span class="WHIT">        </span><span class="NAME">annotationCols</span><span class="PUNC">[</span><span class="NAME">dataIdx</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">push</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3529</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3530</span> </span><span class="WHIT">      </span><span class="NAME">hasAnnotations</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3531</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3532</span> </span><span class="WHIT">      </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">"Only 'number' is supported as a dependent type with Gviz."</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3533</span> </span><span class="WHIT">                 </span><span class="STRN">" 'string' is only supported if displayAnnotations is true"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3534</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3535</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3536</span> 
+<span class='line'>3537</span> </span><span class="WHIT">  </span><span class="COMM">// Read column labels</span><span class="WHIT">
+<span class='line'>3538</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): add support back for errorBars</span><span class="WHIT">
+<span class='line'>3539</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NAME">data.getColumnLabel</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3540</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">colIdx.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3541</span> </span><span class="WHIT">    </span><span class="NAME">labels.push</span><span class="PUNC">(</span><span class="NAME">data.getColumnLabel</span><span class="PUNC">(</span><span class="NAME">colIdx</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3542</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"errorBars"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3543</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3544</span> </span><span class="WHIT">  </span><span class="NAME">this.attrs_.labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">labels</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3545</span> </span><span class="WHIT">  </span><span class="NAME">cols</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">labels.length</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3546</span> 
+<span class='line'>3547</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3548</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">outOfOrder</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3549</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">annotations</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3550</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">rows</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3551</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3552</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">data.getValue</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
+<span class='line'>3553</span> </span><span class="WHIT">        </span><span class="NAME">data.getValue</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3554</span> </span><span class="WHIT">      </span><span class="NAME">this.warn</span><span class="PUNC">(</span><span class="STRN">"Ignoring row "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3555</span> </span><span class="WHIT">                </span><span class="STRN">" of DataTable because of undefined or null first column."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3556</span> </span><span class="WHIT">      </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3557</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3558</span> 
+<span class='line'>3559</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">indepType</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'date'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">indepType</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'datetime'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3560</span> </span><span class="WHIT">      </span><span class="NAME">row.push</span><span class="PUNC">(</span><span class="NAME">data.getValue</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3561</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3562</span> </span><span class="WHIT">      </span><span class="NAME">row.push</span><span class="PUNC">(</span><span class="NAME">data.getValue</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3563</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3564</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"errorBars"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3565</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">colIdx.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3566</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">col</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">colIdx</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3567</span> </span><span class="WHIT">        </span><span class="NAME">row.push</span><span class="PUNC">(</span><span class="NAME">data.getValue</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">col</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3568</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hasAnnotations</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
+<span class='line'>3569</span> </span><span class="WHIT">            </span><span class="NAME">annotationCols.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">col</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
+<span class='line'>3570</span> </span><span class="WHIT">            </span><span class="NAME">data.getValue</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">annotationCols</span><span class="PUNC">[</span><span class="NAME">col</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3571</span> </span><span class="WHIT">          </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">ann</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3572</span> </span><span class="WHIT">          </span><span class="NAME">ann.series</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data.getColumnLabel</span><span class="PUNC">(</span><span class="NAME">col</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3573</span> </span><span class="WHIT">          </span><span class="NAME">ann.xval</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">row</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3574</span> </span><span class="WHIT">          </span><span class="NAME">ann.shortText</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">String.fromCharCode</span><span class="PUNC">(</span><span class="NUMB">65</span><span class="WHIT"> </span><span class="COMM">/* A */</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">annotations.length</span><span class="PUNC">)</span><span class="WHIT">
+<span class='line'>3575</span> </span><span class="WHIT">          </span><span class="NAME">ann.text</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3576</span> </span><span class="WHIT">          </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">annotationCols</span><span class="PUNC">[</span><span class="NAME">col</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">k</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3577</span> </span><span class="WHIT">            </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">ann.text</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3578</span> </span><span class="WHIT">            </span><span class="NAME">ann.text</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">data.getValue</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">annotationCols</span><span class="PUNC">[</span><span class="NAME">col</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3579</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3580</span> </span><span class="WHIT">          </span><span class="NAME">annotations.push</span><span class="PUNC">(</span><span class="NAME">ann</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3581</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3582</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3583</span> 
+<span class='line'>3584</span> </span><span class="WHIT">      </span><span class="COMM">// Strip out infinities, which give dygraphs problems later on.</span><span class="WHIT">
+<span class='line'>3585</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">row.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3586</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">isFinite</span><span class="PUNC">(</span><span class="NAME">row</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">row</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3587</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3588</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3589</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">cols</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3590</span> </span><span class="WHIT">        </span><span class="NAME">row.push</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="WHIT"> </span><span class="NAME">data.getValue</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data.getValue</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">*</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3591</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3592</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3593</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">ret.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">row</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="PUNC">[</span><span class="NAME">ret.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3594</span> </span><span class="WHIT">      </span><span class="NAME">outOfOrder</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3595</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3596</span> </span><span class="WHIT">    </span><span class="NAME">ret.push</span><span class="PUNC">(</span><span class="NAME">row</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3597</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3598</span> 
+<span class='line'>3599</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">outOfOrder</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3600</span> </span><span class="WHIT">    </span><span class="NAME">this.warn</span><span class="PUNC">(</span><span class="STRN">"DataTable is out of order; order it correctly to speed loading."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3601</span> </span><span class="WHIT">    </span><span class="NAME">ret.sort</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">,</span><span class="NAME">b</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">b</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3602</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3603</span> </span><span class="WHIT">  </span><span class="NAME">this.rawData_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ret</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3604</span> 
+<span class='line'>3605</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">annotations.length</span><span class="WHIT"> </span><span class="PUNC">></span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3606</span> </span><span class="WHIT">    </span><span class="NAME">this.setAnnotations</span><span class="PUNC">(</span><span class="NAME">annotations</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3607</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3608</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3609</span> 
+<span class='line'>3610</span> </span><span class="COMM">/**
+<span class='line'>3611</span>  * @private
+<span class='line'>3612</span>  * This is identical to JavaScript's built-in Date.parse() method, except that
+<span class='line'>3613</span>  * it doesn't get replaced with an incompatible method by aggressive JS
+<span class='line'>3614</span>  * libraries like MooTools or Joomla.
+<span class='line'>3615</span>  * @param { String } str The date string, e.g. "2011/05/06"
+<span class='line'>3616</span>  * @return { Integer } millis since epoch
+<span class='line'>3617</span>  */</span><span class="WHIT">
+<span class='line'>3618</span> </span><span class="NAME">Dygraph.dateStrToMillis</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3619</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Date</span><span class="PUNC">(</span><span class="NAME">str</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">getTime</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3620</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3621</span> 
+<span class='line'>3622</span> </span><span class="COMM">// These functions are all based on MochiKit.</span><span class="WHIT">
+<span class='line'>3623</span> </span><span class="COMM">/**
+<span class='line'>3624</span>  * @private
+<span class='line'>3625</span>  */</span><span class="WHIT">
+<span class='line'>3626</span> </span><span class="NAME">Dygraph.update</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">self</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3627</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3628</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3629</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">o.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3630</span> </span><span class="WHIT">        </span><span class="NAME">self</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">o</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3631</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3632</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3633</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3634</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">self</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3635</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3636</span> 
+<span class='line'>3637</span> </span><span class="COMM">/**
+<span class='line'>3638</span>  * @private
+<span class='line'>3639</span>  */</span><span class="WHIT">
+<span class='line'>3640</span> </span><span class="NAME">Dygraph.isArrayLike</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3641</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">typ</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3642</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="WHIT">
+<span class='line'>3643</span> </span><span class="WHIT">      </span><span class="PUNC">(</span><span class="NAME">typ</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="PUNC">(</span><span class="NAME">typ</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
+<span class='line'>3644</span> </span><span class="WHIT">        </span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">o.item</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
+<span class='line'>3645</span> </span><span class="WHIT">      </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
+<span class='line'>3646</span> </span><span class="WHIT">      </span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">o.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'number'</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
+<span class='line'>3647</span> </span><span class="WHIT">      </span><span class="NAME">o.nodeType</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="WHIT">
+<span class='line'>3648</span> </span><span class="WHIT">     </span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3649</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3650</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3651</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3652</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3653</span> 
+<span class='line'>3654</span> </span><span class="COMM">/**
+<span class='line'>3655</span>  * @private
+<span class='line'>3656</span>  */</span><span class="WHIT">
+<span class='line'>3657</span> </span><span class="NAME">Dygraph.isDateLike</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3658</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">"object"</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">o</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT">
+<span class='line'>3659</span> </span><span class="WHIT">      </span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">o.getTime</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3660</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3661</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3662</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3663</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3664</span> 
+<span class='line'>3665</span> </span><span class="COMM">/**
+<span class='line'>3666</span>  * @private
+<span class='line'>3667</span>  */</span><span class="WHIT">
+<span class='line'>3668</span> </span><span class="NAME">Dygraph.clone</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3669</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): figure out how MochiKit's version works</span><span class="WHIT">
+<span class='line'>3670</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">r</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3671</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">o.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3672</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Dygraph.isArrayLike</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3673</span> </span><span class="WHIT">      </span><span class="NAME">r.push</span><span class="PUNC">(</span><span class="NAME">Dygraph.clone</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3674</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3675</span> </span><span class="WHIT">      </span><span class="NAME">r.push</span><span class="PUNC">(</span><span class="NAME">o</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3676</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3677</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3678</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">r</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3679</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3680</span> 
+<span class='line'>3681</span> 
+<span class='line'>3682</span> </span><span class="COMM">/**
+<span class='line'>3683</span>  * Get the CSV data. If it's in a function, call that function. If it's in a
+<span class='line'>3684</span>  * file, do an XMLHttpRequest to get it.
+<span class='line'>3685</span>  * @private
+<span class='line'>3686</span>  */</span><span class="WHIT">
+<span class='line'>3687</span> </span><span class="NAME">Dygraph.prototype.start_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3688</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">this.file_</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3689</span> </span><span class="WHIT">    </span><span class="COMM">// CSV string. Pretend we got it via XHR.</span><span class="WHIT">
+<span class='line'>3690</span> </span><span class="WHIT">    </span><span class="NAME">this.loadedEvent_</span><span class="PUNC">(</span><span class="NAME">this.file_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3691</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Dygraph.isArrayLike</span><span class="PUNC">(</span><span class="NAME">this.file_</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3692</span> </span><span class="WHIT">    </span><span class="NAME">this.rawData_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.parseArray_</span><span class="PUNC">(</span><span class="NAME">this.file_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3693</span> </span><span class="WHIT">    </span><span class="NAME">this.predraw_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3694</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">this.file_</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT">
+<span class='line'>3695</span> </span><span class="WHIT">             </span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">this.file_.getColumnRange</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'function'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3696</span> </span><span class="WHIT">    </span><span class="COMM">// must be a DataTable from gviz.</span><span class="WHIT">
+<span class='line'>3697</span> </span><span class="WHIT">    </span><span class="NAME">this.parseDataTable_</span><span class="PUNC">(</span><span class="NAME">this.file_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3698</span> </span><span class="WHIT">    </span><span class="NAME">this.predraw_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3699</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">this.file_</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3700</span> </span><span class="WHIT">    </span><span class="COMM">// Heuristic: a newline means it's CSV data. Otherwise it's an URL.</span><span class="WHIT">
+<span class='line'>3701</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.file_.indexOf</span><span class="PUNC">(</span><span class="STRN">'\n'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3702</span> </span><span class="WHIT">      </span><span class="NAME">this.loadedEvent_</span><span class="PUNC">(</span><span class="NAME">this.file_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3703</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3704</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">req</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">XMLHttpRequest</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3705</span> </span><span class="WHIT">      </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">caller</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">this</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3706</span> </span><span class="WHIT">      </span><span class="NAME">req.onreadystatechange</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3707</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">req.readyState</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3708</span> </span><span class="WHIT">          </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">req.status</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NUMB">200</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3709</span> </span><span class="WHIT">            </span><span class="NAME">caller.loadedEvent_</span><span class="PUNC">(</span><span class="NAME">req.responseText</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3710</span> </span><span class="WHIT">          </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3711</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3712</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3713</span> 
+<span class='line'>3714</span> </span><span class="WHIT">      </span><span class="NAME">req.open</span><span class="PUNC">(</span><span class="STRN">"GET"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">this.file_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3715</span> </span><span class="WHIT">      </span><span class="NAME">req.send</span><span class="PUNC">(</span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3716</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3717</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3718</span> </span><span class="WHIT">    </span><span class="NAME">this.error</span><span class="PUNC">(</span><span class="STRN">"Unknown data format: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="WHIT"> </span><span class="NAME">this.file_</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3719</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3720</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3721</span> 
+<span class='line'>3722</span> </span><span class="COMM">/**
+<span class='line'>3723</span>  * Changes various properties of the graph. These can include:
+<span class='line'>3724</span>  * &lt;ul>
+<span class='line'>3725</span>  * &lt;li>file: changes the source data for the graph&lt;/li>
+<span class='line'>3726</span>  * &lt;li>errorBars: changes whether the data contains stddev&lt;/li>
+<span class='line'>3727</span>  * &lt;/ul>
+<span class='line'>3728</span>  *
+<span class='line'>3729</span>  * @param {Object} attrs The new properties and values
+<span class='line'>3730</span>  */</span><span class="WHIT">
+<span class='line'>3731</span> </span><span class="NAME">Dygraph.prototype.updateOptions</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3732</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): this is a mess. Rethink this function.</span><span class="WHIT">
+<span class='line'>3733</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">'rollPeriod'</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3734</span> </span><span class="WHIT">    </span><span class="NAME">this.rollPeriod_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attrs.rollPeriod</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3735</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3736</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">'dateWindow'</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3737</span> </span><span class="WHIT">    </span><span class="NAME">this.dateWindow_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attrs.dateWindow</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3738</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="PUNC">(</span><span class="STRN">'isZoomedIgnoreProgrammaticZoom'</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3739</span> </span><span class="WHIT">      </span><span class="NAME">this.zoomed_x_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attrs.dateWindow</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3740</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3741</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3742</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="STRN">'valueRange'</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="PUNC">(</span><span class="STRN">'isZoomedIgnoreProgrammaticZoom'</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3743</span> </span><span class="WHIT">    </span><span class="NAME">this.zoomed_y_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attrs.valueRange</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3744</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3745</span> 
+<span class='line'>3746</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): validate per-series options.</span><span class="WHIT">
+<span class='line'>3747</span> </span><span class="WHIT">  </span><span class="COMM">// Supported:</span><span class="WHIT">
+<span class='line'>3748</span> </span><span class="WHIT">  </span><span class="COMM">// strokeWidth</span><span class="WHIT">
+<span class='line'>3749</span> </span><span class="WHIT">  </span><span class="COMM">// pointSize</span><span class="WHIT">
+<span class='line'>3750</span> </span><span class="WHIT">  </span><span class="COMM">// drawPoints</span><span class="WHIT">
+<span class='line'>3751</span> </span><span class="WHIT">  </span><span class="COMM">// highlightCircleSize</span><span class="WHIT">
+<span class='line'>3752</span> 
+<span class='line'>3753</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">this.user_attrs_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3754</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.update</span><span class="PUNC">(</span><span class="NAME">this.renderOptions_</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3755</span> 
+<span class='line'>3756</span> </span><span class="WHIT">  </span><span class="NAME">this.labelsFromCSV_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labels"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3757</span> 
+<span class='line'>3758</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): this doesn't match the constructor logic</span><span class="WHIT">
+<span class='line'>3759</span> </span><span class="WHIT">  </span><span class="NAME">this.layout_.updateOptions</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="WHIT"> </span><span class="STRN">'errorBars'</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"errorBars"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3760</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">attrs</span><span class="PUNC">[</span><span class="STRN">'file'</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3761</span> </span><span class="WHIT">    </span><span class="NAME">this.file_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">attrs</span><span class="PUNC">[</span><span class="STRN">'file'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3762</span> </span><span class="WHIT">    </span><span class="NAME">this.start_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3763</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3764</span> </span><span class="WHIT">    </span><span class="NAME">this.predraw_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3765</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3766</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3767</span> 
+<span class='line'>3768</span> </span><span class="COMM">/**
+<span class='line'>3769</span>  * Resizes the dygraph. If no parameters are specified, resizes to fill the
+<span class='line'>3770</span>  * containing div (which has presumably changed size since the dygraph was
+<span class='line'>3771</span>  * instantiated. If the width/height are specified, the div will be resized.
+<span class='line'>3772</span>  *
+<span class='line'>3773</span>  * This is far more efficient than destroying and re-instantiating a
+<span class='line'>3774</span>  * Dygraph, since it doesn't have to reparse the underlying data.
+<span class='line'>3775</span>  *
+<span class='line'>3776</span>  * @param {Number} [width] Width (in pixels)
+<span class='line'>3777</span>  * @param {Number} [height] Height (in pixels)
+<span class='line'>3778</span>  */</span><span class="WHIT">
+<span class='line'>3779</span> </span><span class="NAME">Dygraph.prototype.resize</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">width</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3780</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.resize_lock</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3781</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3782</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3783</span> </span><span class="WHIT">  </span><span class="NAME">this.resize_lock</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3784</span> 
+<span class='line'>3785</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">(</span><span class="NAME">width</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">height</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3786</span> </span><span class="WHIT">    </span><span class="NAME">this.warn</span><span class="PUNC">(</span><span class="STRN">"Dygraph.resize() should be called with zero parameters or "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3787</span> </span><span class="WHIT">              </span><span class="STRN">"two non-NULL parameters. Pretending it was zero."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3788</span> </span><span class="WHIT">    </span><span class="NAME">width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3789</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3790</span> 
+<span class='line'>3791</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): there should be a clear() method.</span><span class="WHIT">
+<span class='line'>3792</span> </span><span class="WHIT">  </span><span class="NAME">this.maindiv_.innerHTML</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3793</span> </span><span class="WHIT">  </span><span class="NAME">this.attrs_.labelsDiv</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3794</span> 
+<span class='line'>3795</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">width</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3796</span> </span><span class="WHIT">    </span><span class="NAME">this.maindiv_.style.width</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">width</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3797</span> </span><span class="WHIT">    </span><span class="NAME">this.maindiv_.style.height</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">height</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"px"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3798</span> </span><span class="WHIT">    </span><span class="NAME">this.width_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">width</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3799</span> </span><span class="WHIT">    </span><span class="NAME">this.height_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">height</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3800</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3801</span> </span><span class="WHIT">    </span><span class="NAME">this.width_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.maindiv_.offsetWidth</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3802</span> </span><span class="WHIT">    </span><span class="NAME">this.height_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.maindiv_.offsetHeight</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3803</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3804</span> 
+<span class='line'>3805</span> </span><span class="WHIT">  </span><span class="NAME">this.createInterface_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3806</span> </span><span class="WHIT">  </span><span class="NAME">this.predraw_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3807</span> 
+<span class='line'>3808</span> </span><span class="WHIT">  </span><span class="NAME">this.resize_lock</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3809</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3810</span> 
+<span class='line'>3811</span> </span><span class="COMM">/**
+<span class='line'>3812</span>  * Adjusts the number of points in the rolling average. Updates the graph to
+<span class='line'>3813</span>  * reflect the new averaging period.
+<span class='line'>3814</span>  * @param {Number} length Number of points over which to average the data.
+<span class='line'>3815</span>  */</span><span class="WHIT">
+<span class='line'>3816</span> </span><span class="NAME">Dygraph.prototype.adjustRoll</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3817</span> </span><span class="WHIT">  </span><span class="NAME">this.rollPeriod_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">length</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3818</span> </span><span class="WHIT">  </span><span class="NAME">this.predraw_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3819</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3820</span> 
+<span class='line'>3821</span> </span><span class="COMM">/**
+<span class='line'>3822</span>  * Returns a boolean array of visibility statuses.
+<span class='line'>3823</span>  */</span><span class="WHIT">
+<span class='line'>3824</span> </span><span class="NAME">Dygraph.prototype.visibility</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3825</span> </span><span class="WHIT">  </span><span class="COMM">// Do lazy-initialization, so that this happens after we know the number of</span><span class="WHIT">
+<span class='line'>3826</span> </span><span class="WHIT">  </span><span class="COMM">// data series.</span><span class="WHIT">
+<span class='line'>3827</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"visibility"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3828</span> </span><span class="WHIT">    </span><span class="NAME">this.attrs_</span><span class="PUNC">[</span><span class="STRN">"visibility"</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3829</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3830</span> </span><span class="WHIT">  </span><span class="KEYW">while</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"visibility"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">length</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">this.rawData_</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3831</span> </span><span class="WHIT">    </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"visibility"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">push</span><span class="PUNC">(</span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3832</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3833</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"visibility"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3834</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3835</span> 
+<span class='line'>3836</span> </span><span class="COMM">/**
+<span class='line'>3837</span>  * Changes the visiblity of a series.
+<span class='line'>3838</span>  */</span><span class="WHIT">
+<span class='line'>3839</span> </span><span class="NAME">Dygraph.prototype.setVisibility</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">num</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3840</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.visibility</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3841</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">num</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">num</span><span class="WHIT"> </span><span class="PUNC">>=</span><span class="WHIT"> </span><span class="NAME">x.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3842</span> </span><span class="WHIT">    </span><span class="NAME">this.warn</span><span class="PUNC">(</span><span class="STRN">"invalid series number in setVisibility: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">num</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3843</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3844</span> </span><span class="WHIT">    </span><span class="NAME">x</span><span class="PUNC">[</span><span class="NAME">num</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">value</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3845</span> </span><span class="WHIT">    </span><span class="NAME">this.predraw_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3846</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3847</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3848</span> 
+<span class='line'>3849</span> </span><span class="COMM">/**
+<span class='line'>3850</span>  * Update the list of annotations and redraw the chart.
+<span class='line'>3851</span>  */</span><span class="WHIT">
+<span class='line'>3852</span> </span><span class="NAME">Dygraph.prototype.setAnnotations</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">ann</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">suppressDraw</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3853</span> </span><span class="WHIT">  </span><span class="COMM">// Only add the annotation CSS rule once we know it will be used.</span><span class="WHIT">
+<span class='line'>3854</span> </span><span class="WHIT">  </span><span class="NAME">Dygraph.addAnnotationRule</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3855</span> </span><span class="WHIT">  </span><span class="NAME">this.annotations_</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ann</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3856</span> </span><span class="WHIT">  </span><span class="NAME">this.layout_.setAnnotations</span><span class="PUNC">(</span><span class="NAME">this.annotations_</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3857</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">suppressDraw</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3858</span> </span><span class="WHIT">    </span><span class="NAME">this.predraw_</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3859</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3860</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3861</span> 
+<span class='line'>3862</span> </span><span class="COMM">/**
+<span class='line'>3863</span>  * Return the list of annotations.
+<span class='line'>3864</span>  */</span><span class="WHIT">
+<span class='line'>3865</span> </span><span class="NAME">Dygraph.prototype.annotations</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3866</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.annotations_</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3867</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3868</span> 
+<span class='line'>3869</span> </span><span class="COMM">/**
+<span class='line'>3870</span>  * Get the index of a series (column) given its name. The first column is the
+<span class='line'>3871</span>  * x-axis, so the data series start with index 1.
+<span class='line'>3872</span>  */</span><span class="WHIT">
+<span class='line'>3873</span> </span><span class="NAME">Dygraph.prototype.indexFromSetName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3874</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.attr_</span><span class="PUNC">(</span><span class="STRN">"labels"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3875</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">labels.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3876</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">labels</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="NAME">name</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3877</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3878</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3879</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3880</span> 
+<span class='line'>3881</span> </span><span class="COMM">/**
+<span class='line'>3882</span>  * @private
+<span class='line'>3883</span>  * Adds a default style for the annotation CSS classes to the document. This is
+<span class='line'>3884</span>  * only executed when annotations are actually used. It is designed to only be
+<span class='line'>3885</span>  * called once -- all calls after the first will return immediately.
+<span class='line'>3886</span>  */</span><span class="WHIT">
+<span class='line'>3887</span> </span><span class="NAME">Dygraph.addAnnotationRule</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3888</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">Dygraph.addedAnnotationCSS</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3889</span> 
+<span class='line'>3890</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rule</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"border: 1px solid black; "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3891</span> </span><span class="WHIT">             </span><span class="STRN">"background-color: white; "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>3892</span> </span><span class="WHIT">             </span><span class="STRN">"text-align: center;"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3893</span> 
+<span class='line'>3894</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">styleSheetElement</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"style"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3895</span> </span><span class="WHIT">  </span><span class="NAME">styleSheetElement.type</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"text/css"</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3896</span> </span><span class="WHIT">  </span><span class="NAME">document.getElementsByTagName</span><span class="PUNC">(</span><span class="STRN">"head"</span><span class="PUNC">)</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">appendChild</span><span class="PUNC">(</span><span class="NAME">styleSheetElement</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3897</span> 
+<span class='line'>3898</span> </span><span class="WHIT">  </span><span class="COMM">// Find the first style sheet that we can access.</span><span class="WHIT">
+<span class='line'>3899</span> </span><span class="WHIT">  </span><span class="COMM">// We may not add a rule to a style sheet from another domain for security</span><span class="WHIT">
+<span class='line'>3900</span> </span><span class="WHIT">  </span><span class="COMM">// reasons. This sometimes comes up when using gviz, since the Google gviz JS</span><span class="WHIT">
+<span class='line'>3901</span> </span><span class="WHIT">  </span><span class="COMM">// adds its own style sheets from google.com.</span><span class="WHIT">
+<span class='line'>3902</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">document.styleSheets.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3903</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">document.styleSheets</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">disabled</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3904</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">mysheet</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.styleSheets</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3905</span> </span><span class="WHIT">    </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3906</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">mysheet.insertRule</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">// Firefox</span><span class="WHIT">
+<span class='line'>3907</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">mysheet.cssRules</span><span class="WHIT"> </span><span class="PUNC">?</span><span class="WHIT"> </span><span class="NAME">mysheet.cssRules.length</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3908</span> </span><span class="WHIT">        </span><span class="NAME">mysheet.insertRule</span><span class="PUNC">(</span><span class="STRN">".dygraphDefaultAnnotation { "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">rule</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" }"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3909</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">mysheet.addRule</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">  </span><span class="COMM">// IE</span><span class="WHIT">
+<span class='line'>3910</span> </span><span class="WHIT">        </span><span class="NAME">mysheet.addRule</span><span class="PUNC">(</span><span class="STRN">".dygraphDefaultAnnotation"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">rule</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3911</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3912</span> </span><span class="WHIT">      </span><span class="NAME">Dygraph.addedAnnotationCSS</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3913</span> </span><span class="WHIT">      </span><span class="KEYW">return</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3914</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">err</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3915</span> </span><span class="WHIT">      </span><span class="COMM">// Was likely a security exception.</span><span class="WHIT">
+<span class='line'>3916</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3917</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3918</span> 
+<span class='line'>3919</span> </span><span class="WHIT">  </span><span class="NAME">this.warn</span><span class="PUNC">(</span><span class="STRN">"Unable to add default annotation CSS rule; display may be off."</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3920</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3921</span> 
+<span class='line'>3922</span> </span><span class="COMM">/**
+<span class='line'>3923</span>  * @private
+<span class='line'>3924</span>  * Create a new canvas element. This is more complex than a simple
+<span class='line'>3925</span>  * document.createElement("canvas") because of IE and excanvas.
+<span class='line'>3926</span>  */</span><span class="WHIT">
+<span class='line'>3927</span> </span><span class="NAME">Dygraph.createCanvas</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3928</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">canvas</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">document.createElement</span><span class="PUNC">(</span><span class="STRN">"canvas"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3929</span> 
+<span class='line'>3930</span> </span><span class="WHIT">  </span><span class="NAME">isIE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="REGX">/MSIE/</span><span class="PUNC">.</span><span class="NAME">test</span><span class="PUNC">(</span><span class="NAME">navigator.userAgent</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">!</span><span class="NAME">window.opera</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3931</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">isIE</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">G_vmlCanvasManager</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3932</span> </span><span class="WHIT">    </span><span class="NAME">canvas</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">G_vmlCanvasManager.initElement</span><span class="PUNC">(</span><span class="NAME">canvas</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3933</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3934</span> 
+<span class='line'>3935</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">canvas</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3936</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3937</span> 
+<span class='line'>3938</span> 
+<span class='line'>3939</span> </span><span class="COMM">/**
+<span class='line'>3940</span>  * A wrapper around Dygraph that implements the gviz API.
+<span class='line'>3941</span>  * @param {Object} container The DOM object the visualization should live in.
+<span class='line'>3942</span>  */</span><span class="WHIT">
+<span class='line'>3943</span> </span><span class="NAME">Dygraph.GVizChart</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">container</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3944</span> </span><span class="WHIT">  </span><span class="NAME">this.container</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">container</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3945</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3946</span> 
+<span class='line'>3947</span> </span><span class="NAME">Dygraph.GVizChart.prototype.draw</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3948</span> </span><span class="WHIT">  </span><span class="COMM">// Clear out any existing dygraph.</span><span class="WHIT">
+<span class='line'>3949</span> </span><span class="WHIT">  </span><span class="COMM">// TODO(danvk): would it make more sense to simply redraw using the current</span><span class="WHIT">
+<span class='line'>3950</span> </span><span class="WHIT">  </span><span class="COMM">// date_graph object?</span><span class="WHIT">
+<span class='line'>3951</span> </span><span class="WHIT">  </span><span class="NAME">this.container.innerHTML</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3952</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">this.date_graph</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'undefined'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3953</span> </span><span class="WHIT">    </span><span class="NAME">this.date_graph.destroy</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3954</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3955</span> 
+<span class='line'>3956</span> </span><span class="WHIT">  </span><span class="NAME">this.date_graph</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Dygraph</span><span class="PUNC">(</span><span class="NAME">this.container</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">data</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">options</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3957</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3958</span> 
+<span class='line'>3959</span> </span><span class="COMM">/**
+<span class='line'>3960</span>  * Google charts compatible setSelection
+<span class='line'>3961</span>  * Only row selection is supported, all points in the row will be highlighted
+<span class='line'>3962</span>  * @param {Array} array of the selected cells
+<span class='line'>3963</span>  * @public
+<span class='line'>3964</span>  */</span><span class="WHIT">
+<span class='line'>3965</span> </span><span class="NAME">Dygraph.GVizChart.prototype.setSelection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">selection_array</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3966</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3967</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">selection_array.length</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3968</span> </span><span class="WHIT">    </span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">selection_array</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">row</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3969</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3970</span> </span><span class="WHIT">  </span><span class="NAME">this.date_graph.setSelection</span><span class="PUNC">(</span><span class="NAME">row</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3971</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3972</span> 
+<span class='line'>3973</span> </span><span class="COMM">/**
+<span class='line'>3974</span>  * Google charts compatible getSelection implementation
+<span class='line'>3975</span>  * @return {Array} array of the selected cells
+<span class='line'>3976</span>  * @public
+<span class='line'>3977</span>  */</span><span class="WHIT">
+<span class='line'>3978</span> </span><span class="NAME">Dygraph.GVizChart.prototype.getSelection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3979</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">selection</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3980</span> 
+<span class='line'>3981</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.date_graph.getSelection</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3982</span> 
+<span class='line'>3983</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">row</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">selection</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3984</span> 
+<span class='line'>3985</span> </span><span class="WHIT">  </span><span class="NAME">col</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3986</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">this.date_graph.layout_.datasets</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>3987</span> </span><span class="WHIT">    </span><span class="NAME">selection.push</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">row</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">row</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">column</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">col</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3988</span> </span><span class="WHIT">    </span><span class="NAME">col</span><span class="PUNC">++</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3989</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3990</span> 
+<span class='line'>3991</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">selection</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3992</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>3993</span> 
+<span class='line'>3994</span> </span><span class="COMM">// Older pages may still use this name.</span><span class="WHIT">
+<span class='line'>3995</span> </span><span class="NAME">DateGraph</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>3996</span> 
+<span class='line'>3997</span> </span><span class="COMM">// &lt;REMOVE_FOR_COMBINED></span><span class="WHIT">
+<span class='line'>3998</span> </span><span class="NAME">Dygraph.OPTIONS_REFERENCE</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">  </span><span class="COMM">// &lt;JSON></span><span class="WHIT">
+<span class='line'>3999</span> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4000</span> </span><span class="WHIT">  </span><span class="STRN">"xValueParser"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4001</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"parseFloat() or Date.parse()*"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4002</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"CSV parsing"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4003</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(str) -> number"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4004</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"A function which parses x-values (i.e. the dependent series). Must return a number, even when the values are dates. In this case, millis since epoch are used. This is used primarily for parsing CSV data. *=Dygraphs is slightly more accepting in the dates which it will parse. See code for details."</span><span class="WHIT">
+<span class='line'>4005</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4006</span> </span><span class="WHIT">  </span><span class="STRN">"stackedGraph"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4007</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4008</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Data Line display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4009</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4010</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"If set, stack series on top of one another rather than drawing them independently."</span><span class="WHIT">
+<span class='line'>4011</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4012</span> </span><span class="WHIT">  </span><span class="STRN">"pointSize"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4013</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"1"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4014</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Data Line display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4015</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4016</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"The size of the dot to draw on each point in pixels (see drawPoints). A dot is always drawn when a point is \"isolated\", i.e. there is a missing point on either side of it. This also controls the size of those dots."</span><span class="WHIT">
+<span class='line'>4017</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4018</span> </span><span class="WHIT">  </span><span class="STRN">"labelsDivStyles"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4019</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4020</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Legend"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4021</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"{}"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4022</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Additional styles to apply to the currently-highlighted points div. For example, { 'font-weight': 'bold' } will make the labels bold."</span><span class="WHIT">
+<span class='line'>4023</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4024</span> </span><span class="WHIT">  </span><span class="STRN">"drawPoints"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4025</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4026</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Data Line display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4027</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4028</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Draw a small dot at each point, in addition to a line going through the point. This makes the individual data points easier to see, but can increase visual clutter in the chart."</span><span class="WHIT">
+<span class='line'>4029</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4030</span> </span><span class="WHIT">  </span><span class="STRN">"height"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4031</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"320"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4032</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Overall display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4033</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4034</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Height, in pixels, of the chart. If the container div has been explicitly sized, this will be ignored."</span><span class="WHIT">
+<span class='line'>4035</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4036</span> </span><span class="WHIT">  </span><span class="STRN">"zoomCallback"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4037</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4038</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Callbacks"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4039</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(minDate, maxDate, yRanges)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4040</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"A function to call when the zoom window is changed (either by zooming in or out). minDate and maxDate are milliseconds since epoch. yRanges is an array of [bottom, top] pairs, one for each y-axis."</span><span class="WHIT">
+<span class='line'>4041</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4042</span> </span><span class="WHIT">  </span><span class="STRN">"pointClickCallback"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4043</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4044</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Callbacks"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Interactive Elements"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4045</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">""</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4046</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">""</span><span class="WHIT">
+<span class='line'>4047</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4048</span> </span><span class="WHIT">  </span><span class="STRN">"colors"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4049</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"(see description)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4050</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Data Series Colors"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4051</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"array&lt;string>"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4052</span> </span><span class="WHIT">    </span><span class="STRN">"example"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"['red', '#00FF00']"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4053</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"List of colors for the data series. These can be of the form \"#AABBCC\" or \"rgb(255,100,200)\" or \"yellow\", etc. If not specified, equally-spaced points around a color wheel are used."</span><span class="WHIT">
+<span class='line'>4054</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4055</span> </span><span class="WHIT">  </span><span class="STRN">"connectSeparatedPoints"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4056</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4057</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Data Line display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4058</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4059</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Usually, when Dygraphs encounters a missing value in a data series, it interprets this as a gap and draws it as such. If, instead, the missing values represents an x-value for which only a different series has data, then you'll want to connect the dots by setting this to true. To explicitly include a gap with this option set, use a value of NaN."</span><span class="WHIT">
+<span class='line'>4060</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4061</span> </span><span class="WHIT">  </span><span class="STRN">"highlightCallback"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4062</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4063</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Callbacks"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4064</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(event, x, points,row)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4065</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When set, this callback gets called every time a new point is highlighted. The parameters are the JavaScript mousemove event, the x-coordinate of the highlighted points and an array of highlighted points: &lt;code>[ {name: 'series', yval: y-value}, &hellip; ]&lt;/code>"</span><span class="WHIT">
+<span class='line'>4066</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4067</span> </span><span class="WHIT">  </span><span class="STRN">"includeZero"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4068</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4069</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4070</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4071</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Usually, dygraphs will use the range of the data plus some padding to set the range of the y-axis. If this option is set, the y-axis will always include zero, typically as the lowest value. This can be used to avoid exaggerating the variance in the data"</span><span class="WHIT">
+<span class='line'>4072</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4073</span> </span><span class="WHIT">  </span><span class="STRN">"rollPeriod"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4074</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"1"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4075</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Error Bars"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Rolling Averages"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4076</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer &gt;= 1"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4077</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Number of days over which to average data. Discussed extensively above."</span><span class="WHIT">
+<span class='line'>4078</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4079</span> </span><span class="WHIT">  </span><span class="STRN">"unhighlightCallback"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4080</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4081</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Callbacks"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4082</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(event)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4083</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When set, this callback gets called every time the user stops highlighting any point by mousing out of the graph.  The parameter is the mouseout event."</span><span class="WHIT">
+<span class='line'>4084</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4085</span> </span><span class="WHIT">  </span><span class="STRN">"axisTickSize"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4086</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"3.0"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4087</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4088</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"number"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4089</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"The size of the line to display next to each tick mark on x- or y-axes."</span><span class="WHIT">
+<span class='line'>4090</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4091</span> </span><span class="WHIT">  </span><span class="STRN">"labelsSeparateLines"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4092</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4093</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Legend"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4094</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4095</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Put &lt;code>&lt;br/&gt;&lt;/code> between lines in the label string. Often used in conjunction with &lt;strong>labelsDiv&lt;/strong>."</span><span class="WHIT">
+<span class='line'>4096</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4097</span> </span><span class="WHIT">  </span><span class="STRN">"xValueFormatter"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4098</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"(Round to 2 decimal places)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4099</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4100</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(x)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4101</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Function to provide a custom display format for the X value for mouseover."</span><span class="WHIT">
+<span class='line'>4102</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4103</span> </span><span class="WHIT">  </span><span class="STRN">"pixelsPerYLabel"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4104</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4105</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Grid"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4106</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4107</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Number of pixels to require between each x- and y-label. Larger values will yield a sparser axis with fewer ticks."</span><span class="WHIT">
+<span class='line'>4108</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4109</span> </span><span class="WHIT">  </span><span class="STRN">"annotationMouseOverHandler"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4110</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4111</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Annotations"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4112</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(annotation, point, dygraph, event)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4113</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"If provided, this function is called whenever the user mouses over an annotation."</span><span class="WHIT">
+<span class='line'>4114</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4115</span> </span><span class="WHIT">  </span><span class="STRN">"annotationMouseOutHandler"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4116</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4117</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Annotations"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4118</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(annotation, point, dygraph, event)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4119</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"If provided, this function is called whenever the user mouses out of an annotation."</span><span class="WHIT">
+<span class='line'>4120</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4121</span> </span><span class="WHIT">  </span><span class="STRN">"annotationClickHandler"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4122</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4123</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Annotations"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4124</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(annotation, point, dygraph, event)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4125</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"If provided, this function is called whenever the user clicks on an annotation."</span><span class="WHIT">
+<span class='line'>4126</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4127</span> </span><span class="WHIT">  </span><span class="STRN">"annotationDblClickHandler"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4128</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4129</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Annotations"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4130</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(annotation, point, dygraph, event)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4131</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"If provided, this function is called whenever the user double-clicks on an annotation."</span><span class="WHIT">
+<span class='line'>4132</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4133</span> </span><span class="WHIT">  </span><span class="STRN">"drawCallback"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4134</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4135</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Callbacks"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4136</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(dygraph, is_initial)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4137</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When set, this callback gets called every time the dygraph is drawn. This includes the initial draw, after zooming and repeatedly while panning. The first parameter is the dygraph being drawn. The second is a boolean value indicating whether this is the initial draw."</span><span class="WHIT">
+<span class='line'>4138</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4139</span> </span><span class="WHIT">  </span><span class="STRN">"labelsKMG2"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4140</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4141</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Value display/formatting"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4142</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4143</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Show k/M/G for kilo/Mega/Giga on y-axis. This is different than &lt;code>labelsKMB&lt;/code> in that it uses base 2, not 10."</span><span class="WHIT">
+<span class='line'>4144</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4145</span> </span><span class="WHIT">  </span><span class="STRN">"delimiter"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4146</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">","</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4147</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"CSV parsing"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4148</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4149</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"The delimiter to look for when separating fields of a CSV file. Setting this to a tab is not usually necessary, since tab-delimited data is auto-detected."</span><span class="WHIT">
+<span class='line'>4150</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4151</span> </span><span class="WHIT">  </span><span class="STRN">"axisLabelFontSize"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4152</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"14"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4153</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4154</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4155</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Size of the font (in pixels) to use in the axis labels, both x- and y-axis."</span><span class="WHIT">
+<span class='line'>4156</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4157</span> </span><span class="WHIT">  </span><span class="STRN">"underlayCallback"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4158</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4159</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Callbacks"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4160</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(canvas, area, dygraph)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4161</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When set, this callback gets called before the chart is drawn. It details on how to use this."</span><span class="WHIT">
+<span class='line'>4162</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4163</span> </span><span class="WHIT">  </span><span class="STRN">"width"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4164</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"480"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4165</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Overall display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4166</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4167</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Width, in pixels, of the chart. If the container div has been explicitly sized, this will be ignored."</span><span class="WHIT">
+<span class='line'>4168</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4169</span> </span><span class="WHIT">  </span><span class="STRN">"interactionModel"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4170</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"..."</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4171</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Interactive Elements"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4172</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Object"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4173</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"TODO(konigsberg): document this"</span><span class="WHIT">
+<span class='line'>4174</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4175</span> </span><span class="WHIT">  </span><span class="STRN">"xTicker"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4176</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Dygraph.dateTicker or Dygraph.numericTicks"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4177</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4178</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(min, max, dygraph) -> [{v: ..., label: ...}, ...]"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4179</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"This lets you specify an arbitrary function to generate tick marks on an axis. The tick marks are an array of (value, label) pairs. The built-in functions go to great lengths to choose good tick marks so, if you set this option, you'll most likely want to call one of them and modify the result."</span><span class="WHIT">
+<span class='line'>4180</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4181</span> </span><span class="WHIT">  </span><span class="STRN">"xAxisLabelWidth"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4182</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"50"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4183</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4184</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4185</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Width, in pixels, of the x-axis labels."</span><span class="WHIT">
+<span class='line'>4186</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4187</span> </span><span class="WHIT">  </span><span class="STRN">"showLabelsOnHighlight"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4188</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"true"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4189</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Interactive Elements"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Legend"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4190</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4191</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Whether to show the legend upon mouseover."</span><span class="WHIT">
+<span class='line'>4192</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4193</span> </span><span class="WHIT">  </span><span class="STRN">"axis"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4194</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"(none)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4195</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4196</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"string or object"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4197</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Set to either an object ({}) filled with options for this axis or to the name of an existing data series with its own axis to re-use that axis. See tests for usage."</span><span class="WHIT">
+<span class='line'>4198</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4199</span> </span><span class="WHIT">  </span><span class="STRN">"pixelsPerXLabel"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4200</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"60"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4201</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Grid"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4202</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4203</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Number of pixels to require between each x- and y-label. Larger values will yield a sparser axis with fewer ticks."</span><span class="WHIT">
+<span class='line'>4204</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4205</span> </span><span class="WHIT">  </span><span class="STRN">"labelsDiv"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4206</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4207</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Legend"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4208</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"DOM element or string"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4209</span> </span><span class="WHIT">    </span><span class="STRN">"example"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"&lt;code style='font-size: small'>document.getElementById('foo')&lt;/code>or&lt;code>'foo'"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4210</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Show data labels in an external div, rather than on the graph.  This value can either be a div element or a div id."</span><span class="WHIT">
+<span class='line'>4211</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4212</span> </span><span class="WHIT">  </span><span class="STRN">"fractions"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4213</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4214</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"CSV parsing"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Error Bars"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4215</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4216</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When set, attempt to parse each cell in the CSV file as \"a/b\", where a and b are integers. The ratio will be plotted. This allows computation of Wilson confidence intervals (see below)."</span><span class="WHIT">
+<span class='line'>4217</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4218</span> </span><span class="WHIT">  </span><span class="STRN">"logscale"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4219</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4220</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4221</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4222</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When set for a y-axis, the graph shows that axis in log scale. Any values less than or equal to zero are not displayed.\n\nNot compatible with showZero, and ignores connectSeparatedPoints. Also, showing log scale with valueRanges that are less than zero will result in an unviewable graph."</span><span class="WHIT">
+<span class='line'>4223</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4224</span> </span><span class="WHIT">  </span><span class="STRN">"strokeWidth"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4225</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"1.0"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4226</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Data Line display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4227</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4228</span> </span><span class="WHIT">    </span><span class="STRN">"example"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"0.5, 2.0"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4229</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"The width of the lines connecting data points. This can be used to increase the contrast or some graphs."</span><span class="WHIT">
+<span class='line'>4230</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4231</span> </span><span class="WHIT">  </span><span class="STRN">"wilsonInterval"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4232</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"true"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4233</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Error Bars"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4234</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4235</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Use in conjunction with the \"fractions\" option. Instead of plotting +/- N standard deviations, dygraphs will compute a Wilson confidence interval and plot that. This has more reasonable behavior for ratios close to 0 or 1."</span><span class="WHIT">
+<span class='line'>4236</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4237</span> </span><span class="WHIT">  </span><span class="STRN">"fillGraph"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4238</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4239</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Data Line display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4240</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4241</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Should the area underneath the graph be filled? This option is not compatible with error bars."</span><span class="WHIT">
+<span class='line'>4242</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4243</span> </span><span class="WHIT">  </span><span class="STRN">"highlightCircleSize"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4244</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"3"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4245</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Interactive Elements"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4246</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4247</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"The size in pixels of the dot drawn over highlighted points."</span><span class="WHIT">
+<span class='line'>4248</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4249</span> </span><span class="WHIT">  </span><span class="STRN">"gridLineColor"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4250</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"rgb(128,128,128)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4251</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Grid"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4252</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"red, blue"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4253</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"The color of the gridlines."</span><span class="WHIT">
+<span class='line'>4254</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4255</span> </span><span class="WHIT">  </span><span class="STRN">"visibility"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4256</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"[true, true, ...]"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4257</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Data Line display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4258</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Array of booleans"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4259</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Which series should initially be visible? Once the Dygraph has been constructed, you can access and modify the visibility of each series using the &lt;code>visibility&lt;/code> and &lt;code>setVisibility&lt;/code> methods."</span><span class="WHIT">
+<span class='line'>4260</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4261</span> </span><span class="WHIT">  </span><span class="STRN">"valueRange"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4262</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Full range of the input is shown"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4263</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4264</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Array of two numbers"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4265</span> </span><span class="WHIT">    </span><span class="STRN">"example"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"[10, 110]"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4266</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Explicitly set the vertical range of the graph to [low, high]."</span><span class="WHIT">
+<span class='line'>4267</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4268</span> </span><span class="WHIT">  </span><span class="STRN">"labelsDivWidth"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4269</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"250"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4270</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Legend"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4271</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4272</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Width (in pixels) of the div which shows information on the currently-highlighted points."</span><span class="WHIT">
+<span class='line'>4273</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4274</span> </span><span class="WHIT">  </span><span class="STRN">"colorSaturation"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4275</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"1.0"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4276</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Data Series Colors"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4277</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"0.0 - 1.0"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4278</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"If &lt;strong>colors&lt;/strong> is not specified, saturation of the automatically-generated data series colors."</span><span class="WHIT">
+<span class='line'>4279</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4280</span> </span><span class="WHIT">  </span><span class="STRN">"yAxisLabelWidth"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4281</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"50"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4282</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4283</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4284</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Width, in pixels, of the y-axis labels."</span><span class="WHIT">
+<span class='line'>4285</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4286</span> </span><span class="WHIT">  </span><span class="STRN">"hideOverlayOnMouseOut"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4287</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"true"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4288</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Interactive Elements"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Legend"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4289</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4290</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Whether to hide the legend when the mouse leaves the chart area."</span><span class="WHIT">
+<span class='line'>4291</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4292</span> </span><span class="WHIT">  </span><span class="STRN">"yValueFormatter"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4293</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"(Round to 2 decimal places)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4294</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4295</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(x)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4296</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Function to provide a custom display format for the Y value for mouseover."</span><span class="WHIT">
+<span class='line'>4297</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4298</span> </span><span class="WHIT">  </span><span class="STRN">"legend"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4299</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"onmouseover"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4300</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Legend"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4301</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4302</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When to display the legend. By default, it only appears when a user mouses over the chart. Set it to \"always\" to always display a legend of some sort."</span><span class="WHIT">
+<span class='line'>4303</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4304</span> </span><span class="WHIT">  </span><span class="STRN">"labelsShowZeroValues"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4305</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"true"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4306</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Legend"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4307</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4308</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Show zero value labels in the labelsDiv."</span><span class="WHIT">
+<span class='line'>4309</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4310</span> </span><span class="WHIT">  </span><span class="STRN">"stepPlot"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4311</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4312</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Data Line display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4313</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4314</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When set, display the graph as a step plot instead of a line plot."</span><span class="WHIT">
+<span class='line'>4315</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4316</span> </span><span class="WHIT">  </span><span class="STRN">"labelsKMB"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4317</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4318</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Value display/formatting"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4319</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4320</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Show K/M/B for thousands/millions/billions on y-axis."</span><span class="WHIT">
+<span class='line'>4321</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4322</span> </span><span class="WHIT">  </span><span class="STRN">"rightGap"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4323</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"5"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4324</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Overall display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4325</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4326</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Number of pixels to leave blank at the right edge of the Dygraph. This makes it easier to highlight the right-most data point."</span><span class="WHIT">
+<span class='line'>4327</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4328</span> </span><span class="WHIT">  </span><span class="STRN">"avoidMinZero"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4329</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4330</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4331</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4332</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When set, the heuristic that fixes the Y axis at zero for a data set with the minimum Y value of zero is disabled. \nThis is particularly useful for data sets that contain many zero values, especially for step plots which may otherwise have lines not visible running along the bottom axis."</span><span class="WHIT">
+<span class='line'>4333</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4334</span> </span><span class="WHIT">  </span><span class="STRN">"xAxisLabelFormatter"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4335</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Dygraph.dateAxisFormatter"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4336</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Value display/formatting"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4337</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(date, granularity)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4338</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Function to call to format values along the x axis."</span><span class="WHIT">
+<span class='line'>4339</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4340</span> </span><span class="WHIT">  </span><span class="STRN">"clickCallback"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4341</span> </span><span class="WHIT">    </span><span class="STRN">"snippet"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(e, date){&lt;br>&nbsp;&nbsp;alert(date);&lt;br>}"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4342</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4343</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Callbacks"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4344</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(e, date)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4345</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"A function to call when a data point is clicked. The function should take two arguments, the event object for the click and the date that was clicked."</span><span class="WHIT">
+<span class='line'>4346</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4347</span> </span><span class="WHIT">  </span><span class="STRN">"yAxisLabelFormatter"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4348</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"yValueFormatter"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4349</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Value display/formatting"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4350</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"function(x)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4351</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Function used to format values along the Y axis. By default it uses the same as the &lt;code>yValueFormatter&lt;/code> unless specified."</span><span class="WHIT">
+<span class='line'>4352</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4353</span> </span><span class="WHIT">  </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4354</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"[\"X\", \"Y1\", \"Y2\", ...]*"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4355</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Legend"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4356</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"array&lt;string>"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4357</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"A name for each data series, including the independent (X) series. For CSV files and DataTable objections, this is determined by context. For raw data, this must be specified. If it is not, default values are supplied and a warning is logged."</span><span class="WHIT">
+<span class='line'>4358</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4359</span> </span><span class="WHIT">  </span><span class="STRN">"dateWindow"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4360</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Full range of the input is shown"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4361</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis display"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4362</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Array of two Dates or numbers"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4363</span> </span><span class="WHIT">    </span><span class="STRN">"example"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"[&lt;br>&nbsp;&nbsp;Date.parse('2006-01-01'),&lt;br>&nbsp;&nbsp;(new Date()).valueOf()&lt;br>]"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4364</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Initially zoom in on a section of the graph. Is of the form [earliest, latest], where earliest/latest are milliseconds since epoch. If the data for the x-axis is numeric, the values in dateWindow must also be numbers."</span><span class="WHIT">
+<span class='line'>4365</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4366</span> </span><span class="WHIT">  </span><span class="STRN">"showRoller"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4367</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4368</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Interactive Elements"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Rolling Averages"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4369</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4370</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"If the rolling average period text box should be shown."</span><span class="WHIT">
+<span class='line'>4371</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4372</span> </span><span class="WHIT">  </span><span class="STRN">"sigma"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4373</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"2.0"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4374</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Error Bars"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4375</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"float"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4376</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When errorBars is set, shade this many standard deviations above/below each point."</span><span class="WHIT">
+<span class='line'>4377</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4378</span> </span><span class="WHIT">  </span><span class="STRN">"customBars"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4379</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4380</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"CSV parsing"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Error Bars"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4381</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4382</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When set, parse each CSV cell as \"low;middle;high\". Error bars will be drawn for each point between low and high, with the series itself going through middle."</span><span class="WHIT">
+<span class='line'>4383</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4384</span> </span><span class="WHIT">  </span><span class="STRN">"colorValue"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4385</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"1.0"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4386</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Data Series Colors"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4387</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"float (0.0 - 1.0)"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4388</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"If colors is not specified, value of the data series colors, as in hue/saturation/value. (0.0-1.0, default 0.5)"</span><span class="WHIT">
+<span class='line'>4389</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4390</span> </span><span class="WHIT">  </span><span class="STRN">"errorBars"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4391</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4392</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"CSV parsing"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Error Bars"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4393</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4394</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Does the data contain standard deviations? Setting this to true alters the input format (see above)."</span><span class="WHIT">
+<span class='line'>4395</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4396</span> </span><span class="WHIT">  </span><span class="STRN">"displayAnnotations"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4397</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4398</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Annotations"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4399</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4400</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Only applies when Dygraphs is used as a GViz chart. Causes string columns following a data series to be interpreted as annotations on points in that series. This is the same format used by Google's AnnotatedTimeLine chart."</span><span class="WHIT">
+<span class='line'>4401</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4402</span> </span><span class="WHIT">  </span><span class="STRN">"panEdgeFraction"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4403</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4404</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Axis Display"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"Interactive Elements"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4405</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"float"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4406</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4407</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"A value representing the farthest a graph may be panned, in percent of the display. For example, a value of 0.1 means that the graph can only be panned 10% pased the edges of the displayed values. null means no bounds."</span><span class="WHIT">
+<span class='line'>4408</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4409</span> </span><span class="WHIT">  </span><span class="STRN">"title"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4410</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Chart labels"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4411</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4412</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4413</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Text to display above the chart. You can supply any HTML for this value, not just text. If you wish to style it using CSS, use the 'dygraph-label' or 'dygraph-title' classes."</span><span class="WHIT">
+<span class='line'>4414</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4415</span> </span><span class="WHIT">  </span><span class="STRN">"titleHeight"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4416</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"18"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4417</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Chart labels"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4418</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4419</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Height of the chart title, in pixels. This also controls the default font size of the title. If you style the title on your own, this controls how much space is set aside above the chart for the title's div."</span><span class="WHIT">
+<span class='line'>4420</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4421</span> </span><span class="WHIT">  </span><span class="STRN">"xlabel"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4422</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Chart labels"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4423</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4424</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4425</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Text to display below the chart's x-axis. You can supply any HTML for this value, not just text. If you wish to style it using CSS, use the 'dygraph-label' or 'dygraph-xlabel' classes."</span><span class="WHIT">
+<span class='line'>4426</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4427</span> </span><span class="WHIT">  </span><span class="STRN">"xLabelHeight"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4428</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Chart labels"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4429</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4430</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"18"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4431</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Height of the x-axis label, in pixels. This also controls the default font size of the x-axis label. If you style the label on your own, this controls how much space is set aside below the chart for the x-axis label's div."</span><span class="WHIT">
+<span class='line'>4432</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4433</span> </span><span class="WHIT">  </span><span class="STRN">"ylabel"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4434</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Chart labels"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4435</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"string"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4436</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4437</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Text to display to the left of the chart's y-axis. You can supply any HTML for this value, not just text. If you wish to style it using CSS, use the 'dygraph-label' or 'dygraph-ylabel' classes. The text will be rotated 90 degrees by default, so CSS rules may behave in unintuitive ways. No additional space is set aside for a y-axis label. If you need more space, increase the width of the y-axis tick labels using the yAxisLabelWidth option. If you need a wider div for the y-axis label, either style it that way with CSS (but remember that it's rotated, so width is controlled by the 'height' property) or set the yLabelWidth option."</span><span class="WHIT">
+<span class='line'>4438</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4439</span> </span><span class="WHIT">  </span><span class="STRN">"yLabelWidth"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4440</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Chart labels"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4441</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4442</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"18"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4443</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Width of the div which contains the y-axis label. Since the y-axis label appears rotated 90 degrees, this actually affects the height of its div."</span><span class="WHIT">
+<span class='line'>4444</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4445</span> </span><span class="WHIT">  </span><span class="STRN">"isZoomedIgnoreProgrammaticZoom"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4446</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"false"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4447</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Zooming"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4448</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"boolean"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4449</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When this option is passed to updateOptions() along with either the &lt;code>dateWindow&lt;/code> or &lt;code>valueRange&lt;/code> options, the zoom flags are not changed to reflect a zoomed state. This is primarily useful for when the display area of a chart is changed programmatically and also where manual zooming is allowed and use is made of the &lt;code>isZoomed&lt;/code> method to determine this."</span><span class="WHIT">
+<span class='line'>4450</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4451</span> </span><span class="WHIT">  </span><span class="STRN">"sigFigs"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4452</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"null"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4453</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Value display/formatting"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4454</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4455</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"By default, dygraphs displays numbers with a fixed number of digits after the decimal point. If you'd prefer to have a fixed number of significant figures, set this option to that number of sig figs. A value of 2, for instance, would cause 1 to be display as 1.0 and 1234 to be displayed as 1.23e+3."</span><span class="WHIT">
+<span class='line'>4456</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4457</span> </span><span class="WHIT">  </span><span class="STRN">"digitsAfterDecimal"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4458</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"2"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4459</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Value display/formatting"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4460</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4461</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"Unless it's run in scientific mode (see the &lt;code>sigFigs&lt;/code> option), dygraphs displays numbers with &lt;code>digitsAfterDecimal&lt;/code> digits after the decimal point. Trailing zeros are not displayed, so with a value of 2 you'll get '0', '0.1', '0.12', '123.45' but not '123.456' (it will be rounded to '123.46'). Numbers with absolute value less than 0.1^digitsAfterDecimal (i.e. those which would show up as '0.00') will be displayed in scientific notation."</span><span class="WHIT">
+<span class='line'>4462</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4463</span> </span><span class="WHIT">  </span><span class="STRN">"maxNumberWidth"</span><span class="WHIT"> </span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4464</span> </span><span class="WHIT">    </span><span class="STRN">"default"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"6"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4465</span> </span><span class="WHIT">    </span><span class="STRN">"labels"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">"Value display/formatting"</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4466</span> </span><span class="WHIT">    </span><span class="STRN">"type"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"integer"</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4467</span> </span><span class="WHIT">    </span><span class="STRN">"description"</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="STRN">"When displaying numbers in normal (not scientific) mode, large numbers will be displayed with many trailing zeros (e.g. 100000000 instead of 1e9). This can lead to unwieldy y-axis labels. If there are more than &lt;code>maxNumberWidth&lt;/code> digits to the left of the decimal in a number, dygraphs will switch to scientific notation, even when not operating in scientific mode. If you'd like to see all those digits, set this to something large, like 20 or 30."</span><span class="WHIT">
+<span class='line'>4468</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>4469</span> </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>4470</span> </span><span class="PUNC">;</span><span class="WHIT">  </span><span class="COMM">// &lt;/JSON></span><span class="WHIT">
+<span class='line'>4471</span> </span><span class="COMM">// NOTE: in addition to parsing as JS, this snippet is expected to be valid</span><span class="WHIT">
+<span class='line'>4472</span> </span><span class="COMM">// JSON. This assumption cannot be checked in JS, but it will be checked when</span><span class="WHIT">
+<span class='line'>4473</span> </span><span class="COMM">// documentation is generated by the generate-documentation.py script. For the</span><span class="WHIT">
+<span class='line'>4474</span> </span><span class="COMM">// most part, this just means that you should always use double quotes.</span><span class="WHIT">
+<span class='line'>4475</span> 
+<span class='line'>4476</span> </span><span class="COMM">// Do a quick sanity check on the options reference.</span><span class="WHIT">
+<span class='line'>4477</span> </span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4478</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">warn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">msg</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">console</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">console.warn</span><span class="PUNC">(</span><span class="NAME">msg</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4479</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">flds</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="STRN">'type'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'default'</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">'description'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4480</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">valid_cats</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT"> 
+<span class='line'>4481</span>    </span><span class="STRN">'Annotations'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4482</span> </span><span class="WHIT">   </span><span class="STRN">'Axis display'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4483</span> </span><span class="WHIT">   </span><span class="STRN">'Chart labels'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4484</span> </span><span class="WHIT">   </span><span class="STRN">'CSV parsing'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4485</span> </span><span class="WHIT">   </span><span class="STRN">'Callbacks'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4486</span> </span><span class="WHIT">   </span><span class="STRN">'Data Line display'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4487</span> </span><span class="WHIT">   </span><span class="STRN">'Data Series Colors'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4488</span> </span><span class="WHIT">   </span><span class="STRN">'Error Bars'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4489</span> </span><span class="WHIT">   </span><span class="STRN">'Grid'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4490</span> </span><span class="WHIT">   </span><span class="STRN">'Interactive Elements'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4491</span> </span><span class="WHIT">   </span><span class="STRN">'Legend'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4492</span> </span><span class="WHIT">   </span><span class="STRN">'Overall display'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4493</span> </span><span class="WHIT">   </span><span class="STRN">'Rolling Averages'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4494</span> </span><span class="WHIT">   </span><span class="STRN">'Value display/formatting'</span><span class="PUNC">,</span><span class="WHIT">
+<span class='line'>4495</span> </span><span class="WHIT">   </span><span class="STRN">'Zooming'</span><span class="WHIT">
+<span class='line'>4496</span> </span><span class="WHIT">  </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4497</span> </span><span class="WHIT">  </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cats</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4498</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">valid_cats.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">cats</span><span class="PUNC">[</span><span class="NAME">valid_cats</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4499</span> 
+<span class='line'>4500</span> </span><span class="WHIT">  </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="KEYW">in</span><span class="WHIT"> </span><span class="NAME">Dygraph.OPTIONS_REFERENCE</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4501</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">Dygraph.OPTIONS_REFERENCE.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">k</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">continue</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4502</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">op</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">Dygraph.OPTIONS_REFERENCE</span><span class="PUNC">[</span><span class="NAME">k</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4503</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">flds.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4504</span> </span><span class="WHIT">      </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">op.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">flds</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4505</span> </span><span class="WHIT">        </span><span class="NAME">warn</span><span class="PUNC">(</span><span class="STRN">'Option '</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' missing "'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">flds</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'" property'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4506</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">op</span><span class="PUNC">[</span><span class="NAME">flds</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="STRN">'string'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4507</span> </span><span class="WHIT">        </span><span class="NAME">warn</span><span class="PUNC">(</span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'.'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">flds</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">' must be of type string'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4508</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>4509</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>4510</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">labels</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">op</span><span class="PUNC">[</span><span class="STRN">'labels'</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4511</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">typeof</span><span class="PUNC">(</span><span class="NAME">labels</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">'object'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4512</span> </span><span class="WHIT">      </span><span class="NAME">warn</span><span class="PUNC">(</span><span class="STRN">'Option "'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'" is missing a "labels": [...] option'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4513</span> </span><span class="WHIT">      </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">labels.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4514</span> </span><span class="WHIT">        </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="NAME">cats.hasOwnProperty</span><span class="PUNC">(</span><span class="NAME">labels</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
+<span class='line'>4515</span> </span><span class="WHIT">          </span><span class="NAME">warn</span><span class="PUNC">(</span><span class="STRN">'Option "'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">k</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">'" has label "'</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">labels</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT">
+<span class='line'>4516</span> </span><span class="WHIT">               </span><span class="STRN">'", which is invalid.'</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4517</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>4518</span> </span><span class="WHIT">      </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>4519</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>4520</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
+<span class='line'>4521</span> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
+<span class='line'>4522</span> </span><span class="COMM">// &lt;/REMOVE_FOR_COMBINED></span><span class="WHIT">
+<span class='line'>4523</span> </span></pre></body></html>
\ No newline at end of file
diff --git a/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl b/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl
new file mode 100644 (file)
index 0000000..32f4358
--- /dev/null
@@ -0,0 +1,17 @@
+<div align="center">{+new Link().toFile("index.html").withText("Class Index")+}
+| {+new Link().toFile("files.html").withText("File Index")+}</div>
+<hr />
+<h2>Classes</h2>
+<ul class="classList">
+       <for each="thisClass" in="data">
+       <li>{!
+               if (thisClass.alias == "_global_") {
+                       output += "<i>"+new Link().toClass(thisClass.alias)+"</i>";
+               }
+               else {
+                       output += new Link().toClass(thisClass.alias);
+               }
+       !}</li>
+       </for>
+</ul>
+<hr />
\ No newline at end of file
diff --git a/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl b/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl
new file mode 100644 (file)
index 0000000..4c7de1c
--- /dev/null
@@ -0,0 +1,56 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
+               {! Link.base = ""; /* all generated links will be relative to this */ !}
+               <title>JsDoc Reference - File Index</title>
+               <meta name="generator" content="JsDoc Toolkit" />
+               
+               <style type="text/css">
+               {+include("static/default.css")+}
+               </style>
+       </head>
+       
+       <body>
+               {+include("static/header.html")+}
+               
+               <div id="index">
+                       {+publish.classesIndex+}
+               </div>
+               
+               <div id="content">
+                       <h1 class="classTitle">File Index</h1>
+                       
+                       <for each="item" in="data">
+                       <div>
+                               <h2>{+new Link().toSrc(item.alias).withText(item.name)+}</h2>
+                               <if test="item.desc">{+resolveLinks(item.desc)+}</if>
+                               <dl>
+                                       <if test="item.author">
+                                               <dt class="heading">Author:</dt>
+                                               <dd>{+item.author+}</dd>
+                                       </if>
+                                       <if test="item.version">
+                                               <dt class="heading">Version:</dt>
+                                                       <dd>{+item.version+}</dd>
+                                       </if>
+                                       {! var locations = item.comment.getTag('location').map(function($){return $.toString().replace(/(^\$ ?| ?\$$)/g, '').replace(/^HeadURL: https:/g, 'http:');}) !}
+                                       <if test="locations.length">
+                                               <dt class="heading">Location:</dt>
+                                                       <for each="location" in="locations">
+                                                       <dd><a href="{+location+}">{+location+}</a></dd>
+                                                       </for>
+                                       </if>
+                               </dl>
+                       </div>
+                       <hr />
+                       </for>
+                       
+               </div>
+               <div class="fineprint" style="clear:both">
+                       <if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
+                       Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
+               </div>
+       </body>
+</html>
\ No newline at end of file
diff --git a/jsdoc-toolkit/templates/jsdoc/class.tmpl b/jsdoc-toolkit/templates/jsdoc/class.tmpl
new file mode 100644 (file)
index 0000000..1b32e4a
--- /dev/null
@@ -0,0 +1,649 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
+               <meta name="generator" content="JsDoc Toolkit" />
+               {! Link.base = "../"; /* all generated links will be relative to this */ !}
+               <title>JsDoc Reference - {+data.alias+}</title>
+
+               <style type="text/css">
+                       {+include("static/default.css")+}
+               </style>
+       </head>
+
+       <body>
+<!-- ============================== header ================================= -->       
+               <!-- begin static/header.html -->
+               {+include("static/header.html")+}
+               <!-- end static/header.html -->
+
+<!-- ============================== classes index ============================ -->
+               <div id="index">
+                       <!-- begin publish.classesIndex -->
+                       {+publish.classesIndex+}
+                       <!-- end publish.classesIndex -->
+               </div>
+               
+               <div id="content">
+<!-- ============================== class title ============================ -->
+                       <h1 class="classTitle">
+                               {!
+                                       var classType = "";
+                                       
+                                       if (data.isBuiltin()) {
+                                               classType += "Built-In ";
+                                       }
+                                       
+                                       if (data.isNamespace) {
+                                               if (data.is('FUNCTION')) {
+                                                       classType += "Function ";
+                                               }
+                                               classType += "Namespace ";
+                                       }
+                                       else {
+                                               classType += "Class ";
+                                       }
+                               !}
+                               {+classType+}{+data.alias+}
+                       </h1>
+
+<!-- ============================== class summary ========================== -->                       
+                       <p class="description">
+                               <if test="data.version"><br />Version
+                                       {+ data.version +}.<br />
+                               </if>
+                               <if test="data.augments.length"><br />Extends
+                                       {+
+                                               data.augments
+                                               .sort()
+                                               .map(
+                                                       function($) { return new Link().toSymbol($); }
+                                               )
+                                               .join(", ")
+                                       +}.<br />
+                               </if>
+                       
+                               {+resolveLinks(data.classDesc)+}
+                               
+                               <if test="!data.isBuiltin()">{# isn't defined in any file #}
+                                       <br /><i>Defined in: </i> {+new Link().toSrc(data.srcFile)+}.
+                               </if>
+                       </p>
+
+<!-- ============================== constructor summary ==================== -->                       
+                       <if test="!data.isBuiltin() && (data.isNamespace || data.is('CONSTRUCTOR'))">
+                       <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class {+data.alias+}.">
+                               <caption>{+classType+}Summary</caption>
+                               <thead>
+                                       <tr>
+                                               <th scope="col">Constructor Attributes</th>
+                                               <th scope="col">Constructor Name and Description</th>
+                                       </tr>
+                               </thead>
+                               <tbody>
+                                       <tr>
+                                               <td class="attributes">{!
+                                                       if (data.isPrivate) output += "&lt;private&gt; ";
+                                                       if (data.isInner) output += "&lt;inner&gt; ";
+                                               !}&nbsp;</td>
+                                               <td class="nameDescription" {!if (data.comment.getTag("hilited").length){output += 'style="color: red"'}!}>
+                                                       <div class="fixedFont">
+                                                               <b>{+ new Link().toSymbol(data.alias).inner('constructor')+}</b><if test="classType != 'Namespace '">{+ makeSignature(data.params) +}</if>
+                                                       </div>
+                                                       <div class="description">{+resolveLinks(summarize(data.desc))+}</div>
+                                               </td>
+                                       </tr>
+                               </tbody>
+                       </table>
+                       </if>
+
+<!-- ============================== properties summary ===================== -->
+                       <if test="data.properties.length">
+                               {! var ownProperties = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !}
+                               <if test="ownProperties.length">
+                               <table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class {+data.alias+}.">
+                                       <caption>Field Summary</caption>
+                                       <thead>
+                                               <tr>
+                                                       <th scope="col">Field Attributes</th>
+                                                       <th scope="col">Field Name and Description</th>
+                                               </tr>
+                                       </thead>
+                                       <tbody>
+                                       <for each="member" in="ownProperties">
+                                               <tr>
+                                                       <td class="attributes">{!
+                                                               if (member.isPrivate) output += "&lt;private&gt; ";
+                                                               if (member.isInner) output += "&lt;inner&gt; ";
+                                                               if (member.isStatic) output += "&lt;static&gt; ";
+                                                               if (member.isConstant) output += "&lt;constant&gt; ";
+                                                       !}&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">
+                                                               <if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>
+                                                               </div>
+                                                               <div class="description">{+resolveLinks(summarize(member.desc))+}</div>
+                                                       </td>
+                                               </tr>
+                                       </for>
+                                       </tbody>
+                               </table>
+                               </if>
+                               
+                               <if test="data.inheritsFrom.length">
+                               <dl class="inheritsList">
+                               {!
+                                       var borrowedMembers = data.properties.filter(function($) {return $.memberOf != data.alias});
+                                       
+                                       var contributers = [];
+                                       borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
+                                       for (var i = 0, l = contributers.length; i < l; i++) {
+                                               output +=
+                                                       "<dt>Fields borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
+                                                       +
+                                                       "<dd>" +
+                                                       borrowedMembers
+                                                       .filter(
+                                                               function($) { return $.memberOf == contributers[i] }
+                                                       )
+                                                       .sort(makeSortby("name"))
+                                                       .map(
+                                                               function($) { return new Link().toSymbol($.alias).withText($.name) }
+                                                       )
+                                                       .join(", ")
+                                                       +
+                                                       "</dd>";
+                                       }
+                               !}
+                               </dl>
+                               </if>
+                       </if>
+
+<!-- ============================== methods summary ======================== -->
+                       <if test="data.methods.length">
+                               {! var ownMethods = data.methods.filter(function($){return $.memberOf == data.alias  && !$.isNamespace}).sort(makeSortby("name")); !}
+                               <if test="ownMethods.length">
+                               <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class {+data.alias+}.">
+                                       <caption>Method Summary</caption>
+                                       <thead>
+                                               <tr>
+                                                       <th scope="col">Method Attributes</th>
+                                                       <th scope="col">Method Name and Description</th>
+                                               </tr>
+                                       </thead>
+                                       <tbody>
+                                       <for each="member" in="ownMethods">
+                                               <tr>
+                                                       <td class="attributes">{!
+                                                               if (member.isPrivate) output += "&lt;private&gt; ";
+                                                               if (member.isInner) output += "&lt;inner&gt; ";
+                                                               if (member.isStatic) output += "&lt;static&gt; ";
+                                                       !}&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name.replace(/\^\d+$/, ''))+}</b>{+makeSignature(member.params)+}
+                                                               </div>
+                                                               <div class="description">{+resolveLinks(summarize(member.desc))+}</div>
+                                                       </td>
+                                               </tr>
+                                       </for>
+                                       </tbody>
+                               </table>
+                               </if>
+                               
+                               <if test="data.inheritsFrom.length">
+                               <dl class="inheritsList">
+                               {!
+                                       var borrowedMembers = data.methods.filter(function($) {return $.memberOf != data.alias});
+                                       var contributers = [];
+                                       borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
+                                       for (var i = 0, l = contributers.length; i < l; i++) {
+                                               output +=
+                                                       "<dt>Methods borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
+                                                       +
+                                                       "<dd>" +
+                                                       borrowedMembers
+                                                       .filter(
+                                                               function($) { return $.memberOf == contributers[i] }
+                                                       )
+                                                       .sort(makeSortby("name"))
+                                                       .map(
+                                                               function($) { return new Link().toSymbol($.alias).withText($.name) }
+                                                       )
+                                                       .join(", ")
+                                                       +
+                                                       "</dd>";
+                                       }
+                               
+                               !}
+                               </dl>
+                               </if>
+                       </if>
+<!-- ============================== events summary ======================== -->
+                       <if test="data.events.length">
+                               {! var ownEvents = data.events.filter(function($){return $.memberOf == data.alias  && !$.isNamespace}).sort(makeSortby("name")); !}
+                               <if test="ownEvents.length">
+                               <table class="summaryTable" cellspacing="0" summary="A summary of the events documented in the class {+data.alias+}.">
+                                       <caption>Event Summary</caption>
+                                       <thead>
+                                               <tr>
+                                                       <th scope="col">Event Attributes</th>
+                                                       <th scope="col">Event Name and Description</th>
+                                               </tr>
+                                       </thead>
+                                       <tbody>
+                                       <for each="member" in="ownEvents">
+                                               <tr>
+                                                       <td class="attributes">{!
+                                                               if (member.isPrivate) output += "&lt;private&gt; ";
+                                                               if (member.isInner) output += "&lt;inner&gt; ";
+                                                               if (member.isStatic) output += "&lt;static&gt; ";
+                                                       !}&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>{+makeSignature(member.params)+}
+                                                               </div>
+                                                               <div class="description">{+resolveLinks(summarize(member.desc))+}</div>
+                                                       </td>
+                                               </tr>
+                                       </for>
+                                       </tbody>
+                               </table>
+                               </if>
+                               
+                               <if test="data.inheritsFrom.length">
+                               <dl class="inheritsList">
+                               {!
+                                       var borrowedMembers = data.events.filter(function($) {return $.memberOf != data.alias});
+                                       var contributers = [];
+                                       borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
+                                       for (var i = 0, l = contributers.length; i < l; i++) {
+                                               output +=
+                                                       "<dt>Events borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
+                                                       +
+                                                       "<dd>" +
+                                                       borrowedMembers
+                                                       .filter(
+                                                               function($) { return $.memberOf == contributers[i] }
+                                                       )
+                                                       .sort(makeSortby("name"))
+                                                       .map(
+                                                               function($) { return new Link().toSymbol($.alias).withText($.name) }
+                                                       )
+                                                       .join(", ")
+                                                       +
+                                                       "</dd>";
+                                       }
+                               
+                               !}
+                               </dl>
+                               </if>
+                       </if>
+
+<!-- ============================== constructor details ==================== -->               
+                       <if test="!data.isBuiltin() && (data.isNamespace || data.is('CONSTRUCTOR'))">
+                       <div class="details"><a name="constructor"> </a>
+                               <div class="sectionTitle">
+                                       {+classType+}Detail
+                               </div>
+                               
+                               <div class="fixedFont">{!
+                                       if (data.isPrivate) output += "&lt;private&gt; ";
+                                       if (data.isInner) output += "&lt;inner&gt; ";
+                               !}
+                                               <b>{+ data.alias +}</b><if test="classType != 'Namespace '">{+ makeSignature(data.params) +}</if>
+                               </div>
+                               
+                               <div class="description">
+                                       {+resolveLinks(data.desc)+}
+                                       <if test="data.author"><br /><i>Author: </i>{+data.author+}.</if>
+                               </div>
+                               
+                               <if test="data.example.length">
+                               <for each="example" in="data.example">
+                               <pre class="code">{+example+}</pre>
+                               </for>
+                               </if>
+                               
+                               
+                                       <if test="data.params.length">
+                                               <dl class="detailList">
+                                               <dt class="heading">Parameters:</dt>
+                                               <for each="item" in="data.params">
+                                                       <dt>
+                                                               {+((item.type)?""+("<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type)+"}</span> ")) : "")+} <b>{+item.name+}</b>
+                                                               <if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
+                                                       </dt>
+                                                               <dd>{+resolveLinks(item.desc)+}</dd>
+                                               </for>
+                                               </dl>
+                                       </if>
+                                       <if test="data.deprecated">
+                                               <dl class="detailList">
+                                               <dt class="heading">Deprecated:</dt>
+                                               <dt>
+                                                       {+resolveLinks(data.deprecated)+}
+                                               </dt>
+                                               </dl>
+                                       </if>
+                                       <if test="data.since">
+                                               <dl class="detailList">
+                                               <dt class="heading">Since:</dt>
+                                                       <dd>{+ data.since +}</dd>
+                                               </dl>
+                                       </if>
+                                       <if test="data.exceptions.length">
+                                               <dl class="detailList">
+                                               <dt class="heading">Throws:</dt>
+                                               <for each="item" in="data.exceptions">
+                                                       <dt>
+                                                               {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
+                                                       </dt>
+                                                               <dd>{+resolveLinks(item.desc)+}</dd>
+                                               </for>
+                                               </dl>
+                                       </if>
+                                       <if test="data.returns.length">
+                                               <dl class="detailList">
+                                               <dt class="heading">Returns:</dt>
+                                               <for each="item" in="data.returns">
+                                                               <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
+                                               </for>
+                                               </dl>
+                                       </if>
+                                       <if test="data.requires.length">
+                                               <dl class="detailList">
+                                               <dt class="heading">Requires:</dt>
+                                               <for each="item" in="data.requires">
+                                                       <dd>{+ new Link().toSymbol(item) +}</dd>
+                                               </for>
+                                               </dl>
+                                       </if>
+                                       <if test="data.see.length">
+                                               <dl class="detailList">
+                                               <dt class="heading">See:</dt>
+                                               <for each="item" in="data.see">
+                                                       <dd>{+ new Link().toSymbol(item) +}</dd>
+                                               </for>
+                                               </dl>
+                                       </if>
+
+                       </div>
+                       </if>
+
+<!-- ============================== field details ========================== -->               
+                       <if test="defined(ownProperties) && ownProperties.length">
+                               <div class="sectionTitle">
+                                       Field Detail
+                               </div>
+                               <for each="member" in="ownProperties">
+                                       <a name="{+Link.symbolNameToLinkName(member)+}"> </a>
+                                       <div class="fixedFont">{!
+                                               if (member.isPrivate) output += "&lt;private&gt; ";
+                                               if (member.isInner) output += "&lt;inner&gt; ";
+                                               if (member.isStatic) output += "&lt;static&gt; ";
+                                               if (member.isConstant) output += "&lt;constant&gt; ";
+                                       !}
+                                       
+                                       <if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
+                                       <if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>
+                                       
+                                       </div>
+                                       <div class="description">
+                                               {+resolveLinks(member.desc)+}
+                                               <if test="member.srcFile != data.srcFile">
+                                                       <br />
+                                                       <i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
+                                               </if>
+                                               <if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
+                                       </div>
+                                       
+                                       <if test="member.example.length">
+                                       <for each="example" in="member.example">
+                                       <pre class="code">{+example+}</pre>
+                                       </for>
+                                       </if>
+
+                                               <if test="member.deprecated">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Deprecated:</dt>
+                                                       <dt>
+                                                               {+ resolveLinks(member.deprecated) +}
+                                                       </dt>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.since">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Since:</dt>
+                                                               <dd>{+ member.since +}</dd>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.see.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">See:</dt>
+                                                       <for each="item" in="member.see">
+                                                       <dd>{+ new Link().toSymbol(item) +}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.defaultValue">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Default Value:</dt>
+                                                       <dd>
+                                                               {+resolveLinks(member.defaultValue)+}
+                                                       </dd>
+                                                       </dl>
+                                               </if>
+
+                                       <if test="!$member_last"><hr /></if>
+                               </for>
+                       </if>
+
+<!-- ============================== method details ========================= -->               
+                       <if test="defined(ownMethods) && ownMethods.length">
+                               <div class="sectionTitle">
+                                       Method Detail
+                               </div>
+                               <for each="member" in="ownMethods">
+                                       <a name="{+Link.symbolNameToLinkName(member)+}"> </a>
+                                       <div class="fixedFont">{!
+                                               if (member.isPrivate) output += "&lt;private&gt; ";
+                                               if (member.isInner) output += "&lt;inner&gt; ";
+                                               if (member.isStatic) output += "&lt;static&gt; ";
+                                       !}
+                                       
+                                       <if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
+                                       <if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name.replace(/\^\d+$/, '')+}</b>{+makeSignature(member.params)+}
+                                       
+                                       </div>
+                                       <div class="description">
+                                               {+resolveLinks(member.desc)+}
+                                               <if test="member.srcFile != data.srcFile">
+                                                       <br />
+                                                       <i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
+                                               </if>
+                                               <if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
+                                       </div>
+                                       
+                                       <if test="member.example.length">
+                                       <for each="example" in="member.example">
+                                       <pre class="code">{+example+}</pre>
+                                       </for>
+                                       </if>
+                                       
+                                               <if test="member.params.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       <for each="item" in="member.params">
+                                                               <dt>
+                                                                       {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}<b>{+item.name+}</b>
+                                                                       <if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
+                                                               </dt>
+                                                               <dd>{+resolveLinks(item.desc)+}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.deprecated">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Deprecated:</dt>
+                                                       <dt>
+                                                               {+ resolveLinks(member.deprecated) +}
+                                                       </dt>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.since">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Since:</dt>
+                                                               <dd>{+ member.since +}</dd>
+                                                       </dl>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.exceptions.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Throws:</dt>
+                                                       <for each="item" in="member.exceptions">
+                                                               <dt>
+                                                                       {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
+                                                               </dt>
+                                                               <dd>{+resolveLinks(item.desc)+}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.returns.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       <for each="item" in="member.returns">
+                                                               <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.requires.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Requires:</dt>
+                                                       <for each="item" in="member.requires">
+                                                               <dd>{+ resolveLinks(item) +}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.see.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">See:</dt>
+                                                       <for each="item" in="member.see">
+                                                               <dd>{+ new Link().toSymbol(item) +}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+
+                                       <if test="!$member_last"><hr /></if>
+                               </for>
+                       </if>
+                       
+<!-- ============================== event details ========================= -->                
+                       <if test="defined(ownEvents) && ownEvents.length">
+                               <div class="sectionTitle">
+                                       Event Detail
+                               </div>
+                               <for each="member" in="ownEvents">
+                                       <a name="{+Link.symbolNameToLinkName(member)+}"> </a>
+                                       <div class="fixedFont">{!
+                                               if (member.isPrivate) output += "&lt;private&gt; ";
+                                               if (member.isInner) output += "&lt;inner&gt; ";
+                                               if (member.isStatic) output += "&lt;static&gt; ";
+                                       !}
+                                       
+                                       <if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
+                                       <if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>{+makeSignature(member.params)+}
+                                       
+                                       </div>
+                                       <div class="description">
+                                               {+resolveLinks(member.desc)+}
+                                               <if test="member.srcFile != data.srcFile">
+                                                       <br />
+                                                       <i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
+                                               </if>
+                                               <if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
+                                       </div>
+                                       
+                                       <if test="member.example.length">
+                                       <for each="example" in="member.example">
+                                       <pre class="code">{+example+}</pre>
+                                       </for>
+                                       </if>
+                                       
+                                               <if test="member.params.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       <for each="item" in="member.params">
+                                                               <dt>
+                                                                       {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}<b>{+item.name+}</b>
+                                                                       <if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
+                                                               </dt>
+                                                               <dd>{+ resolveLinks(item.desc) +}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.deprecated">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Deprecated:</dt>
+                                                       <dt>
+                                                               {+ resolveLinks(member.deprecated) +}
+                                                       </dt>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.since">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Since:</dt>
+                                                               <dd>{+ member.since +}</dd>
+                                                       </dl>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.exceptions.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Throws:</dt>
+                                                       <for each="item" in="member.exceptions">
+                                                               <dt>
+                                                                       {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
+                                                               </dt>
+                                                               <dd>{+ resolveLinks(item.desc) +}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.returns.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       <for each="item" in="member.returns">
+                                                               <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.requires.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Requires:</dt>
+                                                       <for each="item" in="member.requires">
+                                                               <dd>{+ resolveLinks(item) +}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.see.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">See:</dt>
+                                                       <for each="item" in="member.see">
+                                                               <dd>{+ new Link().toSymbol(item) +}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+
+                                       <if test="!$member_last"><hr /></if>
+                               </for>
+                       </if>
+                       
+                       <hr />
+               </div>
+
+               
+<!-- ============================== footer ================================= -->
+               <div class="fineprint" style="clear:both">
+                       <if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
+                       Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
+               </div>
+       </body>
+</html>
diff --git a/jsdoc-toolkit/templates/jsdoc/index.tmpl b/jsdoc-toolkit/templates/jsdoc/index.tmpl
new file mode 100644 (file)
index 0000000..a5dc115
--- /dev/null
@@ -0,0 +1,39 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
+               
+               <title>JsDoc Reference - Index</title>
+               <meta name="generator" content="JsDoc Toolkit" />
+               
+               <style type="text/css">
+               {+include("static/default.css")+}
+               </style>
+       </head>
+       
+       <body>
+               {+include("static/header.html")+}
+               
+               <div id="index">
+                       {+publish.classesIndex+}
+               </div>
+               
+               <div id="content">
+                       <h1 class="classTitle">Class Index</h1>
+                       
+                       <for each="thisClass" in="data">
+                       <div>
+                               <h2>{+(new Link().toSymbol(thisClass.alias))+}</h2>
+                               {+resolveLinks(summarize(thisClass.classDesc))+}
+                       </div>
+                       <hr />
+                       </for>
+                       
+               </div>
+               <div class="fineprint" style="clear:both">
+                       <if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
+                       Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
+               </div>
+       </body>
+</html>
\ No newline at end of file
diff --git a/jsdoc-toolkit/templates/jsdoc/publish.js b/jsdoc-toolkit/templates/jsdoc/publish.js
new file mode 100644 (file)
index 0000000..42300f4
--- /dev/null
@@ -0,0 +1,201 @@
+/** Called automatically by JsDoc Toolkit. */
+function publish(symbolSet) {
+       publish.conf = {  // trailing slash expected for dirs
+               ext:         ".html",
+               outDir:      JSDOC.opt.d || SYS.pwd+"../out/jsdoc/",
+               templatesDir: JSDOC.opt.t || SYS.pwd+"../templates/jsdoc/",
+               symbolsDir:  "symbols/",
+               srcDir:      "symbols/src/"
+       };
+       
+       // is source output is suppressed, just display the links to the source file
+       if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) {
+               Link.prototype._makeSrcLink = function(srcFilePath) {
+                       return "&lt;"+srcFilePath+"&gt;";
+               }
+       }
+       
+       // create the folders and subfolders to hold the output
+       IO.mkPath((publish.conf.outDir+"symbols/src").split("/"));
+               
+       // used to allow Link to check the details of things being linked to
+       Link.symbolSet = symbolSet;
+
+       // create the required templates
+       try {
+               var classTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"class.tmpl");
+               var classesTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allclasses.tmpl");
+       }
+       catch(e) {
+               print("Couldn't create the required templates: "+e);
+               quit();
+       }
+       
+       // some ustility filters
+       function hasNoParent($) {return ($.memberOf == "")}
+       function isaFile($) {return ($.is("FILE"))}
+       function isaClass($) {return ($.is("CONSTRUCTOR") || $.isNamespace)}
+       
+       // get an array version of the symbolset, useful for filtering
+       var symbols = symbolSet.toArray();
+       
+       // create the hilited source code files
+       var files = JSDOC.opt.srcFiles;
+       for (var i = 0, l = files.length; i < l; i++) {
+               var file = files[i];
+               var srcDir = publish.conf.outDir + "symbols/src/";
+               makeSrcFile(file, srcDir);
+       }
+       
+       // get a list of all the classes in the symbolset
+       var classes = symbols.filter(isaClass).sort(makeSortby("alias"));
+       
+       // create a filemap in which outfiles must be to be named uniquely, ignoring case
+       if (JSDOC.opt.u) {
+               var filemapCounts = {};
+               Link.filemap = {};
+               for (var i = 0, l = classes.length; i < l; i++) {
+                       var lcAlias = classes[i].alias.toLowerCase();
+                       
+                       if (!filemapCounts[lcAlias]) filemapCounts[lcAlias] = 1;
+                       else filemapCounts[lcAlias]++;
+                       
+                       Link.filemap[classes[i].alias] = 
+                               (filemapCounts[lcAlias] > 1)?
+                               lcAlias+"_"+filemapCounts[lcAlias] : lcAlias;
+               }
+       }
+       
+       // create a class index, displayed in the left-hand column of every class page
+       Link.base = "../";
+       publish.classesIndex = classesTemplate.process(classes); // kept in memory
+       
+       // create each of the class pages
+       for (var i = 0, l = classes.length; i < l; i++) {
+               var symbol = classes[i];
+               
+               symbol.events = symbol.getEvents();   // 1 order matters
+               symbol.methods = symbol.getMethods(); // 2
+               
+               Link.currentSymbol= symbol;
+               var output = "";
+               output = classTemplate.process(symbol);
+               
+               IO.saveFile(publish.conf.outDir+"symbols/", ((JSDOC.opt.u)? Link.filemap[symbol.alias] : symbol.alias) + publish.conf.ext, output);
+       }
+       
+       // regenerate the index with different relative links, used in the index pages
+       Link.base = "";
+       publish.classesIndex = classesTemplate.process(classes);
+       
+       // create the class index page
+       try {
+               var classesindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"index.tmpl");
+       }
+       catch(e) { print(e.message); quit(); }
+       
+       var classesIndex = classesindexTemplate.process(classes);
+       IO.saveFile(publish.conf.outDir, "index"+publish.conf.ext, classesIndex);
+       classesindexTemplate = classesIndex = classes = null;
+       
+       // create the file index page
+       try {
+               var fileindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allfiles.tmpl");
+       }
+       catch(e) { print(e.message); quit(); }
+       
+       var documentedFiles = symbols.filter(isaFile); // files that have file-level docs
+       var allFiles = []; // not all files have file-level docs, but we need to list every one
+       
+       for (var i = 0; i < files.length; i++) {
+               allFiles.push(new JSDOC.Symbol(files[i], [], "FILE", new JSDOC.DocComment("/** */")));
+       }
+       
+       for (var i = 0; i < documentedFiles.length; i++) {
+               var offset = files.indexOf(documentedFiles[i].alias);
+               allFiles[offset] = documentedFiles[i];
+       }
+               
+       allFiles = allFiles.sort(makeSortby("name"));
+
+       // output the file index page
+       var filesIndex = fileindexTemplate.process(allFiles);
+       IO.saveFile(publish.conf.outDir, "files"+publish.conf.ext, filesIndex);
+       fileindexTemplate = filesIndex = files = null;
+}
+
+
+/** Just the first sentence (up to a full stop). Should not break on dotted variable names. */
+function summarize(desc) {
+       if (typeof desc != "undefined")
+               return desc.match(/([\w\W]+?\.)[^a-z0-9_$]/i)? RegExp.$1 : desc;
+}
+
+/** Make a symbol sorter by some attribute. */
+function makeSortby(attribute) {
+       return function(a, b) {
+               if (a[attribute] != undefined && b[attribute] != undefined) {
+                       a = a[attribute].toLowerCase();
+                       b = b[attribute].toLowerCase();
+                       if (a < b) return -1;
+                       if (a > b) return 1;
+                       return 0;
+               }
+       }
+}
+
+/** Pull in the contents of an external file at the given path. */
+function include(path) {
+       var path = publish.conf.templatesDir+path;
+       return IO.readFile(path);
+}
+
+/** Turn a raw source file into a code-hilited page in the docs. */
+function makeSrcFile(path, srcDir, name) {
+       if (JSDOC.opt.s) return;
+       
+       if (!name) {
+               name = path.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_");
+               name = name.replace(/\:/g, "_");
+       }
+       
+       var src = {path: path, name:name, charset: IO.encoding, hilited: ""};
+       
+       if (defined(JSDOC.PluginManager)) {
+               JSDOC.PluginManager.run("onPublishSrc", src);
+       }
+
+       if (src.hilited) {
+               IO.saveFile(srcDir, name+publish.conf.ext, src.hilited);
+       }
+}
+
+/** Build output for displaying function parameters. */
+function makeSignature(params) {
+       if (!params) return "()";
+       var signature = "("
+       +
+       params.filter(
+               function($) {
+                       return $.name.indexOf(".") == -1; // don't show config params in signature
+               }
+       ).map(
+               function($) {
+                       return $.name;
+               }
+       ).join(", ")
+       +
+       ")";
+       return signature;
+}
+
+/** Find symbol {@link ...} strings in text and turn into html links */
+function resolveLinks(str, from) {
+       str = str.replace(/\{@link ([^} ]+) ?\}/gi,
+               function(match, symbolName) {
+                       return new Link().toSymbol(symbolName);
+               }
+       );
+       
+       return str;
+}
diff --git a/jsdoc-toolkit/templates/jsdoc/static/default.css b/jsdoc-toolkit/templates/jsdoc/static/default.css
new file mode 100644 (file)
index 0000000..97e021e
--- /dev/null
@@ -0,0 +1,162 @@
+/* default.css */
+body
+{
+       font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+       width: 800px;
+}
+
+.header
+{
+       clear: both;
+       background-color: #ccc;
+       padding: 8px;
+}
+
+h1
+{
+       font-size: 150%;
+       font-weight: bold;
+       padding: 0;
+       margin: 1em 0 0 .3em;
+}
+
+hr
+{
+       border: none 0;
+       border-top: 1px solid #7F8FB1;
+       height: 1px;
+}
+
+pre.code
+{
+       display: block;
+       padding: 8px;
+       border: 1px dashed #ccc;
+}
+
+#index
+{
+       margin-top: 24px;
+       float: left;
+       width: 160px;
+       position: absolute;
+       left: 8px;
+       background-color: #F3F3F3;
+       padding: 8px;
+}
+
+#content
+{
+       margin-left: 190px;
+       width: 600px;
+}
+
+.classList
+{
+       list-style-type: none;
+       padding: 0;
+       margin: 0 0 0 8px;
+       font-family: arial, sans-serif;
+       font-size: 1em;
+       overflow: auto;
+}
+
+.classList li
+{
+       padding: 0;
+       margin: 0 0 8px 0;
+}
+
+.summaryTable { width: 100%; }
+
+h1.classTitle
+{
+       font-size:170%;
+       line-height:130%;
+}
+
+h2 { font-size: 110%; }
+caption, div.sectionTitle
+{
+       background-color: #7F8FB1;
+       color: #fff;
+       font-size:130%;
+       text-align: left;
+       padding: 2px 6px 2px 6px;
+       border: 1px #7F8FB1 solid;
+}
+
+div.sectionTitle { margin-bottom: 8px; }
+.summaryTable thead { display: none; }
+
+.summaryTable td
+{
+       vertical-align: top;
+       padding: 4px;
+       border-bottom: 1px #7F8FB1 solid;
+       border-right: 1px #7F8FB1 solid;
+}
+
+/*col#summaryAttributes {}*/
+.summaryTable td.attributes
+{
+       border-left: 1px #7F8FB1 solid;
+       width: 140px;
+       text-align: right;
+}
+
+td.attributes, .fixedFont
+{
+       line-height: 15px;
+       color: #002EBE;
+       font-family: "Courier New",Courier,monospace;
+       font-size: 13px;
+}
+
+.summaryTable td.nameDescription
+{
+       text-align: left;
+       font-size: 13px;
+       line-height: 15px;
+}
+
+.summaryTable td.nameDescription, .description
+{
+       line-height: 15px;
+       padding: 4px;
+       padding-left: 4px;
+}
+
+.summaryTable { margin-bottom: 8px; }
+
+ul.inheritsList
+{
+       list-style: square;
+       margin-left: 20px;
+       padding-left: 0;
+}
+
+.detailList {
+       margin-left: 20px; 
+       line-height: 15px;
+}
+.detailList dt { margin-left: 20px; }
+
+.detailList .heading
+{
+       font-weight: bold;
+       padding-bottom: 6px;
+       margin-left: 0;
+}
+
+.light, td.attributes, .light a:link, .light a:visited
+{
+       color: #777;
+       font-style: italic;
+}
+
+.fineprint
+{
+       text-align: right;
+       font-size: 10px;
+}
\ No newline at end of file
diff --git a/jsdoc-toolkit/templates/jsdoc/static/header.html b/jsdoc-toolkit/templates/jsdoc/static/header.html
new file mode 100644 (file)
index 0000000..353b735
--- /dev/null
@@ -0,0 +1,2 @@
+<div id="header">
+</div>
\ No newline at end of file
diff --git a/jsdoc-toolkit/templates/jsdoc/static/index.html b/jsdoc-toolkit/templates/jsdoc/static/index.html
new file mode 100644 (file)
index 0000000..661f6f6
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+       <title>Generated Javascript Documentation</title>
+</head>
+<frameset cols="20%,80%">
+       <frame src="allclasses-frame.html" name="packageFrame" />
+       <frame src="splash.html" name="classFrame" />
+       <noframes>
+               <body>
+               <p>
+               This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
+               </p>
+               </body>
+       </noframes>
+</frameset>
+</html>
\ No newline at end of file
diff --git a/jsdoc-toolkit/templates/jsdoc/symbol.tmpl b/jsdoc-toolkit/templates/jsdoc/symbol.tmpl
new file mode 100644 (file)
index 0000000..f8f4bd1
--- /dev/null
@@ -0,0 +1,35 @@
+<symbol alias="{+data.alias+}">
+       <name>{+data.name+}</name>
+       <memberOf>{+data.memberOf+}</memberOf>
+       <isStatic>{+data.isStatic+}</isStatic>
+       <isa>{+data.isa+}</isa>
+       <desc>{+data.desc+}</desc>
+       <classDesc>{+data.classDesc+}</classDesc>
+       
+       <methods><for each="method" in="data.methods">
+               <method>
+                       <name>{+method.name+}</name>
+                       <memberOf>{+method.memberOf+}</memberOf>
+                       <isStatic>{+method.isStatic+}</isStatic>
+                       <desc>{+method.desc+}</desc>
+                       <params><for each="param" in="method.params">
+                               <param>
+                                       <type>{+param.type+}</type>
+                                       <name>{+param.name+}</name>
+                                       <desc>{+param.desc+}</desc>
+                                       <defaultValue>{+param.defaultValue+}</defaultValue>
+                               </param></for>
+                       </params>
+               </method></for>
+       </methods>
+       
+       <properties><for each="property" in="data.properties">
+               <property>
+                       <name>{+property.name+}</name>
+                       <memberOf>{+property.memberOf+}</memberOf>
+                       <isStatic>{+property.isStatic+}</isStatic>
+                       <desc>{+property.desc+}</desc>
+                       <type>{+property.type+}</type>
+               </property></for>
+       </properties>
+</symbol>