Add support for custom label font size in the following places:
[x] Bar
[x] StackedBar
[x] Scatter
[x] Axes (Category, Numeric, Time)
cc @nifdee @billytrend
Testing
SVG measures distance to text elements using the text baseline instead of the top-left corner like it does with most other elements. I've taken care to redraw or reset the typesettable measurer's cache where applicable to make subsequent renders draw the text in the right place. When playing with the quicktests, please double check that the label is positioned reasonably as font size changes i.e. it doesn't crowd out other elements, it's hidden when there is no space to draw, etc.
⚠️ The blueprint-bot's quicktest link is broken, so I recommend testing by checking out the repo and running yarn start and navigate to the links below. Gifs show what you should expect to see. I recommend using node 8.10.0 with this repo, just to be consistent with the CI environment.
Add support for custom label font size in the following places:
cc @nifdee @billytrend
Testing
SVG measures distance to text elements using the text baseline instead of the top-left corner like it does with most other elements. I've taken care to redraw or reset the
typesettable
measurer's cache where applicable to make subsequent renders draw the text in the right place. When playing with the quicktests, please double check that the label is positioned reasonably as font size changes i.e. it doesn't crowd out other elements, it's hidden when there is no space to draw, etc.⚠️ The blueprint-bot's quicktest link is broken, so I recommend testing by checking out the repo and running
yarn start
and navigate to the links below. Gifs show what you should expect to see. I recommend using node8.10.0
with this repo, just to be consistent with the CI environment.Bar
http://localhost:9999/quicktests/dev/index.html#functional/bar_plot_label_font_size![2021-10-11 21 48 16](https://user-images.githubusercontent.com/3681045/136877244-e2e42039-6689-4025-81c1-8bf477757787.gif)
Scatter
http://localhost:9999/quicktests/dev/index.html#functional/scatter_plot_label_font_size Something weird is happening w/ the scatter plot labels. Unclear why the size "stutters" when increasing font size. Note that internally, we do not use scatter plot labels.![2021-10-11 21 27 59](https://user-images.githubusercontent.com/3681045/136876003-8a6342c3-6c04-4fba-b3c1-1a45355bc9e8.gif)
Category axis
http://localhost:9999/quicktests/dev/index.html#functional/category_axis_label_font_size![2021-10-11 21 27 52](https://user-images.githubusercontent.com/3681045/136876004-f3c4b4ba-eb55-4a50-bbab-5ea9fc369862.gif)
Numeric axis
http://localhost:9999/quicktests/dev/index.html#functional/numeric_axis_label_font_size![2021-10-11 21 27 36](https://user-images.githubusercontent.com/3681045/136876005-31c0a763-1137-4939-a378-7b7774bbee94.gif)
Time axis
http://localhost:9999/quicktests/dev/index.html#functional/time_axis_label_font_size![2021-10-11 21 27 23](https://user-images.githubusercontent.com/3681045/136876008-23012ea9-c065-4493-81dc-60899660edcf.gif)