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

Automatically set correct renderer for Plotly charts in VSCode Notebooks #4827

Open
ndrezn opened this issue Oct 24, 2024 · 1 comment
Open
Labels
bug something broken P2 considered for next cycle

Comments

@ndrezn
Copy link
Member

ndrezn commented Oct 24, 2024

Because microsoft/vscode-notebook-renderers#199 is unmerged, users of Plotly.py using the VSCode notebooks cannot access the latest Plotly.js/Plotly.py features and no discernible error message is provided. This leads to confusion, because users are working with the latest version of Plotly.py and their charts don't work properly.

This has caused issues for adoption of new features like MapLibre and subtitles in charts, and may others. See e.g.:

Developers can workaround this by adding to their notebook:

import plotly.io as pio
pio.renderers.default = "notebook_connected"

While this is trivial to change, it's undiscoverable and non-intuitive. If you have the latest version of Plotly.py installed, you should be able to use the latest features in any Python environment!

Regardless of whether microsoft/vscode-notebook-renderers#199 is merged, this dependency means VSCode Notebook users will always lag behind Plotly.py releases as we wait for VSCode to adopt and release their own updates, which means VSCode users would never have day-of updates without a workaround 🙁

Is it possible to detect that we're in a VSCode Notebook environment and automatically set the correct renderer to avoid this dependency on a VSCode update?

@LiamConnors
Copy link
Member

This is still an issue when installing the rc. It means that in some environments that include an earlier version of Plotly.js, you'll see the deprecation warnings for mapbox maps saying to use map maps but those ones won't render.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P2 considered for next cycle
Projects
None yet
Development

No branches or pull requests

3 participants