Skip to content

Migrate to plotly.js 4.x (removes the mapbox traces rx.plotly.mapbox wraps) #7002

Closed

Description

@masenf

plotly.js 4.0.0 (released 2026-08-24) is a breaking major that reflex-components-plotly cannot take as a straight version bump. The pin is currently held at [email protected], and plotly.js is filtered out of the release branch's outdated-dependency check with a pointer to this issue's problem.

Why it's blocked

plotly.js 4.0.0 removes the mapbox traces and the mapbox subplot outright:

  • scattermapbox, choroplethmapbox, and densitymapbox trace types are gone
  • the mapbox subplot and the mapboxAccessToken config option are gone
  • upstream's guidance is to migrate to the equivalent *map traces (scattermap, choroplethmap, densitymap), which are MapLibre-based and need no access token

Reflex ships PlotlyMapbox in packages/reflex-components-plotly/src/reflex_components_plotly/plotly.py, built on the plotly.js-mapbox-dist-min bundle. That bundle and the component both need a deprecation path before the pin can move.

Other 4.0.0 changes worth checking while migrating:

  • MathJax v2 support dropped (v3/v4 only)
  • Chart Studio config attributes removed: showLink, linkText, sendData, showSources
  • all *src attributes and layout.hidesources removed from the schema
  • color processing switched from TinyColor to culori, which changes decimal-fraction handling in rgb()/rgba() strings and now rejects invalid CSS colors
  • overlaying axes default to tickmode: 'sync'; splom.axis.matches defaults to true; geo plots auto-fit to trace data
  • minimum Node raised to 22 (already satisfied — Node.MIN_VERSION is 22.22.0)

What needs doing

  • Deprecate PlotlyMapbox per the project's deprecation policy (console.deprecate() with a deprecation_version of the next dot version, removal_version of the next major), pointing users at a *map-based replacement
  • Add the replacement component backed by one of the 4.x map bundles
  • Bump plotly.js* pins in plotly.py to 4.x, including the per-variant plotly.js-*-dist-min bundles (confirm each variant still exists in 4.x)
  • Audit the docs app's plotly usage for the removed config attributes and color-string forms
  • Drop plotly\.js from the frontend ignore list in .github/workflows/check_outdated_dependencies.yml

Notes

react-plotly.js was already moved to 4.1.0 separately — its peer range is plotly.js >=3.0.0, so it is compatible with the 3.7.0 pin in the meantime and is not part of this migration.

Upstream changelog: https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions