Fix conversion mean - hz
This commit is contained in:
parent
ba3813c1f4
commit
41c82cfe9b
@ -37,16 +37,16 @@ class WasmVsJsChart extends React.Component {
|
|||||||
values: 'mean'
|
values: 'mean'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
convertDataToHz() {
|
convertDataToHz(data) {
|
||||||
let datasets = this.props.data.datasets
|
let datasets = data.datasets
|
||||||
for (let dataset of datasets.filter(d => d.label !== 'numberOfNodes')) {
|
for (let dataset of datasets.filter(d => d.label !== 'numberOfNodes')) {
|
||||||
dataset.data = dataset.data.map(mean => 1000 / mean)
|
dataset.data = dataset.data.map(mean => 1000 / mean)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
render() {
|
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)
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<Line height={400} width={400} data={data} options={options} />
|
<Line height={400} width={400} data={data} options={options} />
|
||||||
|
Loading…
Reference in New Issue
Block a user