@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.
- package/README.md +17 -17
- package/dist/air.d.ts +4 -7
- package/dist/air.js +1 -2
- package/dist/client/climatology.d.ts +4 -7
- package/dist/client/climatology.js +1 -2
- package/dist/client/history.d.ts +14 -17
- package/dist/client/history.js +1 -2
- package/dist/client/live.d.ts +9 -11
- package/dist/client/live.js +1 -2
- package/dist/client/poll.d.ts +9 -12
- package/dist/client/poll.js +1 -2
- package/dist/client/stores.d.ts +8 -10
- package/dist/client/stores.js +1 -2
- package/dist/client/ticker.d.ts +1 -4
- package/dist/client/ticker.js +1 -2
- package/dist/climatology.d.ts +13 -15
- package/dist/climatology.js +1 -2
- package/dist/connectivity.d.ts +9 -12
- package/dist/connectivity.js +1 -2
- package/dist/contract-climatology.d.ts +11 -14
- package/dist/contract-climatology.js +1 -2
- package/dist/contract.d.ts +148 -151
- package/dist/contract.js +1 -2
- package/dist/derive.d.ts +24 -26
- package/dist/derive.js +5 -6
- package/dist/display.d.ts +6 -9
- package/dist/display.js +1 -2
- package/dist/elements/elements/AirExtremesElement.d.ts +2 -5
- package/dist/elements/elements/AirExtremesElement.js +6 -20
- package/dist/elements/elements/AirMatrixElement.d.ts +2 -5
- package/dist/elements/elements/AirMatrixElement.js +7 -33
- package/dist/elements/elements/ClimatologyDailyPatternElement.d.ts +2 -5
- package/dist/elements/elements/ClimatologyDailyPatternElement.js +18 -14
- package/dist/elements/elements/ClimatologyRoseElement.d.ts +2 -5
- package/dist/elements/elements/ClimatologyRoseElement.js +6 -17
- package/dist/elements/elements/CompassFanElement.d.ts +2 -5
- package/dist/elements/elements/CompassFanElement.js +6 -66
- package/dist/elements/elements/CurrentConditionsElement.d.ts +2 -5
- package/dist/elements/elements/CurrentConditionsElement.js +8 -28
- package/dist/elements/elements/DailyPatternElement.d.ts +2 -6
- package/dist/elements/elements/DailyPatternElement.js +7 -122
- package/dist/elements/elements/DialElement.d.ts +2 -5
- package/dist/elements/elements/DialElement.js +4 -97
- package/dist/elements/elements/FavorableShareElement.d.ts +2 -5
- package/dist/elements/elements/FavorableShareElement.js +7 -23
- package/dist/elements/elements/FreshnessBadgeElement.d.ts +2 -5
- package/dist/elements/elements/FreshnessBadgeElement.js +1 -2
- package/dist/elements/elements/RecentSummariesElement.d.ts +2 -5
- package/dist/elements/elements/RecentSummariesElement.js +7 -25
- package/dist/elements/elements/SparklineElement.d.ts +2 -6
- package/dist/elements/elements/SparklineElement.js +5 -41
- package/dist/elements/elements/StationCardElement.d.ts +6 -8
- package/dist/elements/elements/StationCardElement.js +5 -20
- package/dist/elements/elements/StationFeedElement.d.ts +2 -5
- package/dist/elements/elements/StationFeedElement.js +5 -4
- package/dist/elements/elements/StationStripElement.d.ts +2 -5
- package/dist/elements/elements/StationStripElement.js +5 -20
- package/dist/elements/elements/StationTableElement.d.ts +3 -6
- package/dist/elements/elements/StationTableElement.js +16 -53
- package/dist/elements/elements/TrendChartElement.d.ts +2 -5
- package/dist/elements/elements/TrendChartElement.js +22 -71
- package/dist/elements/elements/WindArrowElement.d.ts +2 -5
- package/dist/elements/elements/WindArrowElement.js +1 -2
- package/dist/elements/elements/WindHistoryChartElement.d.ts +2 -5
- package/dist/elements/elements/WindHistoryChartElement.js +24 -166
- package/dist/elements/elements/WindRoseElement.d.ts +2 -6
- package/dist/elements/elements/WindRoseElement.js +7 -72
- package/dist/elements/elements/atoms.d.ts +10 -12
- package/dist/elements/elements/atoms.js +12 -40
- package/dist/elements/index.d.ts +3 -5
- package/dist/elements/index.js +4 -5
- package/dist/elements/lib/ambient.d.ts +2 -5
- package/dist/elements/lib/ambient.js +1 -2
- package/dist/elements/lib/attributes.js +1 -2
- package/dist/elements/lib/base.d.ts +3 -6
- package/dist/elements/lib/base.js +1 -2
- package/dist/elements/lib/context.js +1 -2
- package/dist/elements/lib/fragments.js +9 -39
- package/dist/elements/lib/h.js +2 -3
- package/dist/elements/lib/pinned-cursor.js +1 -2
- package/dist/elements/lib/render.js +29 -0
- package/dist/elements/register.js +1 -2
- package/dist/endpoints.d.ts +6 -9
- package/dist/endpoints.js +1 -2
- package/dist/fixtures.d.ts +7 -10
- package/dist/fixtures.js +1 -2
- package/dist/format.d.ts +11 -14
- package/dist/format.js +1 -2
- package/dist/geometry.d.ts +36 -38
- package/dist/geometry.js +3 -3
- package/dist/instruments.d.ts +37 -40
- package/dist/instruments.js +3 -4
- package/dist/merge-current.d.ts +4 -7
- package/dist/merge-current.js +1 -2
- package/dist/react/components/AirExtremes.d.ts +2 -5
- package/dist/react/components/AirExtremes.js +6 -24
- package/dist/react/components/AirMatrix.d.ts +2 -5
- package/dist/react/components/AirMatrix.js +11 -45
- package/dist/react/components/ClimatologyDailyPattern.d.ts +2 -5
- package/dist/react/components/ClimatologyDailyPattern.js +20 -15
- package/dist/react/components/ClimatologyRose.d.ts +2 -5
- package/dist/react/components/ClimatologyRose.js +12 -30
- package/dist/react/components/CompassFan.d.ts +2 -5
- package/dist/react/components/CompassFan.js +7 -75
- package/dist/react/components/CurrentConditions.d.ts +2 -5
- package/dist/react/components/CurrentConditions.js +12 -76
- package/dist/react/components/DailyPattern.d.ts +3 -8
- package/dist/react/components/DailyPattern.js +11 -151
- package/dist/react/components/Dial.d.ts +2 -5
- package/dist/react/components/Dial.js +6 -120
- package/dist/react/components/FavorableShare.d.ts +2 -5
- package/dist/react/components/FavorableShare.js +7 -29
- package/dist/react/components/FreshnessBadge.d.ts +2 -5
- package/dist/react/components/FreshnessBadge.js +6 -14
- package/dist/react/components/Readout.d.ts +2 -5
- package/dist/react/components/Readout.js +1 -2
- package/dist/react/components/RecentSummaries.d.ts +2 -5
- package/dist/react/components/RecentSummaries.js +7 -46
- package/dist/react/components/SceneTree.js +37 -0
- package/dist/react/components/Sparkline.d.ts +2 -5
- package/dist/react/components/Sparkline.js +4 -41
- package/dist/react/components/StationCard.d.ts +8 -10
- package/dist/react/components/StationCard.js +6 -47
- package/dist/react/components/StationFeedProvider.d.ts +3 -6
- package/dist/react/components/StationFeedProvider.js +1 -2
- package/dist/react/components/StationStrip.d.ts +2 -5
- package/dist/react/components/StationStrip.js +6 -62
- package/dist/react/components/StationTable.d.ts +3 -6
- package/dist/react/components/StationTable.js +22 -77
- package/dist/react/components/TrendChart.d.ts +2 -5
- package/dist/react/components/TrendChart.js +9 -65
- package/dist/react/components/WindArrow.d.ts +2 -5
- package/dist/react/components/WindArrow.js +4 -17
- package/dist/react/components/WindHistoryChart.d.ts +2 -5
- package/dist/react/components/WindHistoryChart.js +9 -184
- package/dist/react/components/WindRose.d.ts +2 -7
- package/dist/react/components/WindRose.js +7 -91
- package/dist/react/components/WindSampleStrip.d.ts +2 -5
- package/dist/react/components/WindSampleStrip.js +9 -117
- package/dist/react/components/atoms.d.ts +12 -14
- package/dist/react/components/atoms.js +13 -50
- package/dist/react/hooks/useFreshness.d.ts +1 -4
- package/dist/react/hooks/useFreshness.js +1 -2
- package/dist/react/hooks/useMeasuredChartWidth.d.ts +2 -5
- package/dist/react/hooks/useMeasuredChartWidth.js +1 -2
- package/dist/react/hooks/usePolledJson.js +1 -2
- package/dist/react/hooks/useStation.d.ts +2 -5
- package/dist/react/hooks/useStation.js +1 -2
- package/dist/react/hooks/useStationClimatology.d.ts +2 -5
- package/dist/react/hooks/useStationClimatology.js +1 -2
- package/dist/react/hooks/useStationCurrent.d.ts +2 -5
- package/dist/react/hooks/useStationCurrent.js +4 -4
- package/dist/react/hooks/useStationFeed.d.ts +2 -5
- package/dist/react/hooks/useStationFeed.js +4 -4
- package/dist/react/hooks/useStationLive.d.ts +2 -5
- package/dist/react/hooks/useStationLive.js +1 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +5 -5
- package/dist/react/lib/cells.js +5 -26
- package/dist/react/lib/use-pinned-cursor.js +1 -2
- package/dist/samples.d.ts +8 -11
- package/dist/samples.js +1 -2
- package/dist/scene/air-extremes.js +13 -29
- package/dist/scene/air-matrix.js +46 -60
- package/dist/scene/atoms.js +1 -2
- package/dist/scene/card.js +15 -42
- package/dist/scene/cells.d.ts +4 -0
- package/dist/scene/cells.js +50 -0
- package/dist/scene/chart.d.ts +2 -5
- package/dist/scene/chart.js +3 -3
- package/dist/scene/climatology-pattern.d.ts +1 -2
- package/dist/scene/climatology-pattern.js +11 -13
- package/dist/scene/climatology-rose.d.ts +1 -2
- package/dist/scene/climatology-rose.js +15 -35
- package/dist/scene/compass-fan.js +29 -102
- package/dist/scene/current.d.ts +2 -1
- package/dist/scene/current.js +30 -58
- package/dist/scene/daily-pattern.d.ts +1 -3
- package/dist/scene/daily-pattern.js +21 -29
- package/dist/scene/dial-parts.d.ts +1 -0
- package/dist/scene/dial-parts.js +69 -0
- package/dist/scene/dial.d.ts +1 -2
- package/dist/scene/dial.js +49 -138
- package/dist/scene/favorable-share.js +17 -35
- package/dist/scene/glyphs.js +21 -18
- package/dist/scene/index.d.ts +5 -3
- package/dist/scene/node.js +18 -0
- package/dist/scene/recent-summaries.js +27 -65
- package/dist/scene/rose.js +90 -119
- package/dist/scene/sample-strip.d.ts +1 -2
- package/dist/scene/sample-strip.js +36 -38
- package/dist/scene/sparkline.js +32 -42
- package/dist/scene/strip.js +19 -59
- package/dist/scene/table.js +48 -71
- package/dist/scene/trend.d.ts +1 -2
- package/dist/scene/trend.js +30 -57
- package/dist/scene/wind-history.d.ts +1 -2
- package/dist/scene/wind-history.js +42 -53
- package/dist/scene/wind-plot.js +71 -142
- package/dist/server/adapter.d.ts +7 -10
- package/dist/server/adapter.js +1 -2
- package/dist/server/adapters/campbell.d.ts +18 -20
- package/dist/server/adapters/campbell.js +2 -3
- package/dist/server/adapters/ecowitt.d.ts +12 -15
- package/dist/server/adapters/ecowitt.js +1 -2
- package/dist/server/adapters/tempest.d.ts +10 -13
- package/dist/server/adapters/tempest.js +1 -2
- package/dist/server/adapters/windnerd-climatology.d.ts +5 -8
- package/dist/server/adapters/windnerd-climatology.js +5 -5
- package/dist/server/adapters/windnerd-live.d.ts +2 -5
- package/dist/server/adapters/windnerd-live.js +4 -4
- package/dist/server/adapters/windnerd.d.ts +30 -33
- package/dist/server/adapters/windnerd.js +2 -3
- package/dist/server/config.d.ts +61 -63
- package/dist/server/config.js +1 -2
- package/dist/server/environment.d.ts +20 -22
- package/dist/server/environment.js +1 -2
- package/dist/server/feed.d.ts +19 -21
- package/dist/server/feed.js +1 -2
- package/dist/server/handler.d.ts +4 -7
- package/dist/server/handler.js +1 -2
- package/dist/server/hologram.d.ts +9 -12
- package/dist/server/hologram.js +3 -3
- package/dist/server/live.d.ts +2 -5
- package/dist/server/live.js +1 -2
- package/dist/sse.js +1 -2
- package/dist/strings.d.ts +8 -11
- package/dist/strings.js +1 -2
- package/dist/windnerd.d.ts +4 -7
- package/dist/windnerd.js +1 -2
- package/package.json +12 -17
- package/schema/README.md +1 -1
- package/schema/stationclimatology.schema.json +64 -61
- package/schema/stationcurrent.schema.json +68 -156
- package/schema/stationfeed.schema.json +71 -163
- package/schema/stationhistory.schema.json +37 -46
- package/schema/stationlive.schema.json +221 -306
|
@@ -3,8 +3,9 @@ import { measuredChartWidth } from "../../geometry.js";
|
|
|
3
3
|
import { DAILY_PATTERN_CLASS, dailyPatternGate, dailyPatternScene, dailyPatternSource } from "../../scene/daily-pattern.js";
|
|
4
4
|
import { numberAttribute } from "../lib/attributes.js";
|
|
5
5
|
import { MeteoStationElement } from "../lib/base.js";
|
|
6
|
-
import { h
|
|
7
|
-
|
|
6
|
+
import { h } from "../lib/h.js";
|
|
7
|
+
import { renderChildren } from "../lib/render.js";
|
|
8
|
+
// src/elements/elements/DailyPatternElement.ts
|
|
8
9
|
let hatchCounter = 0;
|
|
9
10
|
var DailyPatternElement = class extends MeteoStationElement {
|
|
10
11
|
static observedAttributes = [
|
|
@@ -71,7 +72,7 @@ var DailyPatternElement = class extends MeteoStationElement {
|
|
|
71
72
|
this.#observer.observe(wrap);
|
|
72
73
|
}
|
|
73
74
|
#buildChart(wrap, points, periodMinutes, thresholds, favorableDirections, unit, words, width, stationName) {
|
|
74
|
-
const
|
|
75
|
+
const scene = dailyPatternScene({
|
|
75
76
|
favorableDirections,
|
|
76
77
|
hatchId: `meteo-daily-pattern-hatch-e${++hatchCounter}`,
|
|
77
78
|
periodMinutes,
|
|
@@ -84,124 +85,8 @@ var DailyPatternElement = class extends MeteoStationElement {
|
|
|
84
85
|
utcOffsetMinutes: numberAttribute(this.getAttribute("utc-offset-minutes")) ?? 0,
|
|
85
86
|
width,
|
|
86
87
|
words
|
|
87
|
-
})
|
|
88
|
-
wrap.replaceChildren(
|
|
88
|
+
});
|
|
89
|
+
wrap.replaceChildren(...renderChildren(scene));
|
|
89
90
|
}
|
|
90
91
|
};
|
|
91
|
-
|
|
92
|
-
* climatology-fed twin. */
|
|
93
|
-
function dailyPatternSceneDom(scene) {
|
|
94
|
-
return {
|
|
95
|
-
caption: h("output", { class: scene.caption.className }, scene.caption.text),
|
|
96
|
-
svg: hs("svg", {
|
|
97
|
-
"aria-label": scene.svg.ariaLabel,
|
|
98
|
-
class: scene.svg.className,
|
|
99
|
-
height: scene.svg.height,
|
|
100
|
-
role: "img",
|
|
101
|
-
viewBox: scene.svg.viewBox,
|
|
102
|
-
width: scene.svg.width
|
|
103
|
-
}, hs("defs", null, hs("pattern", {
|
|
104
|
-
height: scene.defs.pattern.height,
|
|
105
|
-
id: scene.defs.pattern.id,
|
|
106
|
-
patternTransform: scene.defs.pattern.transform,
|
|
107
|
-
patternUnits: scene.defs.pattern.units,
|
|
108
|
-
width: scene.defs.pattern.width
|
|
109
|
-
}, hs("line", {
|
|
110
|
-
class: scene.defs.pattern.line.className,
|
|
111
|
-
x1: scene.defs.pattern.line.x1,
|
|
112
|
-
x2: scene.defs.pattern.line.x2,
|
|
113
|
-
y1: scene.defs.pattern.line.y1,
|
|
114
|
-
y2: scene.defs.pattern.line.y2
|
|
115
|
-
}))), scene.zones.map((zone) => hs("rect", {
|
|
116
|
-
class: zone.className,
|
|
117
|
-
height: zone.height,
|
|
118
|
-
width: zone.width,
|
|
119
|
-
x: zone.x,
|
|
120
|
-
y: zone.y
|
|
121
|
-
})), scene.grid.map(({ line, label }) => hs("g", null, hs("line", {
|
|
122
|
-
class: line.className,
|
|
123
|
-
x1: line.x1,
|
|
124
|
-
x2: line.x2,
|
|
125
|
-
y1: line.y1,
|
|
126
|
-
y2: line.y2
|
|
127
|
-
}), hs("text", {
|
|
128
|
-
class: label.className,
|
|
129
|
-
"text-anchor": label.anchor,
|
|
130
|
-
x: label.x,
|
|
131
|
-
y: label.y
|
|
132
|
-
}, label.text))), scene.thresholdGuides.map(({ line, label }) => hs("g", null, hs("line", {
|
|
133
|
-
class: line.className,
|
|
134
|
-
x1: line.x1,
|
|
135
|
-
x2: line.x2,
|
|
136
|
-
y1: line.y1,
|
|
137
|
-
y2: line.y2
|
|
138
|
-
}), hs("text", {
|
|
139
|
-
class: label.className,
|
|
140
|
-
"text-anchor": label.anchor,
|
|
141
|
-
x: label.x,
|
|
142
|
-
y: label.y
|
|
143
|
-
}, label.text))), scene.vaneGuides.map((guide) => hs("line", {
|
|
144
|
-
class: guide.className,
|
|
145
|
-
x1: guide.x1,
|
|
146
|
-
x2: guide.x2,
|
|
147
|
-
y1: guide.y1,
|
|
148
|
-
y2: guide.y2
|
|
149
|
-
})), scene.gaps.map((gap) => hs("rect", {
|
|
150
|
-
class: gap.className,
|
|
151
|
-
fill: gap.fill,
|
|
152
|
-
height: gap.height,
|
|
153
|
-
width: gap.width,
|
|
154
|
-
x: gap.x,
|
|
155
|
-
y: gap.y
|
|
156
|
-
})), scene.mean.kind === "polyline" ? hs("polyline", {
|
|
157
|
-
class: scene.mean.className,
|
|
158
|
-
points: scene.mean.points
|
|
159
|
-
}) : scene.mean.segments.map((segment) => hs("line", {
|
|
160
|
-
class: segment.className,
|
|
161
|
-
x1: segment.x1,
|
|
162
|
-
x2: segment.x2,
|
|
163
|
-
y1: segment.y1,
|
|
164
|
-
y2: segment.y2
|
|
165
|
-
})), scene.calmNote != null && hs("text", {
|
|
166
|
-
class: scene.calmNote.className,
|
|
167
|
-
"text-anchor": scene.calmNote.anchor,
|
|
168
|
-
x: scene.calmNote.x,
|
|
169
|
-
y: scene.calmNote.y
|
|
170
|
-
}, scene.calmNote.text), hs("text", {
|
|
171
|
-
class: scene.rowLabels.to.className,
|
|
172
|
-
"text-anchor": scene.rowLabels.to.anchor,
|
|
173
|
-
x: scene.rowLabels.to.x,
|
|
174
|
-
y: scene.rowLabels.to.y
|
|
175
|
-
}, scene.rowLabels.to.text), scene.vanes.map((vane) => vane.mark.kind === "calm" ? hs("text", {
|
|
176
|
-
class: vane.mark.text.className,
|
|
177
|
-
"text-anchor": vane.mark.text.anchor,
|
|
178
|
-
x: vane.mark.text.x,
|
|
179
|
-
y: vane.mark.text.y
|
|
180
|
-
}, vane.mark.text.text) : hs("path", {
|
|
181
|
-
class: vane.mark.className,
|
|
182
|
-
d: vane.mark.d
|
|
183
|
-
})), scene.vanes.flatMap((vane) => vane.label == null ? [] : [hs("text", {
|
|
184
|
-
class: vane.label.className,
|
|
185
|
-
"text-anchor": vane.label.anchor,
|
|
186
|
-
x: vane.label.x,
|
|
187
|
-
y: vane.label.y
|
|
188
|
-
}, vane.label.text)]), hs("text", {
|
|
189
|
-
class: scene.rowLabels.avg.className,
|
|
190
|
-
"text-anchor": scene.rowLabels.avg.anchor,
|
|
191
|
-
x: scene.rowLabels.avg.x,
|
|
192
|
-
y: scene.rowLabels.avg.y
|
|
193
|
-
}, scene.rowLabels.avg.text), scene.vanes.flatMap((vane) => vane.value == null ? [] : [hs("text", {
|
|
194
|
-
class: vane.value.className,
|
|
195
|
-
"text-anchor": vane.value.anchor,
|
|
196
|
-
x: vane.value.x,
|
|
197
|
-
y: vane.value.y
|
|
198
|
-
}, vane.value.text)]), scene.ticks.map((tick) => hs("text", {
|
|
199
|
-
class: tick.className,
|
|
200
|
-
"text-anchor": tick.anchor,
|
|
201
|
-
x: tick.x,
|
|
202
|
-
y: tick.y
|
|
203
|
-
}, tick.text)))
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
//#endregion
|
|
207
|
-
export { DailyPatternElement, dailyPatternSceneDom };
|
|
92
|
+
export { DailyPatternElement };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import "../../index.js";
|
|
2
2
|
import { MeteoStationElement } from "../lib/base.js";
|
|
3
|
-
|
|
4
|
-
declare class DialElement extends MeteoStationElement {
|
|
3
|
+
export declare class DialElement extends MeteoStationElement {
|
|
5
4
|
static readonly observedAttributes: string[];
|
|
6
5
|
protected render(): void;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
export { DialElement };
|
|
6
|
+
}
|
|
@@ -2,12 +2,12 @@ import "../../instruments.js";
|
|
|
2
2
|
import { dialScene } from "../../scene/dial.js";
|
|
3
3
|
import { numberAttribute } from "../lib/attributes.js";
|
|
4
4
|
import { MeteoStationElement } from "../lib/base.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { renderScene } from "../lib/render.js";
|
|
6
|
+
// src/elements/elements/DialElement.ts
|
|
7
7
|
let bezelCounter = 0;
|
|
8
8
|
function dialSvg(options) {
|
|
9
9
|
const { station, thresholds, favorableDirections, unit, words, size = 160, calmWord = true } = options;
|
|
10
|
-
|
|
10
|
+
return renderScene(dialScene({
|
|
11
11
|
bezelId: `meteo-bezel-e${++bezelCounter}`,
|
|
12
12
|
calmWord,
|
|
13
13
|
favorableDirections,
|
|
@@ -16,99 +16,7 @@ function dialSvg(options) {
|
|
|
16
16
|
thresholds,
|
|
17
17
|
unit,
|
|
18
18
|
words
|
|
19
|
-
});
|
|
20
|
-
const { gradient, centre } = scene;
|
|
21
|
-
return hs("svg", {
|
|
22
|
-
"aria-label": scene.svg.ariaLabel,
|
|
23
|
-
class: scene.svg.className,
|
|
24
|
-
height: scene.svg.height,
|
|
25
|
-
role: "img",
|
|
26
|
-
viewBox: scene.svg.viewBox,
|
|
27
|
-
width: scene.svg.width
|
|
28
|
-
}, hs("defs", null, hs("radialGradient", {
|
|
29
|
-
cx: gradient.cx,
|
|
30
|
-
cy: gradient.cy,
|
|
31
|
-
id: gradient.id,
|
|
32
|
-
r: gradient.r
|
|
33
|
-
}, gradient.stops.map((stop) => hs("stop", {
|
|
34
|
-
class: stop.className,
|
|
35
|
-
offset: stop.offset
|
|
36
|
-
})))), hs("circle", {
|
|
37
|
-
class: scene.face.className,
|
|
38
|
-
cx: scene.face.cx,
|
|
39
|
-
cy: scene.face.cy,
|
|
40
|
-
r: scene.face.r
|
|
41
|
-
}), hs("circle", {
|
|
42
|
-
class: scene.bezel.className,
|
|
43
|
-
cx: scene.bezel.cx,
|
|
44
|
-
cy: scene.bezel.cy,
|
|
45
|
-
fill: scene.bezel.fill,
|
|
46
|
-
r: scene.bezel.r
|
|
47
|
-
}), hs("circle", {
|
|
48
|
-
class: scene.ring.className,
|
|
49
|
-
cx: scene.ring.cx,
|
|
50
|
-
cy: scene.ring.cy,
|
|
51
|
-
r: scene.ring.r
|
|
52
|
-
}), scene.verdictRing != null ? [hs("circle", {
|
|
53
|
-
class: scene.verdictRing.unfavorable.className,
|
|
54
|
-
cx: scene.verdictRing.unfavorable.cx,
|
|
55
|
-
cy: scene.verdictRing.unfavorable.cy,
|
|
56
|
-
r: scene.verdictRing.unfavorable.r
|
|
57
|
-
}), scene.verdictRing.favorable.map((arc) => hs("path", {
|
|
58
|
-
class: arc.className,
|
|
59
|
-
d: arc.d
|
|
60
|
-
}))] : null, scene.arc != null && hs("path", {
|
|
61
|
-
class: scene.arc.className,
|
|
62
|
-
d: scene.arc.d
|
|
63
|
-
}), scene.ticks.map((tick) => hs("line", {
|
|
64
|
-
class: tick.className,
|
|
65
|
-
x1: tick.x1,
|
|
66
|
-
x2: tick.x2,
|
|
67
|
-
y1: tick.y1,
|
|
68
|
-
y2: tick.y2
|
|
69
|
-
})), scene.letters.map((letter) => hs("text", {
|
|
70
|
-
class: letter.className,
|
|
71
|
-
"text-anchor": letter.anchor,
|
|
72
|
-
x: letter.x,
|
|
73
|
-
y: letter.y
|
|
74
|
-
}, letter.text)), scene.needle != null && hs("g", { class: scene.needle.className }, hs("polygon", {
|
|
75
|
-
class: scene.needle.blade.className,
|
|
76
|
-
points: scene.needle.blade.points
|
|
77
|
-
}), hs("circle", {
|
|
78
|
-
class: scene.needle.counterweight.className,
|
|
79
|
-
cx: scene.needle.counterweight.cx,
|
|
80
|
-
cy: scene.needle.counterweight.cy,
|
|
81
|
-
r: scene.needle.counterweight.r
|
|
82
|
-
})), hs("circle", {
|
|
83
|
-
class: scene.hub.className,
|
|
84
|
-
cx: scene.hub.cx,
|
|
85
|
-
cy: scene.hub.cy,
|
|
86
|
-
r: scene.hub.r
|
|
87
|
-
}), centre.kind === "reason" ? hs("text", {
|
|
88
|
-
class: centre.text.className,
|
|
89
|
-
"text-anchor": centre.text.anchor,
|
|
90
|
-
x: centre.text.x,
|
|
91
|
-
y: centre.text.y
|
|
92
|
-
}, centre.text.text) : [
|
|
93
|
-
centre.calmWord != null ? hs("text", {
|
|
94
|
-
class: centre.calmWord.className,
|
|
95
|
-
"text-anchor": centre.calmWord.anchor,
|
|
96
|
-
x: centre.calmWord.x,
|
|
97
|
-
y: centre.calmWord.y
|
|
98
|
-
}, centre.calmWord.text) : null,
|
|
99
|
-
hs("text", {
|
|
100
|
-
class: centre.speed.className,
|
|
101
|
-
"text-anchor": centre.speed.anchor,
|
|
102
|
-
x: centre.speed.x,
|
|
103
|
-
y: centre.speed.y
|
|
104
|
-
}, centre.speed.text),
|
|
105
|
-
hs("text", {
|
|
106
|
-
class: centre.unit.className,
|
|
107
|
-
"text-anchor": centre.unit.anchor,
|
|
108
|
-
x: centre.unit.x,
|
|
109
|
-
y: centre.unit.y
|
|
110
|
-
}, centre.unit.text)
|
|
111
|
-
]);
|
|
19
|
+
}));
|
|
112
20
|
}
|
|
113
21
|
var DialElement = class extends MeteoStationElement {
|
|
114
22
|
static observedAttributes = [
|
|
@@ -135,5 +43,4 @@ var DialElement = class extends MeteoStationElement {
|
|
|
135
43
|
}));
|
|
136
44
|
}
|
|
137
45
|
};
|
|
138
|
-
//#endregion
|
|
139
46
|
export { DialElement, dialSvg };
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { HistoryPoint } from "../../contract.js";
|
|
2
2
|
import "../../index.js";
|
|
3
3
|
import { MeteoStationElement } from "../lib/base.js";
|
|
4
|
-
|
|
5
|
-
declare class FavorableShareElement extends MeteoStationElement {
|
|
4
|
+
export declare class FavorableShareElement extends MeteoStationElement {
|
|
6
5
|
#private;
|
|
7
6
|
static readonly observedAttributes: string[];
|
|
8
7
|
constructor();
|
|
9
8
|
get points(): HistoryPoint[] | undefined;
|
|
10
9
|
set points(value: HistoryPoint[] | undefined);
|
|
11
10
|
protected render(): void;
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { FavorableShareElement };
|
|
11
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolveStation } from "../../display.js";
|
|
2
|
-
import {
|
|
2
|
+
import { favorableShareScene, favorableShareSource } from "../../scene/favorable-share.js";
|
|
3
3
|
import { MeteoStationElement } from "../lib/base.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { renderOptional } from "../lib/render.js";
|
|
5
|
+
// src/elements/elements/FavorableShareElement.ts
|
|
6
6
|
var FavorableShareElement = class extends MeteoStationElement {
|
|
7
7
|
static observedAttributes = ["favorable-directions", "station-id"];
|
|
8
8
|
#points;
|
|
@@ -20,28 +20,12 @@ var FavorableShareElement = class extends MeteoStationElement {
|
|
|
20
20
|
render() {
|
|
21
21
|
const station = this.station ?? (this.#points == null ? resolveStation(this.ambient()?.feed ?? null, this.getAttribute("station-id") ?? void 0) ?? void 0 : void 0);
|
|
22
22
|
const { favorableDirections, words } = this.display();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (gate.kind === "note") {
|
|
29
|
-
this.replaceChildren(h("div", {
|
|
30
|
-
class: gate.className,
|
|
31
|
-
role: "note"
|
|
32
|
-
}, gate.text));
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const scene = favorableShareScene({
|
|
36
|
-
share: gate.share,
|
|
23
|
+
this.replaceChildren(...renderOptional(favorableShareScene({
|
|
24
|
+
favorableDirections,
|
|
25
|
+
source: favorableShareSource(this.#points, station),
|
|
37
26
|
stationName: station?.name,
|
|
38
27
|
words
|
|
39
|
-
});
|
|
40
|
-
this.replaceChildren(h("div", {
|
|
41
|
-
"aria-label": scene.ariaLabel,
|
|
42
|
-
class: scene.className
|
|
43
|
-
}, h("span", { class: scene.label.className }, scene.label.text), " ", h("span", { class: scene.value.className }, scene.value.text)));
|
|
28
|
+
})));
|
|
44
29
|
}
|
|
45
30
|
};
|
|
46
|
-
//#endregion
|
|
47
31
|
export { FavorableShareElement };
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { MeteoStationElement } from "../lib/base.js";
|
|
2
|
-
|
|
3
|
-
declare class FreshnessBadgeElement extends MeteoStationElement {
|
|
2
|
+
export declare class FreshnessBadgeElement extends MeteoStationElement {
|
|
4
3
|
static readonly observedAttributes: string[];
|
|
5
4
|
protected render(): void;
|
|
6
|
-
}
|
|
7
|
-
//#endregion
|
|
8
|
-
export { FreshnessBadgeElement };
|
|
5
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MeteoStationElement } from "../lib/base.js";
|
|
2
2
|
import { freshnessBadgeSpan } from "../lib/fragments.js";
|
|
3
|
-
|
|
3
|
+
// src/elements/elements/FreshnessBadgeElement.ts
|
|
4
4
|
const STATUSES = [
|
|
5
5
|
"live",
|
|
6
6
|
"aging",
|
|
@@ -18,5 +18,4 @@ var FreshnessBadgeElement = class extends MeteoStationElement {
|
|
|
18
18
|
this.replaceChildren(freshnessBadgeSpan(status, words));
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
//#endregion
|
|
22
21
|
export { FreshnessBadgeElement };
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { RecentSummary } from "../../contract.js";
|
|
2
2
|
import "../../index.js";
|
|
3
3
|
import { MeteoStationElement } from "../lib/base.js";
|
|
4
|
-
|
|
5
|
-
declare class RecentSummariesElement extends MeteoStationElement {
|
|
4
|
+
export declare class RecentSummariesElement extends MeteoStationElement {
|
|
6
5
|
#private;
|
|
7
6
|
static readonly observedAttributes: string[];
|
|
8
7
|
constructor();
|
|
9
8
|
get summaries(): RecentSummary[] | null | undefined;
|
|
10
9
|
set summaries(value: RecentSummary[] | null | undefined);
|
|
11
10
|
protected render(): void;
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { RecentSummariesElement };
|
|
11
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { resolveStation } from "../../display.js";
|
|
2
|
-
import {
|
|
2
|
+
import { recentSummariesScene } from "../../scene/recent-summaries.js";
|
|
3
3
|
import { MeteoStationElement } from "../lib/base.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
//#region src/elements/elements/RecentSummariesElement.ts
|
|
4
|
+
import { renderOptional } from "../lib/render.js";
|
|
5
|
+
// src/elements/elements/RecentSummariesElement.ts
|
|
7
6
|
var RecentSummariesElement = class extends MeteoStationElement {
|
|
8
7
|
static observedAttributes = [
|
|
9
8
|
"favorable-directions",
|
|
@@ -25,30 +24,13 @@ var RecentSummariesElement = class extends MeteoStationElement {
|
|
|
25
24
|
render() {
|
|
26
25
|
const station = this.station ?? (this.#summaries == null ? resolveStation(this.ambient()?.feed ?? null, this.getAttribute("station-id") ?? void 0) ?? void 0 : void 0);
|
|
27
26
|
const { favorableDirections, unit, words } = this.display();
|
|
28
|
-
|
|
29
|
-
if (gate.kind === "hidden") {
|
|
30
|
-
this.replaceChildren();
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (gate.kind === "note") {
|
|
34
|
-
this.replaceChildren(h("div", {
|
|
35
|
-
class: gate.className,
|
|
36
|
-
role: "note"
|
|
37
|
-
}, gate.text));
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
const scene = recentSummariesScene({
|
|
27
|
+
this.replaceChildren(...renderOptional(recentSummariesScene({
|
|
41
28
|
favorableDirections,
|
|
42
|
-
|
|
43
|
-
summaries:
|
|
29
|
+
station,
|
|
30
|
+
summaries: this.#summaries,
|
|
44
31
|
unit,
|
|
45
32
|
words
|
|
46
|
-
});
|
|
47
|
-
this.replaceChildren(h("div", {
|
|
48
|
-
"aria-label": scene.ariaLabel,
|
|
49
|
-
class: scene.className
|
|
50
|
-
}, scene.panels.map((panel) => h("section", { class: panel.className }, h("h4", { class: panel.label.className }, panel.label.text), h("div", { class: "meteo-recent-summary-ghosts" }, panel.ghosts.map((ghost) => h("span", { class: ghost.className }, windArrowSvg(ghost.deg, 12)))), h("dl", { class: "meteo-recent-summary-stats" }, panel.stats.map((stat) => h("div", { class: stat.className }, h("dt", { class: "meteo-microlabel" }, stat.label), h("dd", null, stat.value))))))));
|
|
33
|
+
})));
|
|
51
34
|
}
|
|
52
35
|
};
|
|
53
|
-
//#endregion
|
|
54
36
|
export { RecentSummariesElement };
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import "../../index.js";
|
|
2
1
|
import { MeteoStationElement } from "../lib/base.js";
|
|
3
|
-
|
|
4
|
-
declare class SparklineElement extends MeteoStationElement {
|
|
2
|
+
export declare class SparklineElement extends MeteoStationElement {
|
|
5
3
|
static readonly observedAttributes: string[];
|
|
6
4
|
protected render(): void;
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
export { SparklineElement };
|
|
5
|
+
}
|
|
@@ -1,53 +1,18 @@
|
|
|
1
1
|
import { sparklineScene } from "../../scene/sparkline.js";
|
|
2
2
|
import { numberAttribute } from "../lib/attributes.js";
|
|
3
3
|
import { MeteoStationElement } from "../lib/base.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { renderScene } from "../lib/render.js";
|
|
5
|
+
// src/elements/elements/SparklineElement.ts
|
|
6
6
|
function sparklineNode(options) {
|
|
7
7
|
const { station, thresholds, words, width = 120, height = 32, showBand = true } = options;
|
|
8
|
-
|
|
8
|
+
return renderScene(sparklineScene({
|
|
9
9
|
height,
|
|
10
10
|
showBand,
|
|
11
11
|
station,
|
|
12
12
|
thresholds,
|
|
13
13
|
width,
|
|
14
14
|
words
|
|
15
|
-
});
|
|
16
|
-
if (scene.kind === "placeholder") {
|
|
17
|
-
const placeholder = h("span", {
|
|
18
|
-
"aria-label": scene.ariaLabel,
|
|
19
|
-
class: scene.className,
|
|
20
|
-
role: "img"
|
|
21
|
-
}, scene.text);
|
|
22
|
-
placeholder.style.height = `${scene.height}px`;
|
|
23
|
-
placeholder.style.width = `${scene.width}px`;
|
|
24
|
-
return placeholder;
|
|
25
|
-
}
|
|
26
|
-
return hs("svg", {
|
|
27
|
-
"aria-label": scene.svg.ariaLabel,
|
|
28
|
-
class: scene.svg.className,
|
|
29
|
-
height: scene.svg.height,
|
|
30
|
-
role: "img",
|
|
31
|
-
viewBox: scene.svg.viewBox,
|
|
32
|
-
width: scene.svg.width
|
|
33
|
-
}, scene.bands.map((band) => hs("polygon", {
|
|
34
|
-
class: band.className,
|
|
35
|
-
points: band.points
|
|
36
|
-
})), scene.trace.map((part) => part.kind === "dot" ? hs("circle", {
|
|
37
|
-
class: part.className,
|
|
38
|
-
cx: part.cx,
|
|
39
|
-
cy: part.cy,
|
|
40
|
-
r: part.r
|
|
41
|
-
}) : part.kind === "polyline" ? hs("polyline", {
|
|
42
|
-
class: part.className,
|
|
43
|
-
points: part.points
|
|
44
|
-
}) : hs("line", {
|
|
45
|
-
class: part.className,
|
|
46
|
-
x1: part.x1,
|
|
47
|
-
x2: part.x2,
|
|
48
|
-
y1: part.y1,
|
|
49
|
-
y2: part.y2
|
|
50
|
-
})));
|
|
15
|
+
}));
|
|
51
16
|
}
|
|
52
17
|
var SparklineElement = class extends MeteoStationElement {
|
|
53
18
|
static observedAttributes = [
|
|
@@ -70,5 +35,4 @@ var SparklineElement = class extends MeteoStationElement {
|
|
|
70
35
|
}));
|
|
71
36
|
}
|
|
72
37
|
};
|
|
73
|
-
|
|
74
|
-
export { SparklineElement, sparklineNode };
|
|
38
|
+
export { SparklineElement };
|
|
@@ -3,7 +3,6 @@ import { SpeedThresholds, SpeedUnit } from "../../derive.js";
|
|
|
3
3
|
import { FormatTime, StationStringOverrides } from "../../strings.js";
|
|
4
4
|
import "../../index.js";
|
|
5
5
|
import { MeteoElement, MeteoStationElement } from "../lib/base.js";
|
|
6
|
-
//#region src/elements/elements/StationCardElement.d.ts
|
|
7
6
|
type StationCardContextValue = {
|
|
8
7
|
station: Station;
|
|
9
8
|
servedAt: string | null;
|
|
@@ -13,7 +12,7 @@ type StationCardContextValue = {
|
|
|
13
12
|
strings: StationStringOverrides | undefined;
|
|
14
13
|
formatTime: FormatTime;
|
|
15
14
|
};
|
|
16
|
-
declare class StationCardElement extends MeteoStationElement {
|
|
15
|
+
export declare class StationCardElement extends MeteoStationElement {
|
|
17
16
|
#private;
|
|
18
17
|
static readonly observedAttributes: string[];
|
|
19
18
|
protected connected(): void;
|
|
@@ -30,24 +29,23 @@ declare abstract class StationCardPartElement extends MeteoElement {
|
|
|
30
29
|
protected connected(): void;
|
|
31
30
|
protected card(): StationCardContextValue;
|
|
32
31
|
}
|
|
33
|
-
declare class StationCardHeaderElement extends StationCardPartElement {
|
|
32
|
+
export declare class StationCardHeaderElement extends StationCardPartElement {
|
|
34
33
|
protected readonly partName = "header";
|
|
35
34
|
protected connected(): void;
|
|
36
35
|
protected render(): void;
|
|
37
36
|
}
|
|
38
|
-
declare class StationCardInstrumentElement extends StationCardPartElement {
|
|
37
|
+
export declare class StationCardInstrumentElement extends StationCardPartElement {
|
|
39
38
|
static readonly observedAttributes: string[];
|
|
40
39
|
protected readonly partName = "instrument";
|
|
41
40
|
protected render(): void;
|
|
42
41
|
}
|
|
43
|
-
declare class StationCardChartElement extends StationCardPartElement {
|
|
42
|
+
export declare class StationCardChartElement extends StationCardPartElement {
|
|
44
43
|
static readonly observedAttributes: string[];
|
|
45
44
|
protected readonly partName = "chart";
|
|
46
45
|
protected render(): void;
|
|
47
46
|
}
|
|
48
|
-
declare class StationCardSummaryElement extends StationCardPartElement {
|
|
47
|
+
export declare class StationCardSummaryElement extends StationCardPartElement {
|
|
49
48
|
protected readonly partName = "summary";
|
|
50
49
|
protected render(): void;
|
|
51
50
|
}
|
|
52
|
-
|
|
53
|
-
export { StationCardChartElement, StationCardElement, StationCardHeaderElement, StationCardInstrumentElement, StationCardSummaryElement };
|
|
51
|
+
export {};
|
|
@@ -2,13 +2,13 @@ import { freshness, stationFreshnessThresholds } from "../../derive.js";
|
|
|
2
2
|
import { mergeStringOverrides, resolveStrings } from "../../strings.js";
|
|
3
3
|
import { resolveDisplay } from "../../display.js";
|
|
4
4
|
import { subscribeTicker } from "../../client/ticker.js";
|
|
5
|
-
import { STATION_CARD_CLASS,
|
|
5
|
+
import { STATION_CARD_CLASS, cardHeaderNode, cardPartThresholds, cardPartWiringError, summaryNode } from "../../scene/card.js";
|
|
6
6
|
import { numberAttribute } from "../lib/attributes.js";
|
|
7
7
|
import { provideContext, requestContext } from "../lib/context.js";
|
|
8
8
|
import { MeteoElement, MeteoStationElement } from "../lib/base.js";
|
|
9
9
|
import { h } from "../lib/h.js";
|
|
10
|
-
import {
|
|
11
|
-
|
|
10
|
+
import { renderOptional, renderScene } from "../lib/render.js";
|
|
11
|
+
// src/elements/elements/StationCardElement.ts
|
|
12
12
|
const STATION_CARD_CONTEXT_KEY = "meteo-station-card";
|
|
13
13
|
var StationCardElement = class extends MeteoStationElement {
|
|
14
14
|
static observedAttributes = [
|
|
@@ -136,13 +136,7 @@ var StationCardHeaderElement = class extends StationCardPartElement {
|
|
|
136
136
|
receivedAtMs,
|
|
137
137
|
nowMs: Date.now()
|
|
138
138
|
}, stationFreshnessThresholds(station));
|
|
139
|
-
|
|
140
|
-
const { name, meta } = scene.identity;
|
|
141
|
-
this.replaceChildren(h("header", { class: scene.className }, h("div", { class: scene.identity.className }, h("h3", { class: name.className }, name.link ? h("a", {
|
|
142
|
-
href: name.link.href,
|
|
143
|
-
rel: name.link.rel,
|
|
144
|
-
target: name.link.target
|
|
145
|
-
}, name.link.text) : name.text), h("p", { class: meta.className }, h("span", { class: meta.source.className }, meta.source.text), meta.elevation != null && h("span", { class: meta.elevation.className }, meta.elevation.text))), status != null && freshnessBadgeSpan(status, words)));
|
|
139
|
+
this.replaceChildren(renderScene(cardHeaderNode(station, status, words)));
|
|
146
140
|
}
|
|
147
141
|
};
|
|
148
142
|
var StationCardInstrumentElement = class extends StationCardPartElement {
|
|
@@ -196,16 +190,7 @@ var StationCardSummaryElement = class extends StationCardPartElement {
|
|
|
196
190
|
render() {
|
|
197
191
|
const context = this.card();
|
|
198
192
|
const words = resolveStrings(context.strings);
|
|
199
|
-
|
|
200
|
-
if (summary == null) {
|
|
201
|
-
this.replaceChildren();
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
this.replaceChildren(h("dl", {
|
|
205
|
-
"aria-label": summary.ariaLabel,
|
|
206
|
-
class: summary.className
|
|
207
|
-
}, summary.items.map((item) => h("div", { class: summary.itemClassName }, h("dt", { class: summary.labelClassName }, item.label), h("dd", null, item.value)))));
|
|
193
|
+
this.replaceChildren(...renderOptional(summaryNode(context.station, context.unit, words, context.formatTime)));
|
|
208
194
|
}
|
|
209
195
|
};
|
|
210
|
-
//#endregion
|
|
211
196
|
export { StationCardChartElement, StationCardElement, StationCardHeaderElement, StationCardInstrumentElement, StationCardSummaryElement };
|
|
@@ -6,8 +6,7 @@ import { FormatTime, StationStringOverrides } from "../../strings.js";
|
|
|
6
6
|
import { FavorableDirection } from "../../instruments.js";
|
|
7
7
|
import "../../index.js";
|
|
8
8
|
import { MeteoElement } from "../lib/base.js";
|
|
9
|
-
|
|
10
|
-
declare class StationFeedElement extends MeteoElement {
|
|
9
|
+
export declare class StationFeedElement extends MeteoElement {
|
|
11
10
|
#private;
|
|
12
11
|
static readonly observedAttributes: string[];
|
|
13
12
|
constructor();
|
|
@@ -30,6 +29,4 @@ declare class StationFeedElement extends MeteoElement {
|
|
|
30
29
|
protected connected(): void;
|
|
31
30
|
attributeChangedCallback(name: string): void;
|
|
32
31
|
protected render(): void;
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { StationFeedElement };
|
|
32
|
+
}
|
|
@@ -4,7 +4,7 @@ import { STATION_FEED_CONTEXT_KEY } from "../lib/ambient.js";
|
|
|
4
4
|
import { numberAttribute, parseArcsAttribute, parseThresholdsAttribute, unitAttribute } from "../lib/attributes.js";
|
|
5
5
|
import { provideContext } from "../lib/context.js";
|
|
6
6
|
import { MeteoElement } from "../lib/base.js";
|
|
7
|
-
|
|
7
|
+
// src/elements/elements/StationFeedElement.ts
|
|
8
8
|
var StationFeedElement = class extends MeteoElement {
|
|
9
9
|
static observedAttributes = [
|
|
10
10
|
"current-poll-seconds",
|
|
@@ -163,8 +163,10 @@ var StationFeedElement = class extends MeteoElement {
|
|
|
163
163
|
this.#unsubscribeStore = this.#store.subscribe(() => this.#onStoreChange());
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
|
-
if (this.#store != null)
|
|
167
|
-
|
|
166
|
+
if (this.#store != null) {
|
|
167
|
+
if (this.hasAttribute("paused")) this.#store.stop();
|
|
168
|
+
else this.#store.start();
|
|
169
|
+
}
|
|
168
170
|
}
|
|
169
171
|
#buildStore(src, stationId, pollSeconds, currentPollSeconds) {
|
|
170
172
|
const fetchInit = () => this.#fetchInit;
|
|
@@ -222,5 +224,4 @@ var StationFeedElement = class extends MeteoElement {
|
|
|
222
224
|
this.#notify();
|
|
223
225
|
}
|
|
224
226
|
};
|
|
225
|
-
//#endregion
|
|
226
227
|
export { StationFeedElement };
|