Published
Edited
Apr 23, 2022
1 star
Insert cell
Insert cell
display = ["First", "2", "III", "Custom4", "5", "SIX"]
Insert cell
axis(d3.scaleLinear())
.ticks(5)
.tickFormat((d,i) => display[i])
.render()
Insert cell
function axis(scale) {
return Object.assign(
d3.axisBottom(scale.range([20, width - 20])
), {
render() {
return d3.create("svg")
.attr("viewBox", [0, -10, width, 33])
.call(this)
.node();
}
});
}
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