-
Notifications
You must be signed in to change notification settings - Fork 793
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
docs: Add example for *Bar Chart with Highlighting on Hover and Selection on Click* #3485
docs: Add example for *Bar Chart with Highlighting on Hover and Selection on Click* #3485
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! If you have more insight where to place empty=False
, that would be great. I thought we could control everything within the alt.selection_point()
, but that seems not to be the case.
I added two suggestions that shows on a single line the when().then()
's
tests/examples_arguments_syntax/interactive_bar_select_highlight.py
Outdated
Show resolved
Hide resolved
tests/examples_methods_syntax/interactive_bar_select_highlight.py
Outdated
Show resolved
Hide resolved
Thanks for the review @mattijn
I've no strong feelings on the formatting (happy to change), but two points I wanted to mention:
>>> ruff format ./tests/*/interactive_bar_select_highlight.py I did notice
I would say generally though I'd be in favor of running all the examples through
|
From a programming perspective I can understand that you just want to |
@mattijn all good with me, I'll accept the suggestions and we can get this merged |
Co-authored-by: Mattijn van Hoek <mattijn@gmail.com>
#3487 will fix the unrelated |
Thanks! Tests pass now🥳 |
This was already being handled internally, but now aligns with `when` and provides a documentable parameter. Related: vega#3485 (comment)
Fixes #3301
Utilises
alt.when
, introduced in #3427@mattijn I thought adding this first would be something to refer to in the follow-up PR discussed in #3427 (comment)
Also revisiting since #2759 (comment) I have a better explanation for the
empty=False
placement.For
select
, theParameter
is used twice - once withempty=False
and another with the default.Whereas
highlight
is used only once.I think this could be helpful to add to the
alt.condition(empty)
and each.when(empty)
doc, as this is a good justification for why you can passempty
there.https://github.com/dangotbanned/altair/blob/ef81573b9c709989d3965f778a5b0c5d77f6d4c3/tests/examples_methods_syntax/interactive_bar_select_highlight.py#L26-L45