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

Bokeh Support #112

Open
lukasheinrich opened this issue Jan 23, 2019 · 2 comments
Open

Bokeh Support #112

lukasheinrich opened this issue Jan 23, 2019 · 2 comments

Comments

@lukasheinrich
Copy link

Hi, as an alternative to #111 it might be easier (I'm unsure) to support bokeh.

I tried forking launching a kernel based on the https://github.com/bokeh/bokeh-notebooks binder but get: JavaScript output is disabled in JupyterLab

screenshot

which I don't fully understand, since trying to render things in JupyterLab (by replacing /tree with /lab) in that binder works.

I tried forking it and explicitly adding the bokeh jupyterlab extension to the postBuild which successfully builds

https://github.com/lukasheinrich/bokeh-notebooks/blob/master/postBuild

but I still see the same message (jupyter labextension list seems to confirm the extension works)

I see the example with ipyleaflet, which surely uses some javascript, but I don't know which piece I'm missing.

screenshot

@basnijholt
Copy link

I was about to open an issue and then I found this.

We use thebelab in the Adaptive documentation and use holoviews plots. They too (since they depend on bokeh) do not work.

See my minimal example:
cat holoviews.html

<!-- Configure and load Thebe !-->
<script type="text/x-thebe-config">
  {
    requestKernel: true,
    binderOptions: {
      repo: "python-adaptive/adaptive",
    },
  }
</script>
<script src="https://unpkg.com/[email protected]/lib/index.js"></script>


<button id="activateButton"  style="width: 150px; height: 75px; font-size: 1.5em;">Activate</button>
<script>
var bootstrapThebe = function() {
    thebelab.bootstrap();
}

document.querySelector("#activateButton").addEventListener('click', bootstrapThebe)
</script>


<pre data-executable="true" data-language="python">
import holoviews as hv
import numpy as np
hv.notebook_extension('bokeh')

xs = np.linspace(-1, 1)
ys = xs**2

hv.Curve((xs, ys))
</pre>

@celine168
Copy link
Contributor

celine168 commented Dec 22, 2020

This is just a mind dump of things I've been investigating.

I just noticed that the error message seems to come from the source code here: https://github.com/jupyterlab/jupyterlab/blob/master/packages/rendermime/src/widgets.ts#L415

However, I'm not sure at all how or where the render function is being called.

Bokeh.io imports 4 scripts into JupyterLab, but adding them directly to the HTML page doesn't work (I wasn't expecting them to though since we are calling output_notebook). However, I think importing one of them allows the bokeh icon to appear when it says "Loading BokehJS", but I don't think it's an overall solution to solve the underlying problem.

<script src="https://cdn.bokeh.org/bokeh/release/bokeh-2.2.3.min.js"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-2.2.3.min.js"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-2.2.3.min.js"></script>
<script src="https://cdn.bokeh.org/bokeh/release/bokeh-gl-2.2.3.min.js"></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants