Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 776123c

Browse files
Changed exclude_subplots_without_data to exclude_empty_subplots
1 parent 87faec1 commit 776123c

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

packages/python/plotly/plotly/basedatatypes.py

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3538,13 +3538,7 @@ def _make_paper_spanning_shape(self, direction, shape, none_if_no_trace=True):
35383538
return shape
35393539

35403540
def _process_multiple_paper_spanning_shapes(
3541-
self,
3542-
shape_args,
3543-
row,
3544-
col,
3545-
direction,
3546-
exclude_subplots_without_data=True,
3547-
**kwargs
3541+
self, shape_args, row, col, direction, exclude_empty_subplots=True, **kwargs
35483542
):
35493543
"""
35503544
Add a shape or multiple shapes and call _make_paper_spanning_shape on
@@ -3563,17 +3557,15 @@ def _process_multiple_paper_spanning_shapes(
35633557
self._make_paper_spanning_shape(
35643558
direction,
35653559
self.layout["shapes"][n],
3566-
none_if_no_trace=exclude_subplots_without_data,
3560+
none_if_no_trace=exclude_empty_subplots,
35673561
)
35683562
for n in range(n_shapes_before, n_shapes_after)
35693563
],
35703564
)
35713565
)
35723566
self.layout["shapes"] = self.layout["shapes"][:n_shapes_before] + new_shapes
35733567

3574-
def add_vline(
3575-
self, x, row=None, col=None, exclude_subplots_without_data=True, **kwargs
3576-
):
3568+
def add_vline(self, x, row=None, col=None, exclude_empty_subplots=True, **kwargs):
35773569
"""
35783570
Add a vertical line to a plot or subplot that extends infinitely in the
35793571
y-dimension.
@@ -3599,14 +3591,12 @@ def add_vline(
35993591
row,
36003592
col,
36013593
"vertical",
3602-
exclude_subplots_without_data=exclude_subplots_without_data,
3594+
exclude_empty_subplots=exclude_empty_subplots,
36033595
**kwargs
36043596
)
36053597
return self
36063598

3607-
def add_hline(
3608-
self, y, row=None, col=None, exclude_subplots_without_data=True, **kwargs
3609-
):
3599+
def add_hline(self, y, row=None, col=None, exclude_empty_subplots=True, **kwargs):
36103600
"""
36113601
Add a horizontal line to a plot or subplot that extends infinitely in the
36123602
x-dimension.
@@ -3632,13 +3622,13 @@ def add_hline(
36323622
row,
36333623
col,
36343624
"horizontal",
3635-
exclude_subplots_without_data=exclude_subplots_without_data,
3625+
exclude_empty_subplots=exclude_empty_subplots,
36363626
**kwargs
36373627
)
36383628
return self
36393629

36403630
def add_vrect(
3641-
self, x0, x1, row=None, col=None, exclude_subplots_without_data=True, **kwargs
3631+
self, x0, x1, row=None, col=None, exclude_empty_subplots=True, **kwargs
36423632
):
36433633
"""
36443634
Add a rectangle to a plot or subplot that extends infinitely in the
@@ -3667,13 +3657,13 @@ def add_vrect(
36673657
row,
36683658
col,
36693659
"vertical",
3670-
exclude_subplots_without_data=exclude_subplots_without_data,
3660+
exclude_empty_subplots=exclude_empty_subplots,
36713661
**kwargs
36723662
)
36733663
return self
36743664

36753665
def add_hrect(
3676-
self, y0, y1, row=None, col=None, exclude_subplots_without_data=True, **kwargs
3666+
self, y0, y1, row=None, col=None, exclude_empty_subplots=True, **kwargs
36773667
):
36783668
"""
36793669
Add a rectangle to a plot or subplot that extends infinitely in the
@@ -3702,7 +3692,7 @@ def add_hrect(
37023692
row,
37033693
col,
37043694
"horizontal",
3705-
exclude_subplots_without_data=exclude_subplots_without_data,
3695+
exclude_empty_subplots=exclude_empty_subplots,
37063696
**kwargs
37073697
)
37083698
return self

packages/python/plotly/plotly/tests/test_core/test_update_objects/test_paper_span_shapes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def test_add_span_shape(test_input, expected, subplot_fig_fixture):
309309
(
310310
(
311311
go.Figure.add_vline,
312-
dict(x=20, row="all", col=2, exclude_subplots_without_data=False),
312+
dict(x=20, row="all", col=2, exclude_empty_subplots=False),
313313
),
314314
[
315315
{

0 commit comments

Comments
 (0)