@@ -3,6 +3,22 @@ import {DASHBOARD_DATA_URL} from "../urls";
33
44import  { getJson }  from  "../utils/requests" ; 
55
6+ type  ScaleKind  =  "linear"  |  "log" ; 
7+ let  scale : ScaleKind  =  "linear" ; 
8+ 
9+ const  buttons  =  Array . from ( 
10+   document . querySelectorAll < HTMLInputElement > ( "#scale-select-form input" ) 
11+ ) ; 
12+ 
13+ Array . from ( buttons ) . map ( ( button )  =>  { 
14+   button . addEventListener ( "change" ,  ( )  =>  { 
15+     if  ( button . checked )  { 
16+       scale  =  button . value  as  ScaleKind ; 
17+       make_data ( ) ; 
18+     } 
19+   } ) ; 
20+ } ) ; 
21+ 
622interface  DashboardCompileBenchmarkCases  { 
723  clean_averages : [ number ] ; 
824  base_incr_averages : [ number ] ; 
@@ -44,8 +60,8 @@ function render(
4460    } , 
4561    yAxis : { 
4662      title : { text : "Seconds" } , 
47-       min : Math . min ( ... Object . keys ( data ) . flatMap ( ( key )   =>   data [ key ] ) ) , 
48-       type : " logarithmic", 
63+       min : scale   ===   "linear"  ?  0  :  undefined , 
64+       type : scale   ===   "log"  ?  " logarithmic" :  undefined , 
4965    } , 
5066    xAxis : { 
5167      categories : versions , 
@@ -101,8 +117,8 @@ function renderRuntime(element: string, data: [number], versions: [string]) {
101117    } , 
102118    yAxis : { 
103119      title : { text : "Miliseconds" } , 
104-       min : Math . min ( ... formattedData ) , 
105-       type : " logarithmic", 
120+       min : scale   ===   "linear"  ?  0  :  undefined , 
121+       type : scale   ===   "log"  ?  " logarithmic" :  undefined , 
106122    } , 
107123    xAxis : { 
108124      categories : versions . slice ( nullCount ) , 
0 commit comments