mirror of
https://github.com/denoland/deno.git
synced 2025-01-23 07:29:51 -05:00
27 lines
555 B
JavaScript
27 lines
555 B
JavaScript
|
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
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
})();
|