Repository navigation
feat(plotly)!: migrate maps to plotly.js 4 - #7408
Conversation
Add a MapLibre component and retain the deprecated Mapbox bundle during migration. Upgrade the supported bundles and locales, document compatibility changes and cover both renderers in development and production.
[High impact] The PR appears safe to merge with the documented migration limits. SummaryThis PR adds MapLibre maps, upgrades Plotly.js to 4.3.0, and keeps older Mapbox figures rendering through a temporary rename.
kr1shna-exe documents the accepted limits: old Mapbox paths in controls and templates are not translated, and Mapbox-hosted styles no longer load. The latest edits make those limits clearer. No new actionable issues found. Reviews (13) · Last reviewed commit: "docs(plotly): list the Mapbox code that ..." · Reviewed by Greptile |
Merging this PR will improve performance by 6.83%2 warnings
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
View guided diff | Re-trigger cubic
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
Comments Outside DiffThese findings could not be posted inline.
|
mergician threw on a null figure, so a state figure that starts as None crashed the page whenever layout or the default template was merged. Fall back to an empty object and cover the default template in the migration warning test.
# Conflicts: # docs/app/reflex.lock/bun.lock # docs/app/reflex.lock/package.json # packages/reflex-components-plotly/src/reflex_components_plotly/__init__.py # pyi_hashes.json
Pin every Plotly.js 4 bundle, the locales and the docs lockfile to the current 4.3.0 so the outdated-dependency check does not flag them once the hold is gone. Date the rx.plotly.mapbox deprecation to 0.11.1, the next release after v0.11.0, and fold the Mapbox browser warning note into the breaking-change fragment.
Drop the Plotly.js 3.7 Mapbox bundle. The deprecated rx.plotly.mapbox now loads [email protected] and renames Mapbox traces, subplot references and layout.mapbox keys to their MapLibre names until its removal in 1.0.
There was a problem hiding this comment.
All reported issues were addressed across 7 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
View guided diff | Re-trigger cubic
Move the rename into PlotlyMapbox so subclasses keep it, and walk the whole figure: templates, animation frames and button arguments now use MapLibre names too. Compare full strings in the plotly tests.
There was a problem hiding this comment.
All reported issues were addressed across 6 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
The default rx.plotly and its variants now detect Mapbox traces or layout.mapbox keys, log one browser warning and rename the figure to MapLibre names, the same as rx.plotly.mapbox. Mapbox figures keep rendering until removal in 1.0.
There was a problem hiding this comment.
All reported issues were addressed across 7 files (changes from recent commits).
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
View guided diff | Re-trigger cubic
Replace the deep walk with a rename of trace types, subplot references and layout keys in the figure and its animation frames. Templates, geojson, customdata, frame names and button arguments keep the user's names.
There was a problem hiding this comment.
All reported issues were addressed across 5 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Summary
Closes #7002.
Plotly.js 4 removes the Mapbox traces used by
rx.plotly.mapbox. Addrx.plotly.mapfor MapLibre figures and upgrade all bundles to 4.3.0. Existing Mapbox figures keep rendering inrx.plotly,rx.plotly.mapandrx.plotly.mapboxthrough a rename until 1.0, so the app loads one Plotly.js version.What changed
rx.plotly.mapboxand Mapbox figures in Reflex 0.11.1 with removal scheduled for 1.0.rx.plotly.mapboxloads[email protected]; Plotly.js 3.7.0 is no longer a dependency.layout.mapbox*keys, including state updates. On a match it logs one browser warning and passes Plotly a copy with MapLibre trace types (scattermapbox→scattermap, etc.), subplot references andlayout.mapbox*keys, in the figure and its animation frames. The user's figure is not changed. Templates,geojson,customdataand button arguments keep their names. Figures without Mapbox names pass through unchanged, so the warning stops once the user migrates.Nonestate figure whenlayoutor the default template is set;mergicianthrew onnulland crashed the page (also on main).Verification
a19690c: 11,263 passed and 158 skipped with 73.75% coverage. The review follow-up passes all 20 focused unit tests; all 9 Node-dependent cases skip cleanly when Node.js is unavailable.rx.plotly.mapbox(literal, state, density, choropleth, two-subplot,fr, animatedpx.scatter_mapbox, relayout buttons) and defaultrx.plotly(literal, state, mixed map + bar) Mapbox plots, rerun in the same folder on this branch. All eleven render with the same center, zoom, size, locale, click result and animation; buttons withmapbox.*relayout paths no longer act, as documented;.web/package.jsonkeeps only Plotly.js 4.3.0.pyright reflex testsand changed-file pre-commit hooks passed.Deployment notes
All renderers use Plotly.js 4. Mapbox figures keep rendering through the rename until 1.0 and should migrate to MapLibre traces and
layout.map. This is still a breaking change for some Mapbox code: Mapbox paths in buttons, sliders and templates no longer act,on_relayoutdata usesmap.*keys, styles hosted by Mapbox (mapbox://URLs) do not load and the access token is ignored. The docs list these changes. The migration guide also covers removed MathJax 2 support, Chart Studio options, source-reference attributes and changed rendering defaults.