Skip to content

Commit e33e10b

Browse files
docstring
1 parent a802f9d commit e33e10b

File tree

4 files changed

+156
-108
lines changed

4 files changed

+156
-108
lines changed

Diff for: packages/python/plotly/codegen/figure.py

+20-14
Original file line numberDiff line numberDiff line change
@@ -89,18 +89,18 @@ def __init__(self, data=None, layout=None,
8989
frames=None, skip_invalid=False, **kwargs):
9090
\"\"\"
9191
Create a new :class:{fig_classname} instance
92-
92+
9393
Parameters
9494
----------
9595
data
9696
{data_description}
97-
97+
9898
layout
9999
{layout_description}
100-
100+
101101
frames
102102
{frames_description}
103-
103+
104104
skip_invalid: bool
105105
If True, invalid properties in the figure specification will be
106106
skipped silently. If False (default) invalid properties in the
@@ -233,8 +233,8 @@ def add_{trace_node.plotly_name}(self"""
233233
* If False, only select yaxis objects associated with the primary
234234
y-axis of the subplot.
235235
* If None (the default), do not filter yaxis objects based on
236-
a secondary y-axis condition.
237-
236+
a secondary y-axis condition.
237+
238238
To select yaxis objects by secondary y-axis, the Figure must
239239
have been created using plotly.subplots.make_subplots. See
240240
the docstring for the specs argument to make_subplots for more
@@ -287,7 +287,7 @@ def for_each_{singular_name}(
287287
\"\"\"
288288
Apply a function to all {singular_name} objects that satisfy the
289289
specified selection criteria
290-
290+
291291
Parameters
292292
----------
293293
fn:
@@ -329,7 +329,7 @@ def update_{plural_name}(
329329
\"\"\"
330330
Perform a property update operation on all {singular_name} objects
331331
that satisfy the specified selection criteria
332-
332+
333333
Parameters
334334
----------
335335
patch: dict
@@ -395,15 +395,17 @@ def select_{method_prefix}{plural_name}(
395395
396396
Parameters
397397
----------
398-
selector: dict, function, or None (default None)
398+
selector: dict, function, int, str, or None (default None)
399399
Dict to use as selection criteria.
400400
Annotations will be selected if they contain properties corresponding
401401
to all of the dictionary's keys, with values that exactly match
402402
the supplied values. If None (the default), all {plural_name} are
403403
selected. If a function, it must be a function accepting a single
404404
argument and returning a boolean. The function will be called on
405405
each {singular_name} and those for which the function returned True
406-
will be in the selection.
406+
will be in the selection. If an int N, the Nth {singular_name} matching row
407+
and col will be selected (N can be negative). If a string S, the selector
408+
is equivalent to dict(type=S).
407409
row, col: int or None (default None)
408410
Subplot row and column index of {plural_name} to select.
409411
To select {plural_name} by row and column, the Figure must have been
@@ -443,15 +445,17 @@ def for_each_{method_prefix}{singular_name}(
443445
----------
444446
fn:
445447
Function that inputs a single {singular_name} object.
446-
selector: dict, function, or None (default None)
448+
selector: dict, function, int, str or None (default None)
447449
Dict to use as selection criteria.
448450
Traces will be selected if they contain properties corresponding
449451
to all of the dictionary's keys, with values that exactly match
450452
the supplied values. If None (the default), all {plural_name} are
451453
selected. If a function, it must be a function accepting a single
452454
argument and returning a boolean. The function will be called on
453455
each {singular_name} and those for which the function returned True
454-
will be in the selection.
456+
will be in the selection. If an int N, the Nth {singular_name} matching row
457+
and col will be selected (N can be negative). If a string S, the selector
458+
is equivalent to dict(type=S).
455459
row, col: int or None (default None)
456460
Subplot row and column index of {plural_name} to select.
457461
To select {plural_name} by row and column, the Figure must have been
@@ -504,15 +508,17 @@ def update_{method_prefix}{plural_name}(
504508
patch: dict or None (default None)
505509
Dictionary of property updates to be applied to all {plural_name} that
506510
satisfy the selection criteria.
507-
selector: dict, function, or None (default None)
511+
selector: dict, function, int, str or None (default None)
508512
Dict to use as selection criteria.
509513
Traces will be selected if they contain properties corresponding
510514
to all of the dictionary's keys, with values that exactly match
511515
the supplied values. If None (the default), all {plural_name} are
512516
selected. If a function, it must be a function accepting a single
513517
argument and returning a boolean. The function will be called on
514518
each {singular_name} and those for which the function returned True
515-
will be in the selection.
519+
will be in the selection. If an int N, the Nth {singular_name} matching row
520+
and col will be selected (N can be negative). If a string S, the selector
521+
is equivalent to dict(type=S).
516522
row, col: int or None (default None)
517523
Subplot row and column index of {plural_name} to select.
518524
To select {plural_name} by row and column, the Figure must have been

Diff for: packages/python/plotly/plotly/basedatatypes.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -1107,15 +1107,17 @@ def select_traces(self, selector=None, row=None, col=None, secondary_y=None):
11071107
11081108
Parameters
11091109
----------
1110-
selector: dict, function, or None (default None)
1110+
selector: dict, function, int, str or None (default None)
11111111
Dict to use as selection criteria.
11121112
Traces will be selected if they contain properties corresponding
11131113
to all of the dictionary's keys, with values that exactly match
11141114
the supplied values. If None (the default), all traces are
11151115
selected. If a function, it must be a function accepting a single
11161116
argument and returning a boolean. The function will be called on
11171117
each trace and those for which the function returned True
1118-
will be in the selection.
1118+
will be in the selection. If an int N, the Nth trace matching row
1119+
and col will be selected (N can be negative). If a string S, the selector
1120+
is equivalent to dict(type=S).
11191121
row, col: int or None (default None)
11201122
Subplot row and column index of traces to select.
11211123
To select traces by row and column, the Figure must have been
@@ -1267,15 +1269,17 @@ def for_each_trace(self, fn, selector=None, row=None, col=None, secondary_y=None
12671269
----------
12681270
fn:
12691271
Function that inputs a single trace object.
1270-
selector: dict, function, or None (default None)
1272+
selector: dict, function, int, str or None (default None)
12711273
Dict to use as selection criteria.
12721274
Traces will be selected if they contain properties corresponding
12731275
to all of the dictionary's keys, with values that exactly match
12741276
the supplied values. If None (the default), all traces are
12751277
selected. If a function, it must be a function accepting a single
12761278
argument and returning a boolean. The function will be called on
12771279
each trace and those for which the function returned True
1278-
will be in the selection.
1280+
will be in the selection. If an int N, the Nth trace matching row
1281+
and col will be selected (N can be negative). If a string S, the selector
1282+
is equivalent to dict(type=S).
12791283
row, col: int or None (default None)
12801284
Subplot row and column index of traces to select.
12811285
To select traces by row and column, the Figure must have been
@@ -1324,15 +1328,17 @@ def update_traces(
13241328
patch: dict or None (default None)
13251329
Dictionary of property updates to be applied to all traces that
13261330
satisfy the selection criteria.
1327-
selector: dict, function, or None (default None)
1331+
selector: dict, function, int, str or None (default None)
13281332
Dict to use as selection criteria.
13291333
Traces will be selected if they contain properties corresponding
13301334
to all of the dictionary's keys, with values that exactly match
13311335
the supplied values. If None (the default), all traces are
13321336
selected. If a function, it must be a function accepting a single
13331337
argument and returning a boolean. The function will be called on
13341338
each trace and those for which the function returned True
1335-
will be in the selection.
1339+
will be in the selection. If an int N, the Nth trace matching row
1340+
and col will be selected (N can be negative). If a string S, the selector
1341+
is equivalent to dict(type=S).
13361342
row, col: int or None (default None)
13371343
Subplot row and column index of traces to select.
13381344
To select traces by row and column, the Figure must have been

0 commit comments

Comments
 (0)