Skip to content

Commit 33d1f62

Browse files
authored
Merge pull request #51 from jberryman/dev
Some style fixups for viz
2 parents 9aae233 + 15d1e74 commit 33d1f62

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

app/web-app/index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ app.component('DataTable', {
689689
})
690690

691691
// Options for our hdr-histogram-style line chart, factored out for re-use:
692-
const makeLatencyLineChartOptions = (otherPlugins) => {
692+
const makeLatencyLineChartOptions = (otherPlugins, enable_crosshair_zoom = true) => {
693693
return {
694694
tooltips: {
695695
mode: 'interpolate',
@@ -715,7 +715,7 @@ const makeLatencyLineChartOptions = (otherPlugins) => {
715715
enabled: true,
716716
},
717717
zoom: {
718-
enabled: true, // enable zooming
718+
enabled: enable_crosshair_zoom, // enable zooming
719719
zoomboxBackgroundColor: 'rgba(66,133,244,0.2)', // background color of zoom box
720720
zoomboxBorderColor: '#48F', // border color of zoom box
721721
zoomButtonText: 'Reset Zoom', // reset zoom button text
@@ -770,7 +770,7 @@ const makeLatencyLineChartOptions = (otherPlugins) => {
770770
fontSize: 12,
771771
fontStyle: 'bold',
772772
callback: (value, index, allValues) => {
773-
return value
773+
return value.toFixed(1)
774774
},
775775
},
776776
},
@@ -832,16 +832,17 @@ app.component('MultiLatencyLineChart', {
832832
style="
833833
position: relative;
834834
width: 800px;
835-
height: 500px;
836835
padding: 50px 20px;
837836
margin: auto;
838837
"
839838
>
840839
<h1>{{benchName.replace("-k6-custom","").replaceAll("_"," ")}}</h1>
841840
<hr />
842-
<canvas id="chart-container" ref="chartElem"></canvas>
841+
<canvas height="250" ref="chartElem"></canvas>
843842
</div>
844843
`,
844+
// ^^^ NOTE: before changing height styling above, make sure it looks good
845+
// with a chart of at least 50 runs
845846
setup(props) {
846847
const chartElem = ref(null)
847848
onMounted(() => {
@@ -852,8 +853,8 @@ app.component('MultiLatencyLineChart', {
852853
label,
853854
data,
854855
fill: false,
855-
borderWidth: 2,
856-
pointRadius: 2.5,
856+
borderWidth: 1.5,
857+
pointRadius: 0, // disable points, which looks cluttered
857858
// This is a heatmap-style red to blue color scheme which lets us show
858859
// the results "fading back in time":
859860
borderColor: redToBlue(ix, props.benchData.length)
@@ -882,7 +883,8 @@ app.component('MultiLatencyLineChart', {
882883
labels: hist_labels,
883884
datasets: props.benchData.map(makeDataset),
884885
},
885-
options: makeLatencyLineChartOptions(zoomOptions),
886+
// NOTE: this isn't really compatible with crosshair.zoom, so we disable that here:
887+
options: makeLatencyLineChartOptions(zoomOptions, false),
886888
// options: makeLatencyLineChartOptions({colorschemes: { scheme: "brewer.RdYlBu11" }}),
887889
})
888890
})

0 commit comments

Comments
 (0)