From 53e599c46fbfd47d41c672222a0d2c7305725e64 Mon Sep 17 00:00:00 2001 From: Nicholas Esterer Date: Thu, 29 Oct 2020 17:23:59 -0400 Subject: [PATCH 1/2] selector argument accepting function now correctly documented For the BaseFigure.select_traces, and its subclasses' select_* and related functions (for_each_*). --- packages/python/plotly/codegen/figure.py | 45 +++- .../python/plotly/plotly/basedatatypes.py | 21 +- .../plotly/plotly/graph_objs/_figure.py | 255 +++++++++++++----- .../plotly/plotly/graph_objs/_figurewidget.py | 255 +++++++++++++----- 4 files changed, 426 insertions(+), 150 deletions(-) diff --git a/packages/python/plotly/codegen/figure.py b/packages/python/plotly/codegen/figure.py index 9b579093fa9..42a964d2ec9 100644 --- a/packages/python/plotly/codegen/figure.py +++ b/packages/python/plotly/codegen/figure.py @@ -256,12 +256,16 @@ def select_{plural_name}( Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. {singular_name} objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all {singular_name} objects are selected. + (the default), all {singular_name} objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + {singular_name} and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of {singular_name} objects to select. To select {singular_name} objects by row and column, the Figure @@ -288,12 +292,16 @@ def for_each_{singular_name}( ---------- fn: Function that inputs a single {singular_name} object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. {singular_name} objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all {singular_name} objects are selected. + (the default), all {singular_name} objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + {singular_name} and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of {singular_name} objects to select. To select {singular_name} objects by row and column, the Figure @@ -327,12 +335,16 @@ def update_{plural_name}( patch: dict Dictionary of property updates to be applied to all {singular_name} objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. {singular_name} objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all {singular_name} objects are selected. + (the default), all {singular_name} objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + {singular_name} and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -383,12 +395,15 @@ def select_{method_prefix}{plural_name}( Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Annotations will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all {plural_name} are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each {singular_name} and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of {plural_name} to select. To select {plural_name} by row and column, the Figure must have been @@ -428,12 +443,15 @@ def for_each_{method_prefix}{singular_name}( ---------- fn: Function that inputs a single {singular_name} object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all {plural_name} are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each {singular_name} and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of {plural_name} to select. To select {plural_name} by row and column, the Figure must have been @@ -486,12 +504,15 @@ def update_{method_prefix}{plural_name}( patch: dict or None (default None) Dictionary of property updates to be applied to all {plural_name} that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all {plural_name} are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each {singular_name} and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of {plural_name} to select. To select {plural_name} by row and column, the Figure must have been diff --git a/packages/python/plotly/plotly/basedatatypes.py b/packages/python/plotly/plotly/basedatatypes.py index f2033cf359a..df907f98e5e 100644 --- a/packages/python/plotly/plotly/basedatatypes.py +++ b/packages/python/plotly/plotly/basedatatypes.py @@ -857,12 +857,15 @@ def select_traces(self, selector=None, row=None, col=None, secondary_y=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all traces are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each trace and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of traces to select. To select traces by row and column, the Figure must have been @@ -984,12 +987,15 @@ def for_each_trace(self, fn, selector=None, row=None, col=None, secondary_y=None ---------- fn: Function that inputs a single trace object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all traces are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each trace and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of traces to select. To select traces by row and column, the Figure must have been @@ -1038,12 +1044,15 @@ def update_traces( patch: dict or None (default None) Dictionary of property updates to be applied to all traces that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all traces are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each trace and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of traces to select. To select traces by row and column, the Figure must have been diff --git a/packages/python/plotly/plotly/graph_objs/_figure.py b/packages/python/plotly/plotly/graph_objs/_figure.py index 0c2b481965b..d9cf48be670 100644 --- a/packages/python/plotly/plotly/graph_objs/_figure.py +++ b/packages/python/plotly/plotly/graph_objs/_figure.py @@ -17478,12 +17478,16 @@ def select_coloraxes(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. coloraxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all coloraxis objects are selected. + (the default), all coloraxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + coloraxis and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of coloraxis objects to select. To select coloraxis objects by row and column, the Figure @@ -17507,12 +17511,16 @@ def for_each_coloraxis(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single coloraxis object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. coloraxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all coloraxis objects are selected. + (the default), all coloraxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + coloraxis and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of coloraxis objects to select. To select coloraxis objects by row and column, the Figure @@ -17540,12 +17548,16 @@ def update_coloraxes( patch: dict Dictionary of property updates to be applied to all coloraxis objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. coloraxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all coloraxis objects are selected. + (the default), all coloraxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + coloraxis and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -17578,12 +17590,16 @@ def select_geos(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. geo objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all geo objects are selected. + (the default), all geo objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + geo and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of geo objects to select. To select geo objects by row and column, the Figure @@ -17607,12 +17623,16 @@ def for_each_geo(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single geo object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. geo objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all geo objects are selected. + (the default), all geo objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + geo and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of geo objects to select. To select geo objects by row and column, the Figure @@ -17640,12 +17660,16 @@ def update_geos( patch: dict Dictionary of property updates to be applied to all geo objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. geo objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all geo objects are selected. + (the default), all geo objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + geo and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -17678,12 +17702,16 @@ def select_mapboxes(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. mapbox objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all mapbox objects are selected. + (the default), all mapbox objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + mapbox and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of mapbox objects to select. To select mapbox objects by row and column, the Figure @@ -17707,12 +17735,16 @@ def for_each_mapbox(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single mapbox object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. mapbox objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all mapbox objects are selected. + (the default), all mapbox objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + mapbox and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of mapbox objects to select. To select mapbox objects by row and column, the Figure @@ -17740,12 +17772,16 @@ def update_mapboxes( patch: dict Dictionary of property updates to be applied to all mapbox objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. mapbox objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all mapbox objects are selected. + (the default), all mapbox objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + mapbox and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -17778,12 +17814,16 @@ def select_polars(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. polar objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all polar objects are selected. + (the default), all polar objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + polar and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of polar objects to select. To select polar objects by row and column, the Figure @@ -17807,12 +17847,16 @@ def for_each_polar(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single polar object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. polar objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all polar objects are selected. + (the default), all polar objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + polar and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of polar objects to select. To select polar objects by row and column, the Figure @@ -17840,12 +17884,16 @@ def update_polars( patch: dict Dictionary of property updates to be applied to all polar objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. polar objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all polar objects are selected. + (the default), all polar objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + polar and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -17878,12 +17926,16 @@ def select_scenes(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. scene objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all scene objects are selected. + (the default), all scene objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + scene and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of scene objects to select. To select scene objects by row and column, the Figure @@ -17907,12 +17959,16 @@ def for_each_scene(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single scene object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. scene objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all scene objects are selected. + (the default), all scene objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + scene and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of scene objects to select. To select scene objects by row and column, the Figure @@ -17940,12 +17996,16 @@ def update_scenes( patch: dict Dictionary of property updates to be applied to all scene objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. scene objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all scene objects are selected. + (the default), all scene objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + scene and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -17978,12 +18038,16 @@ def select_ternaries(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. ternary objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all ternary objects are selected. + (the default), all ternary objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + ternary and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of ternary objects to select. To select ternary objects by row and column, the Figure @@ -18007,12 +18071,16 @@ def for_each_ternary(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single ternary object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. ternary objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all ternary objects are selected. + (the default), all ternary objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + ternary and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of ternary objects to select. To select ternary objects by row and column, the Figure @@ -18040,12 +18108,16 @@ def update_ternaries( patch: dict Dictionary of property updates to be applied to all ternary objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. ternary objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all ternary objects are selected. + (the default), all ternary objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + ternary and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -18078,12 +18150,16 @@ def select_xaxes(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. xaxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all xaxis objects are selected. + (the default), all xaxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + xaxis and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of xaxis objects to select. To select xaxis objects by row and column, the Figure @@ -18107,12 +18183,16 @@ def for_each_xaxis(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single xaxis object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. xaxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all xaxis objects are selected. + (the default), all xaxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + xaxis and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of xaxis objects to select. To select xaxis objects by row and column, the Figure @@ -18140,12 +18220,16 @@ def update_xaxes( patch: dict Dictionary of property updates to be applied to all xaxis objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. xaxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all xaxis objects are selected. + (the default), all xaxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + xaxis and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -18178,12 +18262,16 @@ def select_yaxes(self, selector=None, row=None, col=None, secondary_y=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. yaxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all yaxis objects are selected. + (the default), all yaxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + yaxis and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of yaxis objects to select. To select yaxis objects by row and column, the Figure @@ -18221,12 +18309,16 @@ def for_each_yaxis(self, fn, selector=None, row=None, col=None, secondary_y=None ---------- fn: Function that inputs a single yaxis object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. yaxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all yaxis objects are selected. + (the default), all yaxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + yaxis and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of yaxis objects to select. To select yaxis objects by row and column, the Figure @@ -18275,12 +18367,16 @@ def update_yaxes( patch: dict Dictionary of property updates to be applied to all yaxis objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. yaxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all yaxis objects are selected. + (the default), all yaxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + yaxis and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -18326,12 +18422,15 @@ def select_annotations(self, selector=None, row=None, col=None, secondary_y=None Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Annotations will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all annotations are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each annotation and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of annotations to select. To select annotations by row and column, the Figure must have been @@ -18371,12 +18470,15 @@ def for_each_annotation( ---------- fn: Function that inputs a single annotation object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all annotations are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each annotation and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of annotations to select. To select annotations by row and column, the Figure must have been @@ -18423,12 +18525,15 @@ def update_annotations( patch: dict or None (default None) Dictionary of property updates to be applied to all annotations that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all annotations are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each annotation and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of annotations to select. To select annotations by row and column, the Figure must have been @@ -18888,12 +18993,15 @@ def select_layout_images(self, selector=None, row=None, col=None, secondary_y=No Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Annotations will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all images are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each image and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of images to select. To select images by row and column, the Figure must have been @@ -18933,12 +19041,15 @@ def for_each_layout_image( ---------- fn: Function that inputs a single image object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all images are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each image and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of images to select. To select images by row and column, the Figure must have been @@ -18981,12 +19092,15 @@ def update_layout_images( patch: dict or None (default None) Dictionary of property updates to be applied to all images that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all images are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each image and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of images to select. To select images by row and column, the Figure must have been @@ -19192,12 +19306,15 @@ def select_shapes(self, selector=None, row=None, col=None, secondary_y=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Annotations will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all shapes are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each shape and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of shapes to select. To select shapes by row and column, the Figure must have been @@ -19235,12 +19352,15 @@ def for_each_shape(self, fn, selector=None, row=None, col=None, secondary_y=None ---------- fn: Function that inputs a single shape object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all shapes are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each shape and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of shapes to select. To select shapes by row and column, the Figure must have been @@ -19283,12 +19403,15 @@ def update_shapes( patch: dict or None (default None) Dictionary of property updates to be applied to all shapes that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all shapes are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each shape and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of shapes to select. To select shapes by row and column, the Figure must have been diff --git a/packages/python/plotly/plotly/graph_objs/_figurewidget.py b/packages/python/plotly/plotly/graph_objs/_figurewidget.py index 25d453f37c8..d32e8b36e38 100644 --- a/packages/python/plotly/plotly/graph_objs/_figurewidget.py +++ b/packages/python/plotly/plotly/graph_objs/_figurewidget.py @@ -17478,12 +17478,16 @@ def select_coloraxes(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. coloraxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all coloraxis objects are selected. + (the default), all coloraxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + coloraxis and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of coloraxis objects to select. To select coloraxis objects by row and column, the Figure @@ -17507,12 +17511,16 @@ def for_each_coloraxis(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single coloraxis object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. coloraxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all coloraxis objects are selected. + (the default), all coloraxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + coloraxis and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of coloraxis objects to select. To select coloraxis objects by row and column, the Figure @@ -17540,12 +17548,16 @@ def update_coloraxes( patch: dict Dictionary of property updates to be applied to all coloraxis objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. coloraxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all coloraxis objects are selected. + (the default), all coloraxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + coloraxis and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -17578,12 +17590,16 @@ def select_geos(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. geo objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all geo objects are selected. + (the default), all geo objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + geo and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of geo objects to select. To select geo objects by row and column, the Figure @@ -17607,12 +17623,16 @@ def for_each_geo(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single geo object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. geo objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all geo objects are selected. + (the default), all geo objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + geo and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of geo objects to select. To select geo objects by row and column, the Figure @@ -17640,12 +17660,16 @@ def update_geos( patch: dict Dictionary of property updates to be applied to all geo objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. geo objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all geo objects are selected. + (the default), all geo objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + geo and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -17678,12 +17702,16 @@ def select_mapboxes(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. mapbox objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all mapbox objects are selected. + (the default), all mapbox objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + mapbox and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of mapbox objects to select. To select mapbox objects by row and column, the Figure @@ -17707,12 +17735,16 @@ def for_each_mapbox(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single mapbox object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. mapbox objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all mapbox objects are selected. + (the default), all mapbox objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + mapbox and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of mapbox objects to select. To select mapbox objects by row and column, the Figure @@ -17740,12 +17772,16 @@ def update_mapboxes( patch: dict Dictionary of property updates to be applied to all mapbox objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. mapbox objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all mapbox objects are selected. + (the default), all mapbox objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + mapbox and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -17778,12 +17814,16 @@ def select_polars(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. polar objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all polar objects are selected. + (the default), all polar objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + polar and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of polar objects to select. To select polar objects by row and column, the Figure @@ -17807,12 +17847,16 @@ def for_each_polar(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single polar object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. polar objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all polar objects are selected. + (the default), all polar objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + polar and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of polar objects to select. To select polar objects by row and column, the Figure @@ -17840,12 +17884,16 @@ def update_polars( patch: dict Dictionary of property updates to be applied to all polar objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. polar objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all polar objects are selected. + (the default), all polar objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + polar and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -17878,12 +17926,16 @@ def select_scenes(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. scene objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all scene objects are selected. + (the default), all scene objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + scene and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of scene objects to select. To select scene objects by row and column, the Figure @@ -17907,12 +17959,16 @@ def for_each_scene(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single scene object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. scene objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all scene objects are selected. + (the default), all scene objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + scene and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of scene objects to select. To select scene objects by row and column, the Figure @@ -17940,12 +17996,16 @@ def update_scenes( patch: dict Dictionary of property updates to be applied to all scene objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. scene objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all scene objects are selected. + (the default), all scene objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + scene and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -17978,12 +18038,16 @@ def select_ternaries(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. ternary objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all ternary objects are selected. + (the default), all ternary objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + ternary and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of ternary objects to select. To select ternary objects by row and column, the Figure @@ -18007,12 +18071,16 @@ def for_each_ternary(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single ternary object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. ternary objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all ternary objects are selected. + (the default), all ternary objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + ternary and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of ternary objects to select. To select ternary objects by row and column, the Figure @@ -18040,12 +18108,16 @@ def update_ternaries( patch: dict Dictionary of property updates to be applied to all ternary objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. ternary objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all ternary objects are selected. + (the default), all ternary objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + ternary and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -18078,12 +18150,16 @@ def select_xaxes(self, selector=None, row=None, col=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. xaxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all xaxis objects are selected. + (the default), all xaxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + xaxis and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of xaxis objects to select. To select xaxis objects by row and column, the Figure @@ -18107,12 +18183,16 @@ def for_each_xaxis(self, fn, selector=None, row=None, col=None): ---------- fn: Function that inputs a single xaxis object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. xaxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all xaxis objects are selected. + (the default), all xaxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + xaxis and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of xaxis objects to select. To select xaxis objects by row and column, the Figure @@ -18140,12 +18220,16 @@ def update_xaxes( patch: dict Dictionary of property updates to be applied to all xaxis objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. xaxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all xaxis objects are selected. + (the default), all xaxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + xaxis and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -18178,12 +18262,16 @@ def select_yaxes(self, selector=None, row=None, col=None, secondary_y=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. yaxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all yaxis objects are selected. + (the default), all yaxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + yaxis and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of yaxis objects to select. To select yaxis objects by row and column, the Figure @@ -18221,12 +18309,16 @@ def for_each_yaxis(self, fn, selector=None, row=None, col=None, secondary_y=None ---------- fn: Function that inputs a single yaxis object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. yaxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all yaxis objects are selected. + (the default), all yaxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + yaxis and those for which the function returned True will + be in the selection. row, col: int or None (default None) Subplot row and column index of yaxis objects to select. To select yaxis objects by row and column, the Figure @@ -18275,12 +18367,16 @@ def update_yaxes( patch: dict Dictionary of property updates to be applied to all yaxis objects that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. yaxis objects will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None - (the default), all yaxis objects are selected. + (the default), all yaxis objects are selected. If a + function, it must be a function accepting a single argument and + returning a boolean. The function will be called on each + yaxis and those for which the function returned True will + be in the selection. overwrite: bool If True, overwrite existing properties. If False, apply updates to existing properties recursively, preserving existing @@ -18326,12 +18422,15 @@ def select_annotations(self, selector=None, row=None, col=None, secondary_y=None Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Annotations will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all annotations are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each annotation and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of annotations to select. To select annotations by row and column, the Figure must have been @@ -18371,12 +18470,15 @@ def for_each_annotation( ---------- fn: Function that inputs a single annotation object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all annotations are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each annotation and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of annotations to select. To select annotations by row and column, the Figure must have been @@ -18423,12 +18525,15 @@ def update_annotations( patch: dict or None (default None) Dictionary of property updates to be applied to all annotations that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all annotations are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each annotation and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of annotations to select. To select annotations by row and column, the Figure must have been @@ -18888,12 +18993,15 @@ def select_layout_images(self, selector=None, row=None, col=None, secondary_y=No Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Annotations will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all images are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each image and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of images to select. To select images by row and column, the Figure must have been @@ -18933,12 +19041,15 @@ def for_each_layout_image( ---------- fn: Function that inputs a single image object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all images are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each image and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of images to select. To select images by row and column, the Figure must have been @@ -18981,12 +19092,15 @@ def update_layout_images( patch: dict or None (default None) Dictionary of property updates to be applied to all images that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all images are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each image and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of images to select. To select images by row and column, the Figure must have been @@ -19192,12 +19306,15 @@ def select_shapes(self, selector=None, row=None, col=None, secondary_y=None): Parameters ---------- - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Annotations will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all shapes are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each shape and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of shapes to select. To select shapes by row and column, the Figure must have been @@ -19235,12 +19352,15 @@ def for_each_shape(self, fn, selector=None, row=None, col=None, secondary_y=None ---------- fn: Function that inputs a single shape object. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all shapes are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each shape and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of shapes to select. To select shapes by row and column, the Figure must have been @@ -19283,12 +19403,15 @@ def update_shapes( patch: dict or None (default None) Dictionary of property updates to be applied to all shapes that satisfy the selection criteria. - selector: dict or None (default None) + selector: dict, function, or None (default None) Dict to use as selection criteria. Traces will be selected if they contain properties corresponding to all of the dictionary's keys, with values that exactly match the supplied values. If None (the default), all shapes are - selected. + selected. If a function, it must be a function accepting a single + argument and returning a boolean. The function will be called on + each shape and those for which the function returned True + will be in the selection. row, col: int or None (default None) Subplot row and column index of shapes to select. To select shapes by row and column, the Figure must have been From b841b7c6676f22df5882e78c483487e19829ae4e Mon Sep 17 00:00:00 2001 From: Nicholas Esterer Date: Fri, 30 Oct 2020 09:54:27 -0400 Subject: [PATCH 2/2] Added reminder in PR checklist to add/update docstrings --- .github/pull_request_template.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 479386c1a55..288a71d2de9 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -33,5 +33,6 @@ below :-). - [ ] For a new feature, I have added documentation examples in an existing or new tutorial notebook (please see the doc checklist as well). - [ ] I have added a CHANGELOG entry if fixing/changing/adding anything substantial. +- [ ] For a new feature or a change in behaviour, I have updated the relevant docstrings in the code to describe the feature or behaviour (please see the doc checklist as well). -->