Refactor code to dynamically create node data and live graphs
This commit is contained in:
11
web/main.js
11
web/main.js
@@ -192,13 +192,10 @@ function updateNodeData(node, temperature, humidity, eCO2, TVOC) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Call the function to create the HTML structure
|
// Call the function to create the HTML structure
|
||||||
createNodeData(1);
|
for (let i = 1; i <= 4; i++) {
|
||||||
createNodeData(2);
|
createNodeData(i);
|
||||||
createNodeData(3);
|
liveGraphs.push(new liveGraph(i));
|
||||||
createNodeData(4);
|
}
|
||||||
|
|
||||||
// Create a new liveGraph object
|
|
||||||
liveGraphs.push(new liveGraph(1));
|
|
||||||
|
|
||||||
// make the graphs
|
// make the graphs
|
||||||
liveGraphs.forEach((graph) => {
|
liveGraphs.forEach((graph) => {
|
||||||
|
Reference in New Issue
Block a user