Repository navigation
chore(deps): upgrade plotly.js to 4.1.1 - #105
Merged
Merged
Conversation
This was referenced Sep 27, 2026
Merged
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #90.
Change
[email protected]), not fromcdn.plot.ly. The file is byte-identical (same SHA-256). jsDelivr already serves gridstack, ECharts, marked and DOMPurify.Plotly.Fx.hovershows no label for a heatmap[row, col]pointNumber(plotly.js #7882 readscd[pointNumber]). No product code callsFx.hover.Architecture.md, the adapter docstring, a test docstring andCHANGELOG.mdare updated.I picked 4.1.1, not 4.0.0. 4.1.1 bundles maplibre-gl 6.9.0, which fixes the critical XSS CVE-2026-85061. 4.0.0 and 3.0.0 bundle a vulnerable maplibre.
Breaking changes from 3.0.0 to 4.1.1
transparent,none, commargba(). User colors pass through:rgb()values from 0 to 1 now draw almost black,hsv()is not accepted. In the changelog.mapboxtraces removedchoroplethmapandscattermapon themapsubplot.tickmode,geo.fitbounds,splom.matches,hoveranywherevalues, Chart Studio config keys,*srcattributesdisplayModeBar: false.selectionsGUI edits map toselectionrevisionuirevision, so ourlayout.selectionsstill wins onPlotly.react. The "Unrecognized GUI edit" warnings stop.The Plotly internals that the adapter reads all exist in 4.1.1:
_fullLayout._activeSelectionIndex,_fullLayout.selections, themap._derivedrelayout key, axis_length,Plotly.Plots.resize, and thewindow.Plotlyglobal.Plotly.reactstill does one render per call (no full replot when the config is unchanged).Performance
Measured on an M5 MacBook with headless Chromium. Cold browser context per run, versions alternate, median of 10 runs (6 at 4x throttle). The bundle is served locally for the CPU numbers, so only plotly.js differs.
Network (Plotly script, what a browser downloads):
cache-controlcache-controlmax-age=1y, immutableReal network, 5-figure dashboard: TTFR 569 ms on main, 558 ms on this branch (the ranges overlap).
CPU, 10-figure dashboard with 2 map figures (1x CPU):
Plotly.reactThe 8 non-map figures render in the same time (±1 ms). Each map figure takes about 20 ms more (about 60 ms at 4x CPU). 4.0.0 already adds about 16 ms of this, so the cost comes from the maplibre update. The security fix needs maplibre v6.
Dashboard without map figures: time to first render 490 → 483 ms, main-thread time 382 → 377 ms, script parse and run 372 → 362 ms. No regression.
Tests
make test: 2390 passed, 2 skipped.ruff format --checkandruff checkare clean.make test-browser: 316 passed, 12 skipped. The test that the first commit changes passes on 3.0.0 and 4.1.1.histogram2d,geo_histogram2d,geo_line,corr_heatmap) under 3.0.0 and 4.1.1 gives the same traces, and zoom, pie click and re-click, treemap click and map pan behave the same. 4.1.1 logs no console errors. The map attribution control now draws correctly (3.0.0 put a large broken attribution line below each map).plotly_selected.