@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.17 → 2.2.0-next.18

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 (36) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +269 -67
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +257 -14
  4. package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts +4 -0
  5. package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts.map +1 -1
  6. package/dist/building-blocks/bar-horizontal/bar-horizontal.js +26 -23
  7. package/dist/building-blocks/bar-horizontal/bar-horizontal.js.map +1 -1
  8. package/dist/building-blocks/bar-vertical/bar-vertical.d.ts +4 -0
  9. package/dist/building-blocks/bar-vertical/bar-vertical.d.ts.map +1 -1
  10. package/dist/building-blocks/bar-vertical/bar-vertical.js +26 -23
  11. package/dist/building-blocks/bar-vertical/bar-vertical.js.map +1 -1
  12. package/dist/building-blocks/external-scale/external-scale.d.ts +28 -1
  13. package/dist/building-blocks/external-scale/external-scale.d.ts.map +1 -1
  14. package/dist/building-blocks/external-scale/external-scale.js +30 -4
  15. package/dist/building-blocks/external-scale/external-scale.js.map +1 -1
  16. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.d.ts +28 -17
  17. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.d.ts.map +1 -1
  18. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.js +91 -11
  19. package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.js.map +1 -1
  20. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.d.ts +28 -17
  21. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.d.ts.map +1 -1
  22. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.js +91 -11
  23. package/dist/navigation-instruments/gauge-vertical/gauge-vertical.js.map +1 -1
  24. package/package.json +1 -1
  25. package/src/building-blocks/bar-horizontal/bar-horizontal-fixed-aspect.spec.ts +102 -0
  26. package/src/building-blocks/bar-horizontal/bar-horizontal.ts +28 -23
  27. package/src/building-blocks/bar-vertical/bar-vertical-fixed-aspect.spec.ts +101 -0
  28. package/src/building-blocks/bar-vertical/bar-vertical.ts +28 -23
  29. package/src/building-blocks/external-scale/external-scale.ts +72 -3
  30. package/src/navigation-instruments/gauge-horizontal/gauge-horizontal.spec.ts +288 -0
  31. package/src/navigation-instruments/gauge-horizontal/gauge-horizontal.stories.ts +114 -4
  32. package/src/navigation-instruments/gauge-horizontal/gauge-horizontal.ts +129 -41
  33. package/src/navigation-instruments/gauge-trend/gauge-trend.stories.ts +8 -0
  34. package/src/navigation-instruments/gauge-vertical/gauge-vertical.spec.ts +284 -0
  35. package/src/navigation-instruments/gauge-vertical/gauge-vertical.stories.ts +117 -4
  36. package/src/navigation-instruments/gauge-vertical/gauge-vertical.ts +129 -41
@@ -17,7 +17,7 @@ declare const ObcGaugeHorizontal_base: (new (...args: any[]) => import('../../sv
17
17
  * ---
18
18
  *
19
19
  * ### Features
20
- * - **Fixed Layout:** Width (384px), padding (32px), bar/tick/label thicknesses, and border radius are fixed for consistent gauge appearance.
20
+ * - **Fixed Layout:** Width (384px), padding (32px), bar/tick/label thicknesses, and border radius are fixed for consistent gauge appearance. 384 px is the length the design is drawn at, not a layout limit: see `fixedAspectRatio`.
21
21
  * - **Scale Configuration:**
22
22
  * - Configurable `minValue` and `maxValue` for the value range.
23
23
  * - Optional main, primary, secondary, and tertiary tickmarks at specified intervals.
@@ -31,7 +31,7 @@ declare const ObcGaugeHorizontal_base: (new (...args: any[]) => import('../../sv
31
31
  * - Optional `setpoint` value displays a marker.
32
32
  * - Automatic at-setpoint detection with configurable deadband.
33
33
  * - **Advice Overlays:** Render advice ranges with different types and hinted states.
34
- * - **Fixed Aspect Ratio:** When enabled, scales the component proportionally while keeping label font-size constant.
34
+ * - **Fixed Aspect Ratio:** `fixedAspectRatio` scales the whole gauge to its container like a vector image while the label font size stays put; `scaleReferenceSize` is the container width at which it draws 1:1.
35
35
  * - **Dimension Reporting:** Dispatches `scale-dimensions-changed` events for parent chart integration.
36
36
  *
37
37
  * ---
@@ -48,7 +48,6 @@ declare const ObcGaugeHorizontal_base: (new (...args: any[]) => import('../../sv
48
48
  * - `hasBar`: true
49
49
  * - `hasScale`: true
50
50
  * - `scaleBackground`: true
51
- * - `fixedAspectRatio`: true (always scales proportionally)
52
51
  *
53
52
  * ---
54
53
  *
@@ -90,6 +89,9 @@ declare const ObcGaugeHorizontal_base: (new (...args: any[]) => import('../../sv
90
89
  * @property maxValue - Maximum scale value
91
90
  * @property reverse - Plot `minValue` at the right so values grow leftward.
92
91
  * @property side - Which side of the chart area this scale lives on (top or bottom)
92
+ * @property fixedAspectRatio - Scale the whole gauge to its container like a vector image, keeping the label font size: the SVG fills the host, so size the host. Off, the gauge draws at its 384 px reference width.
93
+ * @property scaleReferenceSize - Container width at which a `fixedAspectRatio` gauge draws 1:1 with the design. A wider container enlarges the drawing proportionally, a narrower one shrinks it.
94
+ * @availableWhen scaleReferenceSize fixedAspectRatio==true
93
95
  * @property showLabels - Show numerical value labels at primary tickmarks
94
96
  * @property mainTickmarks - Array of values for main tickmarks. When undefined, no main tickmarks shown. When empty array [], defaults to [minValue, 0, maxValue].
95
97
  * @property primaryTickmarkInterval - Interval for primary (longest) tickmarks with labels
@@ -122,23 +124,17 @@ export declare class ObcGaugeHorizontal extends ObcGaugeHorizontal_base {
122
124
  private readonly paddingRight;
123
125
  /** Which side of the chart area this scale lives on (top or bottom) */
124
126
  side: ExternalScaleSide;
125
- /**
126
- * When true, freezes all internal calculations and scales the entire component
127
- * proportionally (like CSS transform:scale), except label font-size remains constant.
128
- * When false (default), dimensions react to component properties.
129
- *
130
- * This property is intentionally not exposed as a public API or Storybook control.
131
- * It can be set programmatically by parent components (e.g., GaugeTrend).
132
- */
127
+ /** Scale the whole gauge to its container like a vector image, keeping the label font size: the SVG fills the host, so size the host. Off, the gauge draws at its 384 px reference width. */
133
128
  fixedAspectRatio: boolean;
134
129
  /**
135
- * Reference size for proportional scaling when fixedAspectRatio is true.
136
- * At this width, the scale renders at native 1:1 (matches Figma design).
137
- * Above this width, the scale grows proportionally; below, it shrinks.
138
- * @default 384
130
+ * Container width at which a `fixedAspectRatio` gauge draws 1:1 with the design. A wider container enlarges the drawing proportionally, a narrower one shrinks it.
131
+ *
132
+ * Available when `fixedAspectRatio==true`.
139
133
  */
140
134
  scaleReferenceSize: number;
141
135
  private _scale;
136
+ /** The drawing's height in viewBox units, kept from the last render for the scale measurement. */
137
+ private _viewBoxThickness;
142
138
  private _resizeController;
143
139
  /** Show numerical value labels at primary tickmarks */
144
140
  showLabels: boolean;
@@ -187,11 +183,26 @@ export declare class ObcGaugeHorizontal extends ObcGaugeHorizontal_base {
187
183
  updated(changed: PropertyValues): void;
188
184
  /**
189
185
  * Report scale dimensions to parent chart component.
190
- * Always reports unscaled/reference dimensions so the parent chart can apply
191
- * consistent proportional scaling in fixedAspectRatioScaling mode.
186
+ * When fixedAspectRatio=true, reports the actual visual (scaled) thickness
187
+ * so the chart can correctly reserve space for the scale.
188
+ * When fixedAspectRatio=false, reports the base/unscaled thickness.
192
189
  */
193
190
  private reportDimensions;
194
191
  protected createRenderRoot(): this;
192
+ connectedCallback(): void;
193
+ /** The inline sizing, value and priority, the consumer had before fixedAspectRatio took the host. */
194
+ private _consumerSizing?;
195
+ /**
196
+ * A custom element is inline by default, which gives the percentage-sized
197
+ * SVG nothing to fill; in fixedAspectRatio mode the host is a block that
198
+ * takes its container's width.
199
+ */
200
+ private _applyFixedAspectRatioStyles;
201
+ private _removeFixedAspectRatioStyles;
202
+ /** Reads the host's content box into the scale; false while the host has no size yet. */
203
+ private _measureScale;
204
+ /** Measures once layout has settled, then reports. */
205
+ private _updateScaleFromCurrentSize;
195
206
  }
196
207
  declare global {
197
208
  interface HTMLElementTagNameMap {
@@ -1 +1 @@
1
- {"version":3,"file":"gauge-horizontal.d.ts","sourceRoot":"","sources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AO,CAAC,QAAQ,CAAC,YAAY,CAAK;IAElC,OAAO,KAAK,MAAM,GAEjB;IAED,OAAO,KAAK,eAAe,GAE1B;IAED,OAAO,KAAK,QAAQ,GAEnB;IAEyB,QAAQ,EAAE,QAAQ,CAAoB;IACtC,QAAQ,EAAE,QAAQ,CAAiB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAa;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAa;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAa;IAE3B,KAAK,EAAE,eAAe,CAA0B;IAE1E;;;OAGG;IACwB,OAAO,UAAS;IAE3C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAwC;IAEvE,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA6B;IAEpC,qBAAqB,UAAS;IAEhD,MAAM;IA4FN,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAUzC,OAAO,CAAC,OAAO,EAAE,cAAc;IAoCxC;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;cA2CL,gBAAgB;IAI1B,iBAAiB,IAAI,IAAI;IAOlC,qGAAqG;IACrG,OAAO,CAAC,eAAe,CAAC,CAGtB;IAEF;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAiBpC,OAAO,CAAC,6BAA6B;IASrC,yFAAyF;IACzF,OAAO,CAAC,aAAa;IAarB,sDAAsD;IACtD,OAAO,CAAC,2BAA2B;CAQpC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAC;KAC5C;CACF"}
@@ -1,7 +1,7 @@
1
1
  import { customElement } from "../../decorator.js";
2
2
  import { CHART_DIMENSIONS } from "../../charthelpers/constants.js";
3
3
  import { BorderRadiusPosition, FrameStyle, InstrumentState, Priority } from "../types.js";
4
- import { AdvicePosition, ExternalScaleOrientation, ExternalScaleSide, FillMode, ScaleType, computeExternalScaleEffectiveBarThickness, computeExternalScaleLayout, computeExternalScaleViewBox, computeFixedAspectRatioScale, computeScaleDimensionsForReport, renderExternalScale, toExternalScaleLayoutConfig } from "../../building-blocks/external-scale/external-scale.js";
4
+ import { AdvicePosition, ExternalScaleOrientation, ExternalScaleSide, FillMode, ScaleType, computeExternalScaleEffectiveBarThickness, computeExternalScaleLayout, computeExternalScaleViewBox, computeFixedAspectRatioScale, computeScaleDimensionsForReport, readContentBox, renderExternalScale, toExternalScaleLayoutConfig } from "../../building-blocks/external-scale/external-scale.js";
5
5
  import { SetpointMixin } from "../../svghelpers/setpoint-mixin.js";
6
6
  import { AdviceMixin } from "../../svghelpers/advice-mixin.js";
7
7
  import { nextAdviceMaskId } from "../../svghelpers/advice.js";
@@ -23,15 +23,17 @@ var ObcGaugeHorizontal = class ObcGaugeHorizontal extends AdviceMixin(SetpointMi
23
23
  this.fixedAspectRatio = false;
24
24
  this.scaleReferenceSize = 384;
25
25
  this._scale = 1;
26
+ this._viewBoxThickness = 0;
26
27
  this._resizeController = new ResizeController(this, { callback: (entries) => {
27
28
  if (!this.fixedAspectRatio) return;
28
29
  const entry = entries[0];
29
30
  if (!entry) return;
30
- const containerMainAxisSize = entry.contentRect.width;
31
31
  const scale = computeFixedAspectRatioScale({
32
32
  orientation: ExternalScaleOrientation.horizontal,
33
- containerMainAxisSize,
34
- scaleReferenceSize: this.scaleReferenceSize
33
+ containerMainAxisSize: entry.contentRect.width,
34
+ containerCrossAxisSize: entry.contentRect.height,
35
+ scaleReferenceSize: this.scaleReferenceSize,
36
+ viewBoxThickness: this._viewBoxThickness
35
37
  });
36
38
  this._scale = scale > 0 ? scale : 1;
37
39
  this.reportDimensions();
@@ -69,10 +71,11 @@ var ObcGaugeHorizontal = class ObcGaugeHorizontal extends AdviceMixin(SetpointMi
69
71
  return true;
70
72
  }
71
73
  render() {
74
+ const effectiveLength = this.fixedAspectRatio ? this.scaleReferenceSize : this.width;
72
75
  const config = {
73
76
  orientation: ExternalScaleOrientation.horizontal,
74
77
  side: this.side,
75
- length: this.width,
78
+ length: effectiveLength,
76
79
  paddingStart: this.paddingLeft,
77
80
  paddingEnd: this.paddingRight,
78
81
  minValue: this.minValue,
@@ -119,10 +122,11 @@ var ObcGaugeHorizontal = class ObcGaugeHorizontal extends AdviceMixin(SetpointMi
119
122
  highlightCurrentValue: this.highlightCurrentValue
120
123
  };
121
124
  const layout = computeExternalScaleLayout(toExternalScaleLayoutConfig(config));
125
+ this._viewBoxThickness = layout.thickness;
122
126
  const parts = renderExternalScale(config);
123
127
  const viewBox = computeExternalScaleViewBox({
124
128
  orientation: config.orientation,
125
- length: this.width
129
+ length: effectiveLength
126
130
  }, layout);
127
131
  const preserveAspectRatio = this.fixedAspectRatio ? "xMidYMid meet" : "none";
128
132
  return html`
@@ -146,12 +150,26 @@ var ObcGaugeHorizontal = class ObcGaugeHorizontal extends AdviceMixin(SetpointMi
146
150
  }
147
151
  updated(changed) {
148
152
  super.updated(changed);
149
- if (!this.fixedAspectRatio && (changed.has("side") || changed.has("showLabels")) || this.setpointPresenceChanged(changed)) this.reportDimensions();
153
+ if (changed.has("fixedAspectRatio")) {
154
+ if (this.fixedAspectRatio) {
155
+ this._applyFixedAspectRatioStyles();
156
+ this._updateScaleFromCurrentSize();
157
+ } else if (changed.get("fixedAspectRatio") === true) {
158
+ this._removeFixedAspectRatioStyles();
159
+ this._scale = 1;
160
+ }
161
+ }
162
+ if (changed.has("scaleReferenceSize") && this.fixedAspectRatio) this._updateScaleFromCurrentSize();
163
+ if (changed.has("fixedAspectRatio") || changed.has("side") || changed.has("showLabels") || changed.has("advices") || this.setpointPresenceChanged(changed)) {
164
+ if (this.fixedAspectRatio) this._measureScale();
165
+ this.reportDimensions();
166
+ }
150
167
  }
151
168
  /**
152
169
  * Report scale dimensions to parent chart component.
153
- * Always reports unscaled/reference dimensions so the parent chart can apply
154
- * consistent proportional scaling in fixedAspectRatioScaling mode.
170
+ * When fixedAspectRatio=true, reports the actual visual (scaled) thickness
171
+ * so the chart can correctly reserve space for the scale.
172
+ * When fixedAspectRatio=false, reports the base/unscaled thickness.
155
173
  */
156
174
  reportDimensions() {
157
175
  const effectiveBarThickness = computeExternalScaleEffectiveBarThickness({
@@ -160,7 +178,7 @@ var ObcGaugeHorizontal = class ObcGaugeHorizontal extends AdviceMixin(SetpointMi
160
178
  borderRadius: this.borderRadius,
161
179
  scaleType: this.scaleType
162
180
  });
163
- const dimensions = computeScaleDimensionsForReport({
181
+ const baseDimensions = computeScaleDimensionsForReport({
164
182
  orientation: ExternalScaleOrientation.horizontal,
165
183
  side: this.side,
166
184
  hasBar: this.hasBar,
@@ -169,11 +187,15 @@ var ObcGaugeHorizontal = class ObcGaugeHorizontal extends AdviceMixin(SetpointMi
169
187
  barThickness: effectiveBarThickness,
170
188
  tickThickness: this.tickThickness,
171
189
  labelThickness: this.labelThickness,
172
- length: this.width,
190
+ length: this.fixedAspectRatio ? this.scaleReferenceSize : this.width,
173
191
  scaleType: this.scaleType,
174
192
  hasAdviceIcon: !!this.advices?.some((a) => a.showIcon),
175
193
  hasSetpoint: this.setpoint !== void 0 || this.newSetpoint !== void 0 || this.departingNewSetpoint !== void 0
176
194
  });
195
+ const dimensions = this.fixedAspectRatio ? {
196
+ ...baseDimensions,
197
+ thickness: Math.round(baseDimensions.thickness * this._scale)
198
+ } : baseDimensions;
177
199
  this.dispatchEvent(new CustomEvent("scale-dimensions-changed", {
178
200
  detail: dimensions,
179
201
  bubbles: true
@@ -182,11 +204,69 @@ var ObcGaugeHorizontal = class ObcGaugeHorizontal extends AdviceMixin(SetpointMi
182
204
  createRenderRoot() {
183
205
  return this;
184
206
  }
207
+ connectedCallback() {
208
+ super.connectedCallback();
209
+ if (this.fixedAspectRatio) this._applyFixedAspectRatioStyles();
210
+ }
211
+ /**
212
+ * A custom element is inline by default, which gives the percentage-sized
213
+ * SVG nothing to fill; in fixedAspectRatio mode the host is a block that
214
+ * takes its container's width.
215
+ */
216
+ _applyFixedAspectRatioStyles() {
217
+ if (!this._consumerSizing) {
218
+ const snapshot = (name) => [this.style.getPropertyValue(name), this.style.getPropertyPriority(name)];
219
+ this._consumerSizing = {
220
+ display: snapshot("display"),
221
+ width: snapshot("width"),
222
+ height: snapshot("height")
223
+ };
224
+ }
225
+ this.style.display = "block";
226
+ this.style.width = "100%";
227
+ this.style.height = "auto";
228
+ }
229
+ _removeFixedAspectRatioStyles() {
230
+ const saved = this._consumerSizing;
231
+ this._consumerSizing = void 0;
232
+ for (const name of [
233
+ "display",
234
+ "width",
235
+ "height"
236
+ ]) {
237
+ const [value, priority] = saved?.[name] ?? ["", ""];
238
+ this.style.setProperty(name, value, priority);
239
+ }
240
+ }
241
+ /** Reads the host's content box into the scale; false while the host has no size yet. */
242
+ _measureScale() {
243
+ const { width, height } = readContentBox(this);
244
+ if (width <= 0) return false;
245
+ this._scale = computeFixedAspectRatioScale({
246
+ orientation: ExternalScaleOrientation.horizontal,
247
+ containerMainAxisSize: width,
248
+ containerCrossAxisSize: height,
249
+ scaleReferenceSize: this.scaleReferenceSize,
250
+ viewBoxThickness: this._viewBoxThickness
251
+ });
252
+ return true;
253
+ }
254
+ /** Measures once layout has settled, then reports. */
255
+ _updateScaleFromCurrentSize() {
256
+ requestAnimationFrame(() => {
257
+ if (this._measureScale()) {
258
+ this.requestUpdate();
259
+ this.reportDimensions();
260
+ }
261
+ });
262
+ }
185
263
  };
186
264
  __decorate([property({ type: Number })], ObcGaugeHorizontal.prototype, "minValue", void 0);
187
265
  __decorate([property({ type: Number })], ObcGaugeHorizontal.prototype, "maxValue", void 0);
188
266
  __decorate([property({ type: Boolean })], ObcGaugeHorizontal.prototype, "reverse", void 0);
189
267
  __decorate([property({ type: String })], ObcGaugeHorizontal.prototype, "side", void 0);
268
+ __decorate([property({ type: Boolean })], ObcGaugeHorizontal.prototype, "fixedAspectRatio", void 0);
269
+ __decorate([property({ type: Number })], ObcGaugeHorizontal.prototype, "scaleReferenceSize", void 0);
190
270
  __decorate([state()], ObcGaugeHorizontal.prototype, "_scale", void 0);
191
271
  __decorate([property({
192
272
  type: Boolean,
@@ -1 +1 @@
1
- {"version":3,"file":"gauge-horizontal.js","names":["_decorate"],"sources":["../../../src/navigation-instruments/gauge-horizontal/gauge-horizontal.ts"],"sourcesContent":["import {LitElement, html} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport type {PropertyValues} from 'lit';\nimport {customElement} from '../../decorator.js';\nimport {ResizeController} from '@lit-labs/observers/resize-controller.js';\nimport {CHART_DIMENSIONS} from '../../charthelpers/constants.js';\nimport {\n InstrumentState,\n FrameStyle,\n BorderRadiusPosition,\n Priority,\n} from '../types.js';\nimport type {ExternalScaleConfig} from '../../building-blocks/external-scale/external-scale.js';\nimport {\n computeExternalScaleViewBox,\n computeFixedAspectRatioScale,\n computeExternalScaleLayout,\n renderExternalScale,\n toExternalScaleLayoutConfig,\n computeScaleDimensionsForReport,\n computeExternalScaleEffectiveBarThickness,\n ScaleType,\n FillMode,\n AdvicePosition,\n ExternalScaleOrientation,\n ExternalScaleSide,\n} from '../../building-blocks/external-scale/external-scale.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\nimport {AdviceMixin} from '../../svghelpers/advice-mixin.js';\nimport {nextAdviceMaskId} from '../../svghelpers/advice.js';\n\n// Re-export shared enums for convenience\nexport {\n ScaleType,\n FillMode,\n AdvicePosition,\n FrameStyle,\n BorderRadiusPosition,\n InstrumentState,\n ExternalScaleSide,\n};\n\n/**\n * `<obc-gauge-horizontal>` – A horizontal gauge component with bar and scale background.\n *\n * Use `obc-gauge-horizontal` when you need a standalone horizontal gauge with a visible scale\n * and bar. This is ideal for displaying single values like speed, power, or progress where\n * the scale context is always needed.\n *\n * This is the same as `obc-bar-horizontal` (both use `external-scale.ts`)\n * but with several properties fixed for consistent gauge appearance.\n * Unlike `obc-bar-horizontal`, this component always shows the bar and scale background.\n *\n * ---\n *\n * ### Features\n * - **Fixed Layout:** Width (384px), padding (32px), bar/tick/label thicknesses, and border radius are fixed for consistent gauge appearance.\n * - **Scale Configuration:**\n * - Configurable `minValue` and `maxValue` for the value range.\n * - Optional main, primary, secondary, and tertiary tickmarks at specified intervals.\n * - Labels shown at primary tickmark intervals (controlled via `showLabels`).\n * - **Side Positioning:** Can be placed on the `top` or `bottom` side via the `side` property.\n * - **Value Display:**\n * - `value` property drives the bar fill.\n * - `fillMode` controls visualization: `fill` shows bar from `fillMin` to `fillMax`; `tint` adds a marker at the `value` position.\n * - Set `priority` to `Priority.enhanced` to use the blue/enhanced color palette for bar fill and setpoint (default: `Priority.regular`).\n * - **Setpoint Marker:**\n * - Optional `setpoint` value displays a marker.\n * - Automatic at-setpoint detection with configurable deadband.\n * - **Advice Overlays:** Render advice ranges with different types and hinted states.\n * - **Fixed Aspect Ratio:** When enabled, scales the component proportionally while keeping label font-size constant.\n * - **Dimension Reporting:** Dispatches `scale-dimensions-changed` events for parent chart integration.\n *\n * ---\n *\n * ### Fixed Properties (not configurable)\n * - `width`: 384px\n * - `paddingLeft`/`paddingRight`: 32px (`CHART_DIMENSIONS.CANVAS_PADDING`)\n * - `barThickness`: 48px\n * - `tickThickness`: 24px\n * - `labelThickness`: 60px\n * - `borderRadius`: 8px (matches obc-component-size-medium)\n * - `scaleType`: regular\n * - `frameStyle`: regular\n * - `hasBar`: true\n * - `hasScale`: true\n * - `scaleBackground`: true\n * - `fixedAspectRatio`: true (always scales proportionally)\n *\n * ---\n *\n * ### Implementation\n * This is a higher fidelity implementation of the concept shown in `instrument-linear.ts`,\n * providing a complete gauge with container, scale background, tickmarks, labels, advice overlays, and setpoint marker.\n *\n * This is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\n * It sets up the outer `<svg>`/`viewBox` for a horizontal scale and delegates rendering/layout to:\n * - `computeExternalScaleLayout(...)`\n * - `renderExternalScale(config)`\n *\n * For renderer documentation see: **Building Blocks/External Scale**.\n *\n * For a version where these properties are user-configurable, see **Bars and Graphs/Bar Horizontal**.\n *\n * ---\n *\n * ### Events\n * - `scale-dimensions-changed` – Fired when layout-affecting properties (`side`, `showLabels`) change, reporting dimensions to parent chart components.\n *\n * ---\n *\n * ### Example\n *\n * ```html\n * <obc-gauge-horizontal\n * min-value=\"0\"\n * max-value=\"100\"\n * value=\"75\"\n * primary-tickmark-interval=\"20\"\n * secondary-tickmark-interval=\"10\"\n * setpoint=\"80\"\n * side=\"bottom\"\n * ></obc-gauge-horizontal>\n * ```\n *\n * @property minValue - Minimum scale value\n * @property maxValue - Maximum scale value\n * @property reverse - Plot `minValue` at the right so values grow leftward.\n * @property side - Which side of the chart area this scale lives on (top or bottom)\n * @property showLabels - Show numerical value labels at primary tickmarks\n * @property mainTickmarks - Array of values for main tickmarks. When undefined, no main tickmarks shown. When empty array [], defaults to [minValue, 0, maxValue].\n * @property primaryTickmarkInterval - Interval for primary (longest) tickmarks with labels\n * @property secondaryTickmarkInterval - Interval for secondary (medium) tickmarks\n * @property tertiaryTickmarkInterval - Interval for tertiary (shortest) tickmarks\n * @property borderRadiusPosition - Border radius position based on component layout\n * @property priority - Color priority: enhanced uses blue instrument colors for bar fill and setpoint\n * @property fillMode - Fill visualization mode: 'fill' shows bar from fillMin to fillMax; 'tint' adds a marker at the value position\n * @property fillMin - Minimum fill value (defaults to 0)\n * @property fillMax - Maximum fill value (defaults to value)\n * @property value - Current value (bar fill level)\n * @property state - Instrument state: active, loading, or off\n * @property advices - Advice/alert overlays with min, max, type, and hinted state. When undefined or empty, no advice shown.\n * @property highlightCurrentValue - When true, displays a dot indicator at the current value position.\n * The dot is rendered in the scale band, touching its inner edge (towards the chart).\n * This provides an alternative to bar fill for highlighting the current value.\n * @property focused - Earlier name for `touching`: a change to it sets `touching`, unless `touching` changes in the same update, which then wins. It is not updated from `touching`, so it does not read back the current value.\n * @fires {CustomEvent} scale-dimensions-changed - Fired when layout-affecting properties change, providing dimension info for parent chart integration. It bubbles to the chart slot the gauge sits in and does not leave the shadow root around it.\n * @stable\n */\n@customElement('obc-gauge-horizontal')\nexport class ObcGaugeHorizontal extends AdviceMixin(\n SetpointMixin(LitElement, {\n defaultDeadband: 1,\n })\n) {\n @property({type: Number}) minValue = 0;\n @property({type: Number}) maxValue = 100;\n @property({type: Boolean}) reverse = false;\n\n private readonly width = 384;\n private readonly paddingLeft = CHART_DIMENSIONS.CANVAS_PADDING;\n private readonly paddingRight = CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: String}) side: ExternalScaleSide = ExternalScaleSide.bottom;\n\n /**\n * When true, freezes all internal calculations and scales the entire component\n * proportionally (like CSS transform:scale), except label font-size remains constant.\n * When false (default), dimensions react to component properties.\n *\n * This property is intentionally not exposed as a public API or Storybook control.\n * It can be set programmatically by parent components (e.g., GaugeTrend).\n */\n fixedAspectRatio = false;\n\n /**\n * Reference size for proportional scaling when fixedAspectRatio is true.\n * At this width, the scale renders at native 1:1 (matches Figma design).\n * Above this width, the scale grows proportionally; below, it shrinks.\n * @default 384\n */\n scaleReferenceSize = 384;\n\n @state()\n private _scale = 1;\n\n // ResizeController automatically subscribes/unsubscribes based on component lifecycle\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _resizeController = new ResizeController(this, {\n callback: (entries) => {\n if (!this.fixedAspectRatio) return;\n\n const entry = entries[0];\n if (!entry) return;\n\n // Use the centralized function that computes scale based on reference size\n // For horizontal scales, compare container width to reference size\n const containerMainAxisSize = entry.contentRect.width;\n\n const scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n // Guard against zero-sized containers, but allow fractional scales < 1\n this._scale = scale > 0 ? scale : 1;\n\n // Report scaled dimensions to parent chart\n this.reportDimensions();\n },\n });\n\n @property({type: Boolean, attribute: false}) showLabels = true;\n private readonly barThickness = 48;\n private readonly tickThickness = 24;\n private readonly labelThickness = 60;\n\n @property({type: Array, attribute: false}) mainTickmarks?: number[] = [];\n @property({type: Number}) primaryTickmarkInterval?: number = undefined;\n @property({type: Number}) secondaryTickmarkInterval?: number = undefined;\n @property({type: Number}) tertiaryTickmarkInterval?: number = undefined;\n private readonly scaleType: ScaleType = ScaleType.regular;\n private readonly frameStyle: FrameStyle = FrameStyle.regular;\n @property({type: String, attribute: false})\n borderRadiusPosition?: BorderRadiusPosition =\n BorderRadiusPosition.innerFirstChild;\n\n private readonly borderRadius = 8;\n\n private get hasBar(): boolean {\n return true;\n }\n\n private get scaleBackground(): boolean {\n return true;\n }\n\n private get hasScale(): boolean {\n return true;\n }\n\n @property({type: String}) priority: Priority = Priority.regular;\n @property({type: String}) fillMode: FillMode = FillMode.fill;\n @property({type: Number}) fillMin?: number = undefined;\n @property({type: Number}) fillMax?: number = undefined;\n @property({type: Number}) value?: number = undefined;\n\n @property({type: String}) state: InstrumentState = InstrumentState.active;\n\n /**\n * @deprecated Use `touching` (from SetpointMixin) instead.\n * Kept for backward compatibility. Synced to `touching` in `willUpdate()`.\n */\n @property({type: Boolean}) focused = false;\n\n private readonly advicePosition: AdvicePosition = AdvicePosition.inner;\n // Mask ids are document-scoped, so each gauge names its own.\n private readonly _adviceMaskPrefix = nextAdviceMaskId('gauge');\n\n @property({type: Boolean}) highlightCurrentValue = false;\n\n override render() {\n const config: ExternalScaleConfig = {\n orientation: ExternalScaleOrientation.horizontal,\n side: this.side,\n length: this.width,\n paddingStart: this.paddingLeft,\n paddingEnd: this.paddingRight,\n minValue: this.minValue,\n maxValue: this.maxValue,\n reverse: this.reverse,\n hasScale: this.hasScale,\n labels: this.showLabels,\n hasBar: this.hasBar,\n scaleBackground: this.scaleBackground,\n barThickness: this.barThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n mainTickmarks: this.mainTickmarks,\n primaryTickmarkInterval: this.primaryTickmarkInterval,\n secondaryTickmarkInterval: this.secondaryTickmarkInterval,\n tertiaryTickmarkInterval: this.tertiaryTickmarkInterval,\n scaleType: this.scaleType,\n frameStyle: this.frameStyle,\n borderRadiusPosition: this.borderRadiusPosition,\n borderRadius: this.borderRadius,\n priority: this.priority,\n fillMode: this.fillMode,\n fillMin: this.fillMin,\n fillMax: this.fillMax,\n value: this.value,\n setpoint: this.setpoint,\n newSetpoint: this.newSetpoint,\n atSetpoint: this.atSetpoint,\n autoAtSetpoint: this.autoAtSetpoint,\n autoAtSetpointDeadband: this.autoAtSetpointDeadband,\n setpointAtZeroDeadband: this.setpointAtZeroDeadband,\n animateSetpoint: this.animateSetpoint,\n departingNewSetpoint: this.departingNewSetpoint,\n state: this.state,\n touching: this.touching,\n setpointOverride: this.setpointOverride,\n advicePosition: this.advicePosition,\n advices: this.advices,\n adviceTrigger: this.adviceTrigger,\n adviceEmphasis: this.adviceEmphasis,\n adviceMaskPrefix: this._adviceMaskPrefix,\n fixedAspectRatio: this.fixedAspectRatio,\n // Gauges are always in instrument mode - they use fixed borderRadius (8px)\n // and don't respond to .obc-component-size-* CSS classes for border radius\n instrumentMode: true,\n highlightCurrentValue: this.highlightCurrentValue,\n };\n\n const layout = computeExternalScaleLayout(\n toExternalScaleLayoutConfig(config)\n );\n\n const parts = renderExternalScale(config);\n\n const viewBox = computeExternalScaleViewBox(\n {orientation: config.orientation, length: this.width},\n layout\n );\n const preserveAspectRatio = this.fixedAspectRatio\n ? 'xMidYMid meet'\n : 'none';\n\n return html`\n <svg\n width=${this.fixedAspectRatio ? '100%' : `${this.width}px`}\n height=${this.fixedAspectRatio ? '100%' : `${viewBox.height}px`}\n viewBox=\"${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}\"\n preserveAspectRatio=\"${preserveAspectRatio}\"\n style=\"--scale: ${\n this.fixedAspectRatio ? this._scale : 1\n }; display: block;\"\n part=\"svg\"\n >\n ${parts.barContainer} ${parts.barFill} ${parts.scaleBackground}\n ${parts.tickmarks} ${parts.labels} ${parts.adviceOverlays}\n ${parts.currentValueDot} ${parts.setpoint}\n </svg>\n `;\n }\n\n override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n\n // Sync deprecated alias to mixin property\n // Only sync if the alias was set and the mixin property was NOT also set.\n if (changed.has('focused') && !changed.has('touching')) {\n this.touching = this.focused;\n }\n }\n\n override updated(changed: PropertyValues) {\n super.updated(changed);\n\n // Report dimensions to parent chart\n // In fixedAspectRatio mode, we report after resize events trigger _scale updates\n // In regular mode, only emit when layout-affecting properties change\n // Setpoint presence changes the reported thickness (reserved marker band),\n // so it must re-report in both aspect-ratio modes.\n if (\n (!this.fixedAspectRatio &&\n (changed.has('side') || changed.has('showLabels'))) ||\n this.setpointPresenceChanged(changed)\n ) {\n this.reportDimensions();\n }\n }\n\n /**\n * Report scale dimensions to parent chart component.\n * Always reports unscaled/reference dimensions so the parent chart can apply\n * consistent proportional scaling in fixedAspectRatioScaling mode.\n */\n private reportDimensions() {\n const effectiveBarThickness = computeExternalScaleEffectiveBarThickness({\n hasBar: this.hasBar,\n barThickness: this.barThickness,\n borderRadius: this.borderRadius,\n scaleType: this.scaleType,\n });\n\n const baseDimensions = computeScaleDimensionsForReport({\n orientation: ExternalScaleOrientation.horizontal,\n side: this.side,\n hasBar: this.hasBar,\n hasScale: this.hasScale,\n labels: this.showLabels,\n barThickness: effectiveBarThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n length: this.width,\n scaleType: this.scaleType,\n hasAdviceIcon: !!this.advices?.some((a) => a.showIcon),\n hasSetpoint:\n this.setpoint !== undefined ||\n this.newSetpoint !== undefined ||\n this.departingNewSetpoint !== undefined,\n });\n\n // Always report unscaled/reference dimensions.\n // The parent chart component handles proportional scaling consistently\n // for both external scales and chart padding in fixedAspectRatioScaling mode.\n const dimensions = baseDimensions;\n\n this.dispatchEvent(\n new CustomEvent('scale-dimensions-changed', {\n detail: dimensions,\n bubbles: true,\n })\n );\n }\n\n protected override createRenderRoot() {\n return this;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-gauge-horizontal': ObcGaugeHorizontal;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAsJO,IAAM,qBAAN,MAAM,2BAA2B,YACtC,cAAc,YAAY,EACxB,iBAAiB,EACnB,CAAC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C,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,WAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,WAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,SAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,SAAA,KAAA,CAAA;AAMvBA,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,mBAAA,WAAA,WAAA,KAAA,CAAA;AAMxBA,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,mBAAA,WAAA,yBAAA,KAAA,CAAA;AA9G1B,qBAAAA,WAAA,CAAA,cAAc,sBAAsB,CAAA,GAAA,kBAAA"}
1
+ {"version":3,"file":"gauge-horizontal.js","names":["_decorate"],"sources":["../../../src/navigation-instruments/gauge-horizontal/gauge-horizontal.ts"],"sourcesContent":["import {LitElement, html} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport type {PropertyValues} from 'lit';\nimport {customElement} from '../../decorator.js';\nimport {ResizeController} from '@lit-labs/observers/resize-controller.js';\nimport {CHART_DIMENSIONS} from '../../charthelpers/constants.js';\nimport {\n InstrumentState,\n FrameStyle,\n BorderRadiusPosition,\n Priority,\n} from '../types.js';\nimport type {ExternalScaleConfig} from '../../building-blocks/external-scale/external-scale.js';\nimport {\n computeExternalScaleViewBox,\n computeFixedAspectRatioScale,\n computeExternalScaleLayout,\n renderExternalScale,\n toExternalScaleLayoutConfig,\n computeScaleDimensionsForReport,\n computeExternalScaleEffectiveBarThickness,\n readContentBox,\n ScaleType,\n FillMode,\n AdvicePosition,\n ExternalScaleOrientation,\n ExternalScaleSide,\n} from '../../building-blocks/external-scale/external-scale.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\nimport {AdviceMixin} from '../../svghelpers/advice-mixin.js';\nimport {nextAdviceMaskId} from '../../svghelpers/advice.js';\n\n// Re-export shared enums for convenience\nexport {\n ScaleType,\n FillMode,\n AdvicePosition,\n FrameStyle,\n BorderRadiusPosition,\n InstrumentState,\n ExternalScaleSide,\n};\n\n/**\n * `<obc-gauge-horizontal>` – A horizontal gauge component with bar and scale background.\n *\n * Use `obc-gauge-horizontal` when you need a standalone horizontal gauge with a visible scale\n * and bar. This is ideal for displaying single values like speed, power, or progress where\n * the scale context is always needed.\n *\n * This is the same as `obc-bar-horizontal` (both use `external-scale.ts`)\n * but with several properties fixed for consistent gauge appearance.\n * Unlike `obc-bar-horizontal`, this component always shows the bar and scale background.\n *\n * ---\n *\n * ### Features\n * - **Fixed Layout:** Width (384px), padding (32px), bar/tick/label thicknesses, and border radius are fixed for consistent gauge appearance. 384 px is the length the design is drawn at, not a layout limit: see `fixedAspectRatio`.\n * - **Scale Configuration:**\n * - Configurable `minValue` and `maxValue` for the value range.\n * - Optional main, primary, secondary, and tertiary tickmarks at specified intervals.\n * - Labels shown at primary tickmark intervals (controlled via `showLabels`).\n * - **Side Positioning:** Can be placed on the `top` or `bottom` side via the `side` property.\n * - **Value Display:**\n * - `value` property drives the bar fill.\n * - `fillMode` controls visualization: `fill` shows bar from `fillMin` to `fillMax`; `tint` adds a marker at the `value` position.\n * - Set `priority` to `Priority.enhanced` to use the blue/enhanced color palette for bar fill and setpoint (default: `Priority.regular`).\n * - **Setpoint Marker:**\n * - Optional `setpoint` value displays a marker.\n * - Automatic at-setpoint detection with configurable deadband.\n * - **Advice Overlays:** Render advice ranges with different types and hinted states.\n * - **Fixed Aspect Ratio:** `fixedAspectRatio` scales the whole gauge to its container like a vector image while the label font size stays put; `scaleReferenceSize` is the container width at which it draws 1:1.\n * - **Dimension Reporting:** Dispatches `scale-dimensions-changed` events for parent chart integration.\n *\n * ---\n *\n * ### Fixed Properties (not configurable)\n * - `width`: 384px\n * - `paddingLeft`/`paddingRight`: 32px (`CHART_DIMENSIONS.CANVAS_PADDING`)\n * - `barThickness`: 48px\n * - `tickThickness`: 24px\n * - `labelThickness`: 60px\n * - `borderRadius`: 8px (matches obc-component-size-medium)\n * - `scaleType`: regular\n * - `frameStyle`: regular\n * - `hasBar`: true\n * - `hasScale`: true\n * - `scaleBackground`: true\n *\n * ---\n *\n * ### Implementation\n * This is a higher fidelity implementation of the concept shown in `instrument-linear.ts`,\n * providing a complete gauge with container, scale background, tickmarks, labels, advice overlays, and setpoint marker.\n *\n * This is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\n * It sets up the outer `<svg>`/`viewBox` for a horizontal scale and delegates rendering/layout to:\n * - `computeExternalScaleLayout(...)`\n * - `renderExternalScale(config)`\n *\n * For renderer documentation see: **Building Blocks/External Scale**.\n *\n * For a version where these properties are user-configurable, see **Bars and Graphs/Bar Horizontal**.\n *\n * ---\n *\n * ### Events\n * - `scale-dimensions-changed` – Fired when layout-affecting properties (`side`, `showLabels`) change, reporting dimensions to parent chart components.\n *\n * ---\n *\n * ### Example\n *\n * ```html\n * <obc-gauge-horizontal\n * min-value=\"0\"\n * max-value=\"100\"\n * value=\"75\"\n * primary-tickmark-interval=\"20\"\n * secondary-tickmark-interval=\"10\"\n * setpoint=\"80\"\n * side=\"bottom\"\n * ></obc-gauge-horizontal>\n * ```\n *\n * @property minValue - Minimum scale value\n * @property maxValue - Maximum scale value\n * @property reverse - Plot `minValue` at the right so values grow leftward.\n * @property side - Which side of the chart area this scale lives on (top or bottom)\n * @property fixedAspectRatio - Scale the whole gauge to its container like a vector image, keeping the label font size: the SVG fills the host, so size the host. Off, the gauge draws at its 384 px reference width.\n * @property scaleReferenceSize - Container width at which a `fixedAspectRatio` gauge draws 1:1 with the design. A wider container enlarges the drawing proportionally, a narrower one shrinks it.\n * @availableWhen scaleReferenceSize fixedAspectRatio==true\n * @property showLabels - Show numerical value labels at primary tickmarks\n * @property mainTickmarks - Array of values for main tickmarks. When undefined, no main tickmarks shown. When empty array [], defaults to [minValue, 0, maxValue].\n * @property primaryTickmarkInterval - Interval for primary (longest) tickmarks with labels\n * @property secondaryTickmarkInterval - Interval for secondary (medium) tickmarks\n * @property tertiaryTickmarkInterval - Interval for tertiary (shortest) tickmarks\n * @property borderRadiusPosition - Border radius position based on component layout\n * @property priority - Color priority: enhanced uses blue instrument colors for bar fill and setpoint\n * @property fillMode - Fill visualization mode: 'fill' shows bar from fillMin to fillMax; 'tint' adds a marker at the value position\n * @property fillMin - Minimum fill value (defaults to 0)\n * @property fillMax - Maximum fill value (defaults to value)\n * @property value - Current value (bar fill level)\n * @property state - Instrument state: active, loading, or off\n * @property advices - Advice/alert overlays with min, max, type, and hinted state. When undefined or empty, no advice shown.\n * @property highlightCurrentValue - When true, displays a dot indicator at the current value position.\n * The dot is rendered in the scale band, touching its inner edge (towards the chart).\n * This provides an alternative to bar fill for highlighting the current value.\n * @property focused - Earlier name for `touching`: a change to it sets `touching`, unless `touching` changes in the same update, which then wins. It is not updated from `touching`, so it does not read back the current value.\n * @fires {CustomEvent} scale-dimensions-changed - Fired when layout-affecting properties change, providing dimension info for parent chart integration. It bubbles to the chart slot the gauge sits in and does not leave the shadow root around it.\n * @stable\n */\n@customElement('obc-gauge-horizontal')\nexport class ObcGaugeHorizontal extends AdviceMixin(\n SetpointMixin(LitElement, {\n defaultDeadband: 1,\n })\n) {\n @property({type: Number}) minValue = 0;\n @property({type: Number}) maxValue = 100;\n @property({type: Boolean}) reverse = false;\n\n private readonly width = 384;\n private readonly paddingLeft = CHART_DIMENSIONS.CANVAS_PADDING;\n private readonly paddingRight = CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: String}) side: ExternalScaleSide = ExternalScaleSide.bottom;\n\n @property({type: Boolean}) fixedAspectRatio = false;\n @property({type: Number}) scaleReferenceSize = 384;\n\n @state()\n private _scale = 1;\n\n /** The drawing's height in viewBox units, kept from the last render for the scale measurement. */\n private _viewBoxThickness = 0;\n\n // ResizeController automatically subscribes/unsubscribes based on component lifecycle\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _resizeController = new ResizeController(this, {\n callback: (entries) => {\n if (!this.fixedAspectRatio) return;\n\n const entry = entries[0];\n if (!entry) return;\n\n const scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize: entry.contentRect.width,\n containerCrossAxisSize: entry.contentRect.height,\n scaleReferenceSize: this.scaleReferenceSize,\n viewBoxThickness: this._viewBoxThickness,\n });\n // Guard against zero-sized containers, but allow fractional scales < 1\n this._scale = scale > 0 ? scale : 1;\n\n // Report scaled dimensions to parent chart\n this.reportDimensions();\n },\n });\n\n @property({type: Boolean, attribute: false}) showLabels = true;\n private readonly barThickness = 48;\n private readonly tickThickness = 24;\n private readonly labelThickness = 60;\n\n @property({type: Array, attribute: false}) mainTickmarks?: number[] = [];\n @property({type: Number}) primaryTickmarkInterval?: number = undefined;\n @property({type: Number}) secondaryTickmarkInterval?: number = undefined;\n @property({type: Number}) tertiaryTickmarkInterval?: number = undefined;\n private readonly scaleType: ScaleType = ScaleType.regular;\n private readonly frameStyle: FrameStyle = FrameStyle.regular;\n @property({type: String, attribute: false})\n borderRadiusPosition?: BorderRadiusPosition =\n BorderRadiusPosition.innerFirstChild;\n\n private readonly borderRadius = 8;\n\n private get hasBar(): boolean {\n return true;\n }\n\n private get scaleBackground(): boolean {\n return true;\n }\n\n private get hasScale(): boolean {\n return true;\n }\n\n @property({type: String}) priority: Priority = Priority.regular;\n @property({type: String}) fillMode: FillMode = FillMode.fill;\n @property({type: Number}) fillMin?: number = undefined;\n @property({type: Number}) fillMax?: number = undefined;\n @property({type: Number}) value?: number = undefined;\n\n @property({type: String}) state: InstrumentState = InstrumentState.active;\n\n /**\n * @deprecated Use `touching` (from SetpointMixin) instead.\n * Kept for backward compatibility. Synced to `touching` in `willUpdate()`.\n */\n @property({type: Boolean}) focused = false;\n\n private readonly advicePosition: AdvicePosition = AdvicePosition.inner;\n // Mask ids are document-scoped, so each gauge names its own.\n private readonly _adviceMaskPrefix = nextAdviceMaskId('gauge');\n\n @property({type: Boolean}) highlightCurrentValue = false;\n\n override render() {\n // A chart pushes its own width to a slotted scale; in fixedAspectRatio\n // mode the drawing keeps its reference length and the SVG scales it.\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\n\n const config: ExternalScaleConfig = {\n orientation: ExternalScaleOrientation.horizontal,\n side: this.side,\n length: effectiveLength,\n paddingStart: this.paddingLeft,\n paddingEnd: this.paddingRight,\n minValue: this.minValue,\n maxValue: this.maxValue,\n reverse: this.reverse,\n hasScale: this.hasScale,\n labels: this.showLabels,\n hasBar: this.hasBar,\n scaleBackground: this.scaleBackground,\n barThickness: this.barThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n mainTickmarks: this.mainTickmarks,\n primaryTickmarkInterval: this.primaryTickmarkInterval,\n secondaryTickmarkInterval: this.secondaryTickmarkInterval,\n tertiaryTickmarkInterval: this.tertiaryTickmarkInterval,\n scaleType: this.scaleType,\n frameStyle: this.frameStyle,\n borderRadiusPosition: this.borderRadiusPosition,\n borderRadius: this.borderRadius,\n priority: this.priority,\n fillMode: this.fillMode,\n fillMin: this.fillMin,\n fillMax: this.fillMax,\n value: this.value,\n setpoint: this.setpoint,\n newSetpoint: this.newSetpoint,\n atSetpoint: this.atSetpoint,\n autoAtSetpoint: this.autoAtSetpoint,\n autoAtSetpointDeadband: this.autoAtSetpointDeadband,\n setpointAtZeroDeadband: this.setpointAtZeroDeadband,\n animateSetpoint: this.animateSetpoint,\n departingNewSetpoint: this.departingNewSetpoint,\n state: this.state,\n touching: this.touching,\n setpointOverride: this.setpointOverride,\n advicePosition: this.advicePosition,\n advices: this.advices,\n adviceTrigger: this.adviceTrigger,\n adviceEmphasis: this.adviceEmphasis,\n adviceMaskPrefix: this._adviceMaskPrefix,\n fixedAspectRatio: this.fixedAspectRatio,\n // Gauges are always in instrument mode - they use fixed borderRadius (8px)\n // and don't respond to .obc-component-size-* CSS classes for border radius\n instrumentMode: true,\n highlightCurrentValue: this.highlightCurrentValue,\n };\n\n const layout = computeExternalScaleLayout(\n toExternalScaleLayoutConfig(config)\n );\n this._viewBoxThickness = layout.thickness;\n\n const parts = renderExternalScale(config);\n\n const viewBox = computeExternalScaleViewBox(\n {orientation: config.orientation, length: effectiveLength},\n layout\n );\n const preserveAspectRatio = this.fixedAspectRatio\n ? 'xMidYMid meet'\n : 'none';\n\n return html`\n <svg\n width=${this.fixedAspectRatio ? '100%' : `${this.width}px`}\n height=${this.fixedAspectRatio ? '100%' : `${viewBox.height}px`}\n viewBox=\"${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}\"\n preserveAspectRatio=\"${preserveAspectRatio}\"\n style=\"--scale: ${\n this.fixedAspectRatio ? this._scale : 1\n }; display: block;\"\n part=\"svg\"\n >\n ${parts.barContainer} ${parts.barFill} ${parts.scaleBackground}\n ${parts.tickmarks} ${parts.labels} ${parts.adviceOverlays}\n ${parts.currentValueDot} ${parts.setpoint}\n </svg>\n `;\n }\n\n override willUpdate(changed: PropertyValues): void {\n super.willUpdate(changed);\n\n // Sync deprecated alias to mixin property\n // Only sync if the alias was set and the mixin property was NOT also set.\n if (changed.has('focused') && !changed.has('touching')) {\n this.touching = this.focused;\n }\n }\n\n override updated(changed: PropertyValues) {\n super.updated(changed);\n\n // Only the styles this element applied are removed: the first update\n // lists every property, and a consumer's inline style is theirs.\n if (changed.has('fixedAspectRatio')) {\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n this._updateScaleFromCurrentSize();\n } else if (changed.get('fixedAspectRatio') === true) {\n this._removeFixedAspectRatioStyles();\n this._scale = 1;\n }\n }\n\n if (changed.has('scaleReferenceSize') && this.fixedAspectRatio) {\n this._updateScaleFromCurrentSize();\n }\n\n // The reported thickness follows the bands, the advice icons, the\n // setpoint marker band and the mode, whichever mode is on; a resize\n // re-reports through the ResizeController.\n if (\n changed.has('fixedAspectRatio') ||\n changed.has('side') ||\n changed.has('showLabels') ||\n changed.has('advices') ||\n this.setpointPresenceChanged(changed)\n ) {\n // A thinner or thicker drawing under the same box changes the painted\n // scale without a resize event.\n if (this.fixedAspectRatio) this._measureScale();\n this.reportDimensions();\n }\n }\n\n /**\n * Report scale dimensions to parent chart component.\n * When fixedAspectRatio=true, reports the actual visual (scaled) thickness\n * so the chart can correctly reserve space for the scale.\n * When fixedAspectRatio=false, reports the base/unscaled thickness.\n */\n private reportDimensions() {\n const effectiveBarThickness = computeExternalScaleEffectiveBarThickness({\n hasBar: this.hasBar,\n barThickness: this.barThickness,\n borderRadius: this.borderRadius,\n scaleType: this.scaleType,\n });\n\n const baseDimensions = computeScaleDimensionsForReport({\n orientation: ExternalScaleOrientation.horizontal,\n side: this.side,\n hasBar: this.hasBar,\n hasScale: this.hasScale,\n labels: this.showLabels,\n barThickness: effectiveBarThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n length: this.fixedAspectRatio ? this.scaleReferenceSize : this.width,\n scaleType: this.scaleType,\n hasAdviceIcon: !!this.advices?.some((a) => a.showIcon),\n hasSetpoint:\n this.setpoint !== undefined ||\n this.newSetpoint !== undefined ||\n this.departingNewSetpoint !== undefined,\n });\n\n // The chart lays out in visual pixels, so a scaled drawing reports its\n // scaled thickness.\n const dimensions = this.fixedAspectRatio\n ? {\n ...baseDimensions,\n thickness: Math.round(baseDimensions.thickness * this._scale),\n }\n : baseDimensions;\n\n this.dispatchEvent(\n new CustomEvent('scale-dimensions-changed', {\n detail: dimensions,\n bubbles: true,\n })\n );\n }\n\n protected override createRenderRoot() {\n return this;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n }\n }\n\n /** The inline sizing, value and priority, the consumer had before fixedAspectRatio took the host. */\n private _consumerSizing?: Record<\n 'display' | 'width' | 'height',\n [value: string, priority: string]\n >;\n\n /**\n * A custom element is inline by default, which gives the percentage-sized\n * SVG nothing to fill; in fixedAspectRatio mode the host is a block that\n * takes its container's width.\n */\n private _applyFixedAspectRatioStyles(): void {\n if (!this._consumerSizing) {\n const snapshot = (name: string): [string, string] => [\n this.style.getPropertyValue(name),\n this.style.getPropertyPriority(name),\n ];\n this._consumerSizing = {\n display: snapshot('display'),\n width: snapshot('width'),\n height: snapshot('height'),\n };\n }\n this.style.display = 'block';\n this.style.width = '100%';\n this.style.height = 'auto';\n }\n\n private _removeFixedAspectRatioStyles(): void {\n const saved = this._consumerSizing;\n this._consumerSizing = undefined;\n for (const name of ['display', 'width', 'height'] as const) {\n const [value, priority] = saved?.[name] ?? ['', ''];\n this.style.setProperty(name, value, priority);\n }\n }\n\n /** Reads the host's content box into the scale; false while the host has no size yet. */\n private _measureScale(): boolean {\n const {width, height} = readContentBox(this);\n if (width <= 0) return false;\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize: width,\n containerCrossAxisSize: height,\n scaleReferenceSize: this.scaleReferenceSize,\n viewBoxThickness: this._viewBoxThickness,\n });\n return true;\n }\n\n /** Measures once layout has settled, then reports. */\n private _updateScaleFromCurrentSize(): void {\n requestAnimationFrame(() => {\n if (this._measureScale()) {\n this.requestUpdate();\n this.reportDimensions();\n }\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-gauge-horizontal': ObcGaugeHorizontal;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAyJO,IAAM,qBAAN,MAAM,2BAA2B,YACtC,cAAc,YAAY,EACxB,iBAAiB,EACnB,CAAC,CACH,CAAC,CAAC;;;EACqC,KAAA,WAAA;EACA,KAAA,WAAA;EACA,KAAA,UAAA;EAEZ,KAAA,QAAA;EACM,KAAA,cAAA,iBAAiB;EAChB,KAAA,eAAA,iBAAiB;EAEG,KAAA,OAAA,kBAAkB;EAExB,KAAA,mBAAA;EACC,KAAA,qBAAA;EAG9B,KAAA,SAAA;EAGW,KAAA,o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AA,KAAA,CAAA;AAGvBA,WAAA,CAAA,SAAS;CAAC,MAAM;CAAQ,WAAW;AAAK,CAAC,CAAA,GAAA,mBAAA,WAAA,wBAAA,KAAA,CAAA;AAkBzCA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,YAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,YAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,WAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,WAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,SAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,SAAA,KAAA,CAAA;AAMvBA,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,mBAAA,WAAA,WAAA,KAAA,CAAA;AAMxBA,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,mBAAA,WAAA,yBAAA,KAAA,CAAA;AAhG1B,qBAAAA,WAAA,CAAA,cAAc,sBAAsB,CAAA,GAAA,kBAAA"}
@@ -17,7 +17,7 @@ declare const ObcGaugeVertical_base: (new (...args: any[]) => import('../../svgh
17
17
  * ---
18
18
  *
19
19
  * ### Features
20
- * - **Fixed Layout:** Height (384px), padding (32px), bar/tick/label thicknesses, and border radius are fixed for consistent gauge appearance.
20
+ * - **Fixed Layout:** Height (384px), padding (32px), bar/tick/label thicknesses, and border radius are fixed for consistent gauge appearance. 384 px is the length the design is drawn at, not a layout limit: see `fixedAspectRatio`.
21
21
  * - **Scale Configuration:**
22
22
  * - Configurable `minValue` and `maxValue` for the value range.
23
23
  * - Optional main, primary, secondary, and tertiary tickmarks at specified intervals.
@@ -31,7 +31,7 @@ declare const ObcGaugeVertical_base: (new (...args: any[]) => import('../../svgh
31
31
  * - Optional `setpoint` value displays a marker.
32
32
  * - Automatic at-setpoint detection with configurable deadband.
33
33
  * - **Advice Overlays:** Render advice ranges with different types and hinted states.
34
- * - **Fixed Aspect Ratio:** When enabled, scales the component proportionally while keeping label font-size constant.
34
+ * - **Fixed Aspect Ratio:** `fixedAspectRatio` scales the whole gauge to its container like a vector image while the label font size stays put; `scaleReferenceSize` is the container height at which it draws 1:1.
35
35
  * - **Dimension Reporting:** Dispatches `scale-dimensions-changed` events for parent chart integration.
36
36
  *
37
37
  * ---
@@ -48,7 +48,6 @@ declare const ObcGaugeVertical_base: (new (...args: any[]) => import('../../svgh
48
48
  * - `hasBar`: true
49
49
  * - `hasScale`: true
50
50
  * - `scaleBackground`: true
51
- * - `fixedAspectRatio`: true (always scales proportionally)
52
51
  *
53
52
  * ---
54
53
  *
@@ -90,6 +89,9 @@ declare const ObcGaugeVertical_base: (new (...args: any[]) => import('../../svgh
90
89
  * @property maxValue - Maximum scale value
91
90
  * @property reverse - Plot `minValue` at the top so values grow downward.
92
91
  * @property side - Which side of the chart area this scale lives on (left or right)
92
+ * @property fixedAspectRatio - Scale the whole gauge to its container like a vector image, keeping the label font size: the SVG fills the host, so size the host. Off, the gauge draws at its 384 px reference height.
93
+ * @property scaleReferenceSize - Container height at which a `fixedAspectRatio` gauge draws 1:1 with the design. A taller container enlarges the drawing proportionally, a shorter one shrinks it.
94
+ * @availableWhen scaleReferenceSize fixedAspectRatio==true
93
95
  * @property showLabels - Show numerical value labels at primary tickmarks
94
96
  * @property mainTickmarks - Array of values for main tickmarks. When undefined, no main tickmarks shown. When empty array [], defaults to [minValue, 0, maxValue].
95
97
  * @property primaryTickmarkInterval - Interval for primary (longest) tickmarks with labels
@@ -122,23 +124,17 @@ export declare class ObcGaugeVertical extends ObcGaugeVertical_base {
122
124
  private readonly paddingBottom;
123
125
  /** Which side of the chart area this scale lives on (left or right) */
124
126
  side: ExternalScaleSide;
125
- /**
126
- * When true, freezes all internal calculations and scales the entire component
127
- * proportionally (like CSS transform:scale), except label font-size remains constant.
128
- * When false (default), dimensions react to component properties.
129
- *
130
- * This property is intentionally not exposed as a public API or Storybook control.
131
- * It can be set programmatically by parent components (e.g., GaugeTrend).
132
- */
127
+ /** Scale the whole gauge to its container like a vector image, keeping the label font size: the SVG fills the host, so size the host. Off, the gauge draws at its 384 px reference height. */
133
128
  fixedAspectRatio: boolean;
134
129
  /**
135
- * Reference size for proportional scaling when fixedAspectRatio is true.
136
- * At this height, the scale renders at native 1:1 (matches Figma design).
137
- * Above this height, the scale grows proportionally; below, it shrinks.
138
- * @default 384
130
+ * Container height at which a `fixedAspectRatio` gauge draws 1:1 with the design. A taller container enlarges the drawing proportionally, a shorter one shrinks it.
131
+ *
132
+ * Available when `fixedAspectRatio==true`.
139
133
  */
140
134
  scaleReferenceSize: number;
141
135
  private _scale;
136
+ /** The drawing's width in viewBox units, kept from the last render for the scale measurement. */
137
+ private _viewBoxThickness;
142
138
  private _resizeController;
143
139
  /** Show numerical value labels at primary tickmarks */
144
140
  showLabels: boolean;
@@ -187,11 +183,26 @@ export declare class ObcGaugeVertical extends ObcGaugeVertical_base {
187
183
  updated(changed: PropertyValues): void;
188
184
  /**
189
185
  * Report scale dimensions to parent chart component.
190
- * Always reports unscaled/reference dimensions so the parent chart can apply
191
- * consistent proportional scaling in fixedAspectRatioScaling mode.
186
+ * When fixedAspectRatio=true, reports the actual visual (scaled) thickness
187
+ * so the chart can correctly reserve space for the scale.
188
+ * When fixedAspectRatio=false, reports the base/unscaled thickness.
192
189
  */
193
190
  private reportDimensions;
194
191
  protected createRenderRoot(): this;
192
+ connectedCallback(): void;
193
+ /** The inline sizing, value and priority, the consumer had before fixedAspectRatio took the host. */
194
+ private _consumerSizing?;
195
+ /**
196
+ * A custom element is inline by default, which gives the percentage-sized
197
+ * SVG nothing to fill; in fixedAspectRatio mode the host is a block that
198
+ * takes its container's height.
199
+ */
200
+ private _applyFixedAspectRatioStyles;
201
+ private _removeFixedAspectRatioStyles;
202
+ /** Reads the host's content box into the scale; false while the host has no size yet. */
203
+ private _measureScale;
204
+ /** Measures once layout has settled, then reports. */
205
+ private _updateScaleFromCurrentSize;
195
206
  }
196
207
  declare global {
197
208
  interface HTMLElementTagNameMap {
@@ -1 +1 @@
1
- {"version":3,"file":"gauge-vertical.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/gauge-vertical/gauge-vertical.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;AAErC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,KAAK,CAAC;AAIxC,OAAO,EACL,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAQL,SAAS,EACT,QAAQ,EACR,cAAc,EAEd,iBAAiB,EAClB,MAAM,wDAAwD,CAAC;AAMhE,OAAO,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,iBAAiB,GAClB,CAAC;;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0GG;AACH,qBACa,gBAAiB,SAAQ,qBAIrC;IAC2B,QAAQ,SAAK;IACb,QAAQ,SAAO;IACd,OAAO,UAAS;IAE3C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAO;IAC9B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAmC;IAC9D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAmC;IAEvC,IAAI,EAAE,iBAAiB,CAA2B;IAE5E;;;;;;;OAOG;IACH,gBAAgB,UAA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