-
Notifications
You must be signed in to change notification settings - Fork 794
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
selection_interval
docs describe unusable "fields"
parameter
#3000
Comments
Thanks for reporting and welcome to the Altair community! You're correct that |
OK, thanks for confirming and for the quick response! |
Thank you! I will take a look today. My first impression is that this |
Great, thank you. My understanding is that it is only usable for point selection but not for intervals as per https://vega.github.io/vega-lite/docs/selection.html#current-limitations so maybe the docstring from point selection was just copied over? |
Ah, thanks @joelostblom, the reason I thought You seem to be right though, so please go ahead with the change you mentioned #3000 (comment) |
Sounds good! @dpoznik Since you reported this initially, are you interested in contributing by removing the lines I linked above in a PR? No worries if not, I can do it too. |
@joelostblom, sure I'd be happy to contribute. Will do! Could I ask a question though? Since I am brand new to this package, I'll take no offense at a response along the lines of ~"read the docs" :) When I saw the I've got a dataframe, Having seen the selection = alt.selection_interval(fields=["id"])
points = (
alt.Chart(df)
.mark_point(...)
.encode(...)
.add_params(selection)
.properties(...)
)
violins = (
alt.Chart(melted_df)
.transform_density(...)
.mark_area(...)
.encode(...)
.properties(...)
.transform_filter(selection)
)
points & violins Thanks! |
P.S. It works to instead melt |
It sounds like you were able to work out your issue, but in case you haven't seen it already this gallery example might be helpful https://altair-viz.github.io/gallery/selection_histogram.html (although is sounds like it might be similar to what you already have figured out with the melting into a |
Cool, thanks. What I realized to be the case was that the interval selection would link the two charts via So I could transform the original dataframe in two ways:
This worked great with box plots, so I think my issue was specific to the violin plots I'd initially attempted. I haven't had a chance to debug that version though. Thanks! |
Just to close the loop on this... I had a chance to explore a bit further, and I figured out why the interval selection was not working with violins. The |
Ah yes that makes sense, thanks for sharing your solution! |
I'm not sure whether this is just a documentation bug or an actual bug, as I've only been using
altair
for one day.I am using version
"5.0.0rc1"
.The
altair.selection_interval
docs include a description of afields
parameter, but attempting to use it:elicits:
#2365 suggests that this is indeed just a documentation bug. Perhaps it arose in #2908?
Thanks!
The text was updated successfully, but these errors were encountered: