Skip to content

Commit 24ca859

Browse files
committed
Merge remote-tracking branch 'origin/main' into doc-prod
2 parents 0a44827 + ca01aba commit 24ca859

1,082 files changed

Lines changed: 74955 additions & 192885 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: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,9 @@ jobs:
3838
3939
4040
- name: Build HTML docs
41-
env:
42-
MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }}
4341
run: |
4442
cd doc
4543
source .venv/bin/activate
46-
echo "${MAPBOX_TOKEN}" > python/.mapbox_token
4744
make -kj8 || make -kj8
4845
curl https://raw.githubusercontent.com/plotly/graphing-library-docs/master/front-matter-ci.py > front-matter-ci.py
4946
curl https://raw.githubusercontent.com/plotly/graphing-library-docs/master/check-or-enforce-order.py > check-or-enforce-order.py
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Check Python codegen
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [opened, reopened, synchronize]
9+
10+
jobs:
11+
check-python-codegen:
12+
name: Check Python codegen
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
- name: Set up Python
17+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
18+
with:
19+
python-version: "3.x"
20+
21+
- name: Set up uv
22+
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
23+
24+
- name: Install dependencies
25+
run: |
26+
uv venv
27+
source .venv/bin/activate
28+
uv lock --check
29+
uv sync --extra dev_codegen
30+
- name: Run codegen
31+
run: |
32+
source .venv/bin/activate
33+
python commands.py codegen
34+
- name: Check for changes
35+
run: |
36+
# Fail if codegen produced any changes to the working directory.
37+
# This means the committed generated files are out of date and codegen
38+
# needs to be re-run locally and the results committed.
39+
if [ -n "$(git status --porcelain)" ]; then
40+
echo "::error::Generated files are out of date. Please run 'python commands.py codegen' locally and commit the result."
41+
echo "The following files differ after running codegen:"
42+
git status --porcelain
43+
echo ""
44+
exit 1
45+
fi
46+
echo "Generated files are up to date."

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ jobs:
4949
run: |
5050
uv venv
5151
source .venv/bin/activate
52-
uv pip install jupyterlab
52+
# Technically, we only need the `jupyter-builder` package, but using the dev_build extra
53+
# keeps build behavior consistent across all CI jobs
54+
uv sync --extra dev_build
5355
cd js
5456
npm ci
5557
npm run build

.github/workflows/run-pytest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135
python -m pytest -x test_init/test_lazy_imports.py
136136
137137
test-kaleido-v0:
138-
name: Optional tests (Kaleido only), Kaleido v0 (Python 3.12, kaleido 0.2.1)
138+
name: Kaleido v0 RuntimeError verification (Python 3.12, kaleido 0.2.1)
139139
runs-on: ubuntu-latest
140140
steps:
141141
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -157,7 +157,7 @@ jobs:
157157
uv pip uninstall kaleido
158158
uv pip install kaleido==0.2.1
159159
python --version
160-
- name: Test plotly.io image output with Kaleido v0
160+
- name: Test that plotly.io raises correct error with Kaleido v0
161161
run: |
162162
source .venv/bin/activate
163-
python -m pytest tests/test_optional/test_kaleido
163+
python -m pytest tests/test_optional/test_kaleido/test_kaleido_v0_error.py

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
0
22
0.html
33
iframe_figures/
4-
tests/test_orca/images/linux/failed/
54

65
*.egg-info
76

@@ -49,13 +48,10 @@ plotly.egg-info/
4948
# macOS utility file
5049
**/.DS_Store
5150

52-
tests/test_orca/images/*/failed
53-
tests/test_orca/images/*/tmp
5451
tests/test_core/test_offline/plotly.min.js
5552
temp-plot.html
5653
.vscode
5754
doc/python/.ipynb_checkpoints
58-
doc/python/.mapbox_token
5955
doc/.ipynb_checkpoints
6056
tags
6157
doc/check-or-enforce-order.py

CHANGELOG.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,69 @@ This project adheres to [Semantic Versioning](http://semver.org/).
55
## Unreleased
66

77

8+
## [7.0.0] - 2026-08-25
9+
10+
### Fixed
11+
- Fix `hex_to_rgb` parsing of 3-digit shorthand hexadecimal colors such as `#FFF` [[#5662](https://github.com/plotly/plotly.py/pull/5662)], with thanks to @genrichez for the contribution!
12+
- Improve `px.*_map()` auto-fitting behavior when `zoom` and `center` are not specified [[#5686](https://github.com/plotly/plotly.py/pull/5686)]
13+
- Add `<!doctype html>` to the `to_html()` template to comply with modern web standards [[#5693](https://github.com/plotly/plotly.py/pull/5693)], with thanks to @mishrakushal for the contribution!
14+
- Apply `histfunc`/`z` aggregation to `marginal_x`/`marginal_y="histogram"` subplots in `density_heatmap`/`density_contour`, instead of always showing raw bin counts [[#3521](https://github.com/plotly/plotly.py/issues/3521)], with thanks to @lucasjamar for the contribution!
15+
- Fix `mpl_to_plotly` silently dropping matplotlib path collections in data coordinates (such as violin plots, pcolor, event plots, stack plots, fill_between, and stem plots) by rendering them as filled polygons or lines [[#5702](https://github.com/plotly/plotly.py/pull/5702)], with thanks to @robertoffmoura for the contribution!
16+
17+
### Updated
18+
- Update plotly.js from version 3.6.0 to version 4.0.0 [[#5673](https://github.com/plotly/plotly.py/pull/5673)]. This is a major-version release with many changes. See the [plotly.js release notes](https://github.com/plotly/plotly.js/releases/tag/v4.0.0) for the full list. The most significant changes include:
19+
- Add `quiver` trace type to visualize vector fields using arrows [[#7710](https://github.com/plotly/plotly.js/pull/7710), [#7945](https://github.com/plotly/plotly.js/issues/7945)]
20+
- Add "Share Chart" modebar button for generating a chart-sharing link via Plotly Cloud [[#7909](https://github.com/plotly/plotly.js/pull/7909)]
21+
- Remove `scattermapbox`, `choroplethmapbox`, `densitymapbox` trace types, the `mapbox` subplot, and the `mapboxAccessToken` config option [[#7860](https://github.com/plotly/plotly.js/pull/7860)]. Use the equivalent `*map` traces instead.
22+
- The corresponding `graph_objects` and Plotly Express functions have also been removed in plotly.py; use the `map` versions instead
23+
- Drop support for MathJax v2, and add support for v4 [[#7898](https://github.com/plotly/plotly.js/pull/7898)]. MathJax is the JavaScript library used for rendering mathematical equations in plotly charts.
24+
- Switch color processing library from [TinyColor](https://github.com/bgrins/TinyColor) to [culori](https://culorijs.org) [[#7536](https://github.com/plotly/plotly.js/pull/7536), [#7962](https://github.com/plotly/plotly.js/pull/7962)]. There are some changes to supported color string formats as a result:
25+
- `rgb()`/`rgba()` strings with decimal 0–1 fractions are no longer supported
26+
- `hsv()` color strings are no longer supported
27+
- Strings with invalid syntax such as `hsl(120, 50% 50%)` are no longer supported
28+
- New supported formats: `'#ff0000aa'`, `'#f00a'`, `'rgb(255 0 0)'`, `'rgba(255 0 0 / 0.5)'`, `'hsl(0 100% 50% / 0.5)'`, `'hsla(0, 100%, 50%, 0.5)'`, `'hwb(0 0% 0%)'`, `lab()`, `lch()`, `oklab()`, `oklch()`, `color()`, `hsl(0.5turn 60% 40%)`, `hsl(none 60% 40%)`
29+
- Replace `country-regex` with `country-iso-search` to search for country names in choropleth, scattergeo traces [[#7856](https://github.com/plotly/plotly.js/pull/7856)]. Most country names are handled exactly the same; a small number of legacy entries have been removed.
30+
- Change `layout.geo.fitbounds` default from `false` to `'locations'` [[#7895](https://github.com/plotly/plotly.js/pull/7895)]. `geo` subplots will now auto-fit the initial view to the trace data by default.
31+
- Dynamically compute `center` and `zoom` values for `scattermap` and `densitymap` traces. The initial map view will now auto-fit to the trace data by default. Add `layout.map.fitbounds` attribute (default `'locations'`) to enable or disable auto-fitting behavior [[#7884](https://github.com/plotly/plotly.js/pull/7884), [#7913](https://github.com/plotly/plotly.js/pull/7913)]
32+
- Fix GeoJSON bounding-box computation for `choropleth` and `scattergeo` traces whose geometry crosses the antimeridian [[#7891](https://github.com/plotly/plotly.js/pull/7891)]
33+
34+
## [7.0.0rc0] - 2026-07-29
35+
36+
### Removed
37+
- Remove the deprecated Figure Factory functions `create_2d_density`, `create_annotated_heatmap`, `create_bullet`, `create_candlestick`, `create_choropleth`, `create_distplot`, `create_facet_grid`, `create_gantt`, `create_hexbin_mapbox`, `create_ohlc`, `create_scatterplotmatrix`, and `create_violin` [[#5627](https://github.com/plotly/plotly.py/pull/5627)]
38+
- Remove support for Kaleido versions less than v1.0.0 for static image generation [[#5677](https://github.com/plotly/plotly.py/pull/5677)]
39+
- Remove support for Orca for static image generation [[#5677](https://github.com/plotly/plotly.py/pull/5677)]
40+
- Remove `engine` argument from functions `fig.write_image()`,`fig.to_image()`, `pio.write_image()`, `pio.write_images()`, `pio.to_image()`, `pio.full_figure_for_development()`, and from renderer constructors [[#5677](https://github.com/plotly/plotly.py/pull/5677)]
41+
42+
### Updated
43+
- Update plotly.js from version 3.6.0 to version 4.0.0-rc.0 [[#5673](https://github.com/plotly/plotly.py/pull/5673)]. This is a major-version release candidate with many changes. See the [plotly.js release notes](https://github.com/plotly/plotly.js/releases/tag/v4.0.0-rc.0) for the full list. The most significant changes include:
44+
- Add `quiver` trace type to visualize vector fields using arrows [[#7710](https://github.com/plotly/plotly.js/pull/7710)]
45+
- Add "Share Chart" modebar button for generating a chart-sharing link via Plotly Cloud [[#7909](https://github.com/plotly/plotly.js/pull/7909)]
46+
- Remove `scattermapbox`, `choroplethmapbox`, `densitymapbox` trace types, the `mapbox` subplot, and the `mapboxAccessToken` config option [[#7860](https://github.com/plotly/plotly.js/pull/7860)]. Use the equivalent `*map` traces instead.
47+
- The corresponding `graph_objects` and Plotly Express functions have also been removed in plotly.py; use the `map` versions instead
48+
- Drop support for MathJax v2, and add support for v4 [[#7898](https://github.com/plotly/plotly.js/pull/7898)]. MathJax is the JavaScript library used for rendering mathematical equations in plotly charts.
49+
- Switch color processing library from [TinyColor](https://github.com/bgrins/TinyColor) to [color](https://github.com/Qix-/color) [[#7536](https://github.com/plotly/plotly.js/pull/7536)]. There are some changes to supported color string formats as a result:
50+
- `rgb()`/`rgba()` strings with decimal 0–1 fractions are no longer supported
51+
- `hsv()` color strings are no longer supported
52+
- New supported formats: `'#ff0000aa'`, `'#f00a'`, `'rgb(255 0 0)'`, `'rgba(255 0 0 / 0.5)'`, `'hsl(0 100% 50% / 0.5)'`, `'hsla(0, 100%, 50%, 0.5)'`, `'hwb(0, 0%, 0%)'`
53+
- Replace `country-regex` with `country-iso-search` to search for country names in choropleth, scattergeo traces [[#7856](https://github.com/plotly/plotly.js/pull/7856)]. Most country names are handled exactly the same; a small number of legacy entries have been removed.
54+
- Change `layout.geo.fitbounds` default from `false` to `'locations'` [[#7895](https://github.com/plotly/plotly.js/pull/7895)]. `geo` subplots will now auto-fit the initial view to the trace data by default.
55+
- Dynamically compute `center` and `zoom` values for `scattermap` and `densitymap` traces. The initial map view will now auto-fit to the trace data by default. Add `layout.map.fitbounds` attribute (default `'locations'`) to enable or disable auto-fitting behavior [[#7884](https://github.com/plotly/plotly.js/pull/7884), [#7913](https://github.com/plotly/plotly.js/pull/7913)]
56+
- Fix GeoJSON bounding-box computation for `choropleth` and `scattergeo` traces whose geometry crosses the antimeridian [[#7891](https://github.com/plotly/plotly.js/pull/7891)]
57+
58+
## [6.9.0] - 2026-07-09
59+
60+
### Fixed
61+
- Raise a clear `ValueError` when an unsupported marginal plot type is passed to Plotly Express, instead of failing later with a cryptic `'NoneType' object has no attribute 'constructor'` message [[#5625](https://github.com/plotly/plotly.py/pull/5625)], with thanks to @eugen-goebel for the contribution!
62+
- Read and write figure JSON files as UTF-8 in `read_json`/`write_json` so figures containing non-ASCII text are handled correctly on platforms whose default encoding is not UTF-8 (e.g. cp1252 on Windows) [[#5633](https://github.com/plotly/plotly.py/pull/5633)]
63+
64+
65+
### Updated
66+
- Update plotly.js from version 3.6.0 to version 3.7.0. See the plotly.js [release notes](https://github.com/plotly/plotly.js/releases/tag/v3.7.0) for more information [[#5639](https://github.com/plotly/plotly.py/pull/5639)]. Notable changes include:
67+
- Rename `sendDataToCloud` modebar button to `sendChartToCloud`, and update to upload chart to Plotly Cloud [[#7802](https://github.com/plotly/plotly.js/pull/7802), [#7852](https://github.com/plotly/plotly.js/pull/7852), [#7854](https://github.com/plotly/plotly.js/pull/7854)]
68+
- Fix stale `scattergl` error bars after toggling traces with mixed error bar visibility [[#7773](https://github.com/plotly/plotly.js/issues/7773)]
69+
- Fix geo `fitbounds` to choose a compact longitude range when point data straddles the antimeridian [[#7837](https://github.com/plotly/plotly.js/pull/7837)]
70+
871
## [6.8.0] - 2026-06-03
972

1073
### Added
@@ -186,7 +249,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
186249
- Drop deprecated `zauto`, `zmin` and `zmax` from the surface trace [[#7234](https://github.com/plotly/plotly.js/pull/7234)]
187250
- Drop deprecated `autotick` attributes from cartesian axes [[#7236](https://github.com/plotly/plotly.js/pull/7236)]
188251
- Drop `transforms` from the API [[#7240](https://github.com/plotly/plotly.js/pull/7240), [#7254](https://github.com/plotly/plotly.js/pull/7254)]
189-
- Deprecate Mapbox-based traces.[[#4900](https://github.com/plotly/plotly.py/pull/4900)]. See the [MapLibre Migration](https://plotly.com/python/mapbox-to-maplibre/) page for details on migrating from Mapbox to Maplibre.
252+
- Deprecate Mapbox-based traces.[[#4900](https://github.com/plotly/plotly.py/pull/4900)]. See the [MapLibre Migration](https://plotly.com/python/mapbox-to-maplibre/) page for details on migrating from Mapbox to MapLibre.
190253
- Update plotly.py to use base64 encoding of typed arrays e.g. numpy in plotly JSON to keep precision intact and improve performance [[#4470](https://github.com/plotly/plotly.py/pull/4470)].
191254
- Make plotly-express dataframe agnostic via Narwhals [[#4790](https://github.com/plotly/plotly.py/pull/4790)].
192255
- Update `go.FigureWidget` to use `anywidget` [[#4823](https://github.com/plotly/plotly.py/pull/4823)]

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ authors:
99
- family-names: "Parmer"
1010
given-names: "Chris"
1111
title: "An interactive, open-source, and browser-based graphing library for Python"
12-
version: 6.8.0
12+
version: 7.0.0
1313
doi: 10.5281/zenodo.14503524
14-
date-released: 2026-06-03
14+
date-released: 2026-08-25
1515
url: "https://github.com/plotly/plotly.py"

CONTRIBUTING.md

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ you can do it directly on GitHub by clicking on the "Edit this page on GitHub" l
6767

6868
We use Git and GitHub to manage our project;
6969
if you are not familiar with them,
70-
there are great resources like <http://try.github.io/> to get you started.
70+
there are great resources like <https://try.github.io/> to get you started.
7171

7272
The first step is to [fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) on GitHub
7373
so that you have your own copy to work with.
@@ -99,7 +99,7 @@ source .venv/bin/activate
9999

100100
Alternatively,
101101
you can use [conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands)
102-
or [virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/)
102+
or [virtualenv](https://docs.python-guide.org/en/latest/dev/virtualenvs/)
103103
to create and manage your virtual environment;
104104
see those tools' documentation for more information.
105105

@@ -251,7 +251,7 @@ Two kinds of Jupyter support are included:
251251
which allows us to avoid embedding `plotly.js` in the notebook output.
252252
The JupyterLab extension source code is located at `js/src/mimeExtension.ts`
253253
and the compiled extension code is located at `plotly/labextension` in the built Python package.
254-
The command `jupyter labextension build` (which is one of the steps called by `npm run build`) compiles the extension
254+
The command `jupyter-builder build` (which is one of the steps called by `npm run build`) compiles the extension
255255
and places the build artifacts in `plotly/labextension`.
256256

257257
2. **FigureWidget**:
@@ -273,22 +273,30 @@ python commands.py updateplotlyjs
273273
```
274274

275275
This downloads new versions of `plot-schema.json` and `plotly.min.js` from the `plotly/plotly.js` GitHub repository
276-
and places them in `plotly/package_data`.
277-
It then regenerates all of the `graph_objs` classes based on the new schema,
278-
and finally runs `npm install` in `js/` to refresh `js/package-lock.json` against the new `plotly.js`.
279-
Commit the updated `js/package-lock.json` along with the regenerated files.
280-
281-
The JupyterLab extension and FigureWidget bundles in `plotly/labextension` and `plotly/package_data/widgetbundle.js`
282-
are rebuilt as part of the release flow (see [RELEASE.md](RELEASE.md)) rather than on every plotly.js bump.
283-
284-
If you need to skip the `npm install` step entirely (e.g. `npm` isn't available),
276+
and places them in `codegen/resources/` and `plotly/package_data/`, respectively.
277+
278+
It then does the following:
279+
- Regenerates all of the `graph_objs` classes based on the new schema
280+
- Runs `npm install` in `js/` to refresh `js/package-lock.json` against the new `plotly.js`
281+
- Runs `npm run build` to rebuild the JupyterLab extension and FigureWidget bundles in `plotly/labextension` and `plotly/package_data/widgetbundle.js`.
282+
283+
Commit the updated files under:
284+
- `codegen/resources/`
285+
- `js/`
286+
- `plotly/graph_objs/`
287+
- `plotly/labextension/`
288+
- `plotly/offline/`
289+
- `plotly/package_data/`
290+
291+
If you need to skip the `npm` steps entirely (e.g. `npm` isn't available),
285292
set the `SKIP_NPM=1` environment variable:
286293

287294
```bash
288295
SKIP_NPM=1 python commands.py updateplotlyjs
289296
```
290297

291-
If you do skip it, you'll need to run `npm install` in `js/` yourself before committing so the lockfile stays in sync.
298+
If you do skip it, you'll need to find a way to manually run `npm install && npm run build` in `js/` before committing,
299+
so that the lockfile and build artifacts stay in sync with `js/package.json`.
292300

293301
### Using a Development Branch of Plotly.js
294302

@@ -301,7 +309,7 @@ python commands.py updateplotlyjsdev --devrepo reponame --devbranch branchname
301309

302310
This fetches the `plotly.js` in the CircleCI artifact of the branch `branchname` of the repo `reponame`.
303311
If `--devrepo` or `--devbranch` are omitted,
304-
`updateplotlyjsdev` defaults to `plotly/plotly.js` and `master` respectively.
312+
`updateplotlyjsdev` defaults to `plotly/plotly.js` and `main` respectively.
305313

306314
### Local Repository
307315

0 commit comments

Comments
 (0)