Skip to content

Commit 3c2f49a

Browse files
committed
Merge remote-tracking branch 'origin/master' into v4.0
2 parents de217ae + 8965c3d commit 3c2f49a

48 files changed

Lines changed: 2525 additions & 1489 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
outputs:
2424
stackgl_modules: ${{ steps.check.outputs.stackgl_modules }}
2525
topojson: ${{ steps.check.outputs.topojson }}
26+
regl_codegen: ${{ steps.check.outputs.regl_codegen }}
2627
steps:
2728
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2829
with:
@@ -42,6 +43,12 @@ jobs:
4243
if git diff --name-only "$BASE"...HEAD -- stackgl_modules/ | grep -q .; then
4344
echo "stackgl_modules=true" >> "$GITHUB_OUTPUT"
4445
fi
46+
# If any of the directories listed below have changed, we need to re-run the regl-codegen step
47+
# stackgl_modules/ is listed here too because the regl-* shader libs live there;
48+
# changes can alter shader output and require regenerating the precompiled shaders.
49+
if git diff --name-only "$BASE"...HEAD -- src/traces/scattergl/ src/traces/scatterpolargl/ src/traces/splom/ src/traces/parcoords/ src/lib/prepare_regl.js stackgl_modules/ devtools/regl_codegen/ | grep -q .; then
50+
echo "regl_codegen=true" >> "$GITHUB_OUTPUT"
51+
fi
4552
4653
# ============================================================
4754
# Root build job - all dependent jobs fan out from here
@@ -636,3 +643,54 @@ jobs:
636643
name: topojson-dist
637644
retention-days: 7
638645
path: topojson/dist/
646+
647+
check-regl-codegen:
648+
needs: [detect-changes, install-and-cibuild]
649+
if: >-
650+
(github.event_name == 'push' && github.ref_name == github.event.repository.default_branch) ||
651+
needs.detect-changes.outputs.regl_codegen == 'true'
652+
runs-on: ubuntu-latest
653+
timeout-minutes: 10
654+
steps:
655+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
656+
- uses: ./.github/actions/setup-workspace
657+
- uses: ./.github/actions/setup-chrome
658+
659+
- name: Run regl codegen
660+
run: |
661+
# Wipe the codegen output dir so orphaned shader files surface as deletions in the diff below.
662+
rm -rf src/generated/regl-codegen/*
663+
node devtools/regl_codegen/server.mjs &
664+
SERVER_PID=$!
665+
until curl -sf -o /dev/null http://localhost:3000/build/regl_codegen-bundle.js 2>/dev/null; do
666+
sleep 1
667+
done
668+
$CHROME_BIN --headless=new --no-sandbox --enable-unsafe-swiftshader --ignore-gpu-blocklist http://localhost:3000/devtools/regl_codegen/index.html &
669+
wait $SERVER_PID
670+
671+
- name: Check regl precompiled shaders are up to date
672+
run: |
673+
# git add -N so newly-generated (untracked) shader files show up in git diff
674+
git add -N src/generated/regl-codegen/
675+
if ! git diff --exit-code \
676+
src/generated/regl-codegen/ \
677+
src/traces/scattergl/regl_precompiled.js \
678+
src/traces/scatterpolargl/regl_precompiled.js \
679+
src/traces/splom/regl_precompiled.js \
680+
src/traces/parcoords/regl_precompiled.js; then
681+
echo "::error::Regl precompiled shaders are out of date. Download the 'regl-codegen' artifact from this workflow run, extract it into src/, and commit the updated files to this pull request."
682+
exit 1
683+
fi
684+
685+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
686+
name: Upload updated regl codegen files
687+
if: failure()
688+
with:
689+
name: regl-codegen
690+
retention-days: 7
691+
path: |
692+
src/generated/regl-codegen/
693+
src/traces/scattergl/regl_precompiled.js
694+
src/traces/scatterpolargl/regl_precompiled.js
695+
src/traces/splom/regl_precompiled.js
696+
src/traces/parcoords/regl_precompiled.js

.github/workflows/upload-dev-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
GH_TOKEN: ${{ github.token }}
4040
GH_EVENT_NAME: ${{ github.event_name }}
4141
GH_REPO: ${{ github.repository }}
42-
SHA: ${{ github.event.workflow_run.sha }}
42+
SHA: ${{ github.event.workflow_run.head_sha }}
4343
RUN_ID: ${{ github.event.workflow_run.id }}
4444
PR_NUM: ${{ github.event.workflow_run.pull_requests[0].number || inputs.pr_number }}
4545
run: |

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ To see all merged commits on the master branch that will be part of the next plo
99

1010
where X.Y.Z is the semver of most recent plotly.js release.
1111

12+
## [3.6.0] -- 2026-06-01
13+
14+
### Added
15+
- Add support for arrays for the pie property `legendrank`, so that it can be configured per slice [[#7723](https://github.com/plotly/plotly.js/pull/7723)], with thanks to @my-tien for the contribution!
16+
- Add `hoversort` layout attribute to sort unified hover label items by value [[#7734](https://github.com/plotly/plotly.js/pull/7734)], with thanks to @kimsehwan96 for the contribution!
17+
18+
### Fixed
19+
- Fix unexpected `ticklabelindex` behavior when minor ticks are not shown [[#7735](https://github.com/plotly/plotly.js/pull/7735)], with thanks to @my-tien for the contribution!
20+
- Fix issue where `hoveranywhere` / `clickanywhere` would not emit hover and click events over editable shapes [[#7788](https://github.com/plotly/plotly.js/pull/7788)]
21+
- Handle 'pixel' size mode for shape labels [[#7790](https://github.com/plotly/plotly.js/pull/7790)]
22+
- Update box plot defaults to fix issue with calling `Plotly.react` to switch from box to violin plot [[#7811](https://github.com/plotly/plotly.js/pull/7811)]
23+
- Include shapes with `legendgroup` specified when handling legend visibility toggling [[#7813](https://github.com/plotly/plotly.js/pull/7813)]
24+
25+
1226
## [3.5.1] -- 2026-05-01
1327

1428
### Changed

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ authors:
99
- family-names: "Samimi"
1010
given-names: "Mojtaba"
1111
title: "Open source Plotly charting library"
12-
version: 3.5.1
12+
version: 3.6.0
1313
doi: 10.5281/zenodo.13964707
14-
date-released: 2026-05-01
14+
date-released: 2026-06-01
1515
url: "https://github.com/plotly/plotly.js"

CONTRIBUTING.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,54 @@ npm run schema
163163
#### Step 9: REGL - Review & commit potential changes to precompiled regl shaders
164164

165165
If you are implementing a new feature that involves regl shaders, or if you are
166-
making changes that affect the usage of regl shaders, you would need to run
166+
making changes that affect the usage of regl shaders, you will need to regenerate the precompiled regl shader code. In practice, that means edits under:
167167

168-
```bash
169-
npm run regl-codegen
170-
```
168+
- `src/traces/{scattergl,scatterpolargl,splom,parcoords}/`
169+
- `src/lib/prepare_regl.js`
170+
- `stackgl_modules/` (where the `regl-*` shader libs live)
171+
- `devtools/regl_codegen/`
171172

172-
to regenerate the regl code. This will prompt you to open a browser window. This will then run through all
173-
traces with 'regl' in the tags, and store the captured code into
174-
[src/generated/regl-codegen](https://github.com/plotly/plotly.js/blob/master/src/generated/regl-codegen). If no updates are necessary, it will be a no-op, but if there are changes, you will need to commit them.
173+
CI's `check-regl-codegen` job uses this same list as its trigger — see [`.github/workflows/ci.yml`](.github/workflows/ci.yml) for the authoritative version.
175174

176175
This is needed because regl performs codegen in runtime which breaks CSP
177176
compliance, and so for strict builds we pre-generate regl shader code here.
178177

178+
The CI pipeline will automatically detect when regl-related files have changed and
179+
run the codegen process. If the precompiled shaders are out of date, the
180+
`check-regl-codegen` job will fail and upload a `regl-codegen` artifact containing
181+
the updated files. The artifact represents the full desired state of the codegen
182+
output (CI wipes the output directory before regenerating, so any orphaned shader
183+
files are pruned). To fix this:
184+
185+
1. Download the `regl-codegen` artifact from the failed workflow run
186+
2. Delete `src/generated/regl-codegen/` in your working tree, then unzip the
187+
artifact into `src/` so it replaces (rather than merges into) the existing
188+
directory. Note that `actions/upload-artifact` strips the longest common
189+
parent path from the uploaded paths, so the zip's root contains
190+
`generated/regl-codegen/` and `traces/{scattergl,scatterpolargl,splom,parcoords}/regl_precompiled.js`
191+
directly — extracting into `src/` restores the correct layout and
192+
overwrites the four `regl_precompiled.js` files in one step.
193+
3. Commit and push the changes to your pull request
194+
195+
Alternatively, you can regenerate the code locally:
196+
197+
```bash
198+
rm -rf src/generated/regl-codegen/*
199+
npm run regl-codegen
200+
```
201+
202+
The `rm -rf` step is needed to clean up any orphaned shader files left over from
203+
previous changes. `npm run regl-codegen` will prompt you to open
204+
a browser window, run through the mocks for each regl-using trace
205+
(`parcoords`, `scattergl`, `scatterpolargl`, `splom`), and store the captured
206+
shader code into
207+
[src/generated/regl-codegen](https://github.com/plotly/plotly.js/blob/master/src/generated/regl-codegen).
208+
The four `src/traces/{parcoords,scattergl,scatterpolargl,splom}/regl_precompiled.js`
209+
files are rewritten in the same pass so their imports point at the freshly
210+
generated shader files. Commit any changes that result — both the
211+
`src/generated/regl-codegen/` updates and any modified `regl_precompiled.js`
212+
files.
213+
179214
#### Other npm scripts that may be of interest in development
180215

181216
- `npm run preprocess`: pre-processes the css and svg source file in js. This

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
6262
6363
```html
6464
<head>
65-
<script src="https://cdn.plot.ly/plotly-3.5.1.min.js" charset="utf-8"></script>
65+
<script src="https://cdn.plot.ly/plotly-3.6.0.min.js" charset="utf-8"></script>
6666
</head>
6767
<body>
6868
<div id="gd"></div>
@@ -79,7 +79,7 @@ You may also consider using [`plotly.js-dist`](https://www.npmjs.com/package/plo
7979
Alternatively, you may consider using [native ES6 import](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) in the script tag.
8080
```html
8181
<script type="module">
82-
import "https://cdn.plot.ly/plotly-3.5.1.min.js"
82+
import "https://cdn.plot.ly/plotly-3.6.0.min.js"
8383
Plotly.newPlot("gd", [{ y: [1, 2, 3] }])
8484
</script>
8585
```
@@ -89,7 +89,7 @@ Fastly supports Plotly.js with free CDN service. Read more at <https://www.fastl
8989
### Un-minified versions are also available on CDN
9090
While non-minified source files may contain characters outside UTF-8, it is recommended that you specify the `charset` when loading those bundles.
9191
```html
92-
<script src="https://cdn.plot.ly/plotly-3.5.1.js" charset="utf-8"></script>
92+
<script src="https://cdn.plot.ly/plotly-3.6.0.js" charset="utf-8"></script>
9393
```
9494

9595
> Please note that as of v2 the "plotly-latest" outputs (e.g. https://cdn.plot.ly/plotly-latest.min.js) will no longer be updated on the CDN, and will stay at the last v1 patch v1.58.5. Therefore, to use the CDN with plotly.js v2 and higher, you must specify an exact plotly.js version.

devtools/regl_codegen/server.mjs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,20 @@ function handleCodegen(data) {
8585
var exports = ['', '/* eslint-disable quote-props */', 'module.exports = {', ''].join('\n');
8686
var varId = 0;
8787

88-
Object.entries(generated).forEach(function (kv) {
89-
var key = kv[0];
90-
var value = kv[1];
91-
var filePath = path.join(pathToReglCodegenSrc, key);
92-
fs.writeFileSync(filePath, 'module.exports = ' + value);
93-
94-
imports += 'var v' + varId + " = require('../../" + path.join(constants.reglCodegenSubdir, key) + "');\n";
95-
exports += " '" + key + "': v" + varId + ',\n';
96-
varId++;
97-
});
88+
// Sort by shader-hash key so the emitted import/export order is deterministic
89+
// across machines (fs.readdir mock order varies by OS/filesystem, which would
90+
// otherwise leak into regl_precompiled.js).
91+
Object.keys(generated)
92+
.sort()
93+
.forEach((key) => {
94+
var value = generated[key];
95+
var filePath = path.join(pathToReglCodegenSrc, key);
96+
fs.writeFileSync(filePath, 'module.exports = ' + value);
97+
98+
imports += 'var v' + varId + " = require('../../" + path.join(constants.reglCodegenSubdir, key) + "');\n";
99+
exports += " '" + key + "': v" + varId + ',\n';
100+
varId++;
101+
});
98102

99103
if (varId > 0) {
100104
exports = exports.slice(0, -2) + '\n};\n';

dist/README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ The main plotly.js bundles weight in at:
4646
| 10.7 MB | 4.6 MB | 1.4 MB | 11 MB |
4747

4848
#### CDN links
49-
> https://cdn.plot.ly/plotly-3.5.1.js
49+
> https://cdn.plot.ly/plotly-3.6.0.js
5050
51-
> https://cdn.plot.ly/plotly-3.5.1.min.js
51+
> https://cdn.plot.ly/plotly-3.6.0.min.js
5252
5353

5454
#### npm packages
@@ -91,12 +91,12 @@ The `basic` partial bundle contains trace modules `bar`, `pie` and `scatter`.
9191

9292
| Raw size | Minified size | Minified + gzip size |
9393
|------|-----------------|------------------------|
94-
| 2.7 MB | 1.1 MB | 364.8 kB |
94+
| 2.7 MB | 1.1 MB | 365.3 kB |
9595

9696
#### CDN links
97-
> https://cdn.plot.ly/plotly-basic-3.5.1.js
97+
> https://cdn.plot.ly/plotly-basic-3.6.0.js
9898
99-
> https://cdn.plot.ly/plotly-basic-3.5.1.min.js
99+
> https://cdn.plot.ly/plotly-basic-3.6.0.min.js
100100
101101

102102
#### npm packages
@@ -114,12 +114,12 @@ The `cartesian` partial bundle contains trace modules `bar`, `box`, `contour`, `
114114

115115
| Raw size | Minified size | Minified + gzip size |
116116
|------|-----------------|------------------------|
117-
| 3.4 MB | 1.4 MB | 463 kB |
117+
| 3.4 MB | 1.4 MB | 463.5 kB |
118118

119119
#### CDN links
120-
> https://cdn.plot.ly/plotly-cartesian-3.5.1.js
120+
> https://cdn.plot.ly/plotly-cartesian-3.6.0.js
121121
122-
> https://cdn.plot.ly/plotly-cartesian-3.5.1.min.js
122+
> https://cdn.plot.ly/plotly-cartesian-3.6.0.min.js
123123
124124

125125
#### npm packages
@@ -137,12 +137,12 @@ The `geo` partial bundle contains trace modules `choropleth`, `scatter` and `sca
137137

138138
| Raw size | Minified size | Minified + gzip size |
139139
|------|-----------------|------------------------|
140-
| 3 MB | 1.2 MB | 415.2 kB |
140+
| 3 MB | 1.2 MB | 415.7 kB |
141141

142142
#### CDN links
143-
> https://cdn.plot.ly/plotly-geo-3.5.1.js
143+
> https://cdn.plot.ly/plotly-geo-3.6.0.js
144144
145-
> https://cdn.plot.ly/plotly-geo-3.5.1.min.js
145+
> https://cdn.plot.ly/plotly-geo-3.6.0.min.js
146146
147147

148148
#### npm packages
@@ -160,12 +160,12 @@ The `gl3d` partial bundle contains trace modules `cone`, `isosurface`, `mesh3d`,
160160

161161
| Raw size | Minified size | Minified + gzip size |
162162
|------|-----------------|------------------------|
163-
| 4.2 MB | 1.6 MB | 527.4 kB |
163+
| 4.2 MB | 1.6 MB | 527.9 kB |
164164

165165
#### CDN links
166-
> https://cdn.plot.ly/plotly-gl3d-3.5.1.js
166+
> https://cdn.plot.ly/plotly-gl3d-3.6.0.js
167167
168-
> https://cdn.plot.ly/plotly-gl3d-3.5.1.min.js
168+
> https://cdn.plot.ly/plotly-gl3d-3.6.0.min.js
169169
170170

171171
#### npm packages
@@ -183,12 +183,12 @@ The `gl2d` partial bundle contains trace modules `parcoords`, `scatter`, `scatte
183183

184184
| Raw size | Minified size | Minified + gzip size |
185185
|------|-----------------|------------------------|
186-
| 3.8 MB | 1.5 MB | 521.2 kB |
186+
| 3.8 MB | 1.5 MB | 521.8 kB |
187187

188188
#### CDN links
189-
> https://cdn.plot.ly/plotly-gl2d-3.5.1.js
189+
> https://cdn.plot.ly/plotly-gl2d-3.6.0.js
190190
191-
> https://cdn.plot.ly/plotly-gl2d-3.5.1.min.js
191+
> https://cdn.plot.ly/plotly-gl2d-3.6.0.min.js
192192
193193

194194
#### npm packages
@@ -206,12 +206,12 @@ The `mapbox` partial bundle contains trace modules `choroplethmapbox`, `densitym
206206

207207
| Raw size | Minified size | Minified + gzip size |
208208
|------|-----------------|------------------------|
209-
| 4.5 MB | 1.9 MB | 580.1 kB |
209+
| 4.5 MB | 1.9 MB | 580.7 kB |
210210

211211
#### CDN links
212-
> https://cdn.plot.ly/plotly-mapbox-3.5.1.js
212+
> https://cdn.plot.ly/plotly-mapbox-3.6.0.js
213213
214-
> https://cdn.plot.ly/plotly-mapbox-3.5.1.min.js
214+
> https://cdn.plot.ly/plotly-mapbox-3.6.0.min.js
215215
216216

217217
#### npm packages
@@ -229,12 +229,12 @@ The `finance` partial bundle contains trace modules `bar`, `candlestick`, `funne
229229

230230
| Raw size | Minified size | Minified + gzip size |
231231
|------|-----------------|------------------------|
232-
| 2.9 MB | 1.2 MB | 398.5 kB |
232+
| 2.9 MB | 1.2 MB | 398.9 kB |
233233

234234
#### CDN links
235-
> https://cdn.plot.ly/plotly-finance-3.5.1.js
235+
> https://cdn.plot.ly/plotly-finance-3.6.0.js
236236
237-
> https://cdn.plot.ly/plotly-finance-3.5.1.min.js
237+
> https://cdn.plot.ly/plotly-finance-3.6.0.min.js
238238
239239

240240
#### npm packages
@@ -255,9 +255,9 @@ The `strict` partial bundle contains trace modules `bar`, `barpolar`, `box`, `ca
255255
| 11.5 MB | 4.9 MB | 1.5 MB |
256256

257257
#### CDN links
258-
> https://cdn.plot.ly/plotly-strict-3.5.1.js
258+
> https://cdn.plot.ly/plotly-strict-3.6.0.js
259259
260-
> https://cdn.plot.ly/plotly-strict-3.5.1.min.js
260+
> https://cdn.plot.ly/plotly-strict-3.6.0.min.js
261261
262262

263263
#### npm packages

0 commit comments

Comments
 (0)