@sailingrotevista/rotevista-dash 7.0.5 → 7.0.6
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/app.js +1 -1
- package/charts.js +24 -19
- package/package.json +1 -1
package/app.js
CHANGED
|
@@ -23,7 +23,7 @@ let CONFIG = {
|
|
|
23
23
|
minSpeed: 0.5,
|
|
24
24
|
stabilityBreakout: 15
|
|
25
25
|
},
|
|
26
|
-
graphs: { reef1:
|
|
26
|
+
graphs: { reef1: 5, reef2: 10, historyMinutes: 10, samples: 60 },
|
|
27
27
|
scales: {
|
|
28
28
|
stw: { stdMax: 4, hercSpan: 2, step: 1 },
|
|
29
29
|
sog: { stdMax: 4, hercSpan: 2, step: 1 },
|
package/charts.js
CHANGED
|
@@ -179,25 +179,30 @@ function drawGraph(d, id, min, max, isTws, isHercules) {
|
|
|
179
179
|
const colDepth = "#0088cc", colStw = "#00C851", colSog = "#ffbb33", colVmg = "#00b8d4";
|
|
180
180
|
|
|
181
181
|
const getColorProps = (val) => {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
|
|
182
|
+
const baseStroke = isFocused ? "4.2" : "1.6";
|
|
183
|
+
const alertStroke = isFocused ? "4.8" : "2.2";
|
|
184
|
+
const warnStroke = isFocused ? "4.4" : "1.8";
|
|
185
|
+
|
|
186
|
+
let color = colTws, opacity = "0.15", stroke = baseStroke;
|
|
187
|
+
if (isTws) {
|
|
188
|
+
const baseWind = (displayModeTws === 'AWS') ? colAws : colTws;
|
|
189
|
+
const r1 = CONFIG.graphs.reef1 || 15;
|
|
190
|
+
const r2 = CONFIG.graphs.reef2 || 20;
|
|
191
|
+
const r3 = r2 + (r2 - r1); // Calcolo sintetico del 3° Terzarolo (Storm)
|
|
192
|
+
|
|
193
|
+
if (val >= r3) { color = "#9c27b0"; opacity = "0.65"; stroke = alertStroke; } // Viola (Tempesta / 3a Mano)
|
|
194
|
+
else if (val >= r2) { color = colDanger; opacity = "0.55"; stroke = alertStroke; } // Rosso (Pericolo / 2a Mano)
|
|
195
|
+
else if (val >= r1) { color = colWarning; opacity = "0.45"; stroke = warnStroke; } // Arancione (Allerta / 1a Mano)
|
|
196
|
+
else color = baseWind;
|
|
197
|
+
} else if (isDepth) {
|
|
198
|
+
if (val < CONFIG.alarms.depthDanger) { color = colDanger; opacity = "0.55"; stroke = alertStroke; }
|
|
199
|
+
else if (val < CONFIG.alarms.depthWarning) { color = colWarning; opacity = "0.45"; stroke = warnStroke; }
|
|
200
|
+
else color = colDepth;
|
|
201
|
+
} else {
|
|
202
|
+
if (id === 'stw-graph') color = colStw;
|
|
203
|
+
else if (id === 'sog-graph') color = (displayModeSog === 'VMG') ? colVmg : colSog;
|
|
204
|
+
}
|
|
205
|
+
return { color, opacity, stroke };
|
|
201
206
|
};
|
|
202
207
|
|
|
203
208
|
let grids = "";
|