diff --git a/packages/python/plotly/codegen/figure.py b/packages/python/plotly/codegen/figure.py index 1a0f073af8c..6c5d98fdf98 100644 --- a/packages/python/plotly/codegen/figure.py +++ b/packages/python/plotly/codegen/figure.py @@ -473,7 +473,7 @@ def for_each_{method_prefix}{singular_name}( def update_{method_prefix}{plural_name}( self, - patch, + patch=None, selector=None, row=None, col=None, diff --git a/packages/python/plotly/plotly/graph_objs/_figure.py b/packages/python/plotly/plotly/graph_objs/_figure.py index e0077b12507..d907b8634c9 100644 --- a/packages/python/plotly/plotly/graph_objs/_figure.py +++ b/packages/python/plotly/plotly/graph_objs/_figure.py @@ -17450,7 +17450,7 @@ def for_each_annotation( return self def update_annotations( - self, patch, selector=None, row=None, col=None, secondary_y=None, **kwargs + self, patch=None, selector=None, row=None, col=None, secondary_y=None, **kwargs ): """ Perform a property update operation on all annotations that satisfy the @@ -17949,7 +17949,7 @@ def for_each_layout_image( return self def update_layout_images( - self, patch, selector=None, row=None, col=None, secondary_y=None, **kwargs + self, patch=None, selector=None, row=None, col=None, secondary_y=None, **kwargs ): """ Perform a property update operation on all images that satisfy the @@ -18221,7 +18221,7 @@ def for_each_shape(self, fn, selector=None, row=None, col=None, secondary_y=None return self def update_shapes( - self, patch, selector=None, row=None, col=None, secondary_y=None, **kwargs + self, patch=None, selector=None, row=None, col=None, secondary_y=None, **kwargs ): """ Perform a property update operation on all shapes that satisfy the diff --git a/packages/python/plotly/plotly/graph_objs/_figurewidget.py b/packages/python/plotly/plotly/graph_objs/_figurewidget.py index 89042ba6645..bb8d57a1d68 100644 --- a/packages/python/plotly/plotly/graph_objs/_figurewidget.py +++ b/packages/python/plotly/plotly/graph_objs/_figurewidget.py @@ -17450,7 +17450,7 @@ def for_each_annotation( return self def update_annotations( - self, patch, selector=None, row=None, col=None, secondary_y=None, **kwargs + self, patch=None, selector=None, row=None, col=None, secondary_y=None, **kwargs ): """ Perform a property update operation on all annotations that satisfy the @@ -17949,7 +17949,7 @@ def for_each_layout_image( return self def update_layout_images( - self, patch, selector=None, row=None, col=None, secondary_y=None, **kwargs + self, patch=None, selector=None, row=None, col=None, secondary_y=None, **kwargs ): """ Perform a property update operation on all images that satisfy the @@ -18221,7 +18221,7 @@ def for_each_shape(self, fn, selector=None, row=None, col=None, secondary_y=None return self def update_shapes( - self, patch, selector=None, row=None, col=None, secondary_y=None, **kwargs + self, patch=None, selector=None, row=None, col=None, secondary_y=None, **kwargs ): """ Perform a property update operation on all shapes that satisfy the diff --git a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py index 26e589603db..0edd3cb644d 100644 --- a/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py +++ b/packages/python/plotly/plotly/tests/test_core/test_update_objects/test_update_annotations.py @@ -219,6 +219,10 @@ def test_update_annotations(self): "annotations", [4], patch=dict(showarrow=False), secondary_y=True ) + def test_annotation_attributes(self): + self.fig.add_annotation(text="this text", yref="paper") + self.fig.update_annotations(text="hi") + def test_update_shapes(self): ( self.fig.add_shape(opacity=0.1, fillcolor="red") @@ -237,6 +241,11 @@ def test_update_shapes(self): self.assert_update("shapes", [2, 5], patch=dict(opacity=0), col=1) self.assert_update("shapes", [4], patch=dict(opacity=0), secondary_y=True) + def test_shape_attributes(self): + + self.fig.add_shape(fillcolor="blue", opacity=0.3) + self.fig.update_shapes(fillcolor="red") + def test_update_images(self): ( self.fig.add_layout_image(opacity=0.1, source="red") @@ -254,3 +263,7 @@ def test_update_images(self): self.assert_update("images", [2, 3, 4], patch=dict(opacity=0), row=1) self.assert_update("images", [2, 5], patch=dict(opacity=0), col=1) self.assert_update("images", [4], patch=dict(opacity=0), secondary_y=True) + + def test_image_attributes(self): + self.fig.add_layout_image(name="my name", x=1, y=2) + self.fig.update_layout_images(opacity=0.1)