observablehq / observablehq/plot
Axis label position: Allow customizing vertical position of axis label for Y axis
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 5.4k
- Forks
- 244
- PR merge metrics
- No merged PRs in 30d
Description
The distance between the axis label and the chart is customizable in one direction. It'd be great to be able to expose a setting for the other direction (or for styling it in general) to allow more flexibility.
.attr("dy", labelAnchor === "center"
? axis === "right"
? "-0.32em"
: "0.75em"
: labelAnchor === "bottom"
? "1.4em"
: "-1em")
The last condition ("-1em") seems too tight for my chart:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the repository for the shown .attr("dy", labelAnchor...) expression and read the surrounding axis-label implementation. Determine how axis-label positioning is currently configured and what API surface is appropriate; done means Y-axis labels support an additional vertical-position or styling setting without breaking existing placement behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- d3, javascript
- Domain
- data-visualization, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100