diff --git a/doc/dev/documentation.org b/doc/dev/documentation.org index f12426b21d09fbdcd6b42bb2437d705f477a7a72..6ec31a3c67e0128aaf7ec3bf50099ece94d57901 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