@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.
Files changed (3) hide show
  1. package/app.js +1 -1
  2. package/charts.js +24 -19
  3. 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: 15, reef2: 20, historyMinutes: 10, samples: 60 },
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
- 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
- if (val >= CONFIG.graphs.reef2) { color = colDanger; opacity = "0.55"; stroke = alertStroke; }
190
- else if (val >= CONFIG.graphs.reef1) { color = colWarning; opacity = "0.45"; stroke = warnStroke; }
191
- else color = baseWind;
192
- } else if (isDepth) {
193
- if (val < CONFIG.alarms.depthDanger) { color = colDanger; opacity = "0.55"; stroke = alertStroke; }
194
- else if (val < CONFIG.alarms.depthWarning) { color = colWarning; opacity = "0.45"; stroke = warnStroke; }
195
- else color = colDepth;
196
- } else {
197
- if (id === 'stw-graph') color = colStw;
198
- else if (id === 'sog-graph') color = (displayModeSog === 'VMG') ? colVmg : colSog;
199
- }
200
- return { color, opacity, stroke };
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 = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sailingrotevista/rotevista-dash",
3
- "version": "7.0.5",
3
+ "version": "7.0.6",
4
4
  "description": "Wind Dashboard with navigation and course aids",
5
5
  "main": "index.js",
6
6
  "publishConfig": {