Public
Edited
Oct 6, 2022
1 star
Insert cell
Insert cell
Insert cell
Insert cell
**Markdown** or
Insert cell
<em>HTML</em> to represent text.
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
x * 10 +3
Insert cell
y = x + 2;
Insert cell
Insert cell
z = square(y);
Insert cell
htmlcreator("world");
Insert cell
Insert cell
Insert cell
Insert cell
viewof value = Inputs.range([0, 100], {label: "Amount", step: 1})
Insert cell
viewof age = Inputs.range([0, 80], {label: "Age", step: 1})
Insert cell
age
Insert cell
The current slider value is **${value}**
Insert cell
viewof selected = Inputs.select(["clear", "cloudy", "rainy", "windy"], {label: "Select the desired weather"})
Insert cell
Insert cell
Insert cell
viewof form = Inputs.form({
potato: Inputs.checkbox(["A", "B", "C"], {label: "Select some"}),
option2: Inputs.range([0, 100], {label: "Amount", step: 1}),
option3: Inputs.radio(["A", "B"], {label: "Select one"}),
option4: Inputs.select(["A", "B"], {label: "Select one"})
})
Insert cell
form.potato
Insert cell
form.option2
Insert cell
form.option3
Insert cell
form.option4
Insert cell
Insert cell
Insert cell
Insert cell
{
const context = DOM.context2d(128, 128);
context.fillStyle = 'rgb(200, 20, 30)';
context.fillRect(10, 10, 50, 50);
context.fillStyle = 'rgba(20, 200, 30, 0.4)';
context.fillRect(50, 30, 120, 60);
return context.canvas;
}
Insert cell
Insert cell
<svg width="128" height="128" fill="none" stroke="black">
<rect x="10" y="10" width="50" height="50" style="fill:rgb(200,20,30);stroke-width:0" />
<rect x="50" y="30" width="120" height="60" style="fill:rgba(20,200,30, 0.4);stroke-width:0" />
</svg>
Insert cell
Insert cell
Insert cell
<svg width="128" height="128" fill="none" stroke="black">
<rect x="10" y="10" width="${width}" height="${height}" style="fill:rgb(200,20,30);stroke-width:0" />
</svg>
Insert cell
Insert cell
Insert cell
json = FileAttachment("testDataJsonExample.json").json()
Insert cell
weather = await FileAttachment("GironaWeatherData.csv").csv();
Insert cell
Insert cell
Insert cell
d3 = require("d3@6")
Insert cell
Insert cell
square=x=>x*x;
Insert cell
htmlcreator = function(word){
return html`<p>Hello <b>${word}</b>!</p>`;
}
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