Details
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>')
https://juanlu-poliastro.readthedocs.io/en/latest/examples/Visualizing%20the%20SpaceX%20Tesla%20Roadster%20trip%20to%20Mars.html
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 ReferenceErrors 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.
Details
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.jsat the top of the page from a notebook cell:https://juanlu-poliastro.readthedocs.io/en/latest/examples/Visualizing%20the%20SpaceX%20Tesla%20Roadster%20trip%20to%20Mars.html
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
ReferenceErrors but the plot loads. These errors come from RTD scripts: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):
https://juanlu-poliastro.readthedocs.io/en/latest/examples/Plotting%20in%203D.html
Then I get errors coming from
require.jsand the plot doesn't load in Firefox nor Chrome.