Skip to content

Commit f98b2f1

Browse files
committed
Merge remote-tracking branch 'origin/master' into cam/7678/enable-typescript-type-checking
2 parents 504aa33 + c201dd1 commit f98b2f1

45 files changed

Lines changed: 3152 additions & 1934 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/publish-dist.yml

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,41 +16,6 @@ concurrency:
1616

1717
jobs:
1818
publish-dist:
19-
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
22-
with:
23-
fetch-depth: 0
24-
fetch-tags: true
25-
26-
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
27-
with:
28-
node-version: '18'
29-
cache: 'npm'
30-
31-
- name: Set up build environment
32-
run: .github/scripts/env_build.sh
33-
34-
- name: Set draft version in package.json
35-
run: |
36-
node --eval "var fs = require('fs'); var inOut = './package.json'; var data = JSON.parse(fs.readFileSync(inOut)); var a = process.argv; data.version = a[a.length - 1].replace('v', ''); fs.writeFileSync(inOut, JSON.stringify(data, null, 2) + '\n');" $(git describe)
37-
# View package.json diff from last release (should show that the version has been changed to the draft version)
38-
git --no-pager diff --color-words tags/$(git describe --tags --abbrev=0) package.json || true
39-
40-
- name: Build dist/
41-
run: npm run build
42-
43-
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
44-
name: Upload Node 18 archive of plotly.js build folder
45-
with:
46-
name: dist-node18
47-
retention-days: 7
48-
path: dist/
49-
50-
- name: Test plot-schema.json diff
51-
run: diff --unified --color dist/plot-schema.json test/plot-schema.json
52-
53-
publish-dist-node-v22:
5419
runs-on: ubuntu-latest
5520
steps:
5621
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
@@ -76,9 +41,9 @@ jobs:
7641
run: npm run build
7742

7843
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
79-
name: Upload Node 22 archive of plotly.js build folder
44+
name: Upload archive of plotly.js build artifacts (contents of dist/)
8045
with:
81-
name: dist-node22
46+
name: dist
8247
retention-days: 7
8348
path: dist/
8449

Lines changed: 101 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Upload dev build from PR
22

3+
# See https://github.com/plotly/plotly.js/blob/master/CONTRIBUTING.md#live-links-to-dev-builds
4+
# for documentation on the usage of this workflow.
5+
36
on:
47
workflow_run:
58
workflows: ["Publish Dist"] # publish-dist.yml
@@ -9,49 +12,103 @@ on:
912
inputs:
1013
pr_number:
1114
description: 'PR Number to deploy'
12-
required: true
13-
run_id:
14-
description: 'The Run ID of the CI workflow that has the artifact'
15-
required: true
15+
required: false
16+
17+
env:
18+
ARTIFACT_UPLOAD_WORKFLOW_NAME: "Publish Dist"
19+
UPLOAD_DIR_NAME: "upload"
1620

1721
jobs:
1822
upload:
1923
runs-on: ubuntu-latest
24+
# Only run on manual dispatch,
25+
# OR if the parent run succeeded and was triggered by a PR from
26+
# a branch in the main repo (not a fork)
2027
if: |
2128
github.event_name == 'workflow_dispatch' ||
2229
(
2330
github.event_name == 'workflow_run' &&
2431
github.event.workflow_run.event == 'pull_request' &&
25-
github.event.workflow_run.conclusion == 'success'
32+
github.event.workflow_run.conclusion == 'success' &&
33+
github.event.workflow_run.head_repository.full_name == github.repository
2634
)
2735
steps:
36+
- name: Get required metadata (PR number, commit SHA, workflow run ID containing artifacts)
37+
id: get-metadata
38+
env:
39+
GH_TOKEN: ${{ github.token }}
40+
GH_EVENT_NAME: ${{ github.event_name }}
41+
GH_REPO: ${{ github.repository }}
42+
SHA: ${{ github.event.workflow_run.head_sha }}
43+
RUN_ID: ${{ github.event.workflow_run.id }}
44+
PR_NUM: ${{ github.event.workflow_run.pull_requests[0].number || inputs.pr_number }}
45+
run: |
46+
# Get SHA from manually-provided PR number if triggered by workflow_dispatch
47+
if [ "${GH_EVENT_NAME}" == "workflow_dispatch" ]; then
48+
if [ -n "${PR_NUM}" ]; then
49+
SHA=$(gh pr view "${PR_NUM}" --repo "${GH_REPO}" --json headRefOid --template '{{.headRefOid}}')
50+
fi
51+
fi
52+
53+
# At this point, SHA should be defined. If not, fail the workflow
54+
if [ -z "${SHA}" ]; then
55+
echo "Failed to get commit SHA, exiting"
56+
exit 1
57+
fi
58+
59+
# If PR_NUM is empty, get PR number using SHA
60+
if [ -z "${PR_NUM}" ]; then
61+
PR_NUM=$(gh pr list --search "sha:${SHA}" --state open --json number --jq '.[0].number')
62+
fi
63+
64+
# Validate that we have a valid PR number
65+
if [ -z "${PR_NUM}" ] || [[ ! "${PR_NUM}" =~ ^[1-9][0-9]{0,4}$ ]]; then
66+
echo "Failed to get PR number, exiting (PR_NUM=${PR_NUM})"
67+
exit 1
68+
fi
69+
70+
# If RUN_ID is empty, use the gh CLI to get the most recent run ID for SHA
71+
if [ -z "${RUN_ID}" ]; then
72+
RUN_ID=$(gh run list \
73+
--workflow "${ARTIFACT_UPLOAD_WORKFLOW_NAME}" \
74+
--commit "${SHA}" \
75+
--limit 1 \
76+
--json databaseId \
77+
--jq '.[0].databaseId')
78+
fi
79+
80+
# At this point, RUN_ID should be defined. If not, fail the workflow
81+
if [ -z "${RUN_ID}" ]; then
82+
echo "Failed to get workflow run ID, exiting"
83+
exit 1
84+
fi
85+
86+
# Save PR number, commit SHA, short SHA, and run ID to output
87+
echo "PR_NUM=${PR_NUM}" >> $GITHUB_OUTPUT
88+
echo "SHA=${SHA}" >> $GITHUB_OUTPUT
89+
echo "SHORT_SHA=${SHA:0:7}" >> $GITHUB_OUTPUT
90+
echo "RUN_ID=${RUN_ID}" >> $GITHUB_OUTPUT
91+
2892
- name: Download build artifact
2993
id: download-artifact
3094
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
3195
with:
32-
name: dist-node22 # uploaded by publish-dist.yml > publish-dist-node-v22
33-
run-id: ${{ github.event.workflow_run.id || inputs.run_id }}
96+
name: dist # uploaded by publish-dist.yml > publish-dist
97+
run-id: ${{ steps.get-metadata.outputs.RUN_ID }}
3498
github-token: ${{ secrets.GITHUB_TOKEN }}
3599
path: temp-dist
36100

37-
- name: Setup metadata and prepare folders
101+
- name: Prepare folders
38102
id: setup-metadata
39103
env:
40104
GH_TOKEN: ${{ github.token }}
41-
PR_NUM: ${{ github.event.workflow_run.pull_requests[0].number || inputs.pr_number }}
105+
PR_NUM: ${{ steps.get-metadata.outputs.PR_NUM }}
106+
SHA: ${{ steps.get-metadata.outputs.SHA }}
107+
SHORT_SHA: ${{ steps.get-metadata.outputs.SHORT_SHA }}
42108
run: |
43-
# Get SHA from triggering workflow, or from manual input
44-
if [ "${{ github.event_name }}" == "workflow_run" ]; then
45-
SHA="${{ github.event.workflow_run.head_sha }}"
46-
else
47-
echo "Fetching latest SHA for PR #$PR_NUM..."
48-
SHA=$(gh pr view "$PR_NUM" --repo ${{ github.repository }} --json headRefOid --template '{{.headRefOid}}')
49-
fi
50-
SHORT_SHA=${SHA::7}
51-
UPLOAD_DIR_NAME="upload"
52-
53-
echo "Using SHA: ${SHA}"
109+
echo "SHA: ${SHA}"
54110
echo "Short SHA: ${SHORT_SHA}"
111+
echo "PR number: ${PR_NUM}"
55112
mkdir -p "${UPLOAD_DIR_NAME}/pr-${PR_NUM}/latest"
56113
mkdir -p "${UPLOAD_DIR_NAME}/pr-${PR_NUM}/${SHORT_SHA}"
57114
# Copy all 3 artifacts (plotly.js, plotly.min.js, plot-schema.json) to /latest/
@@ -65,10 +122,6 @@ jobs:
65122
echo "Created directory ${UPLOAD_DIR_FULL_PATH} with the following contents:"
66123
echo "$(ls -lR ${UPLOAD_DIR_FULL_PATH})"
67124
68-
echo "PR_NUM=${PR_NUM}" >> $GITHUB_OUTPUT
69-
echo "SHA=${SHA}" >> $GITHUB_OUTPUT
70-
echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_OUTPUT
71-
72125
- name: Generate GitHub App token
73126
id: generate-token
74127
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 #v3.1.1
@@ -87,32 +140,45 @@ jobs:
87140

88141
- name: Commit and push files
89142
id: commit-and-push
143+
env:
144+
PR_NUM: ${{ steps.get-metadata.outputs.PR_NUM }}
145+
SHORT_SHA: ${{ steps.get-metadata.outputs.SHORT_SHA }}
90146
run: |
91-
# 1. Move 'upload' directory into repo folder and cd into repo root
92-
mkdir -p plotly.js-dev-builds/upload/
93-
cp -r upload/ plotly.js-dev-builds/
147+
# Move 'pr-NNNN/' directory into upload directory inside repo and cd into repo root
148+
TARGET_DIR="${UPLOAD_DIR_NAME}/pr-${PR_NUM}"
149+
mkdir -p "plotly.js-dev-builds/${UPLOAD_DIR_NAME}"
150+
cp -r "${TARGET_DIR}" "plotly.js-dev-builds/${UPLOAD_DIR_NAME}"
94151
cd plotly.js-dev-builds
95152
96-
# 2. Configure git
153+
# Configure git
97154
git config user.name "plotly.js-pr-upload"
98155
git config user.email "<>"
99156
100-
# 3. add, commit, and push
101-
git add upload/
157+
# Add files
158+
git add "${TARGET_DIR}/"
159+
160+
# Ensure that only files in upload/pr-NNNN/ are staged
161+
if git diff --name-only --cached | grep -qv "^${TARGET_DIR}/"; then
162+
echo "Error: Changes detected outside ${TARGET_DIR}/"
163+
exit 1
164+
fi
102165
103166
# Only commit if there are changes
104167
if git diff --staged --quiet; then
105168
echo "No changes to commit"
106169
else
107-
git commit -m "Deploy build for PR #${{ steps.setup-metadata.outputs.PR_NUM }} (commit ${{ steps.setup-metadata.outputs.SHORT_SHA }})"
170+
git commit -m "Deploy build for PR #${PR_NUM} (commit ${SHORT_SHA})"
108171
git push origin main
109172
fi
110173
111174
- name: Generate summary
175+
env:
176+
PR_NUM: ${{ steps.get-metadata.outputs.PR_NUM }}
177+
SHORT_SHA: ${{ steps.get-metadata.outputs.SHORT_SHA }}
112178
run: |
113-
BASE="https://plotly.github.io/plotly.js-dev-builds/upload/pr-${{ steps.setup-metadata.outputs.PR_NUM }}"
179+
BASE_URL="https://plotly.github.io/plotly.js-dev-builds/${UPLOAD_DIR_NAME}/pr-${PR_NUM}"
114180
echo "### PR Build Uploaded" >> $GITHUB_STEP_SUMMARY
115-
echo "Builds for PR #${{ steps.setup-metadata.outputs.PR_NUM }} can be accessed at:" >> $GITHUB_STEP_SUMMARY
116-
echo "- Latest build for this PR: [$BASE/latest/plotly.min.js]($BASE/latest/plotly.min.js)" >> $GITHUB_STEP_SUMMARY
117-
echo "- Build for this commit: [$BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js]($BASE/${{ steps.setup-metadata.outputs.SHA }}/plotly.min.js)" >> $GITHUB_STEP_SUMMARY
181+
echo "Builds for PR #${PR_NUM} can be accessed at:" >> $GITHUB_STEP_SUMMARY
182+
echo "- Latest build for this PR: [${BASE_URL}/latest/plotly.min.js](${BASE_URL}/latest/plotly.min.js)" >> $GITHUB_STEP_SUMMARY
183+
echo "- Build for this commit: [${BASE_URL}/${SHORT_SHA}/plotly.min.js](${BASE_URL}/${SHORT_SHA}/plotly.min.js)" >> $GITHUB_STEP_SUMMARY
118184
echo "The above links should start working a minute or two after this job completes." >> $GITHUB_STEP_SUMMARY

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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,17 @@ This will produce the following plot, and say you want to simulate a selection p
326326

327327
<img src="https://user-images.githubusercontent.com/31989842/38890553-0bc6190c-4282-11e8-8efc-077bf05ca565.png">
328328

329+
### Live links to dev builds
330+
331+
The [Upload dev build from PR](.github/workflows/upload-dev-build.yml) workflow can be used to upload a dev build for a PR to the plotly.js-dev-builds repo, creating a live link to the plotly.js dev build which can be used in online coding environments to test and demo the PR.
332+
333+
It is triggered in one of two ways:
334+
- Automatically on completion of the Publish Dist workflow, if triggered by a PR from a branch in the main repo (not a fork).
335+
- Manually via the Actions tab in the GitHub UI, by entering a PR number in the workflow inputs
336+
- Only users with write access to the plotly.js repo can trigger workflows manually
337+
338+
If you would like a link to the dev build for your PR but don't have permission to trigger the workflow, tag a maintainer to request a run for your PR.
339+
329340
## Repo organization
330341

331342
- Distributed files are in `dist/`

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.

0 commit comments

Comments
 (0)