-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ (title) try to fit chart title into a single line (#3173)
> [!IMPORTANT] > Wait for #3211 to be merged. ### Current state - When exporting to static charts, we adjust the font size to fit the chart title into a single line if possible - The font size is decreased by not more than 20% using 0.5px steps - But we don't currently do this on the web ### Changes - We re-introduce this technique for charts rendered in an interactive environment (we had removed this for interactive charts in the redesign) - I think reducing the font size by 20% is quite a lot, so I opted for 15% instead (the old grapher also used 85% of the original font size as a threshold) - With 85%, the font size gets at most reduced to... - for narrow charts: 18px * 0.85 = 15.3px (subtitle font size = 12px) - for medium charts: 20px * 0.85 = 17px (subtitle font size = 13px) - for larger charts: 24px * 0.85 = 20.4px (subtitle font size = 14px) The SVG tester complains because we used to decrease by no more than 20% but now use 15%. Some charts look "worse" because of that, but these thresholds are arbitrary, and we have to draw the line somewhere...
- Loading branch information
1 parent
9c4daeb
commit 6979a0b
Showing
1 changed file
with
43 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters