Published
Edited
Oct 19, 2018
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
x = d3.scaleLinear()
.domain(d3.extent(data, d => d.ticks))
.range([margin.left, width - margin.right])
Insert cell
y = d3.scalePoint()
.domain(series.map(d => d.key))
.range([margin.top, height - margin.bottom-40])
Insert cell
z = d3.scaleLinear()
// .domain([0, 120000]).nice()
.domain([0, d3.max(data, d => d.ground_truth.wealth)]).nice()
.range([0, -overlap * y.step()])
Insert cell
Insert cell
Insert cell
area = d3.area()
.curve(d3.curveBasis)
.defined(d => !isNaN(d.ground_truth.wealth))
.x(d => x(d.ticks))
.y0(0)
.y1(d => z(d.ground_truth.wealth))
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require("d3@5")
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