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

selection_interval does not work with fields #2365

Closed
krlng opened this issue Dec 7, 2020 · 2 comments
Closed

selection_interval does not work with fields #2365

krlng opened this issue Dec 7, 2020 · 2 comments

Comments

@krlng
Copy link

krlng commented Dec 7, 2020

The selection_interval seems to work neither with fields nor with encodings which are not numeric. Is this a bug or is there simply no support?

Example code:

import altair as alt
from vega_datasets import data as vdata

cars = vdata.cars.url

brush = alt.selection_interval(fields=['Name'])

alt.Chart(cars).mark_point().encode(
    x='Miles_per_Gallon:Q',
    y='Horsepower:Q',
    color='Origin:N',
    tooltip=["Name:N"]
).add_selection(
    brush
)

error message: Expression parse error: ? selector072_scale_trigger : {}

The same happens if I use brush = alt.selection_interval(encodings=['color'])

@jakevdp
Copy link
Collaborator

jakevdp commented Dec 7, 2020

This is expected: in Vega-Lite, interval selections only work with x and y encodings, and not with fields.

@krlng
Copy link
Author

krlng commented Dec 30, 2020

Okay, kind of sad because that would have been really cool, but well..

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

No branches or pull requests

2 participants