Closed
Description
Details
- Read the Docs project URL: https://readthedocs.org/projects/juanlu-poliastro/
- Build URL (if applicable): https://readthedocs.org/projects/juanlu-poliastro/builds/7484265/
- Read the Docs username (if applicable): Juanlu001
Expected Result
I expected the Plotly plots to show in RTD the same way as locally.
Actual Result
Because of readthedocs/sphinx_rtd_theme#328, I am using a hack, which is adding require.js
at the top of the page from a notebook cell:
from IPython.display import HTML
HTML('<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>')
I tried to build locally and the result is correctly seen in Firefox and Chrome.
When deploying to RTD, on Firefox this gives several JavaScript ReferenceError
s but the plot loads. These errors come from RTD scripts:
ReferenceError: _ is not defined # doctools.js:15
ReferenceError: $ is not defined # readthedocs-doc-embed.js:1
ReferenceError: jQuery is not defined # Visualizing the SpaceX Tesla Roadster trip to Mars.html:681
In Chrome, on the other hand, I get similar errors but the plot never loads.
When I try to add jQuery as suggested in plotly/plotly.py#1033 (comment):
HTML('''
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
''')
https://juanlu-poliastro.readthedocs.io/en/latest/examples/Plotting%20in%203D.html
Then I get errors coming from require.js
and the plot doesn't load in Firefox nor Chrome.