diff --git a/benchmarking/src/components/chart.js b/benchmarking/src/components/chart.js index 94c81c0..d1aa514 100644 --- a/benchmarking/src/components/chart.js +++ b/benchmarking/src/components/chart.js @@ -37,16 +37,16 @@ class WasmVsJsChart extends React.Component { values: 'mean' } } - convertDataToHz() { - let datasets = this.props.data.datasets + convertDataToHz(data) { + let datasets = data.datasets for (let dataset of datasets.filter(d => d.label !== 'numberOfNodes')) { dataset.data = dataset.data.map(mean => 1000 / mean) } } render() { - let data = this.props.data + let data = JSON.parse(JSON.stringify(this.props.data)) // deep copy let options = genOptions('Wasm vs. JavaScript', false, this.state.scaleY) - if (this.state.values === 'hz') this.convertDataToHz() + if (this.state.values === 'hz') this.convertDataToHz(data) return ( <>