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

VegaFusionWidget regressions with Altair 5 #267

Closed
jonmmease opened this issue Mar 20, 2023 · 2 comments
Closed

VegaFusionWidget regressions with Altair 5 #267

jonmmease opened this issue Mar 20, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jonmmease
Copy link
Collaborator

Consider the following example:

import pandas as pd
import altair as alt
import vegafusion as vf

vf.enable_widget()

flights = pd.read_parquet(
    "https://vegafusion-datasets.s3.amazonaws.com/vega/flights_1m.parquet"
)

brush = alt.selection(type='interval', encodings=['x'])

# Define the base chart, with the common parts of the
# background and highlights
base = alt.Chart().mark_bar().encode(
    x=alt.X(alt.repeat('column'), type='quantitative', bin=alt.Bin(maxbins=20)),
    y='count()'
).properties(
    width=160,
    height=130
)

# gray background with selection
background = base.encode(
    color=alt.value('#ddd')
).add_selection(brush)

# blue highlights on the selected data
highlight = base.transform_filter(brush)

# layer the two charts & repeat
chart = alt.layer(
    background,
    highlight,
    data=flights
).transform_calculate(
    "time",
    "hours(datum.date)"
).repeat(column=["distance", "delay", "time"])
chart

With Altair 4.2, a selection on the distance histogram results in the following

Screenshot 2023-03-20 at 8 37 12 AM

But with Altair 5.0.0rc1, the background histograms for the distance and delay subplots disappears:

Screenshot 2023-03-20 at 8 38 10 AM

I haven't dug in yet to diagnose where the breakdown is.

@jonmmease jonmmease added the bug Something isn't working label Mar 20, 2023
@jonmmease
Copy link
Collaborator Author

Looks like the same issue crops up in the Altair 5 gallery example without VegaFusion: https://altair-viz.github.io/gallery/interactive_layered_crossfilter.html

@jonmmease
Copy link
Collaborator Author

This is a known issue already tracked in vega/altair#2849

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant