@@ -1240,24 +1240,25 @@ class Benchmark {
12401240 if ( ! plotContainer || ! this . results || this . results . length === 0 )
12411241 return ;
12421242
1243+ const scores = this . results . map ( time => toScore ( time ) ) ;
12431244 const scoreElement = document . getElementById ( this . scoreIdentifier ( "Score" ) ) ;
12441245 const width = scoreElement . offsetWidth ;
12451246 const height = scoreElement . offsetHeight ;
12461247
12471248 const padding = 5 ;
1248- const maxResult = Math . max ( ...this . results ) ;
1249- const minResult = Math . min ( ...this . results ) ;
1249+ const maxResult = Math . max ( ...scores ) ;
1250+ const minResult = Math . min ( ...scores ) ;
12501251
1251- const xRatio = ( width - 2 * padding ) / ( this . results . length - 1 || 1 ) ;
1252+ const xRatio = ( width - 2 * padding ) / ( scores . length - 1 || 1 ) ;
12521253 const yRatio = ( height - 2 * padding ) / ( maxResult - minResult || 1 ) ;
12531254 const radius = Math . max ( 1.5 , Math . min ( 2.5 , 10 - ( this . iterations / 10 ) ) ) ;
12541255
12551256 let circlesSVG = "" ;
1256- for ( let i = 0 ; i < this . results . length ; i ++ ) {
1257- const result = this . results [ i ] ;
1257+ for ( let i = 0 ; i < scores . length ; i ++ ) {
1258+ const result = scores [ i ] ;
12581259 const cx = padding + i * xRatio ;
12591260 const cy = height - padding - ( result - minResult ) * yRatio ;
1260- const title = `Iteration ${ i + 1 } : ${ uiFriendlyDuration ( result ) } ` ;
1261+ const title = `Iteration ${ i + 1 } : ${ uiFriendlyScore ( result ) } ( ${ uiFriendlyDuration ( this . results [ i ] ) } ) ` ;
12611262 circlesSVG += `<circle cx="${ cx } " cy="${ cy } " r="${ radius } "><title>${ title } </title></circle>` ;
12621263 }
12631264 plotContainer . innerHTML = `<svg width="${ width } px" height="${ height } px">${ circlesSVG } </svg>` ;
0 commit comments