-
Notifications
You must be signed in to change notification settings - Fork 742
Description
I have a very specific question regarding a real-time medical research data visualisation app that I am building in a French hospital.
I have a Python backend that consumes data with a high temporal resolution (high frequency) from a Kafka broker, calculates some lower-frequency signals from this data, and then exposes it through an EventSource server.
My Fresh server runs on the same machine as the Python backend, and exposes the real-time visualisation application to doctors.
On the client side, I want the client to directly connect to the Python backend's EventSource server to subscribe to streams of data.
Each data point that is coming through has a "label". Each plot has a specific set of labels that it's going to subscribe to, and use for its particular visualisation.
Plots might share labels (e.g. PlotA and PlotB will both subscribe to label xyz).
I am wondering how to structure this with Fresh. And in particular:
- Where should my state, that's going to store and cache incoming data, be located? I want the state to be shared from one plot to another, such that switching from one plot to another is not triggering a reload of the data.
- Should each plot be an island? I have looked at this project but I don't really understand whether the plot components are islands or not.
- How can I dynamically create new preact
Signalas new labels are being subscribed to? My thinking is that a plot should be updated only when data with the labels it's subscribing to received new data. i.e. if labelycomes in but the current plot being displayed doesn't care about labely, then it should not be updated (useless recalculation).
In general, being new to (p)react and Fresh, I am still a bit confused by all these concepts.
If someone more experienced with Fresh and preact could give her two cents that would be great!
Thanks :)