Public
Edited
Nov 4, 2022
1 star
Insert cell
Insert cell
Insert cell
substract_health_data@1.csv
Type Table, then Shift-Enter. Ctrl-space for more options.

Insert cell
filteredData = data
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof select_box_plot = Inputs.select(diseases, { label: "Select one" })
Insert cell
// box plot (box.X) x: incidence y: state
// how would you do boxplots of just one state per year
Plot.plot({
width: width,
height: 500,
facet: {
data: filtered_data,
y: "disease",
marginLeft: 100
},
fy: { axis: "left", label: "Disease" },
marks: [
Plot.boxY(filtered_data, { x: "year", y: "incidence", stroke: "disease" })
]
})
Insert cell
filtered_data = data.filter((d) => d.state === select_state_scatter)
Insert cell
Insert cell
Insert cell
// colorScale = ({
// domain: [highlight_state_scatter, "Other state"],
// range: ["#1f77b4", "#7f7f7f"],
// unknown: "#e2e2e2",
// legend: true
// })
Insert cell
Insert cell
Insert cell
viewof file = Inputs.file({label: "Data"})
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