1.4 KiB
1.4 KiB
Graphs
Introduction
The graphs are used to display the data from the sensors. The data is collected by the raspberry pi and then displayed on the graphs. The graphs are made using the plotly library .
Requirements
Live graphs
- Every node has to have a live graph
- The graphs has to be updated every 5 seconds
- All the data from one node has to fit in one graph
Class diagrams
Live graphs
classDiagram
class liveGraph {
+nodeId
+cnt
+timeArray
+tempArray
+humiArray
+eco2Array
+tvocArray
makeGraph()
updateGraph()
updateData()
}
Order of operations
Live graphs
sequenceDiagram
participant Node
participant Raspberry pi
participant Website
Node->>Raspberry pi: sensordata via websocket every 5 seconds
Raspberry pi->>Website: Node data via websocket if new data is received from the node
Website->>Website: updateGraph()
Website->>Website: updateData()
- Every node sends its data to the raspberry pi via websocket every 5 seconds
- The raspberry pi sends the data to the website via websocket if new data is received from the node
- The website updates the data coming from the raspberry pi on its own variables and arrays
- The website updates the live graphs every time new data is received from the websocket