Skip to content

Should charts render in jupyterlab? #147

@jwhendy

Description

@jwhendy

Using this example, I get an error and blank output.

import random
from IPython import display as d
import nvd3
nvd3.ipynb.initialize_javascript(use_remote=True)

type = 'stackedAreaChart'
chart2 = nvd3.stackedAreaChart(name=type,height=450,width=500, 
                               use_interactive_guideline=True)
nb_element = 50
xdata = range(nb_element)
ydata = [i * random.randint(1, 10) for i in range(nb_element)]
ydata2 = [x * 2 for x in ydata]
ydata3 = [x * 5 for x in ydata]
chart2.add_serie(name="serie 1", y=ydata, x=xdata)
chart2.add_serie(name="serie 2", y=ydata2, x=xdata)
chart2.add_serie(name="serie 3", y=ydata3, x=xdata)
chart2

2017-11-05_150003

$ pip freeze
python-nvd3==0.14.2
ipython==6.2.1
jupyter-client==5.1.0
jupyter-console==5.2.0
jupyter-core==4.4.0
jupyterlab==0.28.12
jupyterlab-launcher==0.5.5

Is there any other data needed to identify if this is a bug or some sort of setup issue? For what it's worth, I'm up to 4 js based plotting libraries and they all fail except for altair with their various commands to render in jupyterlab. Not sure if that's related or not, but thought I'd mention it.

  • bokeh with output_notebook()
  • plotly with init_notebook_mode()
  • altair works with it's alt.enable_mime_rendering()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions