File tree 2 files changed +17
-9
lines changed
site/frontend/src/pages/graphs
2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,11 @@ async function loadGraphData(selector: GraphsSelector, loading: Ref<boolean>) {
70
70
71
71
// If we select a smaller subset of benchmarks, then just show them.
72
72
if (hasSpecificSelection (selector )) {
73
- renderPlots (graphData , selector , " #charts" );
73
+ renderPlots (
74
+ graphData ,
75
+ selector ,
76
+ document .querySelector <HTMLElement >(" #charts" )
77
+ );
74
78
} else {
75
79
// If we select all of them, we expect that there will be a regular grid.
76
80
@@ -81,15 +85,23 @@ async function loadGraphData(selector: GraphsSelector, loading: Ref<boolean>) {
81
85
graphData ,
82
86
(benchName ) => ! benchName .endsWith (" -tiny" )
83
87
);
84
- renderPlots (withoutTiny , selector , " #charts" );
88
+ renderPlots (
89
+ withoutTiny ,
90
+ selector ,
91
+ document .querySelector <HTMLElement >(" #charts" )
92
+ );
85
93
86
94
// Then, render only the size-related ones in their own dedicated section as they are less
87
95
// important than having the better grouping. So, we only include the benchmarks ending in
88
96
// "-tiny" and render them in the appropriate section.
89
97
const onlyTiny = filterBenchmarks (graphData , (benchName ) =>
90
98
benchName .endsWith (" -tiny" )
91
99
);
92
- renderPlots (onlyTiny , selector , " #size-charts" );
100
+ renderPlots (
101
+ onlyTiny ,
102
+ selector ,
103
+ document .querySelector <HTMLElement >(" #size-charts" )
104
+ );
93
105
}
94
106
}
95
107
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ function normalizeData(data: GraphData) {
285
285
export function renderPlots (
286
286
data : GraphData ,
287
287
selector : GraphsSelector ,
288
- elementSelector : string
288
+ plotElement : HTMLElement
289
289
) {
290
290
normalizeData ( data ) ;
291
291
@@ -377,11 +377,7 @@ export function renderPlots(
377
377
absoluteMode : selector . kind == "raw" ,
378
378
} ) ;
379
379
380
- new uPlot (
381
- plotOpts ,
382
- plotData as any as TypedArray [ ] ,
383
- document . querySelector < HTMLElement > ( elementSelector )
384
- ) ;
380
+ new uPlot ( plotOpts , plotData as any as TypedArray [ ] , plotElement ) ;
385
381
386
382
i ++ ;
387
383
}
You can’t perform that action at this time.
0 commit comments