@@ -148,7 +148,6 @@ function tooltipPlugin({
148148}
149149
150150function 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.
285287export function renderPlots (
286288 data : GraphData ,
287289 selector : GraphsSelector ,
288- plotElement : HTMLElement
290+ plotElement : HTMLElement ,
291+ opts ?: GraphRenderOpts = undefined
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
0 commit comments