plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Plots from Colab don’t show in Nbviewer

Open mklilley opened this issue 5 months ago • 1 comments

I posted this on the plotly community forum but so far got no traction so I'm reporting this here.

  • What I did:
  • 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:462 in 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?

mklilley avatar Aug 10 '25 19:08 mklilley

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?

mklilley avatar Nov 03 '25 09:11 mklilley