-
Notifications
You must be signed in to change notification settings - Fork 381
Closed
Labels
bugSomething isn't workingSomething isn't workingjupyterupstreamBug is in upstream libraryBug is in upstream library
Milestone
Description
Simple example for basic plotly example with new plotly 6.
https://plotly.com/python/figure-structure/
---
format: html
jupyter: python3
---
```{python}
import plotly.express as px
fig = px.line(x=["a","b","c"], y=[1,3,2], title="sample figure")
fig.show()
```
Error in browser console are:
plotly-3.0.0.min.js:21 Uncaught TypeError: kP.select is not a function
at Ehe (plotly-3.0.0.min.js:21:259206)
at Object.Yft [as _doPlot] (plotly-3.0.0.min.js:21:255283)
at Object.Qft [as newPlot] (plotly-3.0.0.min.js:21:260707)
at index.html:102:444
Using plotly 5.24, it works ok. So something changed in plotly that makes rendering with Quarto fails.
gordonwoodhull, runjak, daeh, ritsuki1227, rwright88 and 4 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingjupyterupstreamBug is in upstream libraryBug is in upstream library
Type
Projects
Relationships
Development
Select code repository
Activity
mcanouil commentedon Feb 12, 2025
From
plotly
, the main change that is likely the source of the issue:(
notebook
>= 7 is now required)Source: https://plotly.com/python/v6-migration/
cderv commentedon Feb 12, 2025
For reference similar issue with .ipynb in Positron
which points to broader plotly issue
danilotpnta-elsevier commentedon Mar 8, 2025
You can use
pio.renderers.default = "iframe"
and it renders for me. For instance:Schniszl commentedon Mar 10, 2025
I had the same Issue but with
pio.renderers.default = "iframe
I only get the last plot rendered in the HTML export, but multiple times.I plot like 10 times different data with the same plot and it's 10 times the same image in the export, so I fixed it manually by using
pio.renderers.default = "iframe+browser"
and then after running the notebook I downloaded all the HTML files manually and linked them in the HTML code of the Notebook export, for sure there's a better way to do that but I really had to send something out today and didn't want to waist more time searching for solutions.Anyone got an Idea why I always get the same Plot multiple times in the export?
In the Notebook in VS code it looks fine when I use
pio.renderers.default = "plotly_mimetype+notebook_connected"
and the plots opening in the browser with the browser option are correct aswell.I'm exporting with
jupyter nbconvert --to html --no-input myNotebook.ipynb
cderv commentedon Mar 18, 2025
This is now solved in plotly. Quarto works when using plotly.py 6.0.1
See comments in