From 2ee6dad80d3cd33ecd0302c8dd3dd77e1fd52509 Mon Sep 17 00:00:00 2001 From: Manik Rana Date: Thu, 29 Feb 2024 08:39:28 +0530 Subject: [PATCH 1/2] fix: add minimum width to graphs --- site/frontend/src/graph/render.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/frontend/src/graph/render.ts b/site/frontend/src/graph/render.ts index 36a3ccb14..51f2411a0 100644 --- a/site/frontend/src/graph/render.ts +++ b/site/frontend/src/graph/render.ts @@ -492,7 +492,7 @@ export function renderPlots( cacheStates[Object.keys(cacheStates)[0]].interpolated_indices; let plotOpts = genPlotOpts({ - width, + width: 380, height: 300, yAxisLabel, series: seriesOpts, From 3fd50214b8bda7f11c0abe293834a712b0d076e4 Mon Sep 17 00:00:00 2001 From: Manik Rana Date: Thu, 29 Feb 2024 08:50:49 +0530 Subject: [PATCH 2/2] refac: set min width through opts --- site/frontend/src/graph/render.ts | 2 +- site/frontend/src/pages/graphs/page.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/site/frontend/src/graph/render.ts b/site/frontend/src/graph/render.ts index 51f2411a0..36a3ccb14 100644 --- a/site/frontend/src/graph/render.ts +++ b/site/frontend/src/graph/render.ts @@ -492,7 +492,7 @@ export function renderPlots( cacheStates[Object.keys(cacheStates)[0]].interpolated_indices; let plotOpts = genPlotOpts({ - width: 380, + width, height: 300, yAxisLabel, series: seriesOpts, diff --git a/site/frontend/src/pages/graphs/page.vue b/site/frontend/src/pages/graphs/page.vue index 4d564b91f..9eb5fad26 100644 --- a/site/frontend/src/pages/graphs/page.vue +++ b/site/frontend/src/pages/graphs/page.vue @@ -68,7 +68,7 @@ async function loadGraphData(selector: GraphsSelector, loading: Ref) { // Then draw the plots. await nextTick(); - const width = Math.floor(window.innerWidth / 4) - 40; + const width = Math.max(Math.floor(window.innerWidth / 4) - 40, 380); const opts = {width}; // If we select a smaller subset of benchmarks, then just show them.