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

Vega 5.26.1 breaks JupyterChart #3268

Closed
manzt opened this issue Nov 17, 2023 · 2 comments · Fixed by #3269
Closed

Vega 5.26.1 breaks JupyterChart #3268

manzt opened this issue Nov 17, 2023 · 2 comments · Fixed by #3269
Labels

Comments

@manzt
Copy link
Contributor

manzt commented Nov 17, 2023

First posted in anywidget:

It seems there is a bug in latest patch release of Vega (vega/vega#3829), that breaks the altair "hello, world":

import altair as alt
from vega_datasets import data

source = data.cars()
brush = alt.selection_interval()

points = alt.Chart(source).mark_point().encode(
    x="Horsepower",
    y="Miles_per_Gallon",
    color=alt.condition(brush, "Origin", alt.value("lightgray"))
).add_params(
    brush
)

bars = alt.Chart(source).mark_bar().encode(
    y="Origin",
    color="Origin",
    x="count(Origin)"
).transform_filter(
    brush
)
alt.jupyter.JupyterChart(points & bars)
image

This occurs because the JS embed dependency is coming from a CDN and vega-embed's package.json says the patch fix is within semver. The CDN esm.sh let's you pin an exact dependency version in your import URL, so you can fix this bug by changing the import in

-- import embed from "https://cdn.jsdelivr.net/npm/vega-embed@6/+esm";
++ import embed from "https://esm.sh/vega-embed@6?deps=vega@5.26.0";
@manzt manzt added the bug label Nov 17, 2023
@manzt manzt changed the title Vega 5.26 breaks JupyterChart Vega 5.26.1 breaks JupyterChart Nov 17, 2023
@jonmmease
Copy link
Contributor

Thanks for the report. Interesting, when I pull 5.26.1 from https://esm.sh/vega-embed@6?deps=vega@5.26.1 it works as well.

@manzt
Copy link
Contributor Author

manzt commented Nov 17, 2023

Interesting. Maybe something else is going on, sorry I don't have the time to dig into it more deeply.

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

Successfully merging a pull request may close this issue.

2 participants