diff --git a/web/newWebsite/main.js b/web/newWebsite/main.js index d55fb12..c5e1486 100644 --- a/web/newWebsite/main.js +++ b/web/newWebsite/main.js @@ -103,7 +103,6 @@ async function nodeAdressHandler(node, dataTypes) { sensorData[node] = gaugeGroup; gaugeGroup.graph.makeGraph(); sensorData[node] = gaugeGroup; - } } @@ -129,3 +128,17 @@ function getNodeInfo(node){ } +// create a function to enable and disable the graph using .disabled using the id of the graph +function toggleGraph(nodeId) { + let graph = document.querySelector('#liveGraph' + nodeId); + + if (graph) { + if (graph.classList.contains('disabled')) { + graph.classList.remove('disabled'); + } else { + graph.classList.add('disabled'); + } + } else { + console.error('No element found with id: liveGraph' + nodeId); + } +} \ No newline at end of file diff --git a/web/newWebsite/styles/dashboard-styles.css b/web/newWebsite/styles/dashboard-styles.css index 0758c94..d550f41 100644 --- a/web/newWebsite/styles/dashboard-styles.css +++ b/web/newWebsite/styles/dashboard-styles.css @@ -191,5 +191,10 @@ body { display: flex; width: 20vw; z-index: -0; - height: -; + +} +* +.disabled { + opacity: 0; + height: 0; } \ No newline at end of file