Public
Edited
Aug 6, 2024
5 forks
5 stars
Insert cell
Insert cell
Plot.plot({
axis: null,
label: null,
height: 260,
marginTop: 20,
marginBottom: 70,
title: "Subdued",
subtitle: "Of 120 surveyed Syrian teenagers:",
marks: [
Plot.axisFx({lineWidth: 10, anchor: "bottom", dy: 20}),
Plot.waffleY({length: 1}, {y: 120, fillOpacity: 0.4, rx: "100%"}),
Plot.waffleY(survey, {fx: "question", y: "yes", rx: "100%", fill: "orange"}),
Plot.text(survey, {fx: "question", text: (d) => (d.yes / 120).toLocaleString("en-US", {style: "percent"}), frameAnchor: "bottom", lineAnchor: "top", dy: 6, fill: "orange", fontSize: 24, fontWeight: "bold"})
]
})
Insert cell
survey = [
{question: "don’t go out after dark", yes: 96},
{question: "do no activities other than school", yes: 89},
{question: "engage in political discussion and social movements, including online", yes: 10},
{question: "would like to do activities but are prevented by safety concerns", yes: 73}
]
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