Plot.plot({
padding: 0,
color: {
pivot: d3.mean(seattle, d => d.temp_max),
legend: true,
scheme: "BuRd"
},
y: {tickFormat: Plot.formatMonth("en", "short")},
marks: [
Plot.cell(seattle, Plot.group({fill: "max"}, {
x: (d) => d.date.getUTCDate(),
y: (d) => d.date.getUTCMonth(),
fill: "temp_max",
inset: 0.5
}))
]
})
Plot.plot({
y: {grid: true},
color: {interpolate: "lab", range: ["#4269d0", "#efb118"]},
marginTop: 10,
marks: [
Plot.ruleY([0], {strokeOpacity: 0.3}),
Plot.dot(gistemp, {x: "Date", y: "Anomaly", r: 3, strokeWidth: 1.5, stroke: "Anomaly"}),
Plot.lineY(gistemp, Plot.windowY(12, {x: "Date", y: "Anomaly"})),
],
})
SankeyChart({
links: energy
}, {
nodeGroup: d => d.id.split(/\W/)[0],
nodeAlign,
linkColor,
format: (f => d => `${f(d)} TWh`)(d3.format(",.1~f")),
width,
height: 600
})
Plot.plot({
x: {
grid: true,
label: "Population (%) →",
percent: true
},
y: {
domain: stateage.ages,
reverse: true,
label: "↑ Age (years)",
labelAnchor: "top"
},
marks: [
Plot.ruleX([0]),
Plot.tickX(stateage, Plot.normalizeX("sum", {z: "state", x: "population", y: "age", stroke: "lightblue"})),
Plot.dotX(filteredAges, Plot.normalizeX("sum", {x: "population", y: "age", stroke: "darkblue", fill: "darkblue"})),
Plot.line(filteredAges, Plot.normalizeX("sum", { x: "population", y: "age", stroke: "darkblue" }))
],
})
SELECT c.longitude as longitude
, c.latitude as latitude
, c.id as customerId
, o.storeId as storeId
, COUNT(*) orders
FROM orders as o
JOIN customers as c
ON o.customerId = c.id
GROUP BY 1, 2, 3, 4
Plot.plot({
grid: true,
color: {legend: false, range: ["#4269d0", "#efb118", "#ff725c"]},
marks: [
Plot.dot(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", fill: "species"}),
Plot.linearRegressionY(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm", stroke: "species"}),
Plot.linearRegressionY(penguins, {x: "culmen_length_mm", y: "culmen_depth_mm"})
]
})
Plot.plot({
padding: 0,
color: {
pivot: d3.mean(seattle, d => d.temp_max),
legend: true,
scheme: "BuRd"
},
y: {tickFormat: Plot.formatMonth("en", "short")},
marks: [
Plot.cell(seattle, Plot.group({fill: "max"}, {
x: (d) => d.date.getUTCDate(),
y: (d) => d.date.getUTCMonth(),
fill: "temp_max",
inset: 0.5
}))
]
})
Plot.plot({
y: {grid: true},
color: {interpolate: "lab", range: ["#4269d0", "#efb118"]},
marginTop: 10,
marks: [
Plot.ruleY([0], {strokeOpacity: 0.3}),
Plot.dot(gistemp, {x: "Date", y: "Anomaly", r: 3, strokeWidth: 1.5, stroke: "Anomaly"}),
Plot.lineY(gistemp, Plot.windowY(12, {x: "Date", y: "Anomaly"})),
],
})
SankeyChart({
links: energy
}, {
nodeGroup: d => d.id.split(/\W/)[0],
nodeAlign,
linkColor,
format: (f => d => `${f(d)} TWh`)(d3.format(",.1~f")),
width,
height: 600
})
Plot.plot({
x: {
grid: true,
label: "Population (%) →",
percent: true
},
y: {
domain: stateage.ages,
reverse: true,
label: "↑ Age (years)",
labelAnchor: "top"
},
marks: [
Plot.ruleX([0]),
Plot.tickX(stateage, Plot.normalizeX("sum", {z: "state", x: "population", y: "age", stroke: "lightblue"})),
Plot.dotX(filteredAges, Plot.normalizeX("sum", {x: "population", y: "age", stroke: "darkblue", fill: "darkblue"})),
Plot.line(filteredAges, Plot.normalizeX("sum", { x: "population", y: "age", stroke: "darkblue" }))
],
})
Observable Notebooks run in your browser, so you can immediately start building instead of setting up a local dev environment. Our notebooks were designed from the ground up to encourage collaboration and code reuse.
Weave together Markdown, JavaScript, HTML, and SQL for expressive dynamic documents, charts, and apps.
Connect to any data source with ease — whether it’s a file, a database, or an API.
Cells re-run automatically as you make changes and interact with inputs, making code easier to understand.
Observable Notebooks are ideal for prototyping, allowing us to rapidly iterate on data visualizations and explore insights without needing advanced front-end skills.
Co-founder and Infrastructure Engineer, IOP Systems
Free
$22/mo/editor
Get started today