@sailingrotevista/rotevista-dash 7.0.9 → 7.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/charts.js CHANGED
@@ -156,14 +156,14 @@ function refreshGraph(t) {
156
156
  // Genera fisicamente le curve e le aree SVG
157
157
  function drawGraph(d, id, min, max, isTws, isHercules) {
158
158
  const svg = document.getElementById(id);
159
- if (!svg || d.length < 2) return;
159
+ if (!svg) return;
160
160
 
161
161
  const w = 200, h = 40;
162
162
  const range = max - min || 1;
163
163
  const isDepth = (id === 'depth-graph');
164
164
 
165
- const latestPoint = d[d.length - 1];
166
- const now = latestPoint ? latestPoint.time : Date.now();
165
+ // Utilizza sempre il tempo reale corrente per permettere lo scorrimento continuo dei dati
166
+ const now = Date.now();
167
167
 
168
168
  const box = svg.closest('.data-box');
169
169
  const isFocused = isFocusActive && box && box.classList.contains('is-focused');
@@ -173,7 +173,10 @@ function drawGraph(d, id, min, max, isTws, isHercules) {
173
173
  const viewportStart = now - viewportMs;
174
174
 
175
175
  const visibleData = d.filter(p => p.time >= viewportStart);
176
- if (visibleData.length < 2) return;
176
+ if (visibleData.length < 2) {
177
+ svg.innerHTML = ""; // Svuota completamente l'SVG se il sensore è spento e i dati sono scivolati fuori scala
178
+ return;
179
+ }
177
180
 
178
181
  const colDanger = "#ff3b30", colWarning = "#ff9800", colTws = "#2c3e50", colAws = "#5c6bc0";
179
182
  const colDepth = "#0088cc", colStw = "#00C851", colSog = "#ffbb33", colVmg = "#00b8d4";
package/index.html CHANGED
@@ -49,8 +49,8 @@
49
49
  </div>
50
50
 
51
51
  <div class="data-box box-tack">
52
- <div class="label-row"><span class="label">TACK</span></div>
53
- <div class="dual-value-container">
52
+ <div class="label-row"><span class="label" id="tack-label">TACK</span></div>
53
+ <div class="dual-value-container">
54
54
  <div class="dual-value-col tack-hdg-col">
55
55
  <span class="dual-label">HDG</span>
56
56
  <span class="value dual-val" id="tack-hdg">---&deg;</span>