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

Limited support using the Code Console in JupyterLab #118

Open
1 task
iuryt opened this issue Oct 17, 2023 · 4 comments
Open
1 task

Limited support using the Code Console in JupyterLab #118

iuryt opened this issue Oct 17, 2023 · 4 comments

Comments

@iuryt
Copy link

iuryt commented Oct 17, 2023

Thanks for contacting us! Please read and follow these instructions carefully, then delete this introductory text to keep your issue easy to read. Note that the issue tracker is NOT the place for usage questions and technical assistance; post those at Discourse instead. Issues without the required information below may be closed immediately.

ALL software version info

(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc)

I basically followed
https://hvplot.holoviz.org/getting_started/installation.html

and installed everything with

conda create -n hvplot-env -c conda-forge -c nodefaults hvplot geoviews datashader xarray pandas geopandas dask streamz networkx intake intake-xarray intake-parquet s3fs scipy spatialpandas pooch rasterio fiona plotly matplotlib jupyterlab

Description of expected behavior and the observed behavior

Then following

https://hvplot.holoviz.org/

I tried

import hvplot.xarray
import panel as pn
import xarray as xr

da = xr.tutorial.open_dataset('air_temperature').air
w_quantile = pn.widgets.FloatSlider(name='quantile', start=0, end=1)
w_time = pn.widgets.IntSlider(name='time', start=0, end=10)

da.interactive(loc='left') \
.isel(time=w_time) \
.quantile(q=w_quantile, dim='lon') \
.hvplot(ylabel='Air Temperature [K]', width=500)

But this is on a .py file on a JupyterLab that I am running using the console for editor which pops up a notebook that is used to run the code.

Complete, minimal, self-contained example code that reproduces the issue

The code was provided in the previous session.

Stack traceback and/or browser JavaScript console output

Not sure if this is what you are asking fo

[bokeh] document idle at 978 ms
3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2 TypeError: i[r] is not a function
    at Object.n [as delegateLabel] (jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2:734214)
    at caption (jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2:731800)
    at e.caption (jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2:1326754)
    at Object.t [as propsFromCommand] (jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2:124476)
    at Object.children (jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2:122762)
    at x.render (jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2:81583)
    at ho (3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2:74183)
    at po (3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2:73980)
    at ds (3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2:110364)
    at Ji (3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2:101464)
Mo @ 3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2
jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2 TypeError: i[r] is not a function
    at Object.n [as delegateLabel] (jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2:734214)
    at caption (jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2:731800)
    at e.caption (jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2:1326754)
    at Object.t [as propsFromCommand] (jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2:124476)
    at Object.children (jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2:122762)
    at x.render (jlab_core.fa2ded6823988d66523d.js?v=fa2ded6823988d66523d:2:81583)
    at ho (3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2:74183)
    at po (3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2:73980)
    at ds (3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2:110364)
    at Ji (3935.4159b022aa6d82e44127.js?v=4159b022aa6d82e44127:2:101464)

Screenshots or screencasts of the bug in action

ezgif com-video-to-gif

ezgif com-video-to-gif (1)

  • I may be interested in making a pull request to address this
@maximlt
Copy link
Member

maximlt commented Oct 18, 2023

Hi @iuryt,

Thanks for opening this issue. I'm not sure I ever used the Code console in Jupyter Lab :) ! I also thought I was just a regular IPython console, it turns out it's more than that as you can't display HoloViews plots in an IPython terminal or Qt console.

I'm moving this issue to another repository that holds the extension responsible for the interactivity you usually get in a notebook. Note that I'm not sure it's going to be possible to support having interactivity in the Jupyter Lab Code Console, so until then the workaround is to directly work in a notebook instead of in the Code Console.

@maximlt maximlt transferred this issue from holoviz/hvplot Oct 18, 2023
@maximlt maximlt changed the title Interactive plots does not work when using notebook console for editor on JupyterLab Limited support using the Code Console in JupyterLab Oct 18, 2023
@maximlt
Copy link
Member

maximlt commented Oct 18, 2023

I moved this issue from hvPlot to here. I have no clue whether supporting full interactivity in the Jupyter Lab Code Console is possible 🙃

@iuryt
Copy link
Author

iuryt commented Oct 18, 2023

Thanks! I am using the notebook now, but it took a while for me to realize that was not a problem on my browser. Haha

@maximlt
Copy link
Member

maximlt commented Oct 18, 2023

Yes, maybe there's a way to detect when the code is executed from within the Code Console and log/warn about the limited support.

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

2 participants