Skip to content
This repository was archived by the owner on Dec 21, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@ export async function fetch(url, body) {
}

async function initVisualization(id, type) {
let spec = await fetch(`/spec/${type}/${id}`);
var body = undefined;
if (type === 'table') {
// for table, fetch the first 100 rows by default
body = {'type': 'rows', start: 0, end: 100};
}
var data = await fetch(`/data/${type}/${id}`, body);
let [spec, data] = await Promise.all([
fetch(`/spec/${type}/${id}`),
fetch(`/data/${type}/${id}`, body),
]);

window.setSpec(spec);
window.handleInput(data);
Expand Down