@azohra/meteo.station 0.6.0 → 0.7.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.
Files changed (128) hide show
  1. package/README.md +17 -17
  2. package/dist/connectivity.d.ts +2 -2
  3. package/dist/contract.d.ts +105 -105
  4. package/dist/derive.js +4 -4
  5. package/dist/elements/elements/AirExtremesElement.js +5 -18
  6. package/dist/elements/elements/AirMatrixElement.js +6 -31
  7. package/dist/elements/elements/ClimatologyDailyPatternElement.js +17 -12
  8. package/dist/elements/elements/ClimatologyRoseElement.js +5 -15
  9. package/dist/elements/elements/CompassFanElement.js +5 -64
  10. package/dist/elements/elements/CurrentConditionsElement.js +7 -26
  11. package/dist/elements/elements/DailyPatternElement.d.ts +0 -1
  12. package/dist/elements/elements/DailyPatternElement.js +6 -120
  13. package/dist/elements/elements/DialElement.js +3 -95
  14. package/dist/elements/elements/FavorableShareElement.js +6 -21
  15. package/dist/elements/elements/RecentSummariesElement.js +6 -23
  16. package/dist/elements/elements/SparklineElement.d.ts +0 -1
  17. package/dist/elements/elements/SparklineElement.js +4 -39
  18. package/dist/elements/elements/StationCardElement.js +4 -18
  19. package/dist/elements/elements/StationFeedElement.js +4 -2
  20. package/dist/elements/elements/StationStripElement.js +4 -18
  21. package/dist/elements/elements/StationTableElement.js +15 -51
  22. package/dist/elements/elements/TrendChartElement.js +21 -69
  23. package/dist/elements/elements/WindHistoryChartElement.js +23 -164
  24. package/dist/elements/elements/WindRoseElement.d.ts +0 -1
  25. package/dist/elements/elements/WindRoseElement.js +6 -70
  26. package/dist/elements/elements/atoms.d.ts +1 -1
  27. package/dist/elements/elements/atoms.js +11 -38
  28. package/dist/elements/index.js +3 -3
  29. package/dist/elements/lib/fragments.js +8 -37
  30. package/dist/elements/lib/h.js +1 -1
  31. package/dist/elements/lib/render.js +30 -0
  32. package/dist/geometry.js +2 -1
  33. package/dist/instruments.js +2 -2
  34. package/dist/react/components/AirExtremes.d.ts +1 -1
  35. package/dist/react/components/AirExtremes.js +5 -22
  36. package/dist/react/components/AirMatrix.js +10 -43
  37. package/dist/react/components/ClimatologyDailyPattern.d.ts +1 -1
  38. package/dist/react/components/ClimatologyDailyPattern.js +19 -13
  39. package/dist/react/components/ClimatologyRose.d.ts +1 -1
  40. package/dist/react/components/ClimatologyRose.js +11 -28
  41. package/dist/react/components/CompassFan.d.ts +1 -1
  42. package/dist/react/components/CompassFan.js +6 -73
  43. package/dist/react/components/CurrentConditions.d.ts +1 -1
  44. package/dist/react/components/CurrentConditions.js +11 -74
  45. package/dist/react/components/DailyPattern.d.ts +1 -3
  46. package/dist/react/components/DailyPattern.js +10 -149
  47. package/dist/react/components/Dial.d.ts +1 -1
  48. package/dist/react/components/Dial.js +5 -118
  49. package/dist/react/components/FavorableShare.d.ts +1 -1
  50. package/dist/react/components/FavorableShare.js +6 -27
  51. package/dist/react/components/FreshnessBadge.d.ts +1 -1
  52. package/dist/react/components/FreshnessBadge.js +5 -12
  53. package/dist/react/components/RecentSummaries.d.ts +1 -1
  54. package/dist/react/components/RecentSummaries.js +6 -44
  55. package/dist/react/components/SceneTree.js +38 -0
  56. package/dist/react/components/Sparkline.d.ts +1 -1
  57. package/dist/react/components/Sparkline.js +3 -39
  58. package/dist/react/components/StationCard.d.ts +2 -2
  59. package/dist/react/components/StationCard.js +5 -45
  60. package/dist/react/components/StationStrip.d.ts +1 -1
  61. package/dist/react/components/StationStrip.js +5 -60
  62. package/dist/react/components/StationTable.js +21 -75
  63. package/dist/react/components/TrendChart.js +8 -63
  64. package/dist/react/components/WindArrow.d.ts +1 -1
  65. package/dist/react/components/WindArrow.js +3 -15
  66. package/dist/react/components/WindHistoryChart.js +8 -182
  67. package/dist/react/components/WindRose.d.ts +1 -3
  68. package/dist/react/components/WindRose.js +6 -89
  69. package/dist/react/components/WindSampleStrip.js +8 -115
  70. package/dist/react/components/atoms.d.ts +5 -5
  71. package/dist/react/components/atoms.js +12 -48
  72. package/dist/react/hooks/useStationCurrent.js +3 -2
  73. package/dist/react/hooks/useStationFeed.js +3 -2
  74. package/dist/react/index.d.ts +2 -2
  75. package/dist/react/index.js +5 -5
  76. package/dist/react/lib/cells.js +4 -24
  77. package/dist/scene/air-extremes.js +12 -27
  78. package/dist/scene/air-matrix.js +45 -58
  79. package/dist/scene/card.js +14 -40
  80. package/dist/scene/cells.d.ts +4 -0
  81. package/dist/scene/cells.js +51 -0
  82. package/dist/scene/chart.js +2 -1
  83. package/dist/scene/climatology-pattern.d.ts +1 -2
  84. package/dist/scene/climatology-pattern.js +10 -11
  85. package/dist/scene/climatology-rose.d.ts +1 -2
  86. package/dist/scene/climatology-rose.js +14 -33
  87. package/dist/scene/compass-fan.js +28 -100
  88. package/dist/scene/current.d.ts +2 -1
  89. package/dist/scene/current.js +29 -56
  90. package/dist/scene/daily-pattern.d.ts +1 -3
  91. package/dist/scene/daily-pattern.js +20 -27
  92. package/dist/scene/dial-parts.d.ts +1 -0
  93. package/dist/scene/dial-parts.js +70 -0
  94. package/dist/scene/dial.d.ts +1 -2
  95. package/dist/scene/dial.js +48 -136
  96. package/dist/scene/favorable-share.js +16 -33
  97. package/dist/scene/glyphs.js +20 -16
  98. package/dist/scene/index.d.ts +5 -3
  99. package/dist/scene/node.js +19 -0
  100. package/dist/scene/recent-summaries.js +26 -63
  101. package/dist/scene/rose.js +89 -117
  102. package/dist/scene/sample-strip.d.ts +1 -2
  103. package/dist/scene/sample-strip.js +35 -36
  104. package/dist/scene/sparkline.js +31 -40
  105. package/dist/scene/strip.js +18 -57
  106. package/dist/scene/table.js +47 -69
  107. package/dist/scene/trend.d.ts +1 -2
  108. package/dist/scene/trend.js +29 -55
  109. package/dist/scene/wind-history.d.ts +1 -2
  110. package/dist/scene/wind-history.js +41 -51
  111. package/dist/scene/wind-plot.js +70 -140
  112. package/dist/server/adapters/campbell.d.ts +7 -7
  113. package/dist/server/adapters/campbell.js +1 -1
  114. package/dist/server/adapters/ecowitt.d.ts +8 -8
  115. package/dist/server/adapters/tempest.d.ts +6 -6
  116. package/dist/server/adapters/windnerd-climatology.js +4 -3
  117. package/dist/server/adapters/windnerd-live.js +3 -2
  118. package/dist/server/adapters/windnerd.d.ts +8 -8
  119. package/dist/server/adapters/windnerd.js +1 -1
  120. package/dist/server/config.d.ts +48 -48
  121. package/dist/server/hologram.js +2 -1
  122. package/package.json +6 -11
  123. package/schema/README.md +1 -1
  124. package/schema/stationclimatology.schema.json +64 -61
  125. package/schema/stationcurrent.schema.json +68 -156
  126. package/schema/stationfeed.schema.json +71 -163
  127. package/schema/stationhistory.schema.json +37 -46
  128. package/schema/stationlive.schema.json +221 -306
@@ -12,6 +12,6 @@ declare function Sparkline({ station: stationProp, stationId, width, height, sho
12
12
  thresholds?: SpeedThresholds | null;
13
13
  unit?: SpeedUnit;
14
14
  strings?: StationStringOverrides;
15
- }): import("react").JSX.Element;
15
+ }): import("react").ReactNode;
16
16
  //#endregion
17
17
  export { Sparkline };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { resolveDisplay } from "../../display.js";
3
3
  import { sparklineScene } from "../../scene/sparkline.js";
4
+ import { renderScene } from "./SceneTree.js";
4
5
  import { requireResolved, resolveStation, useStationFeedContext } from "./StationFeedProvider.js";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
6
  //#region src/react/components/Sparkline.tsx
7
7
  function Sparkline({ station: stationProp, stationId, width = 120, height = 32, showBand = true, thresholds: thresholdsProp, strings: stringsProp }) {
8
8
  const context = useStationFeedContext();
@@ -11,50 +11,14 @@ function Sparkline({ station: stationProp, stationId, width = 120, height = 32,
11
11
  strings: stringsProp,
12
12
  thresholds: thresholdsProp
13
13
  });
14
- const scene = sparklineScene({
14
+ return renderScene(sparklineScene({
15
15
  height,
16
16
  showBand,
17
17
  station,
18
18
  thresholds,
19
19
  width,
20
20
  words
21
- });
22
- if (scene.kind === "placeholder") return /* @__PURE__ */ jsx("span", {
23
- "aria-label": scene.ariaLabel,
24
- className: scene.className,
25
- role: "img",
26
- style: {
27
- height: scene.height,
28
- width: scene.width
29
- },
30
- children: scene.text
31
- });
32
- return /* @__PURE__ */ jsxs("svg", {
33
- "aria-label": scene.svg.ariaLabel,
34
- className: scene.svg.className,
35
- height: scene.svg.height,
36
- role: "img",
37
- viewBox: scene.svg.viewBox,
38
- width: scene.svg.width,
39
- children: [scene.bands.map((band) => /* @__PURE__ */ jsx("polygon", {
40
- className: band.className,
41
- points: band.points
42
- }, band.key)), scene.trace.map((part) => part.kind === "dot" ? /* @__PURE__ */ jsx("circle", {
43
- className: part.className,
44
- cx: part.cx,
45
- cy: part.cy,
46
- r: part.r
47
- }, part.key) : part.kind === "polyline" ? /* @__PURE__ */ jsx("polyline", {
48
- className: part.className,
49
- points: part.points
50
- }, part.key) : /* @__PURE__ */ jsx("line", {
51
- className: part.className,
52
- x1: part.x1,
53
- x2: part.x2,
54
- y1: part.y1,
55
- y2: part.y2
56
- }, part.key))]
57
- });
21
+ }));
58
22
  }
59
23
  //#endregion
60
24
  export { Sparkline };
@@ -17,7 +17,7 @@ declare function StationCardRoot({ station: stationProp, stationId, servedAt: se
17
17
  }): import("react").JSX.Element;
18
18
  declare function StationCardHeader({ strings }?: {
19
19
  strings?: StationStringOverrides;
20
- }): import("react").JSX.Element;
20
+ }): ReactNode;
21
21
  declare function StationCardInstrument({ thresholds, unit, strings, formatTime }?: {
22
22
  thresholds?: SpeedThresholds | null;
23
23
  unit?: SpeedUnit;
@@ -35,7 +35,7 @@ declare function StationCardSummary({ unit, strings, formatTime }?: {
35
35
  unit?: SpeedUnit;
36
36
  strings?: StationStringOverrides;
37
37
  formatTime?: FormatTime;
38
- }): import("react").JSX.Element | null;
38
+ }): ReactNode;
39
39
  declare const StationCard: typeof StationCardRoot & {
40
40
  Header: typeof StationCardHeader;
41
41
  Instrument: typeof StationCardInstrument;
@@ -2,10 +2,10 @@
2
2
  import { stationFreshnessThresholds } from "../../derive.js";
3
3
  import { mergeStringOverrides } from "../../strings.js";
4
4
  import { resolveDisplay } from "../../display.js";
5
- import { STATION_CARD_CLASS, cardHeaderScene, cardPartThresholds, cardPartWiringError, summaryScene } from "../../scene/card.js";
5
+ import { STATION_CARD_CLASS, cardHeaderNode, cardPartThresholds, cardPartWiringError, summaryNode } from "../../scene/card.js";
6
+ import { renderOptional, renderScene } from "./SceneTree.js";
6
7
  import { requireResolved, resolveStation, useStationFeedContext } from "./StationFeedProvider.js";
7
8
  import { useFreshness } from "../hooks/useFreshness.js";
8
- import { FreshnessBadge } from "./FreshnessBadge.js";
9
9
  import { CurrentConditions } from "./CurrentConditions.js";
10
10
  import { WindHistoryChart } from "./WindHistoryChart.js";
11
11
  import { createContext, useContext } from "react";
@@ -53,37 +53,9 @@ function StationCardRoot({ station: stationProp, stationId, servedAt: servedAtPr
53
53
  function StationCardHeader({ strings } = {}) {
54
54
  const context = useStationCardContext("Header");
55
55
  const { station, servedAt, receivedAtMs } = context;
56
- const { strings: resolvedStrings, words } = resolveDisplay(context, { strings });
56
+ const { words } = resolveDisplay(context, { strings });
57
57
  const status = useFreshness(station.reading?.observedAt ?? null, servedAt, receivedAtMs, stationFreshnessThresholds(station));
58
- const scene = cardHeaderScene(station, words);
59
- const { name, meta } = scene.identity;
60
- return /* @__PURE__ */ jsxs("header", {
61
- className: scene.className,
62
- children: [/* @__PURE__ */ jsxs("div", {
63
- className: scene.identity.className,
64
- children: [/* @__PURE__ */ jsx("h3", {
65
- className: name.className,
66
- children: name.link ? /* @__PURE__ */ jsx("a", {
67
- href: name.link.href,
68
- rel: name.link.rel,
69
- target: name.link.target,
70
- children: name.link.text
71
- }) : name.text
72
- }), /* @__PURE__ */ jsxs("p", {
73
- className: meta.className,
74
- children: [/* @__PURE__ */ jsx("span", {
75
- className: meta.source.className,
76
- children: meta.source.text
77
- }), meta.elevation && /* @__PURE__ */ jsx("span", {
78
- className: meta.elevation.className,
79
- children: meta.elevation.text
80
- })]
81
- })]
82
- }), status != null && /* @__PURE__ */ jsx(FreshnessBadge, {
83
- status,
84
- strings: resolvedStrings
85
- })]
86
- });
58
+ return renderScene(cardHeaderNode(station, status, words));
87
59
  }
88
60
  function StationCardInstrument({ thresholds, unit, strings, formatTime } = {}) {
89
61
  const context = useStationCardContext("Instrument");
@@ -116,19 +88,7 @@ function StationCardSummary({ unit, strings, formatTime } = {}) {
116
88
  unit
117
89
  });
118
90
  const { station } = context;
119
- const summary = summaryScene(station, resolvedUnit, words, resolvedFormatTime);
120
- if (summary == null) return null;
121
- return /* @__PURE__ */ jsx("dl", {
122
- "aria-label": summary.ariaLabel,
123
- className: summary.className,
124
- children: summary.items.map((item) => /* @__PURE__ */ jsxs("div", {
125
- className: summary.itemClassName,
126
- children: [/* @__PURE__ */ jsx("dt", {
127
- className: summary.labelClassName,
128
- children: item.label
129
- }), /* @__PURE__ */ jsx("dd", { children: item.value })]
130
- }, item.label))
131
- });
91
+ return renderOptional(summaryNode(station, resolvedUnit, words, resolvedFormatTime));
132
92
  }
133
93
  const StationCard = Object.assign(StationCardRoot, {
134
94
  Header: StationCardHeader,
@@ -11,6 +11,6 @@ declare function StationStrip({ station: stationProp, stationId, servedAt: serve
11
11
  unit?: SpeedUnit;
12
12
  strings?: StationStringOverrides;
13
13
  formatTime?: FormatTime;
14
- }): import("react").JSX.Element;
14
+ }): import("react").ReactNode;
15
15
  //#endregion
16
16
  export { StationStrip };
@@ -2,83 +2,28 @@
2
2
  import { stationFreshnessThresholds } from "../../derive.js";
3
3
  import { resolveDisplay } from "../../display.js";
4
4
  import { stationStripScene } from "../../scene/strip.js";
5
+ import { renderScene } from "./SceneTree.js";
5
6
  import { requireResolved, resolveStation, useStationFeedContext } from "./StationFeedProvider.js";
6
- import { DirectionCell, StationNameLink } from "../lib/cells.js";
7
7
  import { useFreshness } from "../hooks/useFreshness.js";
8
- import { FreshnessBadge } from "./FreshnessBadge.js";
9
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
8
  //#region src/react/components/StationStrip.tsx
11
9
  function StationStrip({ station: stationProp, stationId, servedAt: servedAtProp, receivedAtMs: receivedAtMsProp, unit: unitProp, strings: stringsProp, formatTime: formatTimeProp }) {
12
10
  const context = useStationFeedContext();
13
11
  const station = requireResolved("StationStrip", "station", stationProp ?? resolveStation(context, stationId));
14
12
  const servedAt = servedAtProp ?? context?.feed?.servedAt ?? null;
15
13
  const receivedAtMs = receivedAtMsProp !== void 0 ? receivedAtMsProp : context?.receivedAtMs ?? null;
16
- const { formatTime, strings, unit, words } = resolveDisplay(context, {
14
+ const { formatTime, unit, words } = resolveDisplay(context, {
17
15
  formatTime: formatTimeProp,
18
16
  strings: stringsProp,
19
17
  unit: unitProp
20
18
  });
21
19
  const status = useFreshness(station.reading?.observedAt ?? null, servedAt, receivedAtMs, stationFreshnessThresholds(station));
22
- const scene = stationStripScene({
20
+ return renderScene(stationStripScene({
23
21
  formatTime,
22
+ freshness: status,
24
23
  station,
25
24
  unit,
26
25
  words
27
- });
28
- const { body } = scene;
29
- return /* @__PURE__ */ jsxs("div", {
30
- "aria-label": scene.root.ariaLabel,
31
- className: scene.root.className,
32
- "data-status": scene.root.status,
33
- role: "group",
34
- children: [/* @__PURE__ */ jsx("span", {
35
- className: scene.stationClassName,
36
- children: /* @__PURE__ */ jsx(StationNameLink, { station })
37
- }), body.kind === "reading" ? /* @__PURE__ */ jsxs(Fragment, { children: [
38
- /* @__PURE__ */ jsxs("span", {
39
- className: body.wind.className,
40
- children: [/* @__PURE__ */ jsx("strong", { children: body.wind.value }), /* @__PURE__ */ jsx("small", { children: body.wind.unitLabel })]
41
- }),
42
- body.gustLull && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("span", {
43
- className: body.gustLull.lull.className,
44
- children: [/* @__PURE__ */ jsx("small", {
45
- className: body.gustLull.lull.labelClassName,
46
- children: body.gustLull.lull.label
47
- }), body.gustLull.lull.value]
48
- }), /* @__PURE__ */ jsxs("span", {
49
- className: body.gustLull.gust.className,
50
- children: [/* @__PURE__ */ jsx("small", {
51
- className: body.gustLull.gust.labelClassName,
52
- children: body.gustLull.gust.label
53
- }), body.gustLull.gust.value]
54
- })] }),
55
- /* @__PURE__ */ jsx("span", {
56
- className: body.from.className,
57
- children: /* @__PURE__ */ jsx(DirectionCell, {
58
- windAvgMps: body.from.windAvgMps,
59
- windDirectionDeg: body.from.windDirectionDeg,
60
- words
61
- })
62
- }),
63
- body.temperature && /* @__PURE__ */ jsx("span", {
64
- className: body.temperature.className,
65
- children: body.temperature.text
66
- }),
67
- /* @__PURE__ */ jsxs("span", {
68
- className: body.updated.className,
69
- children: [/* @__PURE__ */ jsx("span", {
70
- className: body.updated.time.className,
71
- children: body.updated.time.text
72
- }), status != null && /* @__PURE__ */ jsx(FreshnessBadge, {
73
- status,
74
- strings
75
- })]
76
- })
77
- ] }) : /* @__PURE__ */ jsx("span", {
78
- className: body.className,
79
- children: body.text
80
- })]
81
- });
26
+ }));
82
27
  }
83
28
  //#endregion
84
29
  export { StationStrip };
@@ -1,37 +1,30 @@
1
1
  "use client";
2
2
  import { stationFreshnessThresholds } from "../../derive.js";
3
3
  import { resolveDisplay } from "../../display.js";
4
- import { stationTableRowScene, stationTableScene } from "../../scene/table.js";
4
+ import { TABLE_BODY_CLASS, TABLE_ROW_CLASS, TABLE_STATION_CELL_CLASS, stationTableHeadNode, stationTableRootAttrs, stationTableRowCells } from "../../scene/table.js";
5
+ import { renderChildren, renderScene } from "./SceneTree.js";
5
6
  import { requireResolved, useStationFeedContext } from "./StationFeedProvider.js";
6
- import { DirectionCell, StationNameLink } from "../lib/cells.js";
7
7
  import { useFreshness } from "../hooks/useFreshness.js";
8
- import { FreshnessBadge } from "./FreshnessBadge.js";
9
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { StationNameLink } from "../lib/cells.js";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
10
  //#region src/react/components/StationTable.tsx
11
11
  function StationTable({ stations: stationsProp, servedAt: servedAtProp, receivedAtMs: receivedAtMsProp, unit: unitProp, strings: stringsProp, formatTime: formatTimeProp, stationMeta }) {
12
12
  const context = useStationFeedContext();
13
13
  const stations = requireResolved("StationTable", "stations", stationsProp ?? context?.feed?.stations);
14
14
  const servedAt = servedAtProp ?? context?.feed?.servedAt ?? null;
15
15
  const receivedAtMs = receivedAtMsProp !== void 0 ? receivedAtMsProp : context?.receivedAtMs ?? null;
16
- const { formatTime, strings, unit, words } = resolveDisplay(context, {
16
+ const { formatTime, unit, words } = resolveDisplay(context, {
17
17
  formatTime: formatTimeProp,
18
18
  strings: stringsProp,
19
19
  unit: unitProp
20
20
  });
21
- const scene = stationTableScene(stations, words);
21
+ const root = stationTableRootAttrs(stations, words);
22
22
  return /* @__PURE__ */ jsxs("div", {
23
- "aria-label": scene.root.ariaLabel,
24
- className: scene.root.className,
23
+ "aria-label": root["aria-label"],
24
+ className: root["class"],
25
25
  role: "table",
26
- children: [/* @__PURE__ */ jsx("div", {
27
- className: scene.head.className,
28
- role: "row",
29
- children: scene.head.columns.map((column) => /* @__PURE__ */ jsx("span", {
30
- role: "columnheader",
31
- children: column
32
- }, column))
33
- }), /* @__PURE__ */ jsx("div", {
34
- className: scene.bodyClassName,
26
+ children: [renderScene(stationTableHeadNode(words)), /* @__PURE__ */ jsx("div", {
27
+ className: TABLE_BODY_CLASS,
35
28
  role: "rowgroup",
36
29
  children: stations.map((station) => /* @__PURE__ */ jsx(TableRow, {
37
30
  formatTime,
@@ -39,76 +32,29 @@ function StationTable({ stations: stationsProp, servedAt: servedAtProp, received
39
32
  servedAt,
40
33
  station,
41
34
  stationMeta,
42
- strings,
43
35
  unit,
44
36
  words
45
37
  }, station.id))
46
38
  })]
47
39
  });
48
40
  }
49
- function TableRow({ formatTime, receivedAtMs, servedAt, station, stationMeta, strings, unit, words }) {
41
+ function TableRow({ formatTime, receivedAtMs, servedAt, station, stationMeta, unit, words }) {
50
42
  const status = useFreshness(station.reading?.observedAt ?? null, servedAt, receivedAtMs, stationFreshnessThresholds(station));
51
- const row = stationTableRowScene({
52
- formatTime,
53
- station,
54
- unit,
55
- words
56
- });
57
- const { cells } = row;
58
43
  return /* @__PURE__ */ jsxs("div", {
59
- className: row.className,
60
- "data-status": row.status,
44
+ className: TABLE_ROW_CLASS,
45
+ "data-status": station.status,
61
46
  role: "row",
62
47
  children: [/* @__PURE__ */ jsxs("span", {
63
- className: row.stationCellClassName,
48
+ className: TABLE_STATION_CELL_CLASS,
64
49
  role: "cell",
65
50
  children: [/* @__PURE__ */ jsx("strong", { children: /* @__PURE__ */ jsx(StationNameLink, { station }) }), /* @__PURE__ */ jsx("small", { children: stationMeta ? stationMeta(station) : station.sourceLabel })]
66
- }), cells.kind === "reading" ? /* @__PURE__ */ jsxs(Fragment, { children: [
67
- /* @__PURE__ */ jsxs("span", {
68
- className: cells.wind.className,
69
- role: "cell",
70
- children: [/* @__PURE__ */ jsx("strong", { children: cells.wind.value }), /* @__PURE__ */ jsx("small", { children: cells.wind.unitLabel })]
71
- }),
72
- /* @__PURE__ */ jsx("span", {
73
- className: cells.lull.className,
74
- role: "cell",
75
- children: cells.lull.value
76
- }),
77
- /* @__PURE__ */ jsx("span", {
78
- className: cells.gust.className,
79
- role: "cell",
80
- children: cells.gust.value
81
- }),
82
- /* @__PURE__ */ jsx("span", {
83
- className: cells.from.className,
84
- role: "cell",
85
- children: /* @__PURE__ */ jsx(DirectionCell, {
86
- windAvgMps: cells.from.windAvgMps,
87
- windDirectionDeg: cells.from.windDirectionDeg,
88
- words
89
- })
90
- }),
91
- /* @__PURE__ */ jsx("span", {
92
- className: cells.temperature.className,
93
- role: "cell",
94
- children: cells.temperature.value
95
- }),
96
- /* @__PURE__ */ jsxs("span", {
97
- className: cells.updated.className,
98
- role: "cell",
99
- children: [/* @__PURE__ */ jsx("span", {
100
- className: cells.updated.time.className,
101
- children: cells.updated.time.text
102
- }), status != null && /* @__PURE__ */ jsx(FreshnessBadge, {
103
- status,
104
- strings
105
- })]
106
- })
107
- ] }) : /* @__PURE__ */ jsx("span", {
108
- className: cells.className,
109
- role: "cell",
110
- children: cells.text
111
- })]
51
+ }), renderChildren(stationTableRowCells({
52
+ formatTime,
53
+ freshness: status,
54
+ station,
55
+ unit,
56
+ words
57
+ }))]
112
58
  });
113
59
  }
114
60
  //#endregion
@@ -3,6 +3,7 @@ import { resolveDisplay } from "../../display.js";
3
3
  import { measuredChartWidth } from "../../geometry.js";
4
4
  import { readoutAriaLive } from "../../scene/chart.js";
5
5
  import { TREND_CLASS, trendGate, trendScene } from "../../scene/trend.js";
6
+ import { renderScene } from "./SceneTree.js";
6
7
  import { requireResolved, resolveStation, useStationFeedContext } from "./StationFeedProvider.js";
7
8
  import { usePinnedCursor } from "../lib/use-pinned-cursor.js";
8
9
  import { useEffect, useRef, useState } from "react";
@@ -18,6 +19,7 @@ function TrendChart({ station: stationProp, stationId, series, strings: stringsP
18
19
  const wrapRef = useRef(null);
19
20
  const [width, setWidth] = useState(null);
20
21
  const gate = trendGate(station, series, words);
22
+ const drawable = gate.kind === "draw";
21
23
  useEffect(() => {
22
24
  const element = wrapRef.current;
23
25
  if (!element) return;
@@ -30,7 +32,7 @@ function TrendChart({ station: stationProp, stationId, series, strings: stringsP
30
32
  });
31
33
  observer.observe(element);
32
34
  return () => observer.disconnect();
33
- }, [gate.kind === "draw"]);
35
+ }, [drawable]);
34
36
  if (gate.kind === "hidden") return null;
35
37
  if (gate.kind === "note") return /* @__PURE__ */ jsx("div", {
36
38
  className: gate.className,
@@ -66,68 +68,11 @@ function MeasuredTrend({ formatTime, history, series, stationName, width, words
66
68
  "aria-live": readoutAriaLive(pinned.previewIndex),
67
69
  className: scene.readout.className,
68
70
  children: [/* @__PURE__ */ jsx("strong", { children: readout.strong }), /* @__PURE__ */ jsx("span", { children: readout.span })]
69
- }), /* @__PURE__ */ jsxs("svg", {
70
- "aria-label": scene.svg.ariaLabel,
71
- className: scene.svg.className,
72
- height: scene.svg.height,
73
- role: "img",
74
- viewBox: scene.svg.viewBox,
75
- width: scene.svg.width,
76
- children: [
77
- scene.grid.map(({ key, line, label }) => /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx("line", {
78
- className: line.className,
79
- x1: line.x1,
80
- x2: line.x2,
81
- y1: line.y1,
82
- y2: line.y2
83
- }), /* @__PURE__ */ jsx("text", {
84
- className: label.className,
85
- textAnchor: label.anchor,
86
- x: label.x,
87
- y: label.y,
88
- children: label.text
89
- })] }, key)),
90
- scene.segments.map((segment) => segment.kind === "dot" ? /* @__PURE__ */ jsx("circle", {
91
- className: segment.className,
92
- cx: segment.cx,
93
- cy: segment.cy,
94
- r: segment.r
95
- }, segment.startedAt) : /* @__PURE__ */ jsx("polyline", {
96
- className: segment.className,
97
- points: segment.points
98
- }, segment.startedAt)),
99
- scene.ticks.map((tick) => /* @__PURE__ */ jsx("text", {
100
- className: tick.className,
101
- textAnchor: tick.anchor,
102
- x: tick.x,
103
- y: tick.y,
104
- children: tick.text
105
- }, tick.key)),
106
- cursor && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("line", {
107
- className: cursor.line.className,
108
- x1: cursor.line.x1,
109
- x2: cursor.line.x2,
110
- y1: cursor.line.y1,
111
- y2: cursor.line.y2
112
- }), cursor.dot && /* @__PURE__ */ jsx("circle", {
113
- className: cursor.dot.className,
114
- cx: cursor.dot.cx,
115
- cy: cursor.dot.cy,
116
- r: cursor.dot.r
117
- })] }),
118
- /* @__PURE__ */ jsx("rect", {
119
- className: scene.hit.className,
120
- fill: scene.hit.fill,
121
- height: scene.hit.height,
122
- onClick: pinned.handleClick,
123
- onPointerLeave: pinned.handlePointerLeave,
124
- onPointerMove: pinned.handlePointerMove,
125
- width: scene.hit.width,
126
- x: scene.hit.x,
127
- y: scene.hit.y
128
- })
129
- ]
130
- })] });
71
+ }), renderScene(scene.draw(cursor, {
72
+ onClick: pinned.handleClick,
73
+ onPointerLeave: pinned.handlePointerLeave,
74
+ onPointerMove: pinned.handlePointerMove
75
+ }))] });
131
76
  }
132
77
  //#endregion
133
78
  export { TrendChart };
@@ -2,6 +2,6 @@
2
2
  declare function WindArrow({ deg, size }: {
3
3
  deg: number;
4
4
  size?: number;
5
- }): import("react").JSX.Element;
5
+ }): import("react").ReactNode;
6
6
  //#endregion
7
7
  export { WindArrow };
@@ -1,21 +1,9 @@
1
1
  "use client";
2
- import { windArrowSpec } from "../../scene/glyphs.js";
3
- import { jsx } from "react/jsx-runtime";
2
+ import { windArrowNode } from "../../scene/glyphs.js";
3
+ import { renderScene } from "./SceneTree.js";
4
4
  //#region src/react/components/WindArrow.tsx
5
5
  function WindArrow({ deg, size = 12 }) {
6
- const spec = windArrowSpec(deg, size);
7
- return /* @__PURE__ */ jsx("svg", {
8
- "aria-hidden": "true",
9
- className: spec.className,
10
- height: spec.height,
11
- style: { transform: spec.transform },
12
- viewBox: spec.viewBox,
13
- width: spec.width,
14
- children: /* @__PURE__ */ jsx("path", {
15
- d: spec.path.d,
16
- fill: spec.path.fill
17
- })
18
- });
6
+ return renderScene(windArrowNode(deg, size));
19
7
  }
20
8
  //#endregion
21
9
  export { WindArrow };