1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-23 07:29:51 -05:00
denoland-deno/website/app.js

27 lines
555 B
JavaScript
Raw Normal View History

2018-09-22 01:06:59 +09:00
const benchmarkNames = ["hello", "relative_import"];
(async () => {
const data = await (await fetch("./data.json")).json();
const benchmarkColumns = benchmarkNames.map(name => [
name,
...data.map(d => {
const benchmark = d.benchmark[name];
return benchmark ? benchmark.mean : 0;
})
]);
const sha1List = data.map(d => d.sha1);
c3.generate({
bindto: "#benchmark-chart",
data: { columns: benchmarkColumns },
axis: {
x: {
type: "category",
categories: sha1List
}
}
});
})();