@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
@@ -1 +1 @@
1
- {"version":3,"file":"bar-horizontal.js","names":["_decorate"],"sources":["../../../src/building-blocks/bar-horizontal/bar-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 '../../navigation-instruments/types.js';\nimport {AdviceMixin} from '../../svghelpers/advice-mixin.js';\nimport {nextAdviceMaskId} from '../../svghelpers/advice.js';\nimport type {ExternalScaleConfig} from '../external-scale/external-scale.js';\nimport {\n computeExternalScaleViewBox,\n computeFixedAspectRatioScale,\n computeExternalScaleLayout,\n renderExternalScale,\n toExternalScaleLayoutConfig,\n computeScaleDimensionsForReport,\n computeExternalScaleEffectiveBarThickness,\n readExternalScaleBorderRadiusPx,\n startExternalScaleBorderRadiusObserver,\n ScaleType,\n FillMode,\n AdvicePosition,\n BarContainerStyle,\n ExternalScaleOrientation,\n ExternalScaleSide,\n} from '../external-scale/external-scale.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\n\n// Re-export shared enums for convenience\nexport {\n ScaleType,\n FillMode,\n AdvicePosition,\n FrameStyle,\n BorderRadiusPosition,\n InstrumentState,\n Priority,\n BarContainerStyle,\n ExternalScaleSide,\n};\n\n/**\n * Horizontal SVG bar + external scale.\n *\n * This is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\n *\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 more test cases (Auto at-setpoint detection, Manual at-setpoint control, Deadband tuning and Zero snap behavior) see: **Bars and Graphs/Bar Vertical**.\n *\n * Set `priority` to `Priority.enhanced` to use the blue/enhanced color palette\n * for bar fill and setpoint instead of the default gray/regular palette\n * (default: `Priority.regular`).\n *\n * @property minValue - Minimum scale value (manual mode)\n * @property maxValue - Maximum scale value (manual mode)\n * @property reverse - Plot `minValue` at the right so values grow leftward.\n * @property width - Total width in pixels (including padding bands)\n * @availableWhen width fixedAspectRatio==false\n * @property paddingLeft - Padding left of the drawing area\n * @property paddingRight - Padding right of the drawing area\n * @property side - Which side this scale lives on\n * @property fixedAspectRatio - 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 * @property scaleReferenceSize - 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 * @availableWhen scaleReferenceSize fixedAspectRatio==true\n * @property hasScale - Show scale tickmarks\n * @property showMainTickmarkLabels - Label the main tickmarks (min / 0 / max) instead of the\n * primary interval ladder, for a scale too short for a ladder. A chart sets it on its\n * slotted scales below its label threshold.\n * @availableWhen showMainTickmarkLabels showLabels==true\n * @property hasBar - Show bar\n * @property scaleBackground - Show background behind the scale tickmarks.\n * @property barContainerStyle - Bar container background style.\n * When undefined, defaults based on scaleBackground.\n * Set explicitly to override: 'primary' (lighter) or 'secondary' (gray).\n * @availableWhen barContainerStyle hasBar==true\n * @property barThickness - Bar/fill thickness in pixels\n * @availableWhen barThickness hasBar==true\n * @property tickThickness - Tickmark band thickness in pixels.\n * @availableWhen tickThickness hasScale==true\n * @property labelThickness - Label band thickness in pixels.\n * @availableWhen labelThickness showLabels==true\n * @property mainTickmarks - Array of values for main tickmarks. When undefined, no main tickmarks shown.\n * When empty array [], defaults to [minValue, 0, maxValue].\n * @availableWhen mainTickmarks hasScale==true\n * @property primaryTickmarkInterval - Interval for primary (longest) tickmarks with labels (minimum 1).\n * When undefined, no primary tickmarks are shown.\n * @availableWhen primaryTickmarkInterval hasScale==true || showLabels==true\n * @property secondaryTickmarkInterval - Interval for secondary (medium) tickmarks (minimum 1).\n * When undefined, no secondary tickmarks are shown.\n * @availableWhen secondaryTickmarkInterval hasScale==true\n * @property tertiaryTickmarkInterval - Interval for tertiary (shortest) tickmarks (minimum 1).\n * When undefined, no tertiary tickmarks are shown.\n * @availableWhen tertiaryTickmarkInterval hasScale==true\n * @property scaleType - Scale display mode: regular or condensed (shorter ticks)\n * @property frameStyle - Frame style: regular (4px gap for all), flat (main tickmarks touch edge), framed, or instrument\n * @availableWhen frameStyle hasScale==true && mainTickmarks!=undefined\n * @property borderRadiusPosition - Border radius position based on component layout\n * @availableWhen borderRadiusPosition hasBar==true\n * @property instrumentMode - When true, the component is used inside an instrument (e.g., gauge-trend).\n * In this mode, only label font size responds to .obc-component-size-* CSS classes.\n * Border radius and bar thickness use explicit values or defaults, not CSS variables.\n * @property borderRadius - Explicit border radius value in pixels.\n * When instrumentMode=true, this value is used directly (defaults to 8px for regular, 4px for condensed).\n * When instrumentMode=false, this is ignored and border radius is read from CSS variable.\n * @availableWhen borderRadius instrumentMode==true\n * @property priority - Color priority: enhanced uses blue instrument colors for bar fill and setpoint\n * @property fillMode - Fill visualization mode: fill or tint\n * @availableWhen fillMode hasBar==true && value!=undefined\n * @property fillMin - Minimum fill value for tint mode (defaults to 0)\n * @availableWhen fillMin hasBar==true && value!=undefined\n * @property fillMax - Maximum fill value for tint mode (defaults to value)\n * @availableWhen fillMax hasBar==true && value!=undefined\n * @property value - Current value (bar fill level)\n * @property state - Instrument state (affects colors and some marker behavior)\n * @property advicePosition - Advice overlay positioning: center (in bar), inner (covers minor ticks), outer (no overlap)\n * @availableWhen advicePosition hasBar==true\n * @property advices - Advice/alert overlays with state and positioning.\n * 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 * @fires {CustomEvent} scale-dimensions-changed - Fired when the scale's computed layout thickness changes; a parent chart listens for this to reserve space for the scale. It bubbles to the chart slot the scale sits in and does not leave the shadow root around it.\n * @beta\n */\n@customElement('obc-bar-horizontal')\nexport class ObcBarHorizontal 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 @property({type: Number}) width = 320;\n\n @property({type: Number}) paddingLeft: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: Number}) paddingRight: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: String}) side: ExternalScaleSide = ExternalScaleSide.bottom;\n\n @property({type: Boolean})\n fixedAspectRatio = false;\n\n @property({type: Number})\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 this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n\n // Report scaled dimensions to parent chart\n this.reportDimensions();\n },\n });\n\n // Bands (thickness)\n @property({type: Boolean, attribute: false}) hasScale = true;\n @property({type: Boolean, attribute: false}) showLabels = true;\n @property({type: Boolean}) showMainTickmarkLabels = false;\n @property({type: Boolean}) hasBar = false;\n @property({type: Boolean})\n scaleBackground = false;\n @property({type: String})\n barContainerStyle?: BarContainerStyle = undefined;\n @property({type: Number}) barThickness = 24;\n @property({type: Number}) tickThickness = 24;\n @property({type: Number}) labelThickness = 60;\n\n // Tick configuration\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 @property({type: String}) scaleType: ScaleType = ScaleType.regular;\n @property({type: String}) frameStyle: FrameStyle = FrameStyle.regular;\n @property({type: String})\n borderRadiusPosition?: BorderRadiusPosition = undefined;\n\n @property({type: Boolean})\n instrumentMode = false;\n\n @property({type: Number})\n borderRadius?: number = undefined;\n\n @state()\n private _computedBorderRadius?: number;\n\n private _borderRadiusObserver?: MutationObserver;\n\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _borderRadiusResizeController = new ResizeController(this, {\n callback: () => {\n // Skip CSS variable reading in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n }\n },\n });\n\n // Values\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 // Advice\n @property({type: String}) advicePosition: AdvicePosition =\n AdvicePosition.inner;\n // Mask ids are document-scoped, so each scale names its own.\n private readonly _adviceMaskPrefix = nextAdviceMaskId('bar');\n\n @property({type: Boolean}) highlightCurrentValue = false;\n\n override render() {\n // When fixedAspectRatio is true, use scaleReferenceSize for the viewBox length.\n // This makes the SVG render at the \"design reference size\" and then scale\n // proportionally to fit the actual container via preserveAspectRatio=\"xMidYMid meet\".\n // The _scale CSS variable counter-scales text labels to maintain constant visual size.\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\n\n // The parent chart component (chart-line-base) calculates and passes the correct\n // viewBox padding values when fixedAspectRatioScaling is enabled. The padding is\n // pre-scaled to: basePadding * scaleReferenceSize / referenceWidth\n // This ensures the visual padding matches the chart's Canvas padding at any aspect ratio.\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 mainTickmarkLabels: this.showMainTickmarkLabels,\n hasBar: this.hasBar,\n scaleBackground: this.scaleBackground,\n barContainerStyle: this.barContainerStyle,\n barThickness: this.barThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n borderRadius: this._getEffectiveBorderRadius(),\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 priority: this.priority,\n setpointOverride: this.setpointOverride,\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 advicePosition: this.advicePosition,\n advices: this.advices,\n adviceTrigger: this.adviceTrigger,\n adviceEmphasis: this.adviceEmphasis,\n adviceMaskPrefix: this._adviceMaskPrefix,\n fixedAspectRatio: this.fixedAspectRatio,\n instrumentMode: this.instrumentMode,\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: 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: ${this.fixedAspectRatio ? this._scale : 1};\"\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 updated(changed: PropertyValues) {\n super.updated(changed);\n\n if (changed.has('scaleType')) {\n this._refreshBorderRadiusFromCssVar();\n }\n\n // Update host styles when fixedAspectRatio changes\n if (changed.has('fixedAspectRatio')) {\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n // Force initial scale calculation based on current size\n this._updateScaleFromCurrentSize();\n } else {\n this._removeFixedAspectRatioStyles();\n this._scale = 1;\n }\n }\n\n // Also recalculate scale when scaleReferenceSize changes\n if (changed.has('scaleReferenceSize') && this.fixedAspectRatio) {\n this._updateScaleFromCurrentSize();\n }\n\n // Report dimensions to parent chart when layout-affecting properties change.\n // In fixedAspectRatio mode, resize events also trigger reportDimensions() via ResizeController.\n // In regular mode, we report on every update to keep parent chart in sync.\n // Layout-affecting properties change the computed thickness and must notify the parent\n // even in fixedAspectRatio mode to keep chart padding accurate.\n const layoutChanged =\n changed.has('side') ||\n changed.has('showLabels') ||\n changed.has('showMainTickmarkLabels') ||\n changed.has('hasScale') ||\n changed.has('hasBar') ||\n changed.has('barThickness') ||\n changed.has('tickThickness') ||\n changed.has('labelThickness') ||\n changed.has('scaleType') ||\n changed.has('borderRadiusPosition') ||\n changed.has('borderRadius') ||\n changed.has('advices') ||\n changed.has('advicePosition') ||\n this.setpointPresenceChanged(changed);\n\n if (!this.fixedAspectRatio || layoutChanged) {\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._getEffectiveBorderRadius(),\n scaleType: this.scaleType,\n });\n\n // Use scaleReferenceSize for layout calculation when in fixedAspectRatio mode\n // This ensures consistent layout dimensions based on the design reference size\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\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: effectiveLength,\n scaleType: this.scaleType,\n advicePosition: this.advicePosition,\n hasAdvice: !!this.advices && this.advices.length > 0,\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 // When fixedAspectRatio=true, the SVG scales proportionally via preserveAspectRatio=\"meet\".\n // The visual thickness = baseThickness × scale, where scale = containerSize / scaleReferenceSize.\n // Report the actual visual thickness so the chart can reserve the correct space.\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 // Only read from CSS variable and observe changes when not in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n this._startBorderRadiusObserver();\n }\n\n // Ensure the element fills its container when in fixedAspectRatio mode\n // Custom elements are display:inline by default, which doesn't work for percentage-based sizing\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n }\n }\n\n override disconnectedCallback(): void {\n this._borderRadiusObserver?.disconnect();\n this._borderRadiusObserver = undefined;\n super.disconnectedCallback();\n }\n\n private _startBorderRadiusObserver(): void {\n this._borderRadiusObserver?.disconnect();\n\n this._borderRadiusObserver = startExternalScaleBorderRadiusObserver(\n this,\n () => this._refreshBorderRadiusFromCssVar()\n );\n }\n\n /**\n * Apply CSS styles needed for fixedAspectRatio mode.\n * Custom elements are display:inline by default, which doesn't work with percentage-based sizing.\n * We need display:block and width:100% to fill the slot container.\n */\n private _applyFixedAspectRatioStyles(): void {\n this.style.display = 'block';\n this.style.width = '100%';\n this.style.height = 'auto';\n }\n\n /**\n * Remove fixed aspect ratio styles when switching back to pixel mode.\n */\n private _removeFixedAspectRatioStyles(): void {\n this.style.display = '';\n this.style.width = '';\n this.style.height = '';\n }\n\n /**\n * Calculate scale based on current element size.\n * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.\n */\n private _updateScaleFromCurrentSize(): void {\n // Use requestAnimationFrame to ensure layout is complete\n requestAnimationFrame(() => {\n const containerWidth = this.clientWidth;\n if (containerWidth > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize: containerWidth,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n this.requestUpdate();\n // Report updated dimensions to parent (matches pattern in ResizeController and _refreshBorderRadiusFromCssVar)\n this.reportDimensions();\n }\n });\n }\n\n private _refreshBorderRadiusFromCssVar(): void {\n // Skip CSS variable reading in instrument mode\n if (this.instrumentMode) return;\n\n const next = readExternalScaleBorderRadiusPx(this, this.scaleType);\n\n if (this._computedBorderRadius !== next) {\n this._computedBorderRadius = next;\n }\n\n // In fixed-aspect-ratio mode, recompute scale when border radius changes\n // (border radius affects effective bar thickness and therefore viewBox)\n if (this.fixedAspectRatio) {\n const rect = this.getBoundingClientRect();\n if (rect.width > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.horizontal,\n containerMainAxisSize: rect.width,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n // Report updated dimensions\n this.reportDimensions();\n }\n }\n }\n\n /**\n * Get the effective border radius to use.\n * In instrument mode: use explicit borderRadius prop or default based on scaleType.\n * In normal mode: use CSS variable computed value.\n */\n private _getEffectiveBorderRadius(): number {\n if (this.instrumentMode) {\n // In instrument mode, use explicit value or default\n if (this.borderRadius !== undefined) {\n return this.borderRadius;\n }\n // Default: 8px for regular, 4px for condensed\n return this.scaleType === ScaleType.condensed ? 4 : 8;\n }\n // Normal mode: use CSS variable computed value\n return (\n this._computedBorderRadius ??\n (this.scaleType === ScaleType.condensed ? 4 : 8)\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-bar-horizontal': ObcBarHorizontal;\n }\n}\n"],"mappings":";;;;;;;;;;;;AA4IO,IAAM,mBAAN,MAAM,yBAAyB,YACpC,cAAc,YAAY,EACxB,iBAAiB,EACnB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gBNA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,YAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,YAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,WAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,WAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,SAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,SAAA,KAAA,CAAA;AAGvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,kBAAA,KAAA,CAAA;AAKvBA,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,iBAAA,WAAA,yBAAA,KAAA,CAAA;AAhH1B,mBAAAA,WAAA,CAAA,cAAc,oBAAoB,CAAA,GAAA,gBAAA"}
1
+ {"version":3,"file":"bar-horizontal.js","names":["_decorate"],"sources":["../../../src/building-blocks/bar-horizontal/bar-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 '../../navigation-instruments/types.js';\nimport {AdviceMixin} from '../../svghelpers/advice-mixin.js';\nimport {nextAdviceMaskId} from '../../svghelpers/advice.js';\nimport type {ExternalScaleConfig} from '../external-scale/external-scale.js';\nimport {\n computeExternalScaleViewBox,\n computeFixedAspectRatioScale,\n computeExternalScaleLayout,\n renderExternalScale,\n toExternalScaleLayoutConfig,\n computeScaleDimensionsForReport,\n computeExternalScaleEffectiveBarThickness,\n readExternalScaleBorderRadiusPx,\n startExternalScaleBorderRadiusObserver,\n readContentBox,\n ScaleType,\n FillMode,\n AdvicePosition,\n BarContainerStyle,\n ExternalScaleOrientation,\n ExternalScaleSide,\n} from '../external-scale/external-scale.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\n\n// Re-export shared enums for convenience\nexport {\n ScaleType,\n FillMode,\n AdvicePosition,\n FrameStyle,\n BorderRadiusPosition,\n InstrumentState,\n Priority,\n BarContainerStyle,\n ExternalScaleSide,\n};\n\n/**\n * Horizontal SVG bar + external scale.\n *\n * This is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\n *\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 more test cases (Auto at-setpoint detection, Manual at-setpoint control, Deadband tuning and Zero snap behavior) see: **Bars and Graphs/Bar Vertical**.\n *\n * Set `priority` to `Priority.enhanced` to use the blue/enhanced color palette\n * for bar fill and setpoint instead of the default gray/regular palette\n * (default: `Priority.regular`).\n *\n * @property minValue - Minimum scale value (manual mode)\n * @property maxValue - Maximum scale value (manual mode)\n * @property reverse - Plot `minValue` at the right so values grow leftward.\n * @property width - Total width in pixels (including padding bands)\n * @availableWhen width fixedAspectRatio==false\n * @property paddingLeft - Padding left of the drawing area\n * @property paddingRight - Padding right of the drawing area\n * @property side - Which side this scale lives on\n * @property fixedAspectRatio - 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 * @property scaleReferenceSize - 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 * @availableWhen scaleReferenceSize fixedAspectRatio==true\n * @property hasScale - Show scale tickmarks\n * @property showMainTickmarkLabels - Label the main tickmarks (min / 0 / max) instead of the\n * primary interval ladder, for a scale too short for a ladder. A chart sets it on its\n * slotted scales below its label threshold.\n * @availableWhen showMainTickmarkLabels showLabels==true\n * @property hasBar - Show bar\n * @property scaleBackground - Show background behind the scale tickmarks.\n * @property barContainerStyle - Bar container background style.\n * When undefined, defaults based on scaleBackground.\n * Set explicitly to override: 'primary' (lighter) or 'secondary' (gray).\n * @availableWhen barContainerStyle hasBar==true\n * @property barThickness - Bar/fill thickness in pixels\n * @availableWhen barThickness hasBar==true\n * @property tickThickness - Tickmark band thickness in pixels.\n * @availableWhen tickThickness hasScale==true\n * @property labelThickness - Label band thickness in pixels.\n * @availableWhen labelThickness showLabels==true\n * @property mainTickmarks - Array of values for main tickmarks. When undefined, no main tickmarks shown.\n * When empty array [], defaults to [minValue, 0, maxValue].\n * @availableWhen mainTickmarks hasScale==true\n * @property primaryTickmarkInterval - Interval for primary (longest) tickmarks with labels (minimum 1).\n * When undefined, no primary tickmarks are shown.\n * @availableWhen primaryTickmarkInterval hasScale==true || showLabels==true\n * @property secondaryTickmarkInterval - Interval for secondary (medium) tickmarks (minimum 1).\n * When undefined, no secondary tickmarks are shown.\n * @availableWhen secondaryTickmarkInterval hasScale==true\n * @property tertiaryTickmarkInterval - Interval for tertiary (shortest) tickmarks (minimum 1).\n * When undefined, no tertiary tickmarks are shown.\n * @availableWhen tertiaryTickmarkInterval hasScale==true\n * @property scaleType - Scale display mode: regular or condensed (shorter ticks)\n * @property frameStyle - Frame style: regular (4px gap for all), flat (main tickmarks touch edge), framed, or instrument\n * @availableWhen frameStyle hasScale==true && mainTickmarks!=undefined\n * @property borderRadiusPosition - Border radius position based on component layout\n * @availableWhen borderRadiusPosition hasBar==true\n * @property instrumentMode - When true, the component is used inside an instrument (e.g., gauge-trend).\n * In this mode, only label font size responds to .obc-component-size-* CSS classes.\n * Border radius and bar thickness use explicit values or defaults, not CSS variables.\n * @property borderRadius - Explicit border radius value in pixels.\n * When instrumentMode=true, this value is used directly (defaults to 8px for regular, 4px for condensed).\n * When instrumentMode=false, this is ignored and border radius is read from CSS variable.\n * @availableWhen borderRadius instrumentMode==true\n * @property priority - Color priority: enhanced uses blue instrument colors for bar fill and setpoint\n * @property fillMode - Fill visualization mode: fill or tint\n * @availableWhen fillMode hasBar==true && value!=undefined\n * @property fillMin - Minimum fill value for tint mode (defaults to 0)\n * @availableWhen fillMin hasBar==true && value!=undefined\n * @property fillMax - Maximum fill value for tint mode (defaults to value)\n * @availableWhen fillMax hasBar==true && value!=undefined\n * @property value - Current value (bar fill level)\n * @property state - Instrument state (affects colors and some marker behavior)\n * @property advicePosition - Advice overlay positioning: center (in bar), inner (covers minor ticks), outer (no overlap)\n * @availableWhen advicePosition hasBar==true\n * @property advices - Advice/alert overlays with state and positioning.\n * 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 * @fires {CustomEvent} scale-dimensions-changed - Fired when the scale's computed layout thickness changes; a parent chart listens for this to reserve space for the scale. It bubbles to the chart slot the scale sits in and does not leave the shadow root around it.\n * @beta\n */\n@customElement('obc-bar-horizontal')\nexport class ObcBarHorizontal 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 @property({type: Number}) width = 320;\n\n @property({type: Number}) paddingLeft: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: Number}) paddingRight: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: String}) side: ExternalScaleSide = ExternalScaleSide.bottom;\n\n @property({type: Boolean})\n fixedAspectRatio = false;\n\n @property({type: Number})\n 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 this._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\n // Report scaled dimensions to parent chart\n this.reportDimensions();\n },\n });\n\n // Bands (thickness)\n @property({type: Boolean, attribute: false}) hasScale = true;\n @property({type: Boolean, attribute: false}) showLabels = true;\n @property({type: Boolean}) showMainTickmarkLabels = false;\n @property({type: Boolean}) hasBar = false;\n @property({type: Boolean})\n scaleBackground = false;\n @property({type: String})\n barContainerStyle?: BarContainerStyle = undefined;\n @property({type: Number}) barThickness = 24;\n @property({type: Number}) tickThickness = 24;\n @property({type: Number}) labelThickness = 60;\n\n // Tick configuration\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 @property({type: String}) scaleType: ScaleType = ScaleType.regular;\n @property({type: String}) frameStyle: FrameStyle = FrameStyle.regular;\n @property({type: String})\n borderRadiusPosition?: BorderRadiusPosition = undefined;\n\n @property({type: Boolean})\n instrumentMode = false;\n\n @property({type: Number})\n borderRadius?: number = undefined;\n\n @state()\n private _computedBorderRadius?: number;\n\n private _borderRadiusObserver?: MutationObserver;\n\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _borderRadiusResizeController = new ResizeController(this, {\n callback: () => {\n // Skip CSS variable reading in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n }\n },\n });\n\n // Values\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 // Advice\n @property({type: String}) advicePosition: AdvicePosition =\n AdvicePosition.inner;\n // Mask ids are document-scoped, so each scale names its own.\n private readonly _adviceMaskPrefix = nextAdviceMaskId('bar');\n\n @property({type: Boolean}) highlightCurrentValue = false;\n\n override render() {\n // When fixedAspectRatio is true, use scaleReferenceSize for the viewBox length.\n // This makes the SVG render at the \"design reference size\" and then scale\n // proportionally to fit the actual container via preserveAspectRatio=\"xMidYMid meet\".\n // The _scale CSS variable counter-scales text labels to maintain constant visual size.\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\n\n // The parent chart component (chart-line-base) calculates and passes the correct\n // viewBox padding values when fixedAspectRatioScaling is enabled. The padding is\n // pre-scaled to: basePadding * scaleReferenceSize / referenceWidth\n // This ensures the visual padding matches the chart's Canvas padding at any aspect ratio.\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 mainTickmarkLabels: this.showMainTickmarkLabels,\n hasBar: this.hasBar,\n scaleBackground: this.scaleBackground,\n barContainerStyle: this.barContainerStyle,\n barThickness: this.barThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n borderRadius: this._getEffectiveBorderRadius(),\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 priority: this.priority,\n setpointOverride: this.setpointOverride,\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 advicePosition: this.advicePosition,\n advices: this.advices,\n adviceTrigger: this.adviceTrigger,\n adviceEmphasis: this.adviceEmphasis,\n adviceMaskPrefix: this._adviceMaskPrefix,\n fixedAspectRatio: this.fixedAspectRatio,\n instrumentMode: this.instrumentMode,\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: ${this.fixedAspectRatio ? this._scale : 1};\"\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 updated(changed: PropertyValues) {\n super.updated(changed);\n\n if (changed.has('scaleType')) {\n this._refreshBorderRadiusFromCssVar();\n }\n\n // Update host styles when fixedAspectRatio changes\n if (changed.has('fixedAspectRatio')) {\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n // Force initial scale calculation based on current size\n this._updateScaleFromCurrentSize();\n } else {\n this._removeFixedAspectRatioStyles();\n this._scale = 1;\n }\n }\n\n // Also recalculate scale when scaleReferenceSize changes\n if (changed.has('scaleReferenceSize') && this.fixedAspectRatio) {\n this._updateScaleFromCurrentSize();\n }\n\n // Report dimensions to parent chart when layout-affecting properties change.\n // In fixedAspectRatio mode, resize events also trigger reportDimensions() via ResizeController.\n // In regular mode, we report on every update to keep parent chart in sync.\n // Layout-affecting properties change the computed thickness and must notify the parent\n // even in fixedAspectRatio mode to keep chart padding accurate.\n const layoutChanged =\n changed.has('side') ||\n changed.has('showLabels') ||\n changed.has('showMainTickmarkLabels') ||\n changed.has('hasScale') ||\n changed.has('hasBar') ||\n changed.has('barThickness') ||\n changed.has('tickThickness') ||\n changed.has('labelThickness') ||\n changed.has('scaleType') ||\n changed.has('borderRadiusPosition') ||\n changed.has('borderRadius') ||\n changed.has('advices') ||\n changed.has('advicePosition') ||\n this.setpointPresenceChanged(changed);\n\n if (!this.fixedAspectRatio || layoutChanged) {\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._getEffectiveBorderRadius(),\n scaleType: this.scaleType,\n });\n\n // Use scaleReferenceSize for layout calculation when in fixedAspectRatio mode\n // This ensures consistent layout dimensions based on the design reference size\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.width;\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: effectiveLength,\n scaleType: this.scaleType,\n advicePosition: this.advicePosition,\n hasAdvice: !!this.advices && this.advices.length > 0,\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 // When fixedAspectRatio=true, the SVG scales proportionally via preserveAspectRatio=\"meet\".\n // The visual thickness = baseThickness × scale, where scale = containerSize / scaleReferenceSize.\n // Report the actual visual thickness so the chart can reserve the correct space.\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 // Only read from CSS variable and observe changes when not in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n this._startBorderRadiusObserver();\n }\n\n // Ensure the element fills its container when in fixedAspectRatio mode\n // Custom elements are display:inline by default, which doesn't work for percentage-based sizing\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n }\n }\n\n override disconnectedCallback(): void {\n this._borderRadiusObserver?.disconnect();\n this._borderRadiusObserver = undefined;\n super.disconnectedCallback();\n }\n\n private _startBorderRadiusObserver(): void {\n this._borderRadiusObserver?.disconnect();\n\n this._borderRadiusObserver = startExternalScaleBorderRadiusObserver(\n this,\n () => this._refreshBorderRadiusFromCssVar()\n );\n }\n\n /**\n * Apply CSS styles needed for fixedAspectRatio mode.\n * Custom elements are display:inline by default, which doesn't work with percentage-based sizing.\n * We need display:block and width:100% to fill the slot container.\n */\n private _applyFixedAspectRatioStyles(): void {\n this.style.display = 'block';\n this.style.width = '100%';\n this.style.height = 'auto';\n }\n\n /**\n * Remove fixed aspect ratio styles when switching back to pixel mode.\n */\n private _removeFixedAspectRatioStyles(): void {\n this.style.display = '';\n this.style.width = '';\n this.style.height = '';\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 /**\n * Calculate scale based on current element size.\n * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.\n */\n private _updateScaleFromCurrentSize(): void {\n // Use requestAnimationFrame to ensure layout is complete\n requestAnimationFrame(() => {\n if (this._measureScale()) {\n this.requestUpdate();\n // Report updated dimensions to parent (matches pattern in ResizeController and _refreshBorderRadiusFromCssVar)\n this.reportDimensions();\n }\n });\n }\n\n private _refreshBorderRadiusFromCssVar(): void {\n // Skip CSS variable reading in instrument mode\n if (this.instrumentMode) return;\n\n const next = readExternalScaleBorderRadiusPx(this, this.scaleType);\n\n if (this._computedBorderRadius !== next) {\n this._computedBorderRadius = next;\n }\n\n // In fixed-aspect-ratio mode, recompute scale when border radius changes\n // (border radius affects effective bar thickness and therefore viewBox)\n if (this.fixedAspectRatio && this._measureScale()) {\n this.reportDimensions();\n }\n }\n\n /**\n * Get the effective border radius to use.\n * In instrument mode: use explicit borderRadius prop or default based on scaleType.\n * In normal mode: use CSS variable computed value.\n */\n private _getEffectiveBorderRadius(): number {\n if (this.instrumentMode) {\n // In instrument mode, use explicit value or default\n if (this.borderRadius !== undefined) {\n return this.borderRadius;\n }\n // Default: 8px for regular, 4px for condensed\n return this.scaleType === ScaleType.condensed ? 4 : 8;\n }\n // Normal mode: use CSS variable computed value\n return (\n this._computedBorderRadius ??\n (this.scaleType === ScaleType.condensed ? 4 : 8)\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-bar-horizontal': ObcBarHorizontal;\n }\n}\n"],"mappings":";;;;;;;;;;;;AA6IO,IAAM,mBAAN,MAAM,yBAAyB,YACpC,cAAc,YAAY,EACxB,iBAAiB,EACnB,CAAC,CACH,CAAC,CAAC;;;EACqC,KAAA,WAAA;EACA,KAAA,WAAA;EACA,KAAA,UAAA;EAEH,KAAA,QAAA;EAGhC,KAAA,cAAA,iBAAiB;EAGjB,KAAA,eAAA,iBAAiB;EAEiC,KAAA,OAAA,kBAAkB;EAGnD,KAAA,mBAAA;EAGE,KAAA,qBAAA;EAGJ,KAAA,SAAA;EAGW,KAAA,oBAAA;EAIA,KAAA,oBAAA,IAAI,iBAAiB,MAAM,EACrD,WAAW,YAAY;GACrB,IAAI,CAAC,KAAK,kBAAkB;GAE5B,MAAM,QAAQ,QAAQ;GACtB,IAAI,CAAC,OAAO;GAEZ,KAAK,SAAS,6BAA6B;IACzC,aAAa,yBAAyB;IACtC,uBAAuB,MAAM,YAAY;IACzC,wBAAwB,MAAM,YAAY;IAC1C,oBAAoB,KAAK;IACzB,kBAAkB,KAAK;GACzB,CAAC;GAGD,KAAK,iBAAiB;EACxB,EACF,CAAC;EAGuD,KAAA,WAAA;EACE,KAAA,aAAA;EACN,KAAA,yBAAA;EAChB,KAAA,SAAA;EAElB,KAAA,kBAAA;EAEsB,KAAA,oBAAA,KAAA;EACC,KAAA,eAAA;EACC,KAAA,gBAAA;EACC,KAAA,iBAAA;EAG2B,KAAA,gBAAA,CAAC;EACV,KAAA,0BAAA,KAAA;EACE,KAAA,4BAAA,KAAA;EACD,KAAA,2BAAA,KAAA;EACb,KAAA,YAAA,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A,GAAA,gBAAA"}
@@ -108,6 +108,8 @@ export declare class ObcBarVertical extends ObcBarVertical_base {
108
108
  */
109
109
  scaleReferenceSize: number;
110
110
  private _scale;
111
+ /** The drawing's width in viewBox units, kept from the last render for the scale measurement. */
112
+ private _viewBoxThickness;
111
113
  private _resizeController;
112
114
  /** Show scale tickmarks */
113
115
  hasScale: boolean;
@@ -219,6 +221,8 @@ export declare class ObcBarVertical extends ObcBarVertical_base {
219
221
  * Remove fixed aspect ratio styles when switching back to pixel mode.
220
222
  */
221
223
  private _removeFixedAspectRatioStyles;
224
+ /** Reads the host's content box into the scale; false while the host has no size yet. */
225
+ private _measureScale;
222
226
  /**
223
227
  * Calculate scale based on current element size.
224
228
  * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.
@@ -1 +1 @@
1
- {"version":3,"file":"bar-vertical.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/bar-vertical/bar-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,uCAAuC,CAAC;AAI/C,OAAO,EAUL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,iBAAiB,EAEjB,iBAAiB,EAClB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,GAClB,CAAC;;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH,qBACa,cAAe,SAAQ,mBAInC;IAC2B,QAAQ,SAAK;IACb,QAAQ,SAAO;IACd,OAAO,UAAS;IAEjB,MAAM,SAAO;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BAAgB;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;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAiBnC,OAAO,CAAC,8BAA8B;IA0BtC;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;CAelC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
1
+ {"version":3,"file":"bar-vertical.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/bar-vertical/bar-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,uCAAuC,CAAC;AAI/C,OAAO,EAWL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,iBAAiB,EAEjB,iBAAiB,EAClB,MAAM,qCAAqC,CAAC;AAI7C,OAAO,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,iBAAiB,EACjB,iBAAiB,GAClB,CAAC;;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH,qBACa,cAAe,SAAQ,mBAInC;IAC2B,QAAQ,SAAK;IACb,QAAQ,SAAO;IACd,OAAO,UAAS;IAEjB,MAAM,SAAO;IAEb,UAAU,EAAE,MAAM,CACV;IAER,aAAa,EAAE,MAAM,CACb;IAER,IAAI,EAAE,iBAAiB,CAA2B;IAG5E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AAI;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,kBAAkB,EAAE,cAAc,CAAC;KACpC;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 ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
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.height;
31
31
  this._scale = computeFixedAspectRatioScale({
32
32
  orientation: ExternalScaleOrientation.vertical,
33
- containerMainAxisSize,
34
- scaleReferenceSize: this.scaleReferenceSize
33
+ containerMainAxisSize: entry.contentRect.height,
34
+ containerCrossAxisSize: entry.contentRect.width,
35
+ scaleReferenceSize: this.scaleReferenceSize,
36
+ viewBoxThickness: this._viewBoxThickness
35
37
  });
36
38
  this.reportDimensions();
37
39
  } });
@@ -120,6 +122,7 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
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 ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
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 ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
234
240
  this.style.height = "";
235
241
  this.style.width = "";
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 (height <= 0) return false;
247
+ this._scale = computeFixedAspectRatioScale({
248
+ orientation: ExternalScaleOrientation.vertical,
249
+ containerMainAxisSize: height,
250
+ containerCrossAxisSize: width,
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 containerHeight = this.clientHeight;
244
- if (containerHeight > 0) {
245
- this._scale = computeFixedAspectRatioScale({
246
- orientation: ExternalScaleOrientation.vertical,
247
- containerMainAxisSize: containerHeight,
248
- scaleReferenceSize: this.scaleReferenceSize
249
- });
262
+ if (this._measureScale()) {
250
263
  this.requestUpdate();
251
264
  this.reportDimensions();
252
265
  }
@@ -256,17 +269,7 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
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.height > 0) {
262
- this._scale = computeFixedAspectRatioScale({
263
- orientation: ExternalScaleOrientation.vertical,
264
- containerMainAxisSize: rect.height,
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.
@@ -1 +1 @@
1
- {"version":3,"file":"bar-vertical.js","names":["_decorate"],"sources":["../../../src/building-blocks/bar-vertical/bar-vertical.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 '../../navigation-instruments/types.js';\nimport {AdviceMixin} from '../../svghelpers/advice-mixin.js';\nimport {nextAdviceMaskId} from '../../svghelpers/advice.js';\nimport type {ExternalScaleConfig} from '../external-scale/external-scale.js';\nimport {\n computeExternalScaleViewBox,\n computeFixedAspectRatioScale,\n computeExternalScaleLayout,\n renderExternalScale,\n toExternalScaleLayoutConfig,\n computeScaleDimensionsForReport,\n computeExternalScaleEffectiveBarThickness,\n readExternalScaleBorderRadiusPx,\n startExternalScaleBorderRadiusObserver,\n ScaleType,\n FillMode,\n AdvicePosition,\n BarContainerStyle,\n ExternalScaleOrientation,\n ExternalScaleSide,\n} from '../external-scale/external-scale.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\n\n// Re-export shared enums for convenience\nexport {\n ScaleType,\n FillMode,\n AdvicePosition,\n FrameStyle,\n BorderRadiusPosition,\n InstrumentState,\n Priority,\n BarContainerStyle,\n ExternalScaleSide,\n};\n\n/**\n * Vertical SVG bar + external scale.\n *\n * This is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\n *\n * It sets up the outer `<svg>`/`viewBox` for a vertical scale and delegates rendering/layout to:\n * - `computeExternalScaleLayout(...)`\n * - `renderExternalScale(config)`\n *\n * For renderer documentation see: **Building Blocks/External Scale**.\n *\n * Set `priority` to `Priority.enhanced` to use the blue/enhanced color palette\n * for bar fill and setpoint instead of the default gray/regular palette\n * (default: `Priority.regular`).\n *\n * @property minValue - Minimum scale value (manual mode)\n * @property maxValue - Maximum scale value (manual mode)\n * @property reverse - Plot `minValue` at the top so values grow downward.\n * @property height - Total height in pixels (including padding bands)\n * @property paddingTop - Padding above the drawing area\n * @property paddingBottom - Padding below the drawing area\n * @property side - Which side this scale lives on\n * @property fixedAspectRatio - 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 * @property scaleReferenceSize - Reference size for proportional scaling when fixedAspectRatio is true.\n * At this height, the scale renders at native 1:1 (matches Figma design).\n * Above this height, the scale grows proportionally; below, it shrinks.\n * @availableWhen scaleReferenceSize fixedAspectRatio==true\n * @property hasScale - Show scale tickmarks\n * @property showMainTickmarkLabels - Label the main tickmarks (min / 0 / max) instead of the\n * primary interval ladder, for a scale too short for a ladder. A chart sets it on its\n * slotted scales below its label threshold.\n * @availableWhen showMainTickmarkLabels showLabels==true\n * @property hasBar - Show bar\n * @property scaleBackground - Show background behind the scale tickmarks.\n * @property barContainerStyle - Bar container background style.\n * When undefined, defaults based on scaleBackground.\n * Set explicitly to override: 'primary' (lighter) or 'secondary' (gray).\n * @availableWhen barContainerStyle hasBar==true\n * @property barThickness - Bar/fill thickness in pixels\n * @property tickThickness - Tickmark band thickness in pixels.\n * @property labelThickness - Label band thickness in pixels.\n * @property mainTickmarks - Array of values for main tickmarks. When undefined, no main tickmarks shown.\n * When empty array [], defaults to [minValue, 0, maxValue].\n * @property primaryTickmarkInterval - Interval for primary (longest) tickmarks with labels (minimum 1).\n * When undefined, no primary tickmarks are shown.\n * @property secondaryTickmarkInterval - Interval for secondary (medium) tickmarks (minimum 1).\n * When undefined, no secondary tickmarks are shown.\n * @property tertiaryTickmarkInterval - Interval for tertiary (shortest) tickmarks (minimum 1).\n * When undefined, no tertiary tickmarks are shown.\n * @property scaleType - Scale display mode: regular or condensed (shorter ticks)\n * @property frameStyle - Frame style: regular (4px gap for all), flat (main tickmarks touch edge), framed, or instrument\n * @property borderRadiusPosition - Border radius position based on component layout\n * @availableWhen borderRadiusPosition hasBar==true\n * @property instrumentMode - When true, the component is used inside an instrument (e.g., gauge-trend).\n * In this mode, only label font size responds to .obc-component-size-* CSS classes.\n * Border radius and bar thickness use explicit values or defaults, not CSS variables.\n * @property borderRadius - Explicit border radius value in pixels.\n * When instrumentMode=true, this value is used directly (defaults to 8px for regular, 4px for condensed).\n * When instrumentMode=false, this is ignored and border radius is read from CSS variable.\n * @availableWhen borderRadius instrumentMode==true\n * @property priority - Color priority: enhanced uses blue instrument colors for bar fill and setpoint\n * @property fillMode - Fill visualization mode: fill or tint\n * @availableWhen fillMode hasBar==true && value!=undefined\n * @property fillMin - Minimum fill value for tint mode (defaults to 0)\n * @availableWhen fillMin hasBar==true && value!=undefined\n * @property fillMax - Maximum fill value for tint mode (defaults to value)\n * @availableWhen fillMax hasBar==true && value!=undefined\n * @property value - Current value (bar fill level)\n * @property state - Instrument state (affects colors and some marker behavior)\n * @property advicePosition - Advice overlay positioning: center (in bar), inner (covers minor ticks), outer (no overlap)\n * @availableWhen advicePosition hasBar==true\n * @property advices - Advice/alert overlays with state and positioning.\n * 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 * @fires {CustomEvent} scale-dimensions-changed - Fired when the scale's computed layout thickness changes; a parent chart listens for this to reserve space for the scale. It bubbles to the chart slot the scale sits in and does not leave the shadow root around it.\n * @beta\n */\n@customElement('obc-bar-vertical')\nexport class ObcBarVertical 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 @property({type: Number}) height = 320;\n\n @property({type: Number}) paddingTop: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: Number}) paddingBottom: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: String}) side: ExternalScaleSide = ExternalScaleSide.right;\n\n @property({type: Boolean})\n fixedAspectRatio = false;\n\n @property({type: Number})\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 vertical scales, compare container height to reference size\n const containerMainAxisSize = entry.contentRect.height;\n\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.vertical,\n containerMainAxisSize,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n\n // Report scaled dimensions to parent chart\n this.reportDimensions();\n },\n });\n\n // Bands (thickness)\n @property({type: Boolean, attribute: false}) hasScale = true;\n @property({type: Boolean, attribute: false}) showLabels = true;\n @property({type: Boolean}) showMainTickmarkLabels = false;\n @property({type: Boolean}) hasBar = false;\n @property({type: Boolean})\n scaleBackground = false;\n @property({type: String})\n barContainerStyle?: BarContainerStyle = undefined;\n @property({type: Number}) barThickness = 24;\n @property({type: Number}) tickThickness = 24;\n @property({type: Number}) labelThickness = 60;\n\n // Tick configuration\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 @property({type: String}) scaleType: ScaleType = ScaleType.regular;\n @property({type: String}) frameStyle: FrameStyle = FrameStyle.regular;\n @property({type: String})\n borderRadiusPosition?: BorderRadiusPosition = undefined;\n\n @property({type: Boolean})\n instrumentMode = false;\n\n @property({type: Number})\n borderRadius?: number = undefined;\n\n @state()\n private _computedBorderRadius?: number;\n\n private _borderRadiusObserver?: MutationObserver;\n\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _borderRadiusResizeController = new ResizeController(this, {\n callback: () => {\n // Skip CSS variable reading in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n }\n },\n });\n\n // Values\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 // Advice\n @property({type: String}) advicePosition: AdvicePosition =\n AdvicePosition.inner;\n // Mask ids are document-scoped, so each scale names its own.\n private readonly _adviceMaskPrefix = nextAdviceMaskId('bar');\n\n @property({type: Boolean}) highlightCurrentValue = false;\n\n override render() {\n // When fixedAspectRatio is true, use scaleReferenceSize for the viewBox length.\n // This makes the SVG render at the \"design reference size\" and then scale\n // proportionally to fit the actual container via preserveAspectRatio=\"xMidYMid meet\".\n // The _scale CSS variable counter-scales text labels to maintain constant visual size.\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.height;\n\n // The parent chart component (chart-line-base) calculates and passes the correct\n // viewBox padding values when fixedAspectRatioScaling is enabled. The padding is\n // pre-scaled to: basePadding * scaleReferenceSize / referenceHeight\n // This ensures the visual padding matches the chart's Canvas padding at any aspect ratio.\n\n const config: ExternalScaleConfig = {\n orientation: ExternalScaleOrientation.vertical,\n side: this.side,\n length: effectiveLength,\n paddingStart: this.paddingTop,\n paddingEnd: this.paddingBottom,\n minValue: this.minValue,\n maxValue: this.maxValue,\n reverse: this.reverse,\n hasScale: this.hasScale,\n labels: this.showLabels,\n mainTickmarkLabels: this.showMainTickmarkLabels,\n hasBar: this.hasBar,\n scaleBackground: this.scaleBackground,\n barContainerStyle: this.barContainerStyle,\n barThickness: this.barThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n borderRadius: this._getEffectiveBorderRadius(),\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 priority: this.priority,\n setpointOverride: this.setpointOverride,\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 advicePosition: this.advicePosition,\n advices: this.advices,\n adviceTrigger: this.adviceTrigger,\n adviceEmphasis: this.adviceEmphasis,\n adviceMaskPrefix: this._adviceMaskPrefix,\n fixedAspectRatio: this.fixedAspectRatio,\n instrumentMode: this.instrumentMode,\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: 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%' : `${viewBox.width}px`}\n height=${this.fixedAspectRatio ? '100%' : `${this.height}px`}\n viewBox=\"${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}\"\n preserveAspectRatio=\"${preserveAspectRatio}\"\n style=\"--scale: ${this.fixedAspectRatio ? this._scale : 1};\"\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 updated(changed: PropertyValues) {\n super.updated(changed);\n\n if (changed.has('scaleType')) {\n this._refreshBorderRadiusFromCssVar();\n }\n\n // Update host styles when fixedAspectRatio changes\n if (changed.has('fixedAspectRatio')) {\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n // Force initial scale calculation based on current size\n this._updateScaleFromCurrentSize();\n } else {\n this._removeFixedAspectRatioStyles();\n this._scale = 1;\n }\n }\n\n // Also recalculate scale when scaleReferenceSize changes\n if (changed.has('scaleReferenceSize') && this.fixedAspectRatio) {\n this._updateScaleFromCurrentSize();\n }\n\n // Report dimensions to parent chart when layout-affecting properties change.\n // In fixedAspectRatio mode, resize events also trigger reportDimensions() via ResizeController.\n // In regular mode, we report on every update to keep parent chart in sync.\n // Layout-affecting properties change the computed thickness and must notify the parent\n // even in fixedAspectRatio mode to keep chart padding accurate.\n const layoutChanged =\n changed.has('side') ||\n changed.has('showLabels') ||\n changed.has('showMainTickmarkLabels') ||\n changed.has('hasScale') ||\n changed.has('hasBar') ||\n changed.has('barThickness') ||\n changed.has('tickThickness') ||\n changed.has('labelThickness') ||\n changed.has('scaleType') ||\n changed.has('borderRadiusPosition') ||\n changed.has('borderRadius') ||\n changed.has('advices') ||\n changed.has('advicePosition') ||\n this.setpointPresenceChanged(changed);\n\n if (!this.fixedAspectRatio || layoutChanged) {\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._getEffectiveBorderRadius(),\n scaleType: this.scaleType,\n });\n\n // Use scaleReferenceSize for layout calculation when in fixedAspectRatio mode\n // This ensures consistent layout dimensions based on the design reference size\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.height;\n\n const baseDimensions = computeScaleDimensionsForReport({\n orientation: ExternalScaleOrientation.vertical,\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: effectiveLength,\n scaleType: this.scaleType,\n advicePosition: this.advicePosition,\n hasAdvice: !!this.advices && this.advices.length > 0,\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 // When fixedAspectRatio=true, the SVG scales proportionally via preserveAspectRatio=\"meet\".\n // The visual thickness = baseThickness × scale, where scale = containerSize / scaleReferenceSize.\n // Report the actual visual thickness so the chart can reserve the correct space.\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 // Only read from CSS variable and observe changes when not in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n this._startBorderRadiusObserver();\n }\n\n // Ensure the element fills its container when in fixedAspectRatio mode\n // Custom elements are display:inline by default, which doesn't work for percentage-based sizing\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n }\n }\n\n override disconnectedCallback(): void {\n this._borderRadiusObserver?.disconnect();\n this._borderRadiusObserver = undefined;\n super.disconnectedCallback();\n }\n\n private _startBorderRadiusObserver(): void {\n this._borderRadiusObserver?.disconnect();\n\n this._borderRadiusObserver = startExternalScaleBorderRadiusObserver(\n this,\n () => this._refreshBorderRadiusFromCssVar()\n );\n }\n\n /**\n * Apply CSS styles needed for fixedAspectRatio mode.\n * Custom elements are display:inline by default, which doesn't work with percentage-based sizing.\n * We need display:block and height:100% to fill the slot container.\n */\n private _applyFixedAspectRatioStyles(): void {\n this.style.display = 'block';\n this.style.height = '100%';\n this.style.width = 'auto';\n }\n\n /**\n * Remove fixed aspect ratio styles when switching back to pixel mode.\n */\n private _removeFixedAspectRatioStyles(): void {\n this.style.display = '';\n this.style.height = '';\n this.style.width = '';\n }\n\n /**\n * Calculate scale based on current element size.\n * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.\n */\n private _updateScaleFromCurrentSize(): void {\n // Use requestAnimationFrame to ensure layout is complete\n requestAnimationFrame(() => {\n const containerHeight = this.clientHeight;\n if (containerHeight > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.vertical,\n containerMainAxisSize: containerHeight,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n this.requestUpdate();\n // Report updated dimensions to parent (matches pattern in ResizeController and _refreshBorderRadiusFromCssVar)\n this.reportDimensions();\n }\n });\n }\n\n private _refreshBorderRadiusFromCssVar(): void {\n // Skip CSS variable reading in instrument mode\n if (this.instrumentMode) return;\n\n const next = readExternalScaleBorderRadiusPx(this, this.scaleType);\n\n if (this._computedBorderRadius !== next) {\n this._computedBorderRadius = next;\n }\n\n // In fixed-aspect-ratio mode, recompute scale when border radius changes\n // (border radius affects effective bar thickness and therefore viewBox)\n if (this.fixedAspectRatio) {\n const rect = this.getBoundingClientRect();\n if (rect.height > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.vertical,\n containerMainAxisSize: rect.height,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n // Report updated dimensions\n this.reportDimensions();\n }\n }\n }\n\n /**\n * Get the effective border radius to use.\n * In instrument mode: use explicit borderRadius prop or default based on scaleType.\n * In normal mode: use CSS variable computed value.\n */\n private _getEffectiveBorderRadius(): number {\n if (this.instrumentMode) {\n // In instrument mode, use explicit value or default\n if (this.borderRadius !== undefined) {\n return this.borderRadius;\n }\n // Default: 8px for regular, 4px for condensed\n return this.scaleType === ScaleType.condensed ? 4 : 8;\n }\n // Normal mode: use CSS variable computed value\n return (\n this._computedBorderRadius ??\n (this.scaleType === ScaleType.condensed ? 4 : 8)\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-bar-vertical': ObcBarVertical;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAiIO,IAAM,iBAAN,MAAM,uBAAuB,YAClC,cAAc,YAAY,EACxB,iBAAiB,EACnB,CAAC,CACH,CAAC,CAAC;;;EACqC,KAAA,WAAA;EACA,KAAA,WAAA;EACA,KAAA,UAAA;EAEF,KAAA,SAAA;EAGjC,KAAA,aAAA,iBAAiB;EAGjB,KAAA,gBAAA,iBAAiB;EAEiC,KAAA,OAAA,kBAAkB;EAGnD,KAAA,mBAAA;EAGE,KAAA,qBAAA;EAGJ,KAAA,SAAA;EAIW,KAAA,oBAAA,IAAI,iBAAiB,MAAM,EACrD,WAAW,YAAY;GACrB,IAAI,CAAC,KAAK,kBAAkB;GAE5B,MAAM,QAAQ,QAAQ;GACtB,IAAI,CAAC,OAAO;GAIZ,MAAM,wBAAwB,MAAM,YAAY;GAEhD,KAAK,SAAS,6BAA6B;IACzC,aAAa,yBAAyB;IACtC;IACA,oBAAoB,KAAK;GAC3B,CAAC;GAGD,KAAK,iBAAiB;EACxB,EACF,CAAC;EAGuD,KAAA,WAAA;EACE,KAAA,aAAA;EACN,KAAA,yBAAA;EAChB,KAAA,SAAA;EAElB,KAAA,kBAAA;EAEsB,KAAA,oBAAA,KAAA;EACC,KAAA,eAAA;EACC,KAAA,gBAAA;EACC,KAAA,iBAAA;EAG2B,KAAA,gBAAA,CAAC;EACV,KAAA,0BAAA,KAAA;EACE,KAAA,4BAAA,KAAA;EACD,KAAA,2BAAA,KAAA;EACb,KAAA,YAAA,UAAU;EACR,KAAA,aAAA,WAAW;EAEh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itElement, 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 '../../navigation-instruments/types.js';\nimport {AdviceMixin} from '../../svghelpers/advice-mixin.js';\nimport {nextAdviceMaskId} from '../../svghelpers/advice.js';\nimport type {ExternalScaleConfig} from '../external-scale/external-scale.js';\nimport {\n computeExternalScaleViewBox,\n computeFixedAspectRatioScale,\n computeExternalScaleLayout,\n renderExternalScale,\n toExternalScaleLayoutConfig,\n computeScaleDimensionsForReport,\n computeExternalScaleEffectiveBarThickness,\n readExternalScaleBorderRadiusPx,\n startExternalScaleBorderRadiusObserver,\n readContentBox,\n ScaleType,\n FillMode,\n AdvicePosition,\n BarContainerStyle,\n ExternalScaleOrientation,\n ExternalScaleSide,\n} from '../external-scale/external-scale.js';\nimport {SetpointMixin} from '../../svghelpers/setpoint-mixin.js';\n\n// Re-export shared enums for convenience\nexport {\n ScaleType,\n FillMode,\n AdvicePosition,\n FrameStyle,\n BorderRadiusPosition,\n InstrumentState,\n Priority,\n BarContainerStyle,\n ExternalScaleSide,\n};\n\n/**\n * Vertical SVG bar + external scale.\n *\n * This is a thin web-component wrapper around the pure SVG building-block renderer in `external-scale.ts`.\n *\n * It sets up the outer `<svg>`/`viewBox` for a vertical scale and delegates rendering/layout to:\n * - `computeExternalScaleLayout(...)`\n * - `renderExternalScale(config)`\n *\n * For renderer documentation see: **Building Blocks/External Scale**.\n *\n * Set `priority` to `Priority.enhanced` to use the blue/enhanced color palette\n * for bar fill and setpoint instead of the default gray/regular palette\n * (default: `Priority.regular`).\n *\n * @property minValue - Minimum scale value (manual mode)\n * @property maxValue - Maximum scale value (manual mode)\n * @property reverse - Plot `minValue` at the top so values grow downward.\n * @property height - Total height in pixels (including padding bands)\n * @property paddingTop - Padding above the drawing area\n * @property paddingBottom - Padding below the drawing area\n * @property side - Which side this scale lives on\n * @property fixedAspectRatio - 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 * @property scaleReferenceSize - Reference size for proportional scaling when fixedAspectRatio is true.\n * At this height, the scale renders at native 1:1 (matches Figma design).\n * Above this height, the scale grows proportionally; below, it shrinks.\n * @availableWhen scaleReferenceSize fixedAspectRatio==true\n * @property hasScale - Show scale tickmarks\n * @property showMainTickmarkLabels - Label the main tickmarks (min / 0 / max) instead of the\n * primary interval ladder, for a scale too short for a ladder. A chart sets it on its\n * slotted scales below its label threshold.\n * @availableWhen showMainTickmarkLabels showLabels==true\n * @property hasBar - Show bar\n * @property scaleBackground - Show background behind the scale tickmarks.\n * @property barContainerStyle - Bar container background style.\n * When undefined, defaults based on scaleBackground.\n * Set explicitly to override: 'primary' (lighter) or 'secondary' (gray).\n * @availableWhen barContainerStyle hasBar==true\n * @property barThickness - Bar/fill thickness in pixels\n * @property tickThickness - Tickmark band thickness in pixels.\n * @property labelThickness - Label band thickness in pixels.\n * @property mainTickmarks - Array of values for main tickmarks. When undefined, no main tickmarks shown.\n * When empty array [], defaults to [minValue, 0, maxValue].\n * @property primaryTickmarkInterval - Interval for primary (longest) tickmarks with labels (minimum 1).\n * When undefined, no primary tickmarks are shown.\n * @property secondaryTickmarkInterval - Interval for secondary (medium) tickmarks (minimum 1).\n * When undefined, no secondary tickmarks are shown.\n * @property tertiaryTickmarkInterval - Interval for tertiary (shortest) tickmarks (minimum 1).\n * When undefined, no tertiary tickmarks are shown.\n * @property scaleType - Scale display mode: regular or condensed (shorter ticks)\n * @property frameStyle - Frame style: regular (4px gap for all), flat (main tickmarks touch edge), framed, or instrument\n * @property borderRadiusPosition - Border radius position based on component layout\n * @availableWhen borderRadiusPosition hasBar==true\n * @property instrumentMode - When true, the component is used inside an instrument (e.g., gauge-trend).\n * In this mode, only label font size responds to .obc-component-size-* CSS classes.\n * Border radius and bar thickness use explicit values or defaults, not CSS variables.\n * @property borderRadius - Explicit border radius value in pixels.\n * When instrumentMode=true, this value is used directly (defaults to 8px for regular, 4px for condensed).\n * When instrumentMode=false, this is ignored and border radius is read from CSS variable.\n * @availableWhen borderRadius instrumentMode==true\n * @property priority - Color priority: enhanced uses blue instrument colors for bar fill and setpoint\n * @property fillMode - Fill visualization mode: fill or tint\n * @availableWhen fillMode hasBar==true && value!=undefined\n * @property fillMin - Minimum fill value for tint mode (defaults to 0)\n * @availableWhen fillMin hasBar==true && value!=undefined\n * @property fillMax - Maximum fill value for tint mode (defaults to value)\n * @availableWhen fillMax hasBar==true && value!=undefined\n * @property value - Current value (bar fill level)\n * @property state - Instrument state (affects colors and some marker behavior)\n * @property advicePosition - Advice overlay positioning: center (in bar), inner (covers minor ticks), outer (no overlap)\n * @availableWhen advicePosition hasBar==true\n * @property advices - Advice/alert overlays with state and positioning.\n * 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 * @fires {CustomEvent} scale-dimensions-changed - Fired when the scale's computed layout thickness changes; a parent chart listens for this to reserve space for the scale. It bubbles to the chart slot the scale sits in and does not leave the shadow root around it.\n * @beta\n */\n@customElement('obc-bar-vertical')\nexport class ObcBarVertical 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 @property({type: Number}) height = 320;\n\n @property({type: Number}) paddingTop: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: Number}) paddingBottom: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: String}) side: ExternalScaleSide = ExternalScaleSide.right;\n\n @property({type: Boolean})\n fixedAspectRatio = false;\n\n @property({type: Number})\n scaleReferenceSize = 384;\n\n @state()\n private _scale = 1;\n\n /** The drawing's width 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 this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.vertical,\n containerMainAxisSize: entry.contentRect.height,\n containerCrossAxisSize: entry.contentRect.width,\n scaleReferenceSize: this.scaleReferenceSize,\n viewBoxThickness: this._viewBoxThickness,\n });\n\n // Report scaled dimensions to parent chart\n this.reportDimensions();\n },\n });\n\n // Bands (thickness)\n @property({type: Boolean, attribute: false}) hasScale = true;\n @property({type: Boolean, attribute: false}) showLabels = true;\n @property({type: Boolean}) showMainTickmarkLabels = false;\n @property({type: Boolean}) hasBar = false;\n @property({type: Boolean})\n scaleBackground = false;\n @property({type: String})\n barContainerStyle?: BarContainerStyle = undefined;\n @property({type: Number}) barThickness = 24;\n @property({type: Number}) tickThickness = 24;\n @property({type: Number}) labelThickness = 60;\n\n // Tick configuration\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 @property({type: String}) scaleType: ScaleType = ScaleType.regular;\n @property({type: String}) frameStyle: FrameStyle = FrameStyle.regular;\n @property({type: String})\n borderRadiusPosition?: BorderRadiusPosition = undefined;\n\n @property({type: Boolean})\n instrumentMode = false;\n\n @property({type: Number})\n borderRadius?: number = undefined;\n\n @state()\n private _computedBorderRadius?: number;\n\n private _borderRadiusObserver?: MutationObserver;\n\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _borderRadiusResizeController = new ResizeController(this, {\n callback: () => {\n // Skip CSS variable reading in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n }\n },\n });\n\n // Values\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 // Advice\n @property({type: String}) advicePosition: AdvicePosition =\n AdvicePosition.inner;\n // Mask ids are document-scoped, so each scale names its own.\n private readonly _adviceMaskPrefix = nextAdviceMaskId('bar');\n\n @property({type: Boolean}) highlightCurrentValue = false;\n\n override render() {\n // When fixedAspectRatio is true, use scaleReferenceSize for the viewBox length.\n // This makes the SVG render at the \"design reference size\" and then scale\n // proportionally to fit the actual container via preserveAspectRatio=\"xMidYMid meet\".\n // The _scale CSS variable counter-scales text labels to maintain constant visual size.\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.height;\n\n // The parent chart component (chart-line-base) calculates and passes the correct\n // viewBox padding values when fixedAspectRatioScaling is enabled. The padding is\n // pre-scaled to: basePadding * scaleReferenceSize / referenceHeight\n // This ensures the visual padding matches the chart's Canvas padding at any aspect ratio.\n\n const config: ExternalScaleConfig = {\n orientation: ExternalScaleOrientation.vertical,\n side: this.side,\n length: effectiveLength,\n paddingStart: this.paddingTop,\n paddingEnd: this.paddingBottom,\n minValue: this.minValue,\n maxValue: this.maxValue,\n reverse: this.reverse,\n hasScale: this.hasScale,\n labels: this.showLabels,\n mainTickmarkLabels: this.showMainTickmarkLabels,\n hasBar: this.hasBar,\n scaleBackground: this.scaleBackground,\n barContainerStyle: this.barContainerStyle,\n barThickness: this.barThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n borderRadius: this._getEffectiveBorderRadius(),\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 priority: this.priority,\n setpointOverride: this.setpointOverride,\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 advicePosition: this.advicePosition,\n advices: this.advices,\n adviceTrigger: this.adviceTrigger,\n adviceEmphasis: this.adviceEmphasis,\n adviceMaskPrefix: this._adviceMaskPrefix,\n fixedAspectRatio: this.fixedAspectRatio,\n instrumentMode: this.instrumentMode,\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%' : `${viewBox.width}px`}\n height=${this.fixedAspectRatio ? '100%' : `${this.height}px`}\n viewBox=\"${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}\"\n preserveAspectRatio=\"${preserveAspectRatio}\"\n style=\"--scale: ${this.fixedAspectRatio ? this._scale : 1};\"\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 updated(changed: PropertyValues) {\n super.updated(changed);\n\n if (changed.has('scaleType')) {\n this._refreshBorderRadiusFromCssVar();\n }\n\n // Update host styles when fixedAspectRatio changes\n if (changed.has('fixedAspectRatio')) {\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n // Force initial scale calculation based on current size\n this._updateScaleFromCurrentSize();\n } else {\n this._removeFixedAspectRatioStyles();\n this._scale = 1;\n }\n }\n\n // Also recalculate scale when scaleReferenceSize changes\n if (changed.has('scaleReferenceSize') && this.fixedAspectRatio) {\n this._updateScaleFromCurrentSize();\n }\n\n // Report dimensions to parent chart when layout-affecting properties change.\n // In fixedAspectRatio mode, resize events also trigger reportDimensions() via ResizeController.\n // In regular mode, we report on every update to keep parent chart in sync.\n // Layout-affecting properties change the computed thickness and must notify the parent\n // even in fixedAspectRatio mode to keep chart padding accurate.\n const layoutChanged =\n changed.has('side') ||\n changed.has('showLabels') ||\n changed.has('showMainTickmarkLabels') ||\n changed.has('hasScale') ||\n changed.has('hasBar') ||\n changed.has('barThickness') ||\n changed.has('tickThickness') ||\n changed.has('labelThickness') ||\n changed.has('scaleType') ||\n changed.has('borderRadiusPosition') ||\n changed.has('borderRadius') ||\n changed.has('advices') ||\n changed.has('advicePosition') ||\n this.setpointPresenceChanged(changed);\n\n if (!this.fixedAspectRatio || layoutChanged) {\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._getEffectiveBorderRadius(),\n scaleType: this.scaleType,\n });\n\n // Use scaleReferenceSize for layout calculation when in fixedAspectRatio mode\n // This ensures consistent layout dimensions based on the design reference size\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.height;\n\n const baseDimensions = computeScaleDimensionsForReport({\n orientation: ExternalScaleOrientation.vertical,\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: effectiveLength,\n scaleType: this.scaleType,\n advicePosition: this.advicePosition,\n hasAdvice: !!this.advices && this.advices.length > 0,\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 // When fixedAspectRatio=true, the SVG scales proportionally via preserveAspectRatio=\"meet\".\n // The visual thickness = baseThickness × scale, where scale = containerSize / scaleReferenceSize.\n // Report the actual visual thickness so the chart can reserve the correct space.\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 // Only read from CSS variable and observe changes when not in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n this._startBorderRadiusObserver();\n }\n\n // Ensure the element fills its container when in fixedAspectRatio mode\n // Custom elements are display:inline by default, which doesn't work for percentage-based sizing\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n }\n }\n\n override disconnectedCallback(): void {\n this._borderRadiusObserver?.disconnect();\n this._borderRadiusObserver = undefined;\n super.disconnectedCallback();\n }\n\n private _startBorderRadiusObserver(): void {\n this._borderRadiusObserver?.disconnect();\n\n this._borderRadiusObserver = startExternalScaleBorderRadiusObserver(\n this,\n () => this._refreshBorderRadiusFromCssVar()\n );\n }\n\n /**\n * Apply CSS styles needed for fixedAspectRatio mode.\n * Custom elements are display:inline by default, which doesn't work with percentage-based sizing.\n * We need display:block and height:100% to fill the slot container.\n */\n private _applyFixedAspectRatioStyles(): void {\n this.style.display = 'block';\n this.style.height = '100%';\n this.style.width = 'auto';\n }\n\n /**\n * Remove fixed aspect ratio styles when switching back to pixel mode.\n */\n private _removeFixedAspectRatioStyles(): void {\n this.style.display = '';\n this.style.height = '';\n this.style.width = '';\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 (height <= 0) return false;\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.vertical,\n containerMainAxisSize: height,\n containerCrossAxisSize: width,\n scaleReferenceSize: this.scaleReferenceSize,\n viewBoxThickness: this._viewBoxThickness,\n });\n return true;\n }\n\n /**\n * Calculate scale based on current element size.\n * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.\n */\n private _updateScaleFromCurrentSize(): void {\n // Use requestAnimationFrame to ensure layout is complete\n requestAnimationFrame(() => {\n if (this._measureScale()) {\n this.requestUpdate();\n // Report updated dimensions to parent (matches pattern in ResizeController and _refreshBorderRadiusFromCssVar)\n this.reportDimensions();\n }\n });\n }\n\n private _refreshBorderRadiusFromCssVar(): void {\n // Skip CSS variable reading in instrument mode\n if (this.instrumentMode) return;\n\n const next = readExternalScaleBorderRadiusPx(this, this.scaleType);\n\n if (this._computedBorderRadius !== next) {\n this._computedBorderRadius = next;\n }\n\n // In fixed-aspect-ratio mode, recompute scale when border radius changes\n // (border radius affects effective bar thickness and therefore viewBox)\n if (this.fixedAspectRatio && this._measureScale()) {\n this.reportDimensions();\n }\n }\n\n /**\n * Get the effective border radius to use.\n * In instrument mode: use explicit borderRadius prop or default based on scaleType.\n * In normal mode: use CSS variable computed value.\n */\n private _getEffectiveBorderRadius(): number {\n if (this.instrumentMode) {\n // In instrument mode, use explicit value or default\n if (this.borderRadius !== undefined) {\n return this.borderRadius;\n }\n // Default: 8px for regular, 4px for condensed\n return this.scaleType === ScaleType.condensed ? 4 : 8;\n }\n // Normal mode: use CSS variable computed value\n return (\n this._computedBorderRadius ??\n (this.scaleType === ScaleType.condensed ? 4 : 8)\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-bar-vertical': ObcBarVertical;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAkIO,IAAM,iBAAN,MAAM,uBAAuB,YAClC,cAAc,YAAY,EACxB,iBAAiB,EACnB,CAAC,CACH,CAAC,CAAC;;;EACqC,KAAA,WAAA;EACA,KAAA,WAAA;EACA,KAAA,UAAA;EAEF,KAAA,SAAA;EAGjC,KAAA,aAAA,iBAAiB;EAGjB,KAAA,gBAAA,iBAAiB;EAEiC,KAAA,OAAA,kBAAkB;EAGnD,KAAA,mBAAA;EAGE,KAAA,qBAAA;EAGJ,KAAA,SAAA;EAGW,KAAA,oBAAA;EAIA,KAAA,oBAAA,IAAI,iBAAiB,MAAM,EACrD,WAAW,YAAY;GACrB,IAAI,CAAC,KAAK,kBAAkB;GAE5B,MAAM,QAAQ,QAAQ;GACtB,IAAI,CAAC,OAAO;GAEZ,KAAK,SAAS,6BAA6B;IACzC,aAAa,yBAAyB;IACtC,uBAAuB,MAAM,YAAY;IACzC,wBAAwB,MAAM,YAAY;IAC1C,oBAAoB,KAAK;IACzB,kBAAkB,KAAK;GACzB,CAAC;GAGD,KAAK,iBAAiB;EACxB,EACF,CAAC;EAGuD,KAAA,WAAA;EACE,KAAA,aAAA;EACN,KAAA,yBAAA;EAChB,KAAA,SAAA;EAElB,KAAA,kBAAA;EAEsB,KAAA,oBAAA,KAAA;EACC,KAAA,eAAA;EACC,KAAA,gBAAA;EACC,KAAA,iBAAA;EAG2B,KAAA,gBAAA,CAAC;EACV,KAAA,0BAAA,KAAA;EACE,KAAA,4BAAA,KAAA;EACD,KAAA,2BAAA,KAAA;EACb,KAAA,YAAA,UAAU;EACR,KAAA,aAAA,WAAW;EAEhB,KAAA,uBAAA,KA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which the scale renders at 1:1 (default: 384) */
411
411
  scaleReferenceSize: number;
412
+ /**
413
+ * Cross-axis size of the container (width for vertical, height for
414
+ * horizontal). With `viewBoxThickness` it caps the scale the way
415
+ * `xMidYMid meet` does once the container is narrower than the drawing.
416
+ */
417
+ containerCrossAxisSize?: number;
418
+ /** The drawing's cross-axis size in viewBox units (`computeExternalScaleLayout().thickness`). */
419
+ viewBoxThickness?: number;
412
420
  }
413
421
  /**
414
422
  * Compute the scale factor for fixed aspect ratio mode.
@@ -422,14 +430,33 @@ export interface FixedAspectRatioScaleConfig {
422
430
  * This scale factor is applied to SVG rendering while keeping text labels at constant size
423
431
  * by using the CSS variable `--scale` to counter-scale font sizes.
424
432
  *
433
+ * The SVG is painted with `xMidYMid meet`, which takes the smaller of the two
434
+ * axes' ratios. Pass the container's cross-axis size and the drawing's
435
+ * thickness so the factor follows the paint when the cross axis is the limit;
436
+ * without them the main axis alone decides, as it does whenever the cross axis
437
+ * has room.
438
+ *
425
439
  * Works for all orientations and sides:
426
440
  * - Vertical scales (left/right): compare container height vs reference
427
441
  * - Horizontal scales (top/bottom): compare container width vs reference
428
442
  *
429
- * @param config Configuration with orientation, container size, and reference size
443
+ * @param config Configuration with orientation, container sizes, reference size and drawing thickness
430
444
  * @returns Scale factor (> 0), defaults to 1 if container size is invalid
431
445
  */
432
446
  export declare function computeFixedAspectRatioScale(config: FixedAspectRatioScaleConfig): number;
447
+ /**
448
+ * The element's content box in CSS px: the box a `100%` × `100%` SVG child
449
+ * fills, and what a ResizeObserver's `contentRect` reports. `clientWidth` /
450
+ * `clientHeight` include the padding, and `getBoundingClientRect()` is scaled
451
+ * by any ancestor CSS `zoom`, so neither is the box the drawing is painted in.
452
+ *
453
+ * @param el The host element
454
+ * @returns Content width and height in CSS px, 0 × 0 while the element has no layout box
455
+ */
456
+ export declare function readContentBox(el: HTMLElement): {
457
+ width: number;
458
+ height: number;
459
+ };
433
460
  /**
434
461
  * Compute scaled dimensions for reporting when in fixed aspect ratio mode.
435
462
  *
@@ -1 +1 @@
1
- {"version":3,"file":"external-scale.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/external-scale/external-scale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2HG;AACH,OAAO,EAAC,iBAAiB,EAAE,OAAO,EAAM,MAAM,KAAK,CAAC;AACpD,OAAO,EACL,eAAe,EACf,QAAQ,EACR,UAAU,EACV,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,aAAa,EAKb,KAAK,WAAW,EAChB,KAAK,cAAc,EAEpB,MAAM,4BAA4B,CAAC;AAiBpC,OAAO,EACL,mBAAmB,EAUpB,MAAM,8BAA8B,CAAC;AAGtC,6DAA6D;AAC7D,oBAAY,wBAAwB;IAClC,QAAQ,aAAa;IACrB,UAAU,eAAe;CAC1B;AAED,6DAA6D;AAC7D,oBAAY,iBAAiB;IAC3B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,MAAM,WAAW;CAClB;AAED,0BAA0B;AAC1B,oBAAY,SAAS;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;CACxB;AAED,8BAA8B;AAC9B,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,8BAA8B;AAC9B,oBAAY,cAAc;IACxB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,mEAAmE;IACnE,OAAO,YAAY;IACnB,sEAAsE;IACtE,SAAS,cAAc;CACxB;AAED,oFAAoF;AACpF,eAAO,MAAM,oCAAoC,kEACgB,CAAC;AAElE;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,OAA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jD,OAAO,EAAE,iBAAiB,GAAG,OAAO,OAAO,CAAC;IAC5C,eAAe,EAAE,iBAAiB,GAAG,OAAO,OAAO,CAAC;IACpD,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,cAAc,EAAE,iBAAiB,EAAE,CAAC;IACpC,eAAe,EAAE,iBAAiB,GAAG,OAAO,OAAO,CAAC;IACpD,QAAQ,EAAE,iBAAiB,GAAG,OAAO,OAAO,CAAC;CAC9C,CA6BA"}
1
+ {"version":3,"file":"external-scale.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/external-scale/external-scale.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2HG;AACH,OAAO,EAAC,iBAAiB,EAAE,OAAO,EAAM,MAAM,KAAK,CAAC;AACpD,OAAO,EACL,eAAe,EACf,QAAQ,EACR,UAAU,EACV,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,aAAa,EAKb,KAAK,WAAW,EAChB,KAAK,cAAc,EAEpB,MAAM,4BAA4B,CAAC;AAiBpC,OAAO,EACL,mBAAmB,EAUpB,MAAM,8BAA8B,CAAC;AAGtC,6DAA6D;AAC7D,oBAAY,wBAAwB;IAClC,QAAQ,aAAa;IACrB,UAAU,eAAe;CAC1B;AAED,6DAA6D;AAC7D,oBAAY,iBAAiB;IAC3B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,MAAM,WAAW;CAClB;AAED,0BAA0B;AAC1B,oBAAY,SAAS;IACnB,OAAO,YAAY;IACnB,SAAS,cAAc;CACxB;AAED,8BAA8B;AAC9B,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,8BAA8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AAa,CAAC,GACrD,MAAM,CAGR;AA6BD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,OAAO,CAAC;AA2C7C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CA2BrB;AA4GD,wBAAgB,eAAe,CAC7B,MAAM,EAAE,mBAAmB,EAC3B,KAAK,EAAE,MAAM,GACZ,MAAM,CAcR;AA+jDD;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,yBAAyB,GAChC;IAAC,IAAI,EAAE,iBAAiB,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAC,CAe9C;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG;IAChE,YAAY,EAAE,iBAAiB,GAAG,OAAO,OAAO,CAAC;IACjD,OAAO,EAAE,iBAAiB,GAAG,OAAO,OAAO,CAAC;IAC5C,eAAe,EAAE,iBAAiB,GAAG,OAAO,OAAO,CAAC;IACpD,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,cAAc,EAAE,iBAAiB,EAAE,CAAC;IACpC,eAAe,EAAE,iBAAiB,GAAG,OAAO,OAAO,CAAC;IACpD,QAAQ,EAAE,iBAAiB,GAAG,OAAO,OAAO,CAAC;CAC9C,CA6BA"}
@@ -350,17 +350,43 @@ function computeMeetScale(viewBoxWidth, viewBoxHeight, containerWidth, container
350
350
  * This scale factor is applied to SVG rendering while keeping text labels at constant size
351
351
  * by using the CSS variable `--scale` to counter-scale font sizes.
352
352
  *
353
+ * The SVG is painted with `xMidYMid meet`, which takes the smaller of the two
354
+ * axes' ratios. Pass the container's cross-axis size and the drawing's
355
+ * thickness so the factor follows the paint when the cross axis is the limit;
356
+ * without them the main axis alone decides, as it does whenever the cross axis
357
+ * has room.
358
+ *
353
359
  * Works for all orientations and sides:
354
360
  * - Vertical scales (left/right): compare container height vs reference
355
361
  * - Horizontal scales (top/bottom): compare container width vs reference
356
362
  *
357
- * @param config Configuration with orientation, container size, and reference size
363
+ * @param config Configuration with orientation, container sizes, reference size and drawing thickness
358
364
  * @returns Scale factor (> 0), defaults to 1 if container size is invalid
359
365
  */
360
366
  function computeFixedAspectRatioScale(config) {
361
- const { containerMainAxisSize, scaleReferenceSize } = config;
367
+ const { containerMainAxisSize, scaleReferenceSize, containerCrossAxisSize, viewBoxThickness } = config;
362
368
  if (containerMainAxisSize <= 0 || scaleReferenceSize <= 0) return 1;
363
- return containerMainAxisSize / scaleReferenceSize;
369
+ const mainScale = containerMainAxisSize / scaleReferenceSize;
370
+ if (containerCrossAxisSize === void 0 || containerCrossAxisSize <= 0 || viewBoxThickness === void 0 || viewBoxThickness <= 0) return mainScale;
371
+ if (containerCrossAxisSize + 1 >= viewBoxThickness * mainScale) return mainScale;
372
+ return config.orientation === "vertical" ? computeMeetScale(viewBoxThickness, scaleReferenceSize, containerCrossAxisSize, containerMainAxisSize) : computeMeetScale(scaleReferenceSize, viewBoxThickness, containerMainAxisSize, containerCrossAxisSize);
373
+ }
374
+ /**
375
+ * The element's content box in CSS px: the box a `100%` × `100%` SVG child
376
+ * fills, and what a ResizeObserver's `contentRect` reports. `clientWidth` /
377
+ * `clientHeight` include the padding, and `getBoundingClientRect()` is scaled
378
+ * by any ancestor CSS `zoom`, so neither is the box the drawing is painted in.
379
+ *
380
+ * @param el The host element
381
+ * @returns Content width and height in CSS px, 0 × 0 while the element has no layout box
382
+ */
383
+ function readContentBox(el) {
384
+ const style = getComputedStyle(el);
385
+ const px = (value) => parseFloat(value) || 0;
386
+ return {
387
+ width: el.clientWidth - px(style.paddingLeft) - px(style.paddingRight),
388
+ height: el.clientHeight - px(style.paddingTop) - px(style.paddingBottom)
389
+ };
364
390
  }
365
391
  /**
366
392
  * Compute scaled dimensions for reporting when in fixed aspect ratio mode.
@@ -1563,6 +1589,6 @@ function renderExternalScale(config) {
1563
1589
  setpoint: setpointMarker(effectiveConfig)
1564
1590
  };
1565
1591
  }
1566
- export { AdvicePosition, BarContainerStyle, EXTERNAL_SCALE_BORDER_RADIUS_CSS_VAR, EXTERNAL_SCALE_MAX_TICKS, ExternalScaleOrientation, ExternalScaleSide, FillMode, ScaleType, computeExternalScaleEffectiveBarThickness, computeExternalScaleEffectiveBorderRadiusPx, computeExternalScaleEffectiveTickThickness, computeExternalScaleLayout, computeExternalScaleViewBox, computeFixedAspectRatioScale, computeMeetScale, computeOutsideBarThickness, computeScaleDimensionsForReport, computeScaledThickness, computeSetpointBandThickness, defaultExternalScaleBorderRadiusPx, deriveSetpointVisualState, parseCssLengthToPx, readExternalScaleBorderRadiusPx, renderExternalScale, startExternalScaleBorderRadiusObserver, toExternalScaleLayoutConfig, valueToMainAxis };
1592
+ export { AdvicePosition, BarContainerStyle, EXTERNAL_SCALE_BORDER_RADIUS_CSS_VAR, EXTERNAL_SCALE_MAX_TICKS, ExternalScaleOrientation, ExternalScaleSide, FillMode, ScaleType, computeExternalScaleEffectiveBarThickness, computeExternalScaleEffectiveBorderRadiusPx, computeExternalScaleEffectiveTickThickness, computeExternalScaleLayout, computeExternalScaleViewBox, computeFixedAspectRatioScale, computeMeetScale, computeOutsideBarThickness, computeScaleDimensionsForReport, computeScaledThickness, computeSetpointBandThickness, defaultExternalScaleBorderRadiusPx, deriveSetpointVisualState, parseCssLengthToPx, readContentBox, readExternalScaleBorderRadiusPx, renderExternalScale, startExternalScaleBorderRadiusObserver, toExternalScaleLayoutConfig, valueToMainAxis };
1567
1593
 
1568
1594
  //# sourceMappingURL=external-scale.js.map