72
72
< h2 > Loading & rendering data..</ h2 >
73
73
< h3 > This may take a while!</ h3 >
74
74
</ div >
75
- < div id ="byCrateChart "> </ div >
76
- < div id ="totalChart "> </ div >
75
+ < div id ="charts "> </ div >
77
76
< div id ="as-of "> </ div >
78
77
< a href ="https://github.com/rust-lang-nursery/rustc-perf ">
79
78
< img style ="position: absolute; top: 0; right: 0; border: 0; "
@@ -233,50 +232,36 @@ <h3>This may take a while!</h3>
233
232
}
234
233
235
234
function renderPlots ( data , state ) {
236
- let byChartSeriesOpts = [ { } ] ;
235
+ let seriesOpts = [ { } ] ;
237
236
238
237
let xVals = data . commits . map ( c => c [ 0 ] ) ;
239
- let byChartPlotData = [ xVals ] ;
238
+ let plotData = [ xVals ] ;
240
239
// https://sashamaps.net/docs/resources/20-colors/
241
240
let colors = [
242
241
'#e6194b' , '#3cb44b' , '#ffe119' , '#4363d8' , '#f58231' ,
243
242
'#911eb4' , '#46f0f0' , '#f032e6' , '#a09b13' , '#0ab0be' ,
244
243
'red' , 'green' , 'blue' , 'purple'
245
244
] ;
246
- let crates = Object . keys ( data . by_crate_build_times ) . sort ( ) ;
245
+ let crates = Object . keys ( data . by_crate ) . sort ( ) ;
247
246
for ( let crate of crates ) {
248
- byChartPlotData . push ( data . by_crate_build_times [ crate ] ) ;
247
+ plotData . push ( data . by_crate [ crate ] ) ;
249
248
250
- byChartSeriesOpts . push ( {
249
+ seriesOpts . push ( {
251
250
label : crate ,
252
251
stroke : colors . length ? colors . pop ( ) : 'black' ,
253
252
} ) ;
254
253
}
255
254
256
- let byChartPlotOpts = genPlotOpts ( {
257
- title : "Bootstrap time for crates >= 30 seconds" ,
255
+ let plotOpts = genPlotOpts ( {
256
+ title : "Bootstrap timings for crates >= 30 seconds" ,
258
257
width : Math . floor ( window . innerWidth ) - 16 ,
259
- height : window . innerHeight * 0.56 ,
258
+ height : window . innerHeight * 0.75 ,
260
259
yAxisLabel : "" ,
261
- series : byChartSeriesOpts ,
260
+ series : seriesOpts ,
262
261
commits : data . commits ,
263
262
} ) ;
264
263
265
- let byChartPlot = new uPlot ( byChartPlotOpts , byChartPlotData , document . querySelector ( "#byCrateChart" ) ) ;
266
-
267
- let totalPlotData = [ xVals , data . total_build_times ] ;
268
-
269
- let totalPlotOpts = genPlotOpts ( {
270
- title : "Total bootstrap time" ,
271
- width : Math . floor ( window . innerWidth ) - 16 ,
272
- height : window . innerHeight * 0.26 ,
273
- yAxisLabel : "" ,
274
- series : [ { } , { label : "rustc" , stroke : '#7cb5ec' } ] ,
275
- commits : data . commits ,
276
- } ) ;
277
-
278
- let totalPlot = new uPlot ( totalPlotOpts , totalPlotData , document . querySelector ( "#totalChart" ) ) ;
279
-
264
+ let u = new uPlot ( plotOpts , plotData , document . querySelector ( "#charts" ) ) ;
280
265
document . querySelector ( "#loading" ) . style . display = 'none' ;
281
266
}
282
267
@@ -306,4 +291,4 @@ <h3>This may take a while!</h3>
306
291
</ script >
307
292
</ body >
308
293
309
- </ html >
294
+ </ html >
0 commit comments