signalk-wmo-gust 0.4.2 → 0.4.3
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/CHANGELOG.md +7 -0
- package/README.md +2 -0
- package/package.json +1 -1
- package/public/index.html +46 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
5
|
|
|
6
|
+
## 0.4.3
|
|
7
|
+
|
|
8
|
+
_2026-11-22_
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Under the WMO gust and 10-minute peak tiles, the wind history app shows the highest value of the chosen period (1, 3, 24 or 72 hours) and how long ago it was; older than 24 hours, the date and time instead.
|
|
12
|
+
|
|
6
13
|
## 0.4.2
|
|
7
14
|
|
|
8
15
|
_2026-11-19_
|
package/README.md
CHANGED
|
@@ -95,6 +95,8 @@ The plugin includes a web app, **WMO Wind**, under **Web Apps** in the Signal K
|
|
|
95
95
|
- **gusts**: the WMO 3-second gust, the absolute maximum (highest single sample), or both, at 10 m or at sensor height;
|
|
96
96
|
- the 10-minute **mean direction**, as arrows pointing downwind, with the direction the wind comes from in degrees.
|
|
97
97
|
|
|
98
|
+
Under the WMO gust and 10-minute peak tiles, the app also shows the highest value of the chosen period and how long ago it was, for example `3 h max 29.2 · 2 h 20 min ago`. When it was more than 24 hours ago, the date and time are shown instead. That time is the middle of the history point, so it is accurate to within half a point: 30 seconds for 1 and 3 hours, 2.5 minutes for 24 hours, 7.5 minutes for 72 hours.
|
|
99
|
+
|
|
98
100
|
Touch or click a chart to read the values at that moment. Units are knots or m/s, and a night mode keeps the screen dark.
|
|
99
101
|
|
|
100
102
|
The app reads the **Signal K History API**, so a history provider must record this plugin's paths, for example **signalk-questdb**. It works without logging in, so it can run on Garmin chartplotters with OneHelm, for example through **signalk-garmin-onehelm**. It uses no external libraries or fonts, so it works offline.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signalk-wmo-gust",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "WMO-standard 10-minute mean wind, mean direction and 3-second gust for Signal K, with 1/3/6-hour gust maxima, and a web app charting the last 1, 3, 24 and 72 hours",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
package/public/index.html
CHANGED
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
.now.gust .value { color: var(--gust); }
|
|
36
36
|
.now.peak .value { color: var(--peak); }
|
|
37
37
|
.now.dir .value { color: var(--dir); }
|
|
38
|
+
.now .since { font-size: 0.8125rem; color: var(--muted); white-space: nowrap; margin-top: 0.125rem; }
|
|
39
|
+
.now .since b { font-weight: 500; color: var(--ink); }
|
|
40
|
+
.now .since .ago-s { display: none; }
|
|
38
41
|
nav { display: flex; flex-wrap: wrap; align-items: center; padding: 0 0.75rem; }
|
|
39
42
|
.group { display: flex; align-items: center; margin: 0 1rem 0.5rem 0; }
|
|
40
43
|
.group span { font-size: 0.875rem; color: var(--muted); margin-right: 0.5rem; }
|
|
@@ -70,6 +73,10 @@
|
|
|
70
73
|
.now .label { font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
71
74
|
.now .value { font-size: 1.3125rem; }
|
|
72
75
|
.now .value small { font-size: 0.75rem; }
|
|
76
|
+
.now .since { font-size: 0.6875rem; overflow: hidden; text-overflow: ellipsis; }
|
|
77
|
+
.now .since .per, .now .since .dot { display: none; }
|
|
78
|
+
.now .since .ago { display: none; }
|
|
79
|
+
.now .since .ago-s { display: block; white-space: normal; }
|
|
73
80
|
nav { padding: 0 0.5rem; }
|
|
74
81
|
.group { margin: 0 0.5rem 0.375rem 0; }
|
|
75
82
|
.group span { font-size: 0.75rem; margin-right: 0.25rem; }
|
|
@@ -84,8 +91,8 @@
|
|
|
84
91
|
<header>
|
|
85
92
|
<div class="now mean"><div class="label">Mean at 10 m</div><div class="value" id="nMean">–</div></div>
|
|
86
93
|
<div class="now means"><div class="label">Mean at sensor</div><div class="value" id="nMeanS">–</div></div>
|
|
87
|
-
<div class="now gust"><div class="label" id="nGustLabel">WMO gust</div><div class="value" id="nGust">–</div></div>
|
|
88
|
-
<div class="now peak"><div class="label" id="nPeakLabel">Peak, 10 min</div><div class="value" id="nPeak">–</div></div>
|
|
94
|
+
<div class="now gust"><div class="label" id="nGustLabel">WMO gust</div><div class="value" id="nGust">–</div><div class="since" id="nGustMax"></div></div>
|
|
95
|
+
<div class="now peak"><div class="label" id="nPeakLabel">Peak, 10 min</div><div class="value" id="nPeak">–</div><div class="since" id="nPeakMax"></div></div>
|
|
89
96
|
<div class="now dir"><div class="label">From</div><div class="value" id="nDir">–</div></div>
|
|
90
97
|
</header>
|
|
91
98
|
<nav>
|
|
@@ -239,6 +246,42 @@
|
|
|
239
246
|
$('nGust').innerHTML = fmt(gust === null ? null : gust * s, true)
|
|
240
247
|
$('nPeak').innerHTML = fmt(peak === null ? null : peak * s, true)
|
|
241
248
|
$('nDir').innerHTML = dir === null ? '–' : pad3(deg(dir)) + '°<small>' + compass(dir) + '</small>' + arrowSvg(dir)
|
|
249
|
+
showMaxima()
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Under the gust and peak tiles: the highest value of the chart period and how long ago
|
|
253
|
+
// it was; older than 24 h, the date and time instead. A point's time is the middle of its
|
|
254
|
+
// history bucket (1 min for 1 and 3 h, 5 min for 24 h, 15 min for 72 h).
|
|
255
|
+
function showMaxima () {
|
|
256
|
+
var start = Date.now() - Number(state.range) * 3600000
|
|
257
|
+
var s = state.gustH === 'sensor'
|
|
258
|
+
if (!points.length) { $('nGustMax').innerHTML = ''; $('nPeakMax').innerHTML = ''; return }
|
|
259
|
+
;[['gust', 'nGustMax'], ['peak', 'nPeakMax']].forEach(function (k) {
|
|
260
|
+
var best = null
|
|
261
|
+
points.forEach(function (p) {
|
|
262
|
+
if (p.t < start || p[k[0]] === null) return
|
|
263
|
+
var f = p.f || liveFactor
|
|
264
|
+
var v = s ? (f ? p[k[0]] / f : null) : p[k[0]]
|
|
265
|
+
if (v !== null && (!best || v > best.v)) best = { v: v, t: p.t }
|
|
266
|
+
})
|
|
267
|
+
// The live 10-minute value can be newer than the last history point.
|
|
268
|
+
var lv = live[k[0]]
|
|
269
|
+
if (num(lv)) {
|
|
270
|
+
if (s) lv = liveFactor ? lv / liveFactor : null
|
|
271
|
+
if (lv !== null && (!best || lv > best.v)) best = { v: lv, t: null }
|
|
272
|
+
}
|
|
273
|
+
$(k[1]).innerHTML = best ? '<span class="per">' + state.range + ' h </span>max <b>' + fmt(best.v) + '</b><span class="dot"> · </span><span class="ago">' + since(best.t) + '</span><span class="ago-s">' + since(best.t, true) + '</span>' : ''
|
|
274
|
+
})
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// short: the compact form for narrow screens.
|
|
278
|
+
function since (t, short) {
|
|
279
|
+
if (t === null) return short ? '10 min' : 'last 10 min'
|
|
280
|
+
var min = Math.max(0, Math.round((Date.now() - t) / 60000))
|
|
281
|
+
if (min < 1) return 'just now'
|
|
282
|
+
if (min < 60) return min + (short ? ' min' : ' min ago')
|
|
283
|
+
if (min < 1440) return Math.floor(min / 60) + ' h ' + two(min % 60) + (short ? '' : ' min ago')
|
|
284
|
+
return dm(t) + ' ' + hm(t)
|
|
242
285
|
}
|
|
243
286
|
|
|
244
287
|
// ---- formatting ---------------------------------------------------------
|
|
@@ -396,6 +439,7 @@
|
|
|
396
439
|
if (selected >= 0 && points[selected]) cross(c, d, list, X, Y, S, D, ink)
|
|
397
440
|
legend(list)
|
|
398
441
|
summary(list)
|
|
442
|
+
showMaxima()
|
|
399
443
|
}
|
|
400
444
|
|
|
401
445
|
function timeAxis (c, r, start, end, X, yTop, yBottom, rule, muted, labels) {
|