Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

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

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

@vega vega locked and limited conversation to collaborators Jan 7, 2025
@dangotbanned dangotbanned converted this issue into discussion #3758 Jan 7, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

1 participant