1

I found a way to implement interactive slider using Bokeh without relying on Bokeh server, since Bokeh server doesn't work in VS code.

But this new way doesn't work in vs code either, though it still works in web browser.

Is it possible to run it in vs code?

David H. J.
  • 340
  • 2
  • 12

1 Answers1

1

The jupyter mentioned in your link is used, so please install the jupyter extension and create the .ipynb file.

enter image description here

I used the basic interactor demo in the link.

enter image description here

After all execution, I can get the content shown in the figure:

enter image description here

Of course, when you adjust the scroll bar below, you need to rerun the penultimate cell:

enter image description here

MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13
  • 1
    Smart idea. Any way to skip the step 2 though? It's of great value to see continuous change on graph when move the slider, so I know what those variables mean. – David H. J. Aug 08 '22 at 09:28
  • 1
    @David H. J. This is not supported at present. It can only be refreshed manually. You can request a new feature in GitHub [jupyter](https://github.com/microsoft/vscode-jupyter) or [bokeh](https://github.com/bokeh/bokeh). – MingJie-MSFT Aug 08 '22 at 09:33
  • @MingJie-MSFT are the Bokeh Jupyter extensions installed? `push_notebook` is implemented using notebook comms, which require an extension (nothing we can do about that) – bigreddot Aug 08 '22 at 14:49
  • @bigreddot This can't be searched in the extension store. Could you please paste a link for me to check it? – MingJie-MSFT Aug 09 '22 at 01:07
  • That's because it is a Jupyter extension, not a VSCode extension: https://github.com/bokeh/jupyter_bokeh#jupyter_bokeh I can't guarantee this extensions makes things work in "JupyterLab inside VSCode" btw, the extension is only tested with plain JupyterLab. – bigreddot Aug 09 '22 at 01:23
  • @bigreddot I've just tried it. It seems that it doesn't work in the jupyter notebook of vscode – MingJie-MSFT Aug 09 '22 at 01:28