Skip to content
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

Adapting Vega-Lite example "Bar Chart with Highlighting on Hover and Selection on Click" #3301

Closed
ChristopherDavisUCI opened this issue Dec 24, 2023 · 5 comments · Fixed by #3485

Comments

@ChristopherDavisUCI
Copy link
Contributor

This is a follow-up to #3295

@mattijn Thanks for linking this Vega-Lite example which I didn't know existed.

In that example, condition seems to take an array, but I don't see any mention of that as an option in the condition documentation, nor does our code seem to allow using lists for a condition, as far as I can tell:
https://github.com/altair-viz/altair/blob/d38409f8f50282d09507f90e490e65c0f0247b25/altair/vegalite/v5/api.py#L787-L796

Does that seem accurate to you? How would you suggest we approach that?

Needless to say, I'm happy for comments from anyone!

@mattijn
Copy link
Contributor

mattijn commented Dec 24, 2023

Hi @ChristopherDavisUCI! This was discussed in this issue: #2759.

It would be nice if we can extend and improve Altair by allowing for multiple predicates as part of a condition.

@ChristopherDavisUCI
Copy link
Contributor Author

Thanks @mattijn! Do you know anywhere that this array functionality is described on the Vega-Lite side?

@mattijn
Copy link
Contributor

mattijn commented Dec 24, 2023

Is this page of help: https://vega.github.io/vega-lite/docs/condition.html?

@ChristopherDavisUCI
Copy link
Contributor Author

Not that I know of? I've tried searching that page for the word "array", and have skimmed through the examples and haven't seen anything that looks similar to the list/array usage in the Bar Chart example, but I could definitely believe that it's there and I'm missing it...

@mattijn
Copy link
Contributor

mattijn commented Dec 24, 2023

You are right, it's not really clear from there.
Maybe a bit from the Vega docs at this page: https://vega.github.io/vega/docs/marks/#encode. Scroll down to the section on Production Rules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants