From a81564e582d46657aa7025a1a02239bc707b7fa6 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr> Date: Wed, 27 Sep 2023 09:20:17 +0200 Subject: [PATCH] doc: dev: Write Plot section. --- doc/dev/documentation.org | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/doc/dev/documentation.org b/doc/dev/documentation.org index f12426b2..6ec31a3c 100644 --- a/doc/dev/documentation.org +++ b/doc/dev/documentation.org @@ -602,8 +602,35 @@ creation, this stack is accessible at =self._undo_stack=. ) #+end_src -*** TODO Plot -*** TODO Mainwindow +*** Plot + +To define a new plot you can create a class who inherit to APlot. The +creator need threee argument: + - A =canvas= of type =MplCanvas= + - A =data= used in =draw= and =update= to create and update the plot + - A optional =toolbar= of type =PamhyrToolbar= +This class must implement two method =draw= and =update=, the first +method to draw the plot from scratch, the second to update the plot if +data has changed. + +#+begin_src python :python python3 :results output :noweb yes + from View.Plot.APlot import APlot + + class MyPlot(APlot): + def __init__(self, canvas=None, data=None, toolbar=None): + super(MyPlot, self).__init__( + canvas=canvas, + data=data, + toolbar=toolbar + ) + + def draw(self): + # Draw function code... + + def update(self, ind = None): + # Update function code... +#+end_src + ** TODO Solver #+name: graph-pipeline -- GitLab