Unlisted
Edited
Apr 10, 2024
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
geo_data_10pc = FileAttachment("lat long chicago arrests sample@1.csv").csv({
typed: true
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require("d3")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
arrests_by_race_and_year = FileAttachment("arrests by race and year.csv").csv({
typed: true
})
Insert cell
mult_arrests = FileAttachment("arrests per person by race.csv").csv({
typed: true
})
Insert cell
misd_arrests_by_race_and_year = FileAttachment(
"misd arrests by race and year.csv"
).csv({ typed: true })
Insert cell
age_data = FileAttachment("arrests by age@3.csv").csv({ typed: true })
Insert cell
Insert cell
title = selection == "income"
? `Chicago Census Tracts by Median Income \n \n(2022 American Community Survey)`
: `Percent of Residents Who Are ${selection} by Census Tract (2020 Census)`
Insert cell
chart_selection = selection == "income" ? income_map : demographic_map
Insert cell
import { slider } from "@jashkenas/inputs"
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Plot.plot({
projection: { type: "reflect-y", domain: chicago },
color: {
scheme: "blues",
unknown: "#ddd",
type: "linear",
label: `% of tract population that is ${selection}`,
legend: true,
percent: true,
domain: [0, 100]
},

marks: [
Plot.geo(flattened, {
stroke: "black",
type: "linear", // Linear scale for color progression
legend: true,
title: (d) => mapped_data.get(d.id),
fill: (d) => mapped_data.get(d.id),
tip: true
})
]
})
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