Skip to content

Commit c7a38b6

Browse files
committed
Merge remote-tracking branch 'origin/main' into docs-update-next-release
2 parents 052efc9 + 1f2e4bc commit c7a38b6

File tree

135 files changed

+4826
-881
lines changed

Some content is hidden

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

135 files changed

+4826
-881
lines changed

CHANGELOG.md

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

55
## Unreleased
66

7+
## [6.3.0] - 2025-08-12
8+
79
### Updated
8-
- Updated Plotly.js from version 3.0.1 to version 3.0.3. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#303----2025-07-23) for more information.
10+
- Updated Plotly.js from version 3.0.1 to version 3.1.0. See the plotly.js [release notes](https://github.com/plotly/plotly.js/releases) for more information. [[#5318](https://github.com/plotly/plotly.py/pull/5318)]
911

1012
### Added
1113
- Exposed `plotly.io.get_chrome()` as a function which can be called from within a Python script. [[#5282](https://github.com/plotly/plotly.py/pull/5282)]
1214

15+
### Fixed
16+
- Resolved issue causing extraneous engine deprecation warnings [[#5287](https://github.com/plotly/plotly.py/pull/5287)], with thanks to @jdbeel for the contribution!
17+
1318
## [6.2.0] - 2025-06-26
1419

1520
### Added

codegen/datatypes.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"choroplethmapbox",
1111
"densitymapbox",
1212
]
13+
locationmode_traces = [
14+
"choropleth",
15+
"scattergeo",
16+
]
1317

1418

1519
def get_typing_type(plotly_type, array_ok=False):
@@ -100,6 +104,7 @@ def build_datatype_py(node):
100104

101105
if (
102106
node.name_property in deprecated_mapbox_traces
107+
or node.name_property in locationmode_traces
103108
or node.name_property == "template"
104109
):
105110
buffer.write("import warnings\n")
@@ -341,6 +346,27 @@ def __init__(self"""
341346
constructor must be a dict or
342347
an instance of :class:`{class_name}`\"\"\")
343348
349+
"""
350+
)
351+
352+
# Add warning for 'country names' locationmode
353+
if node.name_property in locationmode_traces:
354+
buffer.write(
355+
f"""
356+
if locationmode == "country names" and kwargs.get("_validate"):
357+
warnings.warn(
358+
"The library used by the *country names* `locationmode` option is changing in an upcoming version. "
359+
"Country names in existing plots may not work in the new version. "
360+
"To ensure consistent behavior, consider setting `locationmode` to *ISO-3*.",
361+
DeprecationWarning,
362+
stacklevel=5,
363+
)
364+
365+
"""
366+
)
367+
368+
buffer.write(
369+
f"""
344370
self._skip_invalid = kwargs.pop("skip_invalid", False)
345371
self._validate = kwargs.pop("_validate", True)
346372
"""

codegen/resources/plot-schema.json

Lines changed: 601 additions & 102 deletions
Large diffs are not rendered by default.

js/package-lock.json

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

js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"dependencies": {
2121
"lodash-es": "^4.17.21",
22-
"plotly.js": "3.0.3",
22+
"plotly.js": "3.1.0",
2323
"@lumino/widgets": "~2.4.0"
2424
},
2525
"devDependencies": {

plotly/express/_chart_types.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,16 @@ def choropleth(
11101110
In a choropleth map, each row of `data_frame` is represented by a
11111111
colored region mark on a map.
11121112
"""
1113+
1114+
if locationmode == "country names":
1115+
warn(
1116+
"The library used by the *country names* `locationmode` option is changing in an upcoming version. "
1117+
"Country names in existing plots may not work in the new version. "
1118+
"To ensure consistent behavior, consider setting `locationmode` to *ISO-3*.",
1119+
DeprecationWarning,
1120+
stacklevel=2,
1121+
)
1122+
11131123
return make_figure(
11141124
args=locals(),
11151125
constructor=go.Choropleth,
@@ -1168,6 +1178,16 @@ def scatter_geo(
11681178
In a geographic scatter plot, each row of `data_frame` is represented
11691179
by a symbol mark on a map.
11701180
"""
1181+
1182+
if locationmode == "country names":
1183+
warn(
1184+
"The library used by the *country names* `locationmode` option is changing in an upcoming version. "
1185+
"Country names in existing plots may not work in the new version. "
1186+
"To ensure consistent behavior, consider setting `locationmode` to *ISO-3*.",
1187+
DeprecationWarning,
1188+
stacklevel=2,
1189+
)
1190+
11711191
return make_figure(
11721192
args=locals(),
11731193
constructor=go.Scattergeo,

plotly/graph_objs/_bar.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ def hovertemplate(self):
386386
(the ones that are `arrayOk: true`) are available. Finally, the
387387
template string has access to variables `value` and `label`.
388388
Anything contained in tag `<extra>` is displayed in the
389-
secondary box, for example "<extra>{fullData.name}</extra>". To
390-
hide the secondary box completely, use an empty tag
389+
secondary box, for example `<extra>%{fullData.name}</extra>`.
390+
To hide the secondary box completely, use an empty tag
391391
`<extra></extra>`.
392392
393393
The 'hovertemplate' property is a string and must be specified as:
@@ -1731,7 +1731,7 @@ def _prop_descriptions(self):
17311731
are available. Finally, the template string has access
17321732
to variables `value` and `label`. Anything contained in
17331733
tag `<extra>` is displayed in the secondary box, for
1734-
example "<extra>{fullData.name}</extra>". To hide the
1734+
example `<extra>%{fullData.name}</extra>`. To hide the
17351735
secondary box completely, use an empty tag
17361736
`<extra></extra>`.
17371737
hovertemplatesrc
@@ -2197,7 +2197,7 @@ def __init__(
21972197
are available. Finally, the template string has access
21982198
to variables `value` and `label`. Anything contained in
21992199
tag `<extra>` is displayed in the secondary box, for
2200-
example "<extra>{fullData.name}</extra>". To hide the
2200+
example `<extra>%{fullData.name}</extra>`. To hide the
22012201
secondary box completely, use an empty tag
22022202
`<extra></extra>`.
22032203
hovertemplatesrc

plotly/graph_objs/_barpolar.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def hovertemplate(self):
260260
Additionally, every attributes that can be specified per-point
261261
(the ones that are `arrayOk: true`) are available. Anything
262262
contained in tag `<extra>` is displayed in the secondary box,
263-
for example "<extra>{fullData.name}</extra>". To hide the
263+
for example `<extra>%{fullData.name}</extra>`. To hide the
264264
secondary box completely, use an empty tag `<extra></extra>`.
265265
266266
The 'hovertemplate' property is a string and must be specified as:
@@ -1086,8 +1086,9 @@ def _prop_descriptions(self):
10861086
specified per-point (the ones that are `arrayOk: true`)
10871087
are available. Anything contained in tag `<extra>` is
10881088
displayed in the secondary box, for example
1089-
"<extra>{fullData.name}</extra>". To hide the secondary
1090-
box completely, use an empty tag `<extra></extra>`.
1089+
`<extra>%{fullData.name}</extra>`. To hide the
1090+
secondary box completely, use an empty tag
1091+
`<extra></extra>`.
10911092
hovertemplatesrc
10921093
Sets the source reference on Chart Studio Cloud for
10931094
`hovertemplate`.
@@ -1368,8 +1369,9 @@ def __init__(
13681369
specified per-point (the ones that are `arrayOk: true`)
13691370
are available. Anything contained in tag `<extra>` is
13701371
displayed in the secondary box, for example
1371-
"<extra>{fullData.name}</extra>". To hide the secondary
1372-
box completely, use an empty tag `<extra></extra>`.
1372+
`<extra>%{fullData.name}</extra>`. To hide the
1373+
secondary box completely, use an empty tag
1374+
`<extra></extra>`.
13731375
hovertemplatesrc
13741376
Sets the source reference on Chart Studio Cloud for
13751377
`hovertemplate`.

plotly/graph_objs/_box.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ def hovertemplate(self):
377377
Additionally, every attributes that can be specified per-point
378378
(the ones that are `arrayOk: true`) are available. Anything
379379
contained in tag `<extra>` is displayed in the secondary box,
380-
for example "<extra>{fullData.name}</extra>". To hide the
380+
for example `<extra>%{fullData.name}</extra>`. To hide the
381381
secondary box completely, use an empty tag `<extra></extra>`.
382382
383383
The 'hovertemplate' property is a string and must be specified as:
@@ -1996,8 +1996,9 @@ def _prop_descriptions(self):
19961996
specified per-point (the ones that are `arrayOk: true`)
19971997
are available. Anything contained in tag `<extra>` is
19981998
displayed in the secondary box, for example
1999-
"<extra>{fullData.name}</extra>". To hide the secondary
2000-
box completely, use an empty tag `<extra></extra>`.
1999+
`<extra>%{fullData.name}</extra>`. To hide the
2000+
secondary box completely, use an empty tag
2001+
`<extra></extra>`.
20012002
hovertemplatesrc
20022003
Sets the source reference on Chart Studio Cloud for
20032004
`hovertemplate`.
@@ -2567,8 +2568,9 @@ def __init__(
25672568
specified per-point (the ones that are `arrayOk: true`)
25682569
are available. Anything contained in tag `<extra>` is
25692570
displayed in the secondary box, for example
2570-
"<extra>{fullData.name}</extra>". To hide the secondary
2571-
box completely, use an empty tag `<extra></extra>`.
2571+
`<extra>%{fullData.name}</extra>`. To hide the
2572+
secondary box completely, use an empty tag
2573+
`<extra></extra>`.
25722574
hovertemplatesrc
25732575
Sets the source reference on Chart Studio Cloud for
25742576
`hovertemplate`.

plotly/graph_objs/_choropleth.py

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
from plotly.basedatatypes import BaseTraceType as _BaseTraceType
55
import copy as _copy
6+
import warnings
67

78

89
class Choropleth(_BaseTraceType):
@@ -370,7 +371,7 @@ def hovertemplate(self):
370371
Additionally, every attributes that can be specified per-point
371372
(the ones that are `arrayOk: true`) are available. Anything
372373
contained in tag `<extra>` is displayed in the secondary box,
373-
for example "<extra>{fullData.name}</extra>". To hide the
374+
for example `<extra>%{fullData.name}</extra>`. To hide the
374375
secondary box completely, use an empty tag `<extra></extra>`.
375376
376377
The 'hovertemplate' property is a string and must be specified as:
@@ -594,11 +595,14 @@ def legendwidth(self, val):
594595
@property
595596
def locationmode(self):
596597
"""
597-
Determines the set of locations used to match entries in
598-
`locations` to regions on the map. Values "ISO-3", "USA-
599-
states", *country names* correspond to features on the base map
600-
and value "geojson-id" corresponds to features from a custom
601-
GeoJSON linked to the `geojson` attribute.
598+
The library used by the *country names* `locationmode` option
599+
is changing in an upcoming version. Country names in existing
600+
plots may not work in the new version. Determines the set of
601+
locations used to match entries in `locations` to regions on
602+
the map. Values "ISO-3", "USA-states", *country names*
603+
correspond to features on the base map and value "geojson-id"
604+
corresponds to features from a custom GeoJSON linked to the
605+
`geojson` attribute.
602606
603607
The 'locationmode' property is an enumeration that may be specified as:
604608
- One of the following enumeration values:
@@ -1196,8 +1200,9 @@ def _prop_descriptions(self):
11961200
specified per-point (the ones that are `arrayOk: true`)
11971201
are available. Anything contained in tag `<extra>` is
11981202
displayed in the secondary box, for example
1199-
"<extra>{fullData.name}</extra>". To hide the secondary
1200-
box completely, use an empty tag `<extra></extra>`.
1203+
`<extra>%{fullData.name}</extra>`. To hide the
1204+
secondary box completely, use an empty tag
1205+
`<extra></extra>`.
12011206
hovertemplatesrc
12021207
Sets the source reference on Chart Studio Cloud for
12031208
`hovertemplate`.
@@ -1241,12 +1246,15 @@ def _prop_descriptions(self):
12411246
Sets the width (in px or fraction) of the legend for
12421247
this trace.
12431248
locationmode
1244-
Determines the set of locations used to match entries
1245-
in `locations` to regions on the map. Values "ISO-3",
1246-
"USA-states", *country names* correspond to features on
1247-
the base map and value "geojson-id" corresponds to
1248-
features from a custom GeoJSON linked to the `geojson`
1249-
attribute.
1249+
The library used by the *country names* `locationmode`
1250+
option is changing in an upcoming version. Country
1251+
names in existing plots may not work in the new
1252+
version. Determines the set of locations used to match
1253+
entries in `locations` to regions on the map. Values
1254+
"ISO-3", "USA-states", *country names* correspond to
1255+
features on the base map and value "geojson-id"
1256+
corresponds to features from a custom GeoJSON linked to
1257+
the `geojson` attribute.
12501258
locations
12511259
Sets the coordinates via location IDs or names. See
12521260
`locationmode` for more info.
@@ -1515,8 +1523,9 @@ def __init__(
15151523
specified per-point (the ones that are `arrayOk: true`)
15161524
are available. Anything contained in tag `<extra>` is
15171525
displayed in the secondary box, for example
1518-
"<extra>{fullData.name}</extra>". To hide the secondary
1519-
box completely, use an empty tag `<extra></extra>`.
1526+
`<extra>%{fullData.name}</extra>`. To hide the
1527+
secondary box completely, use an empty tag
1528+
`<extra></extra>`.
15201529
hovertemplatesrc
15211530
Sets the source reference on Chart Studio Cloud for
15221531
`hovertemplate`.
@@ -1560,12 +1569,15 @@ def __init__(
15601569
Sets the width (in px or fraction) of the legend for
15611570
this trace.
15621571
locationmode
1563-
Determines the set of locations used to match entries
1564-
in `locations` to regions on the map. Values "ISO-3",
1565-
"USA-states", *country names* correspond to features on
1566-
the base map and value "geojson-id" corresponds to
1567-
features from a custom GeoJSON linked to the `geojson`
1568-
attribute.
1572+
The library used by the *country names* `locationmode`
1573+
option is changing in an upcoming version. Country
1574+
names in existing plots may not work in the new
1575+
version. Determines the set of locations used to match
1576+
entries in `locations` to regions on the map. Values
1577+
"ISO-3", "USA-states", *country names* correspond to
1578+
features on the base map and value "geojson-id"
1579+
corresponds to features from a custom GeoJSON linked to
1580+
the `geojson` attribute.
15691581
locations
15701582
Sets the coordinates via location IDs or names. See
15711583
`locationmode` for more info.
@@ -1697,6 +1709,15 @@ def __init__(
16971709
constructor must be a dict or
16981710
an instance of :class:`plotly.graph_objs.Choropleth`""")
16991711

1712+
if locationmode == "country names" and kwargs.get("_validate"):
1713+
warnings.warn(
1714+
"The library used by the *country names* `locationmode` option is changing in an upcoming version. "
1715+
"Country names in existing plots may not work in the new version. "
1716+
"To ensure consistent behavior, consider setting `locationmode` to *ISO-3*.",
1717+
DeprecationWarning,
1718+
stacklevel=5,
1719+
)
1720+
17001721
self._skip_invalid = kwargs.pop("skip_invalid", False)
17011722
self._validate = kwargs.pop("_validate", True)
17021723

0 commit comments

Comments
 (0)