-
Notifications
You must be signed in to change notification settings - Fork 132
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
Plotly graphs not showing in documentation #128
Comments
Thanks for the report!
Can you please provide an example notebook that shows the issue?
|
https://gist.github.com/bluprince13/1a53aabe99b5a4a1ec2007a90889115b The plots don't render on Github either. |
OK, thanks for the example. Just for the record, it seems to work on nbviewer: http://nbviewer.jupyter.org/gist/bluprince13/1a53aabe99b5a4a1ec2007a90889115b Does it work with I don't know how this is supposed to work. When loading the Sphinx-generated HTML page, I get those errors in the JS Console:
|
I asked a question on stackoverflow on this as well. No responses yet. |
I can confirm that this does work with nbconvert 5.3.1. So, why is the Sphinx generated documentation not showing it ... |
Thanks for checking it out with Since nobody has missed it before, I don't think it's worth including it by default in For now, you can use this in your def setup(app):
app.add_javascript('https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js') ... but probably there is a better solution? |
Hmmm...did you check if it solves the problem? It didn't work for me, but I am not sure if there was some other factor at play. In terms of a solution, is it feasible to get nbsphinx to generate a meaningful warning if there are missing scripts? |
Yes, I checked. No, I don't think that's possible. |
I have tried this workaround, but still I get the Code: poliastro/poliastro@master...Juanlu001:master I suspect this is because the scripts are loaded at the bottom of the page, after |
I see you're tracking this here readthedocs/sphinx_rtd_theme#328 |
Did you try it with a different HTML theme? |
I can confirm locally that using a different theme fixes the problem, so this is not a nbsphinx issue. |
@Juanlu001 OK, thanks! Did you try if readthedocs/sphinx_rtd_theme#467 fixes the problem? |
Yes it does! 😁 see readthedocs/sphinx_rtd_theme#467 (comment) |
readthedocs/sphinx_rtd_theme#467 was closed because it was too complex, but now the issue is being tackled at readthedocs/sphinx_rtd_theme#545. |
Some more info in readthedocs/readthedocs.org#4367 (comment) |
readthedocs/sphinx_rtd_theme#545 has finally been merged into the |
@mgeier I would opt for adding |
@manycoding I guess if Would you like to make a PR? |
We had this issue for both Here is our solution:
Example html_js_files = [
"require.min.js", # Add to your _static
"custom.js",
] Example custom.js: requirejs.config({
paths: {
base: '/static/base',
plotly: 'https://cdn.plot.ly/plotly-2.12.1.min.js?noext',
},
}); This way
See the example open-source documentation here and the example notebook. |
Graphs generated using plotly are not showing in the documentation. Matplotlib plots show up just fine.
The text was updated successfully, but these errors were encountered: