Published unlisted
Edited
Apr 6, 2022
1 fork
Insert cell
Insert cell
d3Axis = FileAttachment("d3-axis.js").url().then(require) // built from the dev branch
Insert cell
{
const svg = d3.create("svg").attr("height", 30);
svg.append("g").call(
d3Axis.axisBottom(d3.scaleLinear([0, 10], [20, 270])).tickSize(() => 10) // 🌶
);
return svg.node();
}
Insert cell
{
const svg = d3.create("svg").attr("height", 60);
svg.append("g").call(
d3Axis
.axisBottom(d3.scaleLinear([0, 10], [20, 270]))
.tickSize((d, i) => 5 * i)
.tickPadding((d, i) => 5 * i + 4) // not working either 🌶
);
return svg.node();
}
Insert cell
{
const svg = d3.create("svg").attr("height", 30);
svg
.append("g")
.call(d3Axis.axisBottom(d3.scaleLinear([0, 10], [20, 270])).tickSize(10));
return svg.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