fix hide/show graph window

This commit is contained in:
2025-07-13 12:13:59 -04:00
parent c7c5df68d3
commit a02eae32a1
3 changed files with 11 additions and 8 deletions

View File

@@ -18,6 +18,7 @@ interface Window {
logTemp?: Function; //function to log a temputure event
exportCSV?: Function; //function to export the events to CSV
showGraph?: Function; // function to render or display graphs using libraries like Chart.js for visual representation of logged events
hideGraph?: Function; //function to hind the graph popup
}
@@ -168,6 +169,14 @@ function showGraph(): void {
}
}
function hideGraph(): void {
const graphContainer = document.getElementById("graph-container");
if (graphContainer) {
graphContainer.classList.add("hidden");
graphContainer.classList.remove("graph-display-flex");
}
}
// Expose functions to the global scope (allowing html direct access)
if (typeof window !== 'undefined') {
window.startTimer = startTimer;
@@ -179,4 +188,5 @@ if (typeof window !== 'undefined') {
window.logTemp = logTemp;
window.exportCSV = exportCSV;
window.showGraph = showGraph;
window.hideGraph = hideGraph;
}