Skip to content

Commit

Permalink
update plotly js to 2.30.0
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamConnors committed Mar 8, 2024
1 parent 6745ef1 commit 378f1fe
Show file tree
Hide file tree
Showing 24 changed files with 605 additions and 30 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## UNRELEASED

### Updated
- 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:
- Add fill gradients for scatter traces [[#6905](https://github.com/plotly/plotly.js/pull/6905)], with thanks to @lumip for the contribution!
- Add `indentation` to legend [[#6874](https://github.com/plotly/plotly.js/pull/6874)], with thanks to @my-tien for the contribution!


## [5.19.0] - 2024-02-15

### Updated
Expand Down
34 changes: 15 additions & 19 deletions packages/javascript/jupyterlab-plotly/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/javascript/jupyterlab-plotly/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@lumino/messaging": "^1.2.3",
"@lumino/widgets": "^1.8.1",
"lodash": "^4.17.4",
"plotly.js": "^2.29.1"
"plotly.js": "^2.30.0"
},
"jupyterlab": {
"extension": "lib/jupyterlab-plugin",
Expand Down
41 changes: 40 additions & 1 deletion packages/python/plotly/codegen/resources/plot-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2848,6 +2848,13 @@
"valType": "number"
}
},
"indentation": {
"description": "Sets the indentation (in px) of the legend entries.",
"dflt": 0,
"editType": "legend",
"min": -15,
"valType": "number"
},
"itemclick": {
"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.",
"dflt": "toggle",
Expand Down Expand Up @@ -45035,10 +45042,42 @@
},
"fillcolor": {
"anim": true,
"description": "Sets the fill color. Defaults to a half-transparent variant of the line color, marker color, or marker line color, whichever is available.",
"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.",
"editType": "style",
"valType": "color"
},
"fillgradient": {
"colorscale": {
"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*.",
"editType": "style",
"valType": "colorscale"
},
"description": "Sets a fill gradient. If not specified, the fillcolor is used instead.",
"editType": "calc",
"role": "object",
"start": {
"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*.",
"editType": "calc",
"valType": "number"
},
"stop": {
"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*.",
"editType": "calc",
"valType": "number"
},
"type": {
"description": "Sets the type/orientation of the color gradient for the fill. Defaults to *none*.",
"dflt": "none",
"editType": "calc",
"valType": "enumerated",
"values": [
"radial",
"horizontal",
"vertical",
"none"
]
}
},
"fillpattern": {
"bgcolor": {
"arrayOk": true,
Expand Down
9 changes: 8 additions & 1 deletion packages/python/plotly/plotly/graph_objs/_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -13179,6 +13179,7 @@ def add_scatter(
error_y=None,
fill=None,
fillcolor=None,
fillgradient=None,
fillpattern=None,
groupnorm=None,
hoverinfo=None,
Expand Down Expand Up @@ -13315,7 +13316,12 @@ def add_scatter(
fillcolor
Sets the fill color. Defaults to a half-transparent
variant of the line color, marker color, or marker line
color, whichever is available.
color, whichever is available. If fillgradient is
specified, fillcolor is ignored except for setting the
background color of the hover label, if any.
fillgradient
Sets a fill gradient. If not specified, the fillcolor
is used instead.
fillpattern
Sets the pattern within the marker.
groupnorm
Expand Down Expand Up @@ -13705,6 +13711,7 @@ def add_scatter(
error_y=error_y,
fill=fill,
fillcolor=fillcolor,
fillgradient=fillgradient,
fillpattern=fillpattern,
groupnorm=groupnorm,
hoverinfo=hoverinfo,
Expand Down
9 changes: 8 additions & 1 deletion packages/python/plotly/plotly/graph_objs/_figurewidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -13183,6 +13183,7 @@ def add_scatter(
error_y=None,
fill=None,
fillcolor=None,
fillgradient=None,
fillpattern=None,
groupnorm=None,
hoverinfo=None,
Expand Down Expand Up @@ -13319,7 +13320,12 @@ def add_scatter(
fillcolor
Sets the fill color. Defaults to a half-transparent
variant of the line color, marker color, or marker line
color, whichever is available.
color, whichever is available. If fillgradient is
specified, fillcolor is ignored except for setting the
background color of the hover label, if any.
fillgradient
Sets a fill gradient. If not specified, the fillcolor
is used instead.
fillpattern
Sets the pattern within the marker.
groupnorm
Expand Down Expand Up @@ -13709,6 +13715,7 @@ def add_scatter(
error_y=error_y,
fill=fill,
fillcolor=fillcolor,
fillgradient=fillgradient,
fillpattern=fillpattern,
groupnorm=groupnorm,
hoverinfo=hoverinfo,
Expand Down
3 changes: 3 additions & 0 deletions packages/python/plotly/plotly/graph_objs/_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,9 @@ def legend(self):
Sets the font for group titles in legend.
Defaults to `legend.font` with its size
increased about 10%.
indentation
Sets the indentation (in px) of the legend
entries.
itemclick
Determines the behavior on legend item click.
"toggle" toggles the visibility of the item
Expand Down
80 changes: 77 additions & 3 deletions packages/python/plotly/plotly/graph_objs/_scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class Scatter(_BaseTraceType):
"error_y",
"fill",
"fillcolor",
"fillgradient",
"fillpattern",
"groupnorm",
"hoverinfo",
Expand Down Expand Up @@ -442,7 +443,9 @@ def fillcolor(self):
"""
Sets the fill color. Defaults to a half-transparent variant of
the line color, marker color, or marker line color, whichever
is available.
is available. If fillgradient is specified, fillcolor is
ignored except for setting the background color of the hover
label, if any.
The 'fillcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
Expand Down Expand Up @@ -496,6 +499,62 @@ def fillcolor(self):
def fillcolor(self, val):
self["fillcolor"] = val

# fillgradient
# ------------
@property
def fillgradient(self):
"""
Sets a fill gradient. If not specified, the fillcolor is used
instead.
The 'fillgradient' property is an instance of Fillgradient
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter.Fillgradient`
- A dict of string/value properties that will be passed
to the Fillgradient constructor
Supported dict properties:
colorscale
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".
start
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".
stop
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".
type
Sets the type/orientation of the color gradient
for the fill. Defaults to "none".
Returns
-------
plotly.graph_objs.scatter.Fillgradient
"""
return self["fillgradient"]

@fillgradient.setter
def fillgradient(self, val):
self["fillgradient"] = val

# fillpattern
# -----------
@property
Expand Down Expand Up @@ -2376,7 +2435,12 @@ def _prop_descriptions(self):
fillcolor
Sets the fill color. Defaults to a half-transparent
variant of the line color, marker color, or marker line
color, whichever is available.
color, whichever is available. If fillgradient is
specified, fillcolor is ignored except for setting the
background color of the hover label, if any.
fillgradient
Sets a fill gradient. If not specified, the fillcolor
is used instead.
fillpattern
Sets the pattern within the marker.
groupnorm
Expand Down Expand Up @@ -2743,6 +2807,7 @@ def __init__(
error_y=None,
fill=None,
fillcolor=None,
fillgradient=None,
fillpattern=None,
groupnorm=None,
hoverinfo=None,
Expand Down Expand Up @@ -2879,7 +2944,12 @@ def __init__(
fillcolor
Sets the fill color. Defaults to a half-transparent
variant of the line color, marker color, or marker line
color, whichever is available.
color, whichever is available. If fillgradient is
specified, fillcolor is ignored except for setting the
background color of the hover label, if any.
fillgradient
Sets a fill gradient. If not specified, the fillcolor
is used instead.
fillpattern
Sets the pattern within the marker.
groupnorm
Expand Down Expand Up @@ -3308,6 +3378,10 @@ def __init__(
_v = fillcolor if fillcolor is not None else _v
if _v is not None:
self["fillcolor"] = _v
_v = arg.pop("fillgradient", None)
_v = fillgradient if fillgradient is not None else _v
if _v is not None:
self["fillgradient"] = _v
_v = arg.pop("fillpattern", None)
_v = fillpattern if fillpattern is not None else _v
if _v is not None:
Expand Down
Loading

0 comments on commit 378f1fe

Please sign in to comment.