Published
Edited
Dec 21, 2020
2 stars
Insert cell
md`# Declarative webgl scale using d3-scale`
Insert cell
Insert cell
Insert cell
Insert cell
zoomScale = {
const domain = exp.map(v => v[0])
const range = exp.map(v => v[1])

return d3.scaleLinear()
.domain(domain)
.range(range)
.clamp(true)
}
Insert cell
exp = [[10, 20], [20, 30], [30, 30], [39.9, 30], [40, 50]]
Insert cell
Insert cell
Insert cell
Insert cell
d3 = require('d3-scale')
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