Published
Edited
Jan 27, 2020
Importers
1 star
Insert cell
Insert cell
Insert cell
jobs = {
let data = await graphql(
RECENT_JOBS,
{limit: 10, experiment: "long_runs"}
);
return data.jobs;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
async function dataframe({
limit = 100,
project = undefined,
measurement = undefined,
tags = undefined,
experiment = undefined,
user = "vogels"
}) {
let data = await graphql(
`query jobs($limit: Int = 5, $user: String, $project: String, $experiment: String, $measurement: String, $tags: String) {
jobs(limit: $limit, user: $user, project: $project, experiment: $experiment) {
id
experiment
job
config {
key
value
}
timeseries(measurement: $measurement, tags: $tags) {
measurement
tags
values
}
}
}`,
{ limit, project, experiment, user, measurement, tags }
);
const dataset = [];
for (let job of data.jobs) {
const { timeseries, config } = job;
const configMap = Object.fromEntries(config.map(c => [c.key, c.value]));
for (let timeserie of timeseries) {
const timeseriesId = Math.round(Math.random() * 1e16);
const { values, tags, ...otherProps } = timeserie;
for (let value of values) {
dataset.push({
...value,
...tags,
...otherProps,
config: configMap,
job,
curve: timeseriesId
});
}
}
}
return dataset;
}
Insert cell
Insert cell
Insert cell
graphql = graphQLConnect("https://graphql-sjvtnngdaq-ew.a.run.app/graphql")
Insert cell
import {table} from "@tvogels/utilities"
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more