Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_removeDygraph() {
let {model} = this.props.metaData;
let element = ReactDOM.findDOMNode(this.refs[`chart-${model.modelId}`]);
let range = element.getElementsByClassName(RANGE_SELECTOR_CLASS)[0];
if (this._dygraph) {
Dygraph.removeEvent(element, 'mouseup', this._handleMouseUp.bind(this));
Dygraph.removeEvent(range, 'mousedown', this._handleMouseDown.bind(this));
this._dygraph.destroy();
this._dygraph = null;
}
}
_removeDygraph() {
let {model} = this.props.metaData;
let element = ReactDOM.findDOMNode(this.refs[`chart-${model.modelId}`]);
let range = element.getElementsByClassName(RANGE_SELECTOR_CLASS)[0];
if (this._dygraph) {
Dygraph.removeEvent(element, 'mouseup', this._handleMouseUp.bind(this));
Dygraph.removeEvent(range, 'mousedown', this._handleMouseDown.bind(this));
this._dygraph.destroy();
this._dygraph = null;
}
}