Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// move chart back to last valid display position from previous viewing?
if ('viewpoint' in metric && metric.viewpoint) {
this._chartRange = [metric.viewpoint, metric.viewpoint + rangeWidth];
}
// init, render, and draw chart!
options.labelsUTC = true;
options.dateWindow = this._chartRange; // update viewport of range selector
this._previousDataSize = data.length;
this._dygraph = new CustomDygraph(element, data, options,
this.props.yScaleCalculate);
// after: track chart viewport position changes
rangeEl = element.getElementsByClassName(RANGE_SELECTOR_CLASS)[0];
Dygraph.addEvent(rangeEl, 'mousedown', this._handleMouseDown.bind(this));
Dygraph.addEvent(element, 'mouseup', this._handleMouseUp.bind(this));
}
// move chart back to last valid display position from previous viewing?
if ('viewpoint' in metric && metric.viewpoint) {
this._chartRange = [metric.viewpoint, metric.viewpoint + rangeWidth];
}
// init, render, and draw chart!
options.labelsUTC = true;
options.dateWindow = this._chartRange; // update viewport of range selector
this._previousDataSize = data.length;
this._dygraph = new CustomDygraph(element, data, options,
this.props.yScaleCalculate);
// after: track chart viewport position changes
rangeEl = element.getElementsByClassName(RANGE_SELECTOR_CLASS)[0];
Dygraph.addEvent(rangeEl, 'mousedown', this._handleMouseDown.bind(this));
Dygraph.addEvent(element, 'mouseup', this._handleMouseUp.bind(this));
}