Unlisted
Edited
Mar 28, 2018
3 stars
Insert cell
Insert cell
Insert cell
md`Here’s a link to a notebook: [Metaballs!](/@mbostock/metaballs)`
Insert cell
md`And here’s a link to a cell: [File](#file)`
Insert cell
Insert cell
new Uint8Array(1e6) // 1MB
Insert cell
Insert cell
[0, 1, 2,,,,, 7]
Insert cell
Insert cell
{
let m = new Map([["foo", 1], ["bar", 2]]);
m.property = "Surprise!";
return m;
}
Insert cell
Insert cell
window.location.host
Insert cell
Insert cell
viewof position = {
const form = html`<form><button name=button>Where am I?`;
form.button.onclick = event => {
event.preventDefault();
navigator.geolocation.getCurrentPosition(
position => {
form.value = position;
form.dispatchEvent(new CustomEvent("input"));
},
error => {
form.value = Promise.reject(error);
form.dispatchEvent(new CustomEvent("input"));
},
{
timeout: 5000,
maximumAge: Infinity
}
);
};
return form;
}
Insert cell
[position.coords.longitude, position.coords.latitude]
Insert cell
Insert cell
Insert cell
{
const src = URL.createObjectURL(image);
invalidation.then(() => URL.revokeObjectURL(src));
return html`<img src="${src}">`;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof file = html`<input type="file" accept=".js">`
Insert cell
require(URL.createObjectURL(file))
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