From 39c83787be8da22876d59a33e33658481211da95 Mon Sep 17 00:00:00 2001 From: Alfred Melch Date: Tue, 6 Aug 2019 15:15:36 +0200 Subject: [PATCH] Add legend information --- benchmarking/package.json | 1 + benchmarking/public/style.css | 5 ++++ benchmarking/src/components/chart.js | 20 ++++++++++++--- benchmarking/src/components/chartOptions.js | 27 +++++++++++++-------- 4 files changed, 39 insertions(+), 14 deletions(-) diff --git a/benchmarking/package.json b/benchmarking/package.json index 99420b1..03c6549 100644 --- a/benchmarking/package.json +++ b/benchmarking/package.json @@ -24,6 +24,7 @@ "chart.js": "^2.8.0", "file-drop-element": "^0.2.0", "lodash": "^4.17.11", + "platform": "^1.3.5", "react": "^16.8.6", "react-chartjs-2": "^2.7.6", "react-debounce-render": "^5.0.0", diff --git a/benchmarking/public/style.css b/benchmarking/public/style.css index d1632b9..e73a1e8 100644 --- a/benchmarking/public/style.css +++ b/benchmarking/public/style.css @@ -43,6 +43,11 @@ select { .component { min-width: 300px; flex: 1; + padding: 10px; +} + +.chartComponent { + min-width: 500px; } @media screen and (max-width: 800px) { diff --git a/benchmarking/src/components/chart.js b/benchmarking/src/components/chart.js index 32f4b2b..3f2e8df 100644 --- a/benchmarking/src/components/chart.js +++ b/benchmarking/src/components/chart.js @@ -1,6 +1,7 @@ import React from 'react' import { Line, Bar } from 'react-chartjs-2' import debounceRender from 'react-debounce-render' +import platform from 'platform' import { downloadAsJson } from '../../../lib/json-download/index.js' import { datasetTemplates, genOptions, beautifyLabels } from './chartOptions.js' @@ -18,9 +19,17 @@ export class Chart extends React.Component { data: stats[name] })) datasets.push({ ...datasetTemplates.numberOfNodes, data: nodeData }) + datasets.push({ + label: `High quality mode: ${formState.highQual}`, + data: [] + }) + datasets.push({ + label: `Platform: ${platform.description}`, + data: [] + }) let data = { datasets, labels } return ( -
+

Chart

{chart === 'wasmVsJs' && } {chart === 'wasmStack' && } @@ -48,7 +57,7 @@ class WasmVsJsChart extends React.Component { render() { let data = JSON.parse(JSON.stringify(this.props.data)) // deep copy let options = genOptions( - 'Wasm vs. JavaScript', + 'Simplify.wasm vs. Simplify.js', false, this.state.scaleY, this.state.values @@ -121,7 +130,7 @@ class WasmStackChart extends React.Component { render() { const data = this.props.data modifyDataArrays(data, 'simplifyWASM', 'storeCoords', 'loadResult') - const options = genOptions('Wasm execution', true) + const options = genOptions('Simplify.wasm runtime insights', true) return ( <>