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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more