Plotly backend does not work in jupyterlab?

Hi,

I am trying to plot with Plotly backened in jupyterlab with the following commands

import holoviews as hv
from holoviews import OrderedDict
import bokeh.palettes
from bokeh.models import HoverTool
from holoviews import opts,dim

hv.extension('plotly')
plt =hv.Scatter3D((umap_pd['x'].values,umap_pd['y'].values,umap_pd['z'].values))
plt

And I got “Drawing…” as the output.

It works when I export it as a html, but I would like to be able to view it in jupyterlab as well.

Any suggestions for why that is the case?

Thank you!

Could you report your versions especially for HoloViews? I suspect this is something to do with the jQuery shipped with the JupyterLab extension. I’ll release a new version soon.

Hi,

sorry for the incomplete question. My version for holoview is 1.12.5

Best,
Kawai

Can only suggest updating to HoloViews 1.13.1 and @pyviz/jupyterlab_pyviz 1.0.

Hi!
I’m also interested in using Holoviews with the plotly backend but it is not working. My holoviews version is 1.13.1. After implementing the following code (from this example https://anaconda.org/jonmmease/link_selections_pr/notebook ) I don’t get any output in my Jupyter Notebook (jupyter==1.0.0):

from plotly.data import iris as load_iris
import holoviews as hv
from holoviews.util.transform import dim
import numpy as np
import pandas as pd
hv.extension("plotly")

iris_df = load_iris()

# Build Dataset from DataFrame and metadata
features = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width']
iris_ds = hv.Dataset(iris_df).redim.label(
    **{c: c.title().replace('_', ' ') for c in features}
).redim.unit(
    **{c: 'cm' for c in features}
)

sepal_width_hist = iris_ds.hist('sepal_length', num_bins=10, adjoin=False, normed=False)
sepal_width_hist

Would you have any suggestion in what I am missing?

Thank you,

Camila

We’ll need a bit more information to figure this out. Could you report whether you’re running this in classic notebook or JupyterLab and also report the versions of panel, plotly and bokeh?

I’m running this from a classic notebook. The versions I’m using are:
Panel: 0.9.3
Plotly: 4.5.4
Bokeh: 2.0.1
Holoviews: 1.13.1

Besides, when I right-click on the empty cell result and go to inspect, this is the error I’m getting:

Uncaught Error: Model 'panel.models.plotly.PlotlyPlot' does not exist. This could be due to a widget or a custom model not being registered before first usage.
    at Object.s.Models (eval at append_javascript (outputarea.js:763), <anonymous>:280:196)
    at Function._instantiate_object (eval at append_javascript (outputarea.js:763), <anonymous>:279:5095)
    at Function._instantiate_references_json (eval at append_javascript (outputarea.js:763), <anonymous>:279:5245)
    at Function.from_json (eval at append_javascript (outputarea.js:763), <anonymous>:279:8390)
    at Object.t.embed_items_notebook (eval at append_javascript (outputarea.js:763), <anonymous>:672:1539)
    at embed_document (<anonymous>:56:20)
    at <anonymous>:59:5
    at <anonymous>:75:3
    at eval (eval at append_javascript (outputarea.js:763), <anonymous>:97:28)
    at Array.forEach (<anonymous>)

Thanks for reporting this. I just uncovered a regression due to the bokeh 2.0.1 release and I’m preparing Panel 0.9.4 and HoloViews 1.13.2 release that should fix this.