Published
Edited
Oct 24, 2019
Insert cell
Insert cell
Insert cell
year
Insert cell
Insert cell
xdomain = d3.range(8)
.map(d => Math.pow(2,d) * 1000)
Insert cell
colors = d3.scaleOrdinal()
.domain(["america","europe","asia","africa"])
.range([d3.hcl(0,50,75), d3.hcl(90,50,75), d3.hcl(180,50,75), d3.hcl(270,50,75)])
Insert cell
height = 300
Insert cell
margin = ({top: 25, bottom: 25, left: 25, right: 25})
Insert cell
popdomain = d3.extent(data, d => d.population)
Insert cell
radius = d3.scaleSqrt()
.domain(popdomain)
.range([1,25])
Insert cell
x = d3.scaleLog()
.domain([1000,128000])
.range([margin.left,width-margin.right])
.clamp(true)
Insert cell
y = d3.scaleLinear()
.domain([0,100])
.range([height-margin.top,margin.bottom])
Insert cell
data2018 = data.filter(d => d.year==2018)
Insert cell
Insert cell
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