Published
Edited
Aug 23, 2020
2 forks
21 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
user = fetch(`${endpoint}/user/@${whoami}`).then(d => d.json())
Insert cell
Insert cell
// documents = fetch(`${endpoint}/documents/@${whoami}`).then(d => d.json())
documents = {
const documents = [];
var last = "4096-01-01T00:45:25.493Z"; // infinite future
var seen = false;
do {
seen = (await fetch(
`${endpoint}/documents/@${whoami}?before=${last}`
).then(d => d.json())).map(d => {
(d.url = `/@${whoami}/${d.slug}`), documents.push(d);
last = d.update_time;
}).length;
yield documents.slice(0, MAXDOCS);
} while (seen && documents.length < MAXDOCS);
}
Insert cell
Insert cell
Insert cell
notebook = fetch(`${endpoint}/document/${documents[0].id}`).then(d => d.json())
Insert cell
Insert cell
html`${
notebook.nodes
.map((d,i) => `<pre style="font-size:7px; color:${color(i)}">${d.value.replace(/</g, "&lt;")}</pre>`)
.join("<hr style='margin:0;padding:0'>")
}`
Insert cell
Insert cell
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