8000 Fix direct instantiation of webagg_core managers. · matplotlib/matplotlib@9369769 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9369769

Browse files
committed
Fix direct instantiation of webagg_core managers.
manager_class and _toolbar2_class were correctly set for the webagg and nbagg subclasses, but the embedding_webagg_sgskip example directly instantiates a webagg_core manager, so it needs these attributes too.
1 parent 446de7b commit 9369769

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/backend_webagg_core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def _timer_set_interval(self):
155155

156156

157157
class FigureCanvasWebAggCore(backend_agg.FigureCanvasAgg):
158+
manager_class = _api.classproperty(lambda cls: FigureManagerWebAgg)
158159
_timer_cls = TimerAsyncio
159160
# Webagg and friends having the right methods, but still
160161
# having bugs in practice. Do not advertise that it works until
@@ -426,7 +427,7 @@ def set_history_buttons(self):
426427

427428

428429
class FigureManagerWebAgg(backend_bases.FigureManagerBase):
429-
ToolbarCls = NavigationToolbar2WebAgg
430+
_toolbar2_class = ToolbarCls = NavigationToolbar2WebAgg
430431

431432
def __init__(self, canvas, num):
432433
self.web_sockets = set()

0 commit comments

Comments
 (0)
0