Skip to content

Commit e519d5a

Browse files
committed
update plotly.js to v3.3.0
1 parent 22b0ac0 commit e519d5a

File tree

11 files changed

+728
-66
lines changed

11 files changed

+728
-66
lines changed

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`.",

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.2.0",
22+
"plotly.js": "3.3.0",
2323
"@lumino/widgets": "~2.4.0"
2424
},
2525
"devDependencies": {

plotly/graph_objs/_candlestick.py

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class Candlestick(_BaseTraceType):
1919
"hoverinfo",
2020
"hoverinfosrc",
2121
"hoverlabel",
22+
"hovertemplate",
23+
"hovertemplatefallback",
24+
"hovertemplatesrc",
2225
"hovertext",
2326
"hovertextsrc",
2427
"ids",
@@ -254,6 +257,92 @@ def hoverlabel(self):
254257
def hoverlabel(self, val):
255258
self["hoverlabel"] = val
256259

260+
@property
261+
def hovertemplate(self):
262+
"""
263+
Template string used for rendering the information that appear
264+
on hover box. Note that this will override `hoverinfo`.
265+
Variables are inserted using %{variable}, for example "y: %{y}"
266+
as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When
267+
showing info for several points, "xother" will be added to
268+
those with different x positions from the first point. An
269+
underscore before or after "(x|y)other" will add a space on
270+
that side, only when this field is shown. Numbers are formatted
271+
using d3-format's syntax %{variable:d3-format}, for example
272+
"Price: %{y:$.2f}".
273+
https://github.com/d3/d3-format/tree/v1.4.5#d3-format for
274+
details on the formatting syntax. Dates are formatted using
275+
d3-time-format's syntax %{variable|d3-time-format}, for example
276+
"Day: %{2019-01-01|%A}". https://github.com/d3/d3-time-
277+
format/tree/v2.2.3#locale_format for details on the date
278+
formatting syntax. Variables that can't be found will be
279+
replaced with the specifier. For example, a template of "data:
280+
%{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1
281+
and y is missing. Variables with an undefined value will be
282+
replaced with the fallback value. The variables available in
283+
`hovertemplate` are the ones emitted as event data described at
284+
this link https://plotly.com/javascript/plotlyjs-events/#event-
285+
data. Additionally, all attributes that can be specified per-
286+
point (the ones that are `arrayOk: true`) are available.
287+
Finally, the template string has access to variables `open`,
288+
`high`, `low` and `close`. Anything contained in tag `<extra>`
289+
is displayed in the secondary box, for example
290+
`<extra>%{fullData.name}</extra>`. To hide the secondary box
291+
completely, use an empty tag `<extra></extra>`.
292+
293+
The 'hovertemplate' property is a string and must be specified as:
294+
- A string
295+
- A number that will be converted to a string
296+
- A tuple, list, or one-dimensional numpy array of the above
297+
298+
Returns
299+
-------
300+
str|numpy.ndarray
301+
"""
302+
return self["hovertemplate"]
303+
304+
@hovertemplate.setter
305+
def hovertemplate(self, val):
306+
self["hovertemplate"] = val
307+
308+
@property
309+
def hovertemplatefallback(self):
310+
"""
311+
Fallback string that's displayed when a variable referenced in
312+
a template is missing. If the boolean value 'false' is passed
313+
in, the specifier with the missing variable will be displayed.
314+
315+
The 'hovertemplatefallback' property accepts values of any type
316+
317+
Returns
318+
-------
319+
Any
320+
"""
321+
return self["hovertemplatefallback"]
322+
323+
@hovertemplatefallback.setter
324+
def hovertemplatefallback(self, val):
325+
self["hovertemplatefallback"] = val
326+
327+
@property
328+
def hovertemplatesrc(self):
329+
"""
330+
Sets the source reference on Chart Studio Cloud for
331+
`hovertemplate`.
332+
333+
The 'hovertemplatesrc' property must be specified as a string or
334+
as a plotly.grid_objs.Column object
335+
336+
Returns
337+
-------
338+
str
339+
"""
340+
return self["hovertemplatesrc"]
341+
342+
@hovertemplatesrc.setter
343+
def hovertemplatesrc(self, val):
344+
self["hovertemplatesrc"] = val
345+
257346
@property
258347
def hovertext(self):
259348
"""
@@ -1105,6 +1194,50 @@ def _prop_descriptions(self):
11051194
hoverlabel
11061195
:class:`plotly.graph_objects.candlestick.Hoverlabel`
11071196
instance or dict with compatible properties
1197+
hovertemplate
1198+
Template string used for rendering the information that
1199+
appear on hover box. Note that this will override
1200+
`hoverinfo`. Variables are inserted using %{variable},
1201+
for example "y: %{y}" as well as %{xother}, {%_xother},
1202+
{%_xother_}, {%xother_}. When showing info for several
1203+
points, "xother" will be added to those with different
1204+
x positions from the first point. An underscore before
1205+
or after "(x|y)other" will add a space on that side,
1206+
only when this field is shown. Numbers are formatted
1207+
using d3-format's syntax %{variable:d3-format}, for
1208+
example "Price: %{y:$.2f}".
1209+
https://github.com/d3/d3-format/tree/v1.4.5#d3-format
1210+
for details on the formatting syntax. Dates are
1211+
formatted using d3-time-format's syntax
1212+
%{variable|d3-time-format}, for example "Day:
1213+
%{2019-01-01|%A}". https://github.com/d3/d3-time-
1214+
format/tree/v2.2.3#locale_format for details on the
1215+
date formatting syntax. Variables that can't be found
1216+
will be replaced with the specifier. For example, a
1217+
template of "data: %{x}, %{y}" will result in a value
1218+
of "data: 1, %{y}" if x is 1 and y is missing.
1219+
Variables with an undefined value will be replaced with
1220+
the fallback value. The variables available in
1221+
`hovertemplate` are the ones emitted as event data
1222+
described at this link
1223+
https://plotly.com/javascript/plotlyjs-events/#event-
1224+
data. Additionally, all attributes that can be
1225+
specified per-point (the ones that are `arrayOk: true`)
1226+
are available. Finally, the template string has access
1227+
to variables `open`, `high`, `low` and `close`.
1228+
Anything contained in tag `<extra>` is displayed in the
1229+
secondary box, for example
1230+
`<extra>%{fullData.name}</extra>`. To hide the
1231+
secondary box completely, use an empty tag
1232+
`<extra></extra>`.
1233+
hovertemplatefallback
1234+
Fallback string that's displayed when a variable
1235+
referenced in a template is missing. If the boolean
1236+
value 'false' is passed in, the specifier with the
1237+
missing variable will be displayed.
1238+
hovertemplatesrc
1239+
Sets the source reference on Chart Studio Cloud for
1240+
`hovertemplate`.
11081241
hovertext
11091242
Same as `text`.
11101243
hovertextsrc
@@ -1313,6 +1446,9 @@ def __init__(
13131446
hoverinfo=None,
13141447
hoverinfosrc=None,
13151448
hoverlabel=None,
1449+
hovertemplate=None,
1450+
hovertemplatefallback=None,
1451+
hovertemplatesrc=None,
13161452
hovertext=None,
13171453
hovertextsrc=None,
13181454
ids=None,
@@ -1403,6 +1539,50 @@ def __init__(
14031539
hoverlabel
14041540
:class:`plotly.graph_objects.candlestick.Hoverlabel`
14051541
instance or dict with compatible properties
1542+
hovertemplate
1543+
Template string used for rendering the information that
1544+
appear on hover box. Note that this will override
1545+
`hoverinfo`. Variables are inserted using %{variable},
1546+
for example "y: %{y}" as well as %{xother}, {%_xother},
1547+
{%_xother_}, {%xother_}. When showing info for several
1548+
points, "xother" will be added to those with different
1549+
x positions from the first point. An underscore before
1550+
or after "(x|y)other" will add a space on that side,
1551+
only when this field is shown. Numbers are formatted
1552+
using d3-format's syntax %{variable:d3-format}, for
1553+
example "Price: %{y:$.2f}".
1554+
https://github.com/d3/d3-format/tree/v1.4.5#d3-format
1555+
for details on the formatting syntax. Dates are
1556+
formatted using d3-time-format's syntax
1557+
%{variable|d3-time-format}, for example "Day:
1558+
%{2019-01-01|%A}". https://github.com/d3/d3-time-
1559+
format/tree/v2.2.3#locale_format for details on the
1560+
date formatting syntax. Variables that can't be found
1561+
will be replaced with the specifier. For example, a
1562+
template of "data: %{x}, %{y}" will result in a value
1563+
of "data: 1, %{y}" if x is 1 and y is missing.
1564+
Variables with an undefined value will be replaced with
1565+
the fallback value. The variables available in
1566+
`hovertemplate` are the ones emitted as event data
1567+
described at this link
1568+
https://plotly.com/javascript/plotlyjs-events/#event-
1569+
data. Additionally, all attributes that can be
1570+
specified per-point (the ones that are `arrayOk: true`)
1571+
are available. Finally, the template string has access
1572+
to variables `open`, `high`, `low` and `close`.
1573+
Anything contained in tag `<extra>` is displayed in the
1574+
secondary box, for example
1575+
`<extra>%{fullData.name}</extra>`. To hide the
1576+
secondary box completely, use an empty tag
1577+
`<extra></extra>`.
1578+
hovertemplatefallback
1579+
Fallback string that's displayed when a variable
1580+
referenced in a template is missing. If the boolean
1581+
value 'false' is passed in, the specifier with the
1582+
missing variable will be displayed.
1583+
hovertemplatesrc
1584+
Sets the source reference on Chart Studio Cloud for
1585+
`hovertemplate`.
14061586
hovertext
14071587
Same as `text`.
14081588
hovertextsrc
@@ -1631,6 +1811,9 @@ def __init__(
16311811
self._set_property("hoverinfo", arg, hoverinfo)
16321812
self._set_property("hoverinfosrc", arg, hoverinfosrc)
16331813
self._set_property("hoverlabel", arg, hoverlabel)
1814+
self._set_property("hovertemplate", arg, hovertemplate)
1815+
self._set_property("hovertemplatefallback", arg, hovertemplatefallback)
1816+
self._set_property("hovertemplatesrc", arg, hovertemplatesrc)
16341817
self._set_property("hovertext", arg, hovertext)
16351818
self._set_property("hovertextsrc", arg, hovertextsrc)
16361819
self._set_property("ids", arg, ids)

0 commit comments

Comments
 (0)