master > master: src - widgets

This commit is contained in:
RD
2022-10-21 22:08:09 +02:00
parent f9186f0464
commit 6f24f4f635
5 changed files with 190 additions and 9 deletions

View File

@@ -63,7 +63,7 @@ class Function(Generic[T1,T2]):
];
return getattr(self, '_indexes');
def draw(self) -> Figure:
def draw(self) -> tuple[Figure, Axes]:
return Functions(self).draw();
class Functions:
@@ -74,7 +74,7 @@ class Functions:
self.fcts = list(f);
self.name = r' \circ '.join([ fct.name[0] for fct in self.fcts ][::-1]);
def draw(self, show_labels: bool = True) -> Figure:
def draw(self, show_labels: bool = True) -> tuple[Figure, Axes]:
N = len(self.fcts);
obj = mplot.subplots(1, 1, constrained_layout=True);
fig: Figure = obj[0];
@@ -165,8 +165,7 @@ class Functions:
# update range of composition:
comp_range = comp_range_next;
return fig;
return fig, axs;
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# AUXILIARY