Published
Edited
Feb 15, 2021
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
data_filtered = data.filter(d => (d.year == "1983" || d.year == "2016") )
Insert cell
md`Group data based on filtered data set`
Insert cell
group_data = Array.from(d3.group(data_filtered, d => d.race))
Insert cell
Insert cell
Insert cell
swatches
Insert cell
entity
Insert cell
margin
Insert cell
height
Insert cell
y
Insert cell
x = d3.scaleBand()
.domain(year_extent)
.range([margin.left, width - margin.right])

.paddingOuter(.5)
Insert cell
xAxis = d3.axisBottom(x)
.tickPadding(5)
Insert cell
line = d3.line()
.x(d => x(d.year) + 120)
.y(d => y(d.wealth))
.curve(d3.curveCardinal.tension(.001))
Insert cell
d3 = require("d3@6")
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