Skip to content

If _repr_html_ is invoked, plotly in some cases tries to open a webbrowser #4162

Closed
@bartbroere

Description

@bartbroere

When I'm trying to use plotly from Starboard Notebook (a notebook implementation that uses Pyodide as an interpreter), the _repr_html_ method crashes.

I have attached this notebook to illustrate the issue interactively

I also have some ideas on how to fix this.

  1. We could no longer have the renderers fall back to opening a webbrowser, or at least be a bit more forgiving when it fails to open a webbrowser for some reason. This PR implements that solution: Be more forgiving when anything with opening a webbrowser fails #4161
  2. We could instantiate the class of _repr_html_ with some parameters that it can use later. This helps make its behaviour more configurable from a notebook context. I could make a PR to achieve this.
  3. We could no longer invoke self._repr_mimebundle_() in _repr_html_ here: basedatatypes.py#L804-L812. I think this would fix the issue for Starboard, but it might create problems for one of the many special cases that are in _renderers.py. This would be my third choice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions