Fix conversion mean - hz
This commit is contained in:
parent
ba3813c1f4
commit
41c82cfe9b
@ -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 (
|
||||
<>
|
||||
<Line height={400} width={400} data={data} options={options} />
|
||||
|
Loading…
Reference in New Issue
Block a user