Skip to content

Upgrade bundled plotly.js to 4.x #6327

Description

@falkoschindler

Motivation

The upgrade removes trace types and changes defaults, so it is a breaking change for NiceGUI users and belongs in 4.0.

We currently bundle plotly.js 3.1.1 in nicegui/elements/plotly. Two reasons to move to 4.x:

Implementation

  • Bump plotly.js in nicegui/elements/plotly/package.json to the first 4.x release that includes maplibre-gl >= 6.4.1, rebuild dist/, regenerate DEPENDENCIES.md.
  • Relax the plotly extra to allow plotly.py 7.x.
  • Check the documentation demos, especially the map demos, against the changed defaults.
  • Mention the breaking changes in the release notes, including the new "Share chart" modebar button (plotly.js and plotly.py 7 both enable it by default; users who don't want it pass config={'showSendToCloud': False}).

Breaking changes for users (from the plotly.js 4.0.0 release notes)

  • scattermapbox, choroplethmapbox, densitymapbox traces, the mapbox subplot and mapboxAccessToken are removed; use the *map equivalents.
  • Color parsing switched from TinyColor to culori: rgb() with 0-1 fractions and hsv() strings are no longer accepted, invalid CSS color strings are rejected, rgb() now accepts an alpha channel.
  • layout.geo.fitbounds defaults to 'locations'; scattermap and densitymap auto-fit center and zoom unless layout.map.fitbounds is set to false.
  • MathJax v2 is no longer supported (v3 and v4 are).
  • splom.axis.matches defaults to true; overlaying axes default to tickmode: 'sync'.
  • hoveranywhere / clickanywhere events return actual data values for xvals / yvals (strings for date and category axes).

Progress

  • Wait for a plotly.js 4.x release that includes maplibre-gl >= 6.4.1
  • Bump plotly.js, rebuild dist, regenerate DEPENDENCIES.md
  • Relax the plotly extra to <8.0
  • Verify documentation demos
  • Release notes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesType/scope: Third party libraries

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions