-
Notifications
You must be signed in to change notification settings - Fork 796
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
conditional formatting mark_text based on variable? #1976
Comments
No, unfortunately the only thing that can depend on conditions are encodings, not mark properties. I know the Vega-Lite team has been thinking about ways to relax this restriction, so you might inquire there. |
Ok, thanks Jake. I'll bring it up with them. They have an example of conditionally altering text in the first example on https://vega.github.io/vega-lite/docs/text.html and am hoping that's the path to my solution. Have a look and please let me know if that can currently be reproduced with Altair. If not, perhaps I can fork and try to help add the capability. |
Yes, you can conditionally encode the color, because the color is an encoding channel. You cannot conditionally encode offset, because offset is not (yet) an encoding channel. |
The relevant issue to add your +1 is here: vega/vega-lite#4703 |
Thanks again, Jake! I saw your recommendation and cross-post to the vega issue board. |
I've read the docs on conditions based on interactions but I didn't find a way to format chart text based on conditions. Here's a particularly egregious example where I would like
mark_text(align="left", dx=20)
forseller_status
up to 50%, over 50%mark_text(align="right", dx=-20)
. I'd appreciate any ideas you have.The text was updated successfully, but these errors were encountered: