diff --git a/benchmarking/public/style.css b/benchmarking/public/style.css index e73a1e8..7fbbe49 100644 --- a/benchmarking/public/style.css +++ b/benchmarking/public/style.css @@ -11,7 +11,7 @@ main { #status { background-color: bisque; } -form { +.form { display: grid; grid-template-columns: auto auto; grid-gap: 10px; diff --git a/benchmarking/src/components/form.js b/benchmarking/src/components/form.js index ba99df2..280a142 100644 --- a/benchmarking/src/components/form.js +++ b/benchmarking/src/components/form.js @@ -47,11 +47,26 @@ export class Form extends Component { this.props.onFormChange({ ...this.state, tolRange }) } + /** changes order of magnitude for all tolerance values */ + changeOOM(mode) { + let maxPrecision = 6 + let p = Math.pow(10, maxPrecision) + let mod = mode === 'increase' ? 10 : 0.1 + let { tolStart, tolStep, tolEnd } = this.state + const round = val => Math.round(val * p) / p + const modify = val => (round(val * mod) === 0 ? val : round(val * mod)) + this.setState({ + tolStart: modify(tolStart), + tolStep: modify(tolStep), + tolEnd: modify(tolEnd) + }) + } + render() { return (