@azohra/meteo.station 0.4.2 → 0.5.0
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/dist/client/history.d.ts +8 -14
- package/dist/client/history.js +5 -7
- package/dist/climatology.d.ts +8 -3
- package/dist/climatology.js +27 -5
- package/dist/contract-climatology.d.ts +4 -0
- package/dist/contract-climatology.js +3 -1
- package/dist/elements/elements/DailyPatternElement.js +4 -4
- package/dist/elements/elements/WindHistoryChartElement.js +4 -4
- package/dist/geometry.d.ts +1 -1
- package/dist/geometry.js +3 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/react/components/DailyPattern.js +2 -2
- package/dist/react/components/RecentSummaries.d.ts +1 -2
- package/dist/react/components/RecentSummaries.js +1 -2
- package/dist/react/components/WindHistoryChart.js +2 -2
- package/dist/react/components/WindSampleStrip.js +2 -2
- package/dist/scene/climatology-pattern.js +1 -1
- package/dist/scene/climatology-rose.js +1 -1
- package/dist/scene/daily-pattern.js +3 -3
- package/dist/scene/trend.js +2 -7
- package/dist/scene/wind-plot.js +14 -6
- package/dist/server/adapters/windnerd-climatology.d.ts +5 -8
- package/dist/server/adapters/windnerd-climatology.js +11 -10
- package/dist/server/adapters/windnerd-live.d.ts +5 -8
- package/dist/server/adapters/windnerd-live.js +5 -8
- package/dist/server/adapters/windnerd.js +2 -3
- package/dist/server/environment.d.ts +4 -10
- package/dist/server/environment.js +4 -10
- package/dist/strings.d.ts +1 -1
- package/dist/strings.js +1 -1
- package/package.json +1 -1
- package/schema/stationclimatology.schema.json +26 -0
- package/styles.css +19 -21
package/dist/client/history.d.ts
CHANGED
|
@@ -6,13 +6,9 @@ type StationHistoryQuery = {
|
|
|
6
6
|
toMs: number;
|
|
7
7
|
periodMinutes: number;
|
|
8
8
|
};
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* handler uses `stationHistoryFetcher`; one that serves history its own way
|
|
13
|
-
* — an authenticated server function, a proxy — supplies any function of
|
|
14
|
-
* this shape and never touches the handler.
|
|
15
|
-
*/
|
|
9
|
+
/** One requested window in, one parsed document (or null on failure) out.
|
|
10
|
+
* A host that mounts the feed handler uses `stationHistoryFetcher`; a host
|
|
11
|
+
* serving history its own way supplies any function of this shape. */
|
|
16
12
|
type StationHistoryFetcher = (query: StationHistoryQuery) => Promise<StationHistory | null>;
|
|
17
13
|
/** The default fetcher, against the mounted handler's /history route. */
|
|
18
14
|
declare function stationHistoryFetcher(base: string, stationId: string, fetchInit?: RequestInit): StationHistoryFetcher;
|
|
@@ -37,17 +33,15 @@ type ArchiveWindow = {
|
|
|
37
33
|
/** The finest ladder period that keeps the span at or under the point
|
|
38
34
|
* target; a span too wide for every rung takes the coarsest. */
|
|
39
35
|
declare function archivePeriodFor(spanMs: number, periods?: ReadonlyArray<number>, targetPoints?: number): number;
|
|
40
|
-
/** One whole LOCAL day from a YYYY-MM-DD date-input value
|
|
41
|
-
*
|
|
42
|
-
* real date. */
|
|
36
|
+
/** One whole LOCAL day from a YYYY-MM-DD date-input value (not the UTC
|
|
37
|
+
* day); null when the value is not a real date. */
|
|
43
38
|
declare function archiveDayWindow(dateValue: string): ArchiveWindow | null;
|
|
44
39
|
/** The YYYY-MM-DD value naming an instant's local day. */
|
|
45
40
|
declare function archiveDayValue(atMs: number): string;
|
|
46
|
-
/** The day value
|
|
47
|
-
*
|
|
48
|
-
* the step on the wrong side. Null when the value is not a real date. */
|
|
41
|
+
/** The day value deltaDays away. Steps through noon so a DST-shifted
|
|
42
|
+
* midnight cannot skip a day; null for an invalid value. */
|
|
49
43
|
declare function archiveDayStep(dateValue: string, deltaDays: number): string | null;
|
|
50
|
-
/** The trailing
|
|
44
|
+
/** The trailing 24 h ending at nowMs. */
|
|
51
45
|
declare function archiveTrailingWindow(nowMs: number, spanMs?: number): ArchiveWindow;
|
|
52
46
|
//#endregion
|
|
53
47
|
export { ARCHIVE_DEFAULT_PERIODS_MINUTES, ARCHIVE_TARGET_POINTS, ArchiveWindow, HISTORY_STORE_DEFAULT_MAX_WINDOWS, StationHistoryFetcher, StationHistoryQuery, StationHistoryStore, archiveDayStep, archiveDayValue, archiveDayWindow, archivePeriodFor, archiveTrailingWindow, createStationHistoryStore, stationHistoryFetcher };
|
package/dist/client/history.js
CHANGED
|
@@ -71,9 +71,8 @@ function archivePeriodFor(spanMs, periods = ARCHIVE_DEFAULT_PERIODS_MINUTES, tar
|
|
|
71
71
|
for (const period of ascending) if (spanMs / (period * 6e4) <= targetPoints) return period;
|
|
72
72
|
return ascending[ascending.length - 1];
|
|
73
73
|
}
|
|
74
|
-
/** One whole LOCAL day from a YYYY-MM-DD date-input value
|
|
75
|
-
*
|
|
76
|
-
* real date. */
|
|
74
|
+
/** One whole LOCAL day from a YYYY-MM-DD date-input value (not the UTC
|
|
75
|
+
* day); null when the value is not a real date. */
|
|
77
76
|
function archiveDayWindow(dateValue) {
|
|
78
77
|
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(dateValue);
|
|
79
78
|
if (!match) return null;
|
|
@@ -95,15 +94,14 @@ function archiveDayValue(atMs) {
|
|
|
95
94
|
const pad = (value) => String(value).padStart(2, "0");
|
|
96
95
|
return `${at.getFullYear()}-${pad(at.getMonth() + 1)}-${pad(at.getDate())}`;
|
|
97
96
|
}
|
|
98
|
-
/** The day value
|
|
99
|
-
*
|
|
100
|
-
* the step on the wrong side. Null when the value is not a real date. */
|
|
97
|
+
/** The day value deltaDays away. Steps through noon so a DST-shifted
|
|
98
|
+
* midnight cannot skip a day; null for an invalid value. */
|
|
101
99
|
function archiveDayStep(dateValue, deltaDays) {
|
|
102
100
|
const window = archiveDayWindow(dateValue);
|
|
103
101
|
if (window == null) return null;
|
|
104
102
|
return archiveDayValue(window.fromMs + deltaDays * DAY_MS + DAY_MS / 2);
|
|
105
103
|
}
|
|
106
|
-
/** The trailing
|
|
104
|
+
/** The trailing 24 h ending at nowMs. */
|
|
107
105
|
function archiveTrailingWindow(nowMs, spanMs = DAY_MS) {
|
|
108
106
|
return {
|
|
109
107
|
fromMs: nowMs - spanMs,
|
package/dist/climatology.d.ts
CHANGED
|
@@ -27,6 +27,8 @@ type MutableCell = {
|
|
|
27
27
|
type ClimatologyAccumulator = {
|
|
28
28
|
readonly params: ClimatologyFoldParams;
|
|
29
29
|
readonly cells: Map<string, MutableCell>;
|
|
30
|
+
/** Distinct (month, day, slot) buckets holding a record, per year. */
|
|
31
|
+
readonly coveredSlots: Map<number, Set<string>>;
|
|
30
32
|
};
|
|
31
33
|
declare function createClimatologyAccumulator(params: ClimatologyFoldParams): ClimatologyAccumulator;
|
|
32
34
|
declare function foldClimatologyPoints(accumulator: ClimatologyAccumulator, points: ReadonlyArray<HistoryPoint>): void;
|
|
@@ -49,13 +51,16 @@ declare function climatologyPattern(document: StationClimatology, filters?: Pick
|
|
|
49
51
|
type ClimatologyCoverage = {
|
|
50
52
|
sampleCount: number;
|
|
51
53
|
expectedCount: number;
|
|
52
|
-
ratio: number;
|
|
54
|
+
ratio: number | null;
|
|
53
55
|
};
|
|
54
|
-
/**
|
|
56
|
+
/** Per-year covered-slot counts, for producers writing the ledger. */
|
|
57
|
+
declare function coveredSlotCountByYear(accumulator: ClimatologyAccumulator): Map<number, number>;
|
|
58
|
+
/** Summed over the ledger. The ratio comes only from the slot pair and is
|
|
59
|
+
* null when any year lacks it — no percent beats a wrong-unit percent. */
|
|
55
60
|
declare function climatologyCoverage(document: StationClimatology): ClimatologyCoverage;
|
|
56
61
|
/** The share of the filtered non-calm record blowing from inside the
|
|
57
62
|
* consumer's arcs, judged at each sector's centre bearing; null when
|
|
58
63
|
* nothing non-calm was recorded — absence over a fabricated zero. */
|
|
59
64
|
declare function climatologyFavorableShare(document: StationClimatology, arcs: ReadonlyArray<DirectionArc>, filters?: ClimatologyFilters): number | null;
|
|
60
65
|
//#endregion
|
|
61
|
-
export { ClimatologyAccumulator, ClimatologyCoverage, ClimatologyFilters, ClimatologyFoldParams, accumulatedCells, climatologyCoverage, climatologyFavorableShare, climatologyPattern, climatologyRose, createClimatologyAccumulator, foldClimatologyPoints };
|
|
66
|
+
export { ClimatologyAccumulator, ClimatologyCoverage, ClimatologyFilters, ClimatologyFoldParams, accumulatedCells, climatologyCoverage, climatologyFavorableShare, climatologyPattern, climatologyRose, coveredSlotCountByYear, createClimatologyAccumulator, foldClimatologyPoints };
|
package/dist/climatology.js
CHANGED
|
@@ -7,7 +7,8 @@ function createClimatologyAccumulator(params) {
|
|
|
7
7
|
if (params.sectorCount < 4) throw new Error(`climatology: sectorCount must be at least 4, got ${params.sectorCount}`);
|
|
8
8
|
return {
|
|
9
9
|
params,
|
|
10
|
-
cells: /* @__PURE__ */ new Map()
|
|
10
|
+
cells: /* @__PURE__ */ new Map(),
|
|
11
|
+
coveredSlots: /* @__PURE__ */ new Map()
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
function foldClimatologyPoints(accumulator, points) {
|
|
@@ -18,7 +19,15 @@ function foldClimatologyPoints(accumulator, points) {
|
|
|
18
19
|
const local = new Date(localMs);
|
|
19
20
|
const month = local.getUTCMonth() + 1;
|
|
20
21
|
const minuteOfDay = local.getUTCHours() * 60 + local.getUTCMinutes();
|
|
21
|
-
const
|
|
22
|
+
const slot = Math.floor(minuteOfDay / slotMinutes);
|
|
23
|
+
const year = local.getUTCFullYear();
|
|
24
|
+
let covered = accumulator.coveredSlots.get(year);
|
|
25
|
+
if (covered == null) {
|
|
26
|
+
covered = /* @__PURE__ */ new Set();
|
|
27
|
+
accumulator.coveredSlots.set(year, covered);
|
|
28
|
+
}
|
|
29
|
+
covered.add(`${month}/${local.getUTCDate()}/${slot}`);
|
|
30
|
+
const key = `${month}/${slot}`;
|
|
22
31
|
let cell = accumulator.cells.get(key);
|
|
23
32
|
if (cell == null) {
|
|
24
33
|
cell = {
|
|
@@ -176,18 +185,31 @@ function climatologyPattern(document, filters) {
|
|
|
176
185
|
};
|
|
177
186
|
});
|
|
178
187
|
}
|
|
179
|
-
/**
|
|
188
|
+
/** Per-year covered-slot counts, for producers writing the ledger. */
|
|
189
|
+
function coveredSlotCountByYear(accumulator) {
|
|
190
|
+
return new Map([...accumulator.coveredSlots.entries()].map(([year, slots]) => [year, slots.size]));
|
|
191
|
+
}
|
|
192
|
+
/** Summed over the ledger. The ratio comes only from the slot pair and is
|
|
193
|
+
* null when any year lacks it — no percent beats a wrong-unit percent. */
|
|
180
194
|
function climatologyCoverage(document) {
|
|
181
195
|
let sampleCount = 0;
|
|
182
196
|
let expectedCount = 0;
|
|
197
|
+
let coveredSlots = 0;
|
|
198
|
+
let expectedSlots = 0;
|
|
199
|
+
let slotsKnown = true;
|
|
183
200
|
for (const year of document.years) {
|
|
184
201
|
sampleCount += year.sampleCount;
|
|
185
202
|
expectedCount += year.expectedCount;
|
|
203
|
+
if (year.coveredSlotCount == null || year.expectedSlotCount == null) slotsKnown = false;
|
|
204
|
+
else {
|
|
205
|
+
coveredSlots += year.coveredSlotCount;
|
|
206
|
+
expectedSlots += year.expectedSlotCount;
|
|
207
|
+
}
|
|
186
208
|
}
|
|
187
209
|
return {
|
|
188
210
|
sampleCount,
|
|
189
211
|
expectedCount,
|
|
190
|
-
ratio:
|
|
212
|
+
ratio: slotsKnown && expectedSlots > 0 ? coveredSlots / expectedSlots : null
|
|
191
213
|
};
|
|
192
214
|
}
|
|
193
215
|
/** The share of the filtered non-calm record blowing from inside the
|
|
@@ -205,4 +227,4 @@ function climatologyFavorableShare(document, arcs, filters) {
|
|
|
205
227
|
return blowing === 0 ? null : favorable / blowing;
|
|
206
228
|
}
|
|
207
229
|
//#endregion
|
|
208
|
-
export { accumulatedCells, climatologyCoverage, climatologyFavorableShare, climatologyPattern, climatologyRose, createClimatologyAccumulator, foldClimatologyPoints };
|
|
230
|
+
export { accumulatedCells, climatologyCoverage, climatologyFavorableShare, climatologyPattern, climatologyRose, coveredSlotCountByYear, createClimatologyAccumulator, foldClimatologyPoints };
|
|
@@ -31,6 +31,8 @@ declare const climatologyYearSchema: z.ZodObject<{
|
|
|
31
31
|
year: z.ZodNumber;
|
|
32
32
|
sampleCount: z.ZodNumber;
|
|
33
33
|
expectedCount: z.ZodNumber;
|
|
34
|
+
coveredSlotCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
35
|
+
expectedSlotCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
34
36
|
}, z.core.$strip>;
|
|
35
37
|
type ClimatologyYear = z.infer<typeof climatologyYearSchema>;
|
|
36
38
|
declare const stationClimatologySchema: z.ZodObject<{
|
|
@@ -45,6 +47,8 @@ declare const stationClimatologySchema: z.ZodObject<{
|
|
|
45
47
|
year: z.ZodNumber;
|
|
46
48
|
sampleCount: z.ZodNumber;
|
|
47
49
|
expectedCount: z.ZodNumber;
|
|
50
|
+
coveredSlotCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
51
|
+
expectedSlotCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
48
52
|
}, z.core.$strip>>;
|
|
49
53
|
cells: z.ZodArray<z.ZodObject<{
|
|
50
54
|
month: z.ZodNumber;
|
|
@@ -21,7 +21,9 @@ const climatologyCellSchema = z.object({
|
|
|
21
21
|
const climatologyYearSchema = z.object({
|
|
22
22
|
year: z.number().int(),
|
|
23
23
|
sampleCount: count,
|
|
24
|
-
expectedCount: count.describe("Records a gapless station would have produced over the requested window — the honesty denominator; a leading dropout lowers the ratio instead of hiding.")
|
|
24
|
+
expectedCount: count.describe("Records a gapless station would have produced over the requested window — the honesty denominator; a leading dropout lowers the ratio instead of hiding."),
|
|
25
|
+
coveredSlotCount: count.nullish().describe("Distinct (day, slot) buckets holding at least one record."),
|
|
26
|
+
expectedSlotCount: count.nullish().describe("Slots a gapless station would have covered over the window.")
|
|
25
27
|
}).meta({ id: "ClimatologyYear" });
|
|
26
28
|
const isoTime = z.string().refine((value) => Number.isFinite(Date.parse(value)), { message: "not an ISO timestamp" }).meta({ format: "date-time" });
|
|
27
29
|
const stationClimatologySchema = z.object({
|
|
@@ -180,22 +180,22 @@ function dailyPatternSceneDom(scene) {
|
|
|
180
180
|
}, vane.mark.text.text) : hs("path", {
|
|
181
181
|
class: vane.mark.className,
|
|
182
182
|
d: vane.mark.d
|
|
183
|
-
})), scene.vanes.
|
|
183
|
+
})), scene.vanes.flatMap((vane) => vane.label == null ? [] : [hs("text", {
|
|
184
184
|
class: vane.label.className,
|
|
185
185
|
"text-anchor": vane.label.anchor,
|
|
186
186
|
x: vane.label.x,
|
|
187
187
|
y: vane.label.y
|
|
188
|
-
}, vane.label.text)), hs("text", {
|
|
188
|
+
}, vane.label.text)]), hs("text", {
|
|
189
189
|
class: scene.rowLabels.avg.className,
|
|
190
190
|
"text-anchor": scene.rowLabels.avg.anchor,
|
|
191
191
|
x: scene.rowLabels.avg.x,
|
|
192
192
|
y: scene.rowLabels.avg.y
|
|
193
|
-
}, scene.rowLabels.avg.text), scene.vanes.
|
|
193
|
+
}, scene.rowLabels.avg.text), scene.vanes.flatMap((vane) => vane.value == null ? [] : [hs("text", {
|
|
194
194
|
class: vane.value.className,
|
|
195
195
|
"text-anchor": vane.value.anchor,
|
|
196
196
|
x: vane.value.x,
|
|
197
197
|
y: vane.value.y
|
|
198
|
-
}, vane.value.text)), scene.ticks.map((tick) => hs("text", {
|
|
198
|
+
}, vane.value.text)]), scene.ticks.map((tick) => hs("text", {
|
|
199
199
|
class: tick.className,
|
|
200
200
|
"text-anchor": tick.anchor,
|
|
201
201
|
x: tick.x,
|
|
@@ -214,22 +214,22 @@ var WindHistoryChartElement = class extends MeteoStationElement {
|
|
|
214
214
|
}, vane.mark.text.text) : hs("path", {
|
|
215
215
|
class: vane.mark.className,
|
|
216
216
|
d: vane.mark.d
|
|
217
|
-
})), scene.vanes.
|
|
217
|
+
})), scene.vanes.flatMap((vane) => vane.label == null ? [] : [hs("text", {
|
|
218
218
|
class: vane.label.className,
|
|
219
219
|
"text-anchor": vane.label.anchor,
|
|
220
220
|
x: vane.label.x,
|
|
221
221
|
y: vane.label.y
|
|
222
|
-
}, vane.label.text)), hs("text", {
|
|
222
|
+
}, vane.label.text)]), hs("text", {
|
|
223
223
|
class: scene.rowLabels.avg.className,
|
|
224
224
|
"text-anchor": scene.rowLabels.avg.anchor,
|
|
225
225
|
x: scene.rowLabels.avg.x,
|
|
226
226
|
y: scene.rowLabels.avg.y
|
|
227
|
-
}, scene.rowLabels.avg.text), scene.vanes.
|
|
227
|
+
}, scene.rowLabels.avg.text), scene.vanes.flatMap((vane) => vane.value == null ? [] : [hs("text", {
|
|
228
228
|
class: vane.value.className,
|
|
229
229
|
"text-anchor": vane.value.anchor,
|
|
230
230
|
x: vane.value.x,
|
|
231
231
|
y: vane.value.y
|
|
232
|
-
}, vane.value.text)), scene.ticks.map((tick) => hs("text", {
|
|
232
|
+
}, vane.value.text)]), scene.ticks.map((tick) => hs("text", {
|
|
233
233
|
class: tick.className,
|
|
234
234
|
"text-anchor": tick.anchor,
|
|
235
235
|
x: tick.x,
|
package/dist/geometry.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ type ChartTick = {
|
|
|
52
52
|
timeMs: number;
|
|
53
53
|
x: number;
|
|
54
54
|
};
|
|
55
|
-
declare function vaneTicks(vanes: ReadonlyArray<Vane>, scales: ChartScales): ChartTick[];
|
|
55
|
+
declare function vaneTicks(vanes: ReadonlyArray<Vane>, scales: ChartScales, labelCount?: number): ChartTick[];
|
|
56
56
|
declare function nearestIndex(points: ReadonlyArray<{
|
|
57
57
|
observedAt: string;
|
|
58
58
|
}>, chartX: number, frame: ChartFrame, scales: ChartScales): number | null;
|
package/dist/geometry.js
CHANGED
|
@@ -131,15 +131,10 @@ function vanePath(cx, cy, fromBearingDeg, { reach = 7, spread = 3.2 } = {}) {
|
|
|
131
131
|
const at = ([px, py]) => `${px.toFixed(1)} ${py.toFixed(1)}`;
|
|
132
132
|
return `M ${at(tail)} L ${at(tip)} M ${at(left)} L ${at(tip)} L ${at(right)}`;
|
|
133
133
|
}
|
|
134
|
-
function vaneTicks(vanes, scales) {
|
|
134
|
+
function vaneTicks(vanes, scales, labelCount = 5) {
|
|
135
135
|
if (vanes.length === 0) return [];
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
.25,
|
|
139
|
-
.5,
|
|
140
|
-
.75,
|
|
141
|
-
1
|
|
142
|
-
].map((fraction, index) => {
|
|
136
|
+
const count = Math.max(2, Math.min(5, Math.floor(labelCount)));
|
|
137
|
+
return Array.from({ length: count }, (_, index) => index / (count - 1)).map((fraction, index) => {
|
|
143
138
|
const vane = vanes[Math.round(fraction * (vanes.length - 1))];
|
|
144
139
|
return {
|
|
145
140
|
index,
|
package/dist/index.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ import { DIAL_CARDINALS, DIAL_CARDINAL_TICK_INNER, DIAL_CENTRE, DIAL_COUNTERWEIG
|
|
|
8
8
|
import { DisplayDefaults, DisplayProps, ResolvedDisplay, requireResolved, resolveDisplay, resolveStation } from "./display.js";
|
|
9
9
|
import { climatologyEndpoint, currentEndpoint, feedEndpoint, historyEndpoint, liveEndpoint } from "./endpoints.js";
|
|
10
10
|
import { CHART_FALLBACK_WIDTH, ChartFrame, ChartScaleOptions, ChartScales, ChartTick, DAILY_PATTERN_DEFAULT_SLOT_MINUTES, DailyPatternSlot, HistoryCoverage, METEOROLOGICAL_SEASON_MONTHS, RoseSector, TickAnchor, Vane, WindRoseSummary, averagePoints, bandPoints, chartFrame, chartScales, compareTracePoints, compareWindow, dailyPattern, favorableShare, filterByMonth, filterByTimeOfDay, historyCoverage, historyGaps, meanDirectionDeg, measuredChartWidth, nearestIndex, speedBand, thinVanes, tickAnchor, vanePath, vaneTicks, windRose, windowPoints } from "./geometry.js";
|
|
11
|
-
import { ClimatologyAccumulator, ClimatologyCoverage, ClimatologyFilters, ClimatologyFoldParams, accumulatedCells, climatologyCoverage, climatologyFavorableShare, climatologyPattern, climatologyRose, createClimatologyAccumulator, foldClimatologyPoints } from "./climatology.js";
|
|
11
|
+
import { ClimatologyAccumulator, ClimatologyCoverage, ClimatologyFilters, ClimatologyFoldParams, accumulatedCells, climatologyCoverage, climatologyFavorableShare, climatologyPattern, climatologyRose, coveredSlotCountByYear, createClimatologyAccumulator, foldClimatologyPoints } from "./climatology.js";
|
|
12
12
|
import { MergeResult, foldCurrent, mergeCurrent } from "./merge-current.js";
|
|
13
13
|
import { SAMPLE_GAP_TOLERANCE_FACTOR, SamplesSummary, sampleMeanDirectionDeg, samplePoints, sampleRuns, sampleScales, samplesSummary, thinSampleVanes } from "./samples.js";
|
|
14
14
|
import { AirRow, airRows, airSummary, lastStrikeWords } from "./air.js";
|
|
15
15
|
import { normalizeWindnerdStationKey, windnerdStationUrl } from "./windnerd.js";
|
|
16
|
-
export { type AirConditions, type AirRow, CALM_THRESHOLD_MPS, CHART_FALLBACK_WIDTH, COMPASS_POINTS, CONNECTIVITY_SERVICE_STATES, type ChartFrame, type ChartScaleOptions, type ChartScales, type ChartTick, type ClimatologyAccumulator, type ClimatologyCell, type ClimatologyCoverage, type ClimatologyFilters, type ClimatologyFoldParams, type ClimatologySector, type ClimatologyYear, type CompassPoint, type ConnectivityServiceState, type ConnectivitySession, DAILY_PATTERN_DEFAULT_SLOT_MINUTES, DIAL_CARDINALS, DIAL_CARDINAL_TICK_INNER, DIAL_CENTRE, DIAL_COUNTERWEIGHT_RADIUS, DIAL_COUNTERWEIGHT_REACH, DIAL_HUB_RADIUS, DIAL_LETTER_RADIUS, DIAL_MIN_MAX_MPS, DIAL_RING_RADIUS, DIAL_SIZE, DIAL_TICK_INNER, type DailyPatternSlot, type DirectionCellData, type DisplayDefaults, type DisplayProps, type FavorableDirection, type FormatTime, type FreshnessStatus, type FreshnessThresholds, type History, type HistoryCoverage, type HistoryPoint, type HistoryRun, type LiveSample, type LiveSamples, METEOROLOGICAL_SEASON_MONTHS, type MergeResult, type PeriodSummary, type PressureTendency, ROSE_CARDINAL_LETTERS, ROSE_CENTRE, ROSE_FAVORABLE_RING_RADIUS, ROSE_HUB_DOT_RADIUS, ROSE_HUB_RADIUS, ROSE_INTERCARDINAL_BEARINGS, ROSE_LETTER_RADIUS, ROSE_MAX_RADIUS, ROSE_PETAL_FILL, ROSE_SIZE, ROSE_TICK_REACH, type Reading, type RecentSummary, type ResolvedDisplay, type RoseSector, SAMPLE_GAP_TOLERANCE_FACTOR, SPARKLINE_EDGE_INSET, SPARKLINE_MAX_PADDING, STATION_CLIMATOLOGY_SCHEMA_VERSION, STATION_SCHEMA_VERSION, type SamplesSummary, type SpeedThresholds, type SpeedUnit, type Station, type StationCapabilities, type StationClimatology, type StationConnectivity, type StationCurrent, type StationFeed, type StationHistory, type StationLiveFrame, type StationMeta, type StationStringOverrides, type StationStrings, type StationTelemetry, type SummaryEntry, type TickAnchor, UNAVAILABLE_REASONS, type UnavailableReason, type Vane, type WindRoseSummary, accumulatedCells, airConditionsSchema, airRows, airSummary, averagePoints, bandPoints, bandStrips, capabilitiesSchema, chartFrame, chartScales, climatologyCellSchema, climatologyCoverage, climatologyEndpoint, climatologyFavorableShare, climatologyPattern, climatologyRose, climatologySectorSchema, climatologyYearSchema, compareTracePoints, compareWindow, compassDirection, connectivitySessionSchema, createClimatologyAccumulator, currentEndpoint, dailyPattern, declaredFavorableDirections, defaultFormatTime, defaultStrings, dialNeedlePoints, dialPolar, dialScaleMaxMps, dialSpeedArcPath, directionArcSchema, directionCell, emptyConditions, favorableShare, feedEndpoint, filterByMonth, filterByTimeOfDay, foldClimatologyPoints, foldCurrent, freshness, historyCoverage, historyEndpoint, historyGaps, meanDirectionDeg as historyMeanDirectionDeg, historyPointSchema, historyRuns, historySchema, isCalm, lastNightLowC, lastStrikeWords, liveEndpoint, liveSampleSchema, liveSamplesSchema, localeFormatTime, measuredChartWidth, mergeCurrent, mergeStringOverrides, nearestIndex, normalizeDegrees, normalizeWindnerdStationKey, optionalSpeed, parseStationClimatology, parseStationClimatologyJson, parseStationConnectivity, parseStationCurrent, parseStationCurrentJson, parseStationFeed, parseStationFeedJson, parseStationHistory, parseStationHistoryJson, parseStationLiveFrame, parseStationLiveFrameJson, periodSummary, pressureDeltaHpa, pressureTendency, readingSchema, recentSummarySchema, requireResolved, resolveDisplay, resolveStation, resolveStrings, roseBandPath, rosePetalPath, rosePolar, roseRingArcPath, roundSpeed, sampleMeanDirectionDeg, samplePoints, sampleRuns, sampleScales, samplesSummary, seaLevelPressureHpa, sparklineScale, speedBand, speedFromMps, speedToMps, speedUnitLabel, stationClimatologySchema, stationConnectivitySchema, stationCurrentSchema, stationFeedSchema, stationFreshnessThresholds, stationHistorySchema, stationLiveFrameSchema, stationMetaSchema, stationSchema, summaryEntries, telemetrySchema, temperatureText, temperatureValue, thinSampleVanes, thinVanes, thresholdsToMps, tickAnchor, unavailableStation, updatedAtText, vanePath, vaneTicks, windRose, windnerdStationUrl, windowPoints };
|
|
16
|
+
export { type AirConditions, type AirRow, CALM_THRESHOLD_MPS, CHART_FALLBACK_WIDTH, COMPASS_POINTS, CONNECTIVITY_SERVICE_STATES, type ChartFrame, type ChartScaleOptions, type ChartScales, type ChartTick, type ClimatologyAccumulator, type ClimatologyCell, type ClimatologyCoverage, type ClimatologyFilters, type ClimatologyFoldParams, type ClimatologySector, type ClimatologyYear, type CompassPoint, type ConnectivityServiceState, type ConnectivitySession, DAILY_PATTERN_DEFAULT_SLOT_MINUTES, DIAL_CARDINALS, DIAL_CARDINAL_TICK_INNER, DIAL_CENTRE, DIAL_COUNTERWEIGHT_RADIUS, DIAL_COUNTERWEIGHT_REACH, DIAL_HUB_RADIUS, DIAL_LETTER_RADIUS, DIAL_MIN_MAX_MPS, DIAL_RING_RADIUS, DIAL_SIZE, DIAL_TICK_INNER, type DailyPatternSlot, type DirectionCellData, type DisplayDefaults, type DisplayProps, type FavorableDirection, type FormatTime, type FreshnessStatus, type FreshnessThresholds, type History, type HistoryCoverage, type HistoryPoint, type HistoryRun, type LiveSample, type LiveSamples, METEOROLOGICAL_SEASON_MONTHS, type MergeResult, type PeriodSummary, type PressureTendency, ROSE_CARDINAL_LETTERS, ROSE_CENTRE, ROSE_FAVORABLE_RING_RADIUS, ROSE_HUB_DOT_RADIUS, ROSE_HUB_RADIUS, ROSE_INTERCARDINAL_BEARINGS, ROSE_LETTER_RADIUS, ROSE_MAX_RADIUS, ROSE_PETAL_FILL, ROSE_SIZE, ROSE_TICK_REACH, type Reading, type RecentSummary, type ResolvedDisplay, type RoseSector, SAMPLE_GAP_TOLERANCE_FACTOR, SPARKLINE_EDGE_INSET, SPARKLINE_MAX_PADDING, STATION_CLIMATOLOGY_SCHEMA_VERSION, STATION_SCHEMA_VERSION, type SamplesSummary, type SpeedThresholds, type SpeedUnit, type Station, type StationCapabilities, type StationClimatology, type StationConnectivity, type StationCurrent, type StationFeed, type StationHistory, type StationLiveFrame, type StationMeta, type StationStringOverrides, type StationStrings, type StationTelemetry, type SummaryEntry, type TickAnchor, UNAVAILABLE_REASONS, type UnavailableReason, type Vane, type WindRoseSummary, accumulatedCells, airConditionsSchema, airRows, airSummary, averagePoints, bandPoints, bandStrips, capabilitiesSchema, chartFrame, chartScales, climatologyCellSchema, climatologyCoverage, climatologyEndpoint, climatologyFavorableShare, climatologyPattern, climatologyRose, climatologySectorSchema, climatologyYearSchema, compareTracePoints, compareWindow, compassDirection, connectivitySessionSchema, coveredSlotCountByYear, createClimatologyAccumulator, currentEndpoint, dailyPattern, declaredFavorableDirections, defaultFormatTime, defaultStrings, dialNeedlePoints, dialPolar, dialScaleMaxMps, dialSpeedArcPath, directionArcSchema, directionCell, emptyConditions, favorableShare, feedEndpoint, filterByMonth, filterByTimeOfDay, foldClimatologyPoints, foldCurrent, freshness, historyCoverage, historyEndpoint, historyGaps, meanDirectionDeg as historyMeanDirectionDeg, historyPointSchema, historyRuns, historySchema, isCalm, lastNightLowC, lastStrikeWords, liveEndpoint, liveSampleSchema, liveSamplesSchema, localeFormatTime, measuredChartWidth, mergeCurrent, mergeStringOverrides, nearestIndex, normalizeDegrees, normalizeWindnerdStationKey, optionalSpeed, parseStationClimatology, parseStationClimatologyJson, parseStationConnectivity, parseStationCurrent, parseStationCurrentJson, parseStationFeed, parseStationFeedJson, parseStationHistory, parseStationHistoryJson, parseStationLiveFrame, parseStationLiveFrameJson, periodSummary, pressureDeltaHpa, pressureTendency, readingSchema, recentSummarySchema, requireResolved, resolveDisplay, resolveStation, resolveStrings, roseBandPath, rosePetalPath, rosePolar, roseRingArcPath, roundSpeed, sampleMeanDirectionDeg, samplePoints, sampleRuns, sampleScales, samplesSummary, seaLevelPressureHpa, sparklineScale, speedBand, speedFromMps, speedToMps, speedUnitLabel, stationClimatologySchema, stationConnectivitySchema, stationCurrentSchema, stationFeedSchema, stationFreshnessThresholds, stationHistorySchema, stationLiveFrameSchema, stationMetaSchema, stationSchema, summaryEntries, telemetrySchema, temperatureText, temperatureValue, thinSampleVanes, thinVanes, thresholdsToMps, tickAnchor, unavailableStation, updatedAtText, vanePath, vaneTicks, windRose, windnerdStationUrl, windowPoints };
|
package/dist/index.js
CHANGED
|
@@ -6,11 +6,11 @@ import { requireResolved, resolveDisplay, resolveStation } from "./display.js";
|
|
|
6
6
|
import { climatologyEndpoint, currentEndpoint, feedEndpoint, historyEndpoint, liveEndpoint } from "./endpoints.js";
|
|
7
7
|
import { STATION_CLIMATOLOGY_SCHEMA_VERSION, climatologyCellSchema, climatologySectorSchema, climatologyYearSchema, parseStationClimatology, parseStationClimatologyJson, stationClimatologySchema } from "./contract-climatology.js";
|
|
8
8
|
import { CHART_FALLBACK_WIDTH, DAILY_PATTERN_DEFAULT_SLOT_MINUTES, METEOROLOGICAL_SEASON_MONTHS, averagePoints, bandPoints, chartFrame, chartScales, compareTracePoints, compareWindow, dailyPattern, favorableShare, filterByMonth, filterByTimeOfDay, historyCoverage, historyGaps, meanDirectionDeg, measuredChartWidth, nearestIndex, speedBand, thinVanes, tickAnchor, vanePath, vaneTicks, windRose, windowPoints } from "./geometry.js";
|
|
9
|
-
import { accumulatedCells, climatologyCoverage, climatologyFavorableShare, climatologyPattern, climatologyRose, createClimatologyAccumulator, foldClimatologyPoints } from "./climatology.js";
|
|
9
|
+
import { accumulatedCells, climatologyCoverage, climatologyFavorableShare, climatologyPattern, climatologyRose, coveredSlotCountByYear, createClimatologyAccumulator, foldClimatologyPoints } from "./climatology.js";
|
|
10
10
|
import { directionCell, optionalSpeed, roundSpeed, summaryEntries, temperatureText, temperatureValue, updatedAtText } from "./format.js";
|
|
11
11
|
import { DIAL_CARDINALS, DIAL_CARDINAL_TICK_INNER, DIAL_CENTRE, DIAL_COUNTERWEIGHT_RADIUS, DIAL_COUNTERWEIGHT_REACH, DIAL_HUB_RADIUS, DIAL_LETTER_RADIUS, DIAL_MIN_MAX_MPS, DIAL_RING_RADIUS, DIAL_SIZE, DIAL_TICK_INNER, ROSE_CARDINAL_LETTERS, ROSE_CENTRE, ROSE_FAVORABLE_RING_RADIUS, ROSE_HUB_DOT_RADIUS, ROSE_HUB_RADIUS, ROSE_INTERCARDINAL_BEARINGS, ROSE_LETTER_RADIUS, ROSE_MAX_RADIUS, ROSE_PETAL_FILL, ROSE_SIZE, ROSE_TICK_REACH, SPARKLINE_EDGE_INSET, SPARKLINE_MAX_PADDING, bandStrips, dialNeedlePoints, dialPolar, dialScaleMaxMps, dialSpeedArcPath, historyRuns, roseBandPath, rosePetalPath, rosePolar, roseRingArcPath, sparklineScale } from "./instruments.js";
|
|
12
12
|
import { foldCurrent, mergeCurrent } from "./merge-current.js";
|
|
13
13
|
import { SAMPLE_GAP_TOLERANCE_FACTOR, sampleMeanDirectionDeg, samplePoints, sampleRuns, sampleScales, samplesSummary, thinSampleVanes } from "./samples.js";
|
|
14
14
|
import { airRows, airSummary, lastStrikeWords } from "./air.js";
|
|
15
15
|
import { normalizeWindnerdStationKey, windnerdStationUrl } from "./windnerd.js";
|
|
16
|
-
export { CALM_THRESHOLD_MPS, CHART_FALLBACK_WIDTH, COMPASS_POINTS, CONNECTIVITY_SERVICE_STATES, DAILY_PATTERN_DEFAULT_SLOT_MINUTES, DIAL_CARDINALS, DIAL_CARDINAL_TICK_INNER, DIAL_CENTRE, DIAL_COUNTERWEIGHT_RADIUS, DIAL_COUNTERWEIGHT_REACH, DIAL_HUB_RADIUS, DIAL_LETTER_RADIUS, DIAL_MIN_MAX_MPS, DIAL_RING_RADIUS, DIAL_SIZE, DIAL_TICK_INNER, METEOROLOGICAL_SEASON_MONTHS, ROSE_CARDINAL_LETTERS, ROSE_CENTRE, ROSE_FAVORABLE_RING_RADIUS, ROSE_HUB_DOT_RADIUS, ROSE_HUB_RADIUS, ROSE_INTERCARDINAL_BEARINGS, ROSE_LETTER_RADIUS, ROSE_MAX_RADIUS, ROSE_PETAL_FILL, ROSE_SIZE, ROSE_TICK_REACH, SAMPLE_GAP_TOLERANCE_FACTOR, SPARKLINE_EDGE_INSET, SPARKLINE_MAX_PADDING, STATION_CLIMATOLOGY_SCHEMA_VERSION, STATION_SCHEMA_VERSION, UNAVAILABLE_REASONS, accumulatedCells, airConditionsSchema, airRows, airSummary, averagePoints, bandPoints, bandStrips, capabilitiesSchema, chartFrame, chartScales, climatologyCellSchema, climatologyCoverage, climatologyEndpoint, climatologyFavorableShare, climatologyPattern, climatologyRose, climatologySectorSchema, climatologyYearSchema, compareTracePoints, compareWindow, compassDirection, connectivitySessionSchema, createClimatologyAccumulator, currentEndpoint, dailyPattern, declaredFavorableDirections, defaultFormatTime, defaultStrings, dialNeedlePoints, dialPolar, dialScaleMaxMps, dialSpeedArcPath, directionArcSchema, directionCell, emptyConditions, favorableShare, feedEndpoint, filterByMonth, filterByTimeOfDay, foldClimatologyPoints, foldCurrent, freshness, historyCoverage, historyEndpoint, historyGaps, meanDirectionDeg as historyMeanDirectionDeg, historyPointSchema, historyRuns, historySchema, isCalm, lastNightLowC, lastStrikeWords, liveEndpoint, liveSampleSchema, liveSamplesSchema, localeFormatTime, measuredChartWidth, mergeCurrent, mergeStringOverrides, nearestIndex, normalizeDegrees, normalizeWindnerdStationKey, optionalSpeed, parseStationClimatology, parseStationClimatologyJson, parseStationConnectivity, parseStationCurrent, parseStationCurrentJson, parseStationFeed, parseStationFeedJson, parseStationHistory, parseStationHistoryJson, parseStationLiveFrame, parseStationLiveFrameJson, periodSummary, pressureDeltaHpa, pressureTendency, readingSchema, recentSummarySchema, requireResolved, resolveDisplay, resolveStation, resolveStrings, roseBandPath, rosePetalPath, rosePolar, roseRingArcPath, roundSpeed, sampleMeanDirectionDeg, samplePoints, sampleRuns, sampleScales, samplesSummary, seaLevelPressureHpa, sparklineScale, speedBand, speedFromMps, speedToMps, speedUnitLabel, stationClimatologySchema, stationConnectivitySchema, stationCurrentSchema, stationFeedSchema, stationFreshnessThresholds, stationHistorySchema, stationLiveFrameSchema, stationMetaSchema, stationSchema, summaryEntries, telemetrySchema, temperatureText, temperatureValue, thinSampleVanes, thinVanes, thresholdsToMps, tickAnchor, unavailableStation, updatedAtText, vanePath, vaneTicks, windRose, windnerdStationUrl, windowPoints };
|
|
16
|
+
export { CALM_THRESHOLD_MPS, CHART_FALLBACK_WIDTH, COMPASS_POINTS, CONNECTIVITY_SERVICE_STATES, DAILY_PATTERN_DEFAULT_SLOT_MINUTES, DIAL_CARDINALS, DIAL_CARDINAL_TICK_INNER, DIAL_CENTRE, DIAL_COUNTERWEIGHT_RADIUS, DIAL_COUNTERWEIGHT_REACH, DIAL_HUB_RADIUS, DIAL_LETTER_RADIUS, DIAL_MIN_MAX_MPS, DIAL_RING_RADIUS, DIAL_SIZE, DIAL_TICK_INNER, METEOROLOGICAL_SEASON_MONTHS, ROSE_CARDINAL_LETTERS, ROSE_CENTRE, ROSE_FAVORABLE_RING_RADIUS, ROSE_HUB_DOT_RADIUS, ROSE_HUB_RADIUS, ROSE_INTERCARDINAL_BEARINGS, ROSE_LETTER_RADIUS, ROSE_MAX_RADIUS, ROSE_PETAL_FILL, ROSE_SIZE, ROSE_TICK_REACH, SAMPLE_GAP_TOLERANCE_FACTOR, SPARKLINE_EDGE_INSET, SPARKLINE_MAX_PADDING, STATION_CLIMATOLOGY_SCHEMA_VERSION, STATION_SCHEMA_VERSION, UNAVAILABLE_REASONS, accumulatedCells, airConditionsSchema, airRows, airSummary, averagePoints, bandPoints, bandStrips, capabilitiesSchema, chartFrame, chartScales, climatologyCellSchema, climatologyCoverage, climatologyEndpoint, climatologyFavorableShare, climatologyPattern, climatologyRose, climatologySectorSchema, climatologyYearSchema, compareTracePoints, compareWindow, compassDirection, connectivitySessionSchema, coveredSlotCountByYear, createClimatologyAccumulator, currentEndpoint, dailyPattern, declaredFavorableDirections, defaultFormatTime, defaultStrings, dialNeedlePoints, dialPolar, dialScaleMaxMps, dialSpeedArcPath, directionArcSchema, directionCell, emptyConditions, favorableShare, feedEndpoint, filterByMonth, filterByTimeOfDay, foldClimatologyPoints, foldCurrent, freshness, historyCoverage, historyEndpoint, historyGaps, meanDirectionDeg as historyMeanDirectionDeg, historyPointSchema, historyRuns, historySchema, isCalm, lastNightLowC, lastStrikeWords, liveEndpoint, liveSampleSchema, liveSamplesSchema, localeFormatTime, measuredChartWidth, mergeCurrent, mergeStringOverrides, nearestIndex, normalizeDegrees, normalizeWindnerdStationKey, optionalSpeed, parseStationClimatology, parseStationClimatologyJson, parseStationConnectivity, parseStationCurrent, parseStationCurrentJson, parseStationFeed, parseStationFeedJson, parseStationHistory, parseStationHistoryJson, parseStationLiveFrame, parseStationLiveFrameJson, periodSummary, pressureDeltaHpa, pressureTendency, readingSchema, recentSummarySchema, requireResolved, resolveDisplay, resolveStation, resolveStrings, roseBandPath, rosePetalPath, rosePolar, roseRingArcPath, roundSpeed, sampleMeanDirectionDeg, samplePoints, sampleRuns, sampleScales, samplesSummary, seaLevelPressureHpa, sparklineScale, speedBand, speedFromMps, speedToMps, speedUnitLabel, stationClimatologySchema, stationConnectivitySchema, stationCurrentSchema, stationFeedSchema, stationFreshnessThresholds, stationHistorySchema, stationLiveFrameSchema, stationMetaSchema, stationSchema, summaryEntries, telemetrySchema, temperatureText, temperatureValue, thinSampleVanes, thinVanes, thresholdsToMps, tickAnchor, unavailableStation, updatedAtText, vanePath, vaneTicks, windRose, windnerdStationUrl, windowPoints };
|
|
@@ -183,7 +183,7 @@ function DailyPatternSceneView({ scene }) {
|
|
|
183
183
|
className: vane.mark.className,
|
|
184
184
|
d: vane.mark.d
|
|
185
185
|
}, vane.key)),
|
|
186
|
-
scene.vanes.map((vane) => /* @__PURE__ */ jsx("text", {
|
|
186
|
+
scene.vanes.map((vane) => vane.label && /* @__PURE__ */ jsx("text", {
|
|
187
187
|
className: vane.label.className,
|
|
188
188
|
textAnchor: vane.label.anchor,
|
|
189
189
|
x: vane.label.x,
|
|
@@ -197,7 +197,7 @@ function DailyPatternSceneView({ scene }) {
|
|
|
197
197
|
y: scene.rowLabels.avg.y,
|
|
198
198
|
children: scene.rowLabels.avg.text
|
|
199
199
|
}),
|
|
200
|
-
scene.vanes.map((vane) => /* @__PURE__ */ jsx("text", {
|
|
200
|
+
scene.vanes.map((vane) => vane.value && /* @__PURE__ */ jsx("text", {
|
|
201
201
|
className: vane.value.className,
|
|
202
202
|
textAnchor: vane.value.anchor,
|
|
203
203
|
x: vane.value.x,
|
|
@@ -5,8 +5,7 @@ import { FavorableDirection } from "../../instruments.js";
|
|
|
5
5
|
import "../../index.js";
|
|
6
6
|
//#region src/react/components/RecentSummaries.d.ts
|
|
7
7
|
/** The source's own step digests as summary panels: per window, the
|
|
8
|
-
* average, gust, and lull beside one small arrow per step
|
|
9
|
-
* recent story at a glance. */
|
|
8
|
+
* average, gust, and lull beside one small arrow per step. */
|
|
10
9
|
declare function RecentSummaries({ summaries, station: stationProp, stationId, favorableDirections: favorableDirectionsProp, unit: unitProp, strings: stringsProp }: {
|
|
11
10
|
summaries?: RecentSummary[] | null;
|
|
12
11
|
station?: Station;
|
|
@@ -6,8 +6,7 @@ import { WindArrow } from "./WindArrow.js";
|
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region src/react/components/RecentSummaries.tsx
|
|
8
8
|
/** The source's own step digests as summary panels: per window, the
|
|
9
|
-
* average, gust, and lull beside one small arrow per step
|
|
10
|
-
* recent story at a glance. */
|
|
9
|
+
* average, gust, and lull beside one small arrow per step. */
|
|
11
10
|
function RecentSummaries({ summaries, station: stationProp, stationId, favorableDirections: favorableDirectionsProp, unit: unitProp, strings: stringsProp }) {
|
|
12
11
|
const context = useStationFeedContext();
|
|
13
12
|
const station = stationProp ?? (summaries == null ? resolveStation(context, stationId) ?? void 0 : void 0);
|
|
@@ -221,7 +221,7 @@ function MeasuredChart({ compareOffsetDays, favorableDirections, formatTime, his
|
|
|
221
221
|
className: vane.mark.className,
|
|
222
222
|
d: vane.mark.d
|
|
223
223
|
}, vane.key)),
|
|
224
|
-
scene.vanes.map((vane) => /* @__PURE__ */ jsx("text", {
|
|
224
|
+
scene.vanes.map((vane) => vane.label && /* @__PURE__ */ jsx("text", {
|
|
225
225
|
className: vane.label.className,
|
|
226
226
|
textAnchor: vane.label.anchor,
|
|
227
227
|
x: vane.label.x,
|
|
@@ -235,7 +235,7 @@ function MeasuredChart({ compareOffsetDays, favorableDirections, formatTime, his
|
|
|
235
235
|
y: scene.rowLabels.avg.y,
|
|
236
236
|
children: scene.rowLabels.avg.text
|
|
237
237
|
}),
|
|
238
|
-
scene.vanes.map((vane) => /* @__PURE__ */ jsx("text", {
|
|
238
|
+
scene.vanes.map((vane) => vane.value && /* @__PURE__ */ jsx("text", {
|
|
239
239
|
className: vane.value.className,
|
|
240
240
|
textAnchor: vane.value.anchor,
|
|
241
241
|
x: vane.value.x,
|
|
@@ -137,7 +137,7 @@ function MeasuredStrip({ favorableDirections, formatTime, plotHeight, samples, s
|
|
|
137
137
|
className: vane.mark.className,
|
|
138
138
|
d: vane.mark.d
|
|
139
139
|
}, vane.key)),
|
|
140
|
-
scene.vanes.map((vane) => /* @__PURE__ */ jsx("text", {
|
|
140
|
+
scene.vanes.map((vane) => vane.label && /* @__PURE__ */ jsx("text", {
|
|
141
141
|
className: vane.label.className,
|
|
142
142
|
textAnchor: vane.label.anchor,
|
|
143
143
|
x: vane.label.x,
|
|
@@ -151,7 +151,7 @@ function MeasuredStrip({ favorableDirections, formatTime, plotHeight, samples, s
|
|
|
151
151
|
y: scene.rowLabels.avg.y,
|
|
152
152
|
children: scene.rowLabels.avg.text
|
|
153
153
|
}),
|
|
154
|
-
scene.vanes.map((vane) => /* @__PURE__ */ jsx("text", {
|
|
154
|
+
scene.vanes.map((vane) => vane.value && /* @__PURE__ */ jsx("text", {
|
|
155
155
|
className: vane.value.className,
|
|
156
156
|
textAnchor: vane.value.anchor,
|
|
157
157
|
x: vane.value.x,
|
|
@@ -27,7 +27,7 @@ function climatologyPatternScene(input) {
|
|
|
27
27
|
slots,
|
|
28
28
|
coverage: {
|
|
29
29
|
totalSamples,
|
|
30
|
-
|
|
30
|
+
percent: coverage != null && coverage.ratio != null ? Math.round(coverage.ratio * 100) : null
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -37,7 +37,7 @@ function climatologyRoseScene(input) {
|
|
|
37
37
|
captions.push({
|
|
38
38
|
key: "samples",
|
|
39
39
|
className: "meteo-climatology-caption",
|
|
40
|
-
text: coverage != null && coverage.
|
|
40
|
+
text: coverage != null && coverage.ratio != null ? words.dailyPatternCoverage(summary.sampleCount, Math.round(coverage.ratio * 100)) : words.dailyPatternSamples(summary.sampleCount)
|
|
41
41
|
});
|
|
42
42
|
return {
|
|
43
43
|
className: CLIMATOLOGY_ROSE_CLASS,
|
|
@@ -47,7 +47,7 @@ function dailyPatternScene(input) {
|
|
|
47
47
|
slots,
|
|
48
48
|
coverage: {
|
|
49
49
|
totalSamples,
|
|
50
|
-
expectedSamples
|
|
50
|
+
percent: expectedSamples != null && expectedSamples > 0 ? Math.round(totalSamples / expectedSamples * 100) : null
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
}
|
|
@@ -57,7 +57,7 @@ function dailyPatternSlotsScene(input) {
|
|
|
57
57
|
const { coverage, hatchId, plotHeight, slotMinutes, slots, stationName, thresholds, unit, width, words } = input;
|
|
58
58
|
const shown = (speedMps) => roundSpeed(speedMps, unit);
|
|
59
59
|
const synthetic = slots.map((slot) => slotPoint(slot, slotMinutes));
|
|
60
|
-
const { totalSamples,
|
|
60
|
+
const { totalSamples, percent } = coverage;
|
|
61
61
|
const frame = stretchedChartFrame(width, plotHeight);
|
|
62
62
|
const scales = displaySpeedScales(synthetic, frame, unit);
|
|
63
63
|
const vanes = thinVanes(synthetic);
|
|
@@ -69,7 +69,7 @@ function dailyPatternSlotsScene(input) {
|
|
|
69
69
|
scales,
|
|
70
70
|
caption: {
|
|
71
71
|
className: "meteo-daily-pattern-caption",
|
|
72
|
-
text:
|
|
72
|
+
text: percent != null ? words.dailyPatternCoverage(totalSamples, percent) : words.dailyPatternSamples(totalSamples)
|
|
73
73
|
},
|
|
74
74
|
svg: {
|
|
75
75
|
ariaLabel: stationName ? words.aria.dailyPattern(stationName) : words.aria.dailyPatternGeneric,
|
package/dist/scene/trend.js
CHANGED
|
@@ -77,13 +77,8 @@ function trendScene(input) {
|
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
});
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
.25,
|
|
83
|
-
.5,
|
|
84
|
-
.75,
|
|
85
|
-
1
|
|
86
|
-
].map((fraction, index) => {
|
|
80
|
+
const tickCount = Math.max(2, Math.min(5, Math.floor((frame.right - frame.left) / 76)));
|
|
81
|
+
const ticks = Array.from({ length: tickCount }, (_, at) => at / (tickCount - 1)).map((fraction, index) => {
|
|
87
82
|
const timeMs = scales.startMs + fraction * scales.durationMs;
|
|
88
83
|
return {
|
|
89
84
|
key: index,
|
package/dist/scene/wind-plot.js
CHANGED
|
@@ -191,9 +191,17 @@ function nightRects(points, frame, scales, night) {
|
|
|
191
191
|
}
|
|
192
192
|
return rects;
|
|
193
193
|
}
|
|
194
|
+
const COMPASS_LABEL_PX = 30;
|
|
195
|
+
const VALUE_LABEL_PX = 24;
|
|
196
|
+
const TIME_LABEL_PX = 76;
|
|
194
197
|
function vaneCells(vanes, frame, scales, valueText, favorableDirections) {
|
|
195
198
|
const verdict = (directionDeg) => favorableDirections == null || favorableDirections.length === 0 ? "" : inDirectionArcs(directionDeg, favorableDirections) ? " meteo-wind-vane-favorable" : " meteo-wind-vane-unfavorable";
|
|
196
|
-
|
|
199
|
+
const pitch = vanes.length === 0 ? Infinity : (frame.right - frame.left) / vanes.length;
|
|
200
|
+
const step = (needPx) => Math.max(1, Math.ceil(needPx / pitch));
|
|
201
|
+
const labelStep = step(COMPASS_LABEL_PX);
|
|
202
|
+
const valueStep = step(VALUE_LABEL_PX);
|
|
203
|
+
const speaks = (index, every) => (vanes.length - 1 - index) % every === 0;
|
|
204
|
+
return vanes.map((vane, index) => ({
|
|
197
205
|
key: vane.midMs,
|
|
198
206
|
mark: vane.windDirectionDeg == null ? {
|
|
199
207
|
kind: "calm",
|
|
@@ -209,24 +217,24 @@ function vaneCells(vanes, frame, scales, valueText, favorableDirections) {
|
|
|
209
217
|
className: `meteo-wind-vane${verdict(vane.windDirectionDeg)}`,
|
|
210
218
|
d: vanePath(scales.xAtMs(vane.midMs), frame.vaneRow, vane.windDirectionDeg)
|
|
211
219
|
},
|
|
212
|
-
label: {
|
|
220
|
+
label: speaks(index, labelStep) ? {
|
|
213
221
|
className: "meteo-wind-vane-label",
|
|
214
222
|
anchor: "middle",
|
|
215
223
|
x: scales.xAtMs(vane.midMs),
|
|
216
224
|
y: frame.vaneLabelRow + 4,
|
|
217
225
|
text: vane.windDirectionDeg == null ? "—" : compassDirection(vane.windDirectionDeg)
|
|
218
|
-
},
|
|
219
|
-
value: {
|
|
226
|
+
} : null,
|
|
227
|
+
value: speaks(index, valueStep) ? {
|
|
220
228
|
className: "meteo-wind-vane-value",
|
|
221
229
|
anchor: "middle",
|
|
222
230
|
x: scales.xAtMs(vane.midMs),
|
|
223
231
|
y: frame.valueRow + 4,
|
|
224
232
|
text: valueText(vane)
|
|
225
|
-
}
|
|
233
|
+
} : null
|
|
226
234
|
}));
|
|
227
235
|
}
|
|
228
236
|
function vaneTickTexts(vanes, frame, scales, labelText) {
|
|
229
|
-
const ticks = vaneTicks(vanes, scales);
|
|
237
|
+
const ticks = vaneTicks(vanes, scales, Math.floor((frame.right - frame.left) / TIME_LABEL_PX));
|
|
230
238
|
return ticks.map(({ index, timeMs, x }) => ({
|
|
231
239
|
key: index,
|
|
232
240
|
className: "meteo-tick",
|
|
@@ -20,14 +20,11 @@ type WindnerdClimatologyOptions = {
|
|
|
20
20
|
recordsUrl?: string;
|
|
21
21
|
liveUrl?: string;
|
|
22
22
|
};
|
|
23
|
-
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* whole document — a silently missing year would read as an outage, and
|
|
29
|
-
* plausible-but-wrong is the named failure mode.
|
|
30
|
-
*/
|
|
23
|
+
/** Builds the climatology cube from the vendor's yearly archive: one
|
|
24
|
+
* records request per calendar year (closed years cached ~30 days, the
|
|
25
|
+
* running year 6 hours), folded into (month, slot, sector) sums in the
|
|
26
|
+
* station's STANDARD time. Any refused year fails the whole document —
|
|
27
|
+
* a silently missing year would read as an outage. */
|
|
31
28
|
declare function loadWindnerdClimatology(config: WindnerdStationConfig, options: WindnerdClimatologyOptions): Promise<StationClimatology>;
|
|
32
29
|
//#endregion
|
|
33
30
|
export { CLIMATOLOGY_DEFAULT_SECTOR_COUNT, CLIMATOLOGY_DEFAULT_YEARS, CLIMATOLOGY_RECORD_PERIOD_MINUTES, WindnerdClimatologyOptions, loadWindnerdClimatology };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { thresholdsToMps } from "../../derive.js";
|
|
2
2
|
import "../../contract-climatology.js";
|
|
3
|
-
import { accumulatedCells, createClimatologyAccumulator, foldClimatologyPoints } from "../../climatology.js";
|
|
3
|
+
import { accumulatedCells, coveredSlotCountByYear, createClimatologyAccumulator, foldClimatologyPoints } from "../../climatology.js";
|
|
4
4
|
import { fetchUpstreamText, logUpstreamFailure, resolveEnvironment } from "../environment.js";
|
|
5
5
|
import { loadWindnerdLocation, parseWindnerdRecords, windnerdHistoryPoints } from "./windnerd.js";
|
|
6
6
|
//#region src/server/adapters/windnerd-climatology.ts
|
|
@@ -9,14 +9,11 @@ const CLIMATOLOGY_DEFAULT_YEARS = 8;
|
|
|
9
9
|
const CLIMATOLOGY_DEFAULT_SECTOR_COUNT = 16;
|
|
10
10
|
const CLOSED_YEAR_CACHE_TTL_SECONDS = 2592e3;
|
|
11
11
|
const CURRENT_YEAR_CACHE_TTL_SECONDS = 21600;
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* whole document — a silently missing year would read as an outage, and
|
|
18
|
-
* plausible-but-wrong is the named failure mode.
|
|
19
|
-
*/
|
|
12
|
+
/** Builds the climatology cube from the vendor's yearly archive: one
|
|
13
|
+
* records request per calendar year (closed years cached ~30 days, the
|
|
14
|
+
* running year 6 hours), folded into (month, slot, sector) sums in the
|
|
15
|
+
* station's STANDARD time. Any refused year fails the whole document —
|
|
16
|
+
* a silently missing year would read as an outage. */
|
|
20
17
|
async function loadWindnerdClimatology(config, options) {
|
|
21
18
|
const environment = resolveEnvironment(options.environment);
|
|
22
19
|
const yearsBack = options.years ?? 8;
|
|
@@ -53,9 +50,13 @@ async function loadWindnerdClimatology(config, options) {
|
|
|
53
50
|
years.push({
|
|
54
51
|
year,
|
|
55
52
|
sampleCount: points.length,
|
|
56
|
-
expectedCount: Math.floor((to - from) / (180 * 6e4))
|
|
53
|
+
expectedCount: Math.floor((to - from) / (180 * 6e4)),
|
|
54
|
+
coveredSlotCount: 0,
|
|
55
|
+
expectedSlotCount: Math.floor((to - from) / (slotMinutes * 6e4))
|
|
57
56
|
});
|
|
58
57
|
}
|
|
58
|
+
const coveredByYear = coveredSlotCountByYear(accumulator);
|
|
59
|
+
for (const ledger of years) ledger.coveredSlotCount = coveredByYear.get(ledger.year) ?? 0;
|
|
59
60
|
while (years.length > 1 && years[0]?.sampleCount === 0) years.shift();
|
|
60
61
|
return {
|
|
61
62
|
schemaVersion: 1,
|
|
@@ -8,14 +8,11 @@ type WindnerdLiveOptions = {
|
|
|
8
8
|
liveUrl?: string;
|
|
9
9
|
idleTimeoutMs?: number;
|
|
10
10
|
};
|
|
11
|
-
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* One call is one upstream connection: reconnect and fan-out belong to the
|
|
17
|
-
* caller, and a reconnect's fresh init frame is the resume story.
|
|
18
|
-
*/
|
|
11
|
+
/** Opens the station's live stream: one init frame, then
|
|
12
|
+
* samples/reading/ping as served. The connect phase (headers plus the
|
|
13
|
+
* upstream init frame) rejects on failure; after that, failures degrade
|
|
14
|
+
* to a terminal unavailable frame. One call is one upstream connection;
|
|
15
|
+
* reconnect and fan-out belong to the caller. */
|
|
19
16
|
declare function openWindnerdLive(config: WindnerdStationConfig, options?: WindnerdLiveOptions): Promise<ReadableStream<StationLiveFrame>>;
|
|
20
17
|
//#endregion
|
|
21
18
|
export { WindnerdLiveOptions, openWindnerdLive };
|
|
@@ -4,14 +4,11 @@ import { UpstreamError, fetchUpstreamStream, logUpstreamFailure, resolveEnvironm
|
|
|
4
4
|
import { WINDNERD_LIVE_INIT_TIMEOUT_MS, parseWindnerdLiveDigest, parseWindnerdLiveInit, parseWindnerdLiveSampleRecords, parseWindnerdRecentSummaries, windnerdEnrichedMeta, windnerdLiveReading, windnerdLiveSamples, windnerdLiveStreamUrl, windnerdStationMeta } from "./windnerd.js";
|
|
5
5
|
//#region src/server/adapters/windnerd-live.ts
|
|
6
6
|
const LIVE_IDLE_TIMEOUT_MS = 75e3;
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* One call is one upstream connection: reconnect and fan-out belong to the
|
|
13
|
-
* caller, and a reconnect's fresh init frame is the resume story.
|
|
14
|
-
*/
|
|
7
|
+
/** Opens the station's live stream: one init frame, then
|
|
8
|
+
* samples/reading/ping as served. The connect phase (headers plus the
|
|
9
|
+
* upstream init frame) rejects on failure; after that, failures degrade
|
|
10
|
+
* to a terminal unavailable frame. One call is one upstream connection;
|
|
11
|
+
* reconnect and fan-out belong to the caller. */
|
|
15
12
|
async function openWindnerdLive(config, options = {}) {
|
|
16
13
|
const environment = resolveEnvironment(options.environment);
|
|
17
14
|
const subject = `WindNerd location ${config.locationId} live stream`;
|
|
@@ -366,9 +366,8 @@ async function cacheWindnerdLocation(config, environment, init) {
|
|
|
366
366
|
};
|
|
367
367
|
await environment.cache.put(`windnerd/location/${config.locationId}`, JSON.stringify(cached), LOCATION_CACHE_TTL_SECONDS);
|
|
368
368
|
}
|
|
369
|
-
/**
|
|
370
|
-
* live
|
|
371
|
-
* dark live road; callers decide whether that degrades or fails. */
|
|
369
|
+
/** Cached location block (6-hour TTL). Throws on a cold cache when the
|
|
370
|
+
* live stream is unreachable; callers choose degrade or fail. */
|
|
372
371
|
async function loadWindnerdLocation(config, environment, options = {}) {
|
|
373
372
|
const cached = await environment.cache.get(`windnerd/location/${config.locationId}`);
|
|
374
373
|
if (cached != null) return JSON.parse(cached);
|
|
@@ -48,11 +48,8 @@ type UpstreamTextRequest = {
|
|
|
48
48
|
* in-flight load. The load owns its own cache fill; this only deduplicates.
|
|
49
49
|
*/
|
|
50
50
|
declare function coalesceUpstreamLoad(cache: FeedCache, key: string, load: () => Promise<string>): Promise<string>;
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* timeout, cache fill. Concurrent misses on the same (cache instance,
|
|
54
|
-
* cacheKey) coalesce onto a single in-flight load.
|
|
55
|
-
*/
|
|
51
|
+
/** Cache lookup, bounded fetch under a timeout, cache fill. Concurrent
|
|
52
|
+
* misses on one (cache instance, cacheKey) coalesce onto a single load. */
|
|
56
53
|
declare function fetchUpstreamText(environment: ResolvedEnvironment, request: UpstreamTextRequest): Promise<string>;
|
|
57
54
|
type UpstreamStreamRequest = {
|
|
58
55
|
url: string | URL;
|
|
@@ -63,11 +60,8 @@ type UpstreamStreamRequest = {
|
|
|
63
60
|
signal?: AbortSignal;
|
|
64
61
|
};
|
|
65
62
|
declare const UPSTREAM_CONNECT_TIMEOUT_MS = 10000;
|
|
66
|
-
/**
|
|
67
|
-
*
|
|
68
|
-
* consumer bounds its own buffering — and never coalesced: every caller owns
|
|
69
|
-
* its connection and tears it down through its signal.
|
|
70
|
-
*/
|
|
63
|
+
/** Long-lived upstream body: no cache, no byte cap, never coalesced —
|
|
64
|
+
* the caller owns the connection and tears it down through its signal. */
|
|
71
65
|
declare function fetchUpstreamStream(environment: ResolvedEnvironment, request: UpstreamStreamRequest): Promise<Response>;
|
|
72
66
|
declare function boundedResponseText(response: Response, limitBytes: number, subject: string): Promise<string>;
|
|
73
67
|
declare function logUpstreamFailure(environment: ResolvedEnvironment, message: string, error: unknown, detail?: Record<string, unknown>): void;
|
|
@@ -87,11 +87,8 @@ function coalesceUpstreamLoad(cache, key, load) {
|
|
|
87
87
|
pending.set(key, loading);
|
|
88
88
|
return loading;
|
|
89
89
|
}
|
|
90
|
-
/**
|
|
91
|
-
*
|
|
92
|
-
* timeout, cache fill. Concurrent misses on the same (cache instance,
|
|
93
|
-
* cacheKey) coalesce onto a single in-flight load.
|
|
94
|
-
*/
|
|
90
|
+
/** Cache lookup, bounded fetch under a timeout, cache fill. Concurrent
|
|
91
|
+
* misses on one (cache instance, cacheKey) coalesce onto a single load. */
|
|
95
92
|
async function fetchUpstreamText(environment, request) {
|
|
96
93
|
const cached = await environment.cache.get(request.cacheKey);
|
|
97
94
|
if (cached != null) return cached;
|
|
@@ -126,11 +123,8 @@ async function loadUpstreamText(environment, request) {
|
|
|
126
123
|
return text;
|
|
127
124
|
}
|
|
128
125
|
const UPSTREAM_CONNECT_TIMEOUT_MS = 1e4;
|
|
129
|
-
/**
|
|
130
|
-
*
|
|
131
|
-
* consumer bounds its own buffering — and never coalesced: every caller owns
|
|
132
|
-
* its connection and tears it down through its signal.
|
|
133
|
-
*/
|
|
126
|
+
/** Long-lived upstream body: no cache, no byte cap, never coalesced —
|
|
127
|
+
* the caller owns the connection and tears it down through its signal. */
|
|
134
128
|
async function fetchUpstreamStream(environment, request) {
|
|
135
129
|
const connect = new AbortController();
|
|
136
130
|
const connectTimer = setTimeout(() => connect.abort(), request.connectTimeoutMs ?? 1e4);
|
package/dist/strings.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ type StationStrings = {
|
|
|
34
34
|
lastNightLowLabel: string;
|
|
35
35
|
pressureDeltaLabel: (windowHours: number) => string;
|
|
36
36
|
dailyPatternSamples: (sampleCount: number) => string;
|
|
37
|
-
dailyPatternCoverage: (sampleCount: number,
|
|
37
|
+
dailyPatternCoverage: (sampleCount: number, coveragePercent: number) => string;
|
|
38
38
|
compassSpoken: Record<CompassPoint, string>;
|
|
39
39
|
updated: {
|
|
40
40
|
justNow: string;
|
package/dist/strings.js
CHANGED
|
@@ -33,7 +33,7 @@ const defaultStrings = {
|
|
|
33
33
|
lastNightLowLabel: "Last night low",
|
|
34
34
|
pressureDeltaLabel: (windowHours) => `Pressure ${windowHours} h`,
|
|
35
35
|
dailyPatternSamples: (sampleCount) => `${sampleCount} samples`,
|
|
36
|
-
dailyPatternCoverage: (sampleCount,
|
|
36
|
+
dailyPatternCoverage: (sampleCount, coveragePercent) => `${sampleCount} samples · ${coveragePercent}%`,
|
|
37
37
|
compassSpoken: {
|
|
38
38
|
N: "north",
|
|
39
39
|
NNE: "north-northeast",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azohra/meteo.station",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "The station capability of meteo by Azohra: live weather-station reading, derivation, and display - the wire contract, provider adapters, a polling client, a Node server, and React and custom-element display bindings.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"weather-station",
|
|
@@ -84,6 +84,32 @@
|
|
|
84
84
|
"minimum": 0,
|
|
85
85
|
"maximum": 9007199254740991,
|
|
86
86
|
"description": "Records a gapless station would have produced over the requested window — the honesty denominator; a leading dropout lowers the ratio instead of hiding."
|
|
87
|
+
},
|
|
88
|
+
"coveredSlotCount": {
|
|
89
|
+
"description": "Distinct (day, slot) buckets holding at least one record.",
|
|
90
|
+
"anyOf": [
|
|
91
|
+
{
|
|
92
|
+
"type": "integer",
|
|
93
|
+
"minimum": 0,
|
|
94
|
+
"maximum": 9007199254740991
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"type": "null"
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
},
|
|
101
|
+
"expectedSlotCount": {
|
|
102
|
+
"description": "Slots a gapless station would have covered over the window.",
|
|
103
|
+
"anyOf": [
|
|
104
|
+
{
|
|
105
|
+
"type": "integer",
|
|
106
|
+
"minimum": 0,
|
|
107
|
+
"maximum": 9007199254740991
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"type": "null"
|
|
111
|
+
}
|
|
112
|
+
]
|
|
87
113
|
}
|
|
88
114
|
},
|
|
89
115
|
"required": [
|
package/styles.css
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* - `--meteo-*` is the SHARED skin — surfaces, ink, muted text, borders,
|
|
5
5
|
* grid lines, the accent, the gap hatch, typography, radius, shadow, and
|
|
6
6
|
* the freshness states (live/aging/stale). Any meteo capability's
|
|
7
|
-
* components (wind today, forecast tomorrow)
|
|
7
|
+
* components (wind today, forecast tomorrow) use these.
|
|
8
8
|
* - `--meteo-wind-*` is genuinely wind-scoped — the lull–gust band fill, the mean
|
|
9
9
|
* trace, vanes, the inspection cursor, the meteo-band-0..4 ramp, and the
|
|
10
10
|
* rose's favorable/unfavorable judgment ring.
|
|
@@ -21,8 +21,7 @@
|
|
|
21
21
|
* outranks it without specificity games.
|
|
22
22
|
*
|
|
23
23
|
* meteo-band-0..4 is a placeholder ramp — calm blue through green and amber to
|
|
24
|
-
* red. What a band means
|
|
25
|
-
* belong to the consumer. */
|
|
24
|
+
* red. What a band means and what colour it gets belong to the consumer. */
|
|
26
25
|
|
|
27
26
|
@layer meteo {
|
|
28
27
|
|
|
@@ -94,8 +93,7 @@
|
|
|
94
93
|
color: var(--meteo-accent, #0f7490);
|
|
95
94
|
}
|
|
96
95
|
|
|
97
|
-
/*
|
|
98
|
-
* table headers. */
|
|
96
|
+
/* Shared style for caption-grade labels: flanks, summary terms, table headers. */
|
|
99
97
|
.meteo-microlabel {
|
|
100
98
|
font-size: 0.68rem;
|
|
101
99
|
font-weight: 600;
|
|
@@ -151,7 +149,7 @@
|
|
|
151
149
|
color: var(--meteo-ink, #17232e);
|
|
152
150
|
}
|
|
153
151
|
|
|
154
|
-
/*
|
|
152
|
+
/* Unit is smaller and muted beside the number, matching the dial hub. */
|
|
155
153
|
.meteo-value .meteo-unit {
|
|
156
154
|
font-size: 0.72em;
|
|
157
155
|
font-weight: 500;
|
|
@@ -196,7 +194,7 @@
|
|
|
196
194
|
color: var(--meteo-muted, #62717f);
|
|
197
195
|
}
|
|
198
196
|
|
|
199
|
-
/*
|
|
197
|
+
/* Timestamps are context, not readings: muted. */
|
|
200
198
|
.meteo-updated {
|
|
201
199
|
color: var(--meteo-muted, #62717f);
|
|
202
200
|
}
|
|
@@ -240,9 +238,7 @@
|
|
|
240
238
|
box-shadow: var(--meteo-shadow, 0 1px 2px rgb(23 35 46 / 0.06), 0 8px 24px rgb(23 35 46 / 0.05));
|
|
241
239
|
}
|
|
242
240
|
|
|
243
|
-
/* Wraps rather than overflows
|
|
244
|
-
* narrow card can promise, and a flank spilling into whatever sits beside
|
|
245
|
-
* the card reads as a broken layout, not a compact one. */
|
|
241
|
+
/* Wraps rather than overflows when LULL/dial/GUST exceeds a narrow card. */
|
|
246
242
|
.meteo-current-instrument {
|
|
247
243
|
display: flex;
|
|
248
244
|
flex-wrap: wrap;
|
|
@@ -305,8 +301,8 @@
|
|
|
305
301
|
stroke-linecap: butt;
|
|
306
302
|
}
|
|
307
303
|
|
|
308
|
-
/*
|
|
309
|
-
*
|
|
304
|
+
/* Speed arc: the reading's share of the dial scale, in the reading's band
|
|
305
|
+
* colour when thresholds grade it. */
|
|
310
306
|
.meteo-wind-dial-arc {
|
|
311
307
|
fill: none;
|
|
312
308
|
stroke: var(--meteo-accent, #0f7490);
|
|
@@ -444,7 +440,7 @@
|
|
|
444
440
|
|
|
445
441
|
/* Fixed minimum height so pinning and unpinning never moves the chart. The
|
|
446
442
|
* daily-pattern caption is static — no pin state — but shares the line so
|
|
447
|
-
* it
|
|
443
|
+
* it keeps the same line metrics as the chart caption above it. */
|
|
448
444
|
.meteo-wind-chart-readout,
|
|
449
445
|
.meteo-sample-strip-readout,
|
|
450
446
|
.meteo-daily-pattern-caption,
|
|
@@ -491,7 +487,7 @@
|
|
|
491
487
|
stroke-width: 1;
|
|
492
488
|
}
|
|
493
489
|
|
|
494
|
-
/* Band zones: each band's
|
|
490
|
+
/* Band zones: each band's range faintly tinted behind the plot. */
|
|
495
491
|
.meteo-wind-zone {
|
|
496
492
|
stroke: none;
|
|
497
493
|
fill-opacity: 0.05;
|
|
@@ -503,7 +499,7 @@
|
|
|
503
499
|
.meteo-wind-zone.meteo-band-3 { fill: var(--meteo-band-3, #e2662c); }
|
|
504
500
|
.meteo-wind-zone.meteo-band-4 { fill: var(--meteo-band-4, #c22727); }
|
|
505
501
|
|
|
506
|
-
/* Threshold guides
|
|
502
|
+
/* Threshold guides use the colour of the band they open. */
|
|
507
503
|
.meteo-wind-threshold {
|
|
508
504
|
stroke: var(--meteo-muted, #62717f);
|
|
509
505
|
stroke-width: 1;
|
|
@@ -594,7 +590,7 @@
|
|
|
594
590
|
}
|
|
595
591
|
|
|
596
592
|
/* Verdict-tinted vanes, drawn only when the consumer supplied favorable
|
|
597
|
-
* arcs; a calm cell never
|
|
593
|
+
* arcs; a calm cell never gets one. */
|
|
598
594
|
.meteo-wind-vane-favorable {
|
|
599
595
|
stroke: var(--meteo-wind-favorable, #2e9e63);
|
|
600
596
|
}
|
|
@@ -664,7 +660,7 @@
|
|
|
664
660
|
}
|
|
665
661
|
|
|
666
662
|
/* The em-dash placeholder holds the exact box the glyph would, so a station
|
|
667
|
-
* going
|
|
663
|
+
* going empty never shifts the row's layout. */
|
|
668
664
|
.meteo-sparkline-na {
|
|
669
665
|
display: inline-flex;
|
|
670
666
|
align-items: center;
|
|
@@ -721,7 +717,7 @@
|
|
|
721
717
|
width: 100%;
|
|
722
718
|
}
|
|
723
719
|
|
|
724
|
-
/* The trace
|
|
720
|
+
/* The trace uses the mean line's colour, thinner — a trend is a
|
|
725
721
|
* background fact, not the wind. */
|
|
726
722
|
.meteo-trend-line {
|
|
727
723
|
fill: none;
|
|
@@ -844,7 +840,7 @@
|
|
|
844
840
|
font-feature-settings: "tnum";
|
|
845
841
|
}
|
|
846
842
|
|
|
847
|
-
/* Night columns: sunset to sunrise
|
|
843
|
+
/* Night columns: sunset to sunrise, low-opacity gray under
|
|
848
844
|
* every data layer. */
|
|
849
845
|
.meteo-night {
|
|
850
846
|
fill: var(--meteo-muted, #62717f);
|
|
@@ -1256,7 +1252,7 @@
|
|
|
1256
1252
|
padding-top: 0.5rem;
|
|
1257
1253
|
}
|
|
1258
1254
|
|
|
1259
|
-
/* Row labels
|
|
1255
|
+
/* Row labels use the shared micro-label style; the unit follows the
|
|
1260
1256
|
* label so cells hold bare numbers. */
|
|
1261
1257
|
.meteo-air-label {
|
|
1262
1258
|
font-size: 0.78rem;
|
|
@@ -1293,8 +1289,10 @@
|
|
|
1293
1289
|
* keeps the unavailable arm the same height as a reading. */
|
|
1294
1290
|
.meteo-strip {
|
|
1295
1291
|
display: flex;
|
|
1292
|
+
/* Wrap rather than clip when the column is narrower than the cells. */
|
|
1293
|
+
flex-wrap: wrap;
|
|
1296
1294
|
align-items: center;
|
|
1297
|
-
gap: 1.1rem;
|
|
1295
|
+
gap: 0.15rem 1.1rem;
|
|
1298
1296
|
min-height: 2.6rem;
|
|
1299
1297
|
padding: 0.4rem 0.9rem;
|
|
1300
1298
|
font-family: var(--meteo-font, ui-sans-serif, system-ui, sans-serif);
|