- /**
- * 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;
- };
+/**
+ * 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.
+ */
+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 : handler.parseFloat(yraw);
+ var point = {
+ x : NaN,
+ y : NaN,
+ xval : handler.parseFloat(item[0]),
+ yval : yval,
+ name : setName, // TODO(danvk): is this really necessary?
+ idx : i + boundaryIdStart
+ };
+ points.push(point);
+ }
+ this.onPointsCreated_(series, points);
+ return points;
+};