@oicl/openbridge-webcomponents 2.0.0-next.151 → 2.0.0-next.152
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 +989 -319
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +1643 -51
- package/dist/alert-severity.d.ts +12 -9
- package/dist/alert-severity.d.ts.map +1 -1
- package/dist/alert-severity.js +30 -38
- package/dist/alert-severity.js.map +1 -1
- package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts +10 -0
- package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts.map +1 -1
- package/dist/building-blocks/bar-horizontal/bar-horizontal.js +6 -1
- package/dist/building-blocks/bar-horizontal/bar-horizontal.js.map +1 -1
- package/dist/building-blocks/bar-vertical/bar-vertical.d.ts +10 -0
- package/dist/building-blocks/bar-vertical/bar-vertical.d.ts.map +1 -1
- package/dist/building-blocks/bar-vertical/bar-vertical.js +6 -1
- package/dist/building-blocks/bar-vertical/bar-vertical.js.map +1 -1
- package/dist/building-blocks/chart-line/chart-line-base.d.ts +137 -0
- package/dist/building-blocks/chart-line/chart-line-base.d.ts.map +1 -1
- package/dist/building-blocks/chart-line/chart-line-base.js +464 -79
- package/dist/building-blocks/chart-line/chart-line-base.js.map +1 -1
- package/dist/building-blocks/external-scale/external-scale.d.ts +11 -0
- package/dist/building-blocks/external-scale/external-scale.d.ts.map +1 -1
- package/dist/building-blocks/external-scale/external-scale.js +45 -12
- package/dist/building-blocks/external-scale/external-scale.js.map +1 -1
- package/dist/charthelpers/index.d.ts +1 -0
- package/dist/charthelpers/index.d.ts.map +1 -1
- package/dist/charthelpers/index.js +7 -1
- package/dist/charthelpers/index.js.map +1 -1
- package/dist/charthelpers/range-labels.d.ts +55 -0
- package/dist/charthelpers/range-labels.d.ts.map +1 -0
- package/dist/charthelpers/range-labels.js +36 -0
- package/dist/charthelpers/range-labels.js.map +1 -0
- package/dist/components/alert-button/alert-button.css.js +13 -21
- package/dist/components/alert-button/alert-button.css.js.map +1 -1
- package/dist/components/alert-button/alert-button.d.ts +9 -4
- package/dist/components/alert-button/alert-button.d.ts.map +1 -1
- package/dist/components/alert-button/alert-button.js +24 -15
- package/dist/components/alert-button/alert-button.js.map +1 -1
- package/dist/components/alert-frame/alert-frame.css.js +109 -33
- package/dist/components/alert-frame/alert-frame.css.js.map +1 -1
- package/dist/components/alert-frame/alert-frame.d.ts +34 -7
- package/dist/components/alert-frame/alert-frame.d.ts.map +1 -1
- package/dist/components/alert-frame/alert-frame.js +134 -30
- package/dist/components/alert-frame/alert-frame.js.map +1 -1
- package/dist/components/alert-icon/alert-icon.d.ts +10 -7
- package/dist/components/alert-icon/alert-icon.d.ts.map +1 -1
- package/dist/components/alert-icon/alert-icon.js +37 -60
- package/dist/components/alert-icon/alert-icon.js.map +1 -1
- package/dist/components/alert-menu-item/alert-menu-item.css.js +1 -4
- package/dist/components/alert-menu-item/alert-menu-item.css.js.map +1 -1
- package/dist/components/date-item/date-item.css.js +3 -3
- package/dist/components/keyboard-full/keyboard-full.css.js +4 -4
- package/dist/components/message-menu-item/message-menu-item.css.js +2 -6
- package/dist/components/message-menu-item/message-menu-item.css.js.map +1 -1
- package/dist/components/sequence-toolbar/sequence-toolbar.css.js +1 -2
- package/dist/components/sequence-toolbar/sequence-toolbar.css.js.map +1 -1
- package/dist/index.js +2 -1
- package/dist/navigation-instruments/gauge-trend/gauge-trend.d.ts +6 -0
- package/dist/navigation-instruments/gauge-trend/gauge-trend.d.ts.map +1 -1
- package/dist/navigation-instruments/gauge-trend/gauge-trend.js +8 -0
- package/dist/navigation-instruments/gauge-trend/gauge-trend.js.map +1 -1
- package/dist/navigation-instruments/instrument-field/instrument-field.css.js +2 -2
- package/dist/navigation-instruments/readout/readout.d.ts.map +1 -1
- package/dist/navigation-instruments/readout/readout.js +2 -1
- package/dist/navigation-instruments/readout/readout.js.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.d.ts.map +1 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js +2 -1
- package/dist/navigation-instruments/readout-list-item/readout-list-item.js.map +1 -1
- package/dist/openbridge.css +19 -4
- package/dist/palettes/blinking.d.ts +14 -4
- package/dist/palettes/blinking.d.ts.map +1 -1
- package/dist/palettes/blinking.js +41 -35
- package/dist/palettes/blinking.js.map +1 -1
- package/dist/palettes/flashing-controller.d.ts +21 -0
- package/dist/palettes/flashing-controller.d.ts.map +1 -0
- package/dist/palettes/flashing-controller.js +45 -0
- package/dist/palettes/flashing-controller.js.map +1 -0
- package/dist/svghelpers/index.d.ts +1 -0
- package/dist/svghelpers/index.d.ts.map +1 -1
- package/dist/svghelpers/index.js +2 -0
- package/dist/svghelpers/index.js.map +1 -1
- package/dist/svghelpers/rounded-rect.d.ts +15 -0
- package/dist/svghelpers/rounded-rect.d.ts.map +1 -0
- package/dist/svghelpers/rounded-rect.js +29 -0
- package/dist/svghelpers/rounded-rect.js.map +1 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bar-vertical.js","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 type {LinearAdvice} from '../instrument-linear/advice.js';\nimport type {\n ExternalScaleAdvice,\n ExternalScaleConfig,\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 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 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 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. Bubbles and is composed.\n * @beta\n */\n@customElement('obc-bar-vertical')\nexport class ObcBarVertical extends SetpointMixin(LitElement, {\n defaultDeadband: 1,\n}) {\n @property({type: Number}) minValue = 0;\n @property({type: Number}) maxValue = 100;\n\n @property({type: Number}) height = 320;\n\n @property({type: Number}) paddingTop: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: Number}) paddingBottom: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: String}) side: ExternalScaleSide = ExternalScaleSide.right;\n\n @property({type: Boolean})\n fixedAspectRatio = false;\n\n @property({type: Number})\n scaleReferenceSize = 384;\n\n @state()\n private _scale = 1;\n\n // ResizeController automatically subscribes/unsubscribes based on component lifecycle\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _resizeController = new ResizeController(this, {\n callback: (entries) => {\n if (!this.fixedAspectRatio) return;\n\n const entry = entries[0];\n if (!entry) return;\n\n // Use the centralized function that computes scale based on reference size\n // For vertical scales, compare container height to reference size\n const containerMainAxisSize = entry.contentRect.height;\n\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.vertical,\n containerMainAxisSize,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n\n // Report scaled dimensions to parent chart\n this.reportDimensions();\n },\n });\n\n // Bands (thickness)\n @property({type: Boolean, attribute: false}) hasScale = true;\n @property({type: Boolean, attribute: false}) showLabels = true;\n @property({type: Boolean}) 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 @property({type: Array, attribute: false}) advices?: LinearAdvice[] = [];\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 hasScale: this.hasScale,\n labels: this.showLabels,\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 as ExternalScaleAdvice[],\n fixedAspectRatio: this.fixedAspectRatio,\n instrumentMode: this.instrumentMode,\n highlightCurrentValue: this.highlightCurrentValue,\n };\n\n const layout = computeExternalScaleLayout(\n toExternalScaleLayoutConfig(config)\n );\n\n const parts = renderExternalScale(config);\n\n const viewBox = computeExternalScaleViewBox(\n {orientation: config.orientation, length: effectiveLength},\n layout\n );\n const preserveAspectRatio = this.fixedAspectRatio\n ? 'xMidYMid meet'\n : 'none';\n\n return html`\n <svg\n width=${this.fixedAspectRatio ? '100%' : `${viewBox.width}px`}\n height=${this.fixedAspectRatio ? '100%' : `${this.height}px`}\n viewBox=\"${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}\"\n preserveAspectRatio=\"${preserveAspectRatio}\"\n style=\"--scale: ${this.fixedAspectRatio ? this._scale : 1};\"\n part=\"svg\"\n >\n ${parts.barContainer} ${parts.barFill} ${parts.scaleBackground}\n ${parts.tickmarks} ${parts.labels} ${parts.adviceOverlays}\n ${parts.currentValueDot} ${parts.setpoint}\n </svg>\n `;\n }\n\n override updated(changed: PropertyValues) {\n super.updated(changed);\n\n if (changed.has('scaleType')) {\n this._refreshBorderRadiusFromCssVar();\n }\n\n // Update host styles when fixedAspectRatio changes\n if (changed.has('fixedAspectRatio')) {\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n // Force initial scale calculation based on current size\n this._updateScaleFromCurrentSize();\n } else {\n this._removeFixedAspectRatioStyles();\n this._scale = 1;\n }\n }\n\n // Also recalculate scale when scaleReferenceSize changes\n if (changed.has('scaleReferenceSize') && this.fixedAspectRatio) {\n this._updateScaleFromCurrentSize();\n }\n\n // Report dimensions to parent chart when layout-affecting properties change.\n // In fixedAspectRatio mode, resize events also trigger reportDimensions() via ResizeController.\n // In regular mode, we report on every update to keep parent chart in sync.\n // Layout-affecting properties change the computed thickness and must notify the parent\n // even in fixedAspectRatio mode to keep chart padding accurate.\n const layoutChanged =\n changed.has('side') ||\n changed.has('showLabels') ||\n changed.has('hasScale') ||\n changed.has('hasBar') ||\n changed.has('barThickness') ||\n changed.has('tickThickness') ||\n changed.has('labelThickness') ||\n changed.has('scaleType') ||\n changed.has('borderRadiusPosition') ||\n changed.has('borderRadius') ||\n changed.has('advices') ||\n changed.has('advicePosition') ||\n this.setpointPresenceChanged(changed);\n\n if (!this.fixedAspectRatio || layoutChanged) {\n this.reportDimensions();\n }\n }\n\n /**\n * Report scale dimensions to parent chart component.\n * When fixedAspectRatio=true, reports the actual visual (scaled) thickness\n * so the chart can correctly reserve space for the scale.\n * When fixedAspectRatio=false, reports the base/unscaled thickness.\n */\n private reportDimensions() {\n const effectiveBarThickness = computeExternalScaleEffectiveBarThickness({\n hasBar: this.hasBar,\n barThickness: this.barThickness,\n borderRadius: this._getEffectiveBorderRadius(),\n scaleType: this.scaleType,\n });\n\n // Use scaleReferenceSize for layout calculation when in fixedAspectRatio mode\n // This ensures consistent layout dimensions based on the design reference size\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.height;\n\n const baseDimensions = computeScaleDimensionsForReport({\n orientation: ExternalScaleOrientation.vertical,\n side: this.side,\n hasBar: this.hasBar,\n hasScale: this.hasScale,\n labels: this.showLabels,\n barThickness: effectiveBarThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n length: effectiveLength,\n scaleType: this.scaleType,\n advicePosition: this.advicePosition,\n hasAdvice: !!this.advices && this.advices.length > 0,\n 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 composed: true,\n })\n );\n }\n\n protected override createRenderRoot() {\n return this;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Only read from CSS variable and observe changes when not in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n this._startBorderRadiusObserver();\n }\n\n // Ensure the element fills its container when in fixedAspectRatio mode\n // Custom elements are display:inline by default, which doesn't work for percentage-based sizing\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n }\n }\n\n override disconnectedCallback(): void {\n this._borderRadiusObserver?.disconnect();\n this._borderRadiusObserver = undefined;\n super.disconnectedCallback();\n }\n\n private _startBorderRadiusObserver(): void {\n this._borderRadiusObserver?.disconnect();\n\n this._borderRadiusObserver = startExternalScaleBorderRadiusObserver(\n this,\n () => this._refreshBorderRadiusFromCssVar()\n );\n }\n\n /**\n * Apply CSS styles needed for fixedAspectRatio mode.\n * Custom elements are display:inline by default, which doesn't work with percentage-based sizing.\n * We need display:block and height:100% to fill the slot container.\n */\n private _applyFixedAspectRatioStyles(): void {\n this.style.display = 'block';\n this.style.height = '100%';\n this.style.width = 'auto';\n }\n\n /**\n * Remove fixed aspect ratio styles when switching back to pixel mode.\n */\n private _removeFixedAspectRatioStyles(): void {\n this.style.display = '';\n this.style.height = '';\n this.style.width = '';\n }\n\n /**\n * Calculate scale based on current element size.\n * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.\n */\n private _updateScaleFromCurrentSize(): void {\n // Use requestAnimationFrame to ensure layout is complete\n requestAnimationFrame(() => {\n const containerHeight = this.clientHeight;\n if (containerHeight > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.vertical,\n containerMainAxisSize: containerHeight,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n this.requestUpdate();\n // Report updated dimensions to parent (matches pattern in ResizeController and _refreshBorderRadiusFromCssVar)\n this.reportDimensions();\n }\n });\n }\n\n private _refreshBorderRadiusFromCssVar(): void {\n // Skip CSS variable reading in instrument mode\n if (this.instrumentMode) return;\n\n const next = readExternalScaleBorderRadiusPx(this, this.scaleType);\n\n if (this._computedBorderRadius !== next) {\n this._computedBorderRadius = next;\n }\n\n // In fixed-aspect-ratio mode, recompute scale when border radius changes\n // (border radius affects effective bar thickness and therefore viewBox)\n if (this.fixedAspectRatio) {\n const rect = this.getBoundingClientRect();\n if (rect.height > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.vertical,\n containerMainAxisSize: rect.height,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n // Report updated dimensions\n this.reportDimensions();\n }\n }\n }\n\n /**\n * Get the effective border radius to use.\n * In instrument mode: use explicit borderRadius prop or default based on scaleType.\n * In normal mode: use CSS variable computed value.\n */\n private _getEffectiveBorderRadius(): number {\n if (this.instrumentMode) {\n // In instrument mode, use explicit value or default\n if (this.borderRadius !== undefined) {\n return this.borderRadius;\n }\n // Default: 8px for regular, 4px for condensed\n return this.scaleType === ScaleType.condensed ? 4 : 8;\n }\n // Normal mode: use CSS variable computed value\n return (\n this._computedBorderRadius ??\n (this.scaleType === ScaleType.condensed ? 4 : 8)\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-bar-vertical': ObcBarVertical;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AA8HO,IAAM,iBAAN,cAA6B,cAAc,YAAY;AAAA,EAC5D,iBAAiB;AACnB,CAAC,EAAE;AAAA,EAFI,cAAA;AAAA,UAAA,GAAA,SAAA;AAGqB,SAAA,WAAW;AACX,SAAA,WAAW;AAEX,SAAA,SAAS;AAET,SAAA,aACxB,iBAAiB;AAEO,SAAA,gBACxB,iBAAiB;AAEO,SAAA,OAA0B,kBAAkB;AAGtE,SAAA,mBAAmB;AAGnB,SAAA,qBAAqB;AAGrB,SAAQ,SAAS;AAIjB,SAAQ,oBAAoB,IAAI,iBAAiB,MAAM;AAAA,MACrD,UAAU,CAAC,YAAY;AACrB,YAAI,CAAC,KAAK,iBAAkB;AAE5B,cAAM,QAAQ,QAAQ,CAAC;AACvB,YAAI,CAAC,MAAO;AAIZ,cAAM,wBAAwB,MAAM,YAAY;AAEhD,aAAK,SAAS,6BAA6B;AAAA,UACzC,aAAa,yBAAyB;AAAA,UACtC;AAAA,UACA,oBAAoB,KAAK;AAAA,QAAA,CAC1B;AAGD,aAAK,iBAAA;AAAA,MACP;AAAA,IAAA,CACD;AAG4C,SAAA,WAAW;AACX,SAAA,aAAa;AAC/B,SAAA,SAAS;AAEpC,SAAA,kB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AA,CAAA;AAekB,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GA7Fb,eA6Fe,WAAA,YAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GA9Fb,eA8Fe,WAAA,YAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GA/Fb,eA+Fe,WAAA,WAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAhGb,eAgGe,WAAA,WAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAjGb,eAiGe,WAAA,SAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAnGb,eAmGe,WAAA,SAAA,CAAA;AAGA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,OAAA,CAAO;AAAA,GAtGb,eAsGe,WAAA,kBAAA,CAAA;AAEiB,gBAAA;AAAA,EAA1C,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GAxG9B,eAwGgC,WAAA,WAAA,CAAA;AAEhB,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GA1Gd,eA0GgB,WAAA,yBAAA,CAAA;AA1GhB,iBAAN,gBAAA;AAAA,EADN,cAAc,kBAAkB;AAAA,GACpB,cAAA;"}
|
|
1
|
+
{"version":3,"file":"bar-vertical.js","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 type {LinearAdvice} from '../instrument-linear/advice.js';\nimport type {\n ExternalScaleAdvice,\n ExternalScaleConfig,\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 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 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. Bubbles and is composed.\n * @beta\n */\n@customElement('obc-bar-vertical')\nexport class ObcBarVertical extends SetpointMixin(LitElement, {\n defaultDeadband: 1,\n}) {\n @property({type: Number}) minValue = 0;\n @property({type: Number}) maxValue = 100;\n\n @property({type: Number}) height = 320;\n\n @property({type: Number}) paddingTop: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: Number}) paddingBottom: number =\n CHART_DIMENSIONS.CANVAS_PADDING;\n\n @property({type: String}) side: ExternalScaleSide = ExternalScaleSide.right;\n\n @property({type: Boolean})\n fixedAspectRatio = false;\n\n @property({type: Number})\n scaleReferenceSize = 384;\n\n @state()\n private _scale = 1;\n\n // ResizeController automatically subscribes/unsubscribes based on component lifecycle\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _resizeController = new ResizeController(this, {\n callback: (entries) => {\n if (!this.fixedAspectRatio) return;\n\n const entry = entries[0];\n if (!entry) return;\n\n // Use the centralized function that computes scale based on reference size\n // For vertical scales, compare container height to reference size\n const containerMainAxisSize = entry.contentRect.height;\n\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.vertical,\n containerMainAxisSize,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n\n // Report scaled dimensions to parent chart\n this.reportDimensions();\n },\n });\n\n // Bands (thickness)\n @property({type: Boolean, attribute: false}) hasScale = true;\n @property({type: Boolean, attribute: false}) showLabels = true;\n @property({type: Boolean}) showMainTickmarkLabels = false;\n @property({type: Boolean}) hasBar = false;\n @property({type: Boolean})\n scaleBackground = false;\n @property({type: String})\n barContainerStyle?: BarContainerStyle = undefined;\n @property({type: Number}) barThickness = 24;\n @property({type: Number}) tickThickness = 24;\n @property({type: Number}) labelThickness = 60;\n\n // Tick configuration\n @property({type: Array, attribute: false}) mainTickmarks?: number[] = [];\n @property({type: Number}) primaryTickmarkInterval?: number = undefined;\n @property({type: Number}) secondaryTickmarkInterval?: number = undefined;\n @property({type: Number}) tertiaryTickmarkInterval?: number = undefined;\n @property({type: String}) scaleType: ScaleType = ScaleType.regular;\n @property({type: String}) frameStyle: FrameStyle = FrameStyle.regular;\n @property({type: String})\n borderRadiusPosition?: BorderRadiusPosition = undefined;\n\n @property({type: Boolean})\n instrumentMode = false;\n\n @property({type: Number})\n borderRadius?: number = undefined;\n\n @state()\n private _computedBorderRadius?: number;\n\n private _borderRadiusObserver?: MutationObserver;\n\n // @ts-expect-error - Controller is used for side effects, not accessed directly\n private _borderRadiusResizeController = new ResizeController(this, {\n callback: () => {\n // Skip CSS variable reading in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n }\n },\n });\n\n // Values\n @property({type: String}) priority: Priority = Priority.regular;\n @property({type: String}) fillMode: FillMode = FillMode.fill;\n @property({type: Number}) fillMin?: number = undefined;\n @property({type: Number}) fillMax?: number = undefined;\n @property({type: Number}) value?: number = undefined;\n\n @property({type: String}) state: InstrumentState = InstrumentState.active;\n\n // Advice\n @property({type: String}) advicePosition: AdvicePosition =\n AdvicePosition.inner;\n @property({type: Array, attribute: false}) advices?: LinearAdvice[] = [];\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 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 as ExternalScaleAdvice[],\n fixedAspectRatio: this.fixedAspectRatio,\n instrumentMode: this.instrumentMode,\n highlightCurrentValue: this.highlightCurrentValue,\n };\n\n const layout = computeExternalScaleLayout(\n toExternalScaleLayoutConfig(config)\n );\n\n const parts = renderExternalScale(config);\n\n const viewBox = computeExternalScaleViewBox(\n {orientation: config.orientation, length: effectiveLength},\n layout\n );\n const preserveAspectRatio = this.fixedAspectRatio\n ? 'xMidYMid meet'\n : 'none';\n\n return html`\n <svg\n width=${this.fixedAspectRatio ? '100%' : `${viewBox.width}px`}\n height=${this.fixedAspectRatio ? '100%' : `${this.height}px`}\n viewBox=\"${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}\"\n preserveAspectRatio=\"${preserveAspectRatio}\"\n style=\"--scale: ${this.fixedAspectRatio ? this._scale : 1};\"\n part=\"svg\"\n >\n ${parts.barContainer} ${parts.barFill} ${parts.scaleBackground}\n ${parts.tickmarks} ${parts.labels} ${parts.adviceOverlays}\n ${parts.currentValueDot} ${parts.setpoint}\n </svg>\n `;\n }\n\n override updated(changed: PropertyValues) {\n super.updated(changed);\n\n if (changed.has('scaleType')) {\n this._refreshBorderRadiusFromCssVar();\n }\n\n // Update host styles when fixedAspectRatio changes\n if (changed.has('fixedAspectRatio')) {\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n // Force initial scale calculation based on current size\n this._updateScaleFromCurrentSize();\n } else {\n this._removeFixedAspectRatioStyles();\n this._scale = 1;\n }\n }\n\n // Also recalculate scale when scaleReferenceSize changes\n if (changed.has('scaleReferenceSize') && this.fixedAspectRatio) {\n this._updateScaleFromCurrentSize();\n }\n\n // Report dimensions to parent chart when layout-affecting properties change.\n // In fixedAspectRatio mode, resize events also trigger reportDimensions() via ResizeController.\n // In regular mode, we report on every update to keep parent chart in sync.\n // Layout-affecting properties change the computed thickness and must notify the parent\n // even in fixedAspectRatio mode to keep chart padding accurate.\n const layoutChanged =\n changed.has('side') ||\n changed.has('showLabels') ||\n changed.has('showMainTickmarkLabels') ||\n changed.has('hasScale') ||\n changed.has('hasBar') ||\n changed.has('barThickness') ||\n changed.has('tickThickness') ||\n changed.has('labelThickness') ||\n changed.has('scaleType') ||\n changed.has('borderRadiusPosition') ||\n changed.has('borderRadius') ||\n changed.has('advices') ||\n changed.has('advicePosition') ||\n this.setpointPresenceChanged(changed);\n\n if (!this.fixedAspectRatio || layoutChanged) {\n this.reportDimensions();\n }\n }\n\n /**\n * Report scale dimensions to parent chart component.\n * When fixedAspectRatio=true, reports the actual visual (scaled) thickness\n * so the chart can correctly reserve space for the scale.\n * When fixedAspectRatio=false, reports the base/unscaled thickness.\n */\n private reportDimensions() {\n const effectiveBarThickness = computeExternalScaleEffectiveBarThickness({\n hasBar: this.hasBar,\n barThickness: this.barThickness,\n borderRadius: this._getEffectiveBorderRadius(),\n scaleType: this.scaleType,\n });\n\n // Use scaleReferenceSize for layout calculation when in fixedAspectRatio mode\n // This ensures consistent layout dimensions based on the design reference size\n const effectiveLength = this.fixedAspectRatio\n ? this.scaleReferenceSize\n : this.height;\n\n const baseDimensions = computeScaleDimensionsForReport({\n orientation: ExternalScaleOrientation.vertical,\n side: this.side,\n hasBar: this.hasBar,\n hasScale: this.hasScale,\n labels: this.showLabels,\n barThickness: effectiveBarThickness,\n tickThickness: this.tickThickness,\n labelThickness: this.labelThickness,\n length: effectiveLength,\n scaleType: this.scaleType,\n advicePosition: this.advicePosition,\n hasAdvice: !!this.advices && this.advices.length > 0,\n 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 composed: true,\n })\n );\n }\n\n protected override createRenderRoot() {\n return this;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n // Only read from CSS variable and observe changes when not in instrument mode\n if (!this.instrumentMode) {\n this._refreshBorderRadiusFromCssVar();\n this._startBorderRadiusObserver();\n }\n\n // Ensure the element fills its container when in fixedAspectRatio mode\n // Custom elements are display:inline by default, which doesn't work for percentage-based sizing\n if (this.fixedAspectRatio) {\n this._applyFixedAspectRatioStyles();\n }\n }\n\n override disconnectedCallback(): void {\n this._borderRadiusObserver?.disconnect();\n this._borderRadiusObserver = undefined;\n super.disconnectedCallback();\n }\n\n private _startBorderRadiusObserver(): void {\n this._borderRadiusObserver?.disconnect();\n\n this._borderRadiusObserver = startExternalScaleBorderRadiusObserver(\n this,\n () => this._refreshBorderRadiusFromCssVar()\n );\n }\n\n /**\n * Apply CSS styles needed for fixedAspectRatio mode.\n * Custom elements are display:inline by default, which doesn't work with percentage-based sizing.\n * We need display:block and height:100% to fill the slot container.\n */\n private _applyFixedAspectRatioStyles(): void {\n this.style.display = 'block';\n this.style.height = '100%';\n this.style.width = 'auto';\n }\n\n /**\n * Remove fixed aspect ratio styles when switching back to pixel mode.\n */\n private _removeFixedAspectRatioStyles(): void {\n this.style.display = '';\n this.style.height = '';\n this.style.width = '';\n }\n\n /**\n * Calculate scale based on current element size.\n * Called when fixedAspectRatio is enabled or scaleReferenceSize changes.\n */\n private _updateScaleFromCurrentSize(): void {\n // Use requestAnimationFrame to ensure layout is complete\n requestAnimationFrame(() => {\n const containerHeight = this.clientHeight;\n if (containerHeight > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.vertical,\n containerMainAxisSize: containerHeight,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n this.requestUpdate();\n // Report updated dimensions to parent (matches pattern in ResizeController and _refreshBorderRadiusFromCssVar)\n this.reportDimensions();\n }\n });\n }\n\n private _refreshBorderRadiusFromCssVar(): void {\n // Skip CSS variable reading in instrument mode\n if (this.instrumentMode) return;\n\n const next = readExternalScaleBorderRadiusPx(this, this.scaleType);\n\n if (this._computedBorderRadius !== next) {\n this._computedBorderRadius = next;\n }\n\n // In fixed-aspect-ratio mode, recompute scale when border radius changes\n // (border radius affects effective bar thickness and therefore viewBox)\n if (this.fixedAspectRatio) {\n const rect = this.getBoundingClientRect();\n if (rect.height > 0) {\n this._scale = computeFixedAspectRatioScale({\n orientation: ExternalScaleOrientation.vertical,\n containerMainAxisSize: rect.height,\n scaleReferenceSize: this.scaleReferenceSize,\n });\n // Report updated dimensions\n this.reportDimensions();\n }\n }\n }\n\n /**\n * Get the effective border radius to use.\n * In instrument mode: use explicit borderRadius prop or default based on scaleType.\n * In normal mode: use CSS variable computed value.\n */\n private _getEffectiveBorderRadius(): number {\n if (this.instrumentMode) {\n // In instrument mode, use explicit value or default\n if (this.borderRadius !== undefined) {\n return this.borderRadius;\n }\n // Default: 8px for regular, 4px for condensed\n return this.scaleType === ScaleType.condensed ? 4 : 8;\n }\n // Normal mode: use CSS variable computed value\n return (\n this._computedBorderRadius ??\n (this.scaleType === ScaleType.condensed ? 4 : 8)\n );\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-bar-vertical': ObcBarVertical;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAkIO,IAAM,iBAAN,cAA6B,cAAc,YAAY;AAAA,EAC5D,iBAAiB;AACnB,CAAC,EAAE;AAAA,EAFI,cAAA;AAAA,UAAA,GAAA,SAAA;AAGqB,SAAA,WAAW;AACX,SAAA,WAAW;AAEX,SAAA,SAAS;AAET,SAAA,aACxB,iBAAiB;AAEO,SAAA,gBACxB,iBAAiB;AAEO,SAAA,OAA0B,kBAAkB;AAGtE,SAAA,mBAAmB;AAGnB,SAAA,qBAAqB;AAGrB,SAAQ,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CAAO;AAAA,GAvGb,eAuGe,WAAA,kBAAA,CAAA;AAEiB,gBAAA;AAAA,EAA1C,SAAS,EAAC,MAAM,OAAO,WAAW,OAAM;AAAA,GAzG9B,eAyGgC,WAAA,WAAA,CAAA;AAEhB,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,QAAA,CAAQ;AAAA,GA3Gd,eA2GgB,WAAA,yBAAA,CAAA;AA3GhB,iBAAN,gBAAA;AAAA,EADN,cAAc,kBAAkB;AAAA,GACpB,cAAA;"}
|
|
@@ -32,6 +32,13 @@ export declare enum TimeDisplay {
|
|
|
32
32
|
minutes = "minutes",
|
|
33
33
|
date = "date"
|
|
34
34
|
}
|
|
35
|
+
/** Which axes keep min / max labels below the label threshold. */
|
|
36
|
+
export declare enum RangeLabels {
|
|
37
|
+
none = "none",
|
|
38
|
+
y = "y",
|
|
39
|
+
x = "x",
|
|
40
|
+
xy = "xy"
|
|
41
|
+
}
|
|
35
42
|
export type ChartLinePoint = number | {
|
|
36
43
|
x: ChartXValue;
|
|
37
44
|
y: number;
|
|
@@ -54,6 +61,10 @@ export type ChartLineYAxisConfig = {
|
|
|
54
61
|
max?: number;
|
|
55
62
|
grid?: boolean;
|
|
56
63
|
};
|
|
64
|
+
export type ChartLineXAxisConfig = {
|
|
65
|
+
min?: number;
|
|
66
|
+
max?: number;
|
|
67
|
+
};
|
|
57
68
|
/**
|
|
58
69
|
* Abstract base class for line and area chart components built on Chart.js.
|
|
59
70
|
*
|
|
@@ -209,12 +220,21 @@ export type ChartLineYAxisConfig = {
|
|
|
209
220
|
* numeric x-values.
|
|
210
221
|
* @property yAxisPosition - Single y-axis position ('left' or 'right'). For multiple y-axes, use yAxes instead.
|
|
211
222
|
* @property yAxes - Multiple y-axis definitions for complex multi-axis charts.
|
|
223
|
+
* @property xAxis - Pinned x range (`min`/`max`) for time and number axes. Without it the
|
|
224
|
+
* axis spans exactly the data, so a window that is still filling stretches across the
|
|
225
|
+
* full width. In `minutes` display `max` is the `0min` reference.
|
|
226
|
+
* @availableWhen xAxis xAxisType!=category
|
|
212
227
|
* @property showGrid - Show grid lines.
|
|
213
228
|
* @property showGridX - Show vertical grid lines (x-axis). Default: false.
|
|
214
229
|
* @availableWhen showGridX showGrid==true
|
|
215
230
|
* @property showGridY - Show horizontal grid lines (y-axis). Default: false.
|
|
216
231
|
* @availableWhen showGridY showGrid==true
|
|
217
232
|
* @property showTickMarks - Show axis tick marks and labels.
|
|
233
|
+
* @property rangeLabels - Labels kept below the 192px threshold, where the axis labels are
|
|
234
|
+
* otherwise hidden: 'y' draws min, max and (inside the range) 0 in a gutter on the
|
|
235
|
+
* y-axis side; 'x' draws the first and last x value in a bottom gutter; 'xy' both.
|
|
236
|
+
* Ignored when `hasLabelPadding` is false.
|
|
237
|
+
* @availableWhen rangeLabels hasLabelPadding==true
|
|
218
238
|
* @property showPoints - Show point markers on data points. Default: false.
|
|
219
239
|
* @property lineMode - Line drawing style: 'smooth' (curved), 'straight', or 'stepped'.
|
|
220
240
|
* @property unit - Unit label displayed in tooltips (e.g., 'kW', 'kg', '%').
|
|
@@ -266,6 +286,12 @@ export declare class ObcChartLineBase extends LitElement {
|
|
|
266
286
|
yAxisPosition: YAxisPosition;
|
|
267
287
|
/** Multiple y-axis definitions for complex multi-axis charts. */
|
|
268
288
|
yAxes?: ChartLineYAxisConfig[];
|
|
289
|
+
/**
|
|
290
|
+
* Pinned x range (`min`/`max`) for time and number axes. Without it the axis spans exactly the data, so a window that is still filling stretches across the full width. In `minutes` display `max` is the `0min` reference.
|
|
291
|
+
*
|
|
292
|
+
* Available when `xAxisType!=category`.
|
|
293
|
+
*/
|
|
294
|
+
xAxis?: ChartLineXAxisConfig;
|
|
269
295
|
/** Show grid lines. */
|
|
270
296
|
showGrid: boolean;
|
|
271
297
|
/**
|
|
@@ -300,12 +326,29 @@ export declare class ObcChartLineBase extends LitElement {
|
|
|
300
326
|
* because a `true`-default boolean cannot work as an HTML boolean attribute.
|
|
301
327
|
*/
|
|
302
328
|
hasLabelPadding: boolean;
|
|
329
|
+
/**
|
|
330
|
+
* Labels kept below the 192px threshold, where the axis labels are otherwise hidden: 'y' draws min, max and (inside the range) 0 in a gutter on the y-axis side; 'x' draws the first and last x value in a bottom gutter; 'xy' both. Ignored when `hasLabelPadding` is false.
|
|
331
|
+
*
|
|
332
|
+
* Available when `hasLabelPadding==true`.
|
|
333
|
+
*/
|
|
334
|
+
rangeLabels: RangeLabels;
|
|
335
|
+
/** @internal - The y side wants range labels; an edge-to-edge chart never does. */
|
|
336
|
+
protected get rangeLabelsY(): boolean;
|
|
337
|
+
/** @internal - The x side wants range labels; an edge-to-edge chart never does. */
|
|
338
|
+
protected get rangeLabelsX(): boolean;
|
|
303
339
|
/** @internal - True when the x-axis positions points by numeric value. */
|
|
304
340
|
protected get isNumericXAxis(): boolean;
|
|
341
|
+
/**
|
|
342
|
+
* Id of the y scale a dataset lands on when it names none. Chart.js would
|
|
343
|
+
* otherwise add a default `y` scale next to the configured ones and draw it.
|
|
344
|
+
*/
|
|
345
|
+
private get primaryYAxisId();
|
|
305
346
|
/** @internal - Normalization mode for the current x-axis type. */
|
|
306
347
|
protected get xValueMode(): XValueMode;
|
|
307
348
|
/** @internal - Last data/datasets reference already warned about. */
|
|
308
349
|
private lastWarnedXSource?;
|
|
350
|
+
/** @internal - Whether the `date`-display scale warning has been issued. */
|
|
351
|
+
private warnedDateDisplayScale;
|
|
309
352
|
/** @internal - Warn once per data assignment about unparseable x-values. */
|
|
310
353
|
private warnOnInvalidX;
|
|
311
354
|
private readonly DEFAULT_TENSION;
|
|
@@ -417,6 +460,63 @@ export declare class ObcChartLineBase extends LitElement {
|
|
|
417
460
|
* - When external scale is on BOTTOM, chart is on TOP (opposite)
|
|
418
461
|
* - middleChild → no rounding
|
|
419
462
|
*/
|
|
463
|
+
/**
|
|
464
|
+
* @internal - Label band each slotted scale had before the chart narrowed
|
|
465
|
+
* it for compact labels, so it can be given back on the way out.
|
|
466
|
+
*/
|
|
467
|
+
private savedLabelThickness;
|
|
468
|
+
private savedMainTickmarkLabels;
|
|
469
|
+
/** Last known threshold side, to notice a crossing in `updated()`. */
|
|
470
|
+
private wasBelowThreshold?;
|
|
471
|
+
/**
|
|
472
|
+
* Label band a slotted scale needs for its compact labels, in the scale's
|
|
473
|
+
* own viewBox units. The scale prints the raw values, so those are what is
|
|
474
|
+
* measured; the x band is one text line.
|
|
475
|
+
*/
|
|
476
|
+
private compactLabelThickness;
|
|
477
|
+
/** @internal - Labels the range-labels plugin drew last, for tests. */
|
|
478
|
+
lastRangeLabels: {
|
|
479
|
+
axis: 'x' | 'y';
|
|
480
|
+
text: string;
|
|
481
|
+
x: number;
|
|
482
|
+
y: number;
|
|
483
|
+
}[];
|
|
484
|
+
/**
|
|
485
|
+
* Range labels for the current data and size, refreshed with every
|
|
486
|
+
* `getChartOptions()` so the plugin never rebuilds the datasets on a draw.
|
|
487
|
+
*/
|
|
488
|
+
private rangeLabelCache;
|
|
489
|
+
private slotFor;
|
|
490
|
+
private hasSlottedScale;
|
|
491
|
+
/** @internal - Below the label threshold on either dimension. */
|
|
492
|
+
private isBelowThreshold;
|
|
493
|
+
private get ySide();
|
|
494
|
+
private rangeLabelFont;
|
|
495
|
+
/**
|
|
496
|
+
* Extent of the prepared data: one for x, one per y scale id. Each y axis
|
|
497
|
+
* ranges from its own datasets, so a merged extent would label one axis
|
|
498
|
+
* with another's values.
|
|
499
|
+
*/
|
|
500
|
+
private dataExtents;
|
|
501
|
+
/**
|
|
502
|
+
* Range the y labels describe. Below the threshold the axis runs on data
|
|
503
|
+
* bounds, so its datasets' extent is exact and needs no chart to read from.
|
|
504
|
+
*/
|
|
505
|
+
private yRangeBounds;
|
|
506
|
+
/** First and last x label, or nothing when there is no span to label. */
|
|
507
|
+
private xEdgeLabelTexts;
|
|
508
|
+
/**
|
|
509
|
+
* Recompute the range labels. A side with a slotted scale is labelled by
|
|
510
|
+
* the scale, so it gets no text here; the y bounds are kept regardless,
|
|
511
|
+
* since the scale's compact band is measured from them.
|
|
512
|
+
*/
|
|
513
|
+
private refreshRangeLabels;
|
|
514
|
+
/**
|
|
515
|
+
* Paints min / 0 / max and first / last once Chart.js has drawn, inside the
|
|
516
|
+
* gutters `getChartOptions()` reserved. The end labels sit flush with the
|
|
517
|
+
* plot edges so no vertical padding is needed for them.
|
|
518
|
+
*/
|
|
519
|
+
private createRangeLabelsPlugin;
|
|
420
520
|
/**
|
|
421
521
|
* Check if a slotted scale element is actually visible (renders content).
|
|
422
522
|
* For bar-vertical/bar-horizontal elements, checks hasBar and hasScale properties.
|
|
@@ -466,10 +566,40 @@ export declare class ObcChartLineBase extends LitElement {
|
|
|
466
566
|
* collapses with the chart's perpendicular padding and they stay visually aligned.
|
|
467
567
|
*/
|
|
468
568
|
private calculatePaddingFromScales;
|
|
569
|
+
/**
|
|
570
|
+
* Range a slotted scale on the given side has to cover.
|
|
571
|
+
*
|
|
572
|
+
* A range pinned in the axis configuration is used as is: it is the source
|
|
573
|
+
* of truth, and on the first sync there is no chart to read yet. Otherwise
|
|
574
|
+
* the live Chart.js scale is read under the id `buildScalesConfig()` gives
|
|
575
|
+
* it. A side with no axis of its own follows the first configured one.
|
|
576
|
+
*/
|
|
577
|
+
private resolveAxisRange;
|
|
578
|
+
/**
|
|
579
|
+
* Range pushed to the top and bottom scales, or `undefined` to leave them
|
|
580
|
+
* alone. A scale prints its values verbatim, and on a `time` axis the raw
|
|
581
|
+
* range is epoch milliseconds. In `minutes` display the range is converted
|
|
582
|
+
* to the minutes the chart's own labels show; `date` display has no numeric
|
|
583
|
+
* equivalent, so the scale keeps its own range.
|
|
584
|
+
*/
|
|
585
|
+
private resolveSlottedXRange;
|
|
469
586
|
/**
|
|
470
587
|
* Update properties on slotted scale elements
|
|
471
588
|
*/
|
|
472
589
|
private updateScaleProperties;
|
|
590
|
+
/**
|
|
591
|
+
* Whether the chart's axis range is what a slotted scale on this side should
|
|
592
|
+
* describe. A subclass that slots a scale of its own and gives it a separate
|
|
593
|
+
* range returns false for that side, otherwise the sync below overwrites it.
|
|
594
|
+
*/
|
|
595
|
+
protected ownsSlottedScaleRange(_side: 'left' | 'right' | 'top' | 'bottom'): boolean;
|
|
596
|
+
/**
|
|
597
|
+
* Push the current axis ranges to the slotted scales. The full
|
|
598
|
+
* `updateScaleProperties()` cascade runs before the chart is (re)built and
|
|
599
|
+
* so reads the previous chart's ranges; this closes that gap once the new
|
|
600
|
+
* chart exists, and keeps auto-ranged scales in step with the data.
|
|
601
|
+
*/
|
|
602
|
+
private syncSlottedScaleRanges;
|
|
473
603
|
private hasAnyChanged;
|
|
474
604
|
/**
|
|
475
605
|
* Apply fillMode rules to datasets. Must be called after the chart is created
|
|
@@ -563,6 +693,11 @@ export declare class ObcChartLineBase extends LitElement {
|
|
|
563
693
|
datasets: ChartDataset<"line", ChartLinePoint[]>[];
|
|
564
694
|
labels: (string | number)[];
|
|
565
695
|
};
|
|
696
|
+
/**
|
|
697
|
+
* One padding source for the Chart.js layout and the slotted scales: two
|
|
698
|
+
* sources painted the canvas over a scale and inset a scale inside a chart.
|
|
699
|
+
*/
|
|
700
|
+
private computeChartPadding;
|
|
566
701
|
/**
|
|
567
702
|
* Get Chart.js options with dynamic sizing and padding
|
|
568
703
|
*/
|
|
@@ -570,6 +705,8 @@ export declare class ObcChartLineBase extends LitElement {
|
|
|
570
705
|
/**
|
|
571
706
|
* Compute reference timestamp for time axis formatting.
|
|
572
707
|
* Returns earliest timestamp for 'date' mode, latest for 'minutes' mode.
|
|
708
|
+
* A pinned x range supplies the reference instead, so the axis edge stays
|
|
709
|
+
* the reference while the data has not reached it yet.
|
|
573
710
|
*/
|
|
574
711
|
private computeTimeReference;
|
|
575
712
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-line-base.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/chart-line/chart-line-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAkB,MAAM,KAAK,CAAC;AAkBhE,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAqB,MAAM,UAAU,CAAC;AAC7E,OAAO,EACL,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACT,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAiBL,UAAU,
|
|
1
|
+
{"version":3,"file":"chart-line-base.d.ts","sourceRoot":"","sources":["../../../src/building-blocks/chart-line/chart-line-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAkB,MAAM,KAAK,CAAC;AAkBhE,OAAO,KAAK,EAAC,YAAY,EAAE,YAAY,EAAqB,MAAM,UAAU,CAAC;AAC7E,OAAO,EACL,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,QAAQ,EACT,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAiBL,UAAU,EAOX,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,+BAA+B,CAAC;AAqB/D;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,6CAA6C;IAC7C,IAAI,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAC1C,8EAA8E;IAC9E,SAAS,EAAE,MAAM,CAAC;CACnB;AA4BD,YAAY,EAAC,WAAW,EAAE,YAAY,EAAC,MAAM,+BAA+B,CAAC;AAE7E,oBAAY,SAAS;IACnB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,oBAAY,QAAQ;IAClB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACpB;AAED,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED,kEAAkE;AAClE,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,CAAC,MAAM;IACP,CAAC,MAAM;IACP,EAAE,OAAO;CACV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