@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
@@ -65236,11 +65236,21 @@
65236
65236
  "privacy": "private",
65237
65237
  "default": "1"
65238
65238
  },
65239
+ {
65240
+ "kind": "field",
65241
+ "name": "_viewBoxThickness",
65242
+ "type": {
65243
+ "text": "number"
65244
+ },
65245
+ "privacy": "private",
65246
+ "default": "0",
65247
+ "description": "The drawing's height in viewBox units, kept from the last render for the scale measurement."
65248
+ },
65239
65249
  {
65240
65250
  "kind": "field",
65241
65251
  "name": "_resizeController",
65242
65252
  "privacy": "private",
65243
- "default": "new ResizeController(this, { callback: (entries) => { if (!this.fixedAspectRatio) return; const entry = entries[0]; if (!entry) return; // Use the centralized function that computes scale based on reference size // For horizontal scales, compare container width to reference size const containerMainAxisSize = entry.contentRect.width; this._scale = computeFixedAspectRatioScale({ orientation: ExternalScaleOrientation.horizontal, containerMainAxisSize, scaleReferenceSize: this.scaleReferenceSize, }); // Report scaled dimensions to parent chart this.reportDimensions(); }, })"
65253
+ "default": "new ResizeController(this, { callback: (entries) => { if (!this.fixedAspectRatio) return; const entry = entries[0]; if (!entry) return; this._scale = computeFixedAspectRatioScale({ orientation: ExternalScaleOrientation.horizontal, containerMainAxisSize: entry.contentRect.width, containerCrossAxisSize: entry.contentRect.height, scaleReferenceSize: this.scaleReferenceSize, viewBoxThickness: this._viewBoxThickness, }); // Report scaled dimensions to parent chart this.reportDimensions(); }, })"
65244
65254
  },
65245
65255
  {
65246
65256
  "kind": "field",
@@ -65618,6 +65628,17 @@
65618
65628
  },
65619
65629
  "description": "Remove fixed aspect ratio styles when switching back to pixel mode."
65620
65630
  },
65631
+ {
65632
+ "kind": "method",
65633
+ "name": "_measureScale",
65634
+ "privacy": "private",
65635
+ "return": {
65636
+ "type": {
65637
+ "text": "boolean"
65638
+ }
65639
+ },
65640
+ "description": "Reads the host's content box into the scale; false while the host has no size yet."
65641
+ },
65621
65642
  {
65622
65643
  "kind": "method",
65623
65644
  "name": "_updateScaleFromCurrentSize",
@@ -66595,11 +66616,21 @@
66595
66616
  "privacy": "private",
66596
66617
  "default": "1"
66597
66618
  },
66619
+ {
66620
+ "kind": "field",
66621
+ "name": "_viewBoxThickness",
66622
+ "type": {
66623
+ "text": "number"
66624
+ },
66625
+ "privacy": "private",
66626
+ "default": "0",
66627
+ "description": "The drawing's width in viewBox units, kept from the last render for the scale measurement."
66628
+ },
66598
66629
  {
66599
66630
  "kind": "field",
66600
66631
  "name": "_resizeController",
66601
66632
  "privacy": "private",
66602
- "default": "new ResizeController(this, { callback: (entries) => { if (!this.fixedAspectRatio) return; const entry = entries[0]; if (!entry) return; // Use the centralized function that computes scale based on reference size // For vertical scales, compare container height to reference size const containerMainAxisSize = entry.contentRect.height; this._scale = computeFixedAspectRatioScale({ orientation: ExternalScaleOrientation.vertical, containerMainAxisSize, scaleReferenceSize: this.scaleReferenceSize, }); // Report scaled dimensions to parent chart this.reportDimensions(); }, })"
66633
+ "default": "new ResizeController(this, { callback: (entries) => { if (!this.fixedAspectRatio) return; const entry = entries[0]; if (!entry) return; this._scale = computeFixedAspectRatioScale({ orientation: ExternalScaleOrientation.vertical, containerMainAxisSize: entry.contentRect.height, containerCrossAxisSize: entry.contentRect.width, scaleReferenceSize: this.scaleReferenceSize, viewBoxThickness: this._viewBoxThickness, }); // Report scaled dimensions to parent chart this.reportDimensions(); }, })"
66603
66634
  },
66604
66635
  {
66605
66636
  "kind": "field",
@@ -66945,6 +66976,17 @@
66945
66976
  },
66946
66977
  "description": "Remove fixed aspect ratio styles when switching back to pixel mode."
66947
66978
  },
66979
+ {
66980
+ "kind": "method",
66981
+ "name": "_measureScale",
66982
+ "privacy": "private",
66983
+ "return": {
66984
+ "type": {
66985
+ "text": "boolean"
66986
+ }
66987
+ },
66988
+ "description": "Reads the host's content box into the scale; false while the host has no size yet."
66989
+ },
66948
66990
  {
66949
66991
  "kind": "method",
66950
66992
  "name": "_updateScaleFromCurrentSize",
@@ -69733,10 +69775,29 @@
69733
69775
  "type": {
69734
69776
  "text": "FixedAspectRatioScaleConfig"
69735
69777
  },
69736
- "description": "Configuration with orientation, container size, and reference size"
69778
+ "description": "Configuration with orientation, container sizes, reference size and drawing thickness"
69779
+ }
69780
+ ],
69781
+ "description": "Compute the scale factor for fixed aspect ratio mode.\n\nIn fixed aspect ratio mode, the scale component determines its zoom level based on\ncomparing the container's main axis size against a reference size (typically 384px).\n- If container is larger than reference: scale > 1 (zoom in)\n- If container is smaller than reference: scale < 1 (zoom out)\n- If container equals reference: scale = 1 (native size)\n\nThis scale factor is applied to SVG rendering while keeping text labels at constant size\nby using the CSS variable `--scale` to counter-scale font sizes.\n\nThe SVG is painted with `xMidYMid meet`, which takes the smaller of the two\naxes' ratios. Pass the container's cross-axis size and the drawing's\nthickness so the factor follows the paint when the cross axis is the limit;\nwithout them the main axis alone decides, as it does whenever the cross axis\nhas room.\n\nWorks for all orientations and sides:\n- Vertical scales (left/right): compare container height vs reference\n- Horizontal scales (top/bottom): compare container width vs reference"
69782
+ },
69783
+ {
69784
+ "kind": "function",
69785
+ "name": "readContentBox",
69786
+ "return": {
69787
+ "type": {
69788
+ "text": ""
69789
+ }
69790
+ },
69791
+ "parameters": [
69792
+ {
69793
+ "name": "el",
69794
+ "type": {
69795
+ "text": "HTMLElement"
69796
+ },
69797
+ "description": "The host element"
69737
69798
  }
69738
69799
  ],
69739
- "description": "Compute the scale factor for fixed aspect ratio mode.\n\nIn fixed aspect ratio mode, the scale component determines its zoom level based on\ncomparing the container's main axis size against a reference size (typically 384px).\n- If container is larger than reference: scale > 1 (zoom in)\n- If container is smaller than reference: scale < 1 (zoom out)\n- If container equals reference: scale = 1 (native size)\n\nThis scale factor is applied to SVG rendering while keeping text labels at constant size\nby using the CSS variable `--scale` to counter-scale font sizes.\n\nWorks for all orientations and sides:\n- Vertical scales (left/right): compare container height vs reference\n- Horizontal scales (top/bottom): compare container width vs reference"
69800
+ "description": "The element's content box in CSS px: the box a `100%` × `100%` SVG child\nfills, and what a ResizeObserver's `contentRect` reports. `clientWidth` /\n`clientHeight` include the padding, and `getBoundingClientRect()` is scaled\nby any ancestor CSS `zoom`, so neither is the box the drawing is painted in."
69740
69801
  },
69741
69802
  {
69742
69803
  "kind": "function",
@@ -69972,6 +70033,14 @@
69972
70033
  "module": "src/building-blocks/external-scale/external-scale.ts"
69973
70034
  }
69974
70035
  },
70036
+ {
70037
+ "kind": "js",
70038
+ "name": "readContentBox",
70039
+ "declaration": {
70040
+ "name": "readContentBox",
70041
+ "module": "src/building-blocks/external-scale/external-scale.ts"
70042
+ }
70043
+ },
69975
70044
  {
69976
70045
  "kind": "js",
69977
70046
  "name": "computeScaledThickness",
@@ -117309,7 +117378,7 @@
117309
117378
  "declarations": [
117310
117379
  {
117311
117380
  "kind": "class",
117312
- "description": "`<obc-gauge-horizontal>` – A horizontal gauge component with bar and scale background.\n\nUse `obc-gauge-horizontal` when you need a standalone horizontal gauge with a visible scale\nand bar. This is ideal for displaying single values like speed, power, or progress where\nthe scale context is always needed.\n\nThis is the same as `obc-bar-horizontal` (both use `external-scale.ts`)\nbut with several properties fixed for consistent gauge appearance.\nUnlike `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\nThis is a higher fidelity implementation of the concept shown in `instrument-linear.ts`,\nproviding a complete gauge with container, scale background, tickmarks, labels, advice overlays, and setpoint marker.\n\nThis is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\nIt sets up the outer `<svg>`/`viewBox` for a horizontal scale and delegates rendering/layout to:\n- `computeExternalScaleLayout(...)`\n- `renderExternalScale(config)`\n\nFor renderer documentation see: **Building Blocks/External Scale**.\n\nFor 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```",
117381
+ "description": "`<obc-gauge-horizontal>` – A horizontal gauge component with bar and scale background.\n\nUse `obc-gauge-horizontal` when you need a standalone horizontal gauge with a visible scale\nand bar. This is ideal for displaying single values like speed, power, or progress where\nthe scale context is always needed.\n\nThis is the same as `obc-bar-horizontal` (both use `external-scale.ts`)\nbut with several properties fixed for consistent gauge appearance.\nUnlike `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\nThis is a higher fidelity implementation of the concept shown in `instrument-linear.ts`,\nproviding a complete gauge with container, scale background, tickmarks, labels, advice overlays, and setpoint marker.\n\nThis is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\nIt sets up the outer `<svg>`/`viewBox` for a horizontal scale and delegates rendering/layout to:\n- `computeExternalScaleLayout(...)`\n- `renderExternalScale(config)`\n\nFor renderer documentation see: **Building Blocks/External Scale**.\n\nFor 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```",
117313
117382
  "name": "ObcGaugeHorizontal",
117314
117383
  "members": [
117315
117384
  {
@@ -117380,7 +117449,8 @@
117380
117449
  "text": "boolean"
117381
117450
  },
117382
117451
  "default": "false",
117383
- "description": "When true, freezes all internal calculations and scales the entire component\nproportionally (like CSS transform:scale), except label font-size remains constant.\nWhen false (default), dimensions react to component properties.\n\nThis property is intentionally not exposed as a public API or Storybook control.\nIt can be set programmatically by parent components (e.g., GaugeTrend)."
117452
+ "description": "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.",
117453
+ "attribute": "fixedAspectRatio"
117384
117454
  },
117385
117455
  {
117386
117456
  "kind": "field",
@@ -117389,7 +117459,13 @@
117389
117459
  "text": "number"
117390
117460
  },
117391
117461
  "default": "384",
117392
- "description": "Reference size for proportional scaling when fixedAspectRatio is true.\nAt this width, the scale renders at native 1:1 (matches Figma design).\nAbove this width, the scale grows proportionally; below, it shrinks."
117462
+ "description": "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\nAvailable when `fixedAspectRatio==true`.",
117463
+ "attribute": "scaleReferenceSize",
117464
+ "availableWhen": "fixedAspectRatio==true",
117465
+ "availableWhenIf": {
117466
+ "arg": "fixedAspectRatio",
117467
+ "truthy": true
117468
+ }
117393
117469
  },
117394
117470
  {
117395
117471
  "kind": "field",
@@ -117400,11 +117476,21 @@
117400
117476
  "privacy": "private",
117401
117477
  "default": "1"
117402
117478
  },
117479
+ {
117480
+ "kind": "field",
117481
+ "name": "_viewBoxThickness",
117482
+ "type": {
117483
+ "text": "number"
117484
+ },
117485
+ "privacy": "private",
117486
+ "default": "0",
117487
+ "description": "The drawing's height in viewBox units, kept from the last render for the scale measurement."
117488
+ },
117403
117489
  {
117404
117490
  "kind": "field",
117405
117491
  "name": "_resizeController",
117406
117492
  "privacy": "private",
117407
- "default": "new ResizeController(this, { callback: (entries) => { if (!this.fixedAspectRatio) return; const entry = entries[0]; if (!entry) return; // Use the centralized function that computes scale based on reference size // For horizontal scales, compare container width to reference size const containerMainAxisSize = entry.contentRect.width; const scale = computeFixedAspectRatioScale({ orientation: ExternalScaleOrientation.horizontal, containerMainAxisSize, scaleReferenceSize: this.scaleReferenceSize, }); // Guard against zero-sized containers, but allow fractional scales < 1 this._scale = scale > 0 ? scale : 1; // Report scaled dimensions to parent chart this.reportDimensions(); }, })"
117493
+ "default": "new ResizeController(this, { callback: (entries) => { if (!this.fixedAspectRatio) return; const entry = entries[0]; if (!entry) return; const scale = computeFixedAspectRatioScale({ orientation: ExternalScaleOrientation.horizontal, containerMainAxisSize: entry.contentRect.width, containerCrossAxisSize: entry.contentRect.height, scaleReferenceSize: this.scaleReferenceSize, viewBoxThickness: this._viewBoxThickness, }); // Guard against zero-sized containers, but allow fractional scales < 1 this._scale = scale > 0 ? scale : 1; // Report scaled dimensions to parent chart this.reportDimensions(); }, })"
117408
117494
  },
117409
117495
  {
117410
117496
  "kind": "field",
@@ -117644,7 +117730,59 @@
117644
117730
  "kind": "method",
117645
117731
  "name": "reportDimensions",
117646
117732
  "privacy": "private",
117647
- "description": "Report scale dimensions to parent chart component.\nAlways reports unscaled/reference dimensions so the parent chart can apply\nconsistent proportional scaling in fixedAspectRatioScaling mode."
117733
+ "description": "Report scale dimensions to parent chart component.\nWhen fixedAspectRatio=true, reports the actual visual (scaled) thickness\nso the chart can correctly reserve space for the scale.\nWhen fixedAspectRatio=false, reports the base/unscaled thickness."
117734
+ },
117735
+ {
117736
+ "kind": "field",
117737
+ "name": "_consumerSizing",
117738
+ "type": {
117739
+ "text": "Record<\n 'display' | 'width' | 'height',\n [value: string, priority: string]\n > | undefined"
117740
+ },
117741
+ "privacy": "private",
117742
+ "description": "The inline sizing, value and priority, the consumer had before fixedAspectRatio took the host."
117743
+ },
117744
+ {
117745
+ "kind": "method",
117746
+ "name": "_applyFixedAspectRatioStyles",
117747
+ "privacy": "private",
117748
+ "return": {
117749
+ "type": {
117750
+ "text": "void"
117751
+ }
117752
+ },
117753
+ "description": "A custom element is inline by default, which gives the percentage-sized\nSVG nothing to fill; in fixedAspectRatio mode the host is a block that\ntakes its container's width."
117754
+ },
117755
+ {
117756
+ "kind": "method",
117757
+ "name": "_removeFixedAspectRatioStyles",
117758
+ "privacy": "private",
117759
+ "return": {
117760
+ "type": {
117761
+ "text": "void"
117762
+ }
117763
+ }
117764
+ },
117765
+ {
117766
+ "kind": "method",
117767
+ "name": "_measureScale",
117768
+ "privacy": "private",
117769
+ "return": {
117770
+ "type": {
117771
+ "text": "boolean"
117772
+ }
117773
+ },
117774
+ "description": "Reads the host's content box into the scale; false while the host has no size yet."
117775
+ },
117776
+ {
117777
+ "kind": "method",
117778
+ "name": "_updateScaleFromCurrentSize",
117779
+ "privacy": "private",
117780
+ "return": {
117781
+ "type": {
117782
+ "text": "void"
117783
+ }
117784
+ },
117785
+ "description": "Measures once layout has settled, then reports."
117648
117786
  },
117649
117787
  {
117650
117788
  "kind": "field",
@@ -118000,6 +118138,24 @@
118000
118138
  "description": "Which side of the chart area this scale lives on (top or bottom)",
118001
118139
  "fieldName": "side"
118002
118140
  },
118141
+ {
118142
+ "name": "fixedAspectRatio",
118143
+ "type": {
118144
+ "text": "boolean"
118145
+ },
118146
+ "default": "false",
118147
+ "description": "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.",
118148
+ "fieldName": "fixedAspectRatio"
118149
+ },
118150
+ {
118151
+ "name": "scaleReferenceSize",
118152
+ "type": {
118153
+ "text": "number"
118154
+ },
118155
+ "default": "384",
118156
+ "description": "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\nAvailable when `fixedAspectRatio==true`.",
118157
+ "fieldName": "scaleReferenceSize"
118158
+ },
118003
118159
  {
118004
118160
  "name": "primaryTickmarkInterval",
118005
118161
  "type": {
@@ -124115,7 +124271,7 @@
124115
124271
  "declarations": [
124116
124272
  {
124117
124273
  "kind": "class",
124118
- "description": "`<obc-gauge-vertical>` – A vertical gauge component with bar and scale background.\n\nUse `obc-gauge-vertical` when you need a standalone vertical gauge with a visible scale\nand bar. This is ideal for displaying single values like tank levels, pressure, or\ntemperature where the scale context is always needed.\n\nThis is the same as `obc-bar-vertical` (both use `external-scale.ts`)\nbut with several properties fixed for consistent gauge appearance.\nUnlike `obc-bar-vertical`, this component always shows the bar and scale background.\n\n---\n\n### Features\n- **Fixed Layout:** Height (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 `left` or `right` 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- `height`: 384px\n- `paddingTop`/`paddingBottom`: 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\nThis is a higher fidelity implementation of the concept shown in `instrument-linear.ts`,\nproviding a complete gauge with container, scale background, tickmarks, labels, advice overlays, and setpoint marker.\n\nThis is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\nIt sets up the outer `<svg>`/`viewBox` for a vertical scale and delegates rendering/layout to:\n- `computeExternalScaleLayout(...)`\n- `renderExternalScale(config)`\n\nFor renderer documentation see: **Building Blocks/External Scale**.\n\nFor a version where these properties are user-configurable, see **Bars and Graphs/Bar Vertical**.\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-vertical\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=\"right\"\n></obc-gauge-vertical>\n```",
124274
+ "description": "`<obc-gauge-vertical>` – A vertical gauge component with bar and scale background.\n\nUse `obc-gauge-vertical` when you need a standalone vertical gauge with a visible scale\nand bar. This is ideal for displaying single values like tank levels, pressure, or\ntemperature where the scale context is always needed.\n\nThis is the same as `obc-bar-vertical` (both use `external-scale.ts`)\nbut with several properties fixed for consistent gauge appearance.\nUnlike `obc-bar-vertical`, this component always shows the bar and scale background.\n\n---\n\n### Features\n- **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`.\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 `left` or `right` 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 height 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- `height`: 384px\n- `paddingTop`/`paddingBottom`: 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\nThis is a higher fidelity implementation of the concept shown in `instrument-linear.ts`,\nproviding a complete gauge with container, scale background, tickmarks, labels, advice overlays, and setpoint marker.\n\nThis is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\nIt sets up the outer `<svg>`/`viewBox` for a vertical scale and delegates rendering/layout to:\n- `computeExternalScaleLayout(...)`\n- `renderExternalScale(config)`\n\nFor renderer documentation see: **Building Blocks/External Scale**.\n\nFor a version where these properties are user-configurable, see **Bars and Graphs/Bar Vertical**.\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-vertical\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=\"right\"\n></obc-gauge-vertical>\n```",
124119
124275
  "name": "ObcGaugeVertical",
124120
124276
  "members": [
124121
124277
  {
@@ -124186,7 +124342,8 @@
124186
124342
  "text": "boolean"
124187
124343
  },
124188
124344
  "default": "false",
124189
- "description": "When true, freezes all internal calculations and scales the entire component\nproportionally (like CSS transform:scale), except label font-size remains constant.\nWhen false (default), dimensions react to component properties.\n\nThis property is intentionally not exposed as a public API or Storybook control.\nIt can be set programmatically by parent components (e.g., GaugeTrend)."
124345
+ "description": "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.",
124346
+ "attribute": "fixedAspectRatio"
124190
124347
  },
124191
124348
  {
124192
124349
  "kind": "field",
@@ -124195,7 +124352,13 @@
124195
124352
  "text": "number"
124196
124353
  },
124197
124354
  "default": "384",
124198
- "description": "Reference size for proportional scaling when fixedAspectRatio is true.\nAt this height, the scale renders at native 1:1 (matches Figma design).\nAbove this height, the scale grows proportionally; below, it shrinks."
124355
+ "description": "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.\n\nAvailable when `fixedAspectRatio==true`.",
124356
+ "attribute": "scaleReferenceSize",
124357
+ "availableWhen": "fixedAspectRatio==true",
124358
+ "availableWhenIf": {
124359
+ "arg": "fixedAspectRatio",
124360
+ "truthy": true
124361
+ }
124199
124362
  },
124200
124363
  {
124201
124364
  "kind": "field",
@@ -124206,11 +124369,21 @@
124206
124369
  "privacy": "private",
124207
124370
  "default": "1"
124208
124371
  },
124372
+ {
124373
+ "kind": "field",
124374
+ "name": "_viewBoxThickness",
124375
+ "type": {
124376
+ "text": "number"
124377
+ },
124378
+ "privacy": "private",
124379
+ "default": "0",
124380
+ "description": "The drawing's width in viewBox units, kept from the last render for the scale measurement."
124381
+ },
124209
124382
  {
124210
124383
  "kind": "field",
124211
124384
  "name": "_resizeController",
124212
124385
  "privacy": "private",
124213
- "default": "new ResizeController(this, { callback: (entries) => { if (!this.fixedAspectRatio) return; const entry = entries[0]; if (!entry) return; // Use the centralized function that computes scale based on reference size // For vertical scales, compare container height to reference size const containerMainAxisSize = entry.contentRect.height; const scale = computeFixedAspectRatioScale({ orientation: ExternalScaleOrientation.vertical, containerMainAxisSize, scaleReferenceSize: this.scaleReferenceSize, }); // Guard against zero-sized containers, but allow fractional scales < 1 this._scale = scale > 0 ? scale : 1; // Report scaled dimensions to parent chart this.reportDimensions(); }, })"
124386
+ "default": "new ResizeController(this, { callback: (entries) => { if (!this.fixedAspectRatio) return; const entry = entries[0]; if (!entry) return; const scale = computeFixedAspectRatioScale({ orientation: ExternalScaleOrientation.vertical, containerMainAxisSize: entry.contentRect.height, containerCrossAxisSize: entry.contentRect.width, scaleReferenceSize: this.scaleReferenceSize, viewBoxThickness: this._viewBoxThickness, }); // Guard against zero-sized containers, but allow fractional scales < 1 this._scale = scale > 0 ? scale : 1; // Report scaled dimensions to parent chart this.reportDimensions(); }, })"
124214
124387
  },
124215
124388
  {
124216
124389
  "kind": "field",
@@ -124450,7 +124623,59 @@
124450
124623
  "kind": "method",
124451
124624
  "name": "reportDimensions",
124452
124625
  "privacy": "private",
124453
- "description": "Report scale dimensions to parent chart component.\nAlways reports unscaled/reference dimensions so the parent chart can apply\nconsistent proportional scaling in fixedAspectRatioScaling mode."
124626
+ "description": "Report scale dimensions to parent chart component.\nWhen fixedAspectRatio=true, reports the actual visual (scaled) thickness\nso the chart can correctly reserve space for the scale.\nWhen fixedAspectRatio=false, reports the base/unscaled thickness."
124627
+ },
124628
+ {
124629
+ "kind": "field",
124630
+ "name": "_consumerSizing",
124631
+ "type": {
124632
+ "text": "Record<\n 'display' | 'height' | 'width',\n [value: string, priority: string]\n > | undefined"
124633
+ },
124634
+ "privacy": "private",
124635
+ "description": "The inline sizing, value and priority, the consumer had before fixedAspectRatio took the host."
124636
+ },
124637
+ {
124638
+ "kind": "method",
124639
+ "name": "_applyFixedAspectRatioStyles",
124640
+ "privacy": "private",
124641
+ "return": {
124642
+ "type": {
124643
+ "text": "void"
124644
+ }
124645
+ },
124646
+ "description": "A custom element is inline by default, which gives the percentage-sized\nSVG nothing to fill; in fixedAspectRatio mode the host is a block that\ntakes its container's height."
124647
+ },
124648
+ {
124649
+ "kind": "method",
124650
+ "name": "_removeFixedAspectRatioStyles",
124651
+ "privacy": "private",
124652
+ "return": {
124653
+ "type": {
124654
+ "text": "void"
124655
+ }
124656
+ }
124657
+ },
124658
+ {
124659
+ "kind": "method",
124660
+ "name": "_measureScale",
124661
+ "privacy": "private",
124662
+ "return": {
124663
+ "type": {
124664
+ "text": "boolean"
124665
+ }
124666
+ },
124667
+ "description": "Reads the host's content box into the scale; false while the host has no size yet."
124668
+ },
124669
+ {
124670
+ "kind": "method",
124671
+ "name": "_updateScaleFromCurrentSize",
124672
+ "privacy": "private",
124673
+ "return": {
124674
+ "type": {
124675
+ "text": "void"
124676
+ }
124677
+ },
124678
+ "description": "Measures once layout has settled, then reports."
124454
124679
  },
124455
124680
  {
124456
124681
  "kind": "field",
@@ -124806,6 +125031,24 @@
124806
125031
  "description": "Which side of the chart area this scale lives on (left or right)",
124807
125032
  "fieldName": "side"
124808
125033
  },
125034
+ {
125035
+ "name": "fixedAspectRatio",
125036
+ "type": {
125037
+ "text": "boolean"
125038
+ },
125039
+ "default": "false",
125040
+ "description": "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.",
125041
+ "fieldName": "fixedAspectRatio"
125042
+ },
125043
+ {
125044
+ "name": "scaleReferenceSize",
125045
+ "type": {
125046
+ "text": "number"
125047
+ },
125048
+ "default": "384",
125049
+ "description": "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.\n\nAvailable when `fixedAspectRatio==true`.",
125050
+ "fieldName": "scaleReferenceSize"
125051
+ },
124809
125052
  {
124810
125053
  "name": "primaryTickmarkInterval",
124811
125054
  "type": {
@@ -123,6 +123,8 @@ export declare class ObcBarHorizontal extends ObcBarHorizontal_base {
123
123
  */
124
124
  scaleReferenceSize: number;
125
125
  private _scale;
126
+ /** The drawing's height in viewBox units, kept from the last render for the scale measurement. */
127
+ private _viewBoxThickness;
126
128
  private _resizeController;
127
129
  /** Show scale tickmarks */
128
130
  hasScale: boolean;
@@ -266,6 +268,8 @@ export declare class ObcBarHorizontal extends ObcBarHorizontal_base {
266
268
  * Remove fixed aspect ratio styles when switching back to pixel mode.
267
269
  */
268
270
  private _removeFixedAspectRatioStyles;
271
+ /** Reads the host's content box into the scale; false while the host has no size yet. */
272
+ private _measureScale;
269
273
  /**
270
274
  * Calculate scale based on current element size.
271
275
  * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.
@@ -1 +1 @@
1
- {"version":3,"file":"bar-horizontal.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/bar-horizontal/bar-horizontal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAO,MAAM,KAAK,CAAC;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,EAAE,oBAAoB,CAAa;IAGxD,cAAc,UAAS;IAGvB,YAAY,CAAC,EAAE,MAAM,CAAa;IAGlC,OAAO,CAAC,qBAAqB,CAAC,CAAS;IAEvC,OAAO,CAAC,qBAAqB,CAAC,CAAmB;IAGjD,OAAO,CAAC,6BAA6B,CAOlC;IAGuB,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;IAGhD,cAAc,EAAE,cAAc,CACjC;IAEvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAA2B;IAElC,qBAAqB,UAAS;IAEhD,MAAM;IAiGN,OAAO,CAAC,OAAO,EAAE,cAAc;IAqDxC;;;;;OAKG;IACH,OAAO,CAAC,gBAAgB;cAoDL,gBAAgB;IAI1B,iBAAiB,IAAI,IAAI;IAezB,oBAAoB,IAAI,IAAI;IAMrC,OAAO,CAAC,0BAA0B;IASlC;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAMpC;;OAEG;IACH,OAAO,CAAC,6BAA6B;IAMrC,yFAAyF;IACzF,OAAO,CAAC,aAAa;IAarB;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,8BAA8B;IAiBtC;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;CAelC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
@@ -3,7 +3,7 @@ import { CHART_DIMENSIONS } from "../../charthelpers/constants.js";
3
3
  import { BorderRadiusPosition, FrameStyle, InstrumentState, Priority } from "../../navigation-instruments/types.js";
4
4
  import { AdviceMixin } from "../../svghelpers/advice-mixin.js";
5
5
  import { nextAdviceMaskId } from "../../svghelpers/advice.js";
6
- import { AdvicePosition, BarContainerStyle, ExternalScaleOrientation, ExternalScaleSide, FillMode, ScaleType, computeExternalScaleEffectiveBarThickness, computeExternalScaleLayout, computeExternalScaleViewBox, computeFixedAspectRatioScale, computeScaleDimensionsForReport, readExternalScaleBorderRadiusPx, renderExternalScale, startExternalScaleBorderRadiusObserver, toExternalScaleLayoutConfig } from "../external-scale/external-scale.js";
6
+ import { AdvicePosition, BarContainerStyle, ExternalScaleOrientation, ExternalScaleSide, FillMode, ScaleType, computeExternalScaleEffectiveBarThickness, computeExternalScaleLayout, computeExternalScaleViewBox, computeFixedAspectRatioScale, computeScaleDimensionsForReport, readContentBox, readExternalScaleBorderRadiusPx, renderExternalScale, startExternalScaleBorderRadiusObserver, toExternalScaleLayoutConfig } from "../external-scale/external-scale.js";
7
7
  import { SetpointMixin } from "../../svghelpers/setpoint-mixin.js";
8
8
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.156.0/helpers/esm/decorate.js";
9
9
  import { LitElement, html } from "lit";
@@ -23,15 +23,17 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
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
  this._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.reportDimensions();
37
39
  } });
@@ -120,6 +122,7 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
120
122
  highlightCurrentValue: this.highlightCurrentValue
121
123
  };
122
124
  const layout = computeExternalScaleLayout(toExternalScaleLayoutConfig(config));
125
+ this._viewBoxThickness = layout.thickness;
123
126
  const parts = renderExternalScale(config);
124
127
  const viewBox = computeExternalScaleViewBox({
125
128
  orientation: config.orientation,
@@ -155,7 +158,10 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
155
158
  }
156
159
  if (changed.has("scaleReferenceSize") && this.fixedAspectRatio) this._updateScaleFromCurrentSize();
157
160
  const layoutChanged = changed.has("side") || changed.has("showLabels") || changed.has("showMainTickmarkLabels") || changed.has("hasScale") || changed.has("hasBar") || changed.has("barThickness") || changed.has("tickThickness") || changed.has("labelThickness") || changed.has("scaleType") || changed.has("borderRadiusPosition") || changed.has("borderRadius") || changed.has("advices") || changed.has("advicePosition") || this.setpointPresenceChanged(changed);
158
- if (!this.fixedAspectRatio || layoutChanged) this.reportDimensions();
161
+ if (!this.fixedAspectRatio || layoutChanged) {
162
+ if (this.fixedAspectRatio) this._measureScale();
163
+ this.reportDimensions();
164
+ }
159
165
  }
160
166
  /**
161
167
  * Report scale dimensions to parent chart component.
@@ -234,19 +240,26 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
234
240
  this.style.width = "";
235
241
  this.style.height = "";
236
242
  }
243
+ /** Reads the host's content box into the scale; false while the host has no size yet. */
244
+ _measureScale() {
245
+ const { width, height } = readContentBox(this);
246
+ if (width <= 0) return false;
247
+ this._scale = computeFixedAspectRatioScale({
248
+ orientation: ExternalScaleOrientation.horizontal,
249
+ containerMainAxisSize: width,
250
+ containerCrossAxisSize: height,
251
+ scaleReferenceSize: this.scaleReferenceSize,
252
+ viewBoxThickness: this._viewBoxThickness
253
+ });
254
+ return true;
255
+ }
237
256
  /**
238
257
  * Calculate scale based on current element size.
239
258
  * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.
240
259
  */
241
260
  _updateScaleFromCurrentSize() {
242
261
  requestAnimationFrame(() => {
243
- const containerWidth = this.clientWidth;
244
- if (containerWidth > 0) {
245
- this._scale = computeFixedAspectRatioScale({
246
- orientation: ExternalScaleOrientation.horizontal,
247
- containerMainAxisSize: containerWidth,
248
- scaleReferenceSize: this.scaleReferenceSize
249
- });
262
+ if (this._measureScale()) {
250
263
  this.requestUpdate();
251
264
  this.reportDimensions();
252
265
  }
@@ -256,17 +269,7 @@ var ObcBarHorizontal = class ObcBarHorizontal extends AdviceMixin(SetpointMixin(
256
269
  if (this.instrumentMode) return;
257
270
  const next = readExternalScaleBorderRadiusPx(this, this.scaleType);
258
271
  if (this._computedBorderRadius !== next) this._computedBorderRadius = next;
259
- if (this.fixedAspectRatio) {
260
- const rect = this.getBoundingClientRect();
261
- if (rect.width > 0) {
262
- this._scale = computeFixedAspectRatioScale({
263
- orientation: ExternalScaleOrientation.horizontal,
264
- containerMainAxisSize: rect.width,
265
- scaleReferenceSize: this.scaleReferenceSize
266
- });
267
- this.reportDimensions();
268
- }
269
- }
272
+ if (this.fixedAspectRatio && this._measureScale()) this.reportDimensions();
270
273
  }
271
274
  /**
272
275
  * Get the effective border radius to use.