Skip to content

Commit

Permalink
bump plotly.js to 2.14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolaskruchten committed Aug 11, 2022
1 parent f9bd7da commit 473c263
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 29 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [5.10.0] - 2022-07-26
## [5.10.0] - 2022-08-11

### Updated
- Updated Plotly.js to from version 2.12.1 to version 2.13.3. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2133----2022-07-25) for more information. Notable changes include:
- Updated Plotly.js to from version 2.12.1 to version 2.14.0. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2140----2022-08-10) for more information. Notable changes include:
- Add support for `sankey` links with arrows
- Add `selections`, `newselection` and `activeselection` layout attributes to have persistent and editable selections over cartesian subplots
- Add `unselected.line.color` and `unselected.line.opacity` options to `parcoords` trace
- Display Plotly's new logo in the modebar
Expand Down
37 changes: 14 additions & 23 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.13.3"
"plotly.js": "^2.14.0"
},
"jupyterlab": {
"extension": "lib/jupyterlab-plugin",
Expand Down
1 change: 1 addition & 0 deletions packages/javascript/jupyterlab-plotly/src/Figure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,7 @@ export class FigureView extends DOMWidgetView {
var initialTraces = _.cloneDeep(this.model.get("_data"));
var initialLayout = _.cloneDeep(this.model.get("_layout"));
var config = this.model.get("_config");
config.editSelection = false;

Plotly.newPlot(that.el, initialTraces, initialLayout, config).then(
function () {
Expand Down
12 changes: 12 additions & 0 deletions packages/python/plotly/codegen/resources/plot-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@
"valType": "boolean"
}
},
"editSelection": {
"description": "Enables moving selections.",
"dflt": true,
"valType": "boolean"
},
"fillFrame": {
"description": "When `layout.autosize` is turned on, determines whether the graph fills the container (the default) or the screen (if set to *true*).",
"dflt": false,
Expand Down Expand Up @@ -42051,6 +42056,13 @@
"valType": "number"
},
"link": {
"arrowlen": {
"description": "Sets the length (in px) of the links arrow, if 0 no arrow will be drawn.",
"dflt": 0,
"editType": "calc",
"min": 0,
"valType": "number"
},
"color": {
"arrayOk": true,
"description": "Sets the `link` color. It can be a single value, or an array for specifying color for each `link`. If `link.color` is omitted, then by default, a translucent grey link will be used.",
Expand Down
3 changes: 3 additions & 0 deletions packages/python/plotly/plotly/graph_objs/_sankey.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ def link(self):
Supported dict properties:
arrowlen
Sets the length (in px) of the links arrow, if
0 no arrow will be drawn.
color
Sets the `link` color. It can be a single
value, or an array for specifying color for
Expand Down
33 changes: 33 additions & 0 deletions packages/python/plotly/plotly/graph_objs/sankey/_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Link(_BaseTraceHierarchyType):
_parent_path_str = "sankey"
_path_str = "sankey.link"
_valid_props = {
"arrowlen",
"color",
"colorscaledefaults",
"colorscales",
Expand All @@ -30,6 +31,27 @@ class Link(_BaseTraceHierarchyType):
"valuesrc",
}

# arrowlen
# --------
@property
def arrowlen(self):
"""
Sets the length (in px) of the links arrow, if 0 no arrow will
be drawn.
The 'arrowlen' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["arrowlen"]

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

# color
# -----
@property
Expand Down Expand Up @@ -599,6 +621,9 @@ def valuesrc(self, val):
@property
def _prop_descriptions(self):
return """\
arrowlen
Sets the length (in px) of the links arrow, if 0 no
arrow will be drawn.
color
Sets the `link` color. It can be a single value, or an
array for specifying color for each `link`. If
Expand Down Expand Up @@ -691,6 +716,7 @@ def _prop_descriptions(self):
def __init__(
self,
arg=None,
arrowlen=None,
color=None,
colorscales=None,
colorscaledefaults=None,
Expand Down Expand Up @@ -722,6 +748,9 @@ def __init__(
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.sankey.Link`
arrowlen
Sets the length (in px) of the links arrow, if 0 no
arrow will be drawn.
color
Sets the `link` color. It can be a single value, or an
array for specifying color for each `link`. If
Expand Down Expand Up @@ -843,6 +872,10 @@ def __init__(

# Populate data dict with properties
# ----------------------------------
_v = arg.pop("arrowlen", None)
_v = arrowlen if arrowlen is not None else _v
if _v is not None:
self["arrowlen"] = _v
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
Expand Down
2 changes: 1 addition & 1 deletion packages/python/plotly/plotly/offline/_plotlyjs_version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# DO NOT EDIT
# This file is generated by the updatebundle setup.py command
__plotlyjs_version__ = "2.13.3"
__plotlyjs_version__ = "2.14.0"
4 changes: 2 additions & 2 deletions packages/python/plotly/plotly/package_data/plotly.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions packages/python/plotly/plotly/validators/sankey/_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ def __init__(self, plotly_name="link", parent_name="sankey", **kwargs):
data_docs=kwargs.pop(
"data_docs",
"""
arrowlen
Sets the length (in px) of the links arrow, if
0 no arrow will be drawn.
color
Sets the `link` color. It can be a single
value, or an array for specifying color for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from ._colorscaledefaults import ColorscaledefaultsValidator
from ._colorscales import ColorscalesValidator
from ._color import ColorValidator
from ._arrowlen import ArrowlenValidator
else:
from _plotly_utils.importers import relative_import

Expand All @@ -47,5 +48,6 @@
"._colorscaledefaults.ColorscaledefaultsValidator",
"._colorscales.ColorscalesValidator",
"._color.ColorValidator",
"._arrowlen.ArrowlenValidator",
],
)
12 changes: 12 additions & 0 deletions packages/python/plotly/plotly/validators/sankey/link/_arrowlen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import _plotly_utils.basevalidators


class ArrowlenValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="arrowlen", parent_name="sankey.link", **kwargs):
super(ArrowlenValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "calc"),
min=kwargs.pop("min", 0),
**kwargs,
)

0 comments on commit 473c263

Please sign in to comment.