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

hv.extension(inline=False) not working #6385

Closed
1 task
michaelaye opened this issue Sep 24, 2024 · 7 comments
Closed
1 task

hv.extension(inline=False) not working #6385

michaelaye opened this issue Sep 24, 2024 · 7 comments

Comments

@michaelaye
Copy link
Contributor

ALL software version info

Software Version Info
* holoviews 1.19.1
* bokeh 3.5.2
* jupyter_bokeh 4.0.5

Description of expected behavior and the observed behavior

  • Expected: notebook does not contain bokeh javascript
  • Observed: Empty new notebook contains bokeh javascript despite inline=False

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

import holoviews as hv
hv.extension("bokeh", inline=False, logo=False)

Stack traceback and/or browser JavaScript console output

Screenshots or screencasts of the bug in action

     "data": {
      "application/javascript": [
       "(function(root) {\n",
       "  function now() {\n",
       "    return new Date();\n",
       "  }\n",
       "\n",
       "  const force = true;\n",
       "  const py_version = '3.5.2'.replace('rc', '-rc.').replace('.dev', '-dev.');\n",
       "  const reloading = false;\n",
       "  const Bokeh = root.Bokeh;\n",
       "\n",
       "  // Set a timeout for this load but only if we are not already initializing\n",
       "  if (typeof (root._bokeh_timeout) === \"undefined\" || (force || !root._bokeh_is_initializing)) {\n",
       "    root._bokeh_timeout = Date.now() + 5000;\n",
       "    root._bokeh_failed_load = false;\n",
       "  }\n",
  • I may be interested in making a pull request to address this
@hoxbro
Copy link
Member

hoxbro commented Sep 24, 2024

Expected: notebook does not contain bokeh javascript

This is a wrong expectation. inline=True (which is the default) means that the libraries are not embedded into the file. You still need a bit of JavaScript to run.

@michaelaye
Copy link
Contributor Author

i see, thanks for confirming. I asked this here a year ago, but alas, nobody replied.

@hoxbro
Copy link
Member

hoxbro commented Sep 24, 2024

That must have fallen through the cracks. Sorry about that.

@michaelaye
Copy link
Contributor Author

oh i don't expect the holoviews team to have time to read all discussion, was just hoping that somebody knows and replies...

@michaelaye
Copy link
Contributor Author

followup: is it normal/as-designed, that a 2nd time execution of a cell with import hvplot.xarray removes that minimal Javascript again from the notebook?

@michaelaye
Copy link
Contributor Author

which interestingly does NOT happen with import holoviews as hv;hv.extension(inline=False)

@hoxbro
Copy link
Member

hoxbro commented Sep 25, 2024

This will be improved in the next hvplot release, so it is added each time you import it. See holoviz/hvplot#1359

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