Skip to content

Commit a1973d3

Browse files
committed
Do not render title in benchmark detail graph
1 parent 66c2e4b commit a1973d3

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

site/frontend/src/graph/render.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ function tooltipPlugin({
148148
}
149149

150150
function genPlotOpts({
151-
title,
152151
width,
153152
height,
154153
yAxisLabel,
@@ -161,7 +160,6 @@ function genPlotOpts({
161160
absoluteMode,
162161
}) {
163162
return {
164-
title,
165163
width,
166164
height,
167165
series,
@@ -280,13 +278,20 @@ function normalizeData(data: GraphData) {
280278
}
281279
}
282280

281+
export type GraphRenderOpts = {
282+
renderTitle?: boolean;
283+
};
284+
283285
// Renders the plots data with the given parameters from the `selector`, into a DOM node optionally
284286
// selected by the `elementSelector` query.
285287
export function renderPlots(
286288
data: GraphData,
287289
selector: GraphsSelector,
288-
plotElement: HTMLElement
290+
plotElement: HTMLElement,
291+
opts?: GraphRenderOpts
289292
) {
293+
const renderTitle = opts?.renderTitle ?? true;
294+
290295
normalizeData(data);
291296

292297
const names = Object.keys(data.benchmarks).sort();
@@ -364,7 +369,6 @@ export function renderPlots(
364369
cacheStates[Object.keys(cacheStates)[0]].interpolated_indices;
365370

366371
let plotOpts = genPlotOpts({
367-
title: benchName + "-" + benchKind,
368372
width: Math.floor(window.innerWidth / 4) - 40,
369373
height: 300,
370374
yAxisLabel,
@@ -376,6 +380,9 @@ export function renderPlots(
376380
},
377381
absoluteMode: selector.kind == "raw",
378382
});
383+
if (renderTitle) {
384+
plotOpts["title"] = `${benchName}-${benchKind}`;
385+
}
379386

380387
new uPlot(plotOpts, plotData as any as TypedArray[], plotElement);
381388

site/frontend/src/pages/compare/compile/table/benchmark-detail.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ async function renderGraph() {
3030
kind: "raw",
3131
};
3232
const graphData = await loadGraphs(selector);
33-
renderPlots(graphData, selector, chartElement.value);
33+
renderPlots(graphData, selector, chartElement.value, {
34+
renderTitle: false,
35+
});
3436
}
3537
3638
const metadata = computed(

0 commit comments

Comments
 (0)