@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.23 → 2.2.0-next.25
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/bundle/openbridge-webcomponents.bundle.js +538 -202
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +271 -0
- package/dist/navigation-instruments/attitude/attitude.css_inline.js +64 -0
- package/dist/navigation-instruments/attitude/attitude.css_inline.js.map +1 -0
- package/dist/navigation-instruments/attitude/attitude.d.ts +121 -0
- package/dist/navigation-instruments/attitude/attitude.d.ts.map +1 -0
- package/dist/navigation-instruments/attitude/attitude.js +255 -0
- package/dist/navigation-instruments/attitude/attitude.js.map +1 -0
- package/dist/navigation-instruments/watch/tickmark.d.ts.map +1 -1
- package/dist/navigation-instruments/watch/tickmark.js +35 -13
- package/dist/navigation-instruments/watch/tickmark.js.map +1 -1
- package/dist/svghelpers/advice-linear.d.ts.map +1 -1
- package/dist/svghelpers/advice-linear.js +10 -4
- package/dist/svghelpers/advice-linear.js.map +1 -1
- package/dist/svghelpers/math.d.ts +7 -0
- package/dist/svghelpers/math.d.ts.map +1 -1
- package/dist/svghelpers/math.js +10 -1
- package/dist/svghelpers/math.js.map +1 -1
- package/llms/components/obc-attitude.md +69 -0
- package/llms/docs/building-blocks-advice.md +1 -0
- package/llms/llms-full.txt +73 -0
- package/llms/llms.txt +1 -0
- package/package.json +1 -1
- package/src/building-blocks/advice/advice.stories.ts +34 -0
- package/src/building-blocks/external-scale/external-scale.spec.ts +15 -0
- package/src/navigation-instruments/attitude/attitude.css +54 -0
- package/src/navigation-instruments/attitude/attitude.spec.ts +208 -0
- package/src/navigation-instruments/attitude/attitude.stories.ts +87 -0
- package/src/navigation-instruments/attitude/attitude.ts +351 -0
- package/src/navigation-instruments/watch/tickmark.spec.ts +22 -0
- package/src/navigation-instruments/watch/tickmark.ts +49 -5
- package/src/svghelpers/advice-linear.ts +16 -4
- package/src/svghelpers/math.spec.ts +25 -0
- package/src/svghelpers/math.ts +10 -0
package/custom-elements.json
CHANGED
|
@@ -109407,6 +109407,277 @@
|
|
|
109407
109407
|
}
|
|
109408
109408
|
]
|
|
109409
109409
|
},
|
|
109410
|
+
{
|
|
109411
|
+
"kind": "javascript-module",
|
|
109412
|
+
"path": "src/navigation-instruments/attitude/attitude.ts",
|
|
109413
|
+
"declarations": [
|
|
109414
|
+
{
|
|
109415
|
+
"kind": "class",
|
|
109416
|
+
"description": "`<obc-attitude>` – Attitude instrument that shows pitch and roll as a moving\nhorizon behind a fixed vessel symbol, the way an artificial horizon does.\n\nThe symbol in the centre stays level. The ground half of the face slides\ndown as the pitch rises and tilts against the roll, so the picture matches\nwhat is seen looking forward. A ladder of short rungs on the horizon gives\nthe pitch. The roll scale turns with the horizon, and the pointer at the\ntop, which stays straight up like the symbol, reads the roll on it.\n\n## Features / Variants\n\n- **Roll scale:** the band over the sky half of the face, labelled\n 90/45/0/45/90. It turns with the horizon, so the fixed pointer sits on\n the side the vehicle rolls to. `showLabels` turns the labels off.\n- **Full turns:** `pitch` and `roll` take any angle. Past ±90° of pitch the\n ladder runs on to the inverted horizon, with the ground above the sky,\n and the roll scale follows the sky to the lower half.\n- **Pitch ladder:** one rung per `pitchTickInterval` degrees. A smaller\n interval magnifies the pitch; a larger one shows more of it.\n- **Priority:** `priority` switches the symbol and the pointer between the\n `regular` and `enhanced` palette.\n\n## Usage Guidelines\n\nUse for a vehicle that is steered in three dimensions and whose operator\nneeds pitch and roll together at a glance. For readings against a scale\nwith advice zones use `obc-pitch`, `obc-roll` or `obc-pitch-roll`; for\npitch, roll and yaw deviation as a dot on a polar grid use\n`obc-pitch-roll-yaw`.\n\nThe scales carry no numbers besides the roll labels. Put the values next to\nthe instrument with `obc-readout` when they have to be read exactly.\n\n**TODO(designer)**: Figma 20108:142407 shows no pitch values on the ladder.",
|
|
109417
|
+
"name": "ObcAttitude",
|
|
109418
|
+
"members": [
|
|
109419
|
+
{
|
|
109420
|
+
"kind": "field",
|
|
109421
|
+
"name": "pitch",
|
|
109422
|
+
"type": {
|
|
109423
|
+
"text": "number"
|
|
109424
|
+
},
|
|
109425
|
+
"default": "0",
|
|
109426
|
+
"description": "Pitch in degrees, positive with the front up. The horizon drops below the symbol as it rises. Any angle is accepted and wraps over a full turn.",
|
|
109427
|
+
"attribute": "pitch"
|
|
109428
|
+
},
|
|
109429
|
+
{
|
|
109430
|
+
"kind": "field",
|
|
109431
|
+
"name": "roll",
|
|
109432
|
+
"type": {
|
|
109433
|
+
"text": "number"
|
|
109434
|
+
},
|
|
109435
|
+
"default": "0",
|
|
109436
|
+
"description": "Roll in degrees, positive with the right side down. The horizon and the roll scale turn the other way, as they appear from on board. Any angle is accepted.",
|
|
109437
|
+
"attribute": "roll"
|
|
109438
|
+
},
|
|
109439
|
+
{
|
|
109440
|
+
"kind": "field",
|
|
109441
|
+
"name": "pitchTickInterval",
|
|
109442
|
+
"type": {
|
|
109443
|
+
"text": "number"
|
|
109444
|
+
},
|
|
109445
|
+
"default": "10",
|
|
109446
|
+
"description": "Degrees of pitch between two ladder rungs, from 0.1 to 90. Default `10`, which shows about ±29° on the face.",
|
|
109447
|
+
"attribute": "pitchTickInterval"
|
|
109448
|
+
},
|
|
109449
|
+
{
|
|
109450
|
+
"kind": "field",
|
|
109451
|
+
"name": "showLabels",
|
|
109452
|
+
"type": {
|
|
109453
|
+
"text": "boolean"
|
|
109454
|
+
},
|
|
109455
|
+
"default": "true",
|
|
109456
|
+
"description": "When `true` (default), labels the roll scale."
|
|
109457
|
+
},
|
|
109458
|
+
{
|
|
109459
|
+
"kind": "field",
|
|
109460
|
+
"name": "priority",
|
|
109461
|
+
"type": {
|
|
109462
|
+
"text": "Priority"
|
|
109463
|
+
},
|
|
109464
|
+
"description": "Palette of the symbol and the pointer: `regular` or `enhanced`.",
|
|
109465
|
+
"attribute": "priority"
|
|
109466
|
+
},
|
|
109467
|
+
{
|
|
109468
|
+
"kind": "field",
|
|
109469
|
+
"name": "faceDiameter",
|
|
109470
|
+
"type": {
|
|
109471
|
+
"text": "number | undefined"
|
|
109472
|
+
},
|
|
109473
|
+
"description": "Outer-ring diameter in CSS pixels. When set, the instrument renders at a fixed size, so instruments that share the value have rings of the same size.",
|
|
109474
|
+
"attribute": "face-diameter"
|
|
109475
|
+
},
|
|
109476
|
+
{
|
|
109477
|
+
"kind": "field",
|
|
109478
|
+
"name": "_idPrefix",
|
|
109479
|
+
"privacy": "private",
|
|
109480
|
+
"default": "`attitude-${Math.random().toString(36).slice(2, 9)}`",
|
|
109481
|
+
"description": "Clip ids are looked up in the whole document, so each instance needs its own."
|
|
109482
|
+
},
|
|
109483
|
+
{
|
|
109484
|
+
"kind": "field",
|
|
109485
|
+
"name": "_frame",
|
|
109486
|
+
"type": {
|
|
109487
|
+
"text": "RadialFrame | undefined"
|
|
109488
|
+
},
|
|
109489
|
+
"privacy": "private"
|
|
109490
|
+
},
|
|
109491
|
+
{
|
|
109492
|
+
"kind": "field",
|
|
109493
|
+
"name": "_hostSizePinned",
|
|
109494
|
+
"type": {
|
|
109495
|
+
"text": "boolean"
|
|
109496
|
+
},
|
|
109497
|
+
"privacy": "private",
|
|
109498
|
+
"default": "false"
|
|
109499
|
+
},
|
|
109500
|
+
{
|
|
109501
|
+
"kind": "field",
|
|
109502
|
+
"name": "_resizeController",
|
|
109503
|
+
"privacy": "private",
|
|
109504
|
+
"default": "new ResizeController(this, {})"
|
|
109505
|
+
},
|
|
109506
|
+
{
|
|
109507
|
+
"kind": "field",
|
|
109508
|
+
"name": "safeRoll",
|
|
109509
|
+
"type": {
|
|
109510
|
+
"text": "number"
|
|
109511
|
+
},
|
|
109512
|
+
"privacy": "private",
|
|
109513
|
+
"readonly": true
|
|
109514
|
+
},
|
|
109515
|
+
{
|
|
109516
|
+
"kind": "field",
|
|
109517
|
+
"name": "wrappedPitch",
|
|
109518
|
+
"type": {
|
|
109519
|
+
"text": "number"
|
|
109520
|
+
},
|
|
109521
|
+
"privacy": "private",
|
|
109522
|
+
"description": "Pitch within half a turn either way, so a full turn draws like none.",
|
|
109523
|
+
"readonly": true
|
|
109524
|
+
},
|
|
109525
|
+
{
|
|
109526
|
+
"kind": "method",
|
|
109527
|
+
"name": "ladderUnits",
|
|
109528
|
+
"privacy": "private",
|
|
109529
|
+
"return": {
|
|
109530
|
+
"type": {
|
|
109531
|
+
"text": "number"
|
|
109532
|
+
}
|
|
109533
|
+
},
|
|
109534
|
+
"parameters": [
|
|
109535
|
+
{
|
|
109536
|
+
"name": "degrees",
|
|
109537
|
+
"type": {
|
|
109538
|
+
"text": "number"
|
|
109539
|
+
}
|
|
109540
|
+
}
|
|
109541
|
+
],
|
|
109542
|
+
"description": "Ladder distance for a pitch angle, in SVG units.\n\nTODO(designer): Figma 20108:141712 spaces the rungs 64 apart and gives\nthem no value. The default reads one rung as 10°."
|
|
109543
|
+
},
|
|
109544
|
+
{
|
|
109545
|
+
"kind": "field",
|
|
109546
|
+
"name": "rollScaleRotation",
|
|
109547
|
+
"type": {
|
|
109548
|
+
"text": "number"
|
|
109549
|
+
},
|
|
109550
|
+
"privacy": "private",
|
|
109551
|
+
"description": "Turn of the roll scale, in degrees clockwise. Its zero mark points at the\nsky, so it turns with the horizon and swaps sides once the pitch passes\nvertical, where the vehicle is upside down and the sky is below.",
|
|
109552
|
+
"readonly": true
|
|
109553
|
+
},
|
|
109554
|
+
{
|
|
109555
|
+
"kind": "field",
|
|
109556
|
+
"name": "horizonTransform",
|
|
109557
|
+
"type": {
|
|
109558
|
+
"text": "string"
|
|
109559
|
+
},
|
|
109560
|
+
"privacy": "private",
|
|
109561
|
+
"description": "Moves the horizon from ladder coordinates onto the face: slid by the pitch, tilted against the roll.",
|
|
109562
|
+
"readonly": true
|
|
109563
|
+
},
|
|
109564
|
+
{
|
|
109565
|
+
"kind": "method",
|
|
109566
|
+
"name": "renderHorizon",
|
|
109567
|
+
"privacy": "private",
|
|
109568
|
+
"return": {
|
|
109569
|
+
"type": {
|
|
109570
|
+
"text": "SVGTemplateResult"
|
|
109571
|
+
}
|
|
109572
|
+
},
|
|
109573
|
+
"description": "The ground, the horizon lines and the ladder, in ladder coordinates:\n`y = 0` is the horizon and one rung is `RUNG_SPACING` up or down.\n\nThe ladder repeats every full turn of pitch. Half a turn from each\nhorizon lies the inverted one, with the ground above it. Only the part\nthe face can show is drawn."
|
|
109574
|
+
},
|
|
109575
|
+
{
|
|
109576
|
+
"kind": "method",
|
|
109577
|
+
"name": "renderFaceOutline",
|
|
109578
|
+
"privacy": "private",
|
|
109579
|
+
"return": {
|
|
109580
|
+
"type": {
|
|
109581
|
+
"text": "SVGTemplateResult"
|
|
109582
|
+
}
|
|
109583
|
+
},
|
|
109584
|
+
"description": "The part of the face edge the roll scale band does not already draw. It\nturns with the band so the two keep meeting at the band's ends."
|
|
109585
|
+
},
|
|
109586
|
+
{
|
|
109587
|
+
"kind": "method",
|
|
109588
|
+
"name": "renderVesselSymbol",
|
|
109589
|
+
"privacy": "private",
|
|
109590
|
+
"return": {
|
|
109591
|
+
"type": {
|
|
109592
|
+
"text": "SVGTemplateResult"
|
|
109593
|
+
}
|
|
109594
|
+
}
|
|
109595
|
+
},
|
|
109596
|
+
{
|
|
109597
|
+
"kind": "method",
|
|
109598
|
+
"name": "renderRollPointer",
|
|
109599
|
+
"privacy": "private",
|
|
109600
|
+
"return": {
|
|
109601
|
+
"type": {
|
|
109602
|
+
"text": "SVGTemplateResult"
|
|
109603
|
+
}
|
|
109604
|
+
},
|
|
109605
|
+
"description": "The roll pointer. It is fixed to the vehicle like the symbol, so it stays\nstraight up and the roll scale turns under it.\n\nTODO(designer): Figma 20108:142406 wraps this arrow in a rotator tool and\nkeeps the scale still. The review chose the fixed pointer."
|
|
109606
|
+
}
|
|
109607
|
+
],
|
|
109608
|
+
"attributes": [
|
|
109609
|
+
{
|
|
109610
|
+
"name": "pitch",
|
|
109611
|
+
"type": {
|
|
109612
|
+
"text": "number"
|
|
109613
|
+
},
|
|
109614
|
+
"default": "0",
|
|
109615
|
+
"description": "Pitch in degrees, positive with the front up. The horizon drops below the symbol as it rises. Any angle is accepted and wraps over a full turn.",
|
|
109616
|
+
"fieldName": "pitch"
|
|
109617
|
+
},
|
|
109618
|
+
{
|
|
109619
|
+
"name": "roll",
|
|
109620
|
+
"type": {
|
|
109621
|
+
"text": "number"
|
|
109622
|
+
},
|
|
109623
|
+
"default": "0",
|
|
109624
|
+
"description": "Roll in degrees, positive with the right side down. The horizon and the roll scale turn the other way, as they appear from on board. Any angle is accepted.",
|
|
109625
|
+
"fieldName": "roll"
|
|
109626
|
+
},
|
|
109627
|
+
{
|
|
109628
|
+
"name": "pitchTickInterval",
|
|
109629
|
+
"type": {
|
|
109630
|
+
"text": "number"
|
|
109631
|
+
},
|
|
109632
|
+
"default": "10",
|
|
109633
|
+
"description": "Degrees of pitch between two ladder rungs, from 0.1 to 90. Default `10`, which shows about ±29° on the face.",
|
|
109634
|
+
"fieldName": "pitchTickInterval"
|
|
109635
|
+
},
|
|
109636
|
+
{
|
|
109637
|
+
"name": "priority",
|
|
109638
|
+
"type": {
|
|
109639
|
+
"text": "Priority"
|
|
109640
|
+
},
|
|
109641
|
+
"description": "Palette of the symbol and the pointer: `regular` or `enhanced`.",
|
|
109642
|
+
"fieldName": "priority"
|
|
109643
|
+
},
|
|
109644
|
+
{
|
|
109645
|
+
"name": "face-diameter",
|
|
109646
|
+
"type": {
|
|
109647
|
+
"text": "number | undefined"
|
|
109648
|
+
},
|
|
109649
|
+
"description": "Outer-ring diameter in CSS pixels. When set, the instrument renders at a fixed size, so instruments that share the value have rings of the same size.",
|
|
109650
|
+
"fieldName": "faceDiameter"
|
|
109651
|
+
}
|
|
109652
|
+
],
|
|
109653
|
+
"superclass": {
|
|
109654
|
+
"name": "LitElement",
|
|
109655
|
+
"package": "lit"
|
|
109656
|
+
},
|
|
109657
|
+
"lifecycle": "experimental",
|
|
109658
|
+
"tagName": "obc-attitude",
|
|
109659
|
+
"customElement": true
|
|
109660
|
+
}
|
|
109661
|
+
],
|
|
109662
|
+
"exports": [
|
|
109663
|
+
{
|
|
109664
|
+
"kind": "js",
|
|
109665
|
+
"name": "ObcAttitude",
|
|
109666
|
+
"declaration": {
|
|
109667
|
+
"name": "ObcAttitude",
|
|
109668
|
+
"module": "src/navigation-instruments/attitude/attitude.ts"
|
|
109669
|
+
}
|
|
109670
|
+
},
|
|
109671
|
+
{
|
|
109672
|
+
"kind": "custom-element-definition",
|
|
109673
|
+
"name": "obc-attitude",
|
|
109674
|
+
"declaration": {
|
|
109675
|
+
"name": "ObcAttitude",
|
|
109676
|
+
"module": "src/navigation-instruments/attitude/attitude.ts"
|
|
109677
|
+
}
|
|
109678
|
+
}
|
|
109679
|
+
]
|
|
109680
|
+
},
|
|
109410
109681
|
{
|
|
109411
109682
|
"kind": "javascript-module",
|
|
109412
109683
|
"path": "src/navigation-instruments/azimuth-thruster-labeled/azimuth-thruster-labeled.ts",
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
// src/navigation-instruments/attitude/attitude.css?inline
|
|
3
|
+
var attitude_default = css`* {
|
|
4
|
+
-webkit-tap-highlight-color: transparent;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
* {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.container {
|
|
12
|
+
position: relative; /* containing block for the three stacked layers */
|
|
13
|
+
width: 100%;
|
|
14
|
+
height: 100%;
|
|
15
|
+
|
|
16
|
+
--attitude-symbol-color: var(--element-neutral-color);
|
|
17
|
+
--attitude-accent-color: var(--instrument-regular-secondary-color);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.container.enhanced {
|
|
21
|
+
--attitude-symbol-color: var(--element-neutral-enhanced-color);
|
|
22
|
+
--attitude-accent-color: var(--instrument-enhanced-secondary-color);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* The horizon sits under the watch so the roll scale band covers it. */
|
|
26
|
+
.container > obc-watch,
|
|
27
|
+
.container > svg {
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: 0;
|
|
30
|
+
left: 0;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ground {
|
|
36
|
+
fill: var(--instrument-frame-secondary-color);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/* Regular colour in both priorities, as the design draws it. */
|
|
40
|
+
.horizon-line {
|
|
41
|
+
stroke: var(--instrument-regular-secondary-color);
|
|
42
|
+
stroke-width: 2;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.rung {
|
|
46
|
+
stroke: var(--instrument-frame-tertiary-color);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.face-outline {
|
|
50
|
+
fill: none;
|
|
51
|
+
stroke: var(--instrument-frame-tertiary-color);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.vessel-symbol path {
|
|
55
|
+
fill: var(--attitude-symbol-color);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.vessel-symbol circle {
|
|
59
|
+
fill: var(--attitude-accent-color);
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
export { attitude_default as default };
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=attitude.css_inline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attitude.css_inline.js","names":[],"sources":[],"mappings":""}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
2
|
+
import { Priority } from '../types.js';
|
|
3
|
+
import '../watch/watch.js';
|
|
4
|
+
/**
|
|
5
|
+
* `<obc-attitude>` – Attitude instrument that shows pitch and roll as a moving
|
|
6
|
+
* horizon behind a fixed vessel symbol, the way an artificial horizon does.
|
|
7
|
+
*
|
|
8
|
+
* The symbol in the centre stays level. The ground half of the face slides
|
|
9
|
+
* down as the pitch rises and tilts against the roll, so the picture matches
|
|
10
|
+
* what is seen looking forward. A ladder of short rungs on the horizon gives
|
|
11
|
+
* the pitch. The roll scale turns with the horizon, and the pointer at the
|
|
12
|
+
* top, which stays straight up like the symbol, reads the roll on it.
|
|
13
|
+
*
|
|
14
|
+
* ## Features / Variants
|
|
15
|
+
*
|
|
16
|
+
* - **Roll scale:** the band over the sky half of the face, labelled
|
|
17
|
+
* 90/45/0/45/90. It turns with the horizon, so the fixed pointer sits on
|
|
18
|
+
* the side the vehicle rolls to. `showLabels` turns the labels off.
|
|
19
|
+
* - **Full turns:** `pitch` and `roll` take any angle. Past ±90° of pitch the
|
|
20
|
+
* ladder runs on to the inverted horizon, with the ground above the sky,
|
|
21
|
+
* and the roll scale follows the sky to the lower half.
|
|
22
|
+
* - **Pitch ladder:** one rung per `pitchTickInterval` degrees. A smaller
|
|
23
|
+
* interval magnifies the pitch; a larger one shows more of it.
|
|
24
|
+
* - **Priority:** `priority` switches the symbol and the pointer between the
|
|
25
|
+
* `regular` and `enhanced` palette.
|
|
26
|
+
*
|
|
27
|
+
* ## Usage Guidelines
|
|
28
|
+
*
|
|
29
|
+
* Use for a vehicle that is steered in three dimensions and whose operator
|
|
30
|
+
* needs pitch and roll together at a glance. For readings against a scale
|
|
31
|
+
* with advice zones use `obc-pitch`, `obc-roll` or `obc-pitch-roll`; for
|
|
32
|
+
* pitch, roll and yaw deviation as a dot on a polar grid use
|
|
33
|
+
* `obc-pitch-roll-yaw`.
|
|
34
|
+
*
|
|
35
|
+
* The scales carry no numbers besides the roll labels. Put the values next to
|
|
36
|
+
* the instrument with `obc-readout` when they have to be read exactly.
|
|
37
|
+
*
|
|
38
|
+
* **TODO(designer)**: Figma 20108:142407 shows no pitch values on the ladder.
|
|
39
|
+
*
|
|
40
|
+
* @property pitch - Pitch in degrees, positive with the front up. The horizon drops below the
|
|
41
|
+
* symbol as it rises. Any angle is accepted and wraps over a full turn.
|
|
42
|
+
* @property roll - Roll in degrees, positive with the right side down. The horizon and the
|
|
43
|
+
* roll scale turn the other way, as they appear from on board. Any angle is accepted.
|
|
44
|
+
* @property pitchTickInterval - Degrees of pitch between two ladder rungs, from 0.1 to 90. Default
|
|
45
|
+
* `10`, which shows about ±29° on the face.
|
|
46
|
+
* @property showLabels - When `true` (default), labels the roll scale.
|
|
47
|
+
* @property priority - Palette of the symbol and the pointer: `regular` or `enhanced`.
|
|
48
|
+
* @property faceDiameter - Outer-ring diameter in CSS pixels. When set, the instrument renders at a
|
|
49
|
+
* fixed size, so instruments that share the value have rings of the same size.
|
|
50
|
+
* @experimental
|
|
51
|
+
*/
|
|
52
|
+
export declare class ObcAttitude extends LitElement {
|
|
53
|
+
/** Pitch in degrees, positive with the front up. The horizon drops below the symbol as it rises. Any angle is accepted and wraps over a full turn. */
|
|
54
|
+
pitch: number;
|
|
55
|
+
/** Roll in degrees, positive with the right side down. The horizon and the roll scale turn the other way, as they appear from on board. Any angle is accepted. */
|
|
56
|
+
roll: number;
|
|
57
|
+
/** Degrees of pitch between two ladder rungs, from 0.1 to 90. Default `10`, which shows about ±29° on the face. */
|
|
58
|
+
pitchTickInterval: number;
|
|
59
|
+
/** When `true` (default), labels the roll scale. */
|
|
60
|
+
showLabels: boolean;
|
|
61
|
+
/** Palette of the symbol and the pointer: `regular` or `enhanced`. */
|
|
62
|
+
priority: Priority;
|
|
63
|
+
/** Outer-ring diameter in CSS pixels. When set, the instrument renders at a fixed size, so instruments that share the value have rings of the same size. */
|
|
64
|
+
faceDiameter: number | undefined;
|
|
65
|
+
/** Clip ids are looked up in the whole document, so each instance needs its own. */
|
|
66
|
+
private _idPrefix;
|
|
67
|
+
private _frame;
|
|
68
|
+
private _hostSizePinned;
|
|
69
|
+
private _resizeController;
|
|
70
|
+
firstUpdated(changed: PropertyValues): void;
|
|
71
|
+
updated(changed: PropertyValues): void;
|
|
72
|
+
private get safeRoll();
|
|
73
|
+
/** Pitch within half a turn either way, so a full turn draws like none. */
|
|
74
|
+
private get wrappedPitch();
|
|
75
|
+
/**
|
|
76
|
+
* Ladder distance for a pitch angle, in SVG units.
|
|
77
|
+
*
|
|
78
|
+
* TODO(designer): Figma 20108:141712 spaces the rungs 64 apart and gives
|
|
79
|
+
* them no value. The default reads one rung as 10°.
|
|
80
|
+
*/
|
|
81
|
+
private ladderUnits;
|
|
82
|
+
/**
|
|
83
|
+
* Turn of the roll scale, in degrees clockwise. Its zero mark points at the
|
|
84
|
+
* sky, so it turns with the horizon and swaps sides once the pitch passes
|
|
85
|
+
* vertical, where the vehicle is upside down and the sky is below.
|
|
86
|
+
*/
|
|
87
|
+
private get rollScaleRotation();
|
|
88
|
+
/** Moves the horizon from ladder coordinates onto the face: slid by the pitch, tilted against the roll. */
|
|
89
|
+
private get horizonTransform();
|
|
90
|
+
/**
|
|
91
|
+
* The ground, the horizon lines and the ladder, in ladder coordinates:
|
|
92
|
+
* `y = 0` is the horizon and one rung is `RUNG_SPACING` up or down.
|
|
93
|
+
*
|
|
94
|
+
* The ladder repeats every full turn of pitch. Half a turn from each
|
|
95
|
+
* horizon lies the inverted one, with the ground above it. Only the part
|
|
96
|
+
* the face can show is drawn.
|
|
97
|
+
*/
|
|
98
|
+
private renderHorizon;
|
|
99
|
+
/**
|
|
100
|
+
* The part of the face edge the roll scale band does not already draw. It
|
|
101
|
+
* turns with the band so the two keep meeting at the band's ends.
|
|
102
|
+
*/
|
|
103
|
+
private renderFaceOutline;
|
|
104
|
+
private renderVesselSymbol;
|
|
105
|
+
/**
|
|
106
|
+
* The roll pointer. It is fixed to the vehicle like the symbol, so it stays
|
|
107
|
+
* straight up and the roll scale turns under it.
|
|
108
|
+
*
|
|
109
|
+
* TODO(designer): Figma 20108:142406 wraps this arrow in a rotator tool and
|
|
110
|
+
* keeps the scale still. The review chose the fixed pointer.
|
|
111
|
+
*/
|
|
112
|
+
private renderRollPointer;
|
|
113
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
114
|
+
static styles: import('lit').CSSResult;
|
|
115
|
+
}
|
|
116
|
+
declare global {
|
|
117
|
+
interface HTMLElementTagNameMap {
|
|
118
|
+
'obc-attitude': ObcAttitude;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=attitude.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attitude.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/attitude/attitude.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EAKf,MAAM,KAAK,CAAC;AAIb,OAAO,mBAAmB,CAAC;AAS3B,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;AAiDrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,qBACa,WAAY,SAAQ,UAAU;IACf,KAAK,SAAK;IACV,IAAI,SAAK;IACT,iBAAiB,SAAM;IACJ,UAAU,UAAQ;IACrC,QAAQ,EAAE,QAAQ,CAAoB;IAEhE,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,oFAAoF;IACpF,OAAO,CAAC,SAAS,CAAwD;IACzE,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,iBAAiB,CAAkC;IAElD,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAK3C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAS/C,OAAO,KAAK,QAAQ,GAEnB;IAED,2EAA2E;IAC3E,OAAO,KAAK,YAAY,GAEvB;IAED;;;;;OAKG;IACH,OAAO,CAAC,WAAW;IAYnB;;;;OAIG;IACH,OAAO,KAAK,iBAAiB,GAG5B;IAED,2GAA2G;IAC3G,OAAO,KAAK,gBAAgB,GAE3B;IAED;;;;;;;OAOG;IACH,OAAO,CAAC,aAAa;IA4DrB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,kBAAkB;IAS1B;;;;;;OAMG;IACH,OAAO,CAAC,iBAAiB;IAQhB,MAAM;IAqDf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
|