-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
2951 contrasting pie and bar inside text #3130
Conversation
- Bar text labels specified as `textposition: outside` being pushed `inside` (to avoid collisions with bars stacked on top) were not styled as inside labels.
- Parallel work being pie titles and 3d tick adjustments.
- Note: even before the introduction of defaulting to contrasting colors for inside text labels, font inheritance wasn't working throughout selection.
- Test ensures a bar's color opacity is taken into account when calculating a contrasting inside text color.
- Reason: both reading and writing assert statements was more cumbersome before because the conversion of colors into their rgb form had to be done in client code that called the font color assert functions.
Very nice improvements for the legibility of the figures! 🎉 |
Thanks Antoine! 🙇♂️ |
in bar_attrs_relative why does text inside the orange bars end up white? Elsewhere (like hover labels, and pie labels elsewhere in this PR) that orange color keeps black text as a contrast. BTW very nice that the text that got pushed out of the small red bar turned to black even though the text inside the red bars is white 🎉 |
- Standard pie colors means no marker colors set explicitly.
- Reason: calculation of inside text color when bar has no explicit marker color set has been fixed in a previous commit.
The problem was I had no test to verify that contrasting text colors are correct if no explicit marker colors are set. I mistakenly assumed |
@rmoestl looks fantastic! @etpinard I have one question about how this will play with RCE (cc @nicolaskruchten @VeraZab) - which currently doesn't seem to support |
OK great - then lets keep this as is -> 💃 I still have concerns about how stuff like this will interact with templates but those should be addressed in a broader context. |
Improves a few things around text font styling for pie and bar. Specified and discussed in #2951.
Rough overview:
arrayOk
) font properties in pie.textposition: 'outside'
labels pushedinside
by a bar being stacked on top of it are rendered with inside text font properties now (bugfix).