From 41c82cfe9bbf2df980246a4404e1638bd19a5d42 Mon Sep 17 00:00:00 2001 From: Alfred Melch Date: Mon, 5 Aug 2019 14:05:06 +0200 Subject: [PATCH] Fix conversion mean - hz --- benchmarking/src/components/chart.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 ( <>