plotly.py
plotly.py copied to clipboard
Plots from Colab don’t show in Nbviewer
I posted this on the plotly community forum but so far got no traction so I'm reporting this here.
-
What I did:
- Created this Colab notebook with a simple plotly line chart
- Added
pio.renderers.default = "notebook_connected+colab"as per Plotly’s instructions for using Multiple Renderers - Pushed it to this public Github repo
- Loaded the notebook in Nbviewer
-
What I expected:
- When loading in Nbviewer, I expected to see the rendered plotly graph as I did in Colab
-
What I saw:
- No rendered plot in Nbviewer
-
Plotly-colab-nbviewer.ipynb:14916 Uncaught ReferenceError: Plotly is not defined at Plotly-colab-nbviewer.ipynb:14916:462in the Brave dev tools
-
What seems strange:
- When I look at the HTML inside Nbviewer, I do see a script tag that should pull in Plotly and it’s right next to the script that makes the plot.
<script charset="utf-8" src="https://cdn.plot.ly/plotly-2.35.2.min.js"></script> <div id="5a0806d5-3da7-4c16-af56-b5fd7c6a67cb" class="plotly-graph-div" style="height:525px; width:100%;"></div> <script type="text/javascript"> window.PLOTLYENV=window.PLOTLYENV || {}; if (document.getElementById("5a0806d5-3da7-4c16-af56-b5fd7c6a67cb")) { Plotly.newPlot("5a0806d5-3da7-4c16-af56-b5fd7c6a67cb", [{"mode":"lines","name":"Simple Line","x":["2023-01-01T00:00:00","2023-01-02T00:00:00","2023-01-03T00:00:00","2023-01-04T00:00:00","2023-01-05T00:00:00","2023-01-06T00:00:00","2023-01-07T00:00:00","2023-01-08T00:00:00","2023-01-09T00:00:00","2023-01-10T00:00:00"],"y":[1,2,3,4,5,6,5,4,3,2],"type":"scatter"}], ...
I’ve seen a few posts that seem somewhat similar, but I thought I’d add some more details to the bug.
Any thoughts?
Hello there 👋. I appreciate there are probably lots of bugs that have higher priority than this one, but I just wanted to see if anyone had any thoughts on this? Did anyone else manage to reproduce it?