@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.161 → 2.0.0-next.162

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 (44) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +437 -324
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +134 -34
  4. package/dist/navigation-instruments/compass-sector/compass-sector.css.js +20 -11
  5. package/dist/navigation-instruments/compass-sector/compass-sector.css.js.map +1 -1
  6. package/dist/navigation-instruments/compass-sector/compass-sector.d.ts +18 -17
  7. package/dist/navigation-instruments/compass-sector/compass-sector.d.ts.map +1 -1
  8. package/dist/navigation-instruments/compass-sector/compass-sector.js +85 -52
  9. package/dist/navigation-instruments/compass-sector/compass-sector.js.map +1 -1
  10. package/dist/navigation-instruments/gauge-radial/gauge-radial.css.js +2 -6
  11. package/dist/navigation-instruments/gauge-radial/gauge-radial.css.js.map +1 -1
  12. package/dist/navigation-instruments/rudder/rudder.css.js +40 -0
  13. package/dist/navigation-instruments/rudder/rudder.css.js.map +1 -0
  14. package/dist/navigation-instruments/rudder/rudder.d.ts +9 -0
  15. package/dist/navigation-instruments/rudder/rudder.d.ts.map +1 -1
  16. package/dist/navigation-instruments/rudder/rudder.js +40 -23
  17. package/dist/navigation-instruments/rudder/rudder.js.map +1 -1
  18. package/dist/navigation-instruments/watch/watch.css.js +6 -0
  19. package/dist/navigation-instruments/watch/watch.css.js.map +1 -1
  20. package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
  21. package/dist/navigation-instruments/watch/watch.js +11 -1
  22. package/dist/navigation-instruments/watch/watch.js.map +1 -1
  23. package/dist/svghelpers/arc-frame.d.ts +8 -0
  24. package/dist/svghelpers/arc-frame.d.ts.map +1 -1
  25. package/dist/svghelpers/arc-frame.js +16 -6
  26. package/dist/svghelpers/arc-frame.js.map +1 -1
  27. package/dist/svghelpers/radial-frame.d.ts +14 -1
  28. package/dist/svghelpers/radial-frame.d.ts.map +1 -1
  29. package/dist/svghelpers/radial-frame.js +3 -1
  30. package/dist/svghelpers/radial-frame.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/mixins/contain-aspect.css +14 -0
  33. package/src/navigation-instruments/compass-sector/compass-sector.css +17 -11
  34. package/src/navigation-instruments/compass-sector/compass-sector.spec.ts +57 -0
  35. package/src/navigation-instruments/compass-sector/compass-sector.stories.ts +23 -0
  36. package/src/navigation-instruments/compass-sector/compass-sector.ts +127 -60
  37. package/src/navigation-instruments/gauge-radial/gauge-radial.css +3 -10
  38. package/src/navigation-instruments/rudder/rudder.css +27 -0
  39. package/src/navigation-instruments/rudder/rudder.ts +52 -22
  40. package/src/navigation-instruments/watch/watch.css +6 -0
  41. package/src/navigation-instruments/watch/watch.ts +16 -1
  42. package/src/svghelpers/arc-frame.ts +19 -5
  43. package/src/svghelpers/radial-frame.spec.ts +51 -0
  44. package/src/svghelpers/radial-frame.ts +15 -1
@@ -9083,7 +9083,7 @@
9083
9083
  {
9084
9084
  "kind": "variable",
9085
9085
  "name": "ObcCompassSector",
9086
- "default": "class extends LitElement { constructor() { super(...arguments); this.heading = 0; this.courseOverGround = 0; this.headingSetpoint = null; this.atHeadingSetpoint = false; this.headingSetpointAtZeroDeadband = 0.5; this.headingSetpointOverride = false; this.autoAtHeadingSetpoint = true; this.autoAtHeadingSetpointDeadband = 2; this.animateSetpoint = false; this.touching = false; this.headingAdvices = []; this.minFOV = 30; this.rotPosition = RotPosition.innerCircle; this.rotDotAnimationFactor = 18; this.rotationsPerMinute = 1; this.rotMaxValue = 60; this.rotPortStarboard = false; this.rotAtZeroDeadband = ROT_ZERO_DEADBAND_DEG; this.state = InstrumentState.active; this.priority = Priority.regular; this.priorityElements = [ \"hdg\" /* hdg */ ]; this.tickmarksInside = false; this.zoomToFitArc = false; this.hasReadout = false; this.label = \"HDG\"; this.unit = \"DEG\"; this.fractionDigits = 0; this._headingSp = new SetpointBundle({ angularWraparound: true, onAnimationEnd: () => this.requestUpdate() }); this._halfFOV = 30; this._arcHalfExtent = ARC_HALF_EXTENT; this._scale = 1; this._radiusOffset = 0; this._cachedViewBox = \"\"; this._cachedAreas = []; this._cachedTickmarks = []; this._cachedAdvices = []; } willUpdate(changed) { super.willUpdate(changed); this._headingSp.sync({ setpoint: this.headingSetpoint ?? void 0, newSetpoint: this.newHeadingSetpoint, atSetpoint: this.atHeadingSetpoint, touching: this.touching, autoAtSetpoint: this.autoAtHeadingSetpoint, autoAtSetpointDeadband: this.autoAtHeadingSetpointDeadband, setpointAtZeroDeadband: this.headingSetpointAtZeroDeadband, setpointOverride: this.headingSetpointOverride, animateSetpoint: this.animateSetpoint }); const arcInputsChanged = changed.has(\"heading\") || changed.has(\"courseOverGround\") || changed.has(\"minFOV\") || changed.has(\"zoomToFitArc\"); if (arcInputsChanged) { let diff = this.courseOverGround - this.heading; if (diff > 180) diff -= 360; else if (diff < -180) diff += 360; const minFov = Math.max(1, this.minFOV); const MARGIN = 15; if (this.zoomToFitArc) { const needed = Math.max(minFov, Math.abs(diff) + MARGIN); if (needed <= ARC_HALF_EXTENT) { this._halfFOV = needed; this._arcHalfExtent = needed; this._scale = 1; } else { this._halfFOV = needed; this._arcHalfExtent = ARC_HALF_EXTENT; this._scale = ARC_HALF_EXTENT / needed; } } else { this._halfFOV = Math.max(minFov, Math.abs(diff)); this._arcHalfExtent = ARC_HALF_EXTENT; this._scale = ARC_HALF_EXTENT / this._halfFOV; } this._cachedAreas = [ { startAngle: this.heading - this._arcHalfExtent, endAngle: this.heading + this._arcHalfExtent, roundInsideCut: true, roundOutsideCut: true } ]; this._computeViewBox(); this._cachedTickmarks = this._buildTickmarks(); } if (arcInputsChanged || changed.has(\"headingAdvices\")) { this._cachedAdvices = this._buildAdvices(); } } disconnectedCallback() { super.disconnectedCallback(); this._headingSp.dispose(); } // --------------------------------------------------------------------------- // Angle mapping — maps compass degrees to arc positions // --------------------------------------------------------------------------- _mapAngle(compassDeg) { let diff = compassDeg - this.heading; if (diff > 180) diff -= 360; else if (diff < -180) diff += 360; return this.heading + diff * this._scale; } // --------------------------------------------------------------------------- // Areas — fixed 120° arc centered on heading (built in willUpdate) // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // Tickmarks — compass-degree labels at mapped arc positions // --------------------------------------------------------------------------- _buildTickmarks() { const fov = this._halfFOV * 2; const { mainInterval, primaryInterval, secondaryInterval } = tickDensityForFOV(fov); const halfFov = this._halfFOV; const compassStart = this.heading - halfFov; const compassEnd = this.heading + halfFov; const tickmarks = []; const added = /* @__PURE__ */ new Set(); const addTick = (arcAngle, type, text) => { const key = Math.round(arcAngle * 1e3); if (added.has(key)) return; added.add(key); tickmarks.push({ angle: arcAngle, type, text }); }; const step = secondaryInterval ?? primaryInterval; const firstTick = Math.ceil(compassStart / step) * step; for (let compassDeg = firstTick; compassDeg <= compassEnd; compassDeg += step) { const norm = normalizeAngle(compassDeg); const arcAngle = this._mapAngle(compassDeg); const isMain = norm % mainInterval === 0; const isPrimary = norm % primaryInterval === 0; if (isMain) { addTick(arcAngle, TickmarkType.main, Math.round(norm).toString()); } else if (isPrimary) { addTick(arcAngle, TickmarkType.primary); } else { addTick(arcAngle, TickmarkType.secondary); } } return tickmarks; } // --------------------------------------------------------------------------- // ViewBox // --------------------------------------------------------------------------- _computeViewBox() { if (this.zoomToFitArc) { const targetSize = (176 + PADDING) * 2; const frame = computeZoomToFitArcFrame({ areas: this._cachedAreas, outerRadius: OUTER_RING_RADIUS, innerRadius: INNER_RADIUS, extension: PADDING, targetSize }); this._radiusOffset = frame.radiusOffset; this._cachedViewBox = frame.viewBox; this._cachedArcFrame = frame; } else { this._radiusOffset = 0; const width = (176 + PADDING) * 2; this._cachedViewBox = `-${width / 2} -${width / 2} ${width} ${width}`; this._cachedArcFrame = void 0; } } // --------------------------------------------------------------------------- // North arrow — rendered in overlay at mapped 0° position // --------------------------------------------------------------------------- _renderNorthArrow(rOff) { let northOffset = -this.heading; if (northOffset > 180) northOffset -= 360; else if (northOffset < -180) northOffset += 360; if (Math.abs(northOffset) > this._halfFOV) return nothing; const northArcAngle = this._mapAngle(0); const radius = OUTER_RING_RADIUS + rOff; return svg` <g transform=\"rotate(${northArcAngle}) translate(0, ${-radius})\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M-17.8457 24.984 0 0 17.8458 24.984C11.9868 24.3338 6.0324 24 0 24-6.0323 24-11.9867 24.3338-17.8457 24.984Z\" fill=\"var(--instrument-frame-tertiary-color)\"/> </g> `; } // --------------------------------------------------------------------------- // Priority & advice helpers // --------------------------------------------------------------------------- _angleInRange(value, min, max) { const v = normalizeAngle(value); const start = normalizeAngle(min); const end = normalizeAngle(max); return start <= end ? v >= start && v <= end : v >= start || v <= end; } _buildAdvices() { return this.headingAdvices.map(({ minAngle, maxAngle, hinted, type }) => { const state = this._angleInRange(this.heading, minAngle, maxAngle) ? AdviceState.triggered : hinted ? AdviceState.hinted : AdviceState.regular; return { minAngle: this._mapAngle(minAngle), maxAngle: this._mapAngle(maxAngle), type, state }; }); } get _effectiveRotDegPerMin() { return this.rateOfTurnDegreesPerMinute ?? this.rotationsPerMinute; } get _rotEndAngle() { const maxVal = this.rotMaxValue || 1; const barCompassDeg = this._effectiveRotDegPerMin / maxVal * ARC_HALF_EXTENT; return this._mapAngle(this.heading + barCompassDeg); } priorityFor(element) { const selected = Array.isArray(this.priorityElements) ? this.priorityElements : []; return selected.includes(element) ? this.priority : Priority.regular; } /** * Vertical placement of the readout as a percentage of the host height. * * With `zoomToFitArc` the arc is reframed by `computeZoomToFitArcFrame`, whose * `radiusOffset`/`viewBox` depend on the arc's *absolute* orientation (which * cardinal axes its bounding box crosses), not just its bend. The arc itself * is always rotated back to the top, so it stays put on screen — but a * frame-derived offset would swing wildly as `heading` rotates the bbox around * the circle. So in zoom we use a fixed offset, which keeps the readout steady * under the (stationary) arc regardless of heading. * * Without zoom the viewBox is the fixed, origin-symmetric 120° framing, so the * geometry is orientation-independent: place the readout halfway down the inner * radius from the watch center toward the arc's inner edge. */ get _readoutTopPercent() { if (this.zoomToFitArc) { return 70; } const [, vy, , vh] = this._cachedViewBox.split(\" \").map(Number); if (!vh || Number.isNaN(vy)) { return 50; } const anchorY = -INNER_RADIUS * 0.5; return Math.round((anchorY - vy) / vh * 1e3) / 10; } // --------------------------------------------------------------------------- // Render // --------------------------------------------------------------------------- render() { const rotation = -this.heading; const viewBox = this._cachedViewBox; const rOff = this._radiusOffset; const mappedCOG = this._mapAngle(this.courseOverGround); const mappedSetpoint = this.headingSetpoint != null ? this._mapAngle(this.headingSetpoint) : void 0; const mappedNewSetpoint = this.newHeadingSetpoint != null ? this._mapAngle(this.newHeadingSetpoint) : void 0; return html` <div class=\"container\"> <obc-watch .touching=${this.touching} .padding=${PADDING} .advices=${this._cachedAdvices} .tickmarks=${this._cachedTickmarks} .tickmarkStyle=${TickmarkStyle.regular} .tickmarksInside=${this.tickmarksInside} .state=${this.state} .watchCircleType=${WATCH_TYPE} .northArrow=${false} .areas=${this._cachedAreas} .arcFrame=${this._cachedArcFrame} .zoomToFitArc=${this.zoomToFitArc} .tickFadeAngle=${this._arcHalfExtent * 0.2} .rotation=${rotation} .angleSetpoint=${mappedSetpoint} .newAngleSetpoint=${mappedNewSetpoint} .atAngleSetpoint=${this._headingSp.computeAtSetpoint(this.heading)} .angleSetpointAtZeroDeadband=${this.headingSetpointAtZeroDeadband} .setpointOverride=${this.headingSetpointOverride} .priority=${this.priority} .animateSetpoint=${this.animateSetpoint} .rotType=${this.rotType} .rotPosition=${this.rotPosition} .rotStartAngle=${this.heading} .rotEndAngle=${this._rotEndAngle} .rotPriority=${this.priorityFor( \"rot\" /* rot */ )} .rotPortStarboard=${this.rotPortStarboard} .rotAtZeroDeadband=${this.rotAtZeroDeadband} .rateOfTurnDegreesPerMinute=${this.rateOfTurnDegreesPerMinute} .rotDotAnimationFactor=${this.rotDotAnimationFactor} .rotationsPerMinute=${this.rotationsPerMinute} > </obc-watch> <svg viewBox=\"${viewBox}\" transform=\"rotate(${rotation})\"> <g transform=\"rotate(${this.heading})\"> <line x1=\"0\" y1=\"${-(SCALE_INNER_RADIUS + rOff)}\" x2=\"0\" y2=\"${-(INNER_RADIUS + rOff)}\" stroke=\"var(--instrument-frame-tertiary-color)\" stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" /> </g> ${this._renderNorthArrow(rOff)} ${arrow( ArrowStyle.HDG, this.heading, this.priorityFor( \"hdg\" /* hdg */ ), rOff )} ${arrow( ArrowStyle.COG, mappedCOG, this.priorityFor( \"cog\" /* cog */ ), rOff )} </svg> ${this.hasReadout ? html`<div class=\"readout\" style=\"top: ${this._readoutTopPercent}%\" > ${renderCenterReadouts([ { value: this.heading, label: this.label, unit: this.unit, fractionDigits: this.fractionDigits, size: ReadoutSize.large, priority: this.priorityFor( \"hdg\" /* hdg */ ), centerValue: true, centerMeta: true } ])} </div>` : nothing} </div> `; } }"
9086
+ "default": "class extends LitElement { constructor() { super(...arguments); this.heading = 0; this.courseOverGround = 0; this.headingSetpoint = null; this.atHeadingSetpoint = false; this.headingSetpointAtZeroDeadband = 0.5; this.headingSetpointOverride = false; this.autoAtHeadingSetpoint = true; this.autoAtHeadingSetpointDeadband = 2; this.animateSetpoint = false; this.touching = false; this.headingAdvices = []; this.minFOV = 30; this.rotPosition = RotPosition.innerCircle; this.rotDotAnimationFactor = 18; this.rotationsPerMinute = 1; this.rotMaxValue = 60; this.rotPortStarboard = false; this.rotAtZeroDeadband = ROT_ZERO_DEADBAND_DEG; this.state = InstrumentState.active; this.priority = Priority.regular; this.priorityElements = [ \"hdg\" /* hdg */ ]; this.tickmarksInside = false; this.zoomToFitArc = false; this.hasReadout = false; this.label = \"HDG\"; this.unit = \"DEG\"; this.fractionDigits = 0; this._headingSp = new SetpointBundle({ angularWraparound: true, onAnimationEnd: () => this.requestUpdate() }); this._halfFOV = 30; this._arcHalfExtent = ARC_HALF_EXTENT; this._scale = 1; this._cachedAreas = []; this._cachedTickmarks = []; this._cachedAdvices = []; this._resizeController = new ResizeController(this, {}); this._aspectWidth = 448; this._aspectHeight = 217.28; } firstUpdated(changed) { super.firstUpdated(changed); observeInnerBox(this._resizeController, this.renderRoot); } willUpdate(changed) { super.willUpdate(changed); this._headingSp.sync({ setpoint: this.headingSetpoint ?? void 0, newSetpoint: this.newHeadingSetpoint, atSetpoint: this.atHeadingSetpoint, touching: this.touching, autoAtSetpoint: this.autoAtHeadingSetpoint, autoAtSetpointDeadband: this.autoAtHeadingSetpointDeadband, setpointAtZeroDeadband: this.headingSetpointAtZeroDeadband, setpointOverride: this.headingSetpointOverride, animateSetpoint: this.animateSetpoint }); const arcInputsChanged = changed.has(\"heading\") || changed.has(\"courseOverGround\") || changed.has(\"minFOV\") || changed.has(\"zoomToFitArc\"); if (arcInputsChanged) { let diff = this.courseOverGround - this.heading; if (diff > 180) diff -= 360; else if (diff < -180) diff += 360; const minFov = Math.max(1, this.minFOV); const MARGIN = 15; if (this.zoomToFitArc) { const needed = Math.max(minFov, Math.abs(diff) + MARGIN); if (needed <= ARC_HALF_EXTENT) { this._halfFOV = needed; this._arcHalfExtent = needed; this._scale = 1; } else { this._halfFOV = needed; this._arcHalfExtent = ARC_HALF_EXTENT; this._scale = ARC_HALF_EXTENT / needed; } } else { this._halfFOV = Math.max(minFov, Math.abs(diff)); this._arcHalfExtent = ARC_HALF_EXTENT; this._scale = ARC_HALF_EXTENT / this._halfFOV; } this._cachedAreas = [ { startAngle: this.heading - this._arcHalfExtent, endAngle: this.heading + this._arcHalfExtent, roundInsideCut: true, roundOutsideCut: true } ]; this._cachedTickmarks = this._buildTickmarks(); } if (arcInputsChanged || changed.has(\"headingAdvices\")) { this._cachedAdvices = this._buildAdvices(); } } updated(changed) { super.updated(changed); this.style.setProperty( \"--obc-compass-sector-aspect\", `${this._aspectWidth} / ${this._aspectHeight}` ); } disconnectedCallback() { super.disconnectedCallback(); this._headingSp.dispose(); } // --------------------------------------------------------------------------- // Angle mapping — maps compass degrees to arc positions // --------------------------------------------------------------------------- _mapAngle(compassDeg) { let diff = compassDeg - this.heading; if (diff > 180) diff -= 360; else if (diff < -180) diff += 360; return this.heading + diff * this._scale; } // --------------------------------------------------------------------------- // Areas — fixed 120° arc centered on heading (built in willUpdate) // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // Tickmarks — compass-degree labels at mapped arc positions // --------------------------------------------------------------------------- _buildTickmarks() { const fov = this._halfFOV * 2; const { mainInterval, primaryInterval, secondaryInterval } = tickDensityForFOV(fov); const halfFov = this._halfFOV; const compassStart = this.heading - halfFov; const compassEnd = this.heading + halfFov; const tickmarks = []; const added = /* @__PURE__ */ new Set(); const addTick = (arcAngle, type, text) => { const key = Math.round(arcAngle * 1e3); if (added.has(key)) return; added.add(key); tickmarks.push({ angle: arcAngle, type, text }); }; const step = secondaryInterval ?? primaryInterval; const firstTick = Math.ceil(compassStart / step) * step; for (let compassDeg = firstTick; compassDeg <= compassEnd; compassDeg += step) { const norm = normalizeAngle(compassDeg); const arcAngle = this._mapAngle(compassDeg); const isMain = norm % mainInterval === 0; const isPrimary = norm % primaryInterval === 0; if (isMain) { addTick(arcAngle, TickmarkType.main, Math.round(norm).toString()); } else if (isPrimary) { addTick(arcAngle, TickmarkType.primary); } else { addTick(arcAngle, TickmarkType.secondary); } } return tickmarks; } // --------------------------------------------------------------------------- // ViewBox // --------------------------------------------------------------------------- /** Deepest crop the active features need, so none of them is shaved. */ _clipBottom() { const clips = [SECTOR_CLIP_BOTTOM]; if (this.rotType !== void 0 && this.rotPosition === RotPosition.innerCircle) { clips.push(SECTOR_CLIP_BOTTOM_ROT); } if (this.tickmarksInside) { clips.push(SECTOR_CLIP_BOTTOM_INSIDE_LABELS); } if (this.hasReadout) { clips.push(SECTOR_CLIP_BOTTOM_READOUT); } return Math.min(...clips); } /** * One frame per render, feeding both layers: the shared sector box cropped * to the arc. Zoom enlarges the arc rather than the window, so the window * only slides outward by the radius offset and the canvas holds still. */ _buildFrame() { const frame = computeRadialFrame({ basePadding: BASE_PADDING, labelWidthPx: this.tickmarksInside ? 0 : estimateLabelWidthPx(this._cachedTickmarks.map((t) => t.text)), clips: { top: 0, bottom: this._clipBottom(), left: 0, right: 0 }, containerPx: measureContainerPx(this) }); if (!this.zoomToFitArc) { return frame; } const halfWidth = frame.width / 2 - SECTOR_SIDE_MARGIN; const sin = Math.sin(degToRad(this._arcHalfExtent)); const radiusOffset = Math.max(0, halfWidth / sin - OUTER_RING_RADIUS); const y = frame.y - radiusOffset; return { ...frame, y, radiusOffset, viewBox: `${frame.x} ${y} ${frame.width} ${frame.height}` }; } // --------------------------------------------------------------------------- // North arrow — rendered in overlay at mapped 0° position // --------------------------------------------------------------------------- _renderNorthArrow(rOff) { let northOffset = -this.heading; if (northOffset > 180) northOffset -= 360; else if (northOffset < -180) northOffset += 360; if (Math.abs(northOffset) > this._halfFOV) return nothing; const northArcAngle = this._mapAngle(0); const radius = OUTER_RING_RADIUS + rOff; return svg` <g transform=\"rotate(${northArcAngle}) translate(0, ${-radius})\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M-17.8457 24.984 0 0 17.8458 24.984C11.9868 24.3338 6.0324 24 0 24-6.0323 24-11.9867 24.3338-17.8457 24.984Z\" fill=\"var(--instrument-frame-tertiary-color)\"/> </g> `; } // --------------------------------------------------------------------------- // Priority & advice helpers // --------------------------------------------------------------------------- _angleInRange(value, min, max) { const v = normalizeAngle(value); const start = normalizeAngle(min); const end = normalizeAngle(max); return start <= end ? v >= start && v <= end : v >= start || v <= end; } _buildAdvices() { return this.headingAdvices.map(({ minAngle, maxAngle, hinted, type }) => { const state = this._angleInRange(this.heading, minAngle, maxAngle) ? AdviceState.triggered : hinted ? AdviceState.hinted : AdviceState.regular; return { minAngle: this._mapAngle(minAngle), maxAngle: this._mapAngle(maxAngle), type, state }; }); } get _effectiveRotDegPerMin() { return this.rateOfTurnDegreesPerMinute ?? this.rotationsPerMinute; } get _rotEndAngle() { const maxVal = this.rotMaxValue || 1; const barCompassDeg = this._effectiveRotDegPerMin / maxVal * ARC_HALF_EXTENT; return this._mapAngle(this.heading + barCompassDeg); } priorityFor(element) { const selected = Array.isArray(this.priorityElements) ? this.priorityElements : []; return selected.includes(element) ? this.priority : Priority.regular; } /** * Vertical placement of the readout as a percentage of the frame height. * * The anchor sits halfway down the inner radius, below the arc's inner edge. * Zoom pushes that edge out by the radius offset, so the anchor follows it * and the gap under the arc reads the same in both modes. */ _readoutTopPercent(frame) { if (!frame.height) { return 50; } const anchorY = -INNER_RADIUS * 0.5 - frame.radiusOffset; return Math.round((anchorY - frame.y) / frame.height * 1e3) / 10; } // --------------------------------------------------------------------------- // Render // --------------------------------------------------------------------------- render() { const rotation = -this.heading; const frame = this._buildFrame(); const viewBox = frame.viewBox; const rOff = frame.radiusOffset; const pivotX = -frame.x / frame.width * 100; const pivotY = -frame.y / frame.height * 100; this._aspectWidth = frame.width; this._aspectHeight = frame.height; const tickmarks = frame.labelsHidden ? this._cachedTickmarks.map((t) => ({ ...t, text: void 0 })) : this._cachedTickmarks; const mappedCOG = this._mapAngle(this.courseOverGround); const mappedSetpoint = this.headingSetpoint != null ? this._mapAngle(this.headingSetpoint) : void 0; const mappedNewSetpoint = this.newHeadingSetpoint != null ? this._mapAngle(this.newHeadingSetpoint) : void 0; return html` <div class=\"container\"> <obc-watch .touching=${this.touching} .advices=${this._cachedAdvices} .tickmarks=${tickmarks} .tickmarkStyle=${TickmarkStyle.regular} .tickmarksInside=${this.tickmarksInside} .state=${this.state} .watchCircleType=${WATCH_TYPE} .northArrow=${false} .areas=${this._cachedAreas} .arcFrame=${frame} .tickFadeAngle=${this._arcHalfExtent * 0.2} .rotation=${rotation} .angleSetpoint=${mappedSetpoint} .newAngleSetpoint=${mappedNewSetpoint} .atAngleSetpoint=${this._headingSp.computeAtSetpoint(this.heading)} .angleSetpointAtZeroDeadband=${this.headingSetpointAtZeroDeadband} .setpointOverride=${this.headingSetpointOverride} .priority=${this.priority} .animateSetpoint=${this.animateSetpoint} .rotType=${this.rotType} .rotPosition=${this.rotPosition} .rotStartAngle=${this.heading} .rotEndAngle=${this._rotEndAngle} .rotPriority=${this.priorityFor( \"rot\" /* rot */ )} .rotPortStarboard=${this.rotPortStarboard} .rotAtZeroDeadband=${this.rotAtZeroDeadband} .rateOfTurnDegreesPerMinute=${this.rateOfTurnDegreesPerMinute} .rotDotAnimationFactor=${this.rotDotAnimationFactor} .rotationsPerMinute=${this.rotationsPerMinute} > </obc-watch> <svg viewBox=\"${viewBox}\" transform=\"rotate(${rotation})\" style=\"transform-origin: ${pivotX}% ${pivotY}%\" > <g transform=\"rotate(${this.heading})\"> <line x1=\"0\" y1=\"${-(SCALE_INNER_RADIUS + rOff)}\" x2=\"0\" y2=\"${-(INNER_RADIUS + rOff)}\" stroke=\"var(--instrument-frame-tertiary-color)\" stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" /> </g> ${this._renderNorthArrow(rOff)} ${arrow( ArrowStyle.HDG, this.heading, this.priorityFor( \"hdg\" /* hdg */ ), rOff )} ${arrow( ArrowStyle.COG, mappedCOG, this.priorityFor( \"cog\" /* cog */ ), rOff )} </svg> ${this.hasReadout ? html`<div class=\"readout\" style=\"top: ${this._readoutTopPercent(frame)}%\" > ${renderCenterReadouts([ { value: this.heading, label: this.label, unit: this.unit, fractionDigits: this.fractionDigits, size: ReadoutSize.large, priority: this.priorityFor( \"hdg\" /* hdg */ ), centerValue: true, centerMeta: true } ])} </div>` : nothing} </div> `; } }"
9087
9087
  }
9088
9088
  ],
9089
9089
  "exports": [
@@ -10774,7 +10774,7 @@
10774
10774
  {
10775
10775
  "kind": "variable",
10776
10776
  "name": "ObcRudder",
10777
- "default": "class extends SetpointMixin(LitElement) { constructor() { super(...arguments); this.angle = 0; this.variant = \"bar\"; this.maxAngle = 90; this.showLabels = false; this.tickmarksInside = false; this.state = InstrumentState.active; this.priority = Priority.regular; this.tickmarkStyle = TickmarkStyle.regular; this.advices = []; this.zoomToFitArc = false; this._radiusOffset = 0; this._hostSizePinned = false; this._resizeController = new ResizeController(this, {}); } firstUpdated(changed) { super.firstUpdated(changed); observeInnerBox(this._resizeController, this.renderRoot); } updated(changed) { super.updated(changed); this._hostSizePinned = applyPinnedHostSize( this, this._frame, this._hostSizePinned ); } get _needleTransform() { const rOff = this._radiusOffset; if (rOff > 0) { return `translate(-256, -256) rotate(${-this.angle} 256 256) translate(0, ${rOff})`; } return `translate(-256, -256) rotate(${-this.angle} 256 256)`; } getAngle(value) { return 180 - value; } get barColor() { if (this.variant === \"needle\") { if (this.state === InstrumentState.loading || this.state === InstrumentState.off) { return \"var(--instrument-frame-tertiary-color)\"; } return this.priority === Priority.enhanced ? \"var(--instrument-enhanced-tertiary-color)\" : \"var(--instrument-regular-tertiary-color)\"; } else { if (this.state === InstrumentState.loading || this.state === InstrumentState.off) { return \"var(--instrument-frame-tertiary-color)\"; } return this.priority === Priority.enhanced ? \"var(--instrument-enhanced-secondary-color)\" : \"var(--instrument-regular-secondary-color)\"; } } renderNeedle() { if (this.variant === \"bar\") { return nothing; } let color; if (this.state === InstrumentState.loading || this.state === InstrumentState.off) { color = \"var(--instrument-frame-tertiary-color)\"; } else { color = this.priority === Priority.enhanced ? \"var(--instrument-enhanced-secondary-color)\" : \"var(--instrument-regular-secondary-color)\"; } return svg` <path transform=\"${this._needleTransform}\" d=\"M260.462 411.447C259.81 416.73 251.933 416.645 251.514 411.191L239.826 259.24C239.618 258.192 239.508 257.109 239.508 256C239.508 255.764 239.514 255.528 239.524 255.294L239.503 255.039L239.462 254.5H239.576C240.334 246.09 247.401 239.5 256.008 239.5C264.615 239.5 271.681 246.09 272.439 254.5H272.542L272.5 255.039L272.488 255.196C272.501 255.462 272.508 255.731 272.508 256C272.508 257.144 272.391 258.261 272.169 259.339L260.487 411.191L260.462 411.447Z\" fill=\"${color}\" stroke=\"var(--border-silhouette-color)\" /> `; } render() { const maxAngle = Math.max(2, this.maxAngle); const areas = [ { startAngle: 180 - maxAngle, endAngle: 180 + maxAngle, roundInsideCut: true, roundOutsideCut: true } ]; const barAreas = [ { startAngle: this.getAngle(0), endAngle: this.getAngle(this.angle), fillColor: this.barColor } ]; const setpointAngle = this.setpoint !== void 0 ? 180 - this.setpoint : void 0; const tickmarks = [ { angle: 180, type: TickmarkType.primary, text: this.showLabels ? \"0\" : void 0 }, { angle: 180, type: TickmarkType.zeroLineThick, color: this.barColor }, { angle: 180 - maxAngle, type: TickmarkType.secondary, text: this.showLabels ? maxAngle.toFixed(0) : void 0 }, { angle: 180 + maxAngle, type: TickmarkType.secondary, text: this.showLabels ? (-maxAngle).toFixed(0) : void 0 } ]; let helpAngle = null; if (maxAngle > 70) { helpAngle = 45; } else if (maxAngle > 50) { helpAngle = 30; } else if (maxAngle > 40) { helpAngle = 22.5; } if (helpAngle !== null) { tickmarks.push({ angle: 180 - helpAngle, type: TickmarkType.primary }); tickmarks.push({ angle: 180 + helpAngle, type: TickmarkType.primary }); } const advices = this.advices.map((adv) => { const startAngle = 180 - adv.maxAngle; const endAngle = 180 - adv.minAngle; const isInRange = this.setpoint !== void 0 && this.setpoint >= adv.minAngle && this.setpoint <= adv.maxAngle; let state; if (isInRange) { state = AdviceState.triggered; } else if (adv.hinted) { state = AdviceState.hinted; } else { state = AdviceState.regular; } return { minAngle: startAngle, maxAngle: endAngle, type: adv.type, state }; }); const frame = computeRadialFrame({ basePadding: 48, labelWidthPx: this.tickmarksInside ? 0 : estimateLabelWidthPx(tickmarks.map((t) => t.text)), clips: this.zoomToFitArc ? void 0 : { top: 40, bottom: 0, left: 0, right: 0 }, containerPx: measureContainerPx(this), faceDiameter: this.faceDiameter, zoomToFitArc: this.zoomToFitArc, areas, innerRadius: innerRingRadiusFor(WatchCircleType.double) }); this._radiusOffset = frame.radiusOffset; this._frame = frame; const shownTickmarks = frame.labelsHidden ? tickmarks.map((t) => ({ ...t, text: void 0 })) : tickmarks; const overlayViewBox = frame.viewBox; return html` <div class=\"container\"> <obc-watch .touching=${this.touching} .arcFrame=${frame} .areas=${areas} .angleSetpoint=${setpointAngle} .newAngleSetpoint=${this.newSetpoint !== void 0 ? 180 - this.newSetpoint : void 0} .atAngleSetpoint=${this.computeAtSetpoint(this.angle)} .angleSetpointAtZeroDeadband=${this.setpointAtZeroDeadband} .setpointOverride=${this.setpointOverride} .animateSetpoint=${this.animateSetpoint} .tickmarks=${shownTickmarks} .tickmarksInside=${this.tickmarksInside} .tickmarkStyle=${this.tickmarkStyle} .watchCircleType=${WatchCircleType.double} .barAreas=${barAreas} .state=${this.state} .priority=${this.priority} .advices=${advices} ></obc-watch> <svg viewBox=\"${overlayViewBox}\">${this.renderNeedle()}</svg> </div> `; } }"
10777
+ "default": "class extends SetpointMixin(LitElement) { constructor() { super(...arguments); this.angle = 0; this.variant = \"bar\"; this.maxAngle = 90; this.showLabels = false; this.tickmarksInside = false; this.state = InstrumentState.active; this.priority = Priority.regular; this.tickmarkStyle = TickmarkStyle.regular; this.advices = []; this.zoomToFitArc = false; this._radiusOffset = 0; this._hostSizePinned = false; this._resizeController = new ResizeController(this, {}); } firstUpdated(changed) { super.firstUpdated(changed); observeInnerBox(this._resizeController, this.renderRoot); } updated(changed) { super.updated(changed); const frame = this._frame; if (frame) { this.style.setProperty( \"--obc-rudder-aspect\", `${frame.width} / ${frame.height}` ); } this._hostSizePinned = applyPinnedHostSize( this, this._frame, this._hostSizePinned ); } /** Box the zoomed frame must keep visible, in SVG units. */ _needleIncludeBox(radiusOffset) { if (this.variant !== \"needle\") { return void 0; } const rad = degToRad(this.getAngle(this.angle)); const u = { x: Math.sin(rad), y: -Math.cos(rad) }; const inner = ObcRudder.NEEDLE_INNER_RADIUS + radiusOffset; const outer = ObcRudder.NEEDLE_OUTER_RADIUS + radiusOffset; const w = ObcRudder.NEEDLE_HALF_WIDTH; return { xMin: Math.min(inner * u.x, outer * u.x) - w, xMax: Math.max(inner * u.x, outer * u.x) + w, yMin: Math.min(inner * u.y, outer * u.y) - w, yMax: Math.max(inner * u.y, outer * u.y) + w }; } get _needleTransform() { const rOff = this._radiusOffset; if (rOff > 0) { return `translate(-256, -256) rotate(${-this.angle} 256 256) translate(0, ${rOff})`; } return `translate(-256, -256) rotate(${-this.angle} 256 256)`; } getAngle(value) { return 180 - value; } get barColor() { if (this.variant === \"needle\") { if (this.state === InstrumentState.loading || this.state === InstrumentState.off) { return \"var(--instrument-frame-tertiary-color)\"; } return this.priority === Priority.enhanced ? \"var(--instrument-enhanced-tertiary-color)\" : \"var(--instrument-regular-tertiary-color)\"; } else { if (this.state === InstrumentState.loading || this.state === InstrumentState.off) { return \"var(--instrument-frame-tertiary-color)\"; } return this.priority === Priority.enhanced ? \"var(--instrument-enhanced-secondary-color)\" : \"var(--instrument-regular-secondary-color)\"; } } renderNeedle() { if (this.variant === \"bar\") { return nothing; } let color; if (this.state === InstrumentState.loading || this.state === InstrumentState.off) { color = \"var(--instrument-frame-tertiary-color)\"; } else { color = this.priority === Priority.enhanced ? \"var(--instrument-enhanced-secondary-color)\" : \"var(--instrument-regular-secondary-color)\"; } return svg` <path transform=\"${this._needleTransform}\" d=\"M260.462 411.447C259.81 416.73 251.933 416.645 251.514 411.191L239.826 259.24C239.618 258.192 239.508 257.109 239.508 256C239.508 255.764 239.514 255.528 239.524 255.294L239.503 255.039L239.462 254.5H239.576C240.334 246.09 247.401 239.5 256.008 239.5C264.615 239.5 271.681 246.09 272.439 254.5H272.542L272.5 255.039L272.488 255.196C272.501 255.462 272.508 255.731 272.508 256C272.508 257.144 272.391 258.261 272.169 259.339L260.487 411.191L260.462 411.447Z\" fill=\"${color}\" stroke=\"var(--border-silhouette-color)\" /> `; } render() { const maxAngle = Math.max(2, this.maxAngle); const areas = [ { startAngle: 180 - maxAngle, endAngle: 180 + maxAngle, roundInsideCut: true, roundOutsideCut: true } ]; const barAreas = [ { startAngle: this.getAngle(0), endAngle: this.getAngle(this.angle), fillColor: this.barColor } ]; const setpointAngle = this.setpoint !== void 0 ? 180 - this.setpoint : void 0; const tickmarks = [ { angle: 180, type: TickmarkType.primary, text: this.showLabels ? \"0\" : void 0 }, { angle: 180, type: TickmarkType.zeroLineThick, color: this.barColor }, { angle: 180 - maxAngle, type: TickmarkType.secondary, text: this.showLabels ? maxAngle.toFixed(0) : void 0 }, { angle: 180 + maxAngle, type: TickmarkType.secondary, text: this.showLabels ? (-maxAngle).toFixed(0) : void 0 } ]; let helpAngle = null; if (maxAngle > 70) { helpAngle = 45; } else if (maxAngle > 50) { helpAngle = 30; } else if (maxAngle > 40) { helpAngle = 22.5; } if (helpAngle !== null) { tickmarks.push({ angle: 180 - helpAngle, type: TickmarkType.primary }); tickmarks.push({ angle: 180 + helpAngle, type: TickmarkType.primary }); } const advices = this.advices.map((adv) => { const startAngle = 180 - adv.maxAngle; const endAngle = 180 - adv.minAngle; const isInRange = this.setpoint !== void 0 && this.setpoint >= adv.minAngle && this.setpoint <= adv.maxAngle; let state; if (isInRange) { state = AdviceState.triggered; } else if (adv.hinted) { state = AdviceState.hinted; } else { state = AdviceState.regular; } return { minAngle: startAngle, maxAngle: endAngle, type: adv.type, state }; }); const frameOptions = { basePadding: 48, labelWidthPx: this.tickmarksInside ? 0 : estimateLabelWidthPx(tickmarks.map((t) => t.text)), clips: this.zoomToFitArc ? void 0 : { top: 40, bottom: 0, left: 0, right: 0 }, containerPx: measureContainerPx(this), faceDiameter: this.faceDiameter, zoomToFitArc: this.zoomToFitArc, // The zoomed arc is flat; a square box would be mostly empty height. zoomFit: ArcFrameFit.bbox, areas, innerRadius: innerRingRadiusFor(WatchCircleType.double) }; const probe = computeRadialFrame(frameOptions); const zoomIncludeBox = this.zoomToFitArc ? this._needleIncludeBox(probe.radiusOffset) : void 0; const frame = zoomIncludeBox ? computeRadialFrame({ ...frameOptions, zoomIncludeBox }) : probe; this._radiusOffset = frame.radiusOffset; this._frame = frame; const shownTickmarks = frame.labelsHidden ? tickmarks.map((t) => ({ ...t, text: void 0 })) : tickmarks; const overlayViewBox = frame.viewBox; return html` <div class=\"container\"> <obc-watch .touching=${this.touching} .arcFrame=${frame} .areas=${areas} .angleSetpoint=${setpointAngle} .newAngleSetpoint=${this.newSetpoint !== void 0 ? 180 - this.newSetpoint : void 0} .atAngleSetpoint=${this.computeAtSetpoint(this.angle)} .angleSetpointAtZeroDeadband=${this.setpointAtZeroDeadband} .setpointOverride=${this.setpointOverride} .animateSetpoint=${this.animateSetpoint} .tickmarks=${shownTickmarks} .tickmarksInside=${this.tickmarksInside} .tickmarkStyle=${this.tickmarkStyle} .watchCircleType=${WatchCircleType.double} .barAreas=${barAreas} .state=${this.state} .priority=${this.priority} .advices=${advices} ></obc-watch> <svg viewBox=\"${overlayViewBox}\">${this.renderNeedle()}</svg> </div> `; } }"
10778
10778
  }
10779
10779
  ],
10780
10780
  "exports": [
@@ -11156,7 +11156,7 @@
11156
11156
  {
11157
11157
  "kind": "variable",
11158
11158
  "name": "ObcWatch",
11159
- "default": "class extends LitElement { constructor() { super(...arguments); this._setpointId = `watch-setpoint-${Math.random().toString(36).slice(2, 9)}`; this._newSetpointId = `watch-new-setpoint-${Math.random().toString(36).slice(2, 9)}`; this.state = InstrumentState.active; this.priority = Priority.regular; this.watchCircleType = \"single\"; this.hasBackgroundCircle = false; this.northArrow = false; this.northMarker = false; this.atAngleSetpoint = false; this.angleSetpointAtZeroDeadband = 0.5; this.setpointOverride = false; this.touching = false; this.animateSetpoint = false; this._setpointCssAngle = 0; this._setpointCssAngleInit = false; this.areas = []; this.barAreas = []; this.roundBandCuts = false; this.splitBand = false; this.needles = []; this.tickmarks = []; this.tickmarksInside = false; this.tickmarkStyle = TickmarkStyle.regular; this.advices = []; this.crosshairEnabled = false; this.crosshairCenterCutout = false; this.showLabels = false; this.insideLabelsFlush = false; this.vessels = []; this.windKnots = null; this.windFromDirectionDeg = null; this.windSymbolRadius = null; this.current = null; this.currentFromDirectionDeg = null; this.currentSymbolRadius = null; this.currentIconCentered = false; this.scaleCurrentIcon = 1; this.starboardPortIndicator = false; this.clipTop = 0; this.clipBottom = 0; this.clipLeft = 0; this.clipRight = 0; this.endLabelsMaxMin = false; this.scaleWindIcon = 1; this.zoomToFitArc = false; this.tickFadeAngle = 0; this.rotPosition = RotPosition.innerCircle; this.rotStartAngle = 0; this.rotEndAngle = 0; this.rotPortStarboard = false; this.rotAtZeroDeadband = ROT_ZERO_DEADBAND_DEG; this.rotDotAnimationFactor = 18; this._legacyRotationsPerMinute = 0; this._resizeController = new ResizeController(this, {}); this._rOff = 0; this._labelsHidden = false; this._hostSizePinned = false; } set rotationsPerMinute(value) { this._legacyRotationsPerMinute = value; } /** Legacy spin speed of the ROT dot ring, in rotations per minute (sign controls direction; positive = clockwise). */ get rotationsPerMinute() { return this._legacyRotationsPerMinute; } /** * Effective rotations-per-minute for the spinning dot animation and * port/starboard direction sign. Resolves to: * • `(rateOfTurnDegreesPerMinute / 360) * rotDotAnimationFactor` when the * new physical API is in use, OR * • the legacy `rotationsPerMinute` value otherwise. */ get _effectiveRpm() { if (this.rateOfTurnDegreesPerMinute != null) { return this.rateOfTurnDegreesPerMinute / 360 * this.rotDotAnimationFactor; } return this._legacyRotationsPerMinute; } firstUpdated(changed) { super.firstUpdated(changed); observeInnerBox(this._resizeController, this.renderRoot); } willUpdate(changed) { super.willUpdate(changed); if (this._rotController && (changed.has(\"rateOfTurnDegreesPerMinute\") || changed.has(\"rotDotAnimationFactor\") || changed.has(\"rotationsPerMinute\"))) { this._rotController.rotationsPerMinute = this._effectiveRpm; } if (changed.has(\"newAngleSetpoint\") && this.animateSetpoint) { const prev = changed.get(\"newAngleSetpoint\"); if (prev !== void 0 && this.newAngleSetpoint === void 0) { this._departingNewAngleSetpoint = prev; clearTimeout(this._animationTimer); const duration = getSetpointAnimationDurationMs(this); this._animationTimer = setTimeout(() => { this._departingNewAngleSetpoint = void 0; }, duration); } } } disconnectedCallback() { super.disconnectedCallback(); clearTimeout(this._animationTimer); this._rotController = disposeRotController(this, this._rotController); } updated(changed) { super.updated(changed); this._hostSizePinned = applyPinnedHostSize( this, this.arcFrame ? void 0 : this._ownFrame, this._hostSizePinned ); const el = this.rotType ? this.renderRoot.querySelector(\"#rot-spinner\") : null; if (!el) { this._rotController = disposeRotController(this, this._rotController); return; } if (!this._rotController || this._rotController.el !== el) { this._rotController = disposeRotController(this, this._rotController); this._rotController = new RateOfTurnController( this, el, this._effectiveRpm ); } } get innerRingRadius() { return innerRingRadiusFor(this.watchCircleType); } /** * Radius for a dial-band edge under zoom: additive (`base + _rOff`), keeping * band thickness constant in SVG units. INVARIANT: every band-edge radius * (rings, value arc, bars, needles, inside-label `textRadius`) must go through * this — mixing additive and multiplicative offsets misaligns ticks, labels, * advice masks and arcs. The proportional experiments were removed for this * reason (PR #903). */ _bandRadius(base) { return base + this._rOff; } watchCircle() { const rings = []; const faceFill = this.hasBackgroundCircle && this.state !== InstrumentState.off ? svg` <circle cx=\"0\" cy=\"0\" r=\"${this._bandRadius(OUTER_RING_RADIUS)}\" fill=\"var(--instrument-frame-primary-color)\" stroke=\"none\" />` : void 0; const faceOutline = this.hasBackgroundCircle && this.areas.length > 0 ? svg` <circle cx=\"0\" cy=\"0\" r=\"${this._bandRadius(OUTER_RING_RADIUS)}\" fill=\"none\" stroke=\"var(--instrument-frame-tertiary-color)\" stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" />` : void 0; if (this.state !== InstrumentState.off) { rings.push(svg` <circle cx=\"0\" cy=\"0\" r=\"${this._bandRadius(172)}\" stroke=\"var(--instrument-frame-primary-color)\" fill=\"none\" stroke-width=\"24\" />`); if (this.watchCircleType !== \"single\") { const r1 = this._bandRadius(RING2_RADIUS); const r2 = this._bandRadius( this.watchCircleType === \"doubleThin\" ? RING3B_RADIUS : RING3_RADIUS ); const r = (r1 + r2) / 2; const strokeWidth = r1 - r2; if (this.splitBand && this.watchCircleType === \"double\") { rings.push(...this.splitBandTracks()); } else if (this.roundBandCuts && this.areas.length > 0) { rings.push( ...this.areas.map( (area) => svg`<path d=${roundedArch({ startAngle: area.startAngle, endAngle: area.endAngle, R: r1, r: r2, roundOutsideCut: area.roundOutsideCut, roundInsideCut: area.roundInsideCut, roundRadius: area.roundRadius })} fill=\"var(--instrument-frame-secondary-color)\" stroke=${area.outlined ? \"var(--instrument-frame-tertiary-color)\" : \"var(--instrument-frame-secondary-color)\"} stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" />` ) ); } else { rings.push( svg` <circle cx=\"0\" cy=\"0\" r=${r} stroke=\"var(--instrument-frame-secondary-color)\" stroke-width=${strokeWidth} fill=\"none\" /> <circle cx=\"0\" cy=\"0\" r=${r1} stroke=\"var(--instrument-frame-secondary-color)\" stroke-width=\"1\" fill=\"none\" vector-effect=\"non-scaling-stroke\" /> <circle cx=\"0\" cy=\"0\" r=${r2} stroke=\"var(--instrument-frame-secondary-color)\" stroke-width=\"1\" fill=\"none\" vector-effect=\"non-scaling-stroke\" /> ` ); } } if (this.watchCircleType === \"triple\") { const r1 = this._bandRadius(RING3_RADIUS); const r2 = this._bandRadius(RING4_RADIUS); const r = (r1 + r2) / 2; const strokeWidth = r1 - r2; rings.push( svg`<circle cx=\"0\" cy=\"0\" r=${r} stroke=\"var(--instrument-frame-primary-color)\" stroke-width=${strokeWidth} fill=\"none\" />` ); } } const maskSize = Math.max(200, OUTER_RING_RADIUS + this._rOff + 50); let result = rings; if (this.areas.length > 0) { const areas = this.areas.map((area) => { const svgPath = roundedArch({ startAngle: area.startAngle, endAngle: area.endAngle, R: this._bandRadius(OUTER_RING_RADIUS), r: this._bandRadius(this.innerRingRadius), roundOutsideCut: area.roundOutsideCut, roundInsideCut: area.roundInsideCut, roundRadius: area.roundRadius }); return svgPath; }); const mask = svg`<mask id=\"cutMask\"> <rect x=\"${-maskSize}\" y=\"${-maskSize}\" width=\"${maskSize * 2}\" height=\"${maskSize * 2}\" fill=\"black\" /> ${areas.map((area) => svg`<path d=${area} fill=\"white\" vector-effect=\"non-scaling-stroke\" stroke=\"white\" stroke-width=\"1\"/>`)} </mask>`; const rotClip = svg`<clipPath id=\"rot-arc-clip\">${this.areas.map( (area) => svg`<path d=${roundedArch({ startAngle: area.startAngle, endAngle: area.endAngle, R: OUTER_RING_RADIUS + this._rOff + 20, r: 0, roundOutsideCut: area.roundOutsideCut, roundInsideCut: area.roundInsideCut })} />` )}</clipPath>`; result = [ mask, rotClip, ...faceFill ? [faceFill] : [], svg`<g mask=\"url(#cutMask)\">${rings}</g>`, ...faceOutline ? [faceOutline] : [] ]; if (!this.hasBackgroundCircle) { areas.forEach((area) => { result.push( svg`<path d=${area} fill=\"none\" stroke=\"var(--instrument-frame-tertiary-color)\" vector-effect=\"non-scaling-stroke\"/>` ); }); } } else { if (faceFill) { result = [faceFill, ...rings]; } if (this.state !== InstrumentState.off) { result.push( circle(\"outerRing\", { radius: this._bandRadius(OUTER_RING_RADIUS), strokeWidth: 1, strokeColor: \"var(--instrument-frame-tertiary-color)\", strokePosition: \"center\", fillColor: \"none\" }) ); result.push(svg` ${circle(\"innerRing\", { radius: this._bandRadius(this.innerRingRadius), strokeWidth: 1, strokeColor: \"var(--instrument-frame-tertiary-color)\", strokePosition: \"center\", fillColor: \"none\" })} `); } else { result.push(svg` ${circle(\"innerRing\", { radius: this._bandRadius(OUTER_RING_RADIUS), strokeWidth: 1, strokeColor: \"var(--instrument-frame-tertiary-color)\", strokePosition: \"center\", fillColor: \"none\" })} `); } } return result; } _renderTickFadeDefs() { if (this.tickFadeAngle <= 0 || this.areas.length === 0) return nothing; const area = this.areas[0]; const arcSpan = area.endAngle - area.startAngle; const fade = Math.min(this.tickFadeAngle, arcSpan / 4); if (fade < 0.5) return nothing; const { startAngle, endAngle } = area; const R = OUTER_RING_RADIUS + this._rOff + 200; const px = (deg) => R * Math.sin(degToRad(deg)); const py = (deg) => -R * Math.cos(degToRad(deg)); const pieSlice = (a, b) => { const x1 = px(a), y1 = py(a); const x2 = px(b), y2 = py(b); const largeArc = b - a > 180 ? 1 : 0; return `M 0 0 L ${x1} ${y1} A ${R} ${R} 0 ${largeArc} 1 ${x2} ${y2} Z`; }; const Rm = (this._bandRadius(OUTER_RING_RADIUS) + this._bandRadius(this.innerRingRadius)) / 2; const gx = (deg) => Rm * Math.sin(degToRad(deg)); const gy = (deg) => -Rm * Math.cos(degToRad(deg)); return svg` <defs> <linearGradient id=\"tickFadeL\" gradientUnits=\"userSpaceOnUse\" x1=\"${gx(startAngle)}\" y1=\"${gy(startAngle)}\" x2=\"${gx(startAngle + fade)}\" y2=\"${gy(startAngle + fade)}\"> <stop offset=\"0\" stop-color=\"black\" /> <stop offset=\"1\" stop-color=\"white\" /> </linearGradient> <linearGradient id=\"tickFadeR\" gradientUnits=\"userSpaceOnUse\" x1=\"${gx(endAngle - fade)}\" y1=\"${gy(endAngle - fade)}\" x2=\"${gx(endAngle)}\" y2=\"${gy(endAngle)}\"> <stop offset=\"0\" stop-color=\"white\" /> <stop offset=\"1\" stop-color=\"black\" /> </linearGradient> <mask id=\"tickFadeMask\" maskUnits=\"userSpaceOnUse\" x=\"${-R}\" y=\"${-R}\" width=\"${R * 2}\" height=\"${R * 2}\"> <path d=\"${pieSlice(startAngle + fade, endAngle - fade)}\" fill=\"white\" /> <path d=\"${pieSlice(startAngle, startAngle + fade)}\" fill=\"url(#tickFadeL)\" /> <path d=\"${pieSlice(endAngle - fade, endAngle)}\" fill=\"url(#tickFadeR)\" /> </mask> </defs> `; } renderCrosshair(radius, labelKnockouts, centerCutoutRadius) { const hasLabelKnockouts = !!labelKnockouts && labelKnockouts.positions.length > 0; const hasMask = hasLabelKnockouts || centerCutoutRadius !== void 0; const labelRadius = hasLabelKnockouts ? Math.max( ...labelKnockouts.positions.map( (l) => Math.abs(l.x !== 0 ? l.x : l.y) ) ) : 0; const ringGapPad = hasLabelKnockouts ? 3 / labelKnockouts.scale : 0; return svg` ${hasMask ? svg` <defs> <mask id=\"crosshair-label-mask\" maskUnits=\"userSpaceOnUse\" x=\"-${radius}\" y=\"-${radius}\" width=\"${radius * 2}\" height=\"${radius * 2}\" > <rect x=\"-${radius}\" y=\"-${radius}\" width=\"${radius * 2}\" height=\"${radius * 2}\" fill=\"white\"/> ${hasLabelKnockouts ? svg` <!-- Annular ring knockout: hide crosshair between labels and inner ring --> <circle cx=\"0\" cy=\"0\" r=\"${labelKnockouts.innerRingRadius}\" fill=\"black\"/> <circle cx=\"0\" cy=\"0\" r=\"${labelRadius - ringGapPad}\" fill=\"white\"/> <!-- Per-label rectangular knockouts --> ${labelKnockouts.positions.map((l) => { const fontSize = 12 / labelKnockouts.scale; const pad = 3 / labelKnockouts.scale; const size = fontSize + pad * 2; return svg` <rect x=\"${l.x - size / 2}\" y=\"${l.y - size / 2}\" width=\"${size}\" height=\"${size}\" fill=\"black\" transform=\"rotate(${-(labelKnockouts.rotation ?? 0)})\" transform-origin=\"${l.x} ${l.y}\" /> `; })}` : nothing} ${centerCutoutRadius !== void 0 ? svg`<circle cx=\"0\" cy=\"0\" r=\"${centerCutoutRadius}\" fill=\"black\"/>` : nothing} </mask> </defs>` : nothing} <g mask=${hasMask ? \"url(#crosshair-label-mask)\" : nothing}> <line x1=\"-${radius}\" y1=\"0\" x2=\"${radius}\" y2=\"0\" stroke=\"var(--instrument-frame-tertiary-color)\" stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" /> <line x1=\"0\" y1=\"-${radius}\" x2=\"0\" y2=\"${radius}\" stroke=\"var(--instrument-frame-tertiary-color)\" stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" /> </g> `; } /** * The split band: the 112..160 annulus as two lane tracks with a bare-face * gap. Sector cuts collapse to flush fillets — half the line width on the * secondary lane, roundedArch's default on the primary lane. */ splitBandTracks() { const track = \"var(--instrument-frame-secondary-color)\"; if (this.areas.length === 0) { const priCenter = (this._bandRadius(PRIMARY_SUBBAND_INNER_RADIUS) + this._bandRadius(BAND_OUTER_RADIUS)) / 2; return [ svg`<circle cx=\"0\" cy=\"0\" r=${this._bandRadius(SECONDARY_LANE_RADIUS)} stroke=${track} stroke-width=${SECONDARY_LINE_WIDTH} fill=\"none\" />`, svg`<circle cx=\"0\" cy=\"0\" r=${priCenter} stroke=${track} stroke-width=${BAND_OUTER_RADIUS - PRIMARY_SUBBAND_INNER_RADIUS} fill=\"none\" />` ]; } return this.areas.flatMap((area) => [ svg`<path d=${roundedArch({ startAngle: area.startAngle, endAngle: area.endAngle, R: this._bandRadius(BAND_INNER_RADIUS + SECONDARY_LINE_WIDTH), r: this._bandRadius(BAND_INNER_RADIUS), roundOutsideCut: true, roundInsideCut: true, roundRadius: SECONDARY_LINE_WIDTH / 2 })} fill=${track} stroke=${track} stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" />`, svg`<path d=${roundedArch({ startAngle: area.startAngle, endAngle: area.endAngle, R: this._bandRadius(BAND_OUTER_RADIUS), r: this._bandRadius(PRIMARY_SUBBAND_INNER_RADIUS), roundOutsideCut: true, roundInsideCut: true })} fill=${track} stroke=${track} stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" />` ]); } renderBars() { if (this.barAreas.length === 0) { return nothing; } return this.barAreas.map((bar, index) => { let startAngle = Math.min(bar.startAngle, bar.endAngle); let endAngle = Math.max(bar.startAngle, bar.endAngle); if (this.splitBand && this.areas.length > 0) { for (const area of this.areas) { if (Math.abs(startAngle - area.startAngle) <= 0.01) { startAngle -= SPLIT_BAR_CUT_OVERSHOOT_DEG; } if (Math.abs(endAngle - area.endAngle) <= 0.01) { endAngle += SPLIT_BAR_CUT_OVERSHOOT_DEG; } } } const arc = roundedArch({ r: this._bandRadius(bar.innerRadius ?? RING3_RADIUS), R: this._bandRadius(bar.outerRadius ?? RING2_RADIUS), startAngle, endAngle, roundInsideCut: false, roundOutsideCut: false }); const barMaskR = (bar.outerRadius ?? RING2_RADIUS) + this._rOff + 40; const mask = svg`<mask id=\"barMask-${index}\"> <rect x=\"${-barMaskR}\" y=\"${-barMaskR}\" width=\"${barMaskR * 2}\" height=\"${barMaskR * 2}\" fill=\"black\" /> <path d=${roundedArch({ r: 1, R: barMaskR, startAngle, endAngle, roundInsideCut: false, roundOutsideCut: false })} fill=\"white\" /> </mask>`; const trackMask = (this.roundBandCuts || this.splitBand) && this.areas.length > 0 ? svg`<mask id=\"barTrackMask-${index}\"> <rect x=\"${-barMaskR}\" y=\"${-barMaskR}\" width=\"${barMaskR * 2}\" height=\"${barMaskR * 2}\" fill=\"black\" /> ${this.areas.map( (area) => svg`<path d=${roundedArch({ startAngle: area.startAngle, endAngle: area.endAngle, R: this._bandRadius( this.splitBand ? BAND_OUTER_RADIUS : bar.outerRadius ?? RING2_RADIUS ), r: this._bandRadius( this.splitBand ? PRIMARY_SUBBAND_INNER_RADIUS : bar.innerRadius ?? RING3_RADIUS ), // splitBandTracks always rounds the lane cuts, so the // split mask must too — else a bar could paint into the // arch fillets of an area with square cut flags. roundOutsideCut: this.splitBand || area.roundOutsideCut, roundInsideCut: this.splitBand || area.roundInsideCut, roundRadius: this.splitBand ? void 0 : area.roundRadius })} fill=\"white\" stroke=\"white\" stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" />` )} </mask>` : nothing; return svg` ${mask} ${trackMask} <g mask=${this.areas.length > 0 && !this.splitBand ? \"url(#cutMask)\" : nothing}> <g mask=${trackMask !== nothing ? `url(#barTrackMask-${index})` : nothing}> <path d=${arc} fill=${bar.fillColor} stroke=${bar.fillColor} stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" mask=\"url(#barMask-${index})\" /> </g> </g> `; }); } renderNeedles() { if (this.needles.length === 0) { return nothing; } return this.needles.map((needle) => { return svg` <rect transform=\"rotate(${needle.angle})\" x=\"-4\" y=\"${-this._bandRadius(RING2_RADIUS)}\" width=\"8\" height=\"${needle.length ?? 48}\" rx=\"4\" fill=${needle.fillColor} stroke=${needle.strokeColor} stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" paint-order=\"stroke fill\" /> `; }); } getScale({ width, height }) { const container = measureContainerPx(this); const scale = Math.min(container.width / width, container.height / height); if (!Number.isFinite(scale) || scale <= 0) { return 1; } return scale; } /** * Pixel width of the widest outside label, feeding the frame's label * reserve (issue #1021). Explicit `padding` is a hard geometry override * and disables the reserve, preserving legacy consumer output. */ getLabelWidthPx() { if (this.padding !== void 0 || this.tickmarksInside) { return 0; } if (this.showLabels) { return NSWE_LABEL_WIDTH_PX; } return estimateLabelWidthPx(this.tickmarks.map((t) => t.text)); } render() { let width; let height; let viewBox; if (this.arcFrame) { this._rOff = this.arcFrame.radiusOffset; this._labelsHidden = false; this._ownFrame = void 0; width = this.arcFrame.width; height = this.arcFrame.height; viewBox = this.arcFrame.viewBox; } else { const frame = computeRadialFrame({ basePadding: this.padding ?? 24, labelWidthPx: this.getLabelWidthPx(), clips: { top: this.clipTop, bottom: this.clipBottom, left: this.clipLeft, right: this.clipRight }, containerPx: measureContainerPx(this), faceDiameter: this.faceDiameter, zoomToFitArc: this.zoomToFitArc, areas: this.areas, innerRadius: this.innerRingRadius }); this._rOff = frame.radiusOffset; this._labelsHidden = frame.labelsHidden; this._ownFrame = frame; width = frame.width; height = frame.height; viewBox = frame.viewBox; } const rOff = this._rOff; const scale = this.getScale({ width, height }); const angleSetpoint = this.renderSetpoint(); const textRadius = this.tickmarksInside ? this._bandRadius(this.innerRingRadius) : this._bandRadius(OUTER_RING_RADIUS); const maxDigits = Math.max( ...this.tickmarks.map((t) => t.text?.length ?? 0) ); const tickmarks = this.tickmarks.map( (t) => tickmark(t.angle, { size: t.type, style: this.tickmarkStyle, scale, text: this.showLabels || this._labelsHidden ? void 0 : t.text, inside: this.tickmarksInside, textRadius, rotation: this.rotation, maxDigits, color: t.color, radiusOffset: rOff, endLabelsMaxMin: this.endLabelsMaxMin }) ); const advices = this.advices ? this.advices.map((a) => renderAdvice(a, rOff)) : nothing; const showNsweLabels = this.showLabels && !this._labelsHidden; const showNorthArrow = this.northArrow; const insideLabels = this.tickmarksInside && showNsweLabels; const includeNorth = !this.northArrow; const labelPositions = showNsweLabels ? getLabelPositions({ scale, inside: this.tickmarksInside, innerRadius: this.innerRingRadius + rOff, includeNorth, insideFlush: this.insideLabelsFlush }) : void 0; const labels = labelPositions ? renderLabels({ scale, rotation: this.rotation, inside: this.tickmarksInside, innerRadius: this.innerRingRadius + rOff, includeNorth, insideFlush: this.insideLabelsFlush }) : nothing; const northArrowEl = showNorthArrow ? this.northMarker ? renderNorthMarker({ scale, rotation: this.rotation }) : renderNorthArrow({ scale, rotation: this.rotation, inside: this.northArrowInside ?? this.tickmarksInside }) : nothing; const wind = this.windKnots != null && this.windFromDirectionDeg != null ? svg`<g transform=\"scale(${this.scaleWindIcon})\">${renderWind({ windKnots: this.windKnots, fromDirectionDeg: this.windFromDirectionDeg, radius: this.windSymbolRadius ?? WIND_ICON_OUTSIDE_RADIUS, color: this.windColor })}</g>` : nothing; const current = this.current != null && this.currentFromDirectionDeg != null ? this.currentIconCentered ? renderCurrentCentered({ current: this.current, fromDirectionDeg: this.currentFromDirectionDeg, scale: this.scaleCurrentIcon, color: this.currentColor }) : renderCurrent({ current: this.current, fromDirectionDeg: this.currentFromDirectionDeg, radius: this.currentSymbolRadius ?? CURRENT_ICON_OUTSIDE_RADIUS, color: this.currentColor }) : nothing; return html` <svg width=\"100%\" height=\"100%\" viewBox=${viewBox} style=\"--scale: ${scale}\" transform=\"rotate(${this.rotation ?? 0})\" > ${this.watchCircle()} ${this.renderBars()} ${this.crosshairEnabled ? this.renderCrosshair( OUTER_RING_RADIUS + rOff, insideLabels && labelPositions ? { positions: labelPositions, rotation: this.rotation, scale, innerRingRadius: this.innerRingRadius + rOff } : void 0, this.crosshairCenterCutout ? this.innerRingRadius + rOff : void 0 ) : nothing} ${northArrowEl} ${this.renderStarboardPortIndicator()} ${current} ${this._renderTickFadeDefs()} ${wind} ${this.tickFadeAngle > 0 && this.areas.length > 0 ? svg`<g mask=\"url(#tickFadeMask)\">${tickmarks}</g>` : tickmarks} ${this.areas.length > 0 ? svg`<g clip-path=\"url(#rot-arc-clip)\">${this.renderRot()}</g>` : this.renderRot()} ${advices} ${angleSetpoint} ${this.tickFadeAngle > 0 && this.areas.length > 0 ? svg`<g mask=\"url(#tickFadeMask)\">${labels}</g>` : labels} ${this.renderVesselImage()} ${this.renderNeedles()} </svg> `; } getRotColors() { const p = this.rotPriority ?? this.priority; const isEnhanced = p === Priority.enhanced; if (this.rotPortStarboard) { let direction; if (this.rotType === RotType.bar) { const cwSpan = normalizeAngle(this.rotEndAngle - this.rotStartAngle); direction = cwSpan <= 180 ? cwSpan : cwSpan - 360; } else { direction = this._effectiveRpm; } if (direction > 0) { return { dotColor: \"var(--instrument-starboard-secondary-color)\", barBgColor: \"var(--instrument-starboard-primary-color)\" }; } if (direction < 0) { return { dotColor: \"var(--instrument-port-secondary-color)\", barBgColor: \"var(--instrument-port-primary-color)\" }; } } return { dotColor: isEnhanced ? \"var(--instrument-enhanced-tertiary-color)\" : \"var(--instrument-regular-tertiary-color)\", barBgColor: isEnhanced ? \"var(--instrument-enhanced-secondary-color)\" : \"var(--instrument-regular-secondary-color)\" }; } renderRot() { if (!this.rotType) return nothing; const { dotColor, barBgColor } = this.getRotColors(); const rOff = this._rOff; if (this.rotType === RotType.bar) { const angularDelta = shortestAngularDeltaDeg( this.rotStartAngle, this.rotEndAngle ); const threshold = rotBarThresholdAngle(this.rotPosition, rOff); const zeroDb = Number.isFinite(this.rotAtZeroDeadband) ? this.rotAtZeroDeadband : ROT_ZERO_DEADBAND_DEG; if (angularDelta < Math.max(zeroDb, threshold)) { return renderRotZeroPill( barBgColor, this.rotStartAngle, this.rotPosition, rOff ); } return svg` ${renderRotBarStatic({ startAngle: this.rotStartAngle, endAngle: this.rotEndAngle, barColor: barBgColor, position: this.rotPosition, maskId: \"rot-bar-mask\", radiusOffset: rOff })} ${svg`<g clip-path=\"url(#rot-bar-mask)\"> <g id=\"rot-spinner\"> ${renderRotBarDots(dotColor, this.rotPosition, rOff)} </g> </g>`} `; } const p = this.rotPriority ?? this.priority; const isEnhanced = p === Priority.enhanced; let dotsColor = isEnhanced ? \"var(--instrument-enhanced-secondary-color)\" : \"var(--instrument-regular-secondary-color)\"; if (this.rotPortStarboard) { if (this._effectiveRpm > 0) { dotsColor = \"var(--instrument-starboard-secondary-color)\"; } else if (this._effectiveRpm < 0) { dotsColor = \"var(--instrument-port-secondary-color)\"; } } return svg` <g id=\"rot-spinner\"> ${renderRotDots(dotsColor, this.rotPosition, rOff)} </g> `; } renderSetpoint() { if (this.angleSetpoint === void 0) { return nothing; } const derived = deriveRadialSetpointConfig({ state: this.state, priority: this.priority, atSetpoint: this.atAngleSetpoint, angleSetpoint: this.angleSetpoint, setpointAtZeroDeadband: this.angleSetpointAtZeroDeadband, newAngleSetpoint: this.newAngleSetpoint, touching: this.touching, setpointOverride: this.setpointOverride }); const { visualState, colorMode, disabled, hasNewSetpoint } = derived; const outwardOffset = getSetpointOutwardOffset(visualState); const radius = RADIAL_SETPOINT_RADIUS + this._rOff + outwardOffset - RADIAL_SETPOINT_INWARD_ADJUST; const opacity = hasNewSetpoint ? 0.75 : 1; const originalMarker = drawSetpointMarker({ visualState, colorMode, disabled, id: this._setpointId }); const animate = this.animateSetpoint; const hasDeparting = this._departingNewAngleSetpoint !== void 0; const rawAngle = this.angleSetpoint + 90; if (!this._setpointCssAngleInit) { this._setpointCssAngle = rawAngle; this._setpointCssAngleInit = true; } else { this._setpointCssAngle = cssSafeAngle(this._setpointCssAngle, rawAngle); } const originalSetpoint = animate ? svg` <g style=\"transform: rotate(${this._setpointCssAngle}deg) translateX(${-radius}px) rotate(270deg); opacity: ${opacity}; transition: transform var(${SETPOINT_ANIMATION_CSS_VAR}, ${SETPOINT_ANIMATION_DURATION_DEFAULT}) ease-out, opacity var(${SETPOINT_ANIMATION_CSS_VAR}, ${SETPOINT_ANIMATION_DURATION_DEFAULT}) ease-out;\"> ${originalMarker} </g> ` : svg` <g transform=\"rotate(${this.angleSetpoint + 90}) translate(${-radius}, 0) rotate(270)\" opacity=\"${opacity}\"> ${originalMarker} </g> `; if (hasNewSetpoint || hasDeparting) { const isActive = hasNewSetpoint; const newAngle = isActive ? this.newAngleSetpoint : this._departingNewAngleSetpoint; const targetOpacity = isActive ? 1 : 0; const focusOutwardOffset = getSetpointOutwardOffset( SetpointVisualState.focus ); const focusRadius = RADIAL_SETPOINT_RADIUS + this._rOff + focusOutwardOffset - RADIAL_SETPOINT_INWARD_ADJUST; const newMarker = drawSetpointMarker({ visualState: SetpointVisualState.focus, colorMode, disabled: false, // newSetpoint is never disabled id: this._newSetpointId }); if (animate) { const duration = `var(${SETPOINT_ANIMATION_CSS_VAR}, ${SETPOINT_ANIMATION_DURATION_DEFAULT})`; return svg` ${originalSetpoint} <g style=\"transform: rotate(${newAngle + 90}deg) translateX(${-focusRadius}px) rotate(270deg); opacity: ${targetOpacity}; transition: opacity ${duration} ease-out;\"> ${newMarker} </g> `; } return svg` ${originalSetpoint} <g transform=\"rotate(${newAngle + 90}) translate(${-focusRadius}, 0) rotate(270)\" opacity=\"${targetOpacity}\"> ${newMarker} </g> `; } return originalSetpoint; } renderVesselImage() { if (this.vessels.length === 0) { return nothing; } return this.vessels.map((v) => { let size; switch (v.size) { case VesselImageSize.large: size = 224; break; case VesselImageSize.medium: size = 160; break; default: size = 100; } const scale = size / 160; return svg`<g style=\"transform: ${v.transform} scale(${scale}) translate(-80px, -80px) \">${vesselImages[v.vesselImage]}</g>`; }); } renderStarboardPortIndicator() { if (!this.starboardPortIndicator) { return nothing; } return [ adviceMask( 0, 180, \"var(--instrument-starboard-secondary-color)\", \"var(--instrument-starboard-secondary-color)\" ), adviceMask( 180, 360, \"var(--instrument-port-secondary-color)\", \"var(--instrument-port-secondary-color)\" ) ]; } }"
11159
+ "default": "class extends LitElement { constructor() { super(...arguments); this._setpointId = `watch-setpoint-${Math.random().toString(36).slice(2, 9)}`; this._newSetpointId = `watch-new-setpoint-${Math.random().toString(36).slice(2, 9)}`; this.state = InstrumentState.active; this.priority = Priority.regular; this.watchCircleType = \"single\"; this.hasBackgroundCircle = false; this.northArrow = false; this.northMarker = false; this.atAngleSetpoint = false; this.angleSetpointAtZeroDeadband = 0.5; this.setpointOverride = false; this.touching = false; this.animateSetpoint = false; this._setpointCssAngle = 0; this._setpointCssAngleInit = false; this.areas = []; this.barAreas = []; this.roundBandCuts = false; this.splitBand = false; this.needles = []; this.tickmarks = []; this.tickmarksInside = false; this.tickmarkStyle = TickmarkStyle.regular; this.advices = []; this.crosshairEnabled = false; this.crosshairCenterCutout = false; this.showLabels = false; this.insideLabelsFlush = false; this.vessels = []; this.windKnots = null; this.windFromDirectionDeg = null; this.windSymbolRadius = null; this.current = null; this.currentFromDirectionDeg = null; this.currentSymbolRadius = null; this.currentIconCentered = false; this.scaleCurrentIcon = 1; this.starboardPortIndicator = false; this.clipTop = 0; this.clipBottom = 0; this.clipLeft = 0; this.clipRight = 0; this.endLabelsMaxMin = false; this.scaleWindIcon = 1; this.zoomToFitArc = false; this.tickFadeAngle = 0; this.rotPosition = RotPosition.innerCircle; this.rotStartAngle = 0; this.rotEndAngle = 0; this.rotPortStarboard = false; this.rotAtZeroDeadband = ROT_ZERO_DEADBAND_DEG; this.rotDotAnimationFactor = 18; this._legacyRotationsPerMinute = 0; this._resizeController = new ResizeController(this, {}); this._rOff = 0; this._labelsHidden = false; this._hostSizePinned = false; } set rotationsPerMinute(value) { this._legacyRotationsPerMinute = value; } /** Legacy spin speed of the ROT dot ring, in rotations per minute (sign controls direction; positive = clockwise). */ get rotationsPerMinute() { return this._legacyRotationsPerMinute; } /** * Effective rotations-per-minute for the spinning dot animation and * port/starboard direction sign. Resolves to: * • `(rateOfTurnDegreesPerMinute / 360) * rotDotAnimationFactor` when the * new physical API is in use, OR * • the legacy `rotationsPerMinute` value otherwise. */ get _effectiveRpm() { if (this.rateOfTurnDegreesPerMinute != null) { return this.rateOfTurnDegreesPerMinute / 360 * this.rotDotAnimationFactor; } return this._legacyRotationsPerMinute; } firstUpdated(changed) { super.firstUpdated(changed); observeInnerBox(this._resizeController, this.renderRoot); } willUpdate(changed) { super.willUpdate(changed); if (this._rotController && (changed.has(\"rateOfTurnDegreesPerMinute\") || changed.has(\"rotDotAnimationFactor\") || changed.has(\"rotationsPerMinute\"))) { this._rotController.rotationsPerMinute = this._effectiveRpm; } if (changed.has(\"newAngleSetpoint\") && this.animateSetpoint) { const prev = changed.get(\"newAngleSetpoint\"); if (prev !== void 0 && this.newAngleSetpoint === void 0) { this._departingNewAngleSetpoint = prev; clearTimeout(this._animationTimer); const duration = getSetpointAnimationDurationMs(this); this._animationTimer = setTimeout(() => { this._departingNewAngleSetpoint = void 0; }, duration); } } } disconnectedCallback() { super.disconnectedCallback(); clearTimeout(this._animationTimer); this._rotController = disposeRotController(this, this._rotController); } updated(changed) { super.updated(changed); this._hostSizePinned = applyPinnedHostSize( this, this.arcFrame ? void 0 : this._ownFrame, this._hostSizePinned ); const el = this.rotType ? this.renderRoot.querySelector(\"#rot-spinner\") : null; if (!el) { this._rotController = disposeRotController(this, this._rotController); return; } if (!this._rotController || this._rotController.el !== el) { this._rotController = disposeRotController(this, this._rotController); this._rotController = new RateOfTurnController( this, el, this._effectiveRpm ); } } get innerRingRadius() { return innerRingRadiusFor(this.watchCircleType); } /** * Radius for a dial-band edge under zoom: additive (`base + _rOff`), keeping * band thickness constant in SVG units. INVARIANT: every band-edge radius * (rings, value arc, bars, needles, inside-label `textRadius`) must go through * this — mixing additive and multiplicative offsets misaligns ticks, labels, * advice masks and arcs. The proportional experiments were removed for this * reason (PR #903). */ _bandRadius(base) { return base + this._rOff; } watchCircle() { const rings = []; const faceFill = this.hasBackgroundCircle && this.state !== InstrumentState.off ? svg` <circle cx=\"0\" cy=\"0\" r=\"${this._bandRadius(OUTER_RING_RADIUS)}\" fill=\"var(--instrument-frame-primary-color)\" stroke=\"none\" />` : void 0; const faceOutline = this.hasBackgroundCircle && this.areas.length > 0 ? svg` <circle cx=\"0\" cy=\"0\" r=\"${this._bandRadius(OUTER_RING_RADIUS)}\" fill=\"none\" stroke=\"var(--instrument-frame-tertiary-color)\" stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" />` : void 0; if (this.state !== InstrumentState.off) { rings.push(svg` <circle cx=\"0\" cy=\"0\" r=\"${this._bandRadius(172)}\" stroke=\"var(--instrument-frame-primary-color)\" fill=\"none\" stroke-width=\"24\" />`); if (this.watchCircleType !== \"single\") { const r1 = this._bandRadius(RING2_RADIUS); const r2 = this._bandRadius( this.watchCircleType === \"doubleThin\" ? RING3B_RADIUS : RING3_RADIUS ); const r = (r1 + r2) / 2; const strokeWidth = r1 - r2; if (this.splitBand && this.watchCircleType === \"double\") { rings.push(...this.splitBandTracks()); } else if (this.roundBandCuts && this.areas.length > 0) { rings.push( ...this.areas.map( (area) => svg`<path d=${roundedArch({ startAngle: area.startAngle, endAngle: area.endAngle, R: r1, r: r2, roundOutsideCut: area.roundOutsideCut, roundInsideCut: area.roundInsideCut, roundRadius: area.roundRadius })} fill=\"var(--instrument-frame-secondary-color)\" stroke=${area.outlined ? \"var(--instrument-frame-tertiary-color)\" : \"var(--instrument-frame-secondary-color)\"} stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" />` ) ); } else { rings.push( svg` <circle cx=\"0\" cy=\"0\" r=${r} stroke=\"var(--instrument-frame-secondary-color)\" stroke-width=${strokeWidth} fill=\"none\" /> <circle cx=\"0\" cy=\"0\" r=${r1} stroke=\"var(--instrument-frame-secondary-color)\" stroke-width=\"1\" fill=\"none\" vector-effect=\"non-scaling-stroke\" /> <circle cx=\"0\" cy=\"0\" r=${r2} stroke=\"var(--instrument-frame-secondary-color)\" stroke-width=\"1\" fill=\"none\" vector-effect=\"non-scaling-stroke\" /> ` ); } } if (this.watchCircleType === \"triple\") { const r1 = this._bandRadius(RING3_RADIUS); const r2 = this._bandRadius(RING4_RADIUS); const r = (r1 + r2) / 2; const strokeWidth = r1 - r2; rings.push( svg`<circle cx=\"0\" cy=\"0\" r=${r} stroke=\"var(--instrument-frame-primary-color)\" stroke-width=${strokeWidth} fill=\"none\" />` ); } } const maskSize = Math.max(200, OUTER_RING_RADIUS + this._rOff + 50); let result = rings; if (this.areas.length > 0) { const areas = this.areas.map((area) => { const svgPath = roundedArch({ startAngle: area.startAngle, endAngle: area.endAngle, R: this._bandRadius(OUTER_RING_RADIUS), r: this._bandRadius(this.innerRingRadius), roundOutsideCut: area.roundOutsideCut, roundInsideCut: area.roundInsideCut, roundRadius: area.roundRadius }); return svgPath; }); const mask = svg`<mask id=\"cutMask\"> <rect x=\"${-maskSize}\" y=\"${-maskSize}\" width=\"${maskSize * 2}\" height=\"${maskSize * 2}\" fill=\"black\" /> ${areas.map((area) => svg`<path d=${area} fill=\"white\" vector-effect=\"non-scaling-stroke\" stroke=\"white\" stroke-width=\"1\"/>`)} </mask>`; const rotClip = svg`<clipPath id=\"rot-arc-clip\">${this.areas.map( (area) => svg`<path d=${roundedArch({ startAngle: area.startAngle, endAngle: area.endAngle, R: OUTER_RING_RADIUS + this._rOff + 20, r: 0, roundOutsideCut: area.roundOutsideCut, roundInsideCut: area.roundInsideCut })} />` )}</clipPath>`; result = [ mask, rotClip, ...faceFill ? [faceFill] : [], svg`<g mask=\"url(#cutMask)\">${rings}</g>`, ...faceOutline ? [faceOutline] : [] ]; if (!this.hasBackgroundCircle) { areas.forEach((area) => { result.push( svg`<path d=${area} fill=\"none\" stroke=\"var(--instrument-frame-tertiary-color)\" vector-effect=\"non-scaling-stroke\"/>` ); }); } } else { if (faceFill) { result = [faceFill, ...rings]; } if (this.state !== InstrumentState.off) { result.push( circle(\"outerRing\", { radius: this._bandRadius(OUTER_RING_RADIUS), strokeWidth: 1, strokeColor: \"var(--instrument-frame-tertiary-color)\", strokePosition: \"center\", fillColor: \"none\" }) ); result.push(svg` ${circle(\"innerRing\", { radius: this._bandRadius(this.innerRingRadius), strokeWidth: 1, strokeColor: \"var(--instrument-frame-tertiary-color)\", strokePosition: \"center\", fillColor: \"none\" })} `); } else { result.push(svg` ${circle(\"innerRing\", { radius: this._bandRadius(OUTER_RING_RADIUS), strokeWidth: 1, strokeColor: \"var(--instrument-frame-tertiary-color)\", strokePosition: \"center\", fillColor: \"none\" })} `); } } return result; } _renderTickFadeDefs() { if (this.tickFadeAngle <= 0 || this.areas.length === 0) return nothing; const area = this.areas[0]; const arcSpan = area.endAngle - area.startAngle; const fade = Math.min(this.tickFadeAngle, arcSpan / 4); if (fade < 0.5) return nothing; const { startAngle, endAngle } = area; const R = OUTER_RING_RADIUS + this._rOff + 200; const px = (deg) => R * Math.sin(degToRad(deg)); const py = (deg) => -R * Math.cos(degToRad(deg)); const pieSlice = (a, b) => { const x1 = px(a), y1 = py(a); const x2 = px(b), y2 = py(b); const largeArc = b - a > 180 ? 1 : 0; return `M 0 0 L ${x1} ${y1} A ${R} ${R} 0 ${largeArc} 1 ${x2} ${y2} Z`; }; const Rm = (this._bandRadius(OUTER_RING_RADIUS) + this._bandRadius(this.innerRingRadius)) / 2; const gx = (deg) => Rm * Math.sin(degToRad(deg)); const gy = (deg) => -Rm * Math.cos(degToRad(deg)); return svg` <defs> <linearGradient id=\"tickFadeL\" gradientUnits=\"userSpaceOnUse\" x1=\"${gx(startAngle)}\" y1=\"${gy(startAngle)}\" x2=\"${gx(startAngle + fade)}\" y2=\"${gy(startAngle + fade)}\"> <stop offset=\"0\" stop-color=\"black\" /> <stop offset=\"1\" stop-color=\"white\" /> </linearGradient> <linearGradient id=\"tickFadeR\" gradientUnits=\"userSpaceOnUse\" x1=\"${gx(endAngle - fade)}\" y1=\"${gy(endAngle - fade)}\" x2=\"${gx(endAngle)}\" y2=\"${gy(endAngle)}\"> <stop offset=\"0\" stop-color=\"white\" /> <stop offset=\"1\" stop-color=\"black\" /> </linearGradient> <mask id=\"tickFadeMask\" maskUnits=\"userSpaceOnUse\" x=\"${-R}\" y=\"${-R}\" width=\"${R * 2}\" height=\"${R * 2}\"> <path d=\"${pieSlice(startAngle + fade, endAngle - fade)}\" fill=\"white\" /> <path d=\"${pieSlice(startAngle, startAngle + fade)}\" fill=\"url(#tickFadeL)\" /> <path d=\"${pieSlice(endAngle - fade, endAngle)}\" fill=\"url(#tickFadeR)\" /> </mask> </defs> `; } renderCrosshair(radius, labelKnockouts, centerCutoutRadius) { const hasLabelKnockouts = !!labelKnockouts && labelKnockouts.positions.length > 0; const hasMask = hasLabelKnockouts || centerCutoutRadius !== void 0; const labelRadius = hasLabelKnockouts ? Math.max( ...labelKnockouts.positions.map( (l) => Math.abs(l.x !== 0 ? l.x : l.y) ) ) : 0; const ringGapPad = hasLabelKnockouts ? 3 / labelKnockouts.scale : 0; return svg` ${hasMask ? svg` <defs> <mask id=\"crosshair-label-mask\" maskUnits=\"userSpaceOnUse\" x=\"-${radius}\" y=\"-${radius}\" width=\"${radius * 2}\" height=\"${radius * 2}\" > <rect x=\"-${radius}\" y=\"-${radius}\" width=\"${radius * 2}\" height=\"${radius * 2}\" fill=\"white\"/> ${hasLabelKnockouts ? svg` <!-- Annular ring knockout: hide crosshair between labels and inner ring --> <circle cx=\"0\" cy=\"0\" r=\"${labelKnockouts.innerRingRadius}\" fill=\"black\"/> <circle cx=\"0\" cy=\"0\" r=\"${labelRadius - ringGapPad}\" fill=\"white\"/> <!-- Per-label rectangular knockouts --> ${labelKnockouts.positions.map((l) => { const fontSize = 12 / labelKnockouts.scale; const pad = 3 / labelKnockouts.scale; const size = fontSize + pad * 2; return svg` <rect x=\"${l.x - size / 2}\" y=\"${l.y - size / 2}\" width=\"${size}\" height=\"${size}\" fill=\"black\" transform=\"rotate(${-(labelKnockouts.rotation ?? 0)})\" transform-origin=\"${l.x} ${l.y}\" /> `; })}` : nothing} ${centerCutoutRadius !== void 0 ? svg`<circle cx=\"0\" cy=\"0\" r=\"${centerCutoutRadius}\" fill=\"black\"/>` : nothing} </mask> </defs>` : nothing} <g mask=${hasMask ? \"url(#crosshair-label-mask)\" : nothing}> <line x1=\"-${radius}\" y1=\"0\" x2=\"${radius}\" y2=\"0\" stroke=\"var(--instrument-frame-tertiary-color)\" stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" /> <line x1=\"0\" y1=\"-${radius}\" x2=\"0\" y2=\"${radius}\" stroke=\"var(--instrument-frame-tertiary-color)\" stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" /> </g> `; } /** * The split band: the 112..160 annulus as two lane tracks with a bare-face * gap. Sector cuts collapse to flush fillets — half the line width on the * secondary lane, roundedArch's default on the primary lane. */ splitBandTracks() { const track = \"var(--instrument-frame-secondary-color)\"; if (this.areas.length === 0) { const priCenter = (this._bandRadius(PRIMARY_SUBBAND_INNER_RADIUS) + this._bandRadius(BAND_OUTER_RADIUS)) / 2; return [ svg`<circle cx=\"0\" cy=\"0\" r=${this._bandRadius(SECONDARY_LANE_RADIUS)} stroke=${track} stroke-width=${SECONDARY_LINE_WIDTH} fill=\"none\" />`, svg`<circle cx=\"0\" cy=\"0\" r=${priCenter} stroke=${track} stroke-width=${BAND_OUTER_RADIUS - PRIMARY_SUBBAND_INNER_RADIUS} fill=\"none\" />` ]; } return this.areas.flatMap((area) => [ svg`<path d=${roundedArch({ startAngle: area.startAngle, endAngle: area.endAngle, R: this._bandRadius(BAND_INNER_RADIUS + SECONDARY_LINE_WIDTH), r: this._bandRadius(BAND_INNER_RADIUS), roundOutsideCut: true, roundInsideCut: true, roundRadius: SECONDARY_LINE_WIDTH / 2 })} fill=${track} stroke=${track} stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" />`, svg`<path d=${roundedArch({ startAngle: area.startAngle, endAngle: area.endAngle, R: this._bandRadius(BAND_OUTER_RADIUS), r: this._bandRadius(PRIMARY_SUBBAND_INNER_RADIUS), roundOutsideCut: true, roundInsideCut: true })} fill=${track} stroke=${track} stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" />` ]); } renderBars() { if (this.barAreas.length === 0) { return nothing; } return this.barAreas.map((bar, index) => { let startAngle = Math.min(bar.startAngle, bar.endAngle); let endAngle = Math.max(bar.startAngle, bar.endAngle); if (this.splitBand && this.areas.length > 0) { for (const area of this.areas) { if (Math.abs(startAngle - area.startAngle) <= 0.01) { startAngle -= SPLIT_BAR_CUT_OVERSHOOT_DEG; } if (Math.abs(endAngle - area.endAngle) <= 0.01) { endAngle += SPLIT_BAR_CUT_OVERSHOOT_DEG; } } } const arc = roundedArch({ r: this._bandRadius(bar.innerRadius ?? RING3_RADIUS), R: this._bandRadius(bar.outerRadius ?? RING2_RADIUS), startAngle, endAngle, roundInsideCut: false, roundOutsideCut: false }); const barMaskR = (bar.outerRadius ?? RING2_RADIUS) + this._rOff + 40; const mask = svg`<mask id=\"barMask-${index}\"> <rect x=\"${-barMaskR}\" y=\"${-barMaskR}\" width=\"${barMaskR * 2}\" height=\"${barMaskR * 2}\" fill=\"black\" /> <path d=${roundedArch({ r: 1, R: barMaskR, startAngle, endAngle, roundInsideCut: false, roundOutsideCut: false })} fill=\"white\" /> </mask>`; const trackMask = (this.roundBandCuts || this.splitBand) && this.areas.length > 0 ? svg`<mask id=\"barTrackMask-${index}\"> <rect x=\"${-barMaskR}\" y=\"${-barMaskR}\" width=\"${barMaskR * 2}\" height=\"${barMaskR * 2}\" fill=\"black\" /> ${this.areas.map( (area) => svg`<path d=${roundedArch({ startAngle: area.startAngle, endAngle: area.endAngle, R: this._bandRadius( this.splitBand ? BAND_OUTER_RADIUS : bar.outerRadius ?? RING2_RADIUS ), r: this._bandRadius( this.splitBand ? PRIMARY_SUBBAND_INNER_RADIUS : bar.innerRadius ?? RING3_RADIUS ), // splitBandTracks always rounds the lane cuts, so the // split mask must too — else a bar could paint into the // arch fillets of an area with square cut flags. roundOutsideCut: this.splitBand || area.roundOutsideCut, roundInsideCut: this.splitBand || area.roundInsideCut, roundRadius: this.splitBand ? void 0 : area.roundRadius })} fill=\"white\" stroke=\"white\" stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" />` )} </mask>` : nothing; return svg` ${mask} ${trackMask} <g mask=${this.areas.length > 0 && !this.splitBand ? \"url(#cutMask)\" : nothing}> <g mask=${trackMask !== nothing ? `url(#barTrackMask-${index})` : nothing}> <path d=${arc} fill=${bar.fillColor} stroke=${bar.fillColor} stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" mask=\"url(#barMask-${index})\" /> </g> </g> `; }); } renderNeedles() { if (this.needles.length === 0) { return nothing; } return this.needles.map((needle) => { return svg` <rect transform=\"rotate(${needle.angle})\" x=\"-4\" y=\"${-this._bandRadius(RING2_RADIUS)}\" width=\"8\" height=\"${needle.length ?? 48}\" rx=\"4\" fill=${needle.fillColor} stroke=${needle.strokeColor} stroke-width=\"1\" vector-effect=\"non-scaling-stroke\" paint-order=\"stroke fill\" /> `; }); } getScale({ width, height }) { const container = measureContainerPx(this); const scale = Math.min(container.width / width, container.height / height); if (!Number.isFinite(scale) || scale <= 0) { return 1; } return scale; } /** * Pixel width of the widest outside label, feeding the frame's label * reserve (issue #1021). Explicit `padding` is a hard geometry override * and disables the reserve, preserving legacy consumer output. */ getLabelWidthPx() { if (this.padding !== void 0 || this.tickmarksInside) { return 0; } if (this.showLabels) { return NSWE_LABEL_WIDTH_PX; } return estimateLabelWidthPx(this.tickmarks.map((t) => t.text)); } render() { let width; let height; let frameX; let frameY; let viewBox; if (this.arcFrame) { this._rOff = this.arcFrame.radiusOffset; this._labelsHidden = false; this._ownFrame = void 0; width = this.arcFrame.width; height = this.arcFrame.height; frameX = this.arcFrame.x; frameY = this.arcFrame.y; viewBox = this.arcFrame.viewBox; } else { const frame = computeRadialFrame({ basePadding: this.padding ?? 24, labelWidthPx: this.getLabelWidthPx(), clips: { top: this.clipTop, bottom: this.clipBottom, left: this.clipLeft, right: this.clipRight }, containerPx: measureContainerPx(this), faceDiameter: this.faceDiameter, zoomToFitArc: this.zoomToFitArc, areas: this.areas, innerRadius: this.innerRingRadius }); this._rOff = frame.radiusOffset; this._labelsHidden = frame.labelsHidden; this._ownFrame = frame; width = frame.width; height = frame.height; frameX = frame.x; frameY = frame.y; viewBox = frame.viewBox; } const rOff = this._rOff; const scale = this.getScale({ width, height }); const pivotX = width > 0 ? -frameX / width * 100 : 50; const pivotY = height > 0 ? -frameY / height * 100 : 50; const cropped = pivotX !== 50 || pivotY !== 50; const angleSetpoint = this.renderSetpoint(); const textRadius = this.tickmarksInside ? this._bandRadius(this.innerRingRadius) : this._bandRadius(OUTER_RING_RADIUS); const maxDigits = Math.max( ...this.tickmarks.map((t) => t.text?.length ?? 0) ); const tickmarks = this.tickmarks.map( (t) => tickmark(t.angle, { size: t.type, style: this.tickmarkStyle, scale, text: this.showLabels || this._labelsHidden ? void 0 : t.text, inside: this.tickmarksInside, textRadius, rotation: this.rotation, maxDigits, color: t.color, radiusOffset: rOff, endLabelsMaxMin: this.endLabelsMaxMin }) ); const advices = this.advices ? this.advices.map((a) => renderAdvice(a, rOff)) : nothing; const showNsweLabels = this.showLabels && !this._labelsHidden; const showNorthArrow = this.northArrow; const insideLabels = this.tickmarksInside && showNsweLabels; const includeNorth = !this.northArrow; const labelPositions = showNsweLabels ? getLabelPositions({ scale, inside: this.tickmarksInside, innerRadius: this.innerRingRadius + rOff, includeNorth, insideFlush: this.insideLabelsFlush }) : void 0; const labels = labelPositions ? renderLabels({ scale, rotation: this.rotation, inside: this.tickmarksInside, innerRadius: this.innerRingRadius + rOff, includeNorth, insideFlush: this.insideLabelsFlush }) : nothing; const northArrowEl = showNorthArrow ? this.northMarker ? renderNorthMarker({ scale, rotation: this.rotation }) : renderNorthArrow({ scale, rotation: this.rotation, inside: this.northArrowInside ?? this.tickmarksInside }) : nothing; const wind = this.windKnots != null && this.windFromDirectionDeg != null ? svg`<g transform=\"scale(${this.scaleWindIcon})\">${renderWind({ windKnots: this.windKnots, fromDirectionDeg: this.windFromDirectionDeg, radius: this.windSymbolRadius ?? WIND_ICON_OUTSIDE_RADIUS, color: this.windColor })}</g>` : nothing; const current = this.current != null && this.currentFromDirectionDeg != null ? this.currentIconCentered ? renderCurrentCentered({ current: this.current, fromDirectionDeg: this.currentFromDirectionDeg, scale: this.scaleCurrentIcon, color: this.currentColor }) : renderCurrent({ current: this.current, fromDirectionDeg: this.currentFromDirectionDeg, radius: this.currentSymbolRadius ?? CURRENT_ICON_OUTSIDE_RADIUS, color: this.currentColor }) : nothing; return html` <svg class=${cropped ? \"cropped\" : nothing} width=\"100%\" height=\"100%\" viewBox=${viewBox} style=\"--scale: ${scale}; transform-origin: ${pivotX}% ${pivotY}%\" transform=\"rotate(${this.rotation ?? 0})\" > ${this.watchCircle()} ${this.renderBars()} ${this.crosshairEnabled ? this.renderCrosshair( OUTER_RING_RADIUS + rOff, insideLabels && labelPositions ? { positions: labelPositions, rotation: this.rotation, scale, innerRingRadius: this.innerRingRadius + rOff } : void 0, this.crosshairCenterCutout ? this.innerRingRadius + rOff : void 0 ) : nothing} ${northArrowEl} ${this.renderStarboardPortIndicator()} ${current} ${this._renderTickFadeDefs()} ${wind} ${this.tickFadeAngle > 0 && this.areas.length > 0 ? svg`<g mask=\"url(#tickFadeMask)\">${tickmarks}</g>` : tickmarks} ${this.areas.length > 0 ? svg`<g clip-path=\"url(#rot-arc-clip)\">${this.renderRot()}</g>` : this.renderRot()} ${advices} ${angleSetpoint} ${this.tickFadeAngle > 0 && this.areas.length > 0 ? svg`<g mask=\"url(#tickFadeMask)\">${labels}</g>` : labels} ${this.renderVesselImage()} ${this.renderNeedles()} </svg> `; } getRotColors() { const p = this.rotPriority ?? this.priority; const isEnhanced = p === Priority.enhanced; if (this.rotPortStarboard) { let direction; if (this.rotType === RotType.bar) { const cwSpan = normalizeAngle(this.rotEndAngle - this.rotStartAngle); direction = cwSpan <= 180 ? cwSpan : cwSpan - 360; } else { direction = this._effectiveRpm; } if (direction > 0) { return { dotColor: \"var(--instrument-starboard-secondary-color)\", barBgColor: \"var(--instrument-starboard-primary-color)\" }; } if (direction < 0) { return { dotColor: \"var(--instrument-port-secondary-color)\", barBgColor: \"var(--instrument-port-primary-color)\" }; } } return { dotColor: isEnhanced ? \"var(--instrument-enhanced-tertiary-color)\" : \"var(--instrument-regular-tertiary-color)\", barBgColor: isEnhanced ? \"var(--instrument-enhanced-secondary-color)\" : \"var(--instrument-regular-secondary-color)\" }; } renderRot() { if (!this.rotType) return nothing; const { dotColor, barBgColor } = this.getRotColors(); const rOff = this._rOff; if (this.rotType === RotType.bar) { const angularDelta = shortestAngularDeltaDeg( this.rotStartAngle, this.rotEndAngle ); const threshold = rotBarThresholdAngle(this.rotPosition, rOff); const zeroDb = Number.isFinite(this.rotAtZeroDeadband) ? this.rotAtZeroDeadband : ROT_ZERO_DEADBAND_DEG; if (angularDelta < Math.max(zeroDb, threshold)) { return renderRotZeroPill( barBgColor, this.rotStartAngle, this.rotPosition, rOff ); } return svg` ${renderRotBarStatic({ startAngle: this.rotStartAngle, endAngle: this.rotEndAngle, barColor: barBgColor, position: this.rotPosition, maskId: \"rot-bar-mask\", radiusOffset: rOff })} ${svg`<g clip-path=\"url(#rot-bar-mask)\"> <g id=\"rot-spinner\"> ${renderRotBarDots(dotColor, this.rotPosition, rOff)} </g> </g>`} `; } const p = this.rotPriority ?? this.priority; const isEnhanced = p === Priority.enhanced; let dotsColor = isEnhanced ? \"var(--instrument-enhanced-secondary-color)\" : \"var(--instrument-regular-secondary-color)\"; if (this.rotPortStarboard) { if (this._effectiveRpm > 0) { dotsColor = \"var(--instrument-starboard-secondary-color)\"; } else if (this._effectiveRpm < 0) { dotsColor = \"var(--instrument-port-secondary-color)\"; } } return svg` <g id=\"rot-spinner\"> ${renderRotDots(dotsColor, this.rotPosition, rOff)} </g> `; } renderSetpoint() { if (this.angleSetpoint === void 0) { return nothing; } const derived = deriveRadialSetpointConfig({ state: this.state, priority: this.priority, atSetpoint: this.atAngleSetpoint, angleSetpoint: this.angleSetpoint, setpointAtZeroDeadband: this.angleSetpointAtZeroDeadband, newAngleSetpoint: this.newAngleSetpoint, touching: this.touching, setpointOverride: this.setpointOverride }); const { visualState, colorMode, disabled, hasNewSetpoint } = derived; const outwardOffset = getSetpointOutwardOffset(visualState); const radius = RADIAL_SETPOINT_RADIUS + this._rOff + outwardOffset - RADIAL_SETPOINT_INWARD_ADJUST; const opacity = hasNewSetpoint ? 0.75 : 1; const originalMarker = drawSetpointMarker({ visualState, colorMode, disabled, id: this._setpointId }); const animate = this.animateSetpoint; const hasDeparting = this._departingNewAngleSetpoint !== void 0; const rawAngle = this.angleSetpoint + 90; if (!this._setpointCssAngleInit) { this._setpointCssAngle = rawAngle; this._setpointCssAngleInit = true; } else { this._setpointCssAngle = cssSafeAngle(this._setpointCssAngle, rawAngle); } const originalSetpoint = animate ? svg` <g style=\"transform: rotate(${this._setpointCssAngle}deg) translateX(${-radius}px) rotate(270deg); opacity: ${opacity}; transition: transform var(${SETPOINT_ANIMATION_CSS_VAR}, ${SETPOINT_ANIMATION_DURATION_DEFAULT}) ease-out, opacity var(${SETPOINT_ANIMATION_CSS_VAR}, ${SETPOINT_ANIMATION_DURATION_DEFAULT}) ease-out;\"> ${originalMarker} </g> ` : svg` <g transform=\"rotate(${this.angleSetpoint + 90}) translate(${-radius}, 0) rotate(270)\" opacity=\"${opacity}\"> ${originalMarker} </g> `; if (hasNewSetpoint || hasDeparting) { const isActive = hasNewSetpoint; const newAngle = isActive ? this.newAngleSetpoint : this._departingNewAngleSetpoint; const targetOpacity = isActive ? 1 : 0; const focusOutwardOffset = getSetpointOutwardOffset( SetpointVisualState.focus ); const focusRadius = RADIAL_SETPOINT_RADIUS + this._rOff + focusOutwardOffset - RADIAL_SETPOINT_INWARD_ADJUST; const newMarker = drawSetpointMarker({ visualState: SetpointVisualState.focus, colorMode, disabled: false, // newSetpoint is never disabled id: this._newSetpointId }); if (animate) { const duration = `var(${SETPOINT_ANIMATION_CSS_VAR}, ${SETPOINT_ANIMATION_DURATION_DEFAULT})`; return svg` ${originalSetpoint} <g style=\"transform: rotate(${newAngle + 90}deg) translateX(${-focusRadius}px) rotate(270deg); opacity: ${targetOpacity}; transition: opacity ${duration} ease-out;\"> ${newMarker} </g> `; } return svg` ${originalSetpoint} <g transform=\"rotate(${newAngle + 90}) translate(${-focusRadius}, 0) rotate(270)\" opacity=\"${targetOpacity}\"> ${newMarker} </g> `; } return originalSetpoint; } renderVesselImage() { if (this.vessels.length === 0) { return nothing; } return this.vessels.map((v) => { let size; switch (v.size) { case VesselImageSize.large: size = 224; break; case VesselImageSize.medium: size = 160; break; default: size = 100; } const scale = size / 160; return svg`<g style=\"transform: ${v.transform} scale(${scale}) translate(-80px, -80px) \">${vesselImages[v.vesselImage]}</g>`; }); } renderStarboardPortIndicator() { if (!this.starboardPortIndicator) { return nothing; } return [ adviceMask( 0, 180, \"var(--instrument-starboard-secondary-color)\", \"var(--instrument-starboard-secondary-color)\" ), adviceMask( 180, 360, \"var(--instrument-port-secondary-color)\", \"var(--instrument-port-secondary-color)\" ) ]; } }"
11160
11160
  }
11161
11161
  ],
11162
11162
  "exports": [
@@ -76328,56 +76328,71 @@
76328
76328
  },
76329
76329
  {
76330
76330
  "kind": "field",
76331
- "name": "_radiusOffset",
76331
+ "name": "_cachedAreas",
76332
76332
  "type": {
76333
- "text": "number"
76333
+ "text": "WatchArea[]"
76334
76334
  },
76335
76335
  "privacy": "private",
76336
- "default": "0"
76336
+ "default": "[]"
76337
76337
  },
76338
76338
  {
76339
76339
  "kind": "field",
76340
- "name": "_cachedViewBox",
76340
+ "name": "_cachedTickmarks",
76341
76341
  "type": {
76342
- "text": "string"
76342
+ "text": "Tickmark[]"
76343
76343
  },
76344
76344
  "privacy": "private",
76345
- "default": "''"
76345
+ "default": "[]"
76346
76346
  },
76347
76347
  {
76348
76348
  "kind": "field",
76349
- "name": "_cachedArcFrame",
76349
+ "name": "_cachedAdvices",
76350
76350
  "type": {
76351
- "text": "ZoomToFitArcFrame | undefined"
76351
+ "text": "AngleAdviceRaw[]"
76352
76352
  },
76353
- "privacy": "private"
76353
+ "privacy": "private",
76354
+ "default": "[]"
76354
76355
  },
76355
76356
  {
76356
76357
  "kind": "field",
76357
- "name": "_cachedAreas",
76358
- "type": {
76359
- "text": "WatchArea[]"
76360
- },
76358
+ "name": "_resizeController",
76361
76359
  "privacy": "private",
76362
- "default": "[]"
76360
+ "default": "new ResizeController(this, {})"
76363
76361
  },
76364
76362
  {
76365
76363
  "kind": "field",
76366
- "name": "_cachedTickmarks",
76364
+ "name": "_aspectWidth",
76367
76365
  "type": {
76368
- "text": "Tickmark[]"
76366
+ "text": "number"
76369
76367
  },
76370
76368
  "privacy": "private",
76371
- "default": "[]"
76369
+ "default": "448"
76372
76370
  },
76373
76371
  {
76374
76372
  "kind": "field",
76375
- "name": "_cachedAdvices",
76373
+ "name": "_aspectHeight",
76376
76374
  "type": {
76377
- "text": "AngleAdviceRaw[]"
76375
+ "text": "number"
76378
76376
  },
76379
76377
  "privacy": "private",
76380
- "default": "[]"
76378
+ "default": "217.28"
76379
+ },
76380
+ {
76381
+ "kind": "method",
76382
+ "name": "firstUpdated",
76383
+ "return": {
76384
+ "type": {
76385
+ "text": "void"
76386
+ }
76387
+ },
76388
+ "parameters": [
76389
+ {
76390
+ "name": "changed",
76391
+ "type": {
76392
+ "text": "PropertyValues"
76393
+ }
76394
+ }
76395
+ ]
76381
76396
  },
76382
76397
  {
76383
76398
  "kind": "method",
@@ -76396,6 +76411,23 @@
76396
76411
  }
76397
76412
  ]
76398
76413
  },
76414
+ {
76415
+ "kind": "method",
76416
+ "name": "updated",
76417
+ "return": {
76418
+ "type": {
76419
+ "text": "void"
76420
+ }
76421
+ },
76422
+ "parameters": [
76423
+ {
76424
+ "name": "changed",
76425
+ "type": {
76426
+ "text": "PropertyValues"
76427
+ }
76428
+ }
76429
+ ]
76430
+ },
76399
76431
  {
76400
76432
  "kind": "method",
76401
76433
  "name": "_mapAngle",
@@ -76426,13 +76458,25 @@
76426
76458
  },
76427
76459
  {
76428
76460
  "kind": "method",
76429
- "name": "_computeViewBox",
76461
+ "name": "_clipBottom",
76430
76462
  "privacy": "private",
76431
76463
  "return": {
76432
76464
  "type": {
76433
- "text": "void"
76465
+ "text": "number"
76434
76466
  }
76435
- }
76467
+ },
76468
+ "description": "Deepest crop the active features need, so none of them is shaved."
76469
+ },
76470
+ {
76471
+ "kind": "method",
76472
+ "name": "_buildFrame",
76473
+ "privacy": "private",
76474
+ "return": {
76475
+ "type": {
76476
+ "text": "RadialFrame"
76477
+ }
76478
+ },
76479
+ "description": "One frame per render, feeding both layers: the shared sector box cropped\nto the arc. Zoom enlarges the arc rather than the window, so the window\nonly slides outward by the radius offset and the canvas holds still."
76436
76480
  },
76437
76481
  {
76438
76482
  "kind": "method",
@@ -76524,14 +76568,23 @@
76524
76568
  ]
76525
76569
  },
76526
76570
  {
76527
- "kind": "field",
76571
+ "kind": "method",
76528
76572
  "name": "_readoutTopPercent",
76529
- "type": {
76530
- "text": "number"
76531
- },
76532
76573
  "privacy": "private",
76533
- "description": "Vertical placement of the readout as a percentage of the host height.\n\nWith `zoomToFitArc` the arc is reframed by `computeZoomToFitArcFrame`, whose\n`radiusOffset`/`viewBox` depend on the arc's *absolute* orientation (which\ncardinal axes its bounding box crosses), not just its bend. The arc itself\nis always rotated back to the top, so it stays put on screen — but a\nframe-derived offset would swing wildly as `heading` rotates the bbox around\nthe circle. So in zoom we use a fixed offset, which keeps the readout steady\nunder the (stationary) arc regardless of heading.\n\nWithout zoom the viewBox is the fixed, origin-symmetric 120° framing, so the\ngeometry is orientation-independent: place the readout halfway down the inner\nradius from the watch center toward the arc's inner edge.",
76534
- "readonly": true
76574
+ "return": {
76575
+ "type": {
76576
+ "text": "number"
76577
+ }
76578
+ },
76579
+ "parameters": [
76580
+ {
76581
+ "name": "frame",
76582
+ "type": {
76583
+ "text": "RadialFrame"
76584
+ }
76585
+ }
76586
+ ],
76587
+ "description": "Vertical placement of the readout as a percentage of the frame height.\n\nThe anchor sits halfway down the inner radius, below the arc's inner edge.\nZoom pushes that edge out by the radius offset, so the anchor follows it\nand the gap under the arc reads the same in both modes."
76535
76588
  },
76536
76589
  {
76537
76590
  "kind": "method",
@@ -92078,6 +92131,54 @@
92078
92131
  }
92079
92132
  ]
92080
92133
  },
92134
+ {
92135
+ "kind": "field",
92136
+ "name": "NEEDLE_INNER_RADIUS",
92137
+ "type": {
92138
+ "text": "number"
92139
+ },
92140
+ "privacy": "private",
92141
+ "static": true,
92142
+ "readonly": true,
92143
+ "default": "-16.5",
92144
+ "description": "Radial reach of the needle path about the watch centre, and its half\nwidth — the zoomed arc's own box stops short of the inner end."
92145
+ },
92146
+ {
92147
+ "kind": "field",
92148
+ "name": "NEEDLE_OUTER_RADIUS",
92149
+ "type": {
92150
+ "text": "number"
92151
+ },
92152
+ "privacy": "private",
92153
+ "static": true,
92154
+ "readonly": true,
92155
+ "default": "160.65"
92156
+ },
92157
+ {
92158
+ "kind": "field",
92159
+ "name": "NEEDLE_HALF_WIDTH",
92160
+ "type": {
92161
+ "text": "number"
92162
+ },
92163
+ "privacy": "private",
92164
+ "static": true,
92165
+ "readonly": true,
92166
+ "default": "16.5"
92167
+ },
92168
+ {
92169
+ "kind": "method",
92170
+ "name": "_needleIncludeBox",
92171
+ "privacy": "private",
92172
+ "parameters": [
92173
+ {
92174
+ "name": "radiusOffset",
92175
+ "type": {
92176
+ "text": "number"
92177
+ }
92178
+ }
92179
+ ],
92180
+ "description": "Box the zoomed frame must keep visible, in SVG units."
92181
+ },
92081
92182
  {
92082
92183
  "kind": "field",
92083
92184
  "name": "_needleTransform",
@@ -92115,8 +92216,7 @@
92115
92216
  {
92116
92217
  "kind": "field",
92117
92218
  "name": "styles",
92118
- "static": true,
92119
- "default": "css` * { box-sizing: border-box; } .container { position: relative; width: 100%; height: 100%; } .container > * { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } `"
92219
+ "static": true
92120
92220
  },
92121
92221
  {
92122
92222
  "kind": "field",
@@ -21,6 +21,13 @@ const componentStyle = css`* {
21
21
  height: 100%;
22
22
  }
23
23
 
24
+ .container > svg {
25
+ /* The arc is drawn where it points and rotated into the window, so it paints
26
+ outside the cropped viewBox; \`transform-origin\` (set inline) keeps that
27
+ rotation on the compass centre. */
28
+ overflow: visible;
29
+ }
30
+
24
31
  .container > .readout {
25
32
  left: 50%;
26
33
  width: auto;
@@ -30,17 +37,19 @@ const componentStyle = css`* {
30
37
 
31
38
  :host {
32
39
  display: block;
33
- width: 100%;
34
- height: 100%;
35
- /* Clips the rotated overlay <svg transform="rotate(...)">, whose corners
36
- swing outside the host and leak arc pixels in wide layouts (same
37
- protection obc-watch has had since #994). Known trade-off: the HDG/COG
38
- arrow apexes previously painted 1-2px past the host's top edge and are
39
- now shaved flat at the box edge — imperceptible at normal viewing.
40
- TODO(designer): if the shave is unwanted, the frame needs headroom so
41
- the arrow tips fit inside the box — see "Host clipping & the arrow-apex
42
- shave" in docs/agents/watch-radial-instruments.md before changing
43
- (interacts with the #1021/#1049 label-reserve geometry). */
40
+ /* The element is the cropped canvas, not a square holding one, so the
41
+ aspect comes from the frame each render — the crop and the label reserve
42
+ both move it. 448 / 217 is the default crop's box (448 wide × 448·(1 −
43
+ 51.5%) tall); keep in sync with \`SECTOR_CLIP_BOTTOM\` in
44
+ compass-sector.ts. */
45
+ width: auto;
46
+ height: auto;
47
+ max-width: 100%;
48
+ max-height: 100%;
49
+ aspect-ratio: var(--obc-compass-sector-aspect, 448 / 217);
50
+
51
+ /* Both layers paint past their viewBox so the rotation can carry the arc in;
52
+ this is the edge that bounds the component. */
44
53
  overflow: hidden;
45
54
  }
46
55
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"compass-sector.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"compass-sector.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -129,17 +129,26 @@ export declare class ObcCompassSector extends LitElement {
129
129
  private _halfFOV;
130
130
  private _arcHalfExtent;
131
131
  private _scale;
132
- private _radiusOffset;
133
- private _cachedViewBox;
134
- private _cachedArcFrame;
135
132
  private _cachedAreas;
136
133
  private _cachedTickmarks;
137
134
  private _cachedAdvices;
135
+ private _resizeController;
136
+ private _aspectWidth;
137
+ private _aspectHeight;
138
+ firstUpdated(changed: PropertyValues): void;
138
139
  willUpdate(changed: PropertyValues): void;
140
+ updated(changed: PropertyValues): void;
139
141
  disconnectedCallback(): void;
140
142
  private _mapAngle;
141
143
  private _buildTickmarks;
142
- private _computeViewBox;
144
+ /** Deepest crop the active features need, so none of them is shaved. */
145
+ private _clipBottom;
146
+ /**
147
+ * One frame per render, feeding both layers: the shared sector box cropped
148
+ * to the arc. Zoom enlarges the arc rather than the window, so the window
149
+ * only slides outward by the radius offset and the canvas holds still.
150
+ */
151
+ private _buildFrame;
143
152
  private _renderNorthArrow;
144
153
  private _angleInRange;
145
154
  private _buildAdvices;
@@ -147,21 +156,13 @@ export declare class ObcCompassSector extends LitElement {
147
156
  private get _rotEndAngle();
148
157
  private priorityFor;
149
158
  /**
150
- * Vertical placement of the readout as a percentage of the host height.
151
- *
152
- * With `zoomToFitArc` the arc is reframed by `computeZoomToFitArcFrame`, whose
153
- * `radiusOffset`/`viewBox` depend on the arc's *absolute* orientation (which
154
- * cardinal axes its bounding box crosses), not just its bend. The arc itself
155
- * is always rotated back to the top, so it stays put on screen — but a
156
- * frame-derived offset would swing wildly as `heading` rotates the bbox around
157
- * the circle. So in zoom we use a fixed offset, which keeps the readout steady
158
- * under the (stationary) arc regardless of heading.
159
+ * Vertical placement of the readout as a percentage of the frame height.
159
160
  *
160
- * Without zoom the viewBox is the fixed, origin-symmetric 120° framing, so the
161
- * geometry is orientation-independent: place the readout halfway down the inner
162
- * radius from the watch center toward the arc's inner edge.
161
+ * The anchor sits halfway down the inner radius, below the arc's inner edge.
162
+ * Zoom pushes that edge out by the radius offset, so the anchor follows it
163
+ * and the gap under the arc reads the same in both modes.
163
164
  */
164
- private get _readoutTopPercent();
165
+ private _readoutTopPercent;
165
166
  render(): import('lit-html').TemplateResult<1>;
166
167
  static styles: import('lit').CSSResult[];
167
168
  }
@@ -1 +1 @@
1
- {"version":3,"file":"compass-sector.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/compass-sector/compass-sector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAgC,MAAM,KAAK,CAAC;AAG9E,OAAO,mBAAmB,CAAC;AAS3B,OAAO,EAAc,WAAW,EAAiB,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAKL,OAAO,EACP,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAS3B,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,CAAC;AAE9B,oBAAY,4BAA4B;IACtC,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AAgCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,qBACa,gBAAiB,SAAQ,UAAU;IACpB,OAAO,SAAK;IACZ,gBAAgB,SAAK;IAErB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAQ;IACtC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,iBAAiB,EAAE,OAAO,CAAS;IACpC,6BAA6B,EAAE,MAAM,CAAO;IAC3C,uBAAuB,EAAE,OAAO,CAAS;IACvB,qBAAqB,UAAQ;IAChD,6BAA6B,EAAE,MAAM,CAAK;IACzC,eAAe,EAAE,OAAO,CAAS;IACjC,QAAQ,EAAE,OAAO,CAAS;IACV,cAAc,EAAE,WAAW,EAAE,CAAM;IAEpD,MAAM,EAAE,MAAM,CAAM;IAEpB,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,WAAW,EAAE,WAAW,CAA2B;IACnD,0BAA0B,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C,qBAAqB,EAAE,MAAM,CAAM;IAC7D;;;;;OAKG;IACuB,kBAAkB,EAAE,MAAM,CAAK;IAC/B,WAAW,EAAE,MAAM,CAAM;IACxB,gBAAgB,EAAE,OAAO,CAAS;IACnC,iBAAiB,EAAE,MAAM,CAAyB;IAElD,KAAK,EAAE,eAAe,CAA0B;IAChD,QAAQ,EAAE,QAAQ,CAAoB;IAEhE,gBAAgB,EAAE,4BAA4B,EAAE,CAE9C;IACyB,eAAe,EAAE,OAAO,CAAS;IACjC,YAAY,EAAE,OAAO,CAAS;IAC9B,UAAU,EAAE,OAAO,CAAS;IAC7B,KAAK,SAAS;IACd,IAAI,SAAS;IACb,cAAc,SAAK;IAE7C,OAAO,CAAC,UAAU,CAGf;IAGH,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,cAAc,CAAmB;IACzC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,cAAc,CAAM;IAC5B,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,cAAc,CAAwB;IAErC,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IA8DzC,oBAAoB,IAAI,IAAI;IASrC,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,eAAe;IAmDvB,OAAO,CAAC,eAAe;IAyBvB,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,aAAa;IAgBrB,OAAO,KAAK,sBAAsB,GAEjC;IAED,OAAO,KAAK,YAAY,GAKvB;IAED,OAAO,CAAC,WAAW;IAOnB;;;;;;;;;;;;;;OAcG;IACH,OAAO,KAAK,kBAAkB,GAU7B;IAMQ,MAAM;IAwGf,OAAgB,MAAM,4BAIpB;CACH;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
1
+ {"version":3,"file":"compass-sector.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/compass-sector/compass-sector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAgC,MAAM,KAAK,CAAC;AAI9E,OAAO,mBAAmB,CAAC;AAS3B,OAAO,EAAc,WAAW,EAAiB,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAKL,OAAO,EACP,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAY3B,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,CAAC;AAE9B,oBAAY,4BAA4B;IACtC,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AA+CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,qBACa,gBAAiB,SAAQ,UAAU;IACpB,OAAO,SAAK;IACZ,gBAAgB,SAAK;IAErB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAQ;IACtC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,iBAAiB,EAAE,OAAO,CAAS;IACpC,6BAA6B,EAAE,MAAM,CAAO;IAC3C,uBAAuB,EAAE,OAAO,CAAS;IACvB,qBAAqB,UAAQ;IAChD,6BAA6B,EAAE,MAAM,CAAK;IACzC,eAAe,EAAE,OAAO,CAAS;IACjC,QAAQ,EAAE,OAAO,CAAS;IACV,cAAc,EAAE,WAAW,EAAE,CAAM;IAEpD,MAAM,EAAE,MAAM,CAAM;IAEpB,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,WAAW,EAAE,WAAW,CAA2B;IACnD,0BAA0B,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/C,qBAAqB,EAAE,MAAM,CAAM;IAC7D;;;;;OAKG;IACuB,kBAAkB,EAAE,MAAM,CAAK;IAC/B,WAAW,EAAE,MAAM,CAAM;IACxB,gBAAgB,EAAE,OAAO,CAAS;IACnC,iBAAiB,EAAE,MAAM,CAAyB;IAElD,KAAK,EAAE,eAAe,CAA0B;IAChD,QAAQ,EAAE,QAAQ,CAAoB;IAEhE,gBAAgB,EAAE,4BAA4B,EAAE,CAE9C;IACyB,eAAe,EAAE,OAAO,CAAS;IACjC,YAAY,EAAE,OAAO,CAAS;IAC9B,UAAU,EAAE,OAAO,CAAS;IAC7B,KAAK,SAAS;IACd,IAAI,SAAS;IACb,cAAc,SAAK;IAE7C,OAAO,CAAC,UAAU,CAGf;IAGH,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,cAAc,CAAmB;IACzC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,cAAc,CAAwB;IAG9C,OAAO,CAAC,iBAAiB,CAAkC;IAE3D,OAAO,CAAC,YAAY,CAAO;IAC3B,OAAO,CAAC,aAAa,CAAU;IAEtB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAK3C,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IA6DzC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAStC,oBAAoB,IAAI,IAAI;IASrC,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,eAAe;IAmDvB,wEAAwE;IACxE,OAAO,CAAC,WAAW;IAiBnB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAkCnB,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,aAAa;IAgBrB,OAAO,KAAK,sBAAsB,GAEjC;IAED,OAAO,KAAK,YAAY,GAKvB;IAED,OAAO,CAAC,WAAW;IAOnB;;;;;;OAMG;IACH,OAAO,CAAC,kBAAkB;IAYjB,MAAM;IAoHf,OAAgB,MAAM,4BAIpB;CACH;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}