-
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 fails to load in html docs #400
Comments
Can you please provide a minimal example to reproduce this problem? Does it work on Does it work with Same procedure as in #128 ... |
Sure, here's a simple example rendered by sphinx: Here's the github link: The plot doesn't render in github. But it shows up on nbviewer: It does not work with nbconvert. |
Thanks for the details! There seems to be some interaction with the RTD theme, they seem to define a |
This is what I did on my custom Sphinx and ReadTheDocs to get Plotly charts working.
{#
Plotly uses require.js for asynchronous JavaScript loading.
Here we will define the require.js config and tell
nbsphinx embedded <script> tags from where to load Plotly.
#}
<script type="text/javascript" src="{{ pathto('_static/require.js', 1) }}"></script>
<script>
require.config({
paths: {
plotly: '{{ pathto("_static/plotly", 1) }}'
}
});
</script> This will tell require.js config where to load Plotly. The configuration must be in For the full example, see the source code here. |
Also make sure you use "offline" plotly renderer in your notebooks.
|
@wellcaffeinated It looks like Plotly assumes MathJax version 2, but Sphinx (and |
This is related to #128 but a different problem. Currently plotly seems to be calling a non-existent method
require.undef
which is causing the plots not to load.Additionally I tried manually commenting out that line, and the require callback that initializes the plot (not shown here) fails to load. I'm not sure why this isn't working. Has anyone else seen this problem?
The text was updated successfully, but these errors were encountered: