jupyterlab / jupyterlab

JupyterLab computational environment.
https://jupyterlab.readthedocs.io/
Other
14.16k stars 3.38k forks source link

Vega-Lite rendering fails for CSV-based data #4167

Open fuglede opened 6 years ago

fuglede commented 6 years ago

To reproduce,

Then, the following error message is displayed:

Error message

In the console, one finds the following warning:

[W 13:10:09.258 LabApp] 404 GET /cars.csv (127.0.0.1) 109.37ms referer=http://localhost:8888/cars.csv

This suggests that rendering might succeed if one were to replace the CSV file path with the absolute path (relative to the root of the JupyterLab file server). If one changes cars.csv to /lab/tree/jupyterlab/cars.csv in the Vega-Lite specification, then one no longer gets an error message; instead, JupyterLab shows the spinning orange "loading" circle forever.

At this point, after restarting the server, loading fails and one can only proceed by clearing the workspace.

Error message

ellisonbg commented 6 years ago

Thanks for reporting this.

On Sat, Mar 10, 2018 at 4:22 AM, Søren Fuglede Jørgensen < notifications@github.com> wrote:

To reproduce,

  • create a folder called jupyterlab relative to the root of the file server,
  • in this folder, create a Python 3 workbook and import altair,
  • generate some data through altair.load_dataset('cars').to_csv('cars.csv', index=False),
  • create and store the following Vega-Lite specification as cars.vl.json: {"encoding": {"color": {"field": "Origin", "type": "nominal"}, "x": {"field": "Horsepower", "type": "quantitative"}, "y": {"field": "Miles_per_Gallon", "type": "quantitative"}}, "mark": "point", "data": {"url": "cars.csv", "format": {"type": "csv"}}, "$schema": " https://vega.github.io/schema/vega-lite/v1.2.1.json https://vega.github.io/schema/vega-lite/v1.2.1.json"},
  • open cars.vl.json in JupyterLab.

Then, the following error message is displayed:

[image: Error message] https://user-images.githubusercontent.com/6169306/37242217-dae996f4-2465-11e8-9767-92cf92163093.png

In the console, one finds the following warning:

[W 13:10:09.258 LabApp] 404 GET /cars.csv (127.0.0.1) 109.37ms referer=http://localhost:8888/cars.csv

This suggests that rendering might succeed if one were to replace the CSV file path with the absolute path (relative to the root of the JupyterLab file server). If one changes cars.csv to /lab/tree/jupyterlab/cars.csv in the Vega-Lite specification, then one no longer gets an error message; instead, JupyterLab shows the spinning orange "loading" circle forever.

At this point, after restarting the server, loading fails and one can only proceed by clearing the workspace.

[image: Error message] https://user-images.githubusercontent.com/6169306/37242199-8fb6701c-2465-11e8-8c0c-ced6863c4fe7.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jupyterlab/jupyterlab/issues/4167, or mute the thread https://github.com/notifications/unsubscribe-auth/AABr0IyBGjHSkJnwJkV8Y1fw7N2DPskBks5tc8VvgaJpZM4SlQeC .

-- Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger@calpoly.edu and ellisonbg@gmail.com

fuglede commented 6 years ago

And thanks for making this!

sid-kap commented 6 years ago

@fuglede Is your notebook password-protected? You might be running into the same issue I was in https://github.com/altair-viz/altair/issues/433. If so, I just opened a PR that addresses this problem (https://github.com/jupyterlab/jupyterlab/pull/4707).

fuglede commented 6 years ago

@sid-kap I'm afraid it wasn't, no, but thanks for the heads-up.