Skip to content
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

pass fontVariant to the axis label #1827

Merged
merged 2 commits into from
Aug 24, 2023
Merged

pass fontVariant to the axis label #1827

merged 2 commits into from
Aug 24, 2023

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Aug 23, 2023

closes #1821

@Fil Fil requested a review from mbostock August 23, 2023 15:04
@mbostock
Copy link
Member

This omission was somewhat intentional: the most common use of fontVariant is for tabular-nums with numeric or temporal ticks so that the numerals align across ticks. That need does not apply to the axis label, since there is only one label per axis and hence no need for the numerals to have the same width — and indeed we prefer not to have tabular-nums because numerals look better with the default variable width.

Though, I guess it might be confusing if some of the font-related options apply to both the ticks and the label, but some don’t. We could have separate options (tickFontVariant, labelFontVariant, and tickFontSize, labelFontSize, etc.). Though maybe it’d be better to just have separate marks… though there we already have a tick mark that is something else too? 😭

@mbostock mbostock force-pushed the fil/label-font-variant branch from 6394b1e to 562fbf5 Compare August 24, 2023 16:38
Copy link
Member

@mbostock mbostock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could always introduce more fine-grained options in the future if we need it.

@mbostock mbostock force-pushed the fil/label-font-variant branch from 562fbf5 to 6b62d55 Compare August 24, 2023 16:43
@mbostock mbostock enabled auto-merge (squash) August 24, 2023 16:43
@mbostock mbostock merged commit 5a2fcf2 into main Aug 24, 2023
chaichontat pushed a commit to chaichontat/plot that referenced this pull request Jan 14, 2024
* pass fontVariant to the axis label

closes observablehq#1821

* Update test/plots/axis-labels.ts

---------

Co-authored-by: Mike Bostock <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fontVariant should be applied to axis labels
2 participants