@@ -8,12 +8,13 @@ async function displayData(data, metric, metricName) {
8
8
( el ) => ( el . innerHTML = metricName )
9
9
) ;
10
10
11
- function display ( el , cols ) {
12
- flattened . sort (
13
- ( a , b ) =>
14
- cols . reduce ( ( acc , key ) => acc + b [ key ] , 0 ) -
15
- cols . reduce ( ( acc , key ) => acc + a [ key ] , 0 )
16
- ) ;
11
+ function display ( el , cols , sort_key ) {
12
+ // flattened.sort(
13
+ // (a, b) =>
14
+ // cols.reduce((acc, key) => acc + b[key], 0) -
15
+ // cols.reduce((acc, key) => acc + a[key], 0)
16
+ // );
17
+ flattened . sort ( ( a , b ) => b [ sort_key ] - a [ sort_key ] ) ;
17
18
18
19
const tbody = el . querySelector ( "tbody" ) ;
19
20
tbody . innerHTML = "" ;
@@ -39,12 +40,16 @@ async function displayData(data, metric, metricName) {
39
40
}
40
41
}
41
42
42
- display ( tableClass , [
43
- "completion" ,
44
- "compilation_class_wise" ,
45
- "pass_class_wise" ,
46
- ] ) ;
47
- display ( tableTest , [ "compilation_test_wise" , "pass_test_wise" ] ) ;
43
+ display (
44
+ tableClass ,
45
+ [ "completion" , "compilation_class_wise" , "pass_class_wise" ] ,
46
+ "pass_class_wise"
47
+ ) ;
48
+ display (
49
+ tableTest ,
50
+ [ "compilation_test_wise" , "pass_test_wise" ] ,
51
+ "pass_test_wise"
52
+ ) ;
48
53
}
49
54
50
55
btnMethod . addEventListener ( "click" , ( ) => {
0 commit comments