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 extension not loading in subdirectory #7047

Closed
malramsay64 opened this issue Aug 19, 2019 · 3 comments · Fixed by #7098
Closed

Vega extension not loading in subdirectory #7047

malramsay64 opened this issue Aug 19, 2019 · 3 comments · Fixed by #7098

Comments

@malramsay64
Copy link

@malramsay64 malramsay64 commented Aug 19, 2019

Description

When inside a subdirectory the paths to a Vega file don't include the directory parts of the path of the current notebook. That is the download path is

localhost:8888/files/altair-data.json

instead of

localhost:8888/files/test/altair-data.json

for a notebook in the test directory.

The change occurred in #7022 (and #7031) where the baseURL parameter was removed from the loader.

See also #7017

Reproduce

  • Create a directory test
  • Inside the test directory create a new notebook with the contents
import altair as alt
import pandas as pd
alt.data_transformers.enable("json")
df = pd.DataFrame({"x": [1,2,3], "y": [1,2,3]})
alt.Chart(df).mark_line().encode(x="x", y="y")
  • The chart will contain no data, a 404 error message in the terminal and the debug console.

This works in the top level directory.

Expected behavior

The chart loads the data from the directory test as per previous versions of jupyterlab, like 1.0.2.

Context

  • Operating System and version: Fedora 30
  • Browser and version: Firefox 68
  • JupyterLab version: 1.0.6
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here.
malramsay64 added a commit to malramsay64/jupyterlab that referenced this issue Aug 19, 2019
This ensures that the path of the current notebook is included in the
URL for data files in the vega extensions.
@RickWalker
Copy link

@RickWalker RickWalker commented Aug 27, 2019

We have this problem too, and it comes up in other cases - if you use a custom transformer to put all the json files from Altair in their own folder, then charts don't work. Pretty sure it's the same root cause.

@jasongrout
Copy link
Contributor

@jasongrout jasongrout commented Aug 27, 2019

I think this is fixed in #7098. If one of you can test it, that would be great!

@jasongrout jasongrout added this to the 1.1 milestone Aug 27, 2019
@malramsay64
Copy link
Author

@malramsay64 malramsay64 commented Aug 27, 2019

It is working in my testing. Thank you for the fix!

@lock lock bot locked as resolved and limited conversation to collaborators Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants