Skip to content

Commit eb1dfd8

Browse files
authored
Merge branch 'doc-prod' into add-maps
2 parents a90127a + 9438a05 commit eb1dfd8

File tree

25 files changed

+5821
-5120
lines changed

25 files changed

+5821
-5120
lines changed

CHANGELOG.md

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

55
## Unreleased
66

7+
## [6.5.0] - 2025-11-17
8+
9+
### Updated
10+
- Update plotly.js from version 3.2.0 to version 3.3.0. See the plotly.js [release notes](https://github.com/plotly/plotly.js/releases/tag/v3.3.0) for more information. [[#5421](https://github.com/plotly/plotly.py/pull/5421)]. Notable changes include:
11+
- Add `hovertemplate` for `candlestick` and `ohlc` traces [[#7619](https://github.com/plotly/plotly.js/pull/7619)]
12+
13+
### Fixed
14+
- Fix bug where numpy datetime contained in Python list was converted to integer [[#5415](https://github.com/plotly/plotly.py/pull/5415)]
15+
716
## [6.4.0] - 2025-11-02
817

918
### Updated

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.4.0
12+
version: 6.5.0
1313
doi: 10.5281/zenodo.14503524
14-
date-released: 2025-11-02
14+
date-released: 2025-11-17
1515
url: "https://github.com/plotly/plotly.py"

_plotly_utils/basevalidators.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ def fullmatch(regex, string, flags=0):
2222
return re.match("(?:" + regex_string + r")\Z", string, flags=flags)
2323

2424

25+
def to_non_numpy_type(np, v):
26+
"""
27+
Convert a numpy scalar value to a native Python type.
28+
Calling .item() on a datetime64[ns] value returns an integer, since
29+
Python datetimes only support microsecond precision. So we cast
30+
datetime64[ns] to datetime64[us] to ensure it remains a datetime.
31+
32+
Should only be used in contexts where we already know `np` is defined.
33+
"""
34+
if hasattr(v, "dtype") and v.dtype == np.dtype("datetime64[ns]"):
35+
return v.astype("datetime64[us]").item()
36+
return v.item()
37+
38+
2539
# Utility functions
2640
# -----------------
2741
def to_scalar_or_list(v):
@@ -35,12 +49,12 @@ def to_scalar_or_list(v):
3549
np = get_module("numpy", should_load=False)
3650
pd = get_module("pandas", should_load=False)
3751
if np and np.isscalar(v) and hasattr(v, "item"):
38-
return v.item()
52+
return to_non_numpy_type(np, v)
3953
if isinstance(v, (list, tuple)):
4054
return [to_scalar_or_list(e) for e in v]
4155
elif np and isinstance(v, np.ndarray):
4256
if v.ndim == 0:
43-
return v.item()
57+
return to_non_numpy_type(np, v)
4458
return [to_scalar_or_list(e) for e in v]
4559
elif pd and isinstance(v, (pd.Series, pd.Index)):
4660
return [to_scalar_or_list(e) for e in v]

codegen/resources/plot-schema.json

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22186,12 +22186,30 @@
2218622186
"valType": "boolean"
2218722187
},
2218822188
"split": {
22189-
"description": "Show hover information (open, close, high, low) in separate labels.",
22189+
"description": "Show hover information (open, close, high, low) in separate labels, rather than a single unified label. Default: *false*. When set to *true*, `hovertemplate` is ignored.",
2219022190
"dflt": false,
2219122191
"editType": "style",
2219222192
"valType": "boolean"
2219322193
}
2219422194
},
22195+
"hovertemplate": {
22196+
"arrayOk": true,
22197+
"description": "Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Variables that can't be found will be replaced with the specifier. For example, a template of \"data: %{x}, %{y}\" will result in a value of \"data: 1, %{y}\" if x is 1 and y is missing. Variables with an undefined value will be replaced with the fallback value. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, all attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Finally, the template string has access to variables `open`, `high`, `low` and `close`. Anything contained in tag `<extra>` is displayed in the secondary box, for example `<extra>%{fullData.name}</extra>`. To hide the secondary box completely, use an empty tag `<extra></extra>`.",
22198+
"dflt": "",
22199+
"editType": "none",
22200+
"valType": "string"
22201+
},
22202+
"hovertemplatefallback": {
22203+
"description": "Fallback string that's displayed when a variable referenced in a template is missing. If the boolean value 'false' is passed in, the specifier with the missing variable will be displayed.",
22204+
"dflt": "-",
22205+
"editType": "none",
22206+
"valType": "any"
22207+
},
22208+
"hovertemplatesrc": {
22209+
"description": "Sets the source reference on Chart Studio Cloud for `hovertemplate`.",
22210+
"editType": "none",
22211+
"valType": "string"
22212+
},
2219522213
"hovertext": {
2219622214
"arrayOk": true,
2219722215
"description": "Same as `text`.",
@@ -52888,12 +52906,30 @@
5288852906
"valType": "boolean"
5288952907
},
5289052908
"split": {
52891-
"description": "Show hover information (open, close, high, low) in separate labels.",
52909+
"description": "Show hover information (open, close, high, low) in separate labels, rather than a single unified label. Default: *false*. When set to *true*, `hovertemplate` is ignored.",
5289252910
"dflt": false,
5289352911
"editType": "style",
5289452912
"valType": "boolean"
5289552913
}
5289652914
},
52915+
"hovertemplate": {
52916+
"arrayOk": true,
52917+
"description": "Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. Variables that can't be found will be replaced with the specifier. For example, a template of \"data: %{x}, %{y}\" will result in a value of \"data: 1, %{y}\" if x is 1 and y is missing. Variables with an undefined value will be replaced with the fallback value. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, all attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. Finally, the template string has access to variables `open`, `high`, `low` and `close`. Anything contained in tag `<extra>` is displayed in the secondary box, for example `<extra>%{fullData.name}</extra>`. To hide the secondary box completely, use an empty tag `<extra></extra>`.",
52918+
"dflt": "",
52919+
"editType": "none",
52920+
"valType": "string"
52921+
},
52922+
"hovertemplatefallback": {
52923+
"description": "Fallback string that's displayed when a variable referenced in a template is missing. If the boolean value 'false' is passed in, the specifier with the missing variable will be displayed.",
52924+
"dflt": "-",
52925+
"editType": "none",
52926+
"valType": "any"
52927+
},
52928+
"hovertemplatesrc": {
52929+
"description": "Sets the source reference on Chart Studio Cloud for `hovertemplate`.",
52930+
"editType": "none",
52931+
"valType": "string"
52932+
},
5289752933
"hovertext": {
5289852934
"arrayOk": true,
5289952935
"description": "Same as `text`.",

doc/apidoc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# The short X.Y version
2525
version = ""
2626
# The full version, including alpha/beta/rc tags
27-
release = "6.4.0"
27+
release = "6.5.0"
2828

2929

3030
# -- General configuration ---------------------------------------------------

doc/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plotly==6.4.0
1+
plotly==6.5.0
22
anywidget
33
cufflinks==0.17.3
44
dash-bio

0 commit comments

Comments
 (0)