|
| 1 | +These are notes for the stream implementation of Nodeplotlib. |
| 2 | + |
| 3 | +## General |
| 4 | +- A plot window (**apps/web**) tries to connect to the server via a realtime api (e.g. websockets). |
| 5 | +- The server recognizes the count of connected apps. |
| 6 | +- If the user executes the `plot` function several times, it will only open a window if there is no |
| 7 | + open connection to a **apps/web**. |
| 8 | + |
| 9 | +## Server lifecycle |
| 10 | +- The server starts with the execution of the `plot` function if there is no active server running. |
| 11 | +- The server stops if all **apps/web** are disconnected (and there were connections before). |
| 12 | + |
| 13 | +## The plot function |
| 14 | +- The plot function can either handle a `Plot` or an `Observable<Plot>`. |
| 15 | + - It creates an `Observable<Plot>` by using Rxjs' `of` observable constructor. |
| 16 | +- The plot streams are saved in a Plots Set. |
| 17 | +- If there is an active **apps/web** that listens to the server, it subscribes to all Plots in the Set. |
| 18 | +- It does not submit a whole "plots" object, but rather submits all plots one by one. The reason is |
| 19 | + realtime data, for which only the updated plot should be transmitted. |
| 20 | +- If all **apps/web** are disconnected, it should close the observable subscriptions of the plots and close |
| 21 | + the server as mentioned in the **server lifecycle** section. |
| 22 | + |
| 23 | +## The stack function |
| 24 | +- Is the `stack` function really needed? Stack served the purpose that only one window opens which |
| 25 | + could display several plots. |
| 26 | + |
| 27 | +## Backlog |
| 28 | +- The user can remove plots from the frontend. If that happened it submits a message to the |
| 29 | + backend so that the subscription can be cancelled and the plot stream can be removed from the plots set. |
| 30 | + |
| 31 | +## Frontend only |
| 32 | +- The user has the possibility to rearrange plots per drag and drop. |
| 33 | +- The user can resize the individual plot windows. |
0 commit comments