Skip to content

Commit

Permalink
fix: altair did not work in jupyter notebook due to wrong mimetype
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
maartenbreddels committed Sep 13, 2023
1 parent 348ab5a commit d05826c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions solara/widgets/vue/vegalite.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ module.exports = {
require.config({
map: {
'*': {
'vega': `${this.getCdn()}/vega@5`,
'vega-lite': `${this.getCdn()}/[email protected]`,
'vega-embed': `${this.getCdn()}/vega-embed@6`,
'vega': `${this.getCdn()}/vega@5/build/vega.min.js`,
'vega-lite': `${this.getCdn()}/[email protected]/build/vega-lite.min.js`,
'vega-embed': `${this.getCdn()}/vega-embed@6/build/vega-embed.min.js`,
}
}
})
Expand Down

0 comments on commit d05826c

Please sign in to comment.