-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathexectime.js
53 lines (49 loc) · 1.49 KB
/
exectime.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const chartistSvg = require('chartist-svg')
module.exports = (data) => {
const length = Object.keys(data.tinyld.size)
var graph = {
title: 'NodeJS Language Detection - Execution Time',
subtitle: 'in milliseconds (lower is better)',
labels: length,
series: ['tinyld', 'langdetect', 'cld', 'franc'].map((lib) => {
return length.map((len) => {
return data[lib].size[len].execution_time
})
})
}
var options = {
options: {
low: 0,
seriesBarDistance: 16,
onlyInteger: true,
// reverseData: true,
// horizontalBars: true,
width: 1200,
height: 600
},
css: `
svg { background: #FFF; }
.ct-series-a .ct-bar, .ct-series-a .ct-line, .ct-series-a .ct-point, .ct-series-a .ct-slice-donut {
stroke: #468966;
stroke-width: 16px !important;
}
.ct-series-b .ct-bar, .ct-series-b .ct-line, .ct-series-b .ct-point, .ct-series-b .ct-slice-donut {
stroke: #98BAE7;
stroke-width: 8px !important;
}
.ct-series-c .ct-bar, .ct-series-c .ct-line, .ct-series-c .ct-point, .ct-series-c .ct-slice-donut {
stroke: #FEC771;
stroke-width: 8px !important;
}
.ct-series-d .ct-bar, .ct-series-d .ct-line, .ct-series-d .ct-point, .ct-series-d .ct-slice-donut {
stroke: #F38181;
stroke-width: 8px !important;
}
.ct-series-e .ct-bar, .ct-series-e .ct-line, .ct-series-e .ct-point, .ct-series-e .ct-slice-donut {
stroke: #D47AE8;
stroke-width: 8px !important;
}
`
}
return chartistSvg('line', graph, options)
}