Skip to content

Commit 378f1fe

Browse files
committed
update plotly js to 2.30.0
1 parent 6745ef1 commit 378f1fe

File tree

24 files changed

+605
-30
lines changed

24 files changed

+605
-30
lines changed

Diff for: CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## UNRELEASED
6+
7+
### Updated
8+
- Updated Plotly.js from version 2.29.1 to version 2.30.0. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2300----2024-03-06) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module. Notable changes include:
9+
- Add fill gradients for scatter traces [[#6905](https://github.com/plotly/plotly.js/pull/6905)], with thanks to @lumip for the contribution!
10+
- Add `indentation` to legend [[#6874](https://github.com/plotly/plotly.js/pull/6874)], with thanks to @my-tien for the contribution!
11+
12+
513
## [5.19.0] - 2024-02-15
614

715
### Updated

Diff for: packages/javascript/jupyterlab-plotly/package-lock.json

+15-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: packages/javascript/jupyterlab-plotly/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"@lumino/messaging": "^1.2.3",
6666
"@lumino/widgets": "^1.8.1",
6767
"lodash": "^4.17.4",
68-
"plotly.js": "^2.29.1"
68+
"plotly.js": "^2.30.0"
6969
},
7070
"jupyterlab": {
7171
"extension": "lib/jupyterlab-plugin",

Diff for: packages/python/plotly/codegen/resources/plot-schema.json

+40-1
Original file line numberDiff line numberDiff line change
@@ -2848,6 +2848,13 @@
28482848
"valType": "number"
28492849
}
28502850
},
2851+
"indentation": {
2852+
"description": "Sets the indentation (in px) of the legend entries.",
2853+
"dflt": 0,
2854+
"editType": "legend",
2855+
"min": -15,
2856+
"valType": "number"
2857+
},
28512858
"itemclick": {
28522859
"description": "Determines the behavior on legend item click. *toggle* toggles the visibility of the item clicked on the graph. *toggleothers* makes the clicked item the sole visible item on the graph. *false* disables legend item click interactions.",
28532860
"dflt": "toggle",
@@ -45035,10 +45042,42 @@
4503545042
},
4503645043
"fillcolor": {
4503745044
"anim": true,
45038-
"description": "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.",
45045+
"description": "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available. If fillgradient is specified, fillcolor is ignored except for setting the background color of the hover label, if any.",
4503945046
"editType": "style",
4504045047
"valType": "color"
4504145048
},
45049+
"fillgradient": {
45050+
"colorscale": {
45051+
"description": "Sets the fill gradient colors as a color scale. The color scale is interpreted as a gradient applied in the direction specified by *orientation*, from the lowest to the highest value of the scatter plot along that axis, or from the center to the most distant point from it, if orientation is *radial*.",
45052+
"editType": "style",
45053+
"valType": "colorscale"
45054+
},
45055+
"description": "Sets a fill gradient. If not specified, the fillcolor is used instead.",
45056+
"editType": "calc",
45057+
"role": "object",
45058+
"start": {
45059+
"description": "Sets the gradient start value. It is given as the absolute position on the axis determined by the orientiation. E.g., if orientation is *horizontal*, the gradient will be horizontal and start from the x-position given by start. If omitted, the gradient starts at the lowest value of the trace along the respective axis. Ignored if orientation is *radial*.",
45060+
"editType": "calc",
45061+
"valType": "number"
45062+
},
45063+
"stop": {
45064+
"description": "Sets the gradient end value. It is given as the absolute position on the axis determined by the orientiation. E.g., if orientation is *horizontal*, the gradient will be horizontal and end at the x-position given by end. If omitted, the gradient ends at the highest value of the trace along the respective axis. Ignored if orientation is *radial*.",
45065+
"editType": "calc",
45066+
"valType": "number"
45067+
},
45068+
"type": {
45069+
"description": "Sets the type/orientation of the color gradient for the fill. Defaults to *none*.",
45070+
"dflt": "none",
45071+
"editType": "calc",
45072+
"valType": "enumerated",
45073+
"values": [
45074+
"radial",
45075+
"horizontal",
45076+
"vertical",
45077+
"none"
45078+
]
45079+
}
45080+
},
4504245081
"fillpattern": {
4504345082
"bgcolor": {
4504445083
"arrayOk": true,

Diff for: packages/python/plotly/plotly/graph_objs/_figure.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -13179,6 +13179,7 @@ def add_scatter(
1317913179
error_y=None,
1318013180
fill=None,
1318113181
fillcolor=None,
13182+
fillgradient=None,
1318213183
fillpattern=None,
1318313184
groupnorm=None,
1318413185
hoverinfo=None,
@@ -13315,7 +13316,12 @@ def add_scatter(
1331513316
fillcolor
1331613317
Sets the fill color. Defaults to a half-transparent
1331713318
variant of the line color, marker color, or marker line
13318-
color, whichever is available.
13319+
color, whichever is available. If fillgradient is
13320+
specified, fillcolor is ignored except for setting the
13321+
background color of the hover label, if any.
13322+
fillgradient
13323+
Sets a fill gradient. If not specified, the fillcolor
13324+
is used instead.
1331913325
fillpattern
1332013326
Sets the pattern within the marker.
1332113327
groupnorm
@@ -13705,6 +13711,7 @@ def add_scatter(
1370513711
error_y=error_y,
1370613712
fill=fill,
1370713713
fillcolor=fillcolor,
13714+
fillgradient=fillgradient,
1370813715
fillpattern=fillpattern,
1370913716
groupnorm=groupnorm,
1371013717
hoverinfo=hoverinfo,

Diff for: packages/python/plotly/plotly/graph_objs/_figurewidget.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -13183,6 +13183,7 @@ def add_scatter(
1318313183
error_y=None,
1318413184
fill=None,
1318513185
fillcolor=None,
13186+
fillgradient=None,
1318613187
fillpattern=None,
1318713188
groupnorm=None,
1318813189
hoverinfo=None,
@@ -13319,7 +13320,12 @@ def add_scatter(
1331913320
fillcolor
1332013321
Sets the fill color. Defaults to a half-transparent
1332113322
variant of the line color, marker color, or marker line
13322-
color, whichever is available.
13323+
color, whichever is available. If fillgradient is
13324+
specified, fillcolor is ignored except for setting the
13325+
background color of the hover label, if any.
13326+
fillgradient
13327+
Sets a fill gradient. If not specified, the fillcolor
13328+
is used instead.
1332313329
fillpattern
1332413330
Sets the pattern within the marker.
1332513331
groupnorm
@@ -13709,6 +13715,7 @@ def add_scatter(
1370913715
error_y=error_y,
1371013716
fill=fill,
1371113717
fillcolor=fillcolor,
13718+
fillgradient=fillgradient,
1371213719
fillpattern=fillpattern,
1371313720
groupnorm=groupnorm,
1371413721
hoverinfo=hoverinfo,

Diff for: packages/python/plotly/plotly/graph_objs/_layout.py

+3
Original file line numberDiff line numberDiff line change
@@ -2018,6 +2018,9 @@ def legend(self):
20182018
Sets the font for group titles in legend.
20192019
Defaults to `legend.font` with its size
20202020
increased about 10%.
2021+
indentation
2022+
Sets the indentation (in px) of the legend
2023+
entries.
20212024
itemclick
20222025
Determines the behavior on legend item click.
20232026
"toggle" toggles the visibility of the item

Diff for: packages/python/plotly/plotly/graph_objs/_scatter.py

+77-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Scatter(_BaseTraceType):
2020
"error_y",
2121
"fill",
2222
"fillcolor",
23+
"fillgradient",
2324
"fillpattern",
2425
"groupnorm",
2526
"hoverinfo",
@@ -442,7 +443,9 @@ def fillcolor(self):
442443
"""
443444
Sets the fill color. Defaults to a half-transparent variant of
444445
the line color, marker color, or marker line color, whichever
445-
is available.
446+
is available. If fillgradient is specified, fillcolor is
447+
ignored except for setting the background color of the hover
448+
label, if any.
446449
447450
The 'fillcolor' property is a color and may be specified as:
448451
- A hex string (e.g. '#ff0000')
@@ -496,6 +499,62 @@ def fillcolor(self):
496499
def fillcolor(self, val):
497500
self["fillcolor"] = val
498501

502+
# fillgradient
503+
# ------------
504+
@property
505+
def fillgradient(self):
506+
"""
507+
Sets a fill gradient. If not specified, the fillcolor is used
508+
instead.
509+
510+
The 'fillgradient' property is an instance of Fillgradient
511+
that may be specified as:
512+
- An instance of :class:`plotly.graph_objs.scatter.Fillgradient`
513+
- A dict of string/value properties that will be passed
514+
to the Fillgradient constructor
515+
516+
Supported dict properties:
517+
518+
colorscale
519+
Sets the fill gradient colors as a color scale.
520+
The color scale is interpreted as a gradient
521+
applied in the direction specified by
522+
"orientation", from the lowest to the highest
523+
value of the scatter plot along that axis, or
524+
from the center to the most distant point from
525+
it, if orientation is "radial".
526+
start
527+
Sets the gradient start value. It is given as
528+
the absolute position on the axis determined by
529+
the orientiation. E.g., if orientation is
530+
"horizontal", the gradient will be horizontal
531+
and start from the x-position given by start.
532+
If omitted, the gradient starts at the lowest
533+
value of the trace along the respective axis.
534+
Ignored if orientation is "radial".
535+
stop
536+
Sets the gradient end value. It is given as the
537+
absolute position on the axis determined by the
538+
orientiation. E.g., if orientation is
539+
"horizontal", the gradient will be horizontal
540+
and end at the x-position given by end. If
541+
omitted, the gradient ends at the highest value
542+
of the trace along the respective axis. Ignored
543+
if orientation is "radial".
544+
type
545+
Sets the type/orientation of the color gradient
546+
for the fill. Defaults to "none".
547+
548+
Returns
549+
-------
550+
plotly.graph_objs.scatter.Fillgradient
551+
"""
552+
return self["fillgradient"]
553+
554+
@fillgradient.setter
555+
def fillgradient(self, val):
556+
self["fillgradient"] = val
557+
499558
# fillpattern
500559
# -----------
501560
@property
@@ -2376,7 +2435,12 @@ def _prop_descriptions(self):
23762435
fillcolor
23772436
Sets the fill color. Defaults to a half-transparent
23782437
variant of the line color, marker color, or marker line
2379-
color, whichever is available.
2438+
color, whichever is available. If fillgradient is
2439+
specified, fillcolor is ignored except for setting the
2440+
background color of the hover label, if any.
2441+
fillgradient
2442+
Sets a fill gradient. If not specified, the fillcolor
2443+
is used instead.
23802444
fillpattern
23812445
Sets the pattern within the marker.
23822446
groupnorm
@@ -2743,6 +2807,7 @@ def __init__(
27432807
error_y=None,
27442808
fill=None,
27452809
fillcolor=None,
2810+
fillgradient=None,
27462811
fillpattern=None,
27472812
groupnorm=None,
27482813
hoverinfo=None,
@@ -2879,7 +2944,12 @@ def __init__(
28792944
fillcolor
28802945
Sets the fill color. Defaults to a half-transparent
28812946
variant of the line color, marker color, or marker line
2882-
color, whichever is available.
2947+
color, whichever is available. If fillgradient is
2948+
specified, fillcolor is ignored except for setting the
2949+
background color of the hover label, if any.
2950+
fillgradient
2951+
Sets a fill gradient. If not specified, the fillcolor
2952+
is used instead.
28832953
fillpattern
28842954
Sets the pattern within the marker.
28852955
groupnorm
@@ -3308,6 +3378,10 @@ def __init__(
33083378
_v = fillcolor if fillcolor is not None else _v
33093379
if _v is not None:
33103380
self["fillcolor"] = _v
3381+
_v = arg.pop("fillgradient", None)
3382+
_v = fillgradient if fillgradient is not None else _v
3383+
if _v is not None:
3384+
self["fillgradient"] = _v
33113385
_v = arg.pop("fillpattern", None)
33123386
_v = fillpattern if fillpattern is not None else _v
33133387
if _v is not None:

0 commit comments

Comments
 (0)