diff --git a/plotly/graph_objs/_figure.py b/plotly/graph_objs/_figure.py index 99529b66f1a..72db4856ccc 100644 --- a/plotly/graph_objs/_figure.py +++ b/plotly/graph_objs/_figure.py @@ -2,6 +2,7 @@ # Modifications will be overwitten the next time code generation run. from plotly.basedatatypes import BaseFigure +from plotly.graph_objs import Parcats class Figure(BaseFigure): @@ -340,7 +341,10 @@ def add_trace( Figure(...) """ - return super().add_trace(trace, row, col, secondary_y, exclude_empty_subplots) + # Avoid method resolution overhead by direct call + return BaseFigure.add_trace( + self, trace, row, col, secondary_y, exclude_empty_subplots + ) def add_traces( self, @@ -11945,7 +11949,6 @@ def add_parcats( ------- Figure """ - from plotly.graph_objs import Parcats new_trace = Parcats( arrangement=arrangement, @@ -11973,7 +11976,8 @@ def add_parcats( visible=visible, **kwargs, ) - return self.add_trace(new_trace, row=row, col=col) + # Direct BaseFigure.add_trace call for reduced overhead + return BaseFigure.add_trace(self, new_trace, row=row, col=col) def add_parcoords( self,