Published
Edited
Feb 13, 2020
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
4 + 10 - 300
Insert cell
Insert cell
myFirstConstant + definedBelow
Insert cell
Insert cell
Insert cell
MethodResult =
{
// const definedBelow = 12 // if we uncomment this it will take local variable
// this is a method and has single return
const result = myFirstConstant + definedBelow
let counter = 1
for (let i = 0; i < result; i++) {
counter += i * 2
}
return counter
}
Insert cell
Insert cell
element = html`<button onclick="clickFunction()">my button</button>`
Insert cell
element.onclick = function(){clickFunction()};
Insert cell
mutable click = false // try taking out "mutable" prefix
Insert cell
function clickFunction () {
mutable click = !click
return click
}
Insert cell
Insert cell
Insert cell
Insert cell
status = new Promise(resolve => {
setTimeout(() => {
resolve({resolved: new Date});
}, 2000);
})
Insert cell
raw = (await fetch("https://raw.githubusercontent.com/ahoak/data-vis-sandbox/master/raw.json")).json()
Insert cell
Insert cell
image = FileAttachment("animals-surprised-cute-kitty-cat@1.jpg").image()
Insert cell
text = FileAttachment("sample@1.csv").text()
Insert cell
d3.csvParse(text, d3.autoType)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
moment = require('moment@2.24.0/moment.js')
Insert cell
moment().format('MMMM Do YYYY, h:mm:ss a');
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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