Skip to content

Commit 67b1dd8

Browse files
authored
Merge branch 'main' into fix/write-images-layout-size
2 parents 0e88811 + ad0d0bb commit 67b1dd8

80 files changed

Lines changed: 2309 additions & 554 deletions

File tree

Some content is hidden

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

‎.github/workflows/build-doc.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1818

1919
- name: Set up uv
20-
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
20+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
2121
with:
2222
python-version: "3.9"
2323

‎.github/workflows/build-package.yml‎

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,46 +11,6 @@ permissions:
1111
contents: read
1212

1313
jobs:
14-
plotlyjs-dev-build:
15-
name: plotly.js dev build
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19-
- name: Set up Python
20-
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
21-
with:
22-
python-version: "3.12"
23-
- name: Set up Node
24-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
25-
with:
26-
node-version: "22"
27-
- name: Set up uv
28-
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
29-
- name: Install dependencies
30-
run: |
31-
uv venv
32-
source .venv/bin/activate
33-
uv sync --locked --extra dev_optional
34-
- name: Update plotly.js to dev
35-
run: |
36-
source .venv/bin/activate
37-
python commands.py updateplotlyjsdev
38-
- name: Test core (excluding nodev)
39-
run: |
40-
source .venv/bin/activate
41-
pytest -k 'not nodev' tests/test_core
42-
- name: Build source distribution packages
43-
run: |
44-
source .venv/bin/activate
45-
uv sync --locked --extra dev_build
46-
python -m build --sdist --wheel -o dist
47-
- name: Upload dist artifacts
48-
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
49-
with:
50-
name: plotlyjs-dev-build-dist
51-
path: dist/
52-
if-no-files-found: error
53-
5414
full-build:
5515
name: Full prod build
5616
runs-on: ubuntu-latest
@@ -65,7 +25,7 @@ jobs:
6525
with:
6626
node-version: "22"
6727
- name: Set up uv
68-
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
28+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
6929
- name: PyPI Build
7030
run: |
7131
uv venv

‎.github/workflows/check-codegen.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
python-version: "3.x"
2323

2424
- name: Set up uv
25-
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
25+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
2626

2727
- name: Install dependencies
2828
run: |

‎.github/workflows/check-formatting.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
python-version: "3.12"
2323
- name: Set up uv
24-
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
24+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
2525
- name: Install dependencies
2626
run: |
2727
uv venv

‎.github/workflows/check-js-build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
node-version: '22'
4343

4444
- name: Set up uv
45-
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
45+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
4646

4747
- name: Copy current files to a temporary directory
4848
run: |

‎.github/workflows/run-percy.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
with:
3535
install-chromedriver: true
3636
- name: Set up uv
37-
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
37+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
3838
- name: Install requirements
3939
run: |
4040
uv venv

‎.github/workflows/run-pytest.yml‎

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727
- name: Set up uv
28-
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
28+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
2929
- name: Install dependencies
3030
run: |
3131
uv venv
@@ -54,7 +54,7 @@ jobs:
5454
- name: Set up Chrome for Pytest
5555
uses: ./.github/actions/setup-chrome-for-pytest
5656
- name: Set up uv
57-
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
57+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
5858
- name: Install dependencies
5959
run: |
6060
uv venv
@@ -106,7 +106,7 @@ jobs:
106106
- name: Set up Chrome for browser tests
107107
uses: ./.github/actions/setup-chrome-for-pytest
108108
- name: Set up uv
109-
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
109+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
110110
- name: Install dependencies
111111
run: |
112112
uv venv
@@ -151,7 +151,7 @@ jobs:
151151
with:
152152
install-chromedriver: true
153153
- name: Set up uv
154-
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
154+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
155155
- name: Install dependencies
156156
run: |
157157
uv venv
@@ -164,3 +164,30 @@ jobs:
164164
run: |
165165
source .venv/bin/activate
166166
python -m pytest tests/test_optional/test_kaleido/test_kaleido_v0_error.py
167+
168+
test-matplotlylib:
169+
name: Matplotlylib tests (Python ${{ matrix.python-version }})
170+
runs-on: ubuntu-latest
171+
strategy:
172+
fail-fast: false
173+
matrix:
174+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
175+
steps:
176+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
177+
- name: Set up Python
178+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
179+
with:
180+
python-version: ${{ matrix.python-version }}
181+
- name: Set up uv
182+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
183+
- name: Install dependencies
184+
run: |
185+
uv venv
186+
source .venv/bin/activate
187+
uv lock --check
188+
uv sync --locked --extra dev_matplotlib
189+
python --version
190+
- name: Test matplotlylib
191+
run: |
192+
source .venv/bin/activate
193+
python -m pytest plotly/matplotlylib/tests plotly/matplotlylib/mplexporter/tests
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Test plotly.js dev
2+
3+
# Run codegen and the core tests against the plot-schema.json on plotly.js main
4+
# once a week. This catches plotly.js schema changes that break codegen or
5+
# validation before the next plotly.js release.
6+
on:
7+
schedule:
8+
- cron: "0 9 * * 1" # Monday 09:00 UTC
9+
workflow_dispatch:
10+
inputs:
11+
plotlyjs_ref:
12+
description: "plotly.js branch, tag, or commit SHA to test"
13+
required: false
14+
default: "main"
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
test-plotlyjs-dev:
21+
name: Test against plotly.js dev schema
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
25+
with:
26+
persist-credentials: false
27+
- name: Set up Python
28+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
29+
with:
30+
python-version: "3.12"
31+
- name: Set up uv
32+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
33+
- name: Install dependencies
34+
run: |
35+
uv venv
36+
source .venv/bin/activate
37+
uv sync --locked --extra dev_optional
38+
- name: Download plot-schema.json from plotly.js
39+
# plotly.js CI keeps test/plot-schema.json identical to the built schema
40+
env:
41+
PLOTLYJS_REF: ${{ inputs.plotlyjs_ref || 'main' }}
42+
run: |
43+
curl -fsSL -o codegen/resources/plot-schema.json \
44+
"https://raw.githubusercontent.com/plotly/plotly.js/${PLOTLYJS_REF}/test/plot-schema.json"
45+
- name: Run codegen
46+
run: |
47+
source .venv/bin/activate
48+
python commands.py codegen
49+
- name: Test core (excluding nodev)
50+
run: |
51+
source .venv/bin/activate
52+
pytest -k 'not nodev' tests/test_core
53+
54+
report-failure:
55+
name: Open an issue for a failed scheduled run
56+
needs: test-plotlyjs-dev
57+
# Manual runs can test any plotly.js ref, so only report scheduled runs
58+
if: failure() && github.event_name == 'schedule'
59+
runs-on: ubuntu-latest
60+
permissions:
61+
issues: write
62+
steps:
63+
- name: Open or update the failure issue
64+
env:
65+
GH_TOKEN: ${{ github.token }}
66+
GH_REPO: ${{ github.repository }}
67+
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
68+
TITLE: "Weekly plotly.js dev test failed"
69+
run: |
70+
BODY="The weekly test against the plot-schema.json on plotly.js main failed: ${RUN_URL}"
71+
# Comment on an open issue from an earlier failure instead of opening a duplicate
72+
EXISTING=$(gh issue list --state open --search "in:title \"${TITLE}\"" \
73+
--json number,title --jq "map(select(.title == \"${TITLE}\")) | .[0].number // empty")
74+
if [ -n "${EXISTING}" ]; then
75+
gh issue comment "${EXISTING}" --body "${BODY}"
76+
else
77+
gh issue create --title "${TITLE}" --body "${BODY}"
78+
fi

‎.github/workflows/test-release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
node-version: '22'
2727

2828
- name: Set up uv
29-
uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0
29+
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
3030

3131
- name: Install npm dependencies
3232
run: |

‎CHANGELOG.md‎

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,26 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44

55
## Unreleased
66

7-
### Fixed
8-
- Fix concurrent first access to lazily initialized graph object properties, which could raise `ValueError("Invalid value")` [[#3441](https://github.com/plotly/plotly.py/issues/3441)], with thanks to @hb1915 for the contribution!
9-
- Fix `px.sunburst`, `px.treemap` and `px.icicle` listing sectors in a different order on every run when `path` is used with a Polars DataFrame; sectors now follow their order of first appearance for all dataframe backends [[#5765](https://github.com/plotly/plotly.py/issues/5765)], with thanks to @Irahan2 for the contribution!
7+
### Added
8+
- Add support for converting matplotlib reference lines (`axhline`, `axvline`, and horizontal/vertical `axline`) as well as axes-coordinate lines into Plotly layout shapes in `mpl_to_plotly`, including support for date axes [[#5719](https://github.com/plotly/plotly.py/pull/5719)], with thanks to @robertoffmoura for the contribution!
9+
10+
### Fixed
11+
- Fix `mpl_to_plotly` tick marker mirroring, axis positioning, and trace visibility for twinned and overlaid subplots (such as `twinx` and `twiny`) [[#5310](https://github.com/plotly/plotly.py/pull/5310)], with thanks to @robertoffmoura for the contribution!
12+
- Fix `mpl_to_plotly` losing matplotlib axis line colors by exporting the color of each axis's displayed spine to the plotly x and y axis `linecolor` [[#5311](https://github.com/plotly/plotly.py/pull/5311)], with thanks to @robertoffmoura for the contribution!
13+
- Fix concurrent first access to lazily initialized graph object properties, which could raise `ValueError("Invalid value")` [[#5691](https://github.com/plotly/plotly.py/pull/5691)], with thanks to @hb1915 for the contribution!
14+
- Fix `mpl_to_plotly` crashing on touching bars (such as `plt.hist`) due to floating-point noise producing negative `bargap` values by clamping `bargap` to `[0, 1]` [[#5696](https://github.com/plotly/plotly.py/pull/5696)], with thanks to @robertoffmoura for the contribution!
15+
- Fix `mpl_to_plotly` drawing step plots with diagonal lines instead of vertical/horizontal step segments by mapping matplotlib step drawstyles (`steps-pre`, `steps-post`, `steps-mid`) to plotly line shapes [[#5697](https://github.com/plotly/plotly.py/pull/5697)], with thanks to @robertoffmoura for the contribution!
16+
- Fix `mpl_to_plotly` dropping matplotlib stairs plots by rendering `StepPatch` artists as step lines or filled step areas from their path vertices and edge style [[#5698](https://github.com/plotly/plotly.py/pull/5698)], with thanks to @robertoffmoura for the contribution!
17+
- Fix `mpl_to_plotly` showing unwanted legends with placeholder or internal label entries (`_nolegend_`, `_childN`) by defaulting `layout.showlegend=False` unless the matplotlib figure explicitly defines a legend [[#5699](https://github.com/plotly/plotly.py/pull/5699)], with thanks to @robertoffmoura for the contribution!
18+
- Fix `mpl_to_plotly` crashing on figures with fully transparent or alpha-carrying colors, such as boxplot outlier markers (`facecolor="none"`), rgba line colors, and `color="none"` text and axis labels; all matplotlib colors are now exported through a single helper that maps `"none"` to transparent rgba and keeps or overrides alpha as matplotlib does [[#5700](https://github.com/plotly/plotly.py/pull/5700)], with thanks to @robertoffmoura for the contribution!
19+
- Export tick label colors to the plotly tickfont in `mpl_to_plotly` [[#5716](https://github.com/plotly/plotly.py/pull/5716)], with thanks to @robertoffmoura for the contribution!
20+
- Fix Plotly Express mutating lists passed to the `x` or `y` arguments in wide mode [[#5727](https://github.com/plotly/plotly.py/pull/5727)], with thanks to @cpruijsen for the contribution!
21+
- Fix `convert_dash` mapping dotted lines (`linestyle=':'`) to invalid `'circle'` in Plotly, correctly converting them to `'dot'` and preserving custom dash patterns as pixel lists, [[#5719](https://github.com/plotly/plotly.py/pull/5719)] with thanks to @robertoffmoura for the contribution!
22+
- Fix `px.sunburst`, `px.treemap` and `px.icicle` listing sectors in a different order on every run when `path` is used with a Polars DataFrame; sectors now follow their order of first appearance for all dataframe backends [[#5766](https://github.com/plotly/plotly.py/pull/5766)], with thanks to @Irahan2 for the contribution!
23+
- Fix `mpl_to_plotly` conversion of matplotlib contour lines and line collections: close contour rings ending with `Z` codes, support dash styles, convert date x-axes, separate disjoint subpaths with `None` separators, hide line collection traces from the legend by default, and group consecutive same-style lines into single traces [[#5770](https://github.com/plotly/plotly.py/pull/5770)], with thanks to @robertoffmoura for the contribution!
24+
- Fix serialization of box/lasso select data for figures with multiple subplots [[#5710](https://github.com/plotly/plotly.py/pull/5710)], with thanks to @flpi-sun for the contribution!
1025
- Fix `plotly.io.write_images` ignoring `layout.width`/`layout.height` (and the template's) and exporting every figure at the default 700x500 size; it now uses the same width/height priority as `write_image` and `to_image` [[#5784](https://github.com/plotly/plotly.py/pull/5784)], with thanks to @breken-ai for the contribution!
1126

12-
1327
## [7.1.0] - 2026-09-15
1428

1529
### Added

0 commit comments

Comments
 (0)