Skip to content

Commit 82a18d9

Browse files
authored
Merge branch 'main' into fix-5615-splom-colorbar-restyle
2 parents b31ae3d + 094c3dc commit 82a18d9

28 files changed

Lines changed: 2104 additions & 1801 deletions

CHANGELOG.md

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

77
### Fixed
8-
- 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!
8+
- 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!
99
- Stop emitting leftover empty `{}` containers when a nested property is set to `None`, which could make a later `Plotly.restyle` of `marker.colorbar` attributes collapse the scatter-matrix layout [[#5615](https://github.com/plotly/plotly.py/issues/5615)]
1010

11+
## [6.9.0] - 2026-07-09
12+
13+
### Fixed
14+
- 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!
15+
- 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)]
16+
17+
18+
### Updated
19+
- 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:
20+
- 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.
21+
- 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!
22+
- 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!
23+
1124

1225
## [6.8.0] - 2026-06-03
1326

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(

codegen/resources/plot-schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
"valType": "number"
280280
},
281281
"plotlyServerURL": {
282-
"description": "When set it determines base URL for the 'Edit in Chart Studio' `showEditInChartStudio`/`showSendToCloud` mode bar button and the showLink/sendData on-graph link. To enable sending your data to Chart Studio Cloud, you need to set both `plotlyServerURL` to 'https://chart-studio.plotly.com' and also set `showSendToCloud` to true.",
282+
"description": "Sets the URL for the `sendChartToCloud` modebar button. When clicked, the button will send the chart data to this URL.",
283283
"dflt": "",
284284
"valType": "string"
285285
},
@@ -331,7 +331,7 @@
331331
"valType": "boolean"
332332
},
333333
"showEditInChartStudio": {
334-
"description": "Same as `showSendToCloud`, but use a pencil icon instead of a floppy-disk. Note that if both `showSendToCloud` and `showEditInChartStudio` are turned, only `showEditInChartStudio` will be honored.",
334+
"description": "Deprecated. Use `showSendToCloud` instead.",
335335
"dflt": false,
336336
"valType": "boolean"
337337
},
@@ -341,7 +341,7 @@
341341
"valType": "boolean"
342342
},
343343
"showSendToCloud": {
344-
"description": "Should we include a ModeBar button, labeled \"Edit in Chart Studio\", that sends this chart to chart-studio.plotly.com (formerly plot.ly) or another plotly server as specified by `plotlyServerURL` for editing, export, etc? Prior to version 1.43.0 this button was included by default, now it is opt-in using this flag. Note that this button can (depending on `plotlyServerURL` being set) send your data to an external server. However that server does not persist your data until you arrive at the Chart Studio and explicitly click \"Save\".",
344+
"description": "Should we include a modebar button that sends this chart to a URL specified by `plotlyServerURL`, for sharing the chart with others? Note that this button will (after a confirmation step) send chart data to an external server.",
345345
"dflt": false,
346346
"valType": "boolean"
347347
},
@@ -4639,7 +4639,7 @@
46394639
},
46404640
"remove": {
46414641
"arrayOk": true,
4642-
"description": "Determines which predefined modebar buttons to remove. Similar to `config.modeBarButtonsToRemove` option. This may include *autoScale2d*, *autoscale*, *editInChartStudio*, *editinchartstudio*, *hoverCompareCartesian*, *hovercompare*, *lasso*, *lasso2d*, *orbitRotation*, *orbitrotation*, *pan*, *pan2d*, *pan3d*, *reset*, *resetCameraDefault3d*, *resetCameraLastSave3d*, *resetGeo*, *resetSankeyGroup*, *resetScale2d*, *resetViewMap*, *resetViewMapbox*, *resetViews*, *resetcameradefault*, *resetcameralastsave*, *resetsankeygroup*, *resetscale*, *resetview*, *resetviews*, *select*, *select2d*, *sendDataToCloud*, *senddatatocloud*, *tableRotation*, *tablerotation*, *toImage*, *toggleHover*, *toggleSpikelines*, *togglehover*, *togglespikelines*, *toimage*, *zoom*, *zoom2d*, *zoom3d*, *zoomIn2d*, *zoomInGeo*, *zoomInMap*, *zoomInMapbox*, *zoomOut2d*, *zoomOutGeo*, *zoomOutMap*, *zoomOutMapbox*, *zoomin*, *zoomout*.",
4642+
"description": "Determines which predefined modebar buttons to remove. Similar to `config.modeBarButtonsToRemove` option. This may include *autoScale2d*, *autoscale*, *hoverCompareCartesian*, *hovercompare*, *lasso*, *lasso2d*, *orbitRotation*, *orbitrotation*, *pan*, *pan2d*, *pan3d*, *reset*, *resetCameraDefault3d*, *resetCameraLastSave3d*, *resetGeo*, *resetSankeyGroup*, *resetScale2d*, *resetViewMap*, *resetViewMapbox*, *resetViews*, *resetcameradefault*, *resetcameralastsave*, *resetsankeygroup*, *resetscale*, *resetview*, *resetviews*, *select*, *select2d*, *sendChartToCloud*, *sendcharttocloud*, *tableRotation*, *tablerotation*, *toImage*, *toggleHover*, *toggleSpikelines*, *togglehover*, *togglespikelines*, *toimage*, *zoom*, *zoom2d*, *zoom3d*, *zoomIn2d*, *zoomInGeo*, *zoomInMap*, *zoomInMapbox*, *zoomOut2d*, *zoomOutGeo*, *zoomOutMap*, *zoomOutMapbox*, *zoomin*, *zoomout*.",
46434643
"dflt": "",
46444644
"editType": "modebar",
46454645
"valType": "string"

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

js/lib/mimeExtension.js

Lines changed: 813 additions & 813 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jupyterlab-plotly",
33
"main": "lib/mimeExtension.js",
4-
"version": "6.8.0",
4+
"version": "6.9.0",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/plotly/plotly.py"
@@ -19,7 +19,7 @@
1919
},
2020
"dependencies": {
2121
"lodash-es": "^4.17.21",
22-
"plotly.js": "3.6.0",
22+
"plotly.js": "3.7.0",
2323
"@lumino/widgets": "~2.4.0"
2424
},
2525
"devDependencies": {

0 commit comments

Comments
 (0)