How the NodePlotLib stream implementation works
mainNodePlotLib uses a real-time API (such as WebSockets) to connect plot windows (apps/web) to a server.
- Connection Logic: The server tracks the number of connected apps. If you call the
plotfunction multiple times, a new window will only open if there is no existing active connection to an apps/web instance. - Data Transmission: Instead of sending a single large object, the server transmits plots one by one. This allows for real-time updates where only the specific updated plot is transmitted over the stream.
- Plot Management: Plot streams are stored in a
Plots Set. When an apps/web instance connects, it subscribes to all plots currently in that set.