@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.20 → 2.2.0-next.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/openbridge-webcomponents.bundle.js +156 -61
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +49 -21
- package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
- package/dist/automation/automation-tank/automation-tank.js +2 -1
- package/dist/automation/automation-tank/automation-tank.js.map +1 -1
- package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts +4 -2
- package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts.map +1 -1
- package/dist/building-blocks/bar-horizontal/bar-horizontal.js +12 -6
- package/dist/building-blocks/bar-horizontal/bar-horizontal.js.map +1 -1
- package/dist/building-blocks/bar-vertical/bar-vertical.d.ts +4 -2
- package/dist/building-blocks/bar-vertical/bar-vertical.d.ts.map +1 -1
- package/dist/building-blocks/bar-vertical/bar-vertical.js +12 -6
- package/dist/building-blocks/bar-vertical/bar-vertical.js.map +1 -1
- package/dist/building-blocks/external-scale/external-scale.d.ts +21 -3
- package/dist/building-blocks/external-scale/external-scale.d.ts.map +1 -1
- package/dist/building-blocks/external-scale/external-scale.js +40 -17
- package/dist/building-blocks/external-scale/external-scale.js.map +1 -1
- package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.d.ts +4 -2
- package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.d.ts.map +1 -1
- package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.js +14 -6
- package/dist/navigation-instruments/gauge-horizontal/gauge-horizontal.js.map +1 -1
- package/dist/navigation-instruments/gauge-vertical/gauge-vertical.d.ts +4 -2
- package/dist/navigation-instruments/gauge-vertical/gauge-vertical.d.ts.map +1 -1
- package/dist/navigation-instruments/gauge-vertical/gauge-vertical.js +14 -6
- package/dist/navigation-instruments/gauge-vertical/gauge-vertical.js.map +1 -1
- package/dist/navigation-instruments/heave/heave.d.ts.map +1 -1
- package/dist/navigation-instruments/heave/heave.js +14 -5
- package/dist/navigation-instruments/heave/heave.js.map +1 -1
- package/dist/navigation-instruments/watch/vessel.d.ts +2 -0
- package/dist/navigation-instruments/watch/vessel.d.ts.map +1 -1
- package/dist/navigation-instruments/watch/vessel.js +6 -0
- package/dist/navigation-instruments/watch/vessel.js.map +1 -1
- package/dist/navigation-instruments/watch/vessels/fish-cage-side.d.ts +3 -0
- package/dist/navigation-instruments/watch/vessels/fish-cage-side.d.ts.map +1 -0
- package/dist/navigation-instruments/watch/vessels/fish-cage-side.js +13 -0
- package/dist/navigation-instruments/watch/vessels/fish-cage-side.js.map +1 -0
- package/dist/navigation-instruments/watch/vessels/fish-cage-top.d.ts +3 -0
- package/dist/navigation-instruments/watch/vessels/fish-cage-top.d.ts.map +1 -0
- package/dist/navigation-instruments/watch/vessels/fish-cage-top.js +20 -0
- package/dist/navigation-instruments/watch/vessels/fish-cage-top.js.map +1 -0
- package/dist/svghelpers/advice-linear.d.ts +7 -0
- package/dist/svghelpers/advice-linear.d.ts.map +1 -1
- package/dist/svghelpers/advice-linear.js +14 -10
- package/dist/svghelpers/advice-linear.js.map +1 -1
- package/dist/svghelpers/advice-patterns.d.ts +2 -2
- package/dist/svghelpers/advice-patterns.d.ts.map +1 -1
- package/dist/svghelpers/advice-patterns.js +6 -4
- package/dist/svghelpers/advice-patterns.js.map +1 -1
- package/package.json +1 -1
- package/src/automation/automation-tank/automation-tank.ts +4 -0
- package/src/building-blocks/bar-horizontal/bar-horizontal-fixed-aspect.spec.ts +50 -0
- package/src/building-blocks/bar-horizontal/bar-horizontal.stories.ts +6 -0
- package/src/building-blocks/bar-horizontal/bar-horizontal.ts +22 -9
- package/src/building-blocks/bar-vertical/bar-vertical-dimensions.spec.ts +36 -0
- package/src/building-blocks/bar-vertical/bar-vertical-fixed-aspect.spec.ts +49 -0
- package/src/building-blocks/bar-vertical/bar-vertical.stories.ts +6 -0
- package/src/building-blocks/bar-vertical/bar-vertical.ts +22 -9
- package/src/building-blocks/external-scale/external-scale.spec.ts +151 -0
- package/src/building-blocks/external-scale/external-scale.stories.ts +6 -0
- package/src/building-blocks/external-scale/external-scale.ts +86 -40
- package/src/navigation-instruments/gauge-horizontal/gauge-horizontal.spec.ts +55 -0
- package/src/navigation-instruments/gauge-horizontal/gauge-horizontal.stories.ts +2 -0
- package/src/navigation-instruments/gauge-horizontal/gauge-horizontal.ts +24 -9
- package/src/navigation-instruments/gauge-trend/gauge-trend.stories.ts +25 -0
- package/src/navigation-instruments/gauge-vertical/gauge-vertical.spec.ts +55 -0
- package/src/navigation-instruments/gauge-vertical/gauge-vertical.stories.ts +2 -0
- package/src/navigation-instruments/gauge-vertical/gauge-vertical.ts +24 -9
- package/src/navigation-instruments/heave/heave.stories.ts +12 -1
- package/src/navigation-instruments/heave/heave.ts +23 -7
- package/src/navigation-instruments/pitch/pitch.stories.ts +13 -0
- package/src/navigation-instruments/roll/roll.stories.ts +13 -1
- package/src/navigation-instruments/watch/vessel.ts +6 -0
- package/src/navigation-instruments/watch/vessels/fish-cage-side.ts +10 -0
- package/src/navigation-instruments/watch/vessels/fish-cage-top.ts +17 -0
- package/src/svghelpers/advice-linear.ts +25 -11
- package/src/svghelpers/advice-patterns.ts +13 -5
|
@@ -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 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,K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AA,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 {\n ExternalScaleConfig,\n ExternalScaleLayoutConfig,\n} 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 last render's layout inputs, for the scale measurement. */\n private _layoutConfig?: ExternalScaleLayoutConfig;\n\n /** The drawing's height in viewBox units at a scale: the advice column is pixels, so it depends on it. */\n private _thicknessAt = (scale: number): number =>\n this._layoutConfig\n ? computeExternalScaleLayout({\n ...this._layoutConfig,\n fixedAspectRatioScale: scale,\n }).thickness\n : 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._thicknessAt,\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 fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1,\n instrumentMode: this.instrumentMode,\n highlightCurrentValue: this.highlightCurrentValue,\n };\n\n const layoutConfig = toExternalScaleLayoutConfig(config);\n const layout = computeExternalScaleLayout(layoutConfig);\n this._layoutConfig = layoutConfig;\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 fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1,\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._thicknessAt,\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":";;;;;;;;;;;;AAgJO,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,KAA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C,MAAM,OAAM,CAAC,CAAA,GAAA,iBAAA,WAAA,gBAAA,KAAA,CAAA;AAGvBA,WAAA,CAAA,MAAM,CAAA,GAAA,iBAAA,WAAA,yBAAA,KAAA,CAAA;AAgBNA,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;AA1H1B,mBAAAA,WAAA,CAAA,cAAc,oBAAoB,CAAA,GAAA,gBAAA"}
|
|
@@ -108,8 +108,10 @@ export declare class ObcBarVertical extends ObcBarVertical_base {
|
|
|
108
108
|
*/
|
|
109
109
|
scaleReferenceSize: number;
|
|
110
110
|
private _scale;
|
|
111
|
-
/** The
|
|
112
|
-
private
|
|
111
|
+
/** The last render's layout inputs, for the scale measurement. */
|
|
112
|
+
private _layoutConfig?;
|
|
113
|
+
/** The drawing's width in viewBox units at a scale: the advice column is pixels, so it depends on it. */
|
|
114
|
+
private _thicknessAt;
|
|
113
115
|
private _resizeController;
|
|
114
116
|
/** Show scale tickmarks */
|
|
115
117
|
hasScale: boolean;
|
|
@@ -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;
|
|
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;AAO/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,CAA2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AAO,CAAC,gBAAgB;cAqDL,gBAAgB;IAI1B,iBAAiB,IAAI,IAAI;IAezB,oBAAoB,IAAI,IAAI;IAMrC,OAAO,CAAC,0BAA0B;IASlC;;;;OAIG;IACH,OAAO,CAAC,4BAA4B;IAMpC;;OAEG;IACH,OAAO,CAAC,6BAA6B;IAMrC,yFAAyF;IACzF,OAAO,CAAC,aAAa;IAarB;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAWnC,OAAO,CAAC,8BAA8B;IAiBtC;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;CAelC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
|
|
@@ -23,7 +23,10 @@ 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.
|
|
26
|
+
this._thicknessAt = (scale) => this._layoutConfig ? computeExternalScaleLayout({
|
|
27
|
+
...this._layoutConfig,
|
|
28
|
+
fixedAspectRatioScale: scale
|
|
29
|
+
}).thickness : 0;
|
|
27
30
|
this._resizeController = new ResizeController(this, { callback: (entries) => {
|
|
28
31
|
if (!this.fixedAspectRatio) return;
|
|
29
32
|
const entry = entries[0];
|
|
@@ -33,7 +36,7 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
|
|
|
33
36
|
containerMainAxisSize: entry.contentRect.height,
|
|
34
37
|
containerCrossAxisSize: entry.contentRect.width,
|
|
35
38
|
scaleReferenceSize: this.scaleReferenceSize,
|
|
36
|
-
viewBoxThickness: this.
|
|
39
|
+
viewBoxThickness: this._thicknessAt
|
|
37
40
|
});
|
|
38
41
|
this.reportDimensions();
|
|
39
42
|
} });
|
|
@@ -118,11 +121,13 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
|
|
|
118
121
|
adviceEmphasis: this.adviceEmphasis,
|
|
119
122
|
adviceMaskPrefix: this._adviceMaskPrefix,
|
|
120
123
|
fixedAspectRatio: this.fixedAspectRatio,
|
|
124
|
+
fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1,
|
|
121
125
|
instrumentMode: this.instrumentMode,
|
|
122
126
|
highlightCurrentValue: this.highlightCurrentValue
|
|
123
127
|
};
|
|
124
|
-
const
|
|
125
|
-
|
|
128
|
+
const layoutConfig = toExternalScaleLayoutConfig(config);
|
|
129
|
+
const layout = computeExternalScaleLayout(layoutConfig);
|
|
130
|
+
this._layoutConfig = layoutConfig;
|
|
126
131
|
const parts = renderExternalScale(config);
|
|
127
132
|
const viewBox = computeExternalScaleViewBox({
|
|
128
133
|
orientation: config.orientation,
|
|
@@ -191,7 +196,8 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
|
|
|
191
196
|
advicePosition: this.advicePosition,
|
|
192
197
|
hasAdvice: !!this.advices && this.advices.length > 0,
|
|
193
198
|
hasAdviceIcon: !!this.advices?.some((a) => a.showIcon),
|
|
194
|
-
hasSetpoint: this.setpoint !== void 0 || this.newSetpoint !== void 0 || this.departingNewSetpoint !== void 0
|
|
199
|
+
hasSetpoint: this.setpoint !== void 0 || this.newSetpoint !== void 0 || this.departingNewSetpoint !== void 0,
|
|
200
|
+
fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1
|
|
195
201
|
});
|
|
196
202
|
const dimensions = this.fixedAspectRatio ? {
|
|
197
203
|
...baseDimensions,
|
|
@@ -249,7 +255,7 @@ var ObcBarVertical = class ObcBarVertical extends AdviceMixin(SetpointMixin(LitE
|
|
|
249
255
|
containerMainAxisSize: height,
|
|
250
256
|
containerCrossAxisSize: width,
|
|
251
257
|
scaleReferenceSize: this.scaleReferenceSize,
|
|
252
|
-
viewBoxThickness: this.
|
|
258
|
+
viewBoxThickness: this._thicknessAt
|
|
253
259
|
});
|
|
254
260
|
return true;
|
|
255
261
|
}
|
|
@@ -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 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,gBAA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CAAA;AAjH1B,iBAAAA,WAAA,CAAA,cAAc,kBAAkB,CAAA,GAAA,cAAA"}
|
|
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 {\n ExternalScaleConfig,\n ExternalScaleLayoutConfig,\n} 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 last render's layout inputs, for the scale measurement. */\n private _layoutConfig?: ExternalScaleLayoutConfig;\n\n /** The drawing's width in viewBox units at a scale: the advice column is pixels, so it depends on it. */\n private _thicknessAt = (scale: number): number =>\n this._layoutConfig\n ? computeExternalScaleLayout({\n ...this._layoutConfig,\n fixedAspectRatioScale: scale,\n }).thickness\n : 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._thicknessAt,\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 fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1,\n instrumentMode: this.instrumentMode,\n highlightCurrentValue: this.highlightCurrentValue,\n };\n\n const layoutConfig = toExternalScaleLayoutConfig(config);\n const layout = computeExternalScaleLayout(layoutConfig);\n this._layoutConfig = layoutConfig;\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 fixedAspectRatioScale: this.fixedAspectRatio ? this._scale : 1,\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._thicknessAt,\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":";;;;;;;;;;;;AAqIO,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;EAMO,KAAA,gBAAA,UACtB,KAAK,gBACD,2BAA2B;GACzB,GAAG,KAAK;GACR,uBAAuB;EACzB,CAAC,CAAC,CAAC,YACH;EAIsB,KAAA,oBAAA,IAAI,iBAAiB,MAAM,EACrD,WAAW,YAAY;GACrB,IAAI,CAAC,KAAK,kBAAkB;GAE5B,MAAM,QAAQ,QAAQ;GACtB,IAAI,CAAC,OA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AA,WAAA,WAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,WAAA,KAAA,CAAA;AACvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,SAAA,KAAA,CAAA;AAEvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,SAAA,KAAA,CAAA;AAGvBA,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,kBAAA,KAAA,CAAA;AAKvBA,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,eAAA,WAAA,yBAAA,KAAA,CAAA;AA1H1B,iBAAAA,WAAA,CAAA,cAAc,kBAAkB,CAAA,GAAA,cAAA"}
|
|
@@ -286,6 +286,13 @@ export interface ExternalScaleConfig {
|
|
|
286
286
|
* @default 384
|
|
287
287
|
*/
|
|
288
288
|
scaleReferenceSize?: number;
|
|
289
|
+
/**
|
|
290
|
+
* The painted scale under `fixedAspectRatio`, which the wrapper measures
|
|
291
|
+
* from its host. The advice pill, its offset and its column are CSS pixels
|
|
292
|
+
* divided by it, so they keep one on-screen size while the bands scale;
|
|
293
|
+
* unset or 1 in pixel mode.
|
|
294
|
+
*/
|
|
295
|
+
fixedAspectRatioScale?: number;
|
|
289
296
|
/**
|
|
290
297
|
* When true, the component is used inside an instrument (e.g., gauge-trend).
|
|
291
298
|
* In this mode, only label font size responds to .obc-component-size-* CSS classes.
|
|
@@ -379,6 +386,13 @@ export type ExternalScaleLayoutConfig = Pick<ExternalScaleConfig, 'orientation'
|
|
|
379
386
|
* extra band so the marker is not clipped by the viewBox.
|
|
380
387
|
*/
|
|
381
388
|
hasSetpoint?: boolean;
|
|
389
|
+
/**
|
|
390
|
+
* The painted scale under `fixedAspectRatio` (1, the default, in pixel
|
|
391
|
+
* mode). The advice pill, its offset and the column reserved for it are CSS
|
|
392
|
+
* pixels divided by it, so they keep one on-screen size at every host size
|
|
393
|
+
* while the bar, tick and label bands scale with the drawing.
|
|
394
|
+
*/
|
|
395
|
+
fixedAspectRatioScale?: number;
|
|
382
396
|
};
|
|
383
397
|
export interface ExternalScaleViewBox {
|
|
384
398
|
x: number;
|
|
@@ -415,8 +429,12 @@ export interface FixedAspectRatioScaleConfig {
|
|
|
415
429
|
* `xMidYMid meet` does once the container is narrower than the drawing.
|
|
416
430
|
*/
|
|
417
431
|
containerCrossAxisSize?: number;
|
|
418
|
-
/**
|
|
419
|
-
|
|
432
|
+
/**
|
|
433
|
+
* The drawing's cross-axis size in viewBox units
|
|
434
|
+
* (`computeExternalScaleLayout().thickness`), or a function of the scale
|
|
435
|
+
* when part of it is pixel-fixed, as the advice column is.
|
|
436
|
+
*/
|
|
437
|
+
viewBoxThickness?: number | ((scale: number) => number);
|
|
420
438
|
}
|
|
421
439
|
/**
|
|
422
440
|
* Compute the scale factor for fixed aspect ratio mode.
|
|
@@ -484,7 +502,7 @@ export declare function computeExternalScaleLayout(config: ExternalScaleLayoutCo
|
|
|
484
502
|
* are off. The icon column follows the labels, so with labels it adds its
|
|
485
503
|
* box past the label band and without them it takes the labels' place.
|
|
486
504
|
*/
|
|
487
|
-
export declare function computeOutsideBarThickness(config: Pick<ExternalScaleLayoutConfig, 'hasBar' | 'hasScale' | 'labels' | 'labelThickness' | 'tickThickness' | 'scaleType' | 'hasAdvice' | 'hasAdviceIcon' | 'advicePosition' | 'hasSetpoint'>): number;
|
|
505
|
+
export declare function computeOutsideBarThickness(config: Pick<ExternalScaleLayoutConfig, 'hasBar' | 'hasScale' | 'labels' | 'labelThickness' | 'tickThickness' | 'scaleType' | 'hasAdvice' | 'hasAdviceIcon' | 'advicePosition' | 'hasSetpoint' | 'fixedAspectRatioScale'>): number;
|
|
488
506
|
/**
|
|
489
507
|
* Perpendicular band needed to keep a setpoint marker inside the viewBox
|
|
490
508
|
* when no scale/label bands reserve the space.
|
|
@@ -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,
|
|
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,EAGpB,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;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;CAC9C,CA6BA"}
|
|
@@ -307,9 +307,15 @@ function toExternalScaleLayoutConfig(config) {
|
|
|
307
307
|
advicePosition: config.advicePosition,
|
|
308
308
|
hasAdvice: !!config.advices && config.advices.length > 0,
|
|
309
309
|
hasAdviceIcon: !!config.advices?.some((a) => a.showIcon),
|
|
310
|
-
hasSetpoint: config.setpoint !== void 0 || config.newSetpoint !== void 0 || config.departingNewSetpoint !== void 0
|
|
310
|
+
hasSetpoint: config.setpoint !== void 0 || config.newSetpoint !== void 0 || config.departingNewSetpoint !== void 0,
|
|
311
|
+
fixedAspectRatioScale: config.fixedAspectRatioScale
|
|
311
312
|
};
|
|
312
313
|
}
|
|
314
|
+
/** ViewBox units per CSS pixel of the advice geometry: 1 outside fixedAspectRatio. */
|
|
315
|
+
function advicePx(config) {
|
|
316
|
+
const scale = config.fixedAspectRatioScale;
|
|
317
|
+
return scale !== void 0 && scale > 0 ? 1 / scale : 1;
|
|
318
|
+
}
|
|
313
319
|
/**
|
|
314
320
|
* Compute the outer SVG viewBox for a scale given layout.
|
|
315
321
|
* Wrappers can use this to avoid duplicating orientation-specific math.
|
|
@@ -367,9 +373,19 @@ function computeFixedAspectRatioScale(config) {
|
|
|
367
373
|
const { containerMainAxisSize, scaleReferenceSize, containerCrossAxisSize, viewBoxThickness } = config;
|
|
368
374
|
if (containerMainAxisSize <= 0 || scaleReferenceSize <= 0) return 1;
|
|
369
375
|
const mainScale = containerMainAxisSize / scaleReferenceSize;
|
|
370
|
-
|
|
371
|
-
if (containerCrossAxisSize
|
|
372
|
-
|
|
376
|
+
const thicknessAt = typeof viewBoxThickness === "function" ? viewBoxThickness : () => viewBoxThickness ?? 0;
|
|
377
|
+
if (containerCrossAxisSize === void 0 || containerCrossAxisSize <= 0 || thicknessAt(mainScale) <= 0) return mainScale;
|
|
378
|
+
if (containerCrossAxisSize + 1 >= thicknessAt(mainScale) * mainScale) return mainScale;
|
|
379
|
+
const meet = (thickness) => config.orientation === "vertical" ? computeMeetScale(thickness, scaleReferenceSize, containerCrossAxisSize, containerMainAxisSize) : computeMeetScale(scaleReferenceSize, thickness, containerMainAxisSize, containerCrossAxisSize);
|
|
380
|
+
const painted = (scale) => meet(thicknessAt(scale));
|
|
381
|
+
let lo = 0;
|
|
382
|
+
let hi = mainScale;
|
|
383
|
+
for (let i = 0; i < 48; i++) {
|
|
384
|
+
const mid = (lo + hi) / 2;
|
|
385
|
+
if (painted(mid) >= mid) lo = mid;
|
|
386
|
+
else hi = mid;
|
|
387
|
+
}
|
|
388
|
+
return lo > 0 ? lo : painted(mainScale);
|
|
373
389
|
}
|
|
374
390
|
/**
|
|
375
391
|
* The element's content box in CSS px: the box a `100%` × `100%` SVG child
|
|
@@ -440,8 +456,9 @@ function computeAdviceBandThickness(config) {
|
|
|
440
456
|
if (!config.hasAdvice) return 0;
|
|
441
457
|
const position = config.hasBar ? config.advicePosition ?? "inner" : "inner";
|
|
442
458
|
if (position === "center") return 0;
|
|
443
|
-
|
|
444
|
-
return
|
|
459
|
+
const px = advicePx(config);
|
|
460
|
+
if (position === "outer") return 24 * px;
|
|
461
|
+
return 16 * px;
|
|
445
462
|
}
|
|
446
463
|
/**
|
|
447
464
|
* The perpendicular band outside the bar: the tick and label bands, or the
|
|
@@ -1463,21 +1480,23 @@ function singleSidedTickmark(config, value, style, tickBase) {
|
|
|
1463
1480
|
}
|
|
1464
1481
|
/**
|
|
1465
1482
|
* The perpendicular coordinate of the advice band's near edge for the
|
|
1466
|
-
* configured position: `inner` sits on the tick band 4 off the bar edge,
|
|
1467
|
-
* `outer`
|
|
1468
|
-
* bar. Without a bar the band is always `inner`.
|
|
1483
|
+
* configured position: `inner` sits on the tick band 4 px off the bar edge,
|
|
1484
|
+
* `outer` 14 px off it, `center` in the middle of the bar; the same on
|
|
1485
|
+
* either side of the bar. Without a bar the band is always `inner`.
|
|
1469
1486
|
*/
|
|
1470
1487
|
function advicePerpStart(config) {
|
|
1471
1488
|
const tickBase = tickBasePerp(config);
|
|
1472
1489
|
const position = config.hasBar ? config.advicePosition : "inner";
|
|
1473
|
-
const
|
|
1490
|
+
const px = advicePx(config);
|
|
1491
|
+
const offset = 4 * px;
|
|
1474
1492
|
const outward = isOutwardPositive(config);
|
|
1475
1493
|
if (position === "center") {
|
|
1476
|
-
const centerOffset = config.barThickness / 2 - 4;
|
|
1477
|
-
return
|
|
1494
|
+
const centerOffset = config.barThickness / 2 - 4 * px;
|
|
1495
|
+
return outward ? centerOffset : -config.barThickness + centerOffset;
|
|
1478
1496
|
}
|
|
1479
|
-
if (position === "inner") return (outward ? tickBase : tickBase - 16) + offset;
|
|
1480
|
-
|
|
1497
|
+
if (position === "inner") return (outward ? tickBase : tickBase - 16 * px) + offset;
|
|
1498
|
+
const outerGap = 14 * px;
|
|
1499
|
+
return outward ? config.barThickness + outerGap : -config.barThickness - outerGap - 8 * px;
|
|
1481
1500
|
}
|
|
1482
1501
|
function renderAdvice(config, advice, maskId) {
|
|
1483
1502
|
const tickBase = tickBasePerp(config);
|
|
@@ -1507,18 +1526,22 @@ function renderAdvice(config, advice, maskId) {
|
|
|
1507
1526
|
if (advice.min > config.minValue) dash(advice.min);
|
|
1508
1527
|
if (!advice.point && advice.max < config.maxValue) dash(advice.max);
|
|
1509
1528
|
}
|
|
1529
|
+
const px = advicePx(config);
|
|
1510
1530
|
const marker = advice.point ? renderLinearAdvicePoint({
|
|
1511
1531
|
vertical,
|
|
1512
1532
|
main: mainStart,
|
|
1513
|
-
perpCenter: perpStart + 4,
|
|
1514
|
-
advice
|
|
1533
|
+
perpCenter: perpStart + 4 * px,
|
|
1534
|
+
advice,
|
|
1535
|
+
unitsPerPx: px
|
|
1515
1536
|
}) : renderLinearAdviceBand({
|
|
1516
1537
|
vertical,
|
|
1517
1538
|
mainStart,
|
|
1518
1539
|
mainEnd,
|
|
1519
1540
|
perpStart,
|
|
1541
|
+
thickness: 8 * px,
|
|
1520
1542
|
advice,
|
|
1521
|
-
maskId
|
|
1543
|
+
maskId,
|
|
1544
|
+
unitsPerPx: px
|
|
1522
1545
|
});
|
|
1523
1546
|
const icon = advice.showIcon ? renderLinearAdviceIcon({
|
|
1524
1547
|
vertical,
|