Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plotly v6 does not showing in HTML with some JS conflict #12061

Open
cderv opened this issue Feb 11, 2025 · 2 comments
Open

Plotly v6 does not showing in HTML with some JS conflict #12061

cderv opened this issue Feb 11, 2025 · 2 comments
Assignees
Labels
bug Something isn't working jupyter upstream Bug is in upstream library
Milestone

Comments

@cderv
Copy link
Collaborator

cderv commented Feb 11, 2025

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:

Image

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.

@cderv cderv added bug Something isn't working jupyter labels Feb 11, 2025
@cderv cderv added this to the v1.7 milestone Feb 11, 2025
@mcanouil
Copy link
Collaborator

mcanouil commented Feb 12, 2025

From plotly, the main change that is likely the source of the issue:

Change to anywidget for go.FigureWidget
go.FigureWidget now uses anywidget.

(notebook >= 7 is now required)

Source: https://plotly.com/python/v6-migration/

@cderv
Copy link
Collaborator Author

cderv commented Feb 12, 2025

For reference similar issue with .ipynb in Positron

which points to broader plotly issue

@cderv cderv added the upstream Bug is in upstream library label Feb 12, 2025
@cderv cderv self-assigned this Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jupyter upstream Bug is in upstream library
Projects
None yet
Development

No branches or pull requests

2 participants