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

fix: make altair work in Jupyter notebook and Jupyter Lab #288

Merged
merged 2 commits into from
Sep 15, 2023

Conversation

maartenbreddels
Copy link
Contributor

@maartenbreddels maartenbreddels commented Sep 13, 2023

  1. notebook: wrong mimetype (see 1st commit)
  2. lab: requirejs was not loaded (see 2nd commit)

Fixes the non-colab part of #287

@maartenbreddels maartenbreddels force-pushed the fix_altair_in_jupyter branch 2 times, most recently from a8253db to 416557f Compare September 13, 2023 19:40
@maartenbreddels maartenbreddels changed the title Fix: altair did not work in Jupyter notebook and Jupyter Lab fix: make altair work in Jupyter notebook and Jupyter Lab Sep 15, 2023
Because the vega url does not end with .js the CdnHandler does not
serve the file with the correct mimetype. We do not store the mime type
on disk, so we do not know the mimetype of the file.
Currently, the mimetype is guessed based on the file extension.
By giving a more explicit path that ends in .js, we can make sure the
mimetype is set correctly.
In the end this caused the Altair component not to work.
Jupyter Lab does not provide requirejs, so we need to load it ourselves
similar to what we do in other vue templates.
@maartenbreddels
Copy link
Contributor Author

failures are unrelated

@maartenbreddels maartenbreddels merged commit a3f9051 into master Sep 15, 2023
18 of 21 checks passed
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

Successfully merging this pull request may close these issues.

None yet

1 participant