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

JSON data not read in JupyterLab if Bokeh labextension present #927

Closed
justinbois opened this issue Jun 9, 2018 · 2 comments
Closed

JSON data not read in JupyterLab if Bokeh labextension present #927

justinbois opened this issue Jun 9, 2018 · 2 comments

Comments

@justinbois
Copy link

If I launch a notebook in freshly installed JupyterLab with a code cell containing the following code, everything runs fine.

import pandas as pd
import altair as alt

alt.data_transformers.enable('json')

df = pd.DataFrame({'x': [0, 1], 'y': [0, 1]})

alt.Chart(df).mark_line().encode(x='x', y='y')

However, if I install the jupyter_bokeh labextension, The chart is not populated with data.

Here is what the Vega-Lite source looks like.

{
  "config": {"view": {"width": 400, "height": 300}},
  "data": {
    "url": "altair-data-8be5c259accbb02f2e137ba91b77b6f0.json",
    "format": {"type": "json"}
  },
  "mark": "line",
  "encoding": {
    "x": {"type": "quantitative", "field": "x"},
    "y": {"type": "quantitative", "field": "y"}
  },
  "$schema": "https://vega.github.io/schema/vega-lite/v2.4.3.json"
}

The file altair-data-8be5c259accbb02f2e137ba91b77b6f0.json is indeed present in the directory of the notebook.

The plot renders just fine if I do not use the data transformer (i.e., delete alt.data_transformers.enable('json')).

Disabling the jupyter_bokeh labextension does not solve the problem, nor does uninstalling it. Uninstalling and reinstalling JupyterLab does work.

I'm not sure what is causing this, but would love to be able to use Altair and Bokeh seamlessly in my projects, so any help or fixes are appreciated.

System information

CPython 3.6.5
IPython 6.4.0

jupyterlab 0.32.1
altair 2.1.0
entrypoints 0.2.3
ipython n�
jsonschema 2.6.0
numpy 1.14.3
pandas 0.23.0
six 1.11.0
toolz 0.9.0
typing n�

compiler   : GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)
system     : Darwin
release    : 17.5.0
machine    : x86_64
processor  : i386
CPU cores  : 8
interpreter: 64bit
@jakevdp
Copy link
Collaborator

jakevdp commented Jun 9, 2018

My only guess is that the bokeh extension somehow changes how the jupyterlab server routes URL paths. I'd suggest raising the issue in that repository to see if they know why this might be happening.

@joelostblom
Copy link
Contributor

@justinbois I am going through Altair issues to find those that have been resolved and can be closed. It looks to me like this issue can't be resolved on the Altair side of things so I am closing it, but please feel free to reopen and add a comment if there is something you don't think is resolved here yet.

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

No branches or pull requests

3 participants