Published
Edited
Nov 19, 2018
Insert cell
Insert cell
scale = d3.scaleLinear()
Insert cell
scale.domain([1,10]).range([10,1])
Insert cell
Insert cell
scale(10)
Insert cell
Insert cell
scale(1)
Insert cell
Insert cell
time = d3.scaleTime()
Insert cell
time.domain([new Date(2000, 0, 1, 0), new Date(2000, 0, 1, 2)])
Insert cell
Insert cell
time.ticks(d3.timeMinute.every(15))
Insert cell
Insert cell
Insert cell
ord = d3.scaleOrdinal().range([1,10]).domain()
Insert cell
Insert cell
Insert cell
d3.schemeCategory10
Insert cell
Insert cell
colors = d3.scaleOrdinal(d3.schemeCategory10)
Insert cell
Insert cell
colors(0)
Insert cell
Insert cell
data = [{x: 10},{x: 15}]
Insert cell
linear_colors = d3.scaleLinear()
.domain(d3.extent(data, (d) => d.x))
.range(d3.schemeGnBu[3])
Insert cell
Insert cell
linear_colors(data[1].x)
Insert cell
Insert cell
d3.extent(data, (d) => d.x)
Insert cell
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