@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.45 → 2.0.0-next.48

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 (55) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +14869 -14889
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +74 -81
  4. package/dist/components/badge/badge.css.js +15 -15
  5. package/dist/navigation-instruments/compass/compass.d.ts +3 -3
  6. package/dist/navigation-instruments/compass/compass.d.ts.map +1 -1
  7. package/dist/navigation-instruments/compass/compass.js +3 -3
  8. package/dist/navigation-instruments/compass/compass.js.map +1 -1
  9. package/dist/navigation-instruments/compass-indicator/compass-indicator.d.ts +12 -0
  10. package/dist/navigation-instruments/compass-indicator/compass-indicator.d.ts.map +1 -1
  11. package/dist/navigation-instruments/compass-indicator/compass-indicator.js +9 -1
  12. package/dist/navigation-instruments/compass-indicator/compass-indicator.js.map +1 -1
  13. package/dist/navigation-instruments/velocity-projection-plot/velocity-projection-plot.d.ts +4 -4
  14. package/dist/navigation-instruments/velocity-projection-plot/velocity-projection-plot.d.ts.map +1 -1
  15. package/dist/navigation-instruments/velocity-projection-plot/velocity-projection-plot.js +15 -14
  16. package/dist/navigation-instruments/velocity-projection-plot/velocity-projection-plot.js.map +1 -1
  17. package/dist/navigation-instruments/watch/environment.d.ts +39 -1
  18. package/dist/navigation-instruments/watch/environment.d.ts.map +1 -1
  19. package/dist/navigation-instruments/watch/environment.js +71 -88
  20. package/dist/navigation-instruments/watch/environment.js.map +1 -1
  21. package/dist/navigation-instruments/watch/watch.d.ts +1 -1
  22. package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
  23. package/dist/navigation-instruments/watch/watch.js +4 -4
  24. package/dist/navigation-instruments/watch/watch.js.map +1 -1
  25. package/dist/navigation-instruments/wind/wind.d.ts +1 -1
  26. package/dist/navigation-instruments/wind/wind.d.ts.map +1 -1
  27. package/dist/navigation-instruments/wind/wind.js +3 -3
  28. package/dist/navigation-instruments/wind/wind.js.map +1 -1
  29. package/dist/navigation-instruments/wind-indicator/wind-indicator.d.ts +63 -9
  30. package/dist/navigation-instruments/wind-indicator/wind-indicator.d.ts.map +1 -1
  31. package/dist/navigation-instruments/wind-indicator/wind-indicator.js +57 -1995
  32. package/dist/navigation-instruments/wind-indicator/wind-indicator.js.map +1 -1
  33. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.d.ts +1 -1
  34. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.d.ts.map +1 -1
  35. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.js +4 -4
  36. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.js.map +1 -1
  37. package/package.json +2 -1
  38. package/src/components/badge/badge.css +15 -15
  39. package/src/components/badge/badge.stories.ts +2 -0
  40. package/src/navigation-instruments/compass/compass.stories.ts +5 -2
  41. package/src/navigation-instruments/compass/compass.ts +4 -4
  42. package/src/navigation-instruments/compass-indicator/compass-indicator.stories.ts +34 -1
  43. package/src/navigation-instruments/compass-indicator/compass-indicator.ts +19 -1
  44. package/src/navigation-instruments/velocity-projection-plot/velocity-projection-plot.stories.ts +13 -13
  45. package/src/navigation-instruments/velocity-projection-plot/velocity-projection-plot.ts +15 -11
  46. package/src/navigation-instruments/watch/environment.ts +120 -87
  47. package/src/navigation-instruments/watch/watch.stories.ts +2 -2
  48. package/src/navigation-instruments/watch/watch.ts +3 -3
  49. package/src/navigation-instruments/wind/wind.stories.ts +4 -3
  50. package/src/navigation-instruments/wind/wind.ts +2 -2
  51. package/src/navigation-instruments/wind-indicator/wind-indicator.stories.ts +22 -12
  52. package/src/navigation-instruments/wind-indicator/wind-indicator.ts +91 -46
  53. package/src/navigation-instruments/wind-propulsion/wind-propulsion.stories.ts +3 -3
  54. package/src/navigation-instruments/wind-propulsion/wind-propulsion.ts +3 -3
  55. package/tsconfig.json +38 -0
@@ -24,18 +24,22 @@ export class ObcVelocityProjectionPlot extends LitElement {
24
24
  @property({type: Array, attribute: false})
25
25
  dataPoints: VelocityProjectionDatapoint[] = [];
26
26
  @property({type: Number})
27
- instantWindDirectionDeg: number | null = null;
27
+ currentWindFromDirection: number | null = null;
28
28
  @property({type: Number})
29
- instantWindSpeedNumber: number | null = null;
29
+ currentWindSpeedKnots: number | null = null;
30
30
  @property({type: Number})
31
- instantCurrentDirectionDeg: number | null = null;
31
+ currentFromDirection: number | null = null;
32
32
  @property({type: Number})
33
- instantCurrentSpeedNumber: number | null = null;
33
+ currentSpeedKnots: number | null = null;
34
34
  @property({type: String})
35
35
  vesselImage: VesselImage = VesselImage.cargoWindTop;
36
36
  override render() {
37
37
  const width = 320;
38
38
  const viewBox = `-${width / 2} -${width / 2} ${width} ${width}`;
39
+ const currentLevel =
40
+ this.currentSpeedKnots == null
41
+ ? null
42
+ : Math.max(0, Math.min(4, Math.round(this.currentSpeedKnots)));
39
43
 
40
44
  return html`
41
45
  <div class="container">
@@ -49,10 +53,10 @@ export class ObcVelocityProjectionPlot extends LitElement {
49
53
  transform: '',
50
54
  },
51
55
  ]}
52
- .windFromDirectionDeg=${this.instantWindDirectionDeg}
53
- .wind=${this.instantWindSpeedNumber}
54
- .currentFromDirectionDeg=${this.instantCurrentDirectionDeg}
55
- .current=${this.instantCurrentSpeedNumber}
56
+ .windFromDirectionDeg=${this.currentWindFromDirection}
57
+ .windKnots=${this.currentWindSpeedKnots}
58
+ .currentFromDirectionDeg=${this.currentFromDirection}
59
+ .current=${currentLevel}
56
60
  .padding=${70}
57
61
  >
58
62
  </obc-watch>
@@ -62,10 +66,10 @@ export class ObcVelocityProjectionPlot extends LitElement {
62
66
  }
63
67
 
64
68
  private isSelected(dp: VelocityProjectionDatapoint): boolean {
65
- if (this.instantWindDirectionDeg != null) {
69
+ if (this.currentWindFromDirection != null) {
66
70
  return (
67
- dp.startAngleDeg <= this.instantWindDirectionDeg &&
68
- dp.endAngleDeg >= this.instantWindDirectionDeg
71
+ dp.startAngleDeg <= this.currentWindFromDirection &&
72
+ dp.endAngleDeg >= this.currentWindFromDirection
69
73
  );
70
74
  }
71
75
  return true;
@@ -1,18 +1,131 @@
1
1
  import {svg, SVGTemplateResult} from 'lit';
2
2
  import {styleMap} from 'lit/directives/style-map.js';
3
+ import '../../icons/icon-wind-true-1.js';
4
+ import '../../icons/icon-wind-true-2.js';
5
+ import '../../icons/icon-wind-true-3.js';
6
+ import '../../icons/icon-wind-true-4.js';
7
+ import '../../icons/icon-wind-true-5.js';
8
+ import '../../icons/icon-wind-true-6.js';
9
+ import '../../icons/icon-wind-true-7.js';
10
+ import '../../icons/icon-wind-true-8.js';
11
+ import '../../icons/icon-wind-true-9.js';
12
+ import '../../icons/icon-wind-true-10.js';
13
+ import '../../icons/icon-wind-true-11.js';
14
+ import '../../icons/icon-wind-true-12.js';
15
+ import '../../icons/icon-wind-true-13.js';
16
+ import '../../icons/icon-wind-true-14.js';
17
+
18
+ /**
19
+ * Number of wind barb icons available (`<obi-wind-true-1>` …
20
+ * `<obi-wind-true-14>`).
21
+ *
22
+ * The set follows the standard meteorological wind-barb convention:
23
+ * icon 1 is calm, icon 2 is shaft-only (1 kn bucket), icons 3–11 add
24
+ * one half-barb per 5 kn (5, 10, 15, …, 45 kn), icon 12 is one pennant
25
+ * (50 kn), icons 13–14 add full barbs above the pennant (60 / 70 kn).
26
+ */
27
+ const WIND_ICON_COUNT = 14;
28
+
29
+ /** Render scale applied to the 24×24 icon so it matches the historic 48×48 visual footprint on the watch dial. */
30
+ const WIND_ICON_SCALE = 2;
31
+
32
+ /**
33
+ * Tip coordinates of the `obi-wind-true-*` icons in their native 24×24 child
34
+ * space. The arrowhead tip is at approximately (12, 22.4453) — this is the
35
+ * anchor point that lands on the watch's periphery radius so the barb tail
36
+ * extends outward only (matching the legacy inline-glyph behavior).
37
+ */
38
+ const WIND_ICON_TIP_X = 12;
39
+ const WIND_ICON_TIP_Y = 22.4453;
40
+
41
+ const windIconCache = new Map<string, SVGTemplateResult>();
42
+
43
+ function getWindIconSvg(index: number): SVGTemplateResult | null {
44
+ const tagName = `obi-wind-true-${index}`;
45
+ const cached = windIconCache.get(tagName);
46
+ if (cached) {
47
+ return cached;
48
+ }
49
+ const ctor = customElements.get(tagName) as
50
+ | (new () => {icon?: SVGTemplateResult; iconCss?: SVGTemplateResult})
51
+ | undefined;
52
+ if (!ctor) {
53
+ return null;
54
+ }
55
+ const instance = new ctor();
56
+ const tpl: SVGTemplateResult | undefined = instance.icon ?? instance.iconCss;
57
+ if (!tpl) {
58
+ return null;
59
+ }
60
+ windIconCache.set(tagName, tpl);
61
+ return tpl;
62
+ }
63
+
64
+ /**
65
+ * Maps a wind speed in **knots** to a wind-barb icon index in `[1, 14]`.
66
+ *
67
+ * Implements the designer-confirmed "Option C" mapping: speeds round to
68
+ * the nearest 5-knot bucket (with two sub-pennant buckets for calm and
69
+ * near-calm conditions):
70
+ *
71
+ * | Knots range | Icon | Glyph |
72
+ * | ----------- | ---- | -------------------- |
73
+ * | `[0, 0.5)` | 1 | calm |
74
+ * | `[0.5, 2.5)`| 2 | shaft only |
75
+ * | `[2.5, 7.5)`| 3 | shaft + ½ barb |
76
+ * | `[7.5, 12.5)`| 4 | shaft + 1 full barb |
77
+ * | …5-kn steps…| … | … |
78
+ * | `[42.5, 47.5)`| 11 | shaft + 4 full + ½ |
79
+ * | `[47.5, 55)`| 12 | pennant (50 kn) |
80
+ * | `[55, 65)` | 13 | pennant + 1 full barb |
81
+ * | `[65, ∞)` | 14 | pennant + 2 full barbs |
82
+ *
83
+ * The 55 / 65 / 100-knot buckets currently collapse to the nearest
84
+ * available icon; dedicated glyphs are tracked for a follow-up icon
85
+ * refresh. Non-finite / null / undefined inputs fall back to icon 1.
86
+ */
87
+ export function windKnotsToIconIndex(knots: number | null | undefined): number {
88
+ if (knots == null || !Number.isFinite(knots) || knots < 0.5) {
89
+ return 1;
90
+ }
91
+ if (knots < 2.5) {
92
+ return 2;
93
+ }
94
+ if (knots < 47.5) {
95
+ return Math.round(knots / 5) + 2;
96
+ }
97
+ if (knots < 55) {
98
+ return 12;
99
+ }
100
+ if (knots < 65) {
101
+ return 13;
102
+ }
103
+ return WIND_ICON_COUNT;
104
+ }
3
105
 
4
106
  export function renderWind(options: {
5
- wind: number;
107
+ windKnots: number;
6
108
  fromDirectionDeg: number;
7
109
  radius: number;
8
110
  color?: string;
9
111
  }): SVGTemplateResult {
10
- return renderEnvironment({
11
- filename: `wind-${options.wind + 1}.svg`,
12
- fromDirectionDeg: options.fromDirectionDeg,
13
- radius: options.radius,
14
- color: options.color,
15
- });
112
+ const {windKnots, fromDirectionDeg, radius, color} = options;
113
+ const index = windKnotsToIconIndex(windKnots);
114
+ const icon = getWindIconSvg(index);
115
+ if (!icon) {
116
+ return svg``;
117
+ }
118
+ const dirRad = (fromDirectionDeg * Math.PI) / 180;
119
+ const x = Math.sin(dirRad) * radius;
120
+ const y = -Math.cos(dirRad) * radius;
121
+ const tipX = WIND_ICON_TIP_X * WIND_ICON_SCALE;
122
+ const tipY = WIND_ICON_TIP_Y * WIND_ICON_SCALE;
123
+ const styles = {
124
+ color: color ?? 'var(--instrument-regular-secondary-color)',
125
+ };
126
+ return svg`<g style=${styleMap(styles)} transform="translate(${x} ${y}) rotate(${fromDirectionDeg}) translate(${-tipX} ${-tipY}) scale(${WIND_ICON_SCALE})">
127
+ ${icon}
128
+ </g>`;
16
129
  }
17
130
 
18
131
  export function renderCurrent(options: {
@@ -73,84 +186,4 @@ export const environmentSvgs: Record<string, SVGTemplateResult> = {
73
186
  <path fill-rule="evenodd" clip-rule="evenodd" d="M7 10.5858L12.2071 5.37866L17.4142 10.5858L16 12L12.2071 8.20709L8.41421 12L7 10.5858Z" fill="var(--instrument-regular-secondary-color)"/>
74
187
  <path fill-rule="evenodd" clip-rule="evenodd" d="M7 16.5858L12.2071 11.3787L17.4142 16.5858L16 18L12.2071 14.2071L8.41421 18L7 16.5858Z" fill="var(--instrument-regular-secondary-color)"/>
75
188
  <path fill-rule="evenodd" clip-rule="evenodd" d="M7 22.5858L12.2071 17.3787L17.4142 22.5858L16 24L12.2071 20.2071L8.41421 24L7 22.5858Z" fill="var(--instrument-regular-secondary-color)"/>`,
76
- 'wind-1.svg': svg`<path d="M12 2C6.47715 2 2 6.47715 2 12H3.90476C3.90476 7.52912 7.52912 3.90476 12 3.90476V2Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
77
- <path d="M22 12C22 6.47715 17.5228 2 12 2V3.90476C16.4709 3.90476 20.0952 7.52912 20.0952 12H22Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
78
- <path d="M12 22C17.5228 22 22 17.5228 22 12H20.0952C20.0952 16.4709 16.4709 20.0952 12 20.0952V22Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
79
- <path d="M2 12C2 17.5228 6.47715 22 12 22V20.0952C7.52912 20.0952 3.90476 16.4709 3.90476 12H2Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
80
- <path d="M12 2C6.47715 2 2 6.47715 2 12H3.90476C3.90476 7.52912 7.52912 3.90476 12 3.90476V2Z" fill="var(--instrument-regular-secondary-color)"/>
81
- <path d="M22 12C22 6.47715 17.5228 2 12 2V3.90476C16.4709 3.90476 20.0952 7.52912 20.0952 12H22Z" fill="var(--instrument-regular-secondary-color)"/>
82
- <path d="M12 22C17.5228 22 22 17.5228 22 12H20.0952C20.0952 16.4709 16.4709 20.0952 12 20.0952V22Z" fill="var(--instrument-regular-secondary-color)"/>
83
- <path d="M2 12C2 17.5228 6.47715 22 12 22V20.0952C7.52912 20.0952 3.90476 16.4709 3.90476 12H2Z" fill="var(--instrument-regular-secondary-color)"/>`,
84
- 'wind-2.svg': svg`<path d="M11 24H13L13 7H15L12 0L9 7H11L11 24Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
85
- <path d="M11 24H13L13 7H15L12 0L9 7H11L11 24Z" fill="var(--instrument-regular-secondary-color)"/>`,
86
- 'wind-3.svg': svg`<path d="M11 24L13 24L13 7L15 7L12 -1.74846e-07L9 7L11 7L11 24Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
87
- <path d="M8 21L8 19L11 19L11 21L8 21Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
88
- <path d="M11 24L13 24L13 7L15 7L12 -1.74846e-07L9 7L11 7L11 24Z" fill="var(--instrument-regular-secondary-color)"/>
89
- <path d="M8 21L8 19L11 19L11 21L8 21Z" fill="var(--instrument-regular-secondary-color)"/>`,
90
- 'wind-4.svg': svg`<path d="M11 24L13 24L13 7L15 7L12 -2.62268e-07L9 7L11 7L11 24Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
91
- <path d="M6 24L6 22L11 22L11 24L6 24Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
92
- <path d="M11 24L13 24L13 7L15 7L12 -2.62268e-07L9 7L11 7L11 24Z" fill="var(--instrument-regular-secondary-color)"/>
93
- <path d="M6 24L6 22L11 22L11 24L6 24Z" fill="var(--instrument-regular-secondary-color)"/>`,
94
- 'wind-5.svg': svg`<path d="M11 24H13L13 7H15L12 0L9 7H11L11 24Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
95
- <path d="M5 24L5 22H12V24H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
96
- <path d="M8 21L8 19H12V21H8Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
97
- <path d="M11 24H13L13 7H15L12 0L9 7H11L11 24Z" fill="var(--instrument-regular-secondary-color)"/>
98
- <path d="M5 24L5 22H12V24H5Z" fill="var(--instrument-regular-secondary-color)"/>
99
- <path d="M8 21L8 19H12V21H8Z" fill="var(--instrument-regular-secondary-color)"/>`,
100
- 'wind-6.svg': svg`<path d="M11 24H13L13 7L15 7L12 0L9 7H11L11 24Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
101
- <path d="M5 24L5 22H12V24H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
102
- <path d="M5 21L5 19H12V21H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
103
- <path d="M11 24H13L13 7L15 7L12 0L9 7H11L11 24Z" fill="var(--instrument-regular-secondary-color)"/>
104
- <path d="M5 24L5 22H12V24H5Z" fill="var(--instrument-regular-secondary-color)"/>
105
- <path d="M5 21L5 19H12V21H5Z" fill="var(--instrument-regular-secondary-color)"/>`,
106
- 'wind-7.svg': svg`<path d="M11 24H13L13 7H15L12 0L9 7H11L11 24Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
107
- <path d="M5 24L5 22H12V24H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
108
- <path d="M5 21L5 19H12V21H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
109
- <path d="M8 18L8 16H12V18H8Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
110
- <path d="M11 24H13L13 7H15L12 0L9 7H11L11 24Z" fill="var(--instrument-regular-secondary-color)"/>
111
- <path d="M5 24L5 22H12V24H5Z" fill="var(--instrument-regular-secondary-color)"/>
112
- <path d="M5 21L5 19H12V21H5Z" fill="var(--instrument-regular-secondary-color)"/>
113
- <path d="M8 18L8 16H12V18H8Z" fill="var(--instrument-regular-secondary-color)"/>`,
114
- 'wind-8.svg': svg`<path d="M11 24H13L13 7H15L12 0L9 7H11L11 24Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
115
- <path d="M5 24L5 22H12V24H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
116
- <path d="M5 21L5 19H12V21H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
117
- <path d="M5 18L5 16H12V18H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
118
- <path d="M11 24H13L13 7H15L12 0L9 7H11L11 24Z" fill="var(--instrument-regular-secondary-color)"/>
119
- <path d="M5 24L5 22H12V24H5Z" fill="var(--instrument-regular-secondary-color)"/>
120
- <path d="M5 21L5 19H12V21H5Z" fill="var(--instrument-regular-secondary-color)"/>
121
- <path d="M5 18L5 16H12V18H5Z" fill="var(--instrument-regular-secondary-color)"/>`,
122
- 'wind-9.svg': svg`<path d="M11 24H13L13 7H15L12 0L9 7H11L11 24Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
123
- <path d="M5 24L5 22H12V24H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
124
- <path d="M5 21L5 19H12V21H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
125
- <path d="M5 18L5 16H12V18H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
126
- <path d="M8 15L8 13H12V15H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
127
- <path d="M11 24H13L13 7H15L12 0L9 7H11L11 24Z" fill="var(--instrument-regular-secondary-color)"/>
128
- <path d="M5 24L5 22H12V24H5Z" fill="var(--instrument-regular-secondary-color)"/>
129
- <path d="M5 21L5 19H12V21H5Z" fill="var(--instrument-regular-secondary-color)"/>
130
- <path d="M5 18L5 16H12V18H5Z" fill="var(--instrument-regular-secondary-color)"/>
131
- <path d="M8 15L8 13H12V15H5Z" fill="var(--instrument-regular-secondary-color)"/>`,
132
- 'wind-10.svg': svg`<path d="M11 24H13L13 7H15L12 0L9 7H11L11 24Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
133
- <path d="M5 24L5 22H12V24H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
134
- <path d="M5 21L5 19H12V21H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
135
- <path d="M5 18L5 16H12V18H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
136
- <path d="M5 15L5 13H12V15H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
137
- <path d="M8 12L8 10H12V12H8Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
138
- <path d="M11 24H13L13 7H15L12 0L9 7H11L11 24Z" fill="var(--instrument-regular-secondary-color)"/>
139
- <path d="M5 24L5 22H12V24H5Z" fill="var(--instrument-regular-secondary-color)"/>
140
- <path d="M5 21L5 19H12V21H5Z" fill="var(--instrument-regular-secondary-color)"/>
141
- <path d="M5 18L5 16H12V18H5Z" fill="var(--instrument-regular-secondary-color)"/>
142
- <path d="M5 15L5 13H12V15H5Z" fill="var(--instrument-regular-secondary-color)"/>
143
- <path d="M8 12L8 10H12V12H8Z" fill="var(--instrument-regular-secondary-color)"/>`,
144
- 'wind-11.svg': svg`<path d="M5 22L13 24L13 7H15L12 0L9 7H11L11 20L5 22Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
145
- <path d="M5 22L13 24L13 7H15L12 0L9 7H11L11 20L5 22Z" fill="var(--instrument-regular-secondary-color)"/>`,
146
- 'wind-12.svg': svg`<path d="M5 22L13 24L13 7H15L12 0L9 7H11L11 19L5 22Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
147
- <path d="M5 18L5 16H12V18H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
148
- <path d="M5 22L13 24L13 7H15L12 0L9 7H11L11 19L5 22Z" fill="var(--instrument-regular-secondary-color)"/>
149
- <path d="M5 18L5 16H12V18H5Z" fill="var(--instrument-regular-secondary-color)"/>`,
150
- 'wind-13.svg': svg`<path d="M5 22L13 24L13 7H15L12 0L9 7H11L11 19L5 22Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
151
- <path d="M5 18L5 16H12V18H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
152
- <path d="M5 15L5 13H12V15H5Z" stroke="var(--border-silhouette-color)" stroke-width="2"/>
153
- <path d="M5 22L13 24L13 7H15L12 0L9 7H11L11 19L5 22Z" fill="var(--instrument-regular-secondary-color)"/>
154
- <path d="M5 18L5 16H12V18H5Z" fill="var(--instrument-regular-secondary-color)"/>
155
- <path d="M5 15L5 13H12V15H5Z" fill="var(--instrument-regular-secondary-color)"/>`,
156
189
  };
@@ -71,7 +71,7 @@ Source of truth: \`packages/openbridge-webcomponents/src/navigation-instruments/
71
71
  areas: {control: {type: 'object'}},
72
72
  padding: {control: {type: 'range', min: 0, max: 100, step: 1}},
73
73
  vessels: {control: {type: 'object'}},
74
- wind: {control: {type: 'range', min: 0, max: 12, step: 1}},
74
+ windKnots: {control: {type: 'range', min: 0, max: 70, step: 1}},
75
75
  windFromDirectionDeg: {control: {type: 'range', min: 0, max: 360, step: 1}},
76
76
  windSymbolRadius: {control: {type: 'range', min: 0, max: 360, step: 1}},
77
77
  current: {control: {type: 'range', min: 0, max: 4, step: 1}},
@@ -194,7 +194,7 @@ export const WithStarboardPortIndicator: Story = {
194
194
 
195
195
  export const WithWind: Story = {
196
196
  args: {
197
- wind: 10,
197
+ windKnots: 50,
198
198
  windFromDirectionDeg: 116,
199
199
  padding: 70,
200
200
  windSymbolRadius: 190,
@@ -222,7 +222,7 @@ export class ObcWatch extends LitElement {
222
222
  @property({type: Boolean}) crosshairEnabled: boolean = false;
223
223
  @property({type: Boolean}) showLabels: boolean = false;
224
224
  @property({type: Array, attribute: false}) vessels: WatchVessel[] = [];
225
- @property({type: Number}) wind: number | null = null;
225
+ @property({type: Number}) windKnots: number | null = null;
226
226
  @property({type: Number}) windFromDirectionDeg: number | null = null;
227
227
  @property({type: Number}) windSymbolRadius: number | null = null;
228
228
  @property({type: String}) windColor: string | undefined;
@@ -766,9 +766,9 @@ export class ObcWatch extends LitElement {
766
766
  })
767
767
  : nothing;
768
768
  const wind =
769
- this.wind != null && this.windFromDirectionDeg != null
769
+ this.windKnots != null && this.windFromDirectionDeg != null
770
770
  ? svg`<g transform="scale(${this.scaleWindIcon})">${renderWind({
771
- wind: this.wind,
771
+ windKnots: this.windKnots,
772
772
  fromDirectionDeg: this.windFromDirectionDeg,
773
773
  radius: this.windSymbolRadius ?? 192,
774
774
  color: this.windColor,
@@ -76,7 +76,7 @@ const meta: Meta<typeof ObcWind> = {
76
76
  width: 400,
77
77
  vesselHeadingDeg: 60,
78
78
  currentWindFromDirection: 100,
79
- currentWindSpeedBeaufort: 5,
79
+ currentWindSpeedKnots: 25,
80
80
  windHistogramData: windHistogramData,
81
81
  },
82
82
  argTypes: {
@@ -85,8 +85,9 @@ const meta: Meta<typeof ObcWind> = {
85
85
  currentWindFromDirection: {
86
86
  control: {type: 'range', min: 0, max: 360, step: 1},
87
87
  },
88
- currentWindSpeedBeaufort: {
89
- control: {type: 'range', min: 0, max: 12, step: 1},
88
+ currentWindSpeedKnots: {
89
+ control: {type: 'range', min: 0, max: 75, step: 1},
90
+ description: 'Wind speed in knots.',
90
91
  },
91
92
  windHistogramData: {control: 'object'},
92
93
  vesselImage: {
@@ -33,7 +33,7 @@ const WIND_HISTOGRAM_MIN_RADIUS = 50;
33
33
  @customElement('obc-wind')
34
34
  export class ObcWind extends LitElement {
35
35
  @property({type: Number}) currentWindFromDirection: number = 0;
36
- @property({type: Number}) currentWindSpeedBeaufort: number = 1;
36
+ @property({type: Number}) currentWindSpeedKnots: number = 25;
37
37
  @property({type: Array, attribute: false})
38
38
  windHistogramData: WindHistogramData[] = [];
39
39
  @property({type: String}) vesselImage: VesselImage = VesselImage.genericTop;
@@ -146,7 +146,7 @@ export class ObcWind extends LitElement {
146
146
  ${this.renderWindHistogram(variant)}
147
147
  <obc-watch
148
148
  .watchCircleType=${watchCircleType}
149
- .wind=${this.currentWindSpeedBeaufort}
149
+ .windKnots=${this.currentWindSpeedKnots}
150
150
  .windFromDirectionDeg=${this.currentWindFromDirection}
151
151
  .windSymbolRadius=${windSymbolRadius}
152
152
  .scaleWindIcon=${scaleWindIcon}
@@ -11,15 +11,18 @@ type WindIndicatorArgs = {
11
11
  type: WindIndicatorType;
12
12
  direction: WindIndicatorDirection;
13
13
  priority: WindIndicatorPriority;
14
- level: number;
14
+ currentWindSpeedKnots: number;
15
15
  rotationAngle: number;
16
- windFromAngle: number;
16
+ currentWindFromDirection: number;
17
17
  angle?: number;
18
18
  'wind-from-angle'?: number;
19
+ 'current-wind-from-direction'?: number;
19
20
  'rotation-angle'?: number;
20
- clampedLevel?: number;
21
+ 'current-wind-speed-knots'?: number;
22
+ iconIndex?: number;
21
23
  accentColor?: string;
22
24
  windIconCache?: unknown;
25
+ windFromAngle?: number;
23
26
  };
24
27
 
25
28
  const meta: Meta<WindIndicatorArgs> = {
@@ -37,14 +40,14 @@ const meta: Meta<WindIndicatorArgs> = {
37
40
  .type=${args.type}
38
41
  .direction=${args.direction}
39
42
  .priority=${args.priority}
40
- .level=${args.level}
43
+ .currentWindSpeedKnots=${args.currentWindSpeedKnots}
41
44
  .rotationAngle=${args.rotationAngle}
42
- .windFromAngle=${args.windFromAngle}
45
+ .currentWindFromDirection=${args.currentWindFromDirection}
43
46
  ></obc-wind-indicator>
44
47
  `,
45
48
  args: {
46
- windFromAngle: 0,
47
- level: 7,
49
+ currentWindFromDirection: 0,
50
+ currentWindSpeedKnots: 35,
48
51
  type: WindIndicatorType.arrow,
49
52
  direction: WindIndicatorDirection.true,
50
53
  priority: WindIndicatorPriority.regular,
@@ -59,8 +62,8 @@ const meta: Meta<WindIndicatorArgs> = {
59
62
  control: {type: 'select'},
60
63
  options: Object.values(WindIndicatorDirection),
61
64
  },
62
- windFromAngle: {
63
- name: 'Wind From Angle',
65
+ currentWindFromDirection: {
66
+ name: 'Current Wind From Direction',
64
67
  description: 'Wind-from angle in degrees. 0/360 = wind from north.',
65
68
  control: {type: 'range', min: 0, max: 360, step: 1},
66
69
  },
@@ -74,12 +77,19 @@ const meta: Meta<WindIndicatorArgs> = {
74
77
  control: {type: 'select'},
75
78
  options: Object.values(WindIndicatorPriority),
76
79
  },
77
- level: {control: {type: 'range', min: 0, max: 12, step: 1}},
80
+ currentWindSpeedKnots: {
81
+ description:
82
+ 'Wind speed in knots. Mapped to barb icons in 5-kn steps (standard meteorological wind-barb convention).',
83
+ control: {type: 'range', min: 0, max: 75, step: 1},
84
+ },
78
85
 
79
86
  angle: {table: {disable: true}, control: false},
87
+ windFromAngle: {table: {disable: true}, control: false},
80
88
  'wind-from-angle': {table: {disable: true}, control: false},
89
+ 'current-wind-from-direction': {table: {disable: true}, control: false},
81
90
  'rotation-angle': {table: {disable: true}, control: false},
82
- clampedLevel: {table: {disable: true}, control: false},
91
+ 'current-wind-speed-knots': {table: {disable: true}, control: false},
92
+ iconIndex: {table: {disable: true}, control: false},
83
93
  accentColor: {table: {disable: true}, control: false},
84
94
  windIconCache: {table: {disable: true}, control: false},
85
95
  },
@@ -121,6 +131,6 @@ export const Labeled: Story = {
121
131
  type: WindIndicatorType.labeled,
122
132
  direction: WindIndicatorDirection.true,
123
133
  priority: WindIndicatorPriority.regular,
124
- level: 12,
134
+ currentWindSpeedKnots: 60,
125
135
  },
126
136
  };