Skip to content

add a {line: true} option to axes #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 12, 2021
Merged

add a {line: true} option to axes #406

merged 3 commits into from
Aug 12, 2021

Conversation

Fil
Copy link
Contributor

@Fil Fil commented May 17, 2021

handy for materializing the vertical axis of a bar chart with an ordinal x
note that in the case of a continuous X, tickX([extent min]) is often preferable, since it creates the support line for all x/y facets

see https://observablehq.com/@fil/axis-support-406

suggested by @EE2dev

@Fil Fil requested a review from mbostock May 17, 2021 13:43
@Fil Fil added the enhancement New feature or request label May 17, 2021
@enjalot
Copy link

enjalot commented May 17, 2021

this makes me want to have a { frame: true } option that adds a frame (to the bottom of the marks?). For most facet use cases a default frame is probably desired and good enough.
this wouldn't replace using the frame mark to create a customized frame, just make it easier to have one when exploring.

@mbostock
Copy link
Member

This seems like a good option to have, but I’m struggling with the name “support”—that doesn’t resonate with me. D3 calls this the “domain path”. Maybe axisLine would be okay? Should we allow you to style this line separately from the grid? It does seem related to the “frame” concept, too, so maybe frame would be okay as an option.

@Fil
Copy link
Contributor Author

Fil commented May 18, 2021

Is "support" a frenchism? Maybe a better translation for what I had in mind is “bearing” or “beam”.

Anyway, in this PR the axis line would be added (or "not removed" :)) on the materialized axes, not on all facets.

By contrast, Plot.ruleX([0]) and Plot.frame are present on all facets (more precisely "active" facets #332).

@mbostock mbostock added question Further information is needed and removed enhancement New feature or request labels Aug 11, 2021
@mbostock
Copy link
Member

Needs a better name than “support” but otherwise I’m onboard with the option.

@Fil
Copy link
Contributor Author

Fil commented Aug 12, 2021

axisLine is fine, I think?

Fil added 2 commits August 12, 2021 10:15
handy for materializing the vertical axis of a bar chart with an ordinal x
note that in the case of a continuous *X*, tickX([*extent min*]) is often preferable, since it creates the support line for all x/y facets
@Fil Fil force-pushed the fil/axis-support branch from 12691c0 to 88ed920 Compare August 12, 2021 08:23
@Fil Fil changed the title add a {support: true} option to axes add a {axisLine: true} option to axes Aug 12, 2021
@mbostock
Copy link
Member

What about simply the name “line”? That seems to match the name “grid” pretty well, and I can’t think of any obvious ambiguity with the shorter name.

@Fil Fil changed the title add a {axisLine: true} option to axes add a {line: true} option to axes Aug 12, 2021
@Fil Fil merged commit fe06c22 into main Aug 12, 2021
@Fil Fil deleted the fil/axis-support branch August 12, 2021 20:24
@Fil
Copy link
Contributor Author

Fil commented Aug 20, 2021

axis-line

(example for the CHANGELOG)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants