Skip to content

Commit

Permalink
Fix baseURL in vega extensions jupyterlab#7047
Browse files Browse the repository at this point in the history
This ensures that the path of the current notebook is included in the
URL for data files in the vega extensions.
  • Loading branch information
malramsay64 committed Aug 19, 2019
1 parent 3592afd commit 0893e7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/vega4-extension/src/index.ts
Expand Up @@ -92,7 +92,10 @@ export class RenderedVega extends Widget implements IRenderMime.IRenderer {
this._result.view.finalize();
}

const path = await this._resolver.resolveUrl('');
const baseURL = await this._resolver.getDownloadUrl(path);
const loader = vega.vega.loader({
baseURL,
http: { credentials: 'same-origin' }
});

Expand Down
3 changes: 3 additions & 0 deletions packages/vega5-extension/src/index.ts
Expand Up @@ -92,7 +92,10 @@ export class RenderedVega extends Widget implements IRenderMime.IRenderer {
this._result.view.finalize();
}

const path = await this._resolver.resolveUrl('');
const baseURL = await this._resolver.getDownloadUrl(path);
const loader = vega.vega.loader({
baseURL,
http: { credentials: 'same-origin' }
});
const sanitize = async (uri: string, options: any) => {
Expand Down

0 comments on commit 0893e7b

Please sign in to comment.