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