Skip to content

font-variant on the axes - #606

Merged
mbostock merged 5 commits into
mainfrom
fil/tabular-nums-axes
Dec 10, 2021
Merged

mbostock merged 5 commits into
mainfrom
fil/tabular-nums-axes

Conversation

@Fil

@Fil Fil commented Dec 10, 2021

Copy link
Copy Markdown
Contributor

remove font-variant from the global styles; introduce the axis fontVariant option, which defaults to tabular-nums

closes #601

…riant option, which defaults to tabular-nums

closes #601
@Fil
Fil requested a review from mbostock December 10, 2021 16:02
@Fil

Fil commented Dec 10, 2021

Copy link
Copy Markdown
Contributor Author

A comment: for Plot.text, I think it would be too magical to do auto-detection, and it's easy enough to use the fontVariant option. This PR removes font-variant from the static styles, and introduces a new axis option called fontVariant, which defaults to tabular-nums. (Just moving the static style to the axis wouldn't allow to undo the feature… and this approach seemed more consistent with our general patterns.)

@mbostock mbostock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! But I think we should only default to tabular-nums for quantitative (and probably also temporal?) scales. For categorical/ordinal scales, we should default to normal.

Comment thread src/axis.js Outdated
Comment thread src/axis.js Outdated
Fil and others added 3 commits December 10, 2021 17:16
Co-authored-by: Mike Bostock <mbostock@gmail.com>
Co-authored-by: Mike Bostock <mbostock@gmail.com>
@Fil
Fil requested a review from mbostock December 10, 2021 16:44
Comment thread src/axes.js Outdated
@mbostock
mbostock merged commit d518c87 into main Dec 10, 2021
@mbostock
mbostock deleted the fil/tabular-nums-axes branch December 10, 2021 16:58
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.

Only apply font-variant: tabular-nums to axis ticks

2 participants