Skip to content

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

Open
@ndrezn

Description

@ndrezn

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2considered for next cyclebugsomething broken

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions