Skip to content

Commit 6722474

Browse files
committed
update to plotyjs 2.20.0
1 parent e5cd7b5 commit 6722474

File tree

10 files changed

+124
-11
lines changed

10 files changed

+124
-11
lines changed

packages/javascript/jupyterlab-plotly/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/javascript/jupyterlab-plotly/package.json

Lines changed: 1 addition & 1 deletion
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.19.1"
68+
"plotly.js": "^2.20.0"
6969
},
7070
"jupyterlab": {
7171
"extension": "lib/jupyterlab-plugin",

packages/python/plotly/codegen/resources/plot-schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9661,6 +9661,12 @@
96619661
}
96629662
},
96639663
"title": {
9664+
"automargin": {
9665+
"description": "Determines whether the title can automatically push the figure margins. If `yref='paper'` then the margin will expand to ensure that the title doesn’t overlap with the edges of the container. If `yref='container'` then the margins will ensure that the title doesn’t overlap with the plot area, tick labels, and axis titles. If `automargin=true` and the margins need to be expanded, then y will be set to a default 1 and yanchor will be set to an appropriate default to ensure that minimal margin space is needed. Note that when `yref='paper'`, only 1 or 0 are allowed y values. Invalid values will be reset to the default 1.",
9666+
"dflt": false,
9667+
"editType": "plot",
9668+
"valType": "boolean"
9669+
},
96649670
"editType": "layoutstyle",
96659671
"font": {
96669672
"color": {

packages/python/plotly/plotly/graph_objs/_layout.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3609,6 +3609,22 @@ def title(self):
36093609
36103610
Supported dict properties:
36113611
3612+
automargin
3613+
Determines whether the title can automatically
3614+
push the figure margins. If `yref='paper'` then
3615+
the margin will expand to ensure that the title
3616+
doesn’t overlap with the edges of the
3617+
container. If `yref='container'` then the
3618+
margins will ensure that the title doesn’t
3619+
overlap with the plot area, tick labels, and
3620+
axis titles. If `automargin=true` and the
3621+
margins need to be expanded, then y will be set
3622+
to a default 1 and yanchor will be set to an
3623+
appropriate default to ensure that minimal
3624+
margin space is needed. Note that when
3625+
`yref='paper'`, only 1 or 0 are allowed y
3626+
values. Invalid values will be reset to the
3627+
default 1.
36123628
font
36133629
Sets the title font. Note that the title's font
36143630
used to be customized by the now deprecated

packages/python/plotly/plotly/graph_objs/layout/_title.py

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class Title(_BaseLayoutHierarchyType):
99
_parent_path_str = "layout"
1010
_path_str = "layout.title"
1111
_valid_props = {
12+
"automargin",
1213
"font",
1314
"pad",
1415
"text",
@@ -20,6 +21,36 @@ class Title(_BaseLayoutHierarchyType):
2021
"yref",
2122
}
2223

24+
# automargin
25+
# ----------
26+
@property
27+
def automargin(self):
28+
"""
29+
Determines whether the title can automatically push the figure
30+
margins. If `yref='paper'` then the margin will expand to
31+
ensure that the title doesn’t overlap with the edges of the
32+
container. If `yref='container'` then the margins will ensure
33+
that the title doesn’t overlap with the plot area, tick labels,
34+
and axis titles. If `automargin=true` and the margins need to
35+
be expanded, then y will be set to a default 1 and yanchor will
36+
be set to an appropriate default to ensure that minimal margin
37+
space is needed. Note that when `yref='paper'`, only 1 or 0 are
38+
allowed y values. Invalid values will be reset to the default
39+
1.
40+
41+
The 'automargin' property must be specified as a bool
42+
(either True, or False)
43+
44+
Returns
45+
-------
46+
bool
47+
"""
48+
return self["automargin"]
49+
50+
@automargin.setter
51+
def automargin(self, val):
52+
self["automargin"] = val
53+
2354
# font
2455
# ----
2556
@property
@@ -280,6 +311,19 @@ def yref(self, val):
280311
@property
281312
def _prop_descriptions(self):
282313
return """\
314+
automargin
315+
Determines whether the title can automatically push the
316+
figure margins. If `yref='paper'` then the margin will
317+
expand to ensure that the title doesn’t overlap with
318+
the edges of the container. If `yref='container'` then
319+
the margins will ensure that the title doesn’t overlap
320+
with the plot area, tick labels, and axis titles. If
321+
`automargin=true` and the margins need to be expanded,
322+
then y will be set to a default 1 and yanchor will be
323+
set to an appropriate default to ensure that minimal
324+
margin space is needed. Note that when `yref='paper'`,
325+
only 1 or 0 are allowed y values. Invalid values will
326+
be reset to the default 1.
283327
font
284328
Sets the title font. Note that the title's font used to
285329
be customized by the now deprecated `titlefont`
@@ -332,6 +376,7 @@ def _prop_descriptions(self):
332376
def __init__(
333377
self,
334378
arg=None,
379+
automargin=None,
335380
font=None,
336381
pad=None,
337382
text=None,
@@ -351,6 +396,19 @@ def __init__(
351396
arg
352397
dict of properties compatible with this constructor or
353398
an instance of :class:`plotly.graph_objs.layout.Title`
399+
automargin
400+
Determines whether the title can automatically push the
401+
figure margins. If `yref='paper'` then the margin will
402+
expand to ensure that the title doesn’t overlap with
403+
the edges of the container. If `yref='container'` then
404+
the margins will ensure that the title doesn’t overlap
405+
with the plot area, tick labels, and axis titles. If
406+
`automargin=true` and the margins need to be expanded,
407+
then y will be set to a default 1 and yanchor will be
408+
set to an appropriate default to ensure that minimal
409+
margin space is needed. Note that when `yref='paper'`,
410+
only 1 or 0 are allowed y values. Invalid values will
411+
be reset to the default 1.
354412
font
355413
Sets the title font. Note that the title's font used to
356414
be customized by the now deprecated `titlefont`
@@ -432,6 +490,10 @@ def __init__(
432490

433491
# Populate data dict with properties
434492
# ----------------------------------
493+
_v = arg.pop("automargin", None)
494+
_v = automargin if automargin is not None else _v
495+
if _v is not None:
496+
self["automargin"] = _v
435497
_v = arg.pop("font", None)
436498
_v = font if font is not None else _v
437499
if _v is not None:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# DO NOT EDIT
22
# This file is generated by the updatebundle setup.py command
3-
__plotlyjs_version__ = "2.19.1"
3+
__plotlyjs_version__ = "2.20.0"

packages/python/plotly/plotly/package_data/plotly.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/python/plotly/plotly/validators/layout/_title.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ def __init__(self, plotly_name="title", parent_name="layout", **kwargs):
1010
data_docs=kwargs.pop(
1111
"data_docs",
1212
"""
13+
automargin
14+
Determines whether the title can automatically
15+
push the figure margins. If `yref='paper'` then
16+
the margin will expand to ensure that the title
17+
doesn’t overlap with the edges of the
18+
container. If `yref='container'` then the
19+
margins will ensure that the title doesn’t
20+
overlap with the plot area, tick labels, and
21+
axis titles. If `automargin=true` and the
22+
margins need to be expanded, then y will be set
23+
to a default 1 and yanchor will be set to an
24+
appropriate default to ensure that minimal
25+
margin space is needed. Note that when
26+
`yref='paper'`, only 1 or 0 are allowed y
27+
values. Invalid values will be reset to the
28+
default 1.
1329
font
1430
Sets the title font. Note that the title's font
1531
used to be customized by the now deprecated

packages/python/plotly/plotly/validators/layout/title/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from ._text import TextValidator
1212
from ._pad import PadValidator
1313
from ._font import FontValidator
14+
from ._automargin import AutomarginValidator
1415
else:
1516
from _plotly_utils.importers import relative_import
1617

@@ -27,5 +28,6 @@
2728
"._text.TextValidator",
2829
"._pad.PadValidator",
2930
"._font.FontValidator",
31+
"._automargin.AutomarginValidator",
3032
],
3133
)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import _plotly_utils.basevalidators
2+
3+
4+
class AutomarginValidator(_plotly_utils.basevalidators.BooleanValidator):
5+
def __init__(self, plotly_name="automargin", parent_name="layout.title", **kwargs):
6+
super(AutomarginValidator, self).__init__(
7+
plotly_name=plotly_name,
8+
parent_name=parent_name,
9+
edit_type=kwargs.pop("edit_type", "plot"),
10+
**kwargs,
11+
)

0 commit comments

Comments
 (0)