Published
Edited
Feb 8, 2021
Insert cell
md`# scales`
Insert cell
viewof selectedValue = slider({
min: 0,
max: 100
})
Insert cell
html`<span style="background-color: ${myScale(
selectedValue
)}; font-size: ${sizeScale(selectedValue)}px;">text</span>`
Insert cell
sizeScale = d3
.scaleLinear()
.domain([0, 100])
.range([12, 25])
Insert cell
myScale = d3
.scaleLinear()
.domain([0, 100])
.range(["steelblue", "papayawhip"])
Insert cell
import { slider } from "@jashkenas/inputs"
Insert cell
d3 = require("d3")
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