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

Could we consolidate data in faceted specs? #3265

Open
joelostblom opened this issue Nov 14, 2023 · 0 comments
Open

Could we consolidate data in faceted specs? #3265

joelostblom opened this issue Nov 14, 2023 · 0 comments

Comments

@joelostblom
Copy link
Contributor

There are situations like the below that raises the error although the same data is technically used, just respecified as a new variable.

alt.layer(
    alt.Chart(data.movies.url).mark_rule().encode(x='IMDB_Rating:Q'),
    alt.Chart(data.movies.url).mark_rule().encode(x='IMDB_Rating:Q')
).facet(
    'Major_Genre:N'
)

I am not sure if altair should be capable of figuring out that this is the same as

source = data.movies.url
alt.layer(
    alt.Chart(source).mark_rule().encode(x='IMDB_Rating:Q'),
    alt.Chart(source).mark_rule().encode(x='IMDB_Rating:Q')
).facet(
    'Major_Genre:N'
)

and avoid the error, maybe those comparisons will be too complex for large data frames and non-portable across dataframe implementations (although many have some type of equality test built-in like pandas). But maybe we can explore if these datasets could be consolidated as is done for other data? See this function: https://github.com/altair-viz/altair/blob/main/altair/vegalite/v5/api.py#L63 cc @mattijn

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

No branches or pull requests

1 participant