diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2018-10-20 16:56:24 +0900 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-10-20 08:07:20 -0400 |
commit | f44ecdff975b637edb1c5d41d30a6924c8fd87d3 (patch) | |
tree | a623d64caf409ac6ba62653b131fb21d4008556a /website/app.js | |
parent | edb7b609f26b628a15c03455db945c58cde72408 (diff) |
feat: show only 20 benchmark data in inde.html
Diffstat (limited to 'website/app.js')
-rw-r--r-- | website/app.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/website/app.js b/website/app.js index 8a2640b2f..c34cfc868 100644 --- a/website/app.js +++ b/website/app.js @@ -124,12 +124,17 @@ export function formatBytes(a, b) { return parseFloat((a / Math.pow(c, f)).toFixed(d)) + " " + e[f]; } +/** + * @param {string} id The id of dom element + * @param {any[][]} columns The columns data + * @param {string[]} categories The sha1 hashes (which work as x-axis values) + */ function gen2(id, categories, columns, onclick) { c3.generate({ bindto: id, size: { height: 300, - width: 375 + width: window.chartWidth || 375 // TODO: do not use global variable }, data: { columns, @@ -154,16 +159,19 @@ export function formatSeconds(t) { return a < 30 ? `${min} min` : `${min + 1} min`; } -export function main() { - drawChartsFromBenchmarkData(); +/** + * @param dataUrl The url of benchramk data json. + */ +export function drawCharts(dataUrl) { + drawChartsFromBenchmarkData(dataUrl); drawChartsFromTravisData(); } /** * Draws the charts from the benchmark data stored in gh-pages branch. */ -export async function drawChartsFromBenchmarkData() { - const data = await getJson("./data.json"); +export async function drawChartsFromBenchmarkData(dataUrl) { + const data = await getJson(dataUrl); const execTimeColumns = createExecTimeColumns(data); const throughputColumns = createThroughputColumns(data); |