Published
Edited
Jul 24, 2020
1 fork
Importers
Insert cell
md`# D3 Scatter Plot`
Insert cell
Insert cell
Insert cell
Insert cell
cars = d3.json(cars_url, d3.autoType)
Insert cell
xScale = d3.scaleLinear(
d3.extent( cars, d => d.Miles_per_Gallon ),
[ margin.left, width - margin.right ]
)
Insert cell
yScale = d3.scaleLinear(
d3.extent( cars, d => d.Horsepower ),
[ height - margin.bottom, margin.top ]
)
Insert cell
Insert cell
Insert cell
yAxis = d3.axisLeft(yScale)
Insert cell
Insert cell
Insert cell
cars_url = datasets['cars.json'].url
Insert cell
datasets = require('vega-datasets@1')
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