- /**
- * Converts a series to a Point array.
- *
- * @param {!Array.<[!number,?number,?]>} series The series in the unified
- * data format where series[i] = [x,y,{extras}].
- * @param {!string} setName Name of the series.
- * @param {!number} boundaryIdStart Index offset of the first point, equal to the
- * number of skipped points left of the date window minimum (if any).
- * @return {!Array.<Dygraph.PointType>} List of points for this series.
- * @public
- */
- handler.prototype.seriesToPoints = function(series, setName, boundaryIdStart) {
- // TODO(bhs): these loops are a hot-spot for high-point-count charts. In
- // fact,
- // on chrome+linux, they are 6 times more expensive than iterating through
- // the
- // points and drawing the lines. The brunt of the cost comes from allocating
- // the |point| structures.
- var points = [];
- for ( var i = 0; i < series.length; ++i) {
- var item = series[i];
- var yraw = item[1];
- var yval = yraw === null ? null : DygraphLayout.parseFloat_(yraw);
- var point = {
- x : NaN,
- y : NaN,
- xval : DygraphLayout.parseFloat_(item[0]),
- yval : yval,
- name : setName, // TODO(danvk): is this really necessary?
- idx : i + boundaryIdStart
- };
- points.push(point);
- }
- handler.prototype.onPointsCreated_(series, points);
- return points;
- };
+/**
+ * Y-value array index constant for unified data samples.
+ * @const
+ * @type {number}
+ */
+handler.Y = 1;
+
+/**
+ * Extras-value array index constant for unified data samples.
+ * @const
+ * @type {number}
+ */
+handler.EXTRAS = 2;
+
+/**
+ * Extracts one series from the raw data (a 2D array) into an array of the
+ * unified data format.
+ * This is where undesirable points (i.e. negative values on log scales and
+ * missing values through which we wish to connect lines) are dropped.
+ * TODO(danvk): the "missing values" bit above doesn't seem right.
+ *
+ * @param {!Array.<Array>} rawData The raw data passed into dygraphs where
+ * rawData[i] = [x,ySeries1,...,ySeriesN].
+ * @param {!number} seriesIndex Index of the series to extract. All other
+ * series should be ignored.
+ * @param {!DygraphOptions} options Dygraph options.
+ * @return {Array.<[!number,?number,?]>} The series in the unified data format
+ * where series[i] = [x,y,{extras}].
+ */
+handler.prototype.extractSeries = function(rawData, seriesIndex, options) {
+};