Jupyter-book: Standalone pages don't show Plotly figures

Created on 20 Sep 2020  路  7Comments  路  Source: executablebooks/jupyter-book

Describe the bug

Since upgrading jupyter-book the figures produced by Plotly no longer appear when building standalone pages.

To Reproduce

Steps to reproduce the behavior:

  1. Create a jupyter notebook mypage.ipynb with a Plotly figure
  2. Run jb build path/to/mypage.ipynb
  3. View the resulting html file
  4. See no figure

Expected behavior

Plotly figures worked with my previous version of jupyter-book, sorry I don't remember the version number but it used jb page ... rather than jb build ... for standalone pages.

Environment

  • Python Version [e.g. 3.7.1]: 3.7.7
  • Package versions or output of jupyter-book --version: 0.8.2
  • Operating System: Windows 10

Additional context

I assume this is because jupyterbooks with Plotly content now need to load require.js in `_config.yml, but I don't see how to do that with a standalone page.

bug

Most helpful comment

BTW, I just built a standalone page from a notebook with a Julia kernel, using the Plotly backend to Plots.jl, and it the resulting figure displays in the html output without the need for a config file.

All 7 comments

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

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! :tada:

Heya, thanks for the report, i did add a mention of how to add this in the documentation https://jupyterbook.org/interactive/interactive.html#plotly
I thought this should still work for standalone, i.e. it should still read the config, is that not case?

Hi, thanks for responding so quickly (love jupyterbook btw)

I'd seen that but hadn't realised you could have a _config.yml with a standalone page, since I hadn't had one before. But I just added one and it works fine now. Thanks again. and sorry to bother you.

Hmmm this makes me think we should make that message clearer, so folks know that they can do all the same stuff w/ _config.yml. Do you agree @mcmwright ?

Agreed

BTW, I just built a standalone page from a notebook with a Julia kernel, using the Plotly backend to Plots.jl, and it the resulting figure displays in the html output without the need for a config file.

Awesome 馃榾

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nozebacle picture nozebacle  路  3Comments

choldgraf picture choldgraf  路  4Comments

cedeerwe picture cedeerwe  路  3Comments

choldgraf picture choldgraf  路  5Comments

utterances-bot picture utterances-bot  路  3Comments