@oicl/openbridge-webcomponents 0.0.20260407101310 → 0.0.20260407112816
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/building-blocks/instrument-radial/instrument-radial.d.ts +3 -0
- package/dist/building-blocks/instrument-radial/instrument-radial.d.ts.map +1 -1
- package/dist/building-blocks/instrument-radial/instrument-radial.js +50 -22
- package/dist/building-blocks/instrument-radial/instrument-radial.js.map +1 -1
- package/dist/navigation-instruments/compass/arrow.d.ts +1 -1
- package/dist/navigation-instruments/compass/arrow.d.ts.map +1 -1
- package/dist/navigation-instruments/compass/arrow.js +3 -3
- package/dist/navigation-instruments/compass/arrow.js.map +1 -1
- package/dist/navigation-instruments/compass/compass.d.ts +12 -6
- package/dist/navigation-instruments/compass/compass.d.ts.map +1 -1
- package/dist/navigation-instruments/compass/compass.js +29 -24
- package/dist/navigation-instruments/compass/compass.js.map +1 -1
- package/dist/navigation-instruments/compass-flat/compass-flat.d.ts +37 -1
- package/dist/navigation-instruments/compass-flat/compass-flat.d.ts.map +1 -1
- package/dist/navigation-instruments/compass-flat/compass-flat.js +34 -3
- package/dist/navigation-instruments/compass-flat/compass-flat.js.map +1 -1
- package/dist/navigation-instruments/compass-sector/compass-sector.css.js +34 -0
- package/dist/navigation-instruments/compass-sector/compass-sector.css.js.map +1 -0
- package/dist/navigation-instruments/compass-sector/compass-sector.d.ts +101 -0
- package/dist/navigation-instruments/compass-sector/compass-sector.d.ts.map +1 -0
- package/dist/navigation-instruments/compass-sector/compass-sector.js +404 -0
- package/dist/navigation-instruments/compass-sector/compass-sector.js.map +1 -0
- package/dist/navigation-instruments/rate-of-turn/rate-of-turn.controller.d.ts +15 -2
- package/dist/navigation-instruments/rate-of-turn/rate-of-turn.controller.d.ts.map +1 -1
- package/dist/navigation-instruments/rate-of-turn/rate-of-turn.controller.js +50 -18
- package/dist/navigation-instruments/rate-of-turn/rate-of-turn.controller.js.map +1 -1
- package/dist/navigation-instruments/rate-of-turn/rate-of-turn.d.ts +40 -6
- package/dist/navigation-instruments/rate-of-turn/rate-of-turn.d.ts.map +1 -1
- package/dist/navigation-instruments/rate-of-turn/rate-of-turn.js +40 -47
- package/dist/navigation-instruments/rate-of-turn/rate-of-turn.js.map +1 -1
- package/dist/navigation-instruments/rate-of-turn/rot-renderer.d.ts +63 -0
- package/dist/navigation-instruments/rate-of-turn/rot-renderer.d.ts.map +1 -0
- package/dist/navigation-instruments/rate-of-turn/rot-renderer.js +211 -0
- package/dist/navigation-instruments/rate-of-turn/rot-renderer.js.map +1 -0
- package/dist/navigation-instruments/rot-sector/rot-sector.d.ts +10 -4
- package/dist/navigation-instruments/rot-sector/rot-sector.d.ts.map +1 -1
- package/dist/navigation-instruments/rot-sector/rot-sector.js +13 -3
- package/dist/navigation-instruments/rot-sector/rot-sector.js.map +1 -1
- package/dist/navigation-instruments/rudder/rudder.d.ts +4 -0
- package/dist/navigation-instruments/rudder/rudder.d.ts.map +1 -1
- package/dist/navigation-instruments/rudder/rudder.js +55 -19
- package/dist/navigation-instruments/rudder/rudder.js.map +1 -1
- package/dist/navigation-instruments/watch/advice.d.ts +3 -3
- package/dist/navigation-instruments/watch/advice.d.ts.map +1 -1
- package/dist/navigation-instruments/watch/advice.js +68 -16
- package/dist/navigation-instruments/watch/advice.js.map +1 -1
- package/dist/navigation-instruments/watch/tickmark.d.ts +2 -1
- package/dist/navigation-instruments/watch/tickmark.d.ts.map +1 -1
- package/dist/navigation-instruments/watch/tickmark.js +15 -13
- package/dist/navigation-instruments/watch/tickmark.js.map +1 -1
- package/dist/navigation-instruments/watch/watch.d.ts +29 -0
- package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
- package/dist/navigation-instruments/watch/watch.js +256 -44
- package/dist/navigation-instruments/watch/watch.js.map +1 -1
- package/dist/navigation-instruments/watch-flat/watch-flat.d.ts +29 -1
- package/dist/navigation-instruments/watch-flat/watch-flat.d.ts.map +1 -1
- package/dist/navigation-instruments/watch-flat/watch-flat.js +162 -17
- package/dist/navigation-instruments/watch-flat/watch-flat.js.map +1 -1
- package/dist/svghelpers/arc-frame.d.ts +42 -0
- package/dist/svghelpers/arc-frame.d.ts.map +1 -0
- package/dist/svghelpers/arc-frame.js +123 -0
- package/dist/svghelpers/arc-frame.js.map +1 -0
- package/package.json +1 -1
- package/dist/navigation-instruments/compass/rot.d.ts +0 -4
- package/dist/navigation-instruments/compass/rot.d.ts.map +0 -1
- package/dist/navigation-instruments/compass/rot.js +0 -11
- package/dist/navigation-instruments/compass/rot.js.map +0 -1
|
@@ -1,12 +1,46 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
import { WatchCircleType, RotType, RotPosition } from '../watch/watch.js';
|
|
3
|
+
import { Priority } from '../types.js';
|
|
2
4
|
import '../watch/watch.js';
|
|
5
|
+
export { RotType, RotPosition };
|
|
6
|
+
/**
|
|
7
|
+
* `<obc-rate-of-turn>` — Standalone rate-of-turn indicator rendered on a circular watch face.
|
|
8
|
+
*
|
|
9
|
+
* Wraps `<obc-watch>` to display a spinning-dot or arc-bar ROT visualization
|
|
10
|
+
* without any additional instrument overlays. Useful for isolating the ROT
|
|
11
|
+
* indicator in layouts where heading/compass elements are handled separately.
|
|
12
|
+
*
|
|
13
|
+
* ## Features
|
|
14
|
+
*
|
|
15
|
+
* - **Dot mode** (`rotType="dots"`): Five evenly-spaced dots spin at the
|
|
16
|
+
* configured `rotationsPerMinute`.
|
|
17
|
+
* - **Bar mode** (`rotType="bar"`): A banana-shaped arc from `barStartAngle`
|
|
18
|
+
* to `barEndAngle` with clipped spinning dots inside.
|
|
19
|
+
* - **Track position**: Place the indicator on the outer scale ring
|
|
20
|
+
* (`rotPosition="scale"`) or the inner circle
|
|
21
|
+
* (`rotPosition="innerCircle"`).
|
|
22
|
+
* - **Color priority**: Uses `priority` to select regular or enhanced color
|
|
23
|
+
* palette.
|
|
24
|
+
*
|
|
25
|
+
* ## Usage Guidelines
|
|
26
|
+
*
|
|
27
|
+
* - Set `rotationsPerMinute` to the current sensor value; sign controls
|
|
28
|
+
* spin direction (positive = clockwise).
|
|
29
|
+
* - In bar mode, `barStartAngle` and `barEndAngle` define the static arc
|
|
30
|
+
* span (0° = 12 o'clock, clockwise).
|
|
31
|
+
* - Change `watchCircleType` to match the surrounding instrument ring style
|
|
32
|
+
* (e.g. `triple` for compass contexts).
|
|
33
|
+
*
|
|
34
|
+
* @element obc-rate-of-turn
|
|
35
|
+
*/
|
|
3
36
|
export declare class ObcRateOfTurn extends LitElement {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
37
|
+
rotationsPerMinute: number;
|
|
38
|
+
rotType: RotType;
|
|
39
|
+
rotPosition: RotPosition;
|
|
40
|
+
priority: Priority;
|
|
41
|
+
barStartAngle: number;
|
|
42
|
+
barEndAngle: number;
|
|
43
|
+
watchCircleType: WatchCircleType;
|
|
10
44
|
static styles: import('lit').CSSResult;
|
|
11
45
|
render(): import('lit-html').TemplateResult<1>;
|
|
12
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-of-turn.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/rate-of-turn/rate-of-turn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAE1C,OAAO,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"rate-of-turn.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/rate-of-turn/rate-of-turn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAE1C,OAAO,mBAAmB,CAAC;AAC3B,OAAO,EAAC,eAAe,EAAE,OAAO,EAAE,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAExE,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAErC,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,qBACa,aAAc,SAAQ,UAAU;IACjB,kBAAkB,EAAE,MAAM,CAAK;IAE/B,OAAO,EAAE,OAAO,CAAgB;IAChC,WAAW,EAAE,WAAW,CAAqB;IAC7C,QAAQ,EAAE,QAAQ,CAAoB;IACtC,aAAa,EAAE,MAAM,CAAK;IAC1B,WAAW,EAAE,MAAM,CAAM;IACzB,eAAe,EAAE,eAAe,CACjC;IAEzB,OAAgB,MAAM,0BAkBpB;IAEO,MAAM;CAahB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,aAAa,CAAC;KACnC;CACF"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { css, LitElement, html } from "lit";
|
|
2
|
-
import { property
|
|
2
|
+
import { property } from "lit/decorators.js";
|
|
3
3
|
import { WatchCircleType } from "../watch/watch.js";
|
|
4
|
-
import { RateOfTurnController } from "./rate-of-turn.controller.js";
|
|
5
4
|
import { customElement } from "../../decorator.js";
|
|
5
|
+
import { Priority } from "../types.js";
|
|
6
|
+
import { RotType, RotPosition } from "./rot-renderer.js";
|
|
6
7
|
var __defProp = Object.defineProperty;
|
|
7
8
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
9
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -16,50 +17,25 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
16
17
|
let ObcRateOfTurn = class extends LitElement {
|
|
17
18
|
constructor() {
|
|
18
19
|
super(...arguments);
|
|
19
|
-
this.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
get rotationsPerMinute() {
|
|
28
|
-
return this._rotationsPerMinute;
|
|
29
|
-
}
|
|
30
|
-
firstUpdated() {
|
|
31
|
-
this.rateOfTurnController = new RateOfTurnController(
|
|
32
|
-
this,
|
|
33
|
-
this.spinner,
|
|
34
|
-
this.rotationsPerMinute
|
|
35
|
-
);
|
|
20
|
+
this.rotationsPerMinute = 1;
|
|
21
|
+
this.rotType = RotType.dots;
|
|
22
|
+
this.rotPosition = RotPosition.scale;
|
|
23
|
+
this.priority = Priority.regular;
|
|
24
|
+
this.barStartAngle = 0;
|
|
25
|
+
this.barEndAngle = 30;
|
|
26
|
+
this.watchCircleType = WatchCircleType.single;
|
|
36
27
|
}
|
|
37
28
|
render() {
|
|
38
29
|
return html`<div class="container">
|
|
39
|
-
<obc-watch
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
fill="var(--instrument-enhanced-secondary-color)"
|
|
49
|
-
/>
|
|
50
|
-
<path
|
|
51
|
-
d="M148.427 390.449C151.024 386.874 156.027 386.082 159.601 388.679C163.176 391.276 163.968 396.279 161.371 399.853C158.774 403.428 153.771 404.22 150.197 401.623C146.622 399.026 145.83 394.023 148.427 390.449Z"
|
|
52
|
-
fill="var(--instrument-enhanced-secondary-color)"
|
|
53
|
-
/>
|
|
54
|
-
<path
|
|
55
|
-
d="M350.625 399.853C348.028 396.279 348.82 391.276 352.395 388.679C355.969 386.082 360.972 386.874 363.569 390.449C366.166 394.023 365.374 399.026 361.799 401.623C358.225 404.22 353.222 403.428 350.625 399.853Z"
|
|
56
|
-
fill="var(--instrument-enhanced-secondary-color)"
|
|
57
|
-
/>
|
|
58
|
-
<path
|
|
59
|
-
d="M422.052 210.458C417.85 211.823 413.336 209.523 411.971 205.321C410.606 201.119 412.905 196.606 417.107 195.241C421.309 193.875 425.823 196.175 427.188 200.377C428.553 204.579 426.254 209.092 422.052 210.458Z"
|
|
60
|
-
fill="var(--instrument-enhanced-secondary-color)"
|
|
61
|
-
/>
|
|
62
|
-
</svg>
|
|
30
|
+
<obc-watch
|
|
31
|
+
.watchCircleType=${this.watchCircleType}
|
|
32
|
+
.priority=${this.priority}
|
|
33
|
+
.rotType=${this.rotType}
|
|
34
|
+
.rotPosition=${this.rotPosition}
|
|
35
|
+
.rotStartAngle=${this.barStartAngle}
|
|
36
|
+
.rotEndAngle=${this.barEndAngle}
|
|
37
|
+
.rotationsPerMinute=${this.rotationsPerMinute}
|
|
38
|
+
></obc-watch>
|
|
63
39
|
</div>`;
|
|
64
40
|
}
|
|
65
41
|
};
|
|
@@ -84,14 +60,31 @@ ObcRateOfTurn.styles = css`
|
|
|
84
60
|
`;
|
|
85
61
|
__decorateClass([
|
|
86
62
|
property({ type: Number })
|
|
87
|
-
], ObcRateOfTurn.prototype, "rotationsPerMinute",
|
|
63
|
+
], ObcRateOfTurn.prototype, "rotationsPerMinute", 2);
|
|
64
|
+
__decorateClass([
|
|
65
|
+
property({ type: String })
|
|
66
|
+
], ObcRateOfTurn.prototype, "rotType", 2);
|
|
67
|
+
__decorateClass([
|
|
68
|
+
property({ type: String })
|
|
69
|
+
], ObcRateOfTurn.prototype, "rotPosition", 2);
|
|
70
|
+
__decorateClass([
|
|
71
|
+
property({ type: String })
|
|
72
|
+
], ObcRateOfTurn.prototype, "priority", 2);
|
|
73
|
+
__decorateClass([
|
|
74
|
+
property({ type: Number })
|
|
75
|
+
], ObcRateOfTurn.prototype, "barStartAngle", 2);
|
|
76
|
+
__decorateClass([
|
|
77
|
+
property({ type: Number })
|
|
78
|
+
], ObcRateOfTurn.prototype, "barEndAngle", 2);
|
|
88
79
|
__decorateClass([
|
|
89
|
-
|
|
90
|
-
], ObcRateOfTurn.prototype, "
|
|
80
|
+
property({ type: String })
|
|
81
|
+
], ObcRateOfTurn.prototype, "watchCircleType", 2);
|
|
91
82
|
ObcRateOfTurn = __decorateClass([
|
|
92
83
|
customElement("obc-rate-of-turn")
|
|
93
84
|
], ObcRateOfTurn);
|
|
94
85
|
export {
|
|
95
|
-
ObcRateOfTurn
|
|
86
|
+
ObcRateOfTurn,
|
|
87
|
+
RotPosition,
|
|
88
|
+
RotType
|
|
96
89
|
};
|
|
97
90
|
//# sourceMappingURL=rate-of-turn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rate-of-turn.js","sources":["../../../src/navigation-instruments/rate-of-turn/rate-of-turn.ts"],"sourcesContent":["import {LitElement, css, html} from 'lit';\nimport {property
|
|
1
|
+
{"version":3,"file":"rate-of-turn.js","sources":["../../../src/navigation-instruments/rate-of-turn/rate-of-turn.ts"],"sourcesContent":["import {LitElement, css, html} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport '../watch/watch.js';\nimport {WatchCircleType, RotType, RotPosition} from '../watch/watch.js';\nimport {customElement} from '../../decorator.js';\nimport {Priority} from '../types.js';\n\nexport {RotType, RotPosition};\n\n/**\n * `<obc-rate-of-turn>` — Standalone rate-of-turn indicator rendered on a circular watch face.\n *\n * Wraps `<obc-watch>` to display a spinning-dot or arc-bar ROT visualization\n * without any additional instrument overlays. Useful for isolating the ROT\n * indicator in layouts where heading/compass elements are handled separately.\n *\n * ## Features\n *\n * - **Dot mode** (`rotType=\"dots\"`): Five evenly-spaced dots spin at the\n * configured `rotationsPerMinute`.\n * - **Bar mode** (`rotType=\"bar\"`): A banana-shaped arc from `barStartAngle`\n * to `barEndAngle` with clipped spinning dots inside.\n * - **Track position**: Place the indicator on the outer scale ring\n * (`rotPosition=\"scale\"`) or the inner circle\n * (`rotPosition=\"innerCircle\"`).\n * - **Color priority**: Uses `priority` to select regular or enhanced color\n * palette.\n *\n * ## Usage Guidelines\n *\n * - Set `rotationsPerMinute` to the current sensor value; sign controls\n * spin direction (positive = clockwise).\n * - In bar mode, `barStartAngle` and `barEndAngle` define the static arc\n * span (0° = 12 o'clock, clockwise).\n * - Change `watchCircleType` to match the surrounding instrument ring style\n * (e.g. `triple` for compass contexts).\n *\n * @element obc-rate-of-turn\n */\n@customElement('obc-rate-of-turn')\nexport class ObcRateOfTurn extends LitElement {\n @property({type: Number}) rotationsPerMinute: number = 1;\n\n @property({type: String}) rotType: RotType = RotType.dots;\n @property({type: String}) rotPosition: RotPosition = RotPosition.scale;\n @property({type: String}) priority: Priority = Priority.regular;\n @property({type: Number}) barStartAngle: number = 0;\n @property({type: Number}) barEndAngle: number = 30;\n @property({type: String}) watchCircleType: WatchCircleType =\n WatchCircleType.single;\n\n static override styles = css`\n * {\n box-sizing: border-box;\n }\n\n .container {\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .container > * {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n }\n `;\n\n override render() {\n return html`<div class=\"container\">\n <obc-watch\n .watchCircleType=${this.watchCircleType}\n .priority=${this.priority}\n .rotType=${this.rotType}\n .rotPosition=${this.rotPosition}\n .rotStartAngle=${this.barStartAngle}\n .rotEndAngle=${this.barEndAngle}\n .rotationsPerMinute=${this.rotationsPerMinute}\n ></obc-watch>\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-rate-of-turn': ObcRateOfTurn;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAwCO,IAAM,gBAAN,cAA4B,WAAW;AAAA,EAAvC,cAAA;AAAA,UAAA,GAAA,SAAA;AACqB,SAAA,qBAA6B;AAE7B,SAAA,UAAmB,QAAQ;AAC3B,SAAA,cAA2B,YAAY;AACvC,SAAA,WAAqB,SAAS;AAC9B,SAAA,gBAAwB;AACxB,SAAA,cAAsB;AACtB,SAAA,kBACxB,gBAAgB;AAAA,EAAA;AAAA,EAsBT,SAAS;AAChB,WAAO;AAAA;AAAA,2BAEgB,KAAK,eAAe;AAAA,oBAC3B,KAAK,QAAQ;AAAA,mBACd,KAAK,OAAO;AAAA,uBACR,KAAK,WAAW;AAAA,yBACd,KAAK,aAAa;AAAA,uBACpB,KAAK,WAAW;AAAA,8BACT,KAAK,kBAAkB;AAAA;AAAA;AAAA,EAGnD;AACF;AA5Ca,cAWK,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAVC,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GADb,cACe,WAAA,sBAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAHb,cAGe,WAAA,WAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAJb,cAIe,WAAA,eAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GALb,cAKe,WAAA,YAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GANb,cAMe,WAAA,iBAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAPb,cAOe,WAAA,eAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GARb,cAQe,WAAA,mBAAA,CAAA;AARf,gBAAN,gBAAA;AAAA,EADN,cAAc,kBAAkB;AAAA,GACpB,aAAA;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { SVGTemplateResult } from 'lit';
|
|
2
|
+
export declare enum RotType {
|
|
3
|
+
dots = "dots",
|
|
4
|
+
bar = "bar"
|
|
5
|
+
}
|
|
6
|
+
export declare enum RotPosition {
|
|
7
|
+
scale = "scale",
|
|
8
|
+
innerCircle = "innerCircle"
|
|
9
|
+
}
|
|
10
|
+
export declare function renderRotDots(color: string, position: RotPosition, radiusOffset?: number): SVGTemplateResult;
|
|
11
|
+
export declare function shortestAngularDeltaDeg(startAngle: number, endAngle: number): number;
|
|
12
|
+
export interface RotBarConfig {
|
|
13
|
+
startAngle: number;
|
|
14
|
+
endAngle: number;
|
|
15
|
+
color: string;
|
|
16
|
+
barColor: string;
|
|
17
|
+
position: RotPosition;
|
|
18
|
+
endDotFill?: string;
|
|
19
|
+
endDotStroke?: string;
|
|
20
|
+
maskId?: string;
|
|
21
|
+
radiusOffset?: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function renderRotBarStatic(config: RotBarConfig): SVGTemplateResult;
|
|
24
|
+
export declare function renderRotBarDots(color: string, position: RotPosition, radiusOffset?: number): SVGTemplateResult;
|
|
25
|
+
/**
|
|
26
|
+
* Angular spacing between dots in degrees — same as radial (360 / 5 = 72).
|
|
27
|
+
* In linear mode this is converted to pixels via `dotSpacing = 72 * translationScale`.
|
|
28
|
+
*/
|
|
29
|
+
export declare const LINEAR_DOT_ANGLE_SPACING: number;
|
|
30
|
+
export declare enum LinearRotPosition {
|
|
31
|
+
track = "track",
|
|
32
|
+
scale = "scale"
|
|
33
|
+
}
|
|
34
|
+
export declare function renderLinearRotDots(color: string, trackY: number, dotSpacing: number, visibleWidth: number): SVGTemplateResult;
|
|
35
|
+
export interface LinearRotBarConfig {
|
|
36
|
+
startX: number;
|
|
37
|
+
endX: number;
|
|
38
|
+
color: string;
|
|
39
|
+
barColor: string;
|
|
40
|
+
trackY: number;
|
|
41
|
+
endDotFill?: string;
|
|
42
|
+
endDotStroke?: string;
|
|
43
|
+
maskId?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Render the static horizontal bar, end-dot, and `<clipPath>` for a linear
|
|
47
|
+
* ROT indicator. Analogous to `renderRotBarStatic` for radial instruments.
|
|
48
|
+
*
|
|
49
|
+
* The bar is a rounded capsule from `startX` to `endX` at vertical
|
|
50
|
+
* position `trackY`. A ring-shaped end-dot sits at `endX`. The clip
|
|
51
|
+
* region is padded at the end side so spinning bar-dots snap in/out
|
|
52
|
+
* cleanly (same rationale as the angular padding in the radial version).
|
|
53
|
+
*
|
|
54
|
+
* Returns empty SVG when the bar span is less than 1 px.
|
|
55
|
+
*/
|
|
56
|
+
export declare function renderLinearRotBarStatic(config: LinearRotBarConfig): SVGTemplateResult;
|
|
57
|
+
/**
|
|
58
|
+
* Render filled dots along a horizontal track, intended to be placed
|
|
59
|
+
* inside a `<g clip-path="…">` that clips to the bar shape.
|
|
60
|
+
* Analogous to `renderRotBarDots` for radial instruments.
|
|
61
|
+
*/
|
|
62
|
+
export declare function renderLinearRotBarDots(color: string, trackY: number, dotSpacing: number, visibleWidth: number): SVGTemplateResult;
|
|
63
|
+
//# sourceMappingURL=rot-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rot-renderer.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/rate-of-turn/rot-renderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAM,iBAAiB,EAAC,MAAM,KAAK,CAAC;AAE3C,oBAAY,OAAO;IACjB,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,WAAW,gBAAgB;CAC5B;AAoCD,wBAAgB,aAAa,CAC3B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,WAAW,EACrB,YAAY,SAAI,GACf,iBAAiB,CAMnB;AA8CD,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,iBAAiB,CAgD1E;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,WAAW,EACrB,YAAY,SAAI,GACf,iBAAiB,CASnB;AAMD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,QAAkB,CAAC;AAIxD,oBAAY,iBAAiB;IAC3B,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAkCD,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,iBAAiB,CAQnB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,kBAAkB,GACzB,iBAAiB,CAuCnB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,iBAAiB,CAQnB"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { svg } from "lit";
|
|
2
|
+
var RotType = /* @__PURE__ */ ((RotType2) => {
|
|
3
|
+
RotType2["dots"] = "dots";
|
|
4
|
+
RotType2["bar"] = "bar";
|
|
5
|
+
return RotType2;
|
|
6
|
+
})(RotType || {});
|
|
7
|
+
var RotPosition = /* @__PURE__ */ ((RotPosition2) => {
|
|
8
|
+
RotPosition2["scale"] = "scale";
|
|
9
|
+
RotPosition2["innerCircle"] = "innerCircle";
|
|
10
|
+
return RotPosition2;
|
|
11
|
+
})(RotPosition || {});
|
|
12
|
+
const DOT_COUNT = 5;
|
|
13
|
+
const DOT_ANGLES = Array.from(
|
|
14
|
+
{ length: DOT_COUNT },
|
|
15
|
+
(_, i) => 360 / DOT_COUNT * i
|
|
16
|
+
);
|
|
17
|
+
const SCALE_RADIUS = 172;
|
|
18
|
+
const INNER_CIRCLE_RADIUS = 100;
|
|
19
|
+
const BAR_HALF_THICKNESS = 8;
|
|
20
|
+
const DOT_RADIUS = BAR_HALF_THICKNESS;
|
|
21
|
+
const BAR_DOT_RADIUS = BAR_HALF_THICKNESS * 0.75;
|
|
22
|
+
const BAR_DOT_STROKE = BAR_HALF_THICKNESS * 0.5;
|
|
23
|
+
const BAR_DOT_INNER_RADIUS = BAR_DOT_RADIUS - BAR_DOT_STROKE / 2;
|
|
24
|
+
function getTrackRadius(position, radiusOffset = 0) {
|
|
25
|
+
const base = position === "scale" ? SCALE_RADIUS : INNER_CIRCLE_RADIUS;
|
|
26
|
+
return base + radiusOffset;
|
|
27
|
+
}
|
|
28
|
+
function dotOnTrack(angle, radius) {
|
|
29
|
+
const rad = angle * Math.PI / 180;
|
|
30
|
+
return {
|
|
31
|
+
cx: Math.sin(rad) * radius,
|
|
32
|
+
cy: -Math.cos(rad) * radius
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function renderRotDots(color, position, radiusOffset = 0) {
|
|
36
|
+
const radius = getTrackRadius(position, radiusOffset);
|
|
37
|
+
return svg`${DOT_ANGLES.map((angle) => {
|
|
38
|
+
const { cx, cy } = dotOnTrack(angle, radius);
|
|
39
|
+
return svg`<circle cx="${cx}" cy="${cy}" r="${DOT_RADIUS}" fill="${color}" />`;
|
|
40
|
+
})}`;
|
|
41
|
+
}
|
|
42
|
+
function rotBarPath(startAngle, endAngle, trackRadius) {
|
|
43
|
+
const R = trackRadius + BAR_HALF_THICKNESS;
|
|
44
|
+
const r = trackRadius - BAR_HALF_THICKNESS;
|
|
45
|
+
const a1 = startAngle * Math.PI / 180;
|
|
46
|
+
const a2 = endAngle * Math.PI / 180;
|
|
47
|
+
const outerStartX = Math.sin(a1) * R;
|
|
48
|
+
const outerStartY = -Math.cos(a1) * R;
|
|
49
|
+
const innerStartX = Math.sin(a1) * r;
|
|
50
|
+
const innerStartY = -Math.cos(a1) * r;
|
|
51
|
+
const outerEndX = Math.sin(a2) * R;
|
|
52
|
+
const outerEndY = -Math.cos(a2) * R;
|
|
53
|
+
const innerEndX = Math.sin(a2) * r;
|
|
54
|
+
const innerEndY = -Math.cos(a2) * r;
|
|
55
|
+
const cwSpan = ((a2 - a1) % (2 * Math.PI) + 2 * Math.PI) % (2 * Math.PI);
|
|
56
|
+
let outerSweep;
|
|
57
|
+
let innerSweep;
|
|
58
|
+
if (cwSpan <= Math.PI) {
|
|
59
|
+
outerSweep = 1;
|
|
60
|
+
innerSweep = 0;
|
|
61
|
+
} else {
|
|
62
|
+
outerSweep = 0;
|
|
63
|
+
innerSweep = 1;
|
|
64
|
+
}
|
|
65
|
+
return [
|
|
66
|
+
`M ${outerStartX} ${outerStartY}`,
|
|
67
|
+
`A ${R} ${R} 0 0 ${outerSweep} ${outerEndX} ${outerEndY}`,
|
|
68
|
+
`L ${innerEndX} ${innerEndY}`,
|
|
69
|
+
`A ${r} ${r} 0 0 ${innerSweep} ${innerStartX} ${innerStartY}`,
|
|
70
|
+
`Z`
|
|
71
|
+
].join(" ");
|
|
72
|
+
}
|
|
73
|
+
function shortestAngularDeltaDeg(startAngle, endAngle) {
|
|
74
|
+
const cw = ((endAngle - startAngle) % 360 + 360) % 360;
|
|
75
|
+
return cw <= 180 ? cw : 360 - cw;
|
|
76
|
+
}
|
|
77
|
+
function renderRotBarStatic(config) {
|
|
78
|
+
const {
|
|
79
|
+
startAngle,
|
|
80
|
+
endAngle,
|
|
81
|
+
color,
|
|
82
|
+
barColor,
|
|
83
|
+
position,
|
|
84
|
+
endDotFill = "var(--instrument-frame-primary-color)",
|
|
85
|
+
endDotStroke = color,
|
|
86
|
+
maskId = "rot-bar-mask",
|
|
87
|
+
radiusOffset = 0
|
|
88
|
+
} = config;
|
|
89
|
+
if (shortestAngularDeltaDeg(startAngle, endAngle) < 0.1) {
|
|
90
|
+
return svg``;
|
|
91
|
+
}
|
|
92
|
+
const trackRadius = getTrackRadius(position, radiusOffset);
|
|
93
|
+
const arcPath = rotBarPath(startAngle, endAngle, trackRadius);
|
|
94
|
+
const { cx: endCx, cy: endCy } = dotOnTrack(endAngle, trackRadius);
|
|
95
|
+
const dotAngularPad = Math.asin(BAR_DOT_INNER_RADIUS / trackRadius) * 180 / Math.PI;
|
|
96
|
+
const cwSpan = ((endAngle - startAngle) % 360 + 360) % 360;
|
|
97
|
+
const isCW = cwSpan <= 180;
|
|
98
|
+
const clipPath = rotBarPath(
|
|
99
|
+
startAngle,
|
|
100
|
+
endAngle + (isCW ? dotAngularPad : -dotAngularPad),
|
|
101
|
+
trackRadius
|
|
102
|
+
);
|
|
103
|
+
return svg`
|
|
104
|
+
<defs>
|
|
105
|
+
<clipPath id="${maskId}">
|
|
106
|
+
<path d="${clipPath}" />
|
|
107
|
+
</clipPath>
|
|
108
|
+
</defs>
|
|
109
|
+
<path d="${arcPath}" fill="${barColor}" />
|
|
110
|
+
<circle
|
|
111
|
+
cx="${endCx}" cy="${endCy}" r="${BAR_DOT_RADIUS}"
|
|
112
|
+
fill="${endDotFill}"
|
|
113
|
+
stroke="${endDotStroke}"
|
|
114
|
+
stroke-width="${BAR_DOT_STROKE}"
|
|
115
|
+
/>
|
|
116
|
+
`;
|
|
117
|
+
}
|
|
118
|
+
function renderRotBarDots(color, position, radiusOffset = 0) {
|
|
119
|
+
const radius = getTrackRadius(position, radiusOffset);
|
|
120
|
+
return svg`
|
|
121
|
+
${DOT_ANGLES.map((angle) => {
|
|
122
|
+
const { cx, cy } = dotOnTrack(angle, radius);
|
|
123
|
+
return svg`<circle cx="${cx}" cy="${cy}" r="${BAR_DOT_INNER_RADIUS}" fill="${color}" />`;
|
|
124
|
+
})}
|
|
125
|
+
`;
|
|
126
|
+
}
|
|
127
|
+
const LINEAR_DOT_ANGLE_SPACING = 360 / DOT_COUNT;
|
|
128
|
+
const LINEAR_DOT_RADIUS = BAR_HALF_THICKNESS / 2;
|
|
129
|
+
var LinearRotPosition = /* @__PURE__ */ ((LinearRotPosition2) => {
|
|
130
|
+
LinearRotPosition2["track"] = "track";
|
|
131
|
+
LinearRotPosition2["scale"] = "scale";
|
|
132
|
+
return LinearRotPosition2;
|
|
133
|
+
})(LinearRotPosition || {});
|
|
134
|
+
function linearDotStrip(color, trackY, dotSpacing, visibleWidth, r) {
|
|
135
|
+
if (dotSpacing <= 0) return svg``;
|
|
136
|
+
const cyclePx = DOT_COUNT * dotSpacing;
|
|
137
|
+
const halfRange = visibleWidth / 2 + cyclePx;
|
|
138
|
+
const firstIdx = Math.floor(-halfRange / dotSpacing);
|
|
139
|
+
const lastIdx = Math.ceil(halfRange / dotSpacing);
|
|
140
|
+
const dots = [];
|
|
141
|
+
for (let i = firstIdx; i <= lastIdx; i++) {
|
|
142
|
+
dots.push(
|
|
143
|
+
svg`<circle cx="${i * dotSpacing}" cy="${trackY}" r="${r}" fill="${color}" />`
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
return svg`${dots}`;
|
|
147
|
+
}
|
|
148
|
+
function renderLinearRotDots(color, trackY, dotSpacing, visibleWidth) {
|
|
149
|
+
return linearDotStrip(
|
|
150
|
+
color,
|
|
151
|
+
trackY,
|
|
152
|
+
dotSpacing,
|
|
153
|
+
visibleWidth,
|
|
154
|
+
LINEAR_DOT_RADIUS
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
function renderLinearRotBarStatic(config) {
|
|
158
|
+
const {
|
|
159
|
+
startX,
|
|
160
|
+
endX,
|
|
161
|
+
color,
|
|
162
|
+
barColor,
|
|
163
|
+
trackY,
|
|
164
|
+
endDotFill = "var(--instrument-frame-primary-color)",
|
|
165
|
+
endDotStroke = color,
|
|
166
|
+
maskId = "rot-bar-mask-linear"
|
|
167
|
+
} = config;
|
|
168
|
+
if (Math.abs(endX - startX) < 1) return svg``;
|
|
169
|
+
const h = BAR_HALF_THICKNESS;
|
|
170
|
+
const top = trackY - h;
|
|
171
|
+
const bot = trackY + h;
|
|
172
|
+
const isEndRight = endX >= startX;
|
|
173
|
+
const flatX = startX;
|
|
174
|
+
const roundX = endX;
|
|
175
|
+
const barPath = isEndRight ? `M ${flatX} ${top} L ${roundX} ${top} A ${h} ${h} 0 0 1 ${roundX} ${bot} L ${flatX} ${bot} Z` : `M ${flatX} ${top} L ${roundX} ${top} A ${h} ${h} 0 0 0 ${roundX} ${bot} L ${flatX} ${bot} Z`;
|
|
176
|
+
return svg`
|
|
177
|
+
<defs>
|
|
178
|
+
<clipPath id="${maskId}">
|
|
179
|
+
<path d="${barPath}" />
|
|
180
|
+
</clipPath>
|
|
181
|
+
</defs>
|
|
182
|
+
<path d="${barPath}" fill="${barColor}" />
|
|
183
|
+
<circle
|
|
184
|
+
cx="${endX}" cy="${trackY}" r="${BAR_DOT_RADIUS}"
|
|
185
|
+
fill="${endDotFill}" stroke="${endDotStroke}"
|
|
186
|
+
stroke-width="${BAR_DOT_STROKE}" />
|
|
187
|
+
`;
|
|
188
|
+
}
|
|
189
|
+
function renderLinearRotBarDots(color, trackY, dotSpacing, visibleWidth) {
|
|
190
|
+
return linearDotStrip(
|
|
191
|
+
color,
|
|
192
|
+
trackY,
|
|
193
|
+
dotSpacing,
|
|
194
|
+
visibleWidth,
|
|
195
|
+
LINEAR_DOT_RADIUS
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
export {
|
|
199
|
+
LINEAR_DOT_ANGLE_SPACING,
|
|
200
|
+
LinearRotPosition,
|
|
201
|
+
RotPosition,
|
|
202
|
+
RotType,
|
|
203
|
+
renderLinearRotBarDots,
|
|
204
|
+
renderLinearRotBarStatic,
|
|
205
|
+
renderLinearRotDots,
|
|
206
|
+
renderRotBarDots,
|
|
207
|
+
renderRotBarStatic,
|
|
208
|
+
renderRotDots,
|
|
209
|
+
shortestAngularDeltaDeg
|
|
210
|
+
};
|
|
211
|
+
//# sourceMappingURL=rot-renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rot-renderer.js","sources":["../../../src/navigation-instruments/rate-of-turn/rot-renderer.ts"],"sourcesContent":["/**\n * Rate-of-turn SVG renderer — pure functions for ROT dot and bar overlays.\n *\n * This module provides side-effect-free rendering functions that return\n * `SVGTemplateResult` fragments for compositing into radial instrument SVGs.\n * All geometry is derived from a small set of constants (`BAR_HALF_THICKNESS`,\n * `DOT_COUNT`, and per-position track radii) so dimensions can be tuned from\n * a single place.\n *\n * ## Exported Functions\n *\n * - `renderRotDots(color, position)` — Five evenly-spaced filled dots on the\n * track circle. Intended to be wrapped in a spinning `<g>` by the caller.\n * - `renderRotBarStatic(config)` — The static \"banana\" arc bar, end-dot, and\n * `<clipPath>` definition. The clip region is angularly padded at the end\n * side so spinning dots snap cleanly in/out.\n * - `renderRotBarDots(color, position)` — Smaller dots sized to fit inside\n * the bar, rendered inside the caller's clip-path group.\n * - `shortestAngularDeltaDeg(startAngle, endAngle)` — Wraparound-safe\n * minimal angular distance (0–180°) used for zero-span thresholds.\n *\n * ## Coordinate System\n *\n * All functions assume a centered SVG coordinate system (0, 0 at center)\n * with 0° at 12 o'clock and angles increasing clockwise. The caller\n * (typically `<obc-watch>`) is responsible for viewBox, rotation, and\n * animation via `RateOfTurnController`.\n *\n * ## Future Extensions\n *\n * The internal path builder (`rotBarPath`) accepts an arbitrary track radius,\n * enabling future use on compass sectors with different radii and on flat\n * (linear) compass layouts where the arc would be \"straightened\" into a\n * horizontal bar.\n */\nimport {svg, SVGTemplateResult} from 'lit';\n\nexport enum RotType {\n dots = 'dots',\n bar = 'bar',\n}\n\nexport enum RotPosition {\n scale = 'scale',\n innerCircle = 'innerCircle',\n}\n\n// TODO: RotStyle.port / RotStyle.starboard for port/starboard coloring\n\nconst DOT_COUNT = 5;\nconst DOT_ANGLES = Array.from(\n {length: DOT_COUNT},\n (_, i) => (360 / DOT_COUNT) * i\n);\n\n// Midpoints of watch ring pairs — cannot import from watch.ts (circular dep)\n// SCALE_RADIUS = (OUTER_RING_RADIUS + RING2_RADIUS) / 2 = (184 + 160) / 2\n// INNER_CIRCLE_RADIUS = (RING3_RADIUS + RING4_RADIUS) / 2 = (112 + 88) / 2\nconst SCALE_RADIUS = 172;\nconst INNER_CIRCLE_RADIUS = 100;\n\nconst BAR_HALF_THICKNESS = 8;\nconst DOT_RADIUS = BAR_HALF_THICKNESS;\nconst BAR_DOT_RADIUS = BAR_HALF_THICKNESS * 0.75;\nconst BAR_DOT_STROKE = BAR_HALF_THICKNESS * 0.5;\nconst BAR_DOT_INNER_RADIUS = BAR_DOT_RADIUS - BAR_DOT_STROKE / 2;\n\nfunction getTrackRadius(position: RotPosition, radiusOffset = 0): number {\n const base =\n position === RotPosition.scale ? SCALE_RADIUS : INNER_CIRCLE_RADIUS;\n return base + radiusOffset;\n}\n\nfunction dotOnTrack(angle: number, radius: number): {cx: number; cy: number} {\n const rad = (angle * Math.PI) / 180;\n return {\n cx: Math.sin(rad) * radius,\n cy: -Math.cos(rad) * radius,\n };\n}\n\nexport function renderRotDots(\n color: string,\n position: RotPosition,\n radiusOffset = 0\n): SVGTemplateResult {\n const radius = getTrackRadius(position, radiusOffset);\n return svg`${DOT_ANGLES.map((angle) => {\n const {cx, cy} = dotOnTrack(angle, radius);\n return svg`<circle cx=\"${cx}\" cy=\"${cy}\" r=\"${DOT_RADIUS}\" fill=\"${color}\" />`;\n })}`;\n}\n\nfunction rotBarPath(\n startAngle: number,\n endAngle: number,\n trackRadius: number\n): string {\n const R = trackRadius + BAR_HALF_THICKNESS;\n const r = trackRadius - BAR_HALF_THICKNESS;\n\n const a1 = (startAngle * Math.PI) / 180;\n const a2 = (endAngle * Math.PI) / 180;\n\n const outerStartX = Math.sin(a1) * R;\n const outerStartY = -Math.cos(a1) * R;\n const innerStartX = Math.sin(a1) * r;\n const innerStartY = -Math.cos(a1) * r;\n\n const outerEndX = Math.sin(a2) * R;\n const outerEndY = -Math.cos(a2) * R;\n const innerEndX = Math.sin(a2) * r;\n const innerEndY = -Math.cos(a2) * r;\n\n // Clockwise angular distance from start to end (0..2π)\n const cwSpan = (((a2 - a1) % (2 * Math.PI)) + 2 * Math.PI) % (2 * Math.PI);\n\n // Always draw the shortest arc (< 180°)\n let outerSweep: number;\n let innerSweep: number;\n if (cwSpan <= Math.PI) {\n outerSweep = 1;\n innerSweep = 0;\n } else {\n outerSweep = 0;\n innerSweep = 1;\n }\n\n return [\n `M ${outerStartX} ${outerStartY}`,\n `A ${R} ${R} 0 0 ${outerSweep} ${outerEndX} ${outerEndY}`,\n `L ${innerEndX} ${innerEndY}`,\n `A ${r} ${r} 0 0 ${innerSweep} ${innerStartX} ${innerStartY}`,\n `Z`,\n ].join(' ');\n}\n\nexport function shortestAngularDeltaDeg(\n startAngle: number,\n endAngle: number\n): number {\n const cw = (((endAngle - startAngle) % 360) + 360) % 360;\n return cw <= 180 ? cw : 360 - cw;\n}\n\nexport interface RotBarConfig {\n startAngle: number;\n endAngle: number;\n color: string;\n barColor: string;\n position: RotPosition;\n endDotFill?: string;\n endDotStroke?: string;\n maskId?: string;\n radiusOffset?: number;\n}\n\nexport function renderRotBarStatic(config: RotBarConfig): SVGTemplateResult {\n const {\n startAngle,\n endAngle,\n color,\n barColor,\n position,\n endDotFill = 'var(--instrument-frame-primary-color)',\n endDotStroke = color,\n maskId = 'rot-bar-mask',\n radiusOffset = 0,\n } = config;\n\n if (shortestAngularDeltaDeg(startAngle, endAngle) < 0.1) {\n return svg``;\n }\n\n const trackRadius = getTrackRadius(position, radiusOffset);\n const arcPath = rotBarPath(startAngle, endAngle, trackRadius);\n const {cx: endCx, cy: endCy} = dotOnTrack(endAngle, trackRadius);\n\n // Expand the clip region angularly at the COG (end) side only so dots\n // snap fully in/out near the end dot. The HDG (start) side is flat —\n // dots should clip exactly at the bar edge with no extra padding.\n const dotAngularPad =\n (Math.asin(BAR_DOT_INNER_RADIUS / trackRadius) * 180) / Math.PI;\n const cwSpan = (((endAngle - startAngle) % 360) + 360) % 360;\n const isCW = cwSpan <= 180;\n const clipPath = rotBarPath(\n startAngle,\n endAngle + (isCW ? dotAngularPad : -dotAngularPad),\n trackRadius\n );\n\n return svg`\n <defs>\n <clipPath id=\"${maskId}\">\n <path d=\"${clipPath}\" />\n </clipPath>\n </defs>\n <path d=\"${arcPath}\" fill=\"${barColor}\" />\n <circle\n cx=\"${endCx}\" cy=\"${endCy}\" r=\"${BAR_DOT_RADIUS}\"\n fill=\"${endDotFill}\"\n stroke=\"${endDotStroke}\"\n stroke-width=\"${BAR_DOT_STROKE}\"\n />\n `;\n}\n\nexport function renderRotBarDots(\n color: string,\n position: RotPosition,\n radiusOffset = 0\n): SVGTemplateResult {\n const radius = getTrackRadius(position, radiusOffset);\n\n return svg`\n ${DOT_ANGLES.map((angle) => {\n const {cx, cy} = dotOnTrack(angle, radius);\n return svg`<circle cx=\"${cx}\" cy=\"${cy}\" r=\"${BAR_DOT_INNER_RADIUS}\" fill=\"${color}\" />`;\n })}\n `;\n}\n\n// ============================================================================\n// Linear (flat compass) ROT rendering\n// ============================================================================\n\n/**\n * Angular spacing between dots in degrees — same as radial (360 / 5 = 72).\n * In linear mode this is converted to pixels via `dotSpacing = 72 * translationScale`.\n */\nexport const LINEAR_DOT_ANGLE_SPACING = 360 / DOT_COUNT;\n\nconst LINEAR_DOT_RADIUS = BAR_HALF_THICKNESS / 2;\n\nexport enum LinearRotPosition {\n track = 'track',\n scale = 'scale',\n}\n\n/**\n * Render evenly-spaced filled dots along a horizontal track.\n *\n * Dots are placed at multiples of `dotSpacing` centered on x = 0.\n * The caller wraps the result in a translating `<g id=\"rot-spinner\">`\n * animated by `RateOfTurnController` in translate mode.\n *\n * Enough dots are generated to cover `visibleWidth` plus one full\n * animation cycle (`5 * dotSpacing`) on each side for seamless looping.\n */\nfunction linearDotStrip(\n color: string,\n trackY: number,\n dotSpacing: number,\n visibleWidth: number,\n r: number\n): SVGTemplateResult {\n if (dotSpacing <= 0) return svg``;\n const cyclePx = DOT_COUNT * dotSpacing;\n const halfRange = visibleWidth / 2 + cyclePx;\n const firstIdx = Math.floor(-halfRange / dotSpacing);\n const lastIdx = Math.ceil(halfRange / dotSpacing);\n\n const dots: SVGTemplateResult[] = [];\n for (let i = firstIdx; i <= lastIdx; i++) {\n dots.push(\n svg`<circle cx=\"${i * dotSpacing}\" cy=\"${trackY}\" r=\"${r}\" fill=\"${color}\" />`\n );\n }\n return svg`${dots}`;\n}\n\nexport function renderLinearRotDots(\n color: string,\n trackY: number,\n dotSpacing: number,\n visibleWidth: number\n): SVGTemplateResult {\n return linearDotStrip(\n color,\n trackY,\n dotSpacing,\n visibleWidth,\n LINEAR_DOT_RADIUS\n );\n}\n\nexport interface LinearRotBarConfig {\n startX: number;\n endX: number;\n color: string;\n barColor: string;\n trackY: number;\n endDotFill?: string;\n endDotStroke?: string;\n maskId?: string;\n}\n\n/**\n * Render the static horizontal bar, end-dot, and `<clipPath>` for a linear\n * ROT indicator. Analogous to `renderRotBarStatic` for radial instruments.\n *\n * The bar is a rounded capsule from `startX` to `endX` at vertical\n * position `trackY`. A ring-shaped end-dot sits at `endX`. The clip\n * region is padded at the end side so spinning bar-dots snap in/out\n * cleanly (same rationale as the angular padding in the radial version).\n *\n * Returns empty SVG when the bar span is less than 1 px.\n */\nexport function renderLinearRotBarStatic(\n config: LinearRotBarConfig\n): SVGTemplateResult {\n const {\n startX,\n endX,\n color,\n barColor,\n trackY,\n endDotFill = 'var(--instrument-frame-primary-color)',\n endDotStroke = color,\n maskId = 'rot-bar-mask-linear',\n } = config;\n\n if (Math.abs(endX - startX) < 1) return svg``;\n\n const h = BAR_HALF_THICKNESS;\n const top = trackY - h;\n const bot = trackY + h;\n const isEndRight = endX >= startX;\n\n // Bar path: flat on HDG/start side, semicircle capsule on COG/end side\n const flatX = startX;\n const roundX = endX;\n const barPath = isEndRight\n ? `M ${flatX} ${top} L ${roundX} ${top} A ${h} ${h} 0 0 1 ${roundX} ${bot} L ${flatX} ${bot} Z`\n : `M ${flatX} ${top} L ${roundX} ${top} A ${h} ${h} 0 0 0 ${roundX} ${bot} L ${flatX} ${bot} Z`;\n\n // Clip path: exact same shape as the bar\n return svg`\n <defs>\n <clipPath id=\"${maskId}\">\n <path d=\"${barPath}\" />\n </clipPath>\n </defs>\n <path d=\"${barPath}\" fill=\"${barColor}\" />\n <circle\n cx=\"${endX}\" cy=\"${trackY}\" r=\"${BAR_DOT_RADIUS}\"\n fill=\"${endDotFill}\" stroke=\"${endDotStroke}\"\n stroke-width=\"${BAR_DOT_STROKE}\" />\n `;\n}\n\n/**\n * Render filled dots along a horizontal track, intended to be placed\n * inside a `<g clip-path=\"…\">` that clips to the bar shape.\n * Analogous to `renderRotBarDots` for radial instruments.\n */\nexport function renderLinearRotBarDots(\n color: string,\n trackY: number,\n dotSpacing: number,\n visibleWidth: number\n): SVGTemplateResult {\n return linearDotStrip(\n color,\n trackY,\n dotSpacing,\n visibleWidth,\n LINEAR_DOT_RADIUS\n );\n}\n"],"names":["RotType","RotPosition","LinearRotPosition"],"mappings":";AAqCO,IAAK,4BAAAA,aAAL;AACLA,WAAA,MAAA,IAAO;AACPA,WAAA,KAAA,IAAM;AAFI,SAAAA;AAAA,GAAA,WAAA,CAAA,CAAA;AAKL,IAAK,gCAAAC,iBAAL;AACLA,eAAA,OAAA,IAAQ;AACRA,eAAA,aAAA,IAAc;AAFJ,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AAOZ,MAAM,YAAY;AAClB,MAAM,aAAa,MAAM;AAAA,EACvB,EAAC,QAAQ,UAAA;AAAA,EACT,CAAC,GAAG,MAAO,MAAM,YAAa;AAChC;AAKA,MAAM,eAAe;AACrB,MAAM,sBAAsB;AAE5B,MAAM,qBAAqB;AAC3B,MAAM,aAAa;AACnB,MAAM,iBAAiB,qBAAqB;AAC5C,MA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b,eAAe;AAAA,IACf,SAAS;AAAA,EAAA,IACP;AAEJ,MAAI,KAAK,IAAI,OAAO,MAAM,IAAI,EAAG,QAAO;AAExC,QAAM,IAAI;AACV,QAAM,MAAM,SAAS;AACrB,QAAM,MAAM,SAAS;AACrB,QAAM,aAAa,QAAQ;AAG3B,QAAM,QAAQ;AACd,QAAM,SAAS;AACf,QAAM,UAAU,aACZ,KAAK,KAAK,IAAI,GAAG,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,MAAM,IAAI,GAAG,MAAM,KAAK,IAAI,GAAG,OACzF,KAAK,KAAK,IAAI,GAAG,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,MAAM,IAAI,GAAG,MAAM,KAAK,IAAI,GAAG;AAG7F,SAAO;AAAA;AAAA,sBAEa,MAAM;AAAA,mBACT,OAAO;AAAA;AAAA;AAAA,eAGX,OAAO,WAAW,QAAQ;AAAA;AAAA,YAE7B,IAAI,SAAS,MAAM,QAAQ,cAAc;AAAA,cACvC,UAAU,aAAa,YAAY;AAAA,sBAC3B,cAAc;AAAA;AAEpC;AAOO,SAAS,uBACd,OACA,QACA,YACA,cACmB;AACnB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;"}
|
|
@@ -19,8 +19,12 @@ declare const ObcRotSector_base: (new (...args: any[]) => import('../../svghelpe
|
|
|
19
19
|
* `<obc-rot-sector>` — Rate-of-turn sector gauge for rotational velocity.
|
|
20
20
|
*
|
|
21
21
|
* `ObcRotSector` is a thin wrapper around `<obc-instrument-radial>` that
|
|
22
|
-
* displays a bipolar
|
|
23
|
-
*
|
|
22
|
+
* displays a bipolar sector gauge showing rate of turn. The arc extent is
|
|
23
|
+
* configurable via `rotArcExtent` (default 60°), mapping the value range
|
|
24
|
+
* (−maxValue to +maxValue) to ±rotArcExtent degrees. The bottom 50% of the
|
|
25
|
+
* circle is clipped, producing a compact sector arc. When `zoomToFitArc`
|
|
26
|
+
* is enabled, clipping is bypassed and the arc is enlarged to fill the
|
|
27
|
+
* available space. It inherits
|
|
24
28
|
* a full setpoint property bundle from {@link SetpointMixin}, including
|
|
25
29
|
* auto at-setpoint detection, dual-marker adjustment preview, and deadband
|
|
26
30
|
* tuning.
|
|
@@ -28,7 +32,7 @@ declare const ObcRotSector_base: (new (...args: any[]) => import('../../svghelpe
|
|
|
28
32
|
* ## Features
|
|
29
33
|
*
|
|
30
34
|
* - **Bipolar sector**: Value range is symmetric around zero (−maxValue to
|
|
31
|
-
* +maxValue), mapped to a
|
|
35
|
+
* +maxValue), mapped to a ±`rotArcExtent`° arc (default 60°).
|
|
32
36
|
* - **Port/starboard coloring**: When `portStarboard` is true, positive
|
|
33
37
|
* values render in starboard (green) and negative in port (red).
|
|
34
38
|
* - **Bar display**: Always renders as a `bar` type — no needle or filled
|
|
@@ -99,7 +103,9 @@ export declare class ObcRotSector extends ObcRotSector_base {
|
|
|
99
103
|
portStarboard: boolean;
|
|
100
104
|
tickmarkStyle: TickmarkStyle;
|
|
101
105
|
advices: GaugeRadialAdvice[];
|
|
102
|
-
|
|
106
|
+
zoomToFitArc: boolean;
|
|
107
|
+
rotArcExtent: number;
|
|
108
|
+
getAngle: (v: number) => number;
|
|
103
109
|
get _type(): ObcGaugeRadialType;
|
|
104
110
|
private get _barColor();
|
|
105
111
|
render(): import('lit-html').TemplateResult<1>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rot-sector.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/rot-sector/rot-sector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAGrC,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAErC,OAAO,8DAA8D,CAAC;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM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AC1D;IACc,QAAQ,EAAE,QAAQ,CAAoB;IACrC,aAAa,EAAE,OAAO,CAAS;IAChC,aAAa,EAAE,aAAa,CAC9B;IACmB,OAAO,EAAE,iBAAiB,EAAE,CAAM;IAClD,YAAY,EAAE,OAAO,CAAS;IAC/B,YAAY,EAAE,MAAM,CAAM;IAEpD,QAAQ,GAAI,GAAG,MAAM,KAAG,MAAM,CAG5B;IAEF,IAAI,KAAK,IAAI,kBAAkB,CAE9B;IAED,OAAO,KAAK,SAAS,GAapB;IAEQ,MAAM;IAkCf,OAAO,KAAK,YAAY,GAgBvB;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,YAAY,CAAC;KAChC;CACF"}
|
|
@@ -35,9 +35,12 @@ let ObcRotSector = class extends SetpointMixin(LitElement) {
|
|
|
35
35
|
this.portStarboard = false;
|
|
36
36
|
this.tickmarkStyle = TickmarkStyle.regular;
|
|
37
37
|
this.advices = [];
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
this.zoomToFitArc = false;
|
|
39
|
+
this.rotArcExtent = 60;
|
|
40
|
+
this.getAngle = (v) => {
|
|
41
|
+
if (!this.maxValue) return 0;
|
|
42
|
+
return v / this.maxValue * this.rotArcExtent;
|
|
43
|
+
};
|
|
41
44
|
}
|
|
42
45
|
get _type() {
|
|
43
46
|
return "bar";
|
|
@@ -81,6 +84,7 @@ let ObcRotSector = class extends SetpointMixin(LitElement) {
|
|
|
81
84
|
.needleType=${this._type}
|
|
82
85
|
.advices=${this.advices}
|
|
83
86
|
.clipBottom=${50}
|
|
87
|
+
.zoomToFitArc=${this.zoomToFitArc}
|
|
84
88
|
>
|
|
85
89
|
</obc-instrument-radial>
|
|
86
90
|
`;
|
|
@@ -134,6 +138,12 @@ __decorateClass([
|
|
|
134
138
|
__decorateClass([
|
|
135
139
|
property({ type: Array, attribute: false })
|
|
136
140
|
], ObcRotSector.prototype, "advices", 2);
|
|
141
|
+
__decorateClass([
|
|
142
|
+
property({ type: Boolean })
|
|
143
|
+
], ObcRotSector.prototype, "zoomToFitArc", 2);
|
|
144
|
+
__decorateClass([
|
|
145
|
+
property({ type: Number })
|
|
146
|
+
], ObcRotSector.prototype, "rotArcExtent", 2);
|
|
137
147
|
ObcRotSector = __decorateClass([
|
|
138
148
|
customElement("obc-rot-sector")
|
|
139
149
|
], ObcRotSector);
|