Published
Edited
Jun 3, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
height = 600
Insert cell
margin = ({ top: 20, right: 70, bottom: 30, left: 60 })
Insert cell
Insert cell
y = d3
.scaleLinear()
.domain([-15, d3.max(data.series, d => d3.max(d.values))])
.nice()
.range([height - margin.bottom, margin.top])
Insert cell
xAxis = g =>
g.attr("transform", `translate(0,${height - margin.bottom})`).call(
d3
.axisBottom(x)
.ticks(width / 80)
.tickSizeOuter(0)
.tickFormat(d3.timeFormat("%b"))
)
Insert cell
Insert cell
Insert cell
d3 = require("d3@5", "d3-array@2")
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