@azohra/meteo.station 0.6.0 → 0.7.1

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 (237) hide show
  1. package/README.md +17 -17
  2. package/dist/air.d.ts +4 -7
  3. package/dist/air.js +1 -2
  4. package/dist/client/climatology.d.ts +4 -7
  5. package/dist/client/climatology.js +1 -2
  6. package/dist/client/history.d.ts +14 -17
  7. package/dist/client/history.js +1 -2
  8. package/dist/client/live.d.ts +9 -11
  9. package/dist/client/live.js +1 -2
  10. package/dist/client/poll.d.ts +9 -12
  11. package/dist/client/poll.js +1 -2
  12. package/dist/client/stores.d.ts +8 -10
  13. package/dist/client/stores.js +1 -2
  14. package/dist/client/ticker.d.ts +1 -4
  15. package/dist/client/ticker.js +1 -2
  16. package/dist/climatology.d.ts +13 -15
  17. package/dist/climatology.js +1 -2
  18. package/dist/connectivity.d.ts +9 -12
  19. package/dist/connectivity.js +1 -2
  20. package/dist/contract-climatology.d.ts +11 -14
  21. package/dist/contract-climatology.js +1 -2
  22. package/dist/contract.d.ts +148 -151
  23. package/dist/contract.js +1 -2
  24. package/dist/derive.d.ts +24 -26
  25. package/dist/derive.js +5 -6
  26. package/dist/display.d.ts +6 -9
  27. package/dist/display.js +1 -2
  28. package/dist/elements/elements/AirExtremesElement.d.ts +2 -5
  29. package/dist/elements/elements/AirExtremesElement.js +6 -20
  30. package/dist/elements/elements/AirMatrixElement.d.ts +2 -5
  31. package/dist/elements/elements/AirMatrixElement.js +7 -33
  32. package/dist/elements/elements/ClimatologyDailyPatternElement.d.ts +2 -5
  33. package/dist/elements/elements/ClimatologyDailyPatternElement.js +18 -14
  34. package/dist/elements/elements/ClimatologyRoseElement.d.ts +2 -5
  35. package/dist/elements/elements/ClimatologyRoseElement.js +6 -17
  36. package/dist/elements/elements/CompassFanElement.d.ts +2 -5
  37. package/dist/elements/elements/CompassFanElement.js +6 -66
  38. package/dist/elements/elements/CurrentConditionsElement.d.ts +2 -5
  39. package/dist/elements/elements/CurrentConditionsElement.js +8 -28
  40. package/dist/elements/elements/DailyPatternElement.d.ts +2 -6
  41. package/dist/elements/elements/DailyPatternElement.js +7 -122
  42. package/dist/elements/elements/DialElement.d.ts +2 -5
  43. package/dist/elements/elements/DialElement.js +4 -97
  44. package/dist/elements/elements/FavorableShareElement.d.ts +2 -5
  45. package/dist/elements/elements/FavorableShareElement.js +7 -23
  46. package/dist/elements/elements/FreshnessBadgeElement.d.ts +2 -5
  47. package/dist/elements/elements/FreshnessBadgeElement.js +1 -2
  48. package/dist/elements/elements/RecentSummariesElement.d.ts +2 -5
  49. package/dist/elements/elements/RecentSummariesElement.js +7 -25
  50. package/dist/elements/elements/SparklineElement.d.ts +2 -6
  51. package/dist/elements/elements/SparklineElement.js +5 -41
  52. package/dist/elements/elements/StationCardElement.d.ts +6 -8
  53. package/dist/elements/elements/StationCardElement.js +5 -20
  54. package/dist/elements/elements/StationFeedElement.d.ts +2 -5
  55. package/dist/elements/elements/StationFeedElement.js +5 -4
  56. package/dist/elements/elements/StationStripElement.d.ts +2 -5
  57. package/dist/elements/elements/StationStripElement.js +5 -20
  58. package/dist/elements/elements/StationTableElement.d.ts +3 -6
  59. package/dist/elements/elements/StationTableElement.js +16 -53
  60. package/dist/elements/elements/TrendChartElement.d.ts +2 -5
  61. package/dist/elements/elements/TrendChartElement.js +22 -71
  62. package/dist/elements/elements/WindArrowElement.d.ts +2 -5
  63. package/dist/elements/elements/WindArrowElement.js +1 -2
  64. package/dist/elements/elements/WindHistoryChartElement.d.ts +2 -5
  65. package/dist/elements/elements/WindHistoryChartElement.js +24 -166
  66. package/dist/elements/elements/WindRoseElement.d.ts +2 -6
  67. package/dist/elements/elements/WindRoseElement.js +7 -72
  68. package/dist/elements/elements/atoms.d.ts +10 -12
  69. package/dist/elements/elements/atoms.js +12 -40
  70. package/dist/elements/index.d.ts +3 -5
  71. package/dist/elements/index.js +4 -5
  72. package/dist/elements/lib/ambient.d.ts +2 -5
  73. package/dist/elements/lib/ambient.js +1 -2
  74. package/dist/elements/lib/attributes.js +1 -2
  75. package/dist/elements/lib/base.d.ts +3 -6
  76. package/dist/elements/lib/base.js +1 -2
  77. package/dist/elements/lib/context.js +1 -2
  78. package/dist/elements/lib/fragments.js +9 -39
  79. package/dist/elements/lib/h.js +2 -3
  80. package/dist/elements/lib/pinned-cursor.js +1 -2
  81. package/dist/elements/lib/render.js +29 -0
  82. package/dist/elements/register.js +1 -2
  83. package/dist/endpoints.d.ts +6 -9
  84. package/dist/endpoints.js +1 -2
  85. package/dist/fixtures.d.ts +7 -10
  86. package/dist/fixtures.js +1 -2
  87. package/dist/format.d.ts +11 -14
  88. package/dist/format.js +1 -2
  89. package/dist/geometry.d.ts +36 -38
  90. package/dist/geometry.js +3 -3
  91. package/dist/instruments.d.ts +37 -40
  92. package/dist/instruments.js +3 -4
  93. package/dist/merge-current.d.ts +4 -7
  94. package/dist/merge-current.js +1 -2
  95. package/dist/react/components/AirExtremes.d.ts +2 -5
  96. package/dist/react/components/AirExtremes.js +6 -24
  97. package/dist/react/components/AirMatrix.d.ts +2 -5
  98. package/dist/react/components/AirMatrix.js +11 -45
  99. package/dist/react/components/ClimatologyDailyPattern.d.ts +2 -5
  100. package/dist/react/components/ClimatologyDailyPattern.js +20 -15
  101. package/dist/react/components/ClimatologyRose.d.ts +2 -5
  102. package/dist/react/components/ClimatologyRose.js +12 -30
  103. package/dist/react/components/CompassFan.d.ts +2 -5
  104. package/dist/react/components/CompassFan.js +7 -75
  105. package/dist/react/components/CurrentConditions.d.ts +2 -5
  106. package/dist/react/components/CurrentConditions.js +12 -76
  107. package/dist/react/components/DailyPattern.d.ts +3 -8
  108. package/dist/react/components/DailyPattern.js +11 -151
  109. package/dist/react/components/Dial.d.ts +2 -5
  110. package/dist/react/components/Dial.js +6 -120
  111. package/dist/react/components/FavorableShare.d.ts +2 -5
  112. package/dist/react/components/FavorableShare.js +7 -29
  113. package/dist/react/components/FreshnessBadge.d.ts +2 -5
  114. package/dist/react/components/FreshnessBadge.js +6 -14
  115. package/dist/react/components/Readout.d.ts +2 -5
  116. package/dist/react/components/Readout.js +1 -2
  117. package/dist/react/components/RecentSummaries.d.ts +2 -5
  118. package/dist/react/components/RecentSummaries.js +7 -46
  119. package/dist/react/components/SceneTree.js +37 -0
  120. package/dist/react/components/Sparkline.d.ts +2 -5
  121. package/dist/react/components/Sparkline.js +4 -41
  122. package/dist/react/components/StationCard.d.ts +8 -10
  123. package/dist/react/components/StationCard.js +6 -47
  124. package/dist/react/components/StationFeedProvider.d.ts +3 -6
  125. package/dist/react/components/StationFeedProvider.js +1 -2
  126. package/dist/react/components/StationStrip.d.ts +2 -5
  127. package/dist/react/components/StationStrip.js +6 -62
  128. package/dist/react/components/StationTable.d.ts +3 -6
  129. package/dist/react/components/StationTable.js +22 -77
  130. package/dist/react/components/TrendChart.d.ts +2 -5
  131. package/dist/react/components/TrendChart.js +9 -65
  132. package/dist/react/components/WindArrow.d.ts +2 -5
  133. package/dist/react/components/WindArrow.js +4 -17
  134. package/dist/react/components/WindHistoryChart.d.ts +2 -5
  135. package/dist/react/components/WindHistoryChart.js +9 -184
  136. package/dist/react/components/WindRose.d.ts +2 -7
  137. package/dist/react/components/WindRose.js +7 -91
  138. package/dist/react/components/WindSampleStrip.d.ts +2 -5
  139. package/dist/react/components/WindSampleStrip.js +9 -117
  140. package/dist/react/components/atoms.d.ts +12 -14
  141. package/dist/react/components/atoms.js +13 -50
  142. package/dist/react/hooks/useFreshness.d.ts +1 -4
  143. package/dist/react/hooks/useFreshness.js +1 -2
  144. package/dist/react/hooks/useMeasuredChartWidth.d.ts +2 -5
  145. package/dist/react/hooks/useMeasuredChartWidth.js +1 -2
  146. package/dist/react/hooks/usePolledJson.js +1 -2
  147. package/dist/react/hooks/useStation.d.ts +2 -5
  148. package/dist/react/hooks/useStation.js +1 -2
  149. package/dist/react/hooks/useStationClimatology.d.ts +2 -5
  150. package/dist/react/hooks/useStationClimatology.js +1 -2
  151. package/dist/react/hooks/useStationCurrent.d.ts +2 -5
  152. package/dist/react/hooks/useStationCurrent.js +4 -4
  153. package/dist/react/hooks/useStationFeed.d.ts +2 -5
  154. package/dist/react/hooks/useStationFeed.js +4 -4
  155. package/dist/react/hooks/useStationLive.d.ts +2 -5
  156. package/dist/react/hooks/useStationLive.js +1 -2
  157. package/dist/react/index.d.ts +2 -2
  158. package/dist/react/index.js +5 -5
  159. package/dist/react/lib/cells.js +5 -26
  160. package/dist/react/lib/use-pinned-cursor.js +1 -2
  161. package/dist/samples.d.ts +8 -11
  162. package/dist/samples.js +1 -2
  163. package/dist/scene/air-extremes.js +13 -29
  164. package/dist/scene/air-matrix.js +46 -60
  165. package/dist/scene/atoms.js +1 -2
  166. package/dist/scene/card.js +15 -42
  167. package/dist/scene/cells.d.ts +4 -0
  168. package/dist/scene/cells.js +50 -0
  169. package/dist/scene/chart.d.ts +2 -5
  170. package/dist/scene/chart.js +3 -3
  171. package/dist/scene/climatology-pattern.d.ts +1 -2
  172. package/dist/scene/climatology-pattern.js +11 -13
  173. package/dist/scene/climatology-rose.d.ts +1 -2
  174. package/dist/scene/climatology-rose.js +15 -35
  175. package/dist/scene/compass-fan.js +29 -102
  176. package/dist/scene/current.d.ts +2 -1
  177. package/dist/scene/current.js +30 -58
  178. package/dist/scene/daily-pattern.d.ts +1 -3
  179. package/dist/scene/daily-pattern.js +21 -29
  180. package/dist/scene/dial-parts.d.ts +1 -0
  181. package/dist/scene/dial-parts.js +69 -0
  182. package/dist/scene/dial.d.ts +1 -2
  183. package/dist/scene/dial.js +49 -138
  184. package/dist/scene/favorable-share.js +17 -35
  185. package/dist/scene/glyphs.js +21 -18
  186. package/dist/scene/index.d.ts +5 -3
  187. package/dist/scene/node.js +18 -0
  188. package/dist/scene/recent-summaries.js +27 -65
  189. package/dist/scene/rose.js +90 -119
  190. package/dist/scene/sample-strip.d.ts +1 -2
  191. package/dist/scene/sample-strip.js +36 -38
  192. package/dist/scene/sparkline.js +32 -42
  193. package/dist/scene/strip.js +19 -59
  194. package/dist/scene/table.js +48 -71
  195. package/dist/scene/trend.d.ts +1 -2
  196. package/dist/scene/trend.js +30 -57
  197. package/dist/scene/wind-history.d.ts +1 -2
  198. package/dist/scene/wind-history.js +42 -53
  199. package/dist/scene/wind-plot.js +71 -142
  200. package/dist/server/adapter.d.ts +7 -10
  201. package/dist/server/adapter.js +1 -2
  202. package/dist/server/adapters/campbell.d.ts +18 -20
  203. package/dist/server/adapters/campbell.js +2 -3
  204. package/dist/server/adapters/ecowitt.d.ts +12 -15
  205. package/dist/server/adapters/ecowitt.js +1 -2
  206. package/dist/server/adapters/tempest.d.ts +10 -13
  207. package/dist/server/adapters/tempest.js +1 -2
  208. package/dist/server/adapters/windnerd-climatology.d.ts +5 -8
  209. package/dist/server/adapters/windnerd-climatology.js +5 -5
  210. package/dist/server/adapters/windnerd-live.d.ts +2 -5
  211. package/dist/server/adapters/windnerd-live.js +4 -4
  212. package/dist/server/adapters/windnerd.d.ts +30 -33
  213. package/dist/server/adapters/windnerd.js +2 -3
  214. package/dist/server/config.d.ts +61 -63
  215. package/dist/server/config.js +1 -2
  216. package/dist/server/environment.d.ts +20 -22
  217. package/dist/server/environment.js +1 -2
  218. package/dist/server/feed.d.ts +19 -21
  219. package/dist/server/feed.js +1 -2
  220. package/dist/server/handler.d.ts +4 -7
  221. package/dist/server/handler.js +1 -2
  222. package/dist/server/hologram.d.ts +9 -12
  223. package/dist/server/hologram.js +3 -3
  224. package/dist/server/live.d.ts +2 -5
  225. package/dist/server/live.js +1 -2
  226. package/dist/sse.js +1 -2
  227. package/dist/strings.d.ts +8 -11
  228. package/dist/strings.js +1 -2
  229. package/dist/windnerd.d.ts +4 -7
  230. package/dist/windnerd.js +1 -2
  231. package/package.json +12 -17
  232. package/schema/README.md +1 -1
  233. package/schema/stationclimatology.schema.json +64 -61
  234. package/schema/stationcurrent.schema.json +68 -156
  235. package/schema/stationfeed.schema.json +71 -163
  236. package/schema/stationhistory.schema.json +37 -46
  237. package/schema/stationlive.schema.json +221 -306
@@ -2,13 +2,14 @@
2
2
  import { resolveDisplay } from "../../display.js";
3
3
  import { readoutAriaLive } from "../../scene/chart.js";
4
4
  import { WIND_CHART_CLASS, windChartGate, windChartScene } from "../../scene/wind-history.js";
5
+ import { renderScene } from "./SceneTree.js";
5
6
  import { requireResolved, resolveStation, useStationFeedContext } from "./StationFeedProvider.js";
6
7
  import { usePinnedCursor } from "../lib/use-pinned-cursor.js";
7
8
  import { Readout } from "./Readout.js";
8
9
  import { useMeasuredChartWidth } from "../hooks/useMeasuredChartWidth.js";
9
10
  import { useId, useRef } from "react";
10
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- //#region src/react/components/WindHistoryChart.tsx
12
+ // src/react/components/WindHistoryChart.tsx
12
13
  function WindHistoryChart({ station: stationProp, stationId, thresholds: thresholdsProp, favorableDirections: favorableDirectionsProp, unit: unitProp, plotHeight, windowHours, compareOffsetDays, nightShading = false, strings: stringsProp, formatTime: formatTimeProp }) {
13
14
  const context = useStationFeedContext();
14
15
  const station = requireResolved("WindHistoryChart", "station", stationProp ?? resolveStation(context, stationId));
@@ -51,11 +52,12 @@ function WindHistoryChart({ station: stationProp, stationId, thresholds: thresho
51
52
  });
52
53
  }
53
54
  function MeasuredChart({ compareOffsetDays, favorableDirections, formatTime, history, night, plotHeight, stationName, thresholds, unit, width, windowHours, words }) {
55
+ const hatchId = `meteo-hatch-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;
54
56
  const scene = windChartScene({
55
57
  compareOffsetDays,
56
58
  favorableDirections,
57
59
  formatTime,
58
- hatchId: `meteo-hatch-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`,
60
+ hatchId,
59
61
  history,
60
62
  night,
61
63
  plotHeight,
@@ -74,187 +76,10 @@ function MeasuredChart({ compareOffsetDays, favorableDirections, formatTime, his
74
76
  className: scene.readout.className,
75
77
  parts: readout.span,
76
78
  strong: readout.strong
77
- }), /* @__PURE__ */ jsxs("svg", {
78
- "aria-label": scene.svg.ariaLabel,
79
- className: scene.svg.className,
80
- height: scene.svg.height,
81
- role: "img",
82
- viewBox: scene.svg.viewBox,
83
- width: scene.svg.width,
84
- children: [
85
- /* @__PURE__ */ jsxs("defs", { children: [/* @__PURE__ */ jsx("pattern", {
86
- height: scene.defs.pattern.height,
87
- id: scene.defs.pattern.id,
88
- patternTransform: scene.defs.pattern.transform,
89
- patternUnits: scene.defs.pattern.units,
90
- width: scene.defs.pattern.width,
91
- children: /* @__PURE__ */ jsx("line", {
92
- className: scene.defs.pattern.line.className,
93
- x1: scene.defs.pattern.line.x1,
94
- x2: scene.defs.pattern.line.x2,
95
- y1: scene.defs.pattern.line.y1,
96
- y2: scene.defs.pattern.line.y2
97
- })
98
- }), /* @__PURE__ */ jsx("clipPath", {
99
- id: scene.defs.clip.id,
100
- children: /* @__PURE__ */ jsx("rect", {
101
- height: scene.defs.clip.rect.height,
102
- width: scene.defs.clip.rect.width,
103
- x: scene.defs.clip.rect.x,
104
- y: scene.defs.clip.rect.y
105
- })
106
- })] }),
107
- scene.zones.map((zone) => /* @__PURE__ */ jsx("rect", {
108
- className: zone.className,
109
- height: zone.height,
110
- width: zone.width,
111
- x: zone.x,
112
- y: zone.y
113
- }, zone.key)),
114
- scene.nightRects.map((rect) => /* @__PURE__ */ jsx("rect", {
115
- className: rect.className,
116
- height: rect.height,
117
- width: rect.width,
118
- x: rect.x,
119
- y: rect.y
120
- }, rect.key)),
121
- scene.grid.map(({ key, line, label }) => /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx("line", {
122
- className: line.className,
123
- x1: line.x1,
124
- x2: line.x2,
125
- y1: line.y1,
126
- y2: line.y2
127
- }), /* @__PURE__ */ jsx("text", {
128
- className: label.className,
129
- textAnchor: label.anchor,
130
- x: label.x,
131
- y: label.y,
132
- children: label.text
133
- })] }, key)),
134
- scene.thresholdGuides.map(({ key, line, label }) => /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx("line", {
135
- className: line.className,
136
- x1: line.x1,
137
- x2: line.x2,
138
- y1: line.y1,
139
- y2: line.y2
140
- }), /* @__PURE__ */ jsx("text", {
141
- className: label.className,
142
- textAnchor: label.anchor,
143
- x: label.x,
144
- y: label.y,
145
- children: label.text
146
- })] }, key)),
147
- scene.vaneGuides.map((guide) => /* @__PURE__ */ jsx("line", {
148
- className: guide.className,
149
- x1: guide.x1,
150
- x2: guide.x2,
151
- y1: guide.y1,
152
- y2: guide.y2
153
- }, `guide-${guide.key}`)),
154
- scene.gaps.map((gap) => /* @__PURE__ */ jsx("rect", {
155
- className: gap.className,
156
- fill: gap.fill,
157
- height: gap.height,
158
- width: gap.width,
159
- x: gap.x,
160
- y: gap.y
161
- }, gap.key)),
162
- scene.band && /* @__PURE__ */ jsx("polygon", {
163
- className: scene.band.className,
164
- points: scene.band.points
165
- }),
166
- scene.compare && /* @__PURE__ */ jsx("polyline", {
167
- className: scene.compare.className,
168
- clipPath: scene.compare.clipPath,
169
- points: scene.compare.points
170
- }),
171
- scene.mean.kind === "polyline" ? /* @__PURE__ */ jsx("polyline", {
172
- className: scene.mean.className,
173
- points: scene.mean.points
174
- }) : scene.mean.segments.map((segment) => /* @__PURE__ */ jsx("line", {
175
- className: segment.className,
176
- x1: segment.x1,
177
- x2: segment.x2,
178
- y1: segment.y1,
179
- y2: segment.y2
180
- }, segment.key)),
181
- scene.calmNote && /* @__PURE__ */ jsx("text", {
182
- className: scene.calmNote.className,
183
- textAnchor: scene.calmNote.anchor,
184
- x: scene.calmNote.x,
185
- y: scene.calmNote.y,
186
- children: scene.calmNote.text
187
- }),
188
- /* @__PURE__ */ jsx("text", {
189
- className: scene.rowLabels.to.className,
190
- textAnchor: scene.rowLabels.to.anchor,
191
- x: scene.rowLabels.to.x,
192
- y: scene.rowLabels.to.y,
193
- children: scene.rowLabels.to.text
194
- }),
195
- scene.vanes.map((vane) => vane.mark.kind === "calm" ? /* @__PURE__ */ jsx("text", {
196
- className: vane.mark.text.className,
197
- textAnchor: vane.mark.text.anchor,
198
- x: vane.mark.text.x,
199
- y: vane.mark.text.y,
200
- children: vane.mark.text.text
201
- }, vane.key) : /* @__PURE__ */ jsx("path", {
202
- className: vane.mark.className,
203
- d: vane.mark.d
204
- }, vane.key)),
205
- scene.vanes.map((vane) => vane.label && /* @__PURE__ */ jsx("text", {
206
- className: vane.label.className,
207
- textAnchor: vane.label.anchor,
208
- x: vane.label.x,
209
- y: vane.label.y,
210
- children: vane.label.text
211
- }, `label-${vane.key}`)),
212
- /* @__PURE__ */ jsx("text", {
213
- className: scene.rowLabels.avg.className,
214
- textAnchor: scene.rowLabels.avg.anchor,
215
- x: scene.rowLabels.avg.x,
216
- y: scene.rowLabels.avg.y,
217
- children: scene.rowLabels.avg.text
218
- }),
219
- scene.vanes.map((vane) => vane.value && /* @__PURE__ */ jsx("text", {
220
- className: vane.value.className,
221
- textAnchor: vane.value.anchor,
222
- x: vane.value.x,
223
- y: vane.value.y,
224
- children: vane.value.text
225
- }, `value-${vane.key}`)),
226
- scene.ticks.map((tick) => /* @__PURE__ */ jsx("text", {
227
- className: tick.className,
228
- textAnchor: tick.anchor,
229
- x: tick.x,
230
- y: tick.y,
231
- children: tick.text
232
- }, tick.key)),
233
- cursor && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("line", {
234
- className: cursor.line.className,
235
- x1: cursor.line.x1,
236
- x2: cursor.line.x2,
237
- y1: cursor.line.y1,
238
- y2: cursor.line.y2
239
- }), /* @__PURE__ */ jsx("circle", {
240
- className: cursor.dot.className,
241
- cx: cursor.dot.cx,
242
- cy: cursor.dot.cy,
243
- r: cursor.dot.r
244
- })] }),
245
- /* @__PURE__ */ jsx("rect", {
246
- className: scene.hit.className,
247
- fill: scene.hit.fill,
248
- height: scene.hit.height,
249
- onClick: pinned.handleClick,
250
- onPointerLeave: pinned.handlePointerLeave,
251
- onPointerMove: pinned.handlePointerMove,
252
- width: scene.hit.width,
253
- x: scene.hit.x,
254
- y: scene.hit.y
255
- })
256
- ]
257
- })] });
79
+ }), renderScene(scene.draw(cursor, {
80
+ onClick: pinned.handleClick,
81
+ onPointerLeave: pinned.handlePointerLeave,
82
+ onPointerMove: pinned.handlePointerMove
83
+ }))] });
258
84
  }
259
- //#endregion
260
85
  export { WindHistoryChart };
@@ -3,10 +3,7 @@ import { SpeedThresholds } from "../../derive.js";
3
3
  import { StationStringOverrides } from "../../strings.js";
4
4
  import { FavorableDirection } from "../../instruments.js";
5
5
  import "../../index.js";
6
- import "../../scene/index.js";
7
- import { ReactNode } from "react";
8
- //#region src/react/components/WindRose.d.ts
9
- declare function WindRose({ station: stationProp, stationId, points, sectorCount, thresholds: thresholdsProp, favorableDirections: favorableDirectionsProp, strings: stringsProp }: {
6
+ export declare function WindRose({ station: stationProp, stationId, points, sectorCount, thresholds: thresholdsProp, favorableDirections: favorableDirectionsProp, strings: stringsProp }: {
10
7
  station?: Station;
11
8
  stationId?: string;
12
9
  points?: HistoryPoint[];
@@ -14,6 +11,4 @@ declare function WindRose({ station: stationProp, stationId, points, sectorCount
14
11
  thresholds?: SpeedThresholds | null;
15
12
  favorableDirections?: FavorableDirection[] | null;
16
13
  strings?: StationStringOverrides;
17
- }): import("react").JSX.Element;
18
- //#endregion
19
- export { WindRose };
14
+ }): import("react").ReactNode;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { resolveDisplay } from "../../display.js";
3
- import { windRoseGate, windRoseScene, windRoseSource } from "../../scene/rose.js";
3
+ import { windRoseScene, windRoseSource } from "../../scene/rose.js";
4
+ import { renderScene } from "./SceneTree.js";
4
5
  import { resolveStation, useStationFeedContext } from "./StationFeedProvider.js";
5
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
- //#region src/react/components/WindRose.tsx
6
+ // src/react/components/WindRose.tsx
7
7
  function WindRose({ station: stationProp, stationId, points, sectorCount = 16, thresholds: thresholdsProp, favorableDirections: favorableDirectionsProp, strings: stringsProp }) {
8
8
  const context = useStationFeedContext();
9
9
  const station = stationProp ?? (points == null ? resolveStation(context, stationId) ?? void 0 : void 0);
@@ -12,97 +12,13 @@ function WindRose({ station: stationProp, stationId, points, sectorCount = 16, t
12
12
  thresholds: thresholdsProp,
13
13
  favorableDirections: favorableDirectionsProp
14
14
  });
15
- const source = windRoseSource(points, station);
16
- const gate = windRoseGate(source, words);
17
- if (gate.kind === "note") return /* @__PURE__ */ jsx("div", {
18
- className: gate.className,
19
- role: "note",
20
- children: gate.text
21
- });
22
- return /* @__PURE__ */ jsx(WindRoseSceneView, { scene: windRoseScene({
15
+ return renderScene(windRoseScene({
23
16
  favorableDirections,
24
17
  sectorCount,
25
- source,
18
+ source: windRoseSource(points, station),
26
19
  stationName: station?.name,
27
20
  thresholds,
28
21
  words
29
- }) });
30
- }
31
- /** One scene, one drawing — shared by the history-fed rose above and the
32
- * climatology-fed twin, which appends its caption row as children. */
33
- function WindRoseSceneView({ scene, children }) {
34
- return /* @__PURE__ */ jsxs("div", {
35
- className: scene.className,
36
- children: [
37
- /* @__PURE__ */ jsxs("svg", {
38
- "aria-label": scene.svg.ariaLabel,
39
- className: scene.svg.className,
40
- height: scene.svg.height,
41
- role: "img",
42
- viewBox: scene.svg.viewBox,
43
- width: scene.svg.width,
44
- children: [
45
- scene.gridCircles.map((circle) => /* @__PURE__ */ jsx("circle", {
46
- className: circle.className,
47
- cx: circle.cx,
48
- cy: circle.cy,
49
- r: circle.r
50
- }, circle.key)),
51
- scene.ring && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("circle", {
52
- className: scene.ring.unfavorable.className,
53
- cx: scene.ring.unfavorable.cx,
54
- cy: scene.ring.unfavorable.cy,
55
- r: scene.ring.unfavorable.r
56
- }), scene.ring.favorable.map((arc) => /* @__PURE__ */ jsx("path", {
57
- className: arc.className,
58
- d: arc.d
59
- }, arc.key))] }),
60
- scene.ticks.map((tick) => /* @__PURE__ */ jsx("line", {
61
- className: tick.className,
62
- x1: tick.x1,
63
- x2: tick.x2,
64
- y1: tick.y1,
65
- y2: tick.y2
66
- }, tick.key)),
67
- scene.letters.map((letter) => /* @__PURE__ */ jsx("text", {
68
- className: letter.className,
69
- textAnchor: letter.anchor,
70
- x: letter.x,
71
- y: letter.y,
72
- children: letter.text
73
- }, letter.key)),
74
- scene.petals.map((petal) => /* @__PURE__ */ jsx("path", {
75
- className: petal.className,
76
- d: petal.d
77
- }, petal.key)),
78
- scene.ringLabel && /* @__PURE__ */ jsx("text", {
79
- className: scene.ringLabel.className,
80
- textAnchor: scene.ringLabel.anchor,
81
- x: scene.ringLabel.x,
82
- y: scene.ringLabel.y,
83
- children: scene.ringLabel.text
84
- }),
85
- /* @__PURE__ */ jsx("circle", {
86
- className: scene.hub.className,
87
- cx: scene.hub.cx,
88
- cy: scene.hub.cy,
89
- r: scene.hub.r
90
- }),
91
- /* @__PURE__ */ jsx("circle", {
92
- className: scene.dot.className,
93
- cx: scene.dot.cx,
94
- cy: scene.dot.cy,
95
- r: scene.dot.r
96
- })
97
- ]
98
- }),
99
- scene.calmCaption && /* @__PURE__ */ jsx("p", {
100
- className: scene.calmCaption.className,
101
- children: scene.calmCaption.text
102
- }),
103
- children
104
- ]
105
- });
22
+ }));
106
23
  }
107
- //#endregion
108
- export { WindRose, WindRoseSceneView };
24
+ export { WindRose };
@@ -3,8 +3,7 @@ import { SpeedUnit } from "../../derive.js";
3
3
  import { FormatTime, StationStringOverrides } from "../../strings.js";
4
4
  import { FavorableDirection } from "../../instruments.js";
5
5
  import "../../index.js";
6
- //#region src/react/components/WindSampleStrip.d.ts
7
- declare function WindSampleStrip({ samples, stationName, unit: unitProp, favorableDirections: favorableDirectionsProp, plotHeight, strings: stringsProp, formatTime: formatTimeProp }: {
6
+ export declare function WindSampleStrip({ samples, stationName, unit: unitProp, favorableDirections: favorableDirectionsProp, plotHeight, strings: stringsProp, formatTime: formatTimeProp }: {
8
7
  samples: LiveSamples | null | undefined;
9
8
  stationName: string;
10
9
  unit?: SpeedUnit;
@@ -12,6 +11,4 @@ declare function WindSampleStrip({ samples, stationName, unit: unitProp, favorab
12
11
  plotHeight?: number;
13
12
  strings?: StationStringOverrides;
14
13
  formatTime?: FormatTime;
15
- }): import("react").JSX.Element;
16
- //#endregion
17
- export { WindSampleStrip };
14
+ }): import("react").JSX.Element;
@@ -2,15 +2,17 @@
2
2
  import { resolveDisplay } from "../../display.js";
3
3
  import { readoutAriaLive } from "../../scene/chart.js";
4
4
  import { SAMPLE_STRIP_CLASS, sampleStripGate, sampleStripScene } from "../../scene/sample-strip.js";
5
+ import { renderScene } from "./SceneTree.js";
5
6
  import { useStationFeedContext } from "./StationFeedProvider.js";
6
7
  import { usePinnedCursor } from "../lib/use-pinned-cursor.js";
7
8
  import { Readout } from "./Readout.js";
8
9
  import { useMeasuredChartWidth } from "../hooks/useMeasuredChartWidth.js";
9
10
  import { useRef } from "react";
10
11
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
- //#region src/react/components/WindSampleStrip.tsx
12
+ // src/react/components/WindSampleStrip.tsx
12
13
  function WindSampleStrip({ samples, stationName, unit: unitProp, favorableDirections: favorableDirectionsProp, plotHeight, strings: stringsProp, formatTime: formatTimeProp }) {
13
- const { favorableDirections, formatTime, unit, words } = resolveDisplay(useStationFeedContext(), {
14
+ const context = useStationFeedContext();
15
+ const { favorableDirections, formatTime, unit, words } = resolveDisplay(context, {
14
16
  formatTime: formatTimeProp,
15
17
  strings: stringsProp,
16
18
  favorableDirections: favorableDirectionsProp,
@@ -58,120 +60,10 @@ function MeasuredStrip({ favorableDirections, formatTime, plotHeight, samples, s
58
60
  className: scene.readout.className,
59
61
  parts: readout.span,
60
62
  strong: readout.strong
61
- }), /* @__PURE__ */ jsxs("svg", {
62
- "aria-label": scene.svg.ariaLabel,
63
- className: scene.svg.className,
64
- height: scene.svg.height,
65
- role: "img",
66
- viewBox: scene.svg.viewBox,
67
- width: scene.svg.width,
68
- children: [
69
- scene.grid.map(({ key, line, label }) => /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx("line", {
70
- className: line.className,
71
- x1: line.x1,
72
- x2: line.x2,
73
- y1: line.y1,
74
- y2: line.y2
75
- }), /* @__PURE__ */ jsx("text", {
76
- className: label.className,
77
- textAnchor: label.anchor,
78
- x: label.x,
79
- y: label.y,
80
- children: label.text
81
- })] }, key)),
82
- scene.vaneGuides.map((guide) => /* @__PURE__ */ jsx("line", {
83
- className: guide.className,
84
- x1: guide.x1,
85
- x2: guide.x2,
86
- y1: guide.y1,
87
- y2: guide.y2
88
- }, `guide-${guide.key}`)),
89
- scene.trace.map((part) => part.kind === "dot" ? /* @__PURE__ */ jsx("circle", {
90
- className: part.className,
91
- cx: part.cx,
92
- cy: part.cy,
93
- r: part.r
94
- }, part.key) : /* @__PURE__ */ jsx("polyline", {
95
- className: part.className,
96
- points: part.points
97
- }, part.key)),
98
- scene.calmNote && /* @__PURE__ */ jsx("text", {
99
- className: scene.calmNote.className,
100
- textAnchor: scene.calmNote.anchor,
101
- x: scene.calmNote.x,
102
- y: scene.calmNote.y,
103
- children: scene.calmNote.text
104
- }),
105
- /* @__PURE__ */ jsx("text", {
106
- className: scene.rowLabels.to.className,
107
- textAnchor: scene.rowLabels.to.anchor,
108
- x: scene.rowLabels.to.x,
109
- y: scene.rowLabels.to.y,
110
- children: scene.rowLabels.to.text
111
- }),
112
- scene.vanes.map((vane) => vane.mark.kind === "calm" ? /* @__PURE__ */ jsx("text", {
113
- className: vane.mark.text.className,
114
- textAnchor: vane.mark.text.anchor,
115
- x: vane.mark.text.x,
116
- y: vane.mark.text.y,
117
- children: vane.mark.text.text
118
- }, vane.key) : /* @__PURE__ */ jsx("path", {
119
- className: vane.mark.className,
120
- d: vane.mark.d
121
- }, vane.key)),
122
- scene.vanes.map((vane) => vane.label && /* @__PURE__ */ jsx("text", {
123
- className: vane.label.className,
124
- textAnchor: vane.label.anchor,
125
- x: vane.label.x,
126
- y: vane.label.y,
127
- children: vane.label.text
128
- }, `label-${vane.key}`)),
129
- /* @__PURE__ */ jsx("text", {
130
- className: scene.rowLabels.avg.className,
131
- textAnchor: scene.rowLabels.avg.anchor,
132
- x: scene.rowLabels.avg.x,
133
- y: scene.rowLabels.avg.y,
134
- children: scene.rowLabels.avg.text
135
- }),
136
- scene.vanes.map((vane) => vane.value && /* @__PURE__ */ jsx("text", {
137
- className: vane.value.className,
138
- textAnchor: vane.value.anchor,
139
- x: vane.value.x,
140
- y: vane.value.y,
141
- children: vane.value.text
142
- }, `value-${vane.key}`)),
143
- scene.ticks.map((tick) => /* @__PURE__ */ jsx("text", {
144
- className: tick.className,
145
- textAnchor: tick.anchor,
146
- x: tick.x,
147
- y: tick.y,
148
- children: tick.text
149
- }, tick.key)),
150
- cursor && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("line", {
151
- className: cursor.line.className,
152
- x1: cursor.line.x1,
153
- x2: cursor.line.x2,
154
- y1: cursor.line.y1,
155
- y2: cursor.line.y2
156
- }), /* @__PURE__ */ jsx("circle", {
157
- className: cursor.dot.className,
158
- cx: cursor.dot.cx,
159
- cy: cursor.dot.cy,
160
- r: cursor.dot.r
161
- })] }),
162
- /* @__PURE__ */ jsx("rect", {
163
- className: scene.hit.className,
164
- fill: scene.hit.fill,
165
- height: scene.hit.height,
166
- onClick: pinned.handleClick,
167
- onPointerLeave: pinned.handlePointerLeave,
168
- onPointerMove: pinned.handlePointerMove,
169
- width: scene.hit.width,
170
- x: scene.hit.x,
171
- y: scene.hit.y
172
- })
173
- ]
174
- })] });
63
+ }), renderScene(scene.draw(cursor, {
64
+ onClick: pinned.handleClick,
65
+ onPointerLeave: pinned.handlePointerLeave,
66
+ onPointerMove: pinned.handlePointerMove
67
+ }))] });
175
68
  }
176
- //#endregion
177
69
  export { WindSampleStrip };
@@ -3,7 +3,6 @@ import { SpeedThresholds, SpeedUnit } from "../../derive.js";
3
3
  import { FormatTime, StationStringOverrides } from "../../strings.js";
4
4
  import { FavorableDirection } from "../../instruments.js";
5
5
  import "../../index.js";
6
- //#region src/react/components/atoms.d.ts
7
6
  type AtomProps = {
8
7
  station?: Station;
9
8
  stationId?: string;
@@ -12,25 +11,24 @@ type AtomProps = {
12
11
  type SpeedAtomProps = AtomProps & {
13
12
  unit?: SpeedUnit;
14
13
  };
15
- declare function Speed(props: SpeedAtomProps): import("react").JSX.Element;
16
- declare function Gust(props: SpeedAtomProps): import("react").JSX.Element;
17
- declare function Lull(props: SpeedAtomProps): import("react").JSX.Element;
18
- declare function Temperature({ station: stationProp, stationId, strings: stringsProp }: AtomProps): import("react").JSX.Element;
19
- declare function Pressure({ station: stationProp, stationId, strings: stringsProp }: AtomProps): import("react").JSX.Element;
20
- declare function Direction({ station: stationProp, stationId, strings: stringsProp, favorableDirections: favorableDirectionsProp }: AtomProps & {
14
+ export declare function Speed(props: SpeedAtomProps): import("react").JSX.Element;
15
+ export declare function Gust(props: SpeedAtomProps): import("react").JSX.Element;
16
+ export declare function Lull(props: SpeedAtomProps): import("react").JSX.Element;
17
+ export declare function Temperature({ station: stationProp, stationId, strings: stringsProp }: AtomProps): import("react").ReactNode;
18
+ export declare function Pressure({ station: stationProp, stationId, strings: stringsProp }: AtomProps): import("react").ReactNode;
19
+ export declare function Direction({ station: stationProp, stationId, strings: stringsProp, favorableDirections: favorableDirectionsProp }: AtomProps & {
21
20
  favorableDirections?: FavorableDirection[] | null;
22
- }): import("react").JSX.Element;
23
- declare function UpdatedAt({ station: stationProp, stationId, servedAt: servedAtProp, receivedAtMs: receivedAtMsProp, strings: stringsProp, formatTime: formatTimeProp }: {
21
+ }): import("react").ReactNode;
22
+ export declare function UpdatedAt({ station: stationProp, stationId, servedAt: servedAtProp, receivedAtMs: receivedAtMsProp, strings: stringsProp, formatTime: formatTimeProp }: {
24
23
  station?: Station;
25
24
  stationId?: string;
26
25
  servedAt?: string | null;
27
26
  receivedAtMs?: number | null;
28
27
  strings?: StationStringOverrides;
29
28
  formatTime?: FormatTime;
30
- }): import("react").JSX.Element;
31
- declare function BandChip({ station: stationProp, stationId, thresholds: thresholdsProp, labels, unit: unitProp, strings: stringsProp }: SpeedAtomProps & {
29
+ }): import("react").ReactNode;
30
+ export declare function BandChip({ station: stationProp, stationId, thresholds: thresholdsProp, labels, unit: unitProp, strings: stringsProp }: SpeedAtomProps & {
32
31
  thresholds?: SpeedThresholds | null;
33
32
  labels?: readonly string[];
34
- }): import("react").JSX.Element;
35
- //#endregion
36
- export { BandChip, Direction, Gust, Lull, Pressure, Speed, Temperature, UpdatedAt };
33
+ }): import("react").ReactNode;
34
+ export {};