Skip to content

Commit 01b9d44

Browse files
committed
Merge branch 'main' into v7.0
2 parents a55d3c9 + 2327333 commit 01b9d44

14 files changed

Lines changed: 205 additions & 407 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,22 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1313
- Remove support for Orca for static image generation [[#5677](https://github.com/plotly/plotly.py/pull/5677)]
1414
- 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)]
1515

16+
### Fixed
17+
- 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!
18+
19+
20+
## [6.9.0] - 2026-07-09
21+
1622
### Fixed
1723
- 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!
24+
- 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)]
25+
26+
27+
### Updated
28+
- 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:
29+
- 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)]. NOTE: The Plotly Cloud endpoint for receiving charts is not yet functional, so this button won't complete the upload.
30+
- Fix stale `scattergl` error bars after toggling traces with mixed error bar visibility [[#7773](https://github.com/plotly/plotly.js/issues/7773)], with thanks to @JulienIcon for the contribution!
31+
- Fix geo `fitbounds` to choose a compact longitude range when point data straddles the antimeridian [[#7837](https://github.com/plotly/plotly.js/pull/7837)], with thanks to @SharadhNaidu for the contribution!
1832

1933
### Updated
2034
- 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:

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: 6.9.0
1313
doi: 10.5281/zenodo.14503524
14-
date-released: 2026-06-03
14+
date-released: 2026-07-09
1515
url: "https://github.com/plotly/plotly.py"

CONTRIBUTING.md

Lines changed: 20 additions & 12 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

@@ -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

_plotly_utils/colors/__init__.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,11 +752,20 @@ def hex_to_rgb(value):
752752
"""
753753
Calculates rgb values from a hex color code.
754754
755-
:param (string) value: Hex color string
755+
:param (string) value: Hex color string. May be a full 6-character code
756+
or a 3-character shorthand code.
756757
757758
:rtype (tuple) (r_value, g_value, b_value): tuple of rgb values
759+
760+
Example:
761+
762+
'#FFFFFF' --> (255, 255, 255)
763+
'#FFF' --> (255, 255, 255)
764+
758765
"""
759766
value = value.lstrip("#")
767+
if len(value) == 3:
768+
value = "".join(c * 2 for c in value)
760769
hex_total_length = len(value)
761770
rgb_section_length = hex_total_length // 3
762771
return tuple(

commands.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def install_js_deps(local, build=True):
5050
When ``build`` is True (the default), also runs ``npm run build`` to
5151
rebuild the JupyterLab extension and FigureWidget bundles and verifies
5252
that the widget bundle exists. Pass ``build=False`` when you only need
53-
to refresh ``node_modules`` / ``package-lock.json`` (e.g. after a
54-
plotly.js version bump) and don't need the bundles rebuilt.
53+
to refresh ``node_modules`` / ``package-lock.json`` but don't
54+
need the bundles rebuilt.
5555
"""
5656

5757
npmName = "npm"
@@ -224,7 +224,7 @@ def update_plotlyjs(plotly_js_version, outdir):
224224
update_bundle(plotly_js_version)
225225
update_schema(plotly_js_version)
226226
perform_codegen(outdir)
227-
install_js_deps(local=None, build=False)
227+
install_js_deps(local=None, build=True)
228228

229229

230230
# FIXME: switch to argparse

doc/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Python packages required to build the docs are listed in
1717
Before building the documentation locally, you need to set up a dedicated
1818
environment with the doc-specific dependencies.
1919

20+
> You will need the [`gdal`](https://gdal.org/) system library installed (it's a build dependency of `geopandas`, a required dependency). The `uv pip install` step below will fail without it.
21+
2022
```bash
2123
cd doc
2224
uv venv --python 3.9

0 commit comments

Comments
 (0)