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 plots do not render with cell tags #1751

Closed
jeff-tilton opened this issue Jun 9, 2022 · 5 comments
Closed

Bokeh plots do not render with cell tags #1751

jeff-tilton opened this issue Jun 9, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@jeff-tilton
Copy link

Describe the bug

context
Bokeh plots do not render when pages contain cell tags example remove-cell or remove-input. This happens regardless of where the cell tags are, even if they are not within the cell that contains the bokeh plot.

expectation
I expected the bokeh plots to render if cell tags are in the jupyter notebook.

bug
Bokeh plots do not render, the below error is seen upon console inspection.

Bokeh: ERROR: Unable to run BokehJS code because BokehJS library is missing

problem
I have a lot of interactive plots that work when I do not use cell tags, but disappear when I add the cell tags, making my presentation currently unusable.

Reproduce the bug

A repository, with an example can be seen here.
The above repository has a github page with the error here.

List your environment

$ jupyter-book --version
Jupyter Book      : 0.13.0
External ToC      : 0.2.4
MyST-Parser       : 0.15.2
MyST-NB           : 0.13.2
Sphinx Book Theme : 0.3.2
Jupyter-Cache     : 0.4.3
NbClient          : 0.5.13
$ bokeh info
Python version      :  3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)]
IPython version     :  7.31.1
Tornado version     :  6.1
Bokeh version       :  2.4.2
BokehJS static path :  C:\Users\jeffrey.tilton\Anaconda3\lib\site-packages\bokeh\server\static
node.js version     :  v16.13.1
npm version         :  8.1.2
Operating system    :  Windows-10-10.0.19042-SP0
@jeff-tilton jeff-tilton added the bug Something isn't working label Jun 9, 2022
@welcome
Copy link

welcome bot commented Jun 9, 2022

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@agoose77
Copy link
Collaborator

agoose77 commented Jun 9, 2022

Currently, the remove-cell etc. tags prevent the nodes from being included in the final document at all, whilst the hide-cell tag introduces a button to show the hidden content.

In this case, we want to include these cells in the document, but render them invisible e.g. if the cell includes a stylesheet or script. What you might need to do is use a custom tag and a CSS stylesheet to hide those tags, e.g invisible.

Long term, I think we might want to add the ability to disable the togglebutton that hide-cell creates.

@jeff-tilton
Copy link
Author

So this has to do with Bokeh's output_notebook() function. Bokeh plots do not render if the remove-cell tag is used in the cell output_notbook() is called. I updated my example on git with a third chapter to see the difference. I am not sure if this is a bug on Jupyter-Book or Bokeh, I will leave this open and let others decide to close it.

@agoose77
Copy link
Collaborator

agoose77 commented Jun 10, 2022

Yes. I thought I'd written that above, but for some reason I must have deleted it.

Technically this is either a bug or a missing feature in MyST-NB (see executablebooks/MyST-NB#418 for related issue).

@jeff-tilton
Copy link
Author

I decided to close this after looking @agoose77 comments and related issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants