@cngx/common 0.1.0-rc.7 → 0.1.0-rc.8
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/card/README.md +2 -1
- package/data/README.md +10 -1
- package/dialog/README.md +23 -1
- package/fesm2022/cngx-common-a11y.mjs +125 -111
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +47 -5
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +300 -46
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +1176 -453
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +37 -10
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +1318 -469
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +151 -14
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +340 -73
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +1744 -952
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +841 -114
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +350 -60
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +727 -317
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +1601 -1243
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +137 -53
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/interactive/README.md +15 -4
- package/layout/README.md +21 -1
- package/package.json +3 -3
- package/popover/README.md +18 -2
- package/stepper/README.md +6 -4
- package/theming/components/cngx-accordion.css +1 -1
- package/theming/components/cngx-backdrop.css +12 -0
- package/theming/components/cngx-button-toggle.css +29 -3
- package/theming/components/cngx-data-grid.css +168 -1
- package/theming/components/cngx-dialog.css +13 -0
- package/theming/components/cngx-listbox.css +21 -12
- package/theming/components/cngx-menu.css +56 -16
- package/theming/components/cngx-popover.css +24 -0
- package/theming/components/cngx-recycler-placeholder.css +196 -0
- package/theming/components/cngx-ripple.css +1 -1
- package/theming/components/cngx-slider.css +32 -1
- package/theming/components/cngx-tooltip.css +12 -0
- package/timeline/README.md +155 -0
- package/types/cngx-common-a11y.d.ts +42 -18
- package/types/cngx-common-card.d.ts +201 -17
- package/types/cngx-common-chart.d.ts +343 -47
- package/types/cngx-common-command.d.ts +31 -8
- package/types/cngx-common-data.d.ts +581 -68
- package/types/cngx-common-dialog.d.ts +158 -3
- package/types/cngx-common-display.d.ts +356 -142
- package/types/cngx-common-interactive.d.ts +859 -210
- package/types/cngx-common-layout.d.ts +567 -28
- package/types/cngx-common-popover.d.ts +262 -39
- package/types/cngx-common-stepper.d.ts +366 -116
- package/types/cngx-common-tabs.d.ts +214 -50
- package/types/cngx-common-timeline.d.ts +82 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-common-chart.mjs","sources":["../../../projects/common/chart/scales/linear.ts","../../../projects/common/chart/scales/time.ts","../../../projects/common/chart/scales/band.ts","../../../projects/common/chart/scales/ordinal.ts","../../../projects/common/chart/buffer/lttb.ts","../../../projects/common/chart/chart/equal-helpers.ts","../../../projects/common/chart/buffer/ring-buffer.ts","../../../projects/common/chart/buffer/inject-chart-buffer.ts","../../../projects/common/chart/axis/chart-axis.ts","../../../projects/common/chart/chart/chart-context.ts","../../../projects/common/chart/layers/chart-layer.ts","../../../projects/common/chart/layers/threshold.component.ts","../../../projects/common/chart/i18n/chart-i18n.ts","../../../projects/common/chart/chart/data-table.component.ts","../../../projects/common/chart/chart/template-slots.ts","../../../projects/common/chart/chart/summary.ts","../../../projects/common/chart/chart/significant-change.ts","../../../projects/common/chart/renderer/chart-renderer-controller.ts","../../../projects/common/chart/renderer/canvas-renderer.ts","../../../projects/common/chart/renderer/svg-renderer.ts","../../../projects/common/chart/renderer/renderer-threshold.ts","../../../projects/common/chart/renderer/renderer-factory.ts","../../../projects/common/chart/chart/chart.component.ts","../../../projects/common/chart/chart/chart-announcer.component.ts","../../../projects/common/chart/axis/axis.component.ts","../../../projects/common/chart/axis/axis-domain.ts","../../../projects/common/chart/legend/legend.component.ts","../../../projects/common/chart/layers/point-geom.ts","../../../projects/common/chart/path/curve.ts","../../../projects/common/chart/path/path-builder.ts","../../../projects/common/chart/layers/line.component.ts","../../../projects/common/chart/layers/area.component.ts","../../../projects/common/chart/layers/bar.component.ts","../../../projects/common/chart/layers/scatter.component.ts","../../../projects/common/chart/layers/band.component.ts","../../../projects/common/chart/presets/preset-state.ts","../../../projects/common/chart/presets/sparkline.component.ts","../../../projects/common/chart/presets/mini-bar.component.ts","../../../projects/common/chart/presets/deviation-bar.component.ts","../../../projects/common/chart/presets/mini-area.component.ts","../../../projects/common/chart/presets/donut.component.ts","../../../projects/common/chart/presets/bullet.component.ts","../../../projects/common/chart/presets/stacked-bar.component.ts","../../../projects/common/chart/public-api.ts","../../../projects/common/chart/cngx-common-chart.ts"],"sourcesContent":["/**\n * Pure-TS linear scale. Maps a numeric domain `[d0, d1]` to a numeric\n * range `[r0, r1]` via standard linear interpolation. Domain may be\n * inverted (`d0 > d1`) for SVG Y-axes where the top of the chart is the\n * highest data value but the lowest pixel coordinate.\n *\n * Values outside the domain extrapolate. Charts that need overflow\n * clamping clamp at the data layer, not the scale.\n *\n * @param domain `[start, end]` data range. Equal endpoints collapse the\n * scale to a constant function returning `range[0]`.\n * @param range `[start, end]` output range (typically pixel coordinates).\n * @returns `(v: number) => number` mapping domain values to range values.\n *\n * @category common/chart/scales\n */\nexport function createLinearScale(\n domain: readonly [number, number],\n range: readonly [number, number],\n): (v: number) => number {\n const [d0, d1] = domain;\n const [r0, r1] = range;\n const dSpan = d1 - d0;\n if (dSpan === 0) {\n return () => r0;\n }\n const rSpan = r1 - r0;\n return (v: number) => r0 + ((v - d0) / dSpan) * rSpan;\n}\n","import { createLinearScale } from './linear';\n\n/**\n * Pure-TS time scale. Reuses {@link createLinearScale} after coercing\n * `Date` endpoints (and inputs) to epoch milliseconds. Supports\n * inverted domains and bare-number timestamps interchangeably.\n *\n * @param domain `[start, end]` time range. `Date` and `number` are\n * interchangeable on either endpoint.\n * @param range `[start, end]` output range (typically pixel coordinates).\n * @returns `(v: Date | number) => number` mapping time values to range\n * values.\n *\n * @category common/chart/scales\n */\nexport function createTimeScale(\n domain: readonly [Date | number, Date | number],\n range: readonly [number, number],\n): (v: Date | number) => number {\n const d0 = toMs(domain[0]);\n const d1 = toMs(domain[1]);\n const linear = createLinearScale([d0, d1], range);\n return (v: Date | number) => linear(toMs(v));\n}\n\n/** @internal */\nfunction toMs(v: Date | number): number {\n return typeof v === 'number' ? v : v.getTime();\n}\n","/**\n * Pure-TS band scale. Maps a discrete categorical domain to evenly\n * spaced positions along a numeric range. Each band reserves equal\n * width; padding shrinks the band by a fraction of its slot.\n *\n * Result is a callable carrying a `bandwidth()` method so layer atoms\n * (`<cngx-bar>`, ...) can read both the position and the slot width.\n *\n * @param domain Ordered list of categorical values. Values are matched\n * by reference equality on lookup; pass primitives or stable refs.\n * @param range `[start, end]` output range.\n * @param padding Fraction of each slot reserved as inter-band gap.\n * Default `0` (no gap). Range `[0, 1)`.\n * @returns Callable `(v: T) => number` returning the **leading edge** of\n * the band, with a `bandwidth()` method returning the band width.\n * Lookup of an unknown value returns `NaN`.\n *\n * @category common/chart/scales\n */\nexport interface BandScale<T> {\n (v: T): number;\n bandwidth(): number;\n}\n\n/**\n * Construct a {@link BandScale} from a categorical domain and a numeric\n * range. See the type-level documentation above for parameter\n * semantics.\n *\n * @category common/chart/scales\n */\nexport function createBandScale<T>(\n domain: readonly T[],\n range: readonly [number, number],\n padding = 0,\n): BandScale<T> {\n const [r0, r1] = range;\n const n = domain.length;\n const span = r1 - r0;\n const slot = n === 0 ? 0 : span / n;\n const inner = slot * (1 - padding);\n const offset = (slot - inner) / 2;\n\n const lookup = new Map<T, number>();\n for (let i = 0; i < n; i++) {\n lookup.set(domain[i], r0 + i * slot + offset);\n }\n\n const fn: BandScale<T> = ((v: T) => {\n return lookup.get(v) ?? NaN;\n }) as BandScale<T>;\n fn.bandwidth = () => inner;\n return fn;\n}\n","/**\n * Pure-TS ordinal scale. Maps a discrete categorical domain to a\n * cycling palette of values (typically colours). When the domain is\n * longer than the palette, mappings wrap modulo palette length.\n *\n * @param domain Ordered list of categorical values. Values are matched\n * by reference equality on lookup.\n * @param colors Palette to cycle through. Must have at least one entry;\n * an empty palette throws synchronously at construction time.\n * @returns Callable `(v: T) => string` returning the palette entry for\n * `v`. Lookup of an unknown value returns the palette's first entry.\n *\n * @category common/chart/scales\n */\nexport function createOrdinalScale<T>(\n domain: readonly T[],\n colors: readonly string[],\n): (v: T) => string {\n if (colors.length === 0) {\n throw new Error('createOrdinalScale: colors palette must not be empty');\n }\n const lookup = new Map<T, string>();\n for (let i = 0; i < domain.length; i++) {\n lookup.set(domain[i], colors[i % colors.length]);\n }\n return (v: T) => lookup.get(v) ?? colors[0];\n}\n","/**\n * Largest-Triangle-Three-Buckets downsampling. Reduces a dense series to\n * `targetSize` points while preserving the perceptual shape of the line -\n * peaks, troughs, and inflections survive where naive uniform (every-Nth)\n * sampling would drop them. This is the realtime-charting literature's\n * default downsampler (Steinarsson 2013).\n *\n * Pure TS: no Angular, no signal, no RxJS dependency. Tree-shakeable, so\n * static-chart consumers that never buffer pay nothing. The `<cngx-chart>`\n * buffer ({@link injectChartBuffer}) is the single downsampling boundary at\n * v2; this is its algorithm.\n *\n * The first and last points are always kept. The middle `targetSize - 2`\n * points are chosen one per bucket by the largest-triangle-area heuristic:\n * for each bucket, the point forming the largest triangle with the previous\n * selected point and the next bucket's average is retained.\n *\n * @param data source series, read-only.\n * @param targetSize desired output length. When `>= data.length` (or `<= 0`),\n * the input is returned unchanged by reference - no allocation, no copy.\n * @param xAccessor projects a row to its numeric X (typically a timestamp or\n * positional index).\n * @param yAccessor projects a row to its numeric Y (the value the triangle\n * area is computed against).\n * @returns a fresh array of at most `targetSize` rows, or the input by\n * reference when no reduction is needed.\n *\n * @category common/chart/buffer\n */\nexport function downsampleLTTB<T>(\n data: readonly T[],\n targetSize: number,\n xAccessor: (d: T, i: number) => number,\n yAccessor: (d: T, i: number) => number,\n): readonly T[] {\n const n = data.length;\n if (targetSize <= 0 || targetSize >= n) {\n return data;\n }\n if (targetSize === 1) {\n return [data[0]];\n }\n if (targetSize === 2) {\n return [data[0], data[n - 1]];\n }\n\n const sampled: T[] = [data[0]];\n // Middle buckets span the interior points [1, n-2]; first and last are\n // reserved. A fractional bucket size keeps the buckets evenly balanced.\n const bucketSize = (n - 2) / (targetSize - 2);\n let anchor = 0;\n\n for (let i = 0; i < targetSize - 2; i++) {\n const bucketStart = Math.floor(i * bucketSize) + 1;\n const bucketEnd = Math.floor((i + 1) * bucketSize) + 1;\n\n // Average of the next bucket forms the third triangle vertex.\n const nextStart = bucketEnd;\n const nextEnd = Math.min(Math.floor((i + 2) * bucketSize) + 1, n);\n const nextLen = nextEnd - nextStart;\n let avgX = 0;\n let avgY = 0;\n for (let j = nextStart; j < nextEnd; j++) {\n avgX += xAccessor(data[j], j);\n avgY += yAccessor(data[j], j);\n }\n avgX /= nextLen;\n avgY /= nextLen;\n\n const anchorX = xAccessor(data[anchor], anchor);\n const anchorY = yAccessor(data[anchor], anchor);\n\n let maxArea = -1;\n let maxIndex = bucketStart;\n for (let j = bucketStart; j < bucketEnd; j++) {\n const area =\n Math.abs(\n (anchorX - avgX) * (yAccessor(data[j], j) - anchorY) -\n (anchorX - xAccessor(data[j], j)) * (avgY - anchorY),\n ) * 0.5;\n if (area > maxArea) {\n maxArea = area;\n maxIndex = j;\n }\n }\n\n sampled.push(data[maxIndex]);\n anchor = maxIndex;\n }\n\n sampled.push(data[n - 1]);\n return sampled;\n}\n","/**\n * Internal `equal` fn helpers shared by the chart graph's bespoke\n * cascade guards. Each helper is two-line trivial; the bespoke fns on\n * heterogeneous shapes (axis tick rendering, layer rect/circle arrays)\n * stay inline at their call sites - this file only carries the\n * recurring shapes (numeric arrays, dimension objects).\n *\n * Not exported from `public-api.ts`. Internal to `@cngx/common/chart`.\n *\n * @internal\n */\n\nimport type { CngxChartInset, CngxChartPlotArea } from './chart-context';\nimport type { CngxChartSlotContext } from './template-slots';\n\n/**\n * Length + `Object.is` per-index equality on a readonly numeric array.\n * Used by `summaryValues` and `summary.thresholds`. Reference-equal\n * arrays short-circuit immediately.\n */\nexport function sameNumberArr(a: readonly number[], b: readonly number[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (!Object.is(a[i], b[i])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Length + `Object.is` per-index equality on any readonly array. The\n * generic sibling of {@link sameNumberArr}: `injectChartBuffer` stores the\n * pushed rows by reference, so a flush that reselects the same rows in the\n * same order yields an element-wise-identical projection even though\n * `snapshot()` allocates a fresh wrapper each call. Reference equality would\n * never fire here (the wrapper is always new); element-wise is the only\n * guard that dedups the buffer's `points` cascade.\n */\nexport function sameItemsArr<T>(a: readonly T[], b: readonly T[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (!Object.is(a[i], b[i])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Field-wise equality on the chart's `{ width, height }` dimension\n * shape. Used by the `dimensions` computed; every `ResizeObserver` tick\n * produces a fresh literal even when the numeric pair is unchanged, so\n * an `equal` fn on this signal is the foundation of the chart-graph\n * cascade short-circuit.\n */\nexport function dimensionsEqual(\n a: { width: number; height: number },\n b: { width: number; height: number },\n): boolean {\n return a.width === b.width && a.height === b.height;\n}\n\n/**\n * Field-wise equality on the chart's four-sided axis inset. The `inset`\n * computed rebuilds its literal whenever the projected axis set\n * re-emits, so without this guard an unchanged axis set would cascade\n * into the plot area and from there into both scale ranges and every\n * axis geometry on each pass.\n */\nexport function insetEqual(a: CngxChartInset, b: CngxChartInset): boolean {\n return (\n a.inlineStart === b.inlineStart &&\n a.inlineEnd === b.inlineEnd &&\n a.blockStart === b.blockStart &&\n a.blockEnd === b.blockEnd\n );\n}\n\n/**\n * Field-wise equality on the published plot rectangle. Only the four\n * corners are compared - `width`/`height` are derived from them, so an\n * equal pair of corners implies equal extents.\n */\nexport function plotAreaEqual(a: CngxChartPlotArea, b: CngxChartPlotArea): boolean {\n return a.x0 === b.x0 && a.y0 === b.y0 && a.x1 === b.x1 && a.y1 === b.y1;\n}\n\n/**\n * Field-wise equality on the slot context handed to every fallback\n * template. `small` is derived from `width`, so comparing it would be\n * redundant.\n *\n * The context is a fresh literal on every read, so without this a\n * resize that lands on the same pixel still re-renders every projected\n * loading / empty / error template.\n */\nexport function slotContextEqual(a: CngxChartSlotContext, b: CngxChartSlotContext): boolean {\n return a.width === b.width && a.height === b.height && plotAreaEqual(a.plot, b.plot);\n}\n","/**\n * Fixed-capacity FIFO ring. Once full, every `push` overwrites the oldest\n * entry - the buffer never grows past `capacity`, so a high-frequency\n * producer cannot leak memory into it. Pure TS, no signal dependency; the\n * reactive wrapper is {@link injectChartBuffer}.\n *\n * @internal - the public realtime surface is {@link injectChartBuffer};\n * consumers never touch the raw ring.\n *\n * @category common/chart/buffer\n */\nexport interface RingBuffer<T> {\n /** Append one value, evicting the oldest when at capacity. */\n push(value: T): void;\n /**\n * Append many values in order. When `values` exceeds `capacity`, only the\n * final `capacity` entries can survive, so the doomed prefix is skipped\n * rather than pushed-then-overwritten.\n */\n pushBatch(values: readonly T[]): void;\n /** Reset length to zero without re-allocating the backing store. */\n clear(): void;\n /**\n * A fresh in-order array (oldest first, newest last). Allocates on every\n * call - the caller is the cascade boundary and owns dedup.\n */\n snapshot(): readonly T[];\n /** Current element count, `0..capacity`. */\n length(): number;\n /** The fixed maximum element count. */\n readonly capacity: number;\n}\n\n/**\n * Construct a {@link RingBuffer} with a fixed `capacity`. The backing array\n * is allocated once; no growth, no per-push allocation.\n *\n * @param capacity positive integer maximum element count.\n * @throws when `capacity` is not a positive integer.\n *\n * @category common/chart/buffer\n */\nexport function createRingBuffer<T>(capacity: number): RingBuffer<T> {\n if (!Number.isInteger(capacity) || capacity <= 0) {\n throw new Error(`createRingBuffer: capacity must be a positive integer, got ${capacity}`);\n }\n\n const store = new Array<T>(capacity);\n let head = 0; // next write slot\n let size = 0;\n\n function push(value: T): void {\n store[head] = value;\n head = (head + 1) % capacity;\n if (size < capacity) {\n size++;\n }\n }\n\n function pushBatch(values: readonly T[]): void {\n const start = values.length > capacity ? values.length - capacity : 0;\n for (let i = start; i < values.length; i++) {\n push(values[i]);\n }\n }\n\n function clear(): void {\n head = 0;\n size = 0;\n }\n\n function snapshot(): readonly T[] {\n const out = new Array<T>(size);\n const oldest = (head - size + capacity) % capacity;\n for (let i = 0; i < size; i++) {\n out[i] = store[(oldest + i) % capacity];\n }\n return out;\n }\n\n function length(): number {\n return size;\n }\n\n return { push, pushBatch, clear, snapshot, length, capacity };\n}\n","import { DestroyRef, computed, inject, signal, type Signal } from '@angular/core';\n\nimport { sameItemsArr } from '../chart/equal-helpers';\nimport { downsampleLTTB } from './lttb';\nimport { createRingBuffer } from './ring-buffer';\n\n/**\n * Construction options for {@link injectChartBuffer}.\n *\n * @category common/chart/buffer\n */\nexport interface ChartBufferOptions<T> {\n /** Ring capacity - the maximum rows retained before eviction. */\n readonly capacity: number;\n /**\n * When set and the ring holds more than this many rows, `points` is\n * LTTB-downsampled to exactly this length. Omit to emit the raw window.\n */\n readonly downsampleTo?: number;\n /** Projects a row to its numeric X for the LTTB triangle area. */\n readonly xAccessor: (d: T, i: number) => number;\n /** Projects a row to its numeric Y for the LTTB triangle area. */\n readonly yAccessor: (d: T, i: number) => number;\n}\n\n/**\n * The realtime feed handle returned by {@link injectChartBuffer}. Bind\n * `points` to a chart data input; drive it from any high-frequency producer\n * via `push` / `pushBatch`.\n *\n * @category common/chart/buffer\n */\nexport interface CngxChartBuffer<T> {\n /**\n * The current (optionally downsampled) window, rAF-coalesced. Carries an\n * element-wise `equal` guard so a flush reselecting the same rows does not\n * cascade downstream.\n */\n readonly points: Signal<readonly T[]>;\n /** Append one row; schedules a flush for the next animation frame. */\n push(value: T): void;\n /** Append many rows in order; schedules a single flush. */\n pushBatch(values: readonly T[]): void;\n /** Empty the ring; the emptied window emits on the next flush. */\n clear(): void;\n /** The fixed ring capacity. */\n readonly capacity: number;\n /** Current retained row count, `0..capacity`, reflecting the last flush. */\n readonly length: Signal<number>;\n /** `true` while a flush is scheduled but not yet applied - drive a busy hint. */\n readonly pendingFlush: Signal<boolean>;\n}\n\n/**\n * Bounded, rAF-coalesced realtime feed for `<cngx-chart>`. Wraps a\n * fixed-capacity ring ({@link createRingBuffer}) with an optional LTTB\n * downsample ({@link downsampleLTTB}) and exposes the window as a `Signal`.\n *\n * Multiple `push` / `pushBatch` / `clear` calls within one animation frame\n * collapse into a single `points` emission: each mutation writes the ring\n * imperatively and schedules one `requestAnimationFrame(flush)`; the flush\n * bumps a revision signal that `points` derives from. The flush is a plain\n * callback writing a signal - not an `effect()` body - so no reactive\n * exception class is involved.\n *\n * Runs in an injection context; the rAF handle is cancelled via `DestroyRef`.\n *\n * ```typescript\n * export class Telemetry {\n * private readonly buffer = injectChartBuffer<Sample>({\n * capacity: 1000,\n * downsampleTo: 600,\n * xAccessor: (s) => s.t,\n * yAccessor: (s) => s.value,\n * });\n * protected readonly points = this.buffer.points; // -> <cngx-chart [data]>\n * onSample(s: Sample): void {\n * this.buffer.push(s);\n * }\n * }\n * ```\n *\n * @category common/chart/buffer\n */\nexport function injectChartBuffer<T>(opts: ChartBufferOptions<T>): CngxChartBuffer<T> {\n const destroyRef = inject(DestroyRef);\n const ring = createRingBuffer<T>(opts.capacity);\n\n const revision = signal(0);\n const pending = signal(false);\n let rafHandle: number | null = null;\n\n const points = computed<readonly T[]>(\n () => {\n revision();\n const snap = ring.snapshot();\n if (opts.downsampleTo === undefined || snap.length <= opts.downsampleTo) {\n return snap;\n }\n return downsampleLTTB(snap, opts.downsampleTo, opts.xAccessor, opts.yAccessor);\n },\n { equal: sameItemsArr },\n );\n\n const length = computed(() => {\n revision();\n return ring.length();\n });\n\n function flush(): void {\n rafHandle = null;\n pending.set(false);\n revision.update((n) => n + 1);\n }\n\n function scheduleFlush(): void {\n if (rafHandle !== null) {\n return;\n }\n pending.set(true);\n rafHandle = requestAnimationFrame(flush);\n }\n\n function push(value: T): void {\n ring.push(value);\n scheduleFlush();\n }\n\n function pushBatch(values: readonly T[]): void {\n ring.pushBatch(values);\n scheduleFlush();\n }\n\n function clear(): void {\n ring.clear();\n scheduleFlush();\n }\n\n destroyRef.onDestroy(() => {\n if (rafHandle !== null) {\n cancelAnimationFrame(rafHandle);\n rafHandle = null;\n }\n });\n\n return {\n points,\n push,\n pushBatch,\n clear,\n capacity: opts.capacity,\n length,\n pendingFlush: pending.asReadonly(),\n };\n}\n","import { InjectionToken, type Signal } from '@angular/core';\nimport { type CngxAxisPosition, type CngxAxisType } from './axis-position';\n\n/**\n * What `<cngx-chart>` needs from an axis, and nothing more.\n *\n * Two things travel over this contract. The scale half (`position` /\n * `type` / `domain`) tells the chart which scale to build and over what\n * range of values. The geometry half (`reservation` /\n * `crossReservation`) tells it how much of the box that axis's\n * decoration needs, so the chart can shrink the plot area to fit.\n *\n * Both implementations in the library are axes in the loose sense but\n * differ in what they do: {@link CngxAxis} draws ticks, labels and a\n * title and reserves room for them; `CngxAxisDomain` draws nothing and\n * reserves nothing, existing purely to publish a scale domain. The\n * chart cannot tell them apart, which is the point - it places and\n * sizes against the contract, never against a concrete class.\n *\n * Implement it on your own directive when you need an axis the chart\n * participates with but the library does not ship: a logarithmic scale\n * publisher, an axis whose domain comes from a service, a decoration\n * you draw yourself. Provide it with `useExisting` and the chart picks\n * the directive up through its content query.\n *\n * @category common/chart/axis\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/axis/chart-axis.ts\n * @since 0.1.0\n * @relatedTo CngxAxis, CngxAxisDomain, CngxChart\n */\nexport interface CngxChartAxis {\n /** Which edge of the plot area this axis occupies. */\n readonly position: Signal<CngxAxisPosition>;\n /** Scale kind the chart builds for this axis's dimension. */\n readonly type: Signal<CngxAxisType>;\n /** Value range the scale maps from. `undefined` yields a NOOP scale. */\n readonly domain: Signal<readonly unknown[] | undefined>;\n /**\n * How far this axis's decoration extends perpendicular to its own\n * line, in viewBox user units. The chart reserves it on the side\n * {@link position} names. Return `0` to claim no room.\n */\n readonly reservation: Signal<number>;\n /**\n * How far this axis's decoration extends *along* its own line, past\n * the plot corner at either end. The chart reserves it on the two\n * sides perpendicular to {@link position}. Return `0` to claim no\n * room.\n */\n readonly crossReservation: Signal<number>;\n}\n\n/**\n * Contract token every axis provides and `<cngx-chart>` queries.\n *\n * The chart's content query resolves this rather than a concrete class,\n * so a consumer-authored axis participates in scale building and plot\n * insetting on equal terms with the ones the library ships.\n *\n * @category common/chart/axis\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/axis/chart-axis.ts\n * @since 0.1.0\n * @relatedTo CngxChartAxis, CngxAxis, CngxAxisDomain\n */\nexport const CNGX_CHART_AXIS = new InjectionToken<CngxChartAxis>('CNGX_CHART_AXIS');\n","import { inject, InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Numeric input shape every concrete scale accepts. Linear scales take\n * `number`, time scales take `Date | number`, band scales take `string`\n * or arbitrary references via {@link createBandScale}'s generic. The\n * union narrows at the layer atom (`[cngxLine]`, `[cngxBar]`, ...);\n * the chart context surface stays scale-agnostic.\n *\n * @category common/chart\n */\nexport type XScaleInput = number | Date | string;\n\n/**\n * Generic scale function shape. Maps a domain value of type `TIn` to a\n * range value (typically a pixel coordinate). Mirrors the result type\n * of every `create*Scale` factory in `@cngx/common/chart`.\n *\n * @category common/chart\n */\nexport type ScaleFn<TIn> = (v: TIn) => number;\n\n/**\n * Space reserved inside the viewBox for axis decoration, in viewBox\n * user units. Logical, not physical: `inlineStart` is the left edge in\n * an LTR writing mode. A side with no axis on it reserves `0`.\n *\n * Chart-internal. The context publishes the resulting\n * {@link CngxChartPlotArea} instead, so the rectangle is derived once\n * rather than reconstructed from the box and the inset at every reader.\n *\n * @internal\n */\nexport interface CngxChartInset {\n readonly inlineStart: number;\n readonly inlineEnd: number;\n readonly blockStart: number;\n readonly blockEnd: number;\n}\n\n/**\n * The rectangle the chart's scales map onto: the viewBox minus the\n * space reserved for axis decoration, in viewBox user units. Without\n * axes it equals the box.\n *\n * `x0`/`y0` are the top-left corner, `x1`/`y1` the bottom-right one,\n * and `width`/`height` the extents between them. Every chart child that\n * needs to know where the plot starts reads this rather than\n * subtracting an inset from the box itself - one derivation, so the\n * scales and the axis lines cannot drift apart.\n *\n * A collapsed plot (a box narrower than the room its axes need) reports\n * `width` or `height` at or below `0`. Readers guard on the extent; the\n * chart hands out its NOOP scale in the same case.\n *\n * @category common/chart\n */\nexport interface CngxChartPlotArea {\n readonly x0: number;\n readonly y0: number;\n readonly x1: number;\n readonly y1: number;\n readonly width: number;\n readonly height: number;\n}\n\n/**\n * Reactive context published by `<cngx-chart>` to its content children.\n * Layer atoms (`[cngxLine]`, `[cngxBar]`, ...) and `[cngxAxis]` inject\n * {@link CNGX_CHART_CONTEXT} to read the parent chart's scales,\n * dimensions, data length, and data array without needing a direct\n * reference to the parent class. Token is non-generic at the DI\n * boundary; layer atoms call `data<T>()` to narrow the array to their\n * own `<T>` - the single boundary cast lives inside `CngxChart`'s\n * `data<U>()` method, not at every consumer site.\n *\n * @category common/chart\n */\nexport interface CngxChartContext<TX = XScaleInput, TY = number> {\n readonly xScale: Signal<ScaleFn<TX>>;\n readonly yScale: Signal<ScaleFn<TY>>;\n readonly dimensions: Signal<{ width: number; height: number }>;\n /**\n * The plot rectangle inside the viewBox, after the room the projected\n * axes need for their decoration. The chart's own scale ranges and\n * `[cngxAxis]`'s line placement both read this single derivation, so\n * ticks always line up with marks. A chart without axes gets the full\n * box.\n */\n readonly plot: Signal<CngxChartPlotArea>;\n readonly dataLength: Signal<number>;\n /**\n * Generic-aware data accessor. Reads the chart's reactive data\n * array; the consumer's `<T>` parameter narrows the returned type\n * without a per-call cast at the consumer site. The chart performs\n * one boundary cast in its implementation.\n */\n data<T = unknown>(): readonly T[];\n /**\n * SVG-output gate (default `true`). Layer atoms wrap their own\n * `<svg:path>` / `<svg:rect>` / `<svg:circle>` emission behind\n * `@if (ctx.renderSvg())`. The chart shell drives this `false` only\n * when Canvas mode is active - an atom asks \"should I render my own\n * SVG?\", never \"what mode am I in?\".\n */\n readonly renderSvg: Signal<boolean>;\n}\n\n/**\n * Injection token consumed by every chart child (`[cngxAxis]`, layer\n * atoms, `<cngx-chart-data-table>`). `<cngx-chart>` provides itself\n * via `useExisting`; child queries narrow the generic on the consumer\n * side.\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/chart-context.ts\n * @since 0.1.0\n */\nexport const CNGX_CHART_CONTEXT = new InjectionToken<CngxChartContext>('CngxChartContext');\n\n/**\n * Inject the parent chart's reactive context. Throws a clear dev-mode\n * error when the consumer is not mounted as a content child of\n * `<cngx-chart>`. The `consumerName` argument is interpolated into the\n * error message so the consumer-class name surfaces at the call site\n * rather than a generic guard string.\n *\n * Replaces six verbatim copies of the same six-line helper that\n * previously lived inline in every layer atom.\n */\nexport function injectChartContext(consumerName: string): CngxChartContext {\n const ctx = inject(CNGX_CHART_CONTEXT, { optional: true });\n if (!ctx) {\n throw new Error(\n `${consumerName}: missing CNGX_CHART_CONTEXT - must be a content child of <cngx-chart>`,\n );\n }\n return ctx;\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Backend-agnostic geometry a layer atom publishes for rendering. A\n * discriminated union: each variant carries exactly the primitives its\n * kind needs, and nothing more. Both the SVG self-render path and the\n * Canvas renderer paint against this same shape, so a single\n * layer-authoring API drives either backend.\n *\n * Coordinates are already scale-projected (pixel space); `color` is\n * `null` when the atom defers to its CSS custom property (the SVG path\n * reads the var directly, the Canvas renderer resolves it via\n * `getComputedStyle`).\n *\n * @category common/chart/layers\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/chart-layer.ts\n * @since 0.1.0\n */\nexport type LayerGeometry =\n | {\n readonly kind: 'line' | 'area';\n readonly d: string;\n readonly color: string | null;\n readonly strokeWidth: number | string | null;\n readonly fill?: string | null;\n readonly opacity?: number | null;\n /**\n * Optional point-marker pass a mark layer emits alongside its\n * path - the scale-projected centres of the datapoints the layer\n * chooses to mark (e.g. the lone datum of a warming series). Both\n * the SVG template and the Canvas renderer paint these as small\n * filled circles in the layer's resolved colour. Absent / empty\n * when the layer draws no markers.\n */\n readonly points?: readonly { readonly cx: number; readonly cy: number }[];\n }\n | {\n readonly kind: 'bar';\n readonly rects: readonly {\n readonly x: number;\n readonly y: number;\n readonly w: number;\n readonly h: number;\n readonly color: string | null;\n }[];\n }\n | {\n readonly kind: 'scatter';\n readonly marks: readonly {\n readonly cx: number;\n readonly cy: number;\n readonly r: number;\n readonly color: string | null;\n }[];\n }\n | {\n readonly kind: 'threshold';\n readonly x1: number;\n readonly y1: number;\n readonly x2: number;\n readonly y2: number;\n readonly color: string | null;\n readonly dashed: boolean;\n }\n | {\n readonly kind: 'band';\n readonly x: number;\n readonly y: number;\n readonly w: number;\n readonly h: number;\n readonly color: string | null;\n readonly opacity: number | null;\n };\n\n/**\n * Contract every layer atom (`[cngxLine]`, `[cngxBar]`, ...) self-provides\n * via {@link CNGX_CHART_LAYER}. The chart shell and the Canvas renderer\n * read layer geometry through this token instead of scraping the DOM.\n *\n * @category common/chart/layers\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/chart-layer.ts\n * @since 0.1.0\n */\nexport interface CngxChartLayer {\n /** The layer's scale-projected geometry, cascade-guarded by an `equal` fn. */\n readonly geometry: Signal<LayerGeometry>;\n}\n\n/**\n * Injection token each layer atom provides via\n * `{ provide: CNGX_CHART_LAYER, useExisting: CngxX }`. A\n * `contentChildren(CNGX_CHART_LAYER, { descendants: true })` query on the\n * chart shell collects every mounted layer's geometry through DI.\n *\n * @category common/chart/layers\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/chart-layer.ts\n * @since 0.1.0\n * @relatedTo CngxLine, CngxArea, CngxBar, CngxScatter, CngxThreshold, CngxBand\n */\nexport const CNGX_CHART_LAYER = new InjectionToken<CngxChartLayer>('CngxChartLayer');\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectChartContext } from '../chart/chart-context';\nimport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './chart-layer';\n\n/**\n * Threshold reference atom. Renders a single horizontal `<line>` at\n * `yScale(value)` spanning the chart's full width, plus an optional\n * `<text>` label at the right edge.\n *\n * Common use: target threshold (\"budget cap\"), warning bands, or any\n * \"line at value\" reference. Always reads scales from\n * {@link CNGX_CHART_CONTEXT}.\n *\n * Attribute-selector on `<svg:g>` - see {@link CngxLine} for why.\n *\n * @category common/chart/layers\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/threshold.component.ts\n * @since 0.1.0\n * @relatedTo CngxBand, CngxChart, CngxLine\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxThreshold]',\n exportAs: 'cngxThreshold',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_LAYER, useExisting: CngxThreshold }],\n template: `\n @if (bounds(); as g) {\n @if (ctx.renderSvg()) {\n <svg:line\n class=\"cngx-threshold__line\"\n [attr.x1]=\"g.x1\"\n [attr.y1]=\"g.y\"\n [attr.x2]=\"g.x2\"\n [attr.y2]=\"g.y\"\n [attr.stroke-dasharray]=\"dashed() ? '4 3' : null\"\n />\n }\n <!--\n Outside the renderSvg gate on purpose: the canvas backend paints\n marks, never text, so gating the label on it would delete the\n label at the auto-switch threshold. Same split CngxAxis already\n makes - decoration stays SVG in both modes, only the\n volume-dependent geometry moves to canvas.\n -->\n @if (label(); as l) {\n <svg:text\n class=\"cngx-threshold__label\"\n [attr.x]=\"g.x2 - 4\"\n [attr.y]=\"g.y - 4\"\n text-anchor=\"end\"\n >\n {{ l }}\n </svg:text>\n }\n }\n `,\n styles: [\n `\n .cngx-threshold__line {\n stroke: var(--cngx-threshold-color, var(--cngx-chart-danger, currentColor));\n stroke-width: var(--cngx-threshold-stroke-width, 1px);\n fill: none;\n animation: cngx-threshold-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n .cngx-threshold__label {\n fill: var(--cngx-threshold-text-color, var(--cngx-chart-danger, currentColor));\n font-size: var(--cngx-threshold-font-size, 11px);\n unicode-bidi: var(--cngx-chart-numeric-bidi, isolate);\n animation: cngx-threshold-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n @keyframes cngx-threshold-enter {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .cngx-threshold__line,\n .cngx-threshold__label {\n animation: none;\n }\n }\n `,\n ],\n})\nexport class CngxThreshold implements CngxChartLayer {\n readonly value = input.required<number>();\n readonly label = input<string | null>(null);\n readonly dashed = input<boolean>(false);\n\n protected readonly ctx = injectChartContext('CngxThreshold');\n\n protected readonly bounds = computed<{ x1: number; x2: number; y: number } | null>(\n () => {\n // Spans the plot, not the box - a threshold line running under\n // the left axis's tick labels reads as a stray rule through the\n // gutter rather than as a level on the chart.\n const { x0, x1, width, height } = this.ctx.plot();\n if (width <= 0 || height <= 0) {\n return null;\n }\n const y = this.ctx.yScale()(this.value());\n return { x1: x0, x2: x1, y };\n },\n {\n equal: (a, b) =>\n a === b || (a !== null && b !== null && a.x1 === b.x1 && a.x2 === b.x2 && a.y === b.y),\n },\n );\n\n readonly geometry = computed<LayerGeometry>(\n () => {\n const b = this.bounds();\n const y = b?.y ?? 0;\n return {\n kind: 'threshold',\n x1: b?.x1 ?? 0,\n y1: y,\n x2: b?.x2 ?? 0,\n y2: y,\n color: null,\n dashed: this.dashed(),\n };\n },\n { equal: thresholdGeomEqual },\n );\n}\n\n/** @internal */\nfunction thresholdGeomEqual(a: LayerGeometry, b: LayerGeometry): boolean {\n if (a === b) {\n return true;\n }\n if (a.kind !== 'threshold' || b.kind !== 'threshold') {\n return false;\n }\n return (\n a.x1 === b.x1 &&\n a.y1 === b.y1 &&\n a.x2 === b.x2 &&\n a.y2 === b.y2 &&\n a.color === b.color &&\n a.dashed === b.dashed\n );\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Summary input describing the chart's current data shape. Consumed by\n * `CngxChartI18n.summary()` to produce the `aria-label` text the\n * `<cngx-chart>` host announces to screen readers.\n *\n * @category common/chart/i18n\n */\nexport interface CngxChartSummary {\n readonly trend: 'up' | 'down' | 'flat';\n readonly min: number;\n readonly max: number;\n readonly current: number;\n readonly thresholds: readonly number[];\n}\n\n/**\n * i18n surface for `@cngx/common/chart`. Mirrors the `CNGX_RECYCLER_I18N`\n * shape from `@cngx/common/data` - factory defaults supply English;\n * consumers override per-app via {@link provideChartI18n}.\n *\n * @category common/chart/i18n\n */\nexport interface CngxChartI18n {\n readonly summary: (input: CngxChartSummary) => string;\n readonly dataTable: () => string;\n readonly valueColumnLabel: () => string;\n readonly trendChanged: (trend: 'up' | 'down' | 'flat') => string;\n readonly thresholdAlert: (threshold: number) => string;\n readonly connectionLost: () => string;\n readonly connectionReconnecting: () => string;\n readonly connectionRestored: () => string;\n readonly empty: () => string;\n readonly loading: () => string;\n readonly error: () => string;\n}\n\n/**\n * Injection token for chart i18n strings. Defaults to English via\n * `factory:`. Override at app root with {@link provideChartI18n}.\n *\n * @category common/chart/i18n\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/i18n/chart-i18n.ts\n * @since 0.1.0\n */\nexport const CNGX_CHART_I18N = new InjectionToken<CngxChartI18n>('CngxChartI18n', {\n providedIn: 'root',\n factory: (): CngxChartI18n => ({\n summary: ({ trend, min, max, current, thresholds }) => {\n const trendText =\n trend === 'up' ? 'Trending up' : trend === 'down' ? 'Trending down' : 'Flat';\n const thresholdText =\n thresholds.length === 0\n ? 'No thresholds.'\n : thresholds.length === 1\n ? 'One threshold crossing.'\n : `${thresholds.length} threshold crossings.`;\n return `${trendText}. Min ${min}, max ${max}, current ${current}. ${thresholdText}`;\n },\n dataTable: () => 'Data table',\n valueColumnLabel: () => 'Value',\n trendChanged: (trend) =>\n trend === 'up'\n ? 'Trend changed to up'\n : trend === 'down'\n ? 'Trend changed to down'\n : 'Trend flattened',\n thresholdAlert: (threshold) => `Threshold ${threshold} crossed`,\n connectionLost: () => 'Connection lost',\n connectionReconnecting: () => 'Reconnecting',\n connectionRestored: () => 'Connection restored',\n empty: () => 'No data',\n loading: () => 'Loading',\n error: () => 'Error loading chart',\n }),\n});\n\n/**\n * Provider helper for custom chart i18n strings.\n *\n * ```typescript\n * providers: [provideChartI18n({\n * summary: ({ trend, min, max, current, thresholds }) =>\n * `${trend === 'up' ? 'Aufwärtstrend' : 'Abwärtstrend'}. Min ${min}, Max ${max}, aktuell ${current}.`,\n * dataTable: () => 'Datentabelle',\n * // ...remaining keys\n * })]\n * ```\n *\n * @category common/chart/i18n\n */\nexport function provideChartI18n(i18n: CngxChartI18n): {\n provide: typeof CNGX_CHART_I18N;\n useValue: CngxChartI18n;\n} {\n return { provide: CNGX_CHART_I18N, useValue: i18n };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { nextUid } from '@cngx/core/utils';\nimport { CNGX_CHART_I18N } from '../i18n/chart-i18n';\n\n/**\n * Internal SR-only data-table view. The parent `<cngx-chart>` mounts\n * one of these and links it via `aria-describedby`\n * (`chart.component.ts`), and that link never disappears from the host.\n * The element is always visually SR-only (the clip/offscreen host\n * styles below), so nothing about it ever paints. What toggles is its\n * accessibility-tree visibility: the chart binds the `hidden` input\n * (`chart.component.ts`) from its `tableActive` predicate and\n * `activeView`, and the host maps that input to `[attr.aria-hidden]`.\n * This is the Pillar-2 always-in-DOM contract: the `aria-describedby`\n * id stays referenced whether or not the table is exposed to AT; only\n * `aria-hidden` flips.\n *\n * The current surface is single-column (\"Value\") backed by the chart's\n * `summary`-projected numeric values; the column header derivation is\n * intentionally minimal, and may later widen to one column per layer\n * accessor.\n *\n * @internal\n */\n@Component({\n selector: 'cngx-chart-data-table',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '[id]': 'resolvedId()',\n '[attr.aria-hidden]': 'hidden() ? \"true\" : \"false\"',\n },\n template: `\n <table class=\"cngx-chart-data-table__table\">\n <caption>\n {{\n caption()\n }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">#</th>\n <th scope=\"col\">{{ valueColumnLabel() }}</th>\n </tr>\n </thead>\n <tbody>\n @for (row of rows(); track row.index) {\n <tr>\n <th scope=\"row\">{{ row.index + 1 }}</th>\n <td>{{ row.value }}</td>\n </tr>\n }\n </tbody>\n </table>\n `,\n styles: [\n `\n cngx-chart-data-table {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n }\n `,\n ],\n})\nexport class CngxChartDataTable {\n readonly values = input.required<readonly number[]>();\n readonly hidden = input.required<boolean>();\n /**\n * Stable id consumed by the chart's `aria-describedby` binding.\n * Optional input - when omitted, falls back to a per-instance\n * `nextUid`-allocated default. Two standalone tables without an\n * explicit `[id]` therefore receive different ids; the always-in-\n * DOM rule cannot be violated by an unset input.\n */\n readonly id = input<string | undefined>(undefined);\n\n private readonly defaultId = nextUid('cngx-chart-data-table');\n private readonly i18n = inject(CNGX_CHART_I18N);\n\n /**\n * Resolved host id - the explicit `[id]` input wins over the\n * per-instance default. The host binding reads this signal so\n * external `aria-describedby` references stay live across input\n * changes.\n */\n protected readonly resolvedId = computed(() => this.id() ?? this.defaultId);\n\n protected readonly caption = computed(() => this.i18n.dataTable());\n protected readonly valueColumnLabel = computed(() => this.i18n.valueColumnLabel());\n\n protected readonly rows = computed<readonly { index: number; value: number }[]>(\n () => {\n const vs = this.values();\n const out = new Array<{ index: number; value: number }>(vs.length);\n for (let i = 0; i < vs.length; i++) {\n out[i] = { index: i, value: vs[i] };\n }\n return out;\n },\n {\n equal: (a, b) => {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i].index !== b[i].index || !Object.is(a[i].value, b[i].value)) {\n return false;\n }\n }\n return true;\n },\n },\n );\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\nimport type { CngxChartPlotArea } from './chart-context';\n\n/**\n * Common context shape passed into every chart slot template\n * (loading, empty, error). Carries the chart's current rendered\n * dimensions plus a `small` discriminator so consumers can switch\n * between a compact and a richer fallback in the same template:\n *\n * ```html\n * <ng-template cngxChartEmpty let-small=\"small\">\n * @if (small) {\n * <span class=\"cngx-empty-compact\">No data</span>\n * } @else {\n * <cngx-empty-state title=\"No telemetry yet\" description=\"...\" />\n * }\n * </ng-template>\n * ```\n *\n * The `small` flag is true when the chart's rendered width is below\n * the threshold defined by the `--cngx-chart-small-width-px` CSS\n * custom property (read from the chart at first render via the\n * `CHART_SMALL_BREAKPOINT_PX` constant; default 400). Container-size\n * based, not viewport-based, so it works correctly inside dashboard\n * cells of any size.\n *\n * @category common/chart\n */\nexport interface CngxChartSlotContext {\n readonly width: number;\n readonly height: number;\n readonly small: boolean;\n /**\n * The rectangle the chart's marks occupy: the viewBox minus the room\n * the projected axes reserved for their decoration. Without axes it\n * equals the box.\n *\n * Slot templates paint over the chart, and since the axis gutter\n * landed the box is no longer the drawing surface - a fallback\n * centred on `width`/`height` sits off-centre from the marks it\n * replaces. Align to this instead when the fallback should line up\n * with the plot rather than with the host.\n *\n * In viewBox user units. `width`/`height` above stay the *rendered*\n * host size, so the two are in different spaces whenever an explicit\n * `[width]` chart is squeezed; use the `--cngx-chart-plot-*` custom\n * properties for CSS-side alignment, which are resolution-independent.\n */\n readonly plot: CngxChartPlotArea;\n}\n\n/**\n * Threshold (px) below which `CngxChartSlotContext.small` is true.\n * Hardcoded for v1; later releases may make this a config token.\n *\n * @category common/chart\n */\nexport const CHART_SMALL_BREAKPOINT_PX = 400;\n\n/**\n * Per-instance loading slot for `<cngx-chart>`. Project an\n * `<ng-template cngxChartLoading>` to override the default centred\n * spinner. The template receives a {@link CngxChartSlotContext} with\n * the chart's rendered width/height plus a `small` flag for\n * container-size-aware branching.\n *\n * ```html\n * <cngx-chart [state]=\"state()\">\n * <ng-template cngxChartLoading let-small=\"small\">\n * @if (small) { <my-mini-spinner /> }\n * @else { <my-branded-spinner /> }\n * </ng-template>\n * </cngx-chart>\n * ```\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts\n * @since 0.1.0\n * @relatedTo CngxChartSlotContext, CngxChartEmpty, CngxChartError, CngxChart\n */\n@Directive({\n selector: 'ng-template[cngxChartLoading]',\n standalone: true,\n})\nexport class CngxChartLoading {\n readonly templateRef = inject(TemplateRef<CngxChartSlotContext>);\n}\n\n/**\n * Per-instance empty slot for `<cngx-chart>`. Receives a\n * {@link CngxChartSlotContext} so the consumer can branch on chart\n * size - typically a compact text fallback when `small` is true and\n * a richer surface (`<cngx-empty-state>`, illustration, action) at\n * regular sizes.\n *\n * ```html\n * <cngx-chart [state]=\"state()\">\n * <ng-template cngxChartEmpty let-small=\"small\" let-plot=\"plot\">\n * <span>No readings in this range ({{ plot.width }} wide)</span>\n * </ng-template>\n * </cngx-chart>\n * ```\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts\n * @since 0.1.0\n * @relatedTo CngxChartSlotContext, CngxChartLoading, CngxChartError, CngxChart\n */\n@Directive({\n selector: 'ng-template[cngxChartEmpty]',\n standalone: true,\n})\nexport class CngxChartEmpty {\n readonly templateRef = inject(TemplateRef<CngxChartSlotContext>);\n}\n\n/**\n * Context for the `*cngxChartError` slot template. Extends the\n * common slot context with the live error value via `$implicit` and\n * `error` keys, so consumers can render a typed message AND branch\n * on chart size.\n *\n * @category common/chart\n */\nexport interface CngxChartErrorContext extends CngxChartSlotContext {\n readonly $implicit: unknown;\n readonly error: unknown;\n}\n\n/**\n * `*cngxChartError` slot - overrides the chart-level error placeholder.\n * Receives a {@link CngxChartErrorContext}.\n *\n * ```html\n * <cngx-chart [state]=\"state()\">\n * <ng-template cngxChartError let-error let-small=\"small\">\n * <span>Could not load: {{ error?.message }}</span>\n * </ng-template>\n * </cngx-chart>\n * ```\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts\n * @since 0.1.0\n * @relatedTo CngxChartErrorContext, CngxChartLoading, CngxChartEmpty, CngxChart\n */\n@Directive({\n selector: 'ng-template[cngxChartError]',\n standalone: true,\n})\nexport class CngxChartError {\n readonly templateRef = inject(TemplateRef<CngxChartErrorContext>);\n}\n\n/**\n * Context for the connection-lifecycle slots (`*cngxChartConnectionError`,\n * `*cngxChartReconnecting`). Extends the common slot context with the live\n * connection error value via `$implicit` / `error`, mirroring\n * {@link CngxChartErrorContext}. The connection channel is separate from\n * the data `[state]` channel, so this context reflects `[connectionState]`.\n *\n * @category common/chart\n */\nexport interface CngxChartConnectionContext extends CngxChartSlotContext {\n readonly $implicit: unknown;\n readonly error: unknown;\n}\n\n/**\n * `*cngxChartConnectionError` slot - overrides the default banner shown\n * when `[connectionState]` reports `'error'` (connection lost). Overlaid on\n * top of the data view with `role=\"alert\"`; receives a\n * {@link CngxChartConnectionContext}.\n *\n * ```html\n * <cngx-chart [connectionState]=\"socket\">\n * <ng-template cngxChartConnectionError let-error>\n * <span>Live feed lost: {{ error?.message }}</span>\n * </ng-template>\n * </cngx-chart>\n * ```\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts\n * @since 0.1.0\n * @relatedTo CngxChartConnectionContext, CngxChartReconnecting, CngxChart\n */\n@Directive({\n selector: 'ng-template[cngxChartConnectionError]',\n standalone: true,\n})\nexport class CngxChartConnectionError {\n readonly templateRef = inject(TemplateRef<CngxChartConnectionContext>);\n}\n\n/**\n * `*cngxChartReconnecting` slot - overrides the default subtle indicator\n * shown when `[connectionState]` reports `'refreshing'` (reconnecting).\n * Overlaid with `role=\"status\"` (polite); receives a\n * {@link CngxChartConnectionContext}.\n *\n * ```html\n * <cngx-chart [connectionState]=\"socket\">\n * <ng-template cngxChartReconnecting let-small=\"small\">\n * <span>{{ small ? 'Reconnecting' : 'Reconnecting to the live feed' }}</span>\n * </ng-template>\n * </cngx-chart>\n * ```\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts\n * @since 0.1.0\n * @relatedTo CngxChartConnectionContext, CngxChartConnectionError, CngxChart\n */\n@Directive({\n selector: 'ng-template[cngxChartReconnecting]',\n standalone: true,\n})\nexport class CngxChartReconnecting {\n readonly templateRef = inject(TemplateRef<CngxChartConnectionContext>);\n}\n\n/**\n * `*cngxChartOverlay` slot - projects HTML *on top of the marks*, inside\n * the plot area. Unlike the loading / empty / error slots (which replace\n * the marks in their respective fallback arms), the overlay renders in the\n * `@default` content arm alongside the drawn chart, so it is where\n * crosshair readouts, hover tooltips, annotation callouts and brush\n * affordances belong.\n *\n * The chart positions the overlay frame itself, inset to the plot area via\n * the `--cngx-chart-plot-*` custom properties it already publishes - the\n * consumer performs no `exportAs`, no `plot()` / `dimensions()` arithmetic,\n * and needs no wrapper of their own to act as a containing block. Receives\n * the shared {@link CngxChartSlotContext}, so `plot` / `width` / `height` /\n * `small` are all readable from the template:\n *\n * ```html\n * <cngx-chart [data]=\"series()\" [width]=\"480\" [height]=\"200\">\n * <svg:g cngxAxis position=\"left\" type=\"linear\" [domain]=\"[0, 100000]\"></svg:g>\n * <svg:g cngxLine></svg:g>\n * <ng-template cngxChartOverlay let-plot=\"plot\">\n * <div class=\"my-callout\">{{ plot.width }}x{{ plot.height }} plot</div>\n * </ng-template>\n * </cngx-chart>\n * ```\n *\n * Pointer events: the frame is `pointer-events: none`, so it never\n * intercepts a click, hover or drag meant for the marks beneath it. An\n * interactive element inside the overlay opts back in per element with\n * `pointer-events: auto`. The default is off deliberately - an overlay\n * that silently swallows every pointer event on the chart is invisible\n * until some other interaction (a tooltip, a brush) stops firing, and\n * that is a debugging session; opting a single element back in is one\n * declaration.\n *\n * Accessibility: the chart host is `role=\"img\"` with an auto-summary\n * `aria-label`, so assistive technology sees the chart as a single\n * labelled graphic and never traverses into the overlay. Treat overlay\n * content as *visual* - a hover readout, a tint, an annotation callout.\n * Any state that has to reach AT belongs on the reactive summary or the\n * SR data-table (the `aria-describedby` channel the chart already owns),\n * not on an element projected here.\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts\n * @since 0.1.0\n * @relatedTo CngxChartSlotContext, CngxChartLoading, CngxChartEmpty, CngxChartError, CngxChart\n */\n@Directive({\n selector: 'ng-template[cngxChartOverlay]',\n standalone: true,\n})\nexport class CngxChartOverlay {\n readonly templateRef = inject(TemplateRef<CngxChartSlotContext>);\n}\n","import type { CngxChartSummary } from '../i18n/chart-i18n';\n\n/**\n * Pure helper that derives a `CngxChartSummary` from already-projected\n * numeric values plus a list of threshold values. The chart component\n * passes the result to `CngxChartI18n.summary()` to produce the\n * `aria-label` text the host announces to screen readers.\n *\n * Trend rule: if the last value is more than 5% of the data's range\n * above the first, the trend is `'up'`; below, `'down'`; otherwise\n * `'flat'`. The 5% deadband prevents trivial fluctuations from\n * flipping the trend label and keeps the summary stable across\n * minor data refreshes.\n *\n * Threshold rule: a threshold is \"crossed\" if the data series goes\n * from above to below or vice versa anywhere in the projected range.\n * The returned `thresholds` list is the subset of input thresholds\n * the data actually crosses, in input order.\n *\n * @internal\n */\nexport function computeChartSummary(\n values: readonly number[],\n thresholds: readonly number[],\n): CngxChartSummary {\n if (values.length === 0) {\n return { trend: 'flat', min: 0, max: 0, current: 0, thresholds: [] };\n }\n let min = values[0];\n let max = values[0];\n for (let i = 1; i < values.length; i++) {\n const v = values[i];\n if (v < min) {\n min = v;\n }\n if (v > max) {\n max = v;\n }\n }\n const first = values[0];\n const current = values[values.length - 1];\n const range = max - min;\n const deadband = range * 0.05;\n const delta = current - first;\n const trend: 'up' | 'down' | 'flat' =\n delta > deadband ? 'up' : delta < -deadband ? 'down' : 'flat';\n const crossed = thresholds.filter((t) => crossesThreshold(values, t));\n return { trend, min, max, current, thresholds: crossed };\n}\n\n/** @internal */\nfunction crossesThreshold(values: readonly number[], threshold: number): boolean {\n let above = values[0] > threshold;\n for (let i = 1; i < values.length; i++) {\n const nowAbove = values[i] > threshold;\n if (nowAbove !== above) {\n return true;\n }\n above = nowAbove;\n }\n return false;\n}\n","import { computed, linkedSignal, type Signal } from '@angular/core';\n\nimport { type CngxChartSummary } from '../i18n/chart-i18n';\n\n/** @internal */\ntype Trend = 'up' | 'down' | 'flat';\n\n/**\n * A significant, AT-worthy transition derived from the chart summary:\n * either the trend flipped, or the current value crossed a threshold.\n * A discriminated union - each variant carries exactly its own fields.\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/significant-change.ts\n * @since 0.1.0\n */\nexport type CngxSignificantChange =\n | { readonly kind: 'trend-flip'; readonly from: Trend; readonly to: Trend }\n | {\n readonly kind: 'threshold-cross';\n readonly threshold: number;\n readonly direction: 'up' | 'down';\n };\n\n/** @internal Structural equality so a re-emitted identical event does not cascade. */\nfunction significantChangeEqual(\n a: CngxSignificantChange | null,\n b: CngxSignificantChange | null,\n): boolean {\n if (a === b) {\n return true;\n }\n if (a === null || b === null) {\n return false;\n }\n if (a.kind !== b.kind) {\n return false;\n }\n if (a.kind === 'trend-flip' && b.kind === 'trend-flip') {\n return a.from === b.from && a.to === b.to;\n }\n if (a.kind === 'threshold-cross' && b.kind === 'threshold-cross') {\n return a.threshold === b.threshold && a.direction === b.direction;\n }\n return false;\n}\n\n/**\n * Derive the most recent significant transition from a chart-summary\n * signal, or `null` when the latest update carried no significance.\n *\n * Mirrors `createTransitionTracker`'s current/previous discipline: an\n * internal `linkedSignal` holds the current summary and the one before it\n * (structural-equality guarded), and the public signal is a `computed`\n * with its own structural `equal` - so a summary that re-emits an\n * equivalent shape yields the same `null` reference and never re-fires a\n * downstream effect. Threshold crossings take precedence over trend flips\n * (they are operationally more significant).\n *\n * The chart stays pure-derivation: effects that react to the event live in\n * the companion announcer, not here.\n *\n * @param summary the chart's `CngxChartSummary` signal.\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/significant-change.ts\n * @since 0.1.0\n */\nexport function createSignificantChangeTracker(\n summary: Signal<CngxChartSummary>,\n): Signal<CngxSignificantChange | null> {\n const pair = linkedSignal<\n CngxChartSummary,\n { current: CngxChartSummary; previous: CngxChartSummary | null }\n >({\n source: summary,\n computation: (current, prev) => ({ current, previous: prev?.value.current ?? null }),\n equal: (a, b) => a.current === b.current && a.previous === b.previous,\n });\n\n return computed<CngxSignificantChange | null>(\n () => {\n const { current, previous } = pair();\n if (!previous) {\n return null;\n }\n for (const threshold of current.thresholds) {\n const before = previous.current - threshold;\n const after = current.current - threshold;\n if (before !== 0 && after !== 0 && Math.sign(before) !== Math.sign(after)) {\n return { kind: 'threshold-cross', threshold, direction: after > 0 ? 'up' : 'down' };\n }\n }\n if (current.trend !== previous.trend) {\n return { kind: 'trend-flip', from: previous.trend, to: current.trend };\n }\n return null;\n },\n { equal: significantChangeEqual },\n );\n}\n","import { type DestroyRef, effect, linkedSignal, type Signal, untracked } from '@angular/core';\n\nimport { type CngxChartContext } from '../chart/chart-context';\nimport { dimensionsEqual } from '../chart/equal-helpers';\nimport { type LayerGeometry } from '../layers/chart-layer';\nimport { type CngxChartRenderer, type CngxChartRendererFactory } from './chart-renderer';\n\n/**\n * Construction dependencies for {@link createChartRendererController}.\n *\n * @category common/chart/renderer\n */\nexport interface ChartRendererControllerDeps {\n readonly host: HTMLElement;\n readonly ctx: CngxChartContext;\n readonly mode: Signal<'svg' | 'canvas'>;\n readonly geometries: Signal<readonly LayerGeometry[]>;\n readonly factory: CngxChartRendererFactory;\n readonly destroyRef: DestroyRef;\n}\n\n/**\n * Handle returned by {@link createChartRendererController}.\n *\n * @category common/chart/renderer\n */\nexport interface CngxChartRendererController {\n readonly currentMode: Signal<'svg' | 'canvas'>;\n destroy(): void;\n}\n\n/**\n * Owns the renderer mount / destroy / paint reactive lifecycle so the\n * chart shell holds no rendering brain. Installs two effects:\n *\n * - **mount** - tracks `mode()`; on change, destroys the previous backend,\n * builds the new one via `factory`, mounts it, and seeds the first paint.\n * - **paint** - tracks `geometries()` and the (structurally-deduped)\n * dimensions; repaints on every geometry emission and invalidates the\n * backend's color cache when the dimensions actually change.\n *\n * Both effects wrap their imperative renderer calls in `untracked()` so\n * the renderer's own signal reads never feed back into the effect graph.\n * The dimensions are tracked through a `linkedSignal` guarded by\n * {@link dimensionsEqual}, so a resize observer re-emitting the same\n * width/height literal does not trigger a redundant cache invalidation.\n *\n * Must run in an injection context (the chart shell calls it from a field\n * initialiser / constructor). Ships as a plain `create*` factory the shell\n * calls directly - no DI token, since the only second consumer today is a\n * test double, which injects a fake `factory` through the deps.\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/chart-renderer-controller.ts\n * @since 0.1.0\n */\nexport function createChartRendererController(\n deps: ChartRendererControllerDeps,\n): CngxChartRendererController {\n let current: CngxChartRenderer | null = null;\n\n // Structural-equality tracker: the resize observer re-emits a fresh\n // { width, height } literal every tick; dimensionsEqual short-circuits\n // the redundant re-paints / cache invalidations.\n const dims = linkedSignal(() => deps.ctx.dimensions(), { equal: dimensionsEqual });\n let lastDims = untracked(dims);\n\n // Mount effect: rebuild the backend whenever the mode flips, then seed\n // the first paint (the paint effect does not track `mode`, so the fresh\n // backend would otherwise stay blank until the next geometry change).\n effect(() => {\n const mode = deps.mode();\n untracked(() => {\n current?.destroy();\n current = deps.factory(mode, { ctx: deps.ctx, destroyRef: deps.destroyRef });\n current.mount(deps.host, deps.ctx);\n current.paint(deps.geometries());\n });\n });\n\n // Paint effect: repaint on geometry change; invalidate the color cache\n // only when the deduped dimensions actually changed.\n effect(() => {\n const geometries = deps.geometries();\n const nextDims = dims();\n untracked(() => {\n if (nextDims !== lastDims) {\n lastDims = nextDims;\n current?.invalidateColorCache?.();\n }\n current?.paint(geometries);\n });\n });\n\n deps.destroyRef.onDestroy(() => current?.destroy());\n\n return {\n currentMode: deps.mode,\n destroy: () => current?.destroy(),\n };\n}\n","import { type CngxChartContext } from '../chart/chart-context';\nimport { type LayerGeometry } from '../layers/chart-layer';\nimport { type ChartRendererDeps, type CngxChartRenderer } from './chart-renderer';\n\n/**\n * @internal Per-kind CSS custom-property fallback chain, resolved when a\n * geometry emits `color: null`. Mirrors each layer atom's SVG cascade\n * (`var(--cngx-<kind>-*, var(--cngx-chart-*, currentColor))`) so a\n * consumer's per-atom theming survives the SVG->Canvas crossover instead\n * of collapsing to the three chart-family colors.\n */\nconst KIND_VARS: Record<LayerGeometry['kind'], readonly string[]> = {\n line: ['--cngx-line-color', '--cngx-chart-primary'],\n area: ['--cngx-area-fill', '--cngx-chart-primary'],\n bar: ['--cngx-bar-color', '--cngx-chart-primary'],\n scatter: ['--cngx-scatter-color', '--cngx-chart-primary'],\n threshold: ['--cngx-threshold-color', '--cngx-chart-danger'],\n band: ['--cngx-band-color', '--cngx-chart-secondary'],\n};\n\n/** @internal */\nconst DEFAULT_STROKE_WIDTH = 1.5;\n/** @internal */\nconst DEFAULT_AREA_OPACITY = 0.18;\n/** @internal */\nconst DEFAULT_BAND_OPACITY = 0.12;\n/** @internal Fallback point-marker radius, matching the layers' CSS token defaults. */\nconst DEFAULT_POINT_RADIUS = 3;\n\n/**\n * Canvas rendering backend. Mounts a `<canvas>` absolutely positioned\n * over the chart's SVG frame and paints each {@link LayerGeometry} onto\n * its 2D context: `Path2D` stroke/fill for line/area, per-mark loops for\n * bar/scatter, `moveTo`/`lineTo` for threshold, `fillRect` for band.\n *\n * Colors resolve through a closure-local cache: the first `paint()` reads\n * each CSS custom property once via `getComputedStyle(host)`; subsequent\n * paints hit the cache, so the paint hot path performs zero synchronous\n * DOM reads. {@link CngxChartRenderer.invalidateColorCache} clears it -\n * the renderer controller calls it on a `dimensions()` change (a proxy\n * for layout / theming reflow). It never writes the chart context's\n * `renderSvg` gate; the shell owns that.\n *\n * The plot inset needs no handling here. Every geometry this backend\n * paints was derived from `ctx.xScale()` / `ctx.yScale()`, whose ranges\n * are already the inset plot area, so canvas marks land exactly where\n * SVG marks would without the renderer knowing an inset exists. Axis\n * decoration never reaches this file at all: there is no axis branch in\n * {@link KIND_VARS} and no text call anywhere in the backend, because\n * `CngxAxis` renders its own SVG ungated by `renderSvg` in both modes.\n * The two paths therefore cannot disagree on where the plot area is,\n * and only one of them ever draws an axis.\n *\n * They do differ on what happens past the box edge: a canvas clips\n * natively at the element bounds, and since the SVG root no longer sets\n * `overflow: visible` it now clips there too. Out-of-domain data is cut\n * off on both paths.\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/canvas-renderer.ts\n * @since 0.1.0\n */\nexport function createCanvasRenderer(deps: ChartRendererDeps): CngxChartRenderer {\n let canvas: HTMLCanvasElement | null = null;\n let hostEl: HTMLElement | null = null;\n let ctx2d: CanvasRenderingContext2D | null = null;\n let lastW = -1;\n let lastH = -1;\n const colorCache = new Map<string, string>();\n const numberCache = new Map<string, number>();\n\n function readVar(name: string): string {\n return hostEl ? getComputedStyle(hostEl).getPropertyValue(name).trim() : '';\n }\n\n /**\n * Read a numeric CSS custom property (e.g. `--cngx-area-opacity`,\n * `--cngx-line-stroke-width`), cached like colors so the paint hot path\n * stays free of synchronous DOM reads. Falls back when unset / unparseable.\n */\n function resolveNumberVar(name: string, fallback: number): number {\n const cached = numberCache.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const raw = readVar(name);\n const parsed = raw ? parseFloat(raw) : NaN;\n const value = Number.isFinite(parsed) ? parsed : fallback;\n numberCache.set(name, value);\n return value;\n }\n\n function colorOf(color: string | null, kind: LayerGeometry['kind']): string {\n // An explicit literal color (e.g. [cngxLine] [color]=\"'#f00'\") passes\n // through untouched - no var resolution, no cache.\n if (color !== null && !color.startsWith('--')) {\n return color;\n }\n const key = color ?? `@${kind}`;\n const cached = colorCache.get(key);\n if (cached !== undefined) {\n return cached;\n }\n let resolved = 'currentColor';\n if (color !== null) {\n resolved = readVar(color) || 'currentColor';\n } else {\n // Walk the per-atom -> family fallback chain, first hit wins.\n for (const name of KIND_VARS[kind]) {\n const value = readVar(name);\n if (value) {\n resolved = value;\n break;\n }\n }\n }\n colorCache.set(key, resolved);\n return resolved;\n }\n\n function strokeWidthOf(sw: number | string | null): number {\n // Unset -> the same `--cngx-line-stroke-width` var the SVG line reads,\n // so per-atom stroke width survives the SVG->Canvas crossover.\n if (sw === null) {\n return resolveNumberVar('--cngx-line-stroke-width', DEFAULT_STROKE_WIDTH);\n }\n const n = typeof sw === 'number' ? sw : parseFloat(sw);\n return Number.isFinite(n) ? n : DEFAULT_STROKE_WIDTH;\n }\n\n /**\n * Draw the optional point-marker pass a line / area geometry carries,\n * as filled arcs in the layer's resolved colour. Same colour path as\n * the stroke / fill so no second colour resolution is introduced.\n */\n function drawPointMarks(\n c: CanvasRenderingContext2D,\n points: readonly { readonly cx: number; readonly cy: number }[] | undefined,\n color: string | null,\n kind: LayerGeometry['kind'],\n radiusVar: string,\n ): void {\n if (!points || points.length === 0) {\n return;\n }\n const r = resolveNumberVar(radiusVar, DEFAULT_POINT_RADIUS);\n c.fillStyle = colorOf(color, kind);\n for (const p of points) {\n c.beginPath();\n c.arc(p.cx, p.cy, r, 0, Math.PI * 2);\n c.fill();\n }\n }\n\n function sizeCanvas(): void {\n if (!canvas || !ctx2d) {\n return;\n }\n const { width, height } = deps.ctx.dimensions();\n const dpr = globalThis.devicePixelRatio ?? 1;\n const w = Math.max(0, Math.round(width * dpr));\n const h = Math.max(0, Math.round(height * dpr));\n if (w === lastW && h === lastH) {\n return;\n }\n lastW = w;\n lastH = h;\n // Assigning width/height reallocates and clears the bitmap - only when\n // the device-pixel size actually changed. paint() clears each frame via\n // clearRect regardless, so the realtime hot path pays nothing here.\n canvas.width = w;\n canvas.height = h;\n // Draw in logical pixels; the bitmap is scaled for the device.\n ctx2d.setTransform(dpr, 0, 0, dpr, 0, 0);\n }\n\n function mount(host: HTMLElement): void {\n hostEl = host;\n const el = host.ownerDocument.createElement('canvas');\n // Structural positioning lives with the skin (the `.cngx-chart__canvas`\n // rule in the chart stylesheet), not inline here - so a decomposed skin\n // can restyle the overlay without editing this brain.\n el.className = 'cngx-chart__canvas';\n el.setAttribute('aria-hidden', 'true');\n host.appendChild(el);\n canvas = el;\n ctx2d = el.getContext('2d');\n sizeCanvas();\n // Teardown is owned by the renderer controller (it destroys on mode\n // flip and on the chart's DestroyRef). Self-registering here would\n // pile up one never-unregistered closure per svg<->canvas flip.\n }\n\n function paint(geometries: readonly LayerGeometry[]): void {\n const c = ctx2d;\n if (!canvas || !c) {\n return;\n }\n sizeCanvas();\n const { width, height } = deps.ctx.dimensions();\n c.clearRect(0, 0, width, height);\n for (const g of geometries) {\n paintOne(c, g);\n }\n }\n\n function paintOne(c: CanvasRenderingContext2D, g: LayerGeometry): void {\n switch (g.kind) {\n case 'line': {\n c.strokeStyle = colorOf(g.color, 'line');\n c.lineWidth = strokeWidthOf(g.strokeWidth);\n c.lineJoin = 'round';\n c.lineCap = 'round';\n c.stroke(new Path2D(g.d));\n drawPointMarks(c, g.points, g.color, 'line', '--cngx-line-point-radius');\n break;\n }\n case 'area': {\n c.fillStyle = colorOf(g.color, 'area');\n c.globalAlpha = g.opacity ?? resolveNumberVar('--cngx-area-opacity', DEFAULT_AREA_OPACITY);\n c.fill(new Path2D(g.d));\n c.globalAlpha = 1;\n drawPointMarks(c, g.points, g.color, 'area', '--cngx-area-point-radius');\n break;\n }\n case 'bar': {\n for (const r of g.rects) {\n c.fillStyle = colorOf(r.color, 'bar');\n c.fillRect(r.x, r.y, r.w, r.h);\n }\n break;\n }\n case 'scatter': {\n for (const m of g.marks) {\n c.fillStyle = colorOf(m.color, 'scatter');\n c.beginPath();\n c.arc(m.cx, m.cy, m.r, 0, Math.PI * 2);\n c.fill();\n }\n break;\n }\n case 'threshold': {\n c.strokeStyle = colorOf(g.color, 'threshold');\n c.lineWidth = 1;\n c.setLineDash(g.dashed ? [4, 3] : []);\n c.beginPath();\n c.moveTo(g.x1, g.y1);\n c.lineTo(g.x2, g.y2);\n c.stroke();\n c.setLineDash([]);\n break;\n }\n case 'band': {\n c.fillStyle = colorOf(g.color, 'band');\n c.globalAlpha = g.opacity ?? resolveNumberVar('--cngx-band-opacity', DEFAULT_BAND_OPACITY);\n c.fillRect(g.x, g.y, g.w, g.h);\n c.globalAlpha = 1;\n break;\n }\n }\n }\n\n function invalidateColorCache(): void {\n colorCache.clear();\n numberCache.clear();\n }\n\n function destroy(): void {\n canvas?.remove();\n canvas = null;\n ctx2d = null;\n hostEl = null;\n lastW = -1;\n lastH = -1;\n colorCache.clear();\n numberCache.clear();\n }\n\n return {\n mode: 'canvas',\n mount: (host: HTMLElement, _ctx: CngxChartContext) => mount(host),\n paint,\n destroy,\n invalidateColorCache,\n };\n}\n","import { type ChartRendererDeps, type CngxChartRenderer } from './chart-renderer';\n\n/**\n * SVG passthrough renderer. Layer atoms render their own `<svg:path>` /\n * `<svg:rect>` / `<svg:circle>`, gated by the chart shell's `renderSvg`\n * computed, so this backend has nothing to do: every method is a no-op.\n * It never writes back to the chart context - `renderSvg` ownership stays\n * in the chart shell as the single source of truth.\n *\n * @param _deps unused; kept for factory signature symmetry with\n * {@link createCanvasRenderer}.\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/svg-renderer.ts\n * @since 0.1.0\n */\nexport function createSvgRenderer(_deps: ChartRendererDeps): CngxChartRenderer {\n const noop = (): void => undefined;\n return {\n mode: 'svg',\n mount: noop,\n paint: noop,\n destroy: noop,\n invalidateColorCache: noop,\n };\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Datapoint count above which `<cngx-chart>` auto-switches from SVG to\n * Canvas rendering. Default `500` - the point at which the SVG backend's\n * per-layer DOM-node cost starts to dominate on a mid-range laptop.\n *\n * Override enterprise-wide via {@link withChartRendererThreshold} (or a\n * bare provider) to tune the SVG/Canvas crossover for a given app's\n * hardware profile.\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/renderer-threshold.ts\n * @since 0.1.0\n * @relatedTo provideChartRenderer, withChartRendererThreshold\n */\nexport const CNGX_CHART_RENDERER_THRESHOLD = new InjectionToken<number>(\n 'CngxChartRendererThreshold',\n { providedIn: 'root', factory: () => 500 },\n);\n","import { InjectionToken, type Provider } from '@angular/core';\n\nimport { type CngxChartRendererFactory } from './chart-renderer';\nimport { createCanvasRenderer } from './canvas-renderer';\nimport { createSvgRenderer } from './svg-renderer';\nimport { CNGX_CHART_RENDERER_THRESHOLD } from './renderer-threshold';\n\n/**\n * The default renderer factory: dispatches `'svg'` to\n * {@link createSvgRenderer} and `'canvas'` to {@link createCanvasRenderer}.\n * Inlines the two-backend switch; a consumer wanting a third backend\n * (WebGL, ...) supplies a whole replacement via\n * {@link withChartRendererFactory}.\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/renderer-factory.ts\n * @since 0.1.0\n */\nexport const createDefaultChartRenderer: CngxChartRendererFactory = (mode, deps) =>\n mode === 'svg' ? createSvgRenderer(deps) : createCanvasRenderer(deps);\n\n/**\n * The renderer-factory the chart shell resolves to build its backend.\n * Default {@link createDefaultChartRenderer}; override enterprise-wide via\n * {@link withChartRendererFactory} to add a backend without touching layer\n * atoms.\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/renderer-factory.ts\n * @since 0.1.0\n * @relatedTo provideChartRenderer, withChartRendererFactory\n */\nexport const CNGX_CHART_RENDERER_FACTORY = new InjectionToken<CngxChartRendererFactory>(\n 'CngxChartRendererFactory',\n { providedIn: 'root', factory: () => createDefaultChartRenderer },\n);\n\n/**\n * A single renderer-config override produced by a `with*` feature and\n * folded by {@link provideChartRenderer}.\n *\n * @category common/chart/renderer\n */\nexport interface CngxChartRendererFeature {\n readonly providers: Provider[];\n}\n\n/**\n * Override the SVG->Canvas auto-switch cutoff (default `500`).\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/renderer-factory.ts\n * @since 0.1.0\n */\nexport function withChartRendererThreshold(n: number): CngxChartRendererFeature {\n return { providers: [{ provide: CNGX_CHART_RENDERER_THRESHOLD, useValue: n }] };\n}\n\n/**\n * Replace the renderer factory - e.g. to force one backend or add a\n * third. Consumers wanting a heuristic swap supply a custom factory here\n * (the heuristic-swap axis ships no dedicated token at v2).\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/renderer-factory.ts\n * @since 0.1.0\n */\nexport function withChartRendererFactory(fn: CngxChartRendererFactory): CngxChartRendererFeature {\n return { providers: [{ provide: CNGX_CHART_RENDERER_FACTORY, useValue: fn }] };\n}\n\n/**\n * Aggregate renderer-config features into a provider set. Place in a\n * bootstrap `providers` array (app-wide) or a component's `viewProviders`\n * (subtree scope).\n *\n * ```typescript\n * provideChartRenderer(withChartRendererThreshold(2000))\n * ```\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/renderer-factory.ts\n * @since 0.1.0\n * @relatedTo withChartRendererThreshold, withChartRendererFactory\n */\nexport function provideChartRenderer(...features: CngxChartRendererFeature[]): Provider[] {\n return features.flatMap((f) => f.providers);\n}\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n contentChildren,\n DestroyRef,\n ElementRef,\n inject,\n input,\n isDevMode,\n type Signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { CngxResizeObserver } from '@cngx/common/layout';\nimport { resolveAsyncView, type AsyncView } from '@cngx/common/data';\nimport { nextUid, type CngxAsyncState } from '@cngx/core/utils';\nimport { type CngxAxisPosition, type CngxAxisType } from '../axis/axis-position';\nimport { CNGX_CHART_AXIS } from '../axis/chart-axis';\nimport { CngxThreshold } from '../layers/threshold.component';\nimport { CNGX_CHART_I18N } from '../i18n/chart-i18n';\nimport { CngxChartDataTable } from './data-table.component';\nimport {\n CHART_SMALL_BREAKPOINT_PX,\n CngxChartConnectionError,\n type CngxChartConnectionContext,\n CngxChartEmpty,\n CngxChartError,\n CngxChartLoading,\n CngxChartOverlay,\n CngxChartReconnecting,\n type CngxChartSlotContext,\n} from './template-slots';\nimport { createBandScale, createLinearScale, createTimeScale } from '../scales';\nimport {\n CNGX_CHART_CONTEXT,\n type CngxChartContext,\n type CngxChartInset,\n type CngxChartPlotArea,\n type ScaleFn,\n type XScaleInput,\n} from './chart-context';\nimport { computeChartSummary } from './summary';\nimport { createSignificantChangeTracker } from './significant-change';\nimport {\n dimensionsEqual,\n insetEqual,\n plotAreaEqual,\n sameItemsArr,\n sameNumberArr,\n slotContextEqual,\n} from './equal-helpers';\nimport { CNGX_CHART_LAYER, type LayerGeometry } from '../layers/chart-layer';\nimport { createChartRendererController } from '../renderer/chart-renderer-controller';\nimport { CNGX_CHART_RENDERER_FACTORY } from '../renderer/renderer-factory';\nimport { CNGX_CHART_RENDERER_THRESHOLD } from '../renderer/renderer-threshold';\n\n/** @internal */\nconst NOOP_SCALE: ScaleFn<XScaleInput> = () => 0;\n/** @internal */\nconst NOOP_Y_SCALE: ScaleFn<number> = () => 0;\n\n/**\n * Reserve-nothing inset. A stable reference, so a chart whose axis set\n * never changes hands the same object to every reader and the `equal`\n * guard on {@link CngxChart.inset} short-circuits on identity.\n *\n * @internal\n */\nconst ZERO_INSET: CngxChartInset = {\n inlineStart: 0,\n inlineEnd: 0,\n blockStart: 0,\n blockEnd: 0,\n};\n\n/**\n * Stable reference for the default `summaryAccessor`. Exposed so the\n * dev-mode warning can detect \"consumer omitted [summaryAccessor] on\n * non-numeric data\" without false positives when the consumer happens\n * to pass an identical-looking arrow.\n *\n * @internal\n */\nconst DEFAULT_SUMMARY_ACCESSOR = <T>(d: T): number => Number(d as unknown);\n\n/**\n * Top-level chart container. Hosts an `<svg>` viewBox, applies\n * {@link CngxResizeObserver} via `hostDirectives` to track its rendered\n * size, and provides {@link CNGX_CHART_CONTEXT} so child atoms\n * (`[cngxAxis]`, layer atoms) read the live scales without injecting\n * the concrete `CngxChart` class.\n *\n * Layer atoms and `[cngxAxis]` are attribute directives: consumers\n * mount them on `<svg:g>` hosts inside the chart so the SVG namespace\n * boundary stays clean. An element selector (`<cngx-axis>` etc.)\n * inside `<svg>` would create an XHTML-namespaced custom element\n * whose SVG-namespaced children would not lay out, leaving the chart\n * blank in real browsers (jsdom is permissive and would mask this).\n *\n * Scales are derived from content-child `[cngxAxis]` directives:\n * the X axis (top/bottom position) drives `xScale`, the Y axis\n * (left/right) drives `yScale`. With no axis present, the\n * corresponding scale falls back to a no-op `() => 0` and content\n * children may render off-canvas - consumers must mount at least\n * one axis per direction they actually use.\n *\n * The `[width]` / `[height]` inputs override the resize observer for\n * fixed-dimension presets (inline sparkline at 80×24, etc.).\n *\n * ## The plot area\n *\n * Marks are mapped onto the *plot area*, not onto the whole viewBox:\n * the viewBox minus the room the projected axes need for their tick\n * labels and titles. The chart publishes the resulting rectangle on\n * {@link CngxChartContext.plot}, and both its own scale ranges and\n * every `[cngxAxis]` line resolve against that one derivation, so a\n * tick can never drift away from the mark it labels.\n *\n * The reserved room is derived, not configured. Which sides reserve\n * comes from the projected axis set; how much each side reserves comes\n * from the axis itself, which sizes the gutter from the tick labels it\n * already formats. There is no input, no CSS custom property and no DI\n * token to tune it - a chart without axes reserves nothing and fills\n * its box exactly as it did before the plot area existed, as does one\n * whose axes are {@link CngxAxisDomain}, which draws nothing.\n *\n * Every axis reserves on its own side and a little on the two\n * perpendicular ones, because a tick label is centred on its tick and\n * the end ticks sit on the plot corners.\n *\n * Nothing here reads the DOM. The gutter is arithmetic over label\n * strings, so it is at final width in the first painted frame and\n * renders identically under SSR. The cost is that one character's\n * width is an estimate rather than the font's real advance width; a\n * consumer restyling `--cngx-axis-font-size` gets labels at their own\n * size inside a gutter sized for the default.\n *\n * @category common/chart\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/chart.component.ts\n * @since 0.1.0\n * @relatedTo CngxAxis, CngxLine, CngxArea, CngxBar, CngxChartLegend\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/overlay-aligned-to-the-plot</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n * @slot cngxChartLoading Replaces the centred spinner shown during the first load.\n * @slot cngxChartEmpty Rendered when the data resolves to nothing.\n * @slot cngxChartError Rendered when the load fails; gets the error.\n * @slot cngxChartConnectionError Rendered over the chart when the live connection drops.\n * @slot cngxChartReconnecting Rendered over the chart while the connection retries.\n * @slot cngxChartOverlay HTML layered over the marks in the content view; the chart insets it to the plot area, pointer-events off by default.\n */\n@Component({\n selector: 'cngx-chart',\n exportAs: 'cngxChart',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'img',\n '[attr.aria-label]': 'ariaLabelText()',\n '[attr.aria-describedby]': 'dataTableId',\n '[attr.aria-busy]': 'busy() ? \"true\" : null',\n '[class.cngx-chart--responsive]': 'isResponsive()',\n '[class.cngx-chart--content-hidden]': 'contentHidden()',\n '[style.width.px]': 'width() ?? null',\n '[style.aspect-ratio]': 'explicitAspectRatio()',\n // The resolved plot inset, published so HTML overlays positioned\n // against the host box can align to the plot area instead.\n '[style.--cngx-chart-plot-block-start]': 'plotVars().blockStart',\n '[style.--cngx-chart-plot-block-end]': 'plotVars().blockEnd',\n '[style.--cngx-chart-plot-inline-start]': 'plotVars().inlineStart',\n '[style.--cngx-chart-plot-inline-end]': 'plotVars().inlineEnd',\n },\n hostDirectives: [CngxResizeObserver],\n providers: [{ provide: CNGX_CHART_CONTEXT, useExisting: CngxChart }],\n imports: [CngxChartDataTable, NgTemplateOutlet],\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n @if (loadingTpl(); as tpl) {\n <div class=\"cngx-chart__fallback-frame\">\n <ng-container *ngTemplateOutlet=\"tpl; context: slotContext()\" />\n </div>\n } @else {\n <div class=\"cngx-chart__loading\" [attr.aria-hidden]=\"true\">\n <div class=\"cngx-chart__spinner\"></div>\n </div>\n }\n }\n @case ('empty') {\n @if (emptyTpl(); as tpl) {\n <div class=\"cngx-chart__fallback-frame\">\n <ng-container *ngTemplateOutlet=\"tpl; context: slotContext()\" />\n </div>\n } @else {\n <div class=\"cngx-chart__fallback\" [attr.aria-hidden]=\"true\">{{ i18n.empty() }}</div>\n }\n }\n @case ('error') {\n @if (errorTpl(); as tpl) {\n <div class=\"cngx-chart__fallback-frame\">\n <ng-container *ngTemplateOutlet=\"tpl; context: errorContext()\" />\n </div>\n } @else {\n <div class=\"cngx-chart__fallback cngx-chart__fallback--error\" [attr.aria-hidden]=\"true\">\n {{ i18n.error() }}\n </div>\n }\n }\n @case ('none') {}\n @default {\n <svg [attr.viewBox]=\"viewBox()\" [attr.preserveAspectRatio]=\"preserveAspectRatio()\">\n <svg:title>{{ ariaLabelText() }}</svg:title>\n <ng-content />\n </svg>\n @if (overlayTpl(); as tpl) {\n <div class=\"cngx-chart__overlay-frame\">\n <ng-container *ngTemplateOutlet=\"tpl; context: slotContext()\" />\n </div>\n }\n }\n }\n @if (connectionView() === 'error') {\n @if (connectionErrorTpl(); as tpl) {\n <div\n class=\"cngx-chart__connection-overlay cngx-chart__connection-overlay--error\"\n role=\"alert\"\n >\n <ng-container *ngTemplateOutlet=\"tpl; context: connectionCtx()\" />\n </div>\n } @else {\n <div\n class=\"cngx-chart__connection-overlay cngx-chart__connection-overlay--error\"\n role=\"alert\"\n >\n {{ i18n.connectionLost() }}\n </div>\n }\n } @else if (connectionView() === 'reconnecting') {\n @if (reconnectingTpl(); as tpl) {\n <div\n class=\"cngx-chart__connection-overlay cngx-chart__connection-overlay--reconnecting\"\n role=\"status\"\n >\n <ng-container *ngTemplateOutlet=\"tpl; context: connectionCtx()\" />\n </div>\n } @else {\n <div\n class=\"cngx-chart__connection-overlay cngx-chart__connection-overlay--reconnecting\"\n role=\"status\"\n >\n {{ i18n.connectionReconnecting() }}\n </div>\n }\n }\n <cngx-chart-data-table\n [id]=\"dataTableId\"\n [values]=\"summaryValues()\"\n [hidden]=\"!tableActive() || activeView() !== 'content'\"\n />\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-chart {\n display: inline-block;\n /* Positioning context for the SR-only cngx-chart-data-table (a\n direct absolute descendant). Without it the table's containing\n block is the initial containing block, so it escapes ancestor\n overflow clipping and contributes to the document's scroll\n height - in a virtualized list of charts that destabilises the\n recycler's viewport math. Zero visual effect: the host has no\n absolutely-positioned children that offset from it. */\n position: relative;\n /* Cap the host at its parent's content width so explicit\n [width] values shrink on narrower viewports (mobile portrait,\n constrained dashboard cells). The aspect-ratio derived from\n [width]/[height] keeps the chart proportional when squeezed -\n the SVG viewBox stays in logical coords so axes / threshold\n labels / scales reflow cleanly. */\n max-width: 100%;\n }\n /* Responsive mode: when neither width nor height is bound, the\n host fills its parent and derives height from the\n --cngx-chart-aspect-ratio CSS variable (default 16/9). The\n resize observer measures the rendered size; dimensions() then\n drives the SVG width/height + viewBox + scale math, so axes\n and layer atoms re-flow as the parent resizes. */\n cngx-chart.cngx-chart--responsive {\n display: block;\n width: 100%;\n aspect-ratio: var(--cngx-chart-aspect-ratio, 5 / 2);\n }\n cngx-chart > .cngx-chart__canvas {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n /* The canvas is host.appendChild()-ed at runtime, so it lands\n after all template content in DOM order and would paint over an\n overlay by default. An explicit order keeps the overlay on top\n across the SVG/canvas crossover; DOM order alone does not. */\n z-index: var(--cngx-chart-canvas-z, 0);\n }\n cngx-chart.cngx-chart--content-hidden > .cngx-chart__canvas {\n display: none;\n }\n cngx-chart > svg {\n display: block;\n width: 100%;\n height: 100%;\n /* No overflow: visible here, deliberately. The plot inset\n reserves room for tick labels and axis titles inside the\n viewBox, so nothing the chart authors lands outside it and the\n SVG default is the correct one. Two things do still cross the\n edge and now clip: half the stroke width of a mark sitting on\n the plot boundary, and out-of-domain data. Both already clip\n on the canvas backend, which clips natively at the element\n box - so the backends agree on where a chart ends. */\n }\n cngx-chart > .cngx-chart__fallback-frame {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n }\n /*\n Inset to the plot area from the four --cngx-chart-plot-* percentages\n the host already publishes, so an overlay lands on the marks without\n the consumer re-deriving the rectangle. pointer-events: none so the\n frame never swallows chart interaction; an element inside it opts\n back in with pointer-events: auto.\n */\n cngx-chart > .cngx-chart__overlay-frame {\n position: absolute;\n inset-block-start: var(--cngx-chart-plot-block-start, 0px);\n inset-block-end: var(--cngx-chart-plot-block-end, 0px);\n inset-inline-start: var(--cngx-chart-plot-inline-start, 0px);\n inset-inline-end: var(--cngx-chart-plot-inline-end, 0px);\n /* Above the canvas backend (see .cngx-chart__canvas). */\n z-index: var(--cngx-chart-overlay-z, 1);\n pointer-events: none;\n }\n cngx-chart > .cngx-chart__loading {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n }\n cngx-chart .cngx-chart__spinner {\n width: var(--cngx-chart-spinner-size, 32px);\n height: var(--cngx-chart-spinner-size, 32px);\n border: var(--cngx-chart-spinner-thickness, 3px) solid\n var(--cngx-chart-spinner-track, rgb(0 0 0 / 0.08));\n border-top-color: var(--cngx-chart-spinner-color, var(--cngx-chart-primary, currentColor));\n border-radius: 50%;\n animation: cngx-chart-spin 800ms linear infinite;\n }\n cngx-chart > .cngx-chart__fallback {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-height: var(--cngx-chart-fallback-min-height, 48px);\n font-size: var(--cngx-chart-fallback-font-size, 0.875rem);\n color: var(--cngx-chart-text-color, currentColor);\n opacity: var(--cngx-chart-fallback-opacity, 0.7);\n padding: var(--cngx-chart-fallback-padding, 1rem);\n text-align: center;\n box-sizing: border-box;\n }\n cngx-chart > .cngx-chart__fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n opacity: 1;\n }\n /*\n Anchored to the plot area's top-inline-end corner, not the host\n box: centred over the box it lands on the marks, and on a chart\n with axes it can sit over the tick labels. The plot inset comes\n off the host as custom properties, so the pill tracks the gutter\n the axes reserved without knowing an axis exists.\n */\n cngx-chart > .cngx-chart__connection-overlay {\n position: absolute;\n top: calc(\n var(--cngx-chart-plot-block-start, 0px) + var(--cngx-chart-connection-inset, 0.5rem)\n );\n inset-inline-end: calc(\n var(--cngx-chart-plot-inline-end, 0px) + var(--cngx-chart-connection-inset, 0.5rem)\n );\n max-inline-size: calc(\n 100% - var(--cngx-chart-plot-inline-start, 0px) - var(--cngx-chart-plot-inline-end, 0px) -\n 2 * var(--cngx-chart-connection-inset, 0.5rem)\n );\n display: flex;\n align-items: center;\n gap: var(--cngx-chart-connection-gap, 0.375rem);\n padding: var(--cngx-chart-connection-padding, 0.25rem 0.625rem);\n border-radius: var(--cngx-chart-connection-radius, 999px);\n font-size: var(--cngx-chart-connection-font-size, 0.75rem);\n line-height: 1.4;\n pointer-events: none;\n box-shadow: var(--cngx-chart-connection-shadow, 0 1px 3px rgb(0 0 0 / 0.12));\n }\n cngx-chart > .cngx-chart__connection-overlay--error {\n background: var(--cngx-chart-connection-error-bg, var(--cngx-chart-danger, #d32f2f));\n color: var(--cngx-chart-connection-error-color, #fff);\n }\n cngx-chart > .cngx-chart__connection-overlay--reconnecting {\n background: var(--cngx-chart-connection-reconnecting-bg, rgb(0 0 0 / 0.72));\n color: var(--cngx-chart-connection-reconnecting-color, #fff);\n }\n @keyframes cngx-chart-spin {\n to {\n transform: rotate(360deg);\n }\n }\n @media (prefers-reduced-motion: reduce) {\n cngx-chart .cngx-chart__spinner {\n animation: none;\n }\n }\n `,\n ],\n})\nexport class CngxChart<T = unknown> implements CngxChartContext<XScaleInput, number> {\n /**\n * Raw data input. Aliased as `data` at the template-binding level so\n * consumer markup stays `<cngx-chart [data]=\"rows\">`. The public,\n * typed read surface is the `data<U>()` method below - layer atoms\n * call `this.ctx.data<T>()` to narrow without per-site casts.\n *\n * @internal - alias for the public `data<U>()` method\n */\n readonly dataInput = input.required<readonly T[]>({ alias: 'data' });\n readonly width = input<number | undefined>(undefined);\n readonly height = input<number | undefined>(undefined);\n readonly preserveAspectRatio = input<string>('xMidYMid meet');\n /**\n * Optional explicit `aria-label` override. When set, supersedes the\n * auto-Summary derived from data + threshold layers. Use when the\n * default summary phrasing does not fit the chart's domain.\n */\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n /**\n * Numeric accessor used to project generic data to the values fed\n * into the auto-Summary. Default `Number(d)` works for `readonly\n * number[]` data; structured data must override.\n */\n readonly summaryAccessor = input<(d: T, i: number) => number>(DEFAULT_SUMMARY_ACCESSOR);\n /**\n * Controls when the SR-only data-table view is exposed to assistive\n * technology. `'auto'` (default) shows the table whenever the data\n * has more than one point - a single value is announced via the\n * `aria-label`, no table needed. `'off'` keeps the table hidden\n * regardless. The table element is always present in the DOM -\n * visibility flips through `aria-hidden`, the linked id on\n * `aria-describedby` never disappears.\n */\n readonly accessibleTable = input<'auto' | 'off'>('auto');\n /**\n * Optional async-state envelope. When bound, the chart routes through\n * the same skeleton / empty / error / content state machine that the\n * preset molecules use. Without this input, the chart always renders\n * its content (Pillar-2 always-in-DOM data-table id stays stable, but\n * the SR data-table only flips out of `aria-hidden` when the active\n * view is `'content'`).\n *\n * Accepts the standard `CngxAsyncState<T>` shape (any producer:\n * `createManualState`, `createAsyncState`, `injectAsyncState`,\n * `fromHttpResource`, `tap*` pipeline output). The chart exposes its\n * state via this explicit input, not a `CNGX_STATEFUL` provision - bind\n * bridges directly, e.g. `<cngx-toast-on [state]=\"chart.state()\">`. The\n * separate `[connectionState]` input tracks connection lifecycle so the\n * two channels never contend for a single precedence seat.\n */\n readonly state = input<CngxAsyncState<readonly T[]> | undefined>(undefined);\n /**\n * Optional connection-lifecycle envelope, additive and independent of\n * `[state]`. Bind a websocket/SSE adapter's `CngxAsyncState<unknown>` so\n * connection blips surface via the `*cngxChartConnectionError` /\n * `*cngxChartReconnecting` overlays without overriding the data view.\n * Consumers care only about the status surface, hence `unknown` as `T`.\n */\n readonly connectionState = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n private readonly resize = inject(CngxResizeObserver, { host: true });\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly rendererFactory = inject(CNGX_CHART_RENDERER_FACTORY);\n private readonly threshold = inject(CNGX_CHART_RENDERER_THRESHOLD);\n private readonly axes = contentChildren(CNGX_CHART_AXIS, { descendants: true });\n private readonly thresholds = contentChildren(CngxThreshold, { descendants: true });\n private readonly layers = contentChildren(CNGX_CHART_LAYER, { descendants: true });\n protected readonly i18n = inject(CNGX_CHART_I18N);\n protected readonly dataTableId = nextUid('cngx-chart-data-table');\n\n private readonly loadingSlot = contentChild(CngxChartLoading);\n private readonly emptySlot = contentChild(CngxChartEmpty);\n private readonly errorSlot = contentChild(CngxChartError);\n private readonly connectionErrorSlot = contentChild(CngxChartConnectionError);\n private readonly reconnectingSlot = contentChild(CngxChartReconnecting);\n private readonly overlaySlot = contentChild(CngxChartOverlay);\n // Only the first overlay renders (contentChild above). This parallel\n // query exists solely to warn in dev when a consumer projects more\n // than one, since the extra templates drop silently otherwise.\n private readonly overlaySlots = contentChildren(CngxChartOverlay);\n\n /** Resolved consumer-projected loading template (null when no slot bound). */\n protected readonly loadingTpl = computed(() => this.loadingSlot()?.templateRef ?? null);\n /** Resolved consumer-projected empty template (null when no slot bound). */\n protected readonly emptyTpl = computed(() => this.emptySlot()?.templateRef ?? null);\n /** Resolved consumer-projected error template (null when no slot bound). */\n protected readonly errorTpl = computed(() => this.errorSlot()?.templateRef ?? null);\n /** Resolved consumer-projected connection-error template. */\n protected readonly connectionErrorTpl = computed(\n () => this.connectionErrorSlot()?.templateRef ?? null,\n );\n /** Resolved consumer-projected reconnecting template. */\n protected readonly reconnectingTpl = computed(() => this.reconnectingSlot()?.templateRef ?? null);\n /** Resolved consumer-projected overlay template (null when no slot bound). */\n protected readonly overlayTpl = computed(() => this.overlaySlot()?.templateRef ?? null);\n\n /**\n * Common context for every slot template (loading, empty, error).\n * Carries the chart's current rendered width/height plus a `small`\n * flag flipped at the {@link CHART_SMALL_BREAKPOINT_PX} threshold,\n * so consumers can branch on container size:\n *\n * ```html\n * <ng-template cngxChartEmpty let-small=\"small\">\n * @if (small) { <span>No data</span> }\n * @else { <cngx-empty-state title=\"No telemetry yet\" /> }\n * </ng-template>\n * ```\n *\n * Reads directly from the resize observer (host's actual painted\n * size) - NOT from `dimensions()` which prefers the logical\n * `[width]`/`[height]` inputs. This matters when an explicit\n * `[width]=\"480\"` chart squeezes via `max-width: 100%` on a narrow\n * viewport: the rendered width is what the consumer cares about\n * for fallback layout, not the logical viewBox dimension.\n */\n protected readonly slotContext = computed<CngxChartSlotContext>(\n () => {\n const width = this.resize.width();\n const height = this.resize.height();\n return {\n width,\n height,\n small: width > 0 && width < CHART_SMALL_BREAKPOINT_PX,\n // The same derivation the scales and the axes read. A slot\n // template that centres on width/height alone would sit\n // off-centre from the marks it stands in for.\n plot: this.plot(),\n };\n },\n { equal: slotContextEqual },\n );\n\n /**\n * Error-slot context - extends {@link slotContext} with the live\n * error value under `$implicit` and `error` keys, so a consumer can\n * render a typed message AND branch on chart size in the same\n * template.\n */\n protected readonly errorContext = computed(\n () => {\n const err = this.state()?.error?.() ?? null;\n return { ...this.slotContext(), $implicit: err, error: err };\n },\n { equal: (a, b) => Object.is(a.error, b.error) && slotContextEqual(a, b) },\n );\n\n /**\n * Connection-lifecycle view derived from `[connectionState]`'s status.\n * NOT routed through `resolveAsyncView` - that `AsyncView` union has no\n * `'refreshing'` member and folds a refreshing status into the data\n * view. The connection channel maps status directly: `'error'` ->\n * connection-lost overlay, `'refreshing'` -> reconnecting overlay,\n * everything else -> no overlay. Independent of `activeView()`.\n */\n protected readonly connectionView = computed<'error' | 'reconnecting' | 'none'>(() => {\n const s = this.connectionState();\n if (!s) {\n return 'none';\n }\n const status = s.status();\n if (status === 'error') {\n return 'error';\n }\n if (status === 'refreshing') {\n return 'reconnecting';\n }\n return 'none';\n });\n\n /**\n * Context for the connection-slot templates - the connection-channel\n * twin of {@link errorContext}, carrying the live connection error.\n */\n protected readonly connectionCtx = computed<CngxChartConnectionContext>(() => {\n const err = this.connectionState()?.error?.() ?? null;\n return { ...this.slotContext(), $implicit: err, error: err };\n });\n\n constructor() {\n // The controller owns the mount / destroy / paint reactive lifecycle;\n // its effects and teardown are held by this injection context's\n // DestroyRef, so the shell keeps no rendering brain and no handle.\n createChartRendererController({\n host: this.hostEl.nativeElement,\n ctx: this,\n mode: this.renderMode,\n geometries: this.geometries,\n factory: this.rendererFactory,\n destroyRef: this.destroyRef,\n });\n\n if (isDevMode()) {\n afterNextRender(() => {\n if (this.summaryAccessor() !== DEFAULT_SUMMARY_ACCESSOR) {\n return;\n }\n const data = this.dataInput();\n if (data.length === 0) {\n return;\n }\n const projected = Number(data[0] as unknown);\n if (Number.isFinite(projected)) {\n return;\n }\n console.warn(\n 'CngxChart: data is non-numeric and no [summaryAccessor] is bound. ' +\n 'Auto-Summary and the SR data-table will silently fall back to NaN. ' +\n 'Bind [summaryAccessor]=\"(d) => d.yourField\" or pass a numeric data array.',\n );\n });\n afterNextRender(() => {\n if (this.overlaySlots().length > 1) {\n console.warn(\n 'CngxChart: more than one *cngxChartOverlay projected; only the first renders. ' +\n 'Compose multiple overlays inside a single overlay template.',\n );\n }\n });\n }\n }\n\n readonly dataLength = computed(() => this.dataInput().length);\n\n /**\n * Generic-aware data accessor satisfying {@link CngxChartContext.data}.\n * The single boundary cast lives here; layer atoms call\n * `this.ctx.data<T>()` and receive `readonly T[]` directly with no\n * per-site `as` cast.\n */\n data<U = T>(): readonly U[] {\n return this.dataInput() as unknown as readonly U[];\n }\n\n readonly dimensions = computed(\n () => ({\n width: this.width() ?? this.resize.width(),\n height: this.height() ?? this.resize.height(),\n }),\n { equal: dimensionsEqual },\n );\n\n /**\n * Room the projected axes need for their decoration, per side.\n * Chart-internal: it exists only to produce {@link plot}, which is\n * what every reader actually wants.\n *\n * Which sides reserve is derived from the same `axes()` query the\n * scale lookups below already read - a consumer input would be a\n * second source for something the chart can see. How much each side\n * reserves is the axis's own {@link CngxChartAxis.reservation}: the\n * chart never learns what a tick label is, and the axis never learns\n * where the plot ends. A side with no axis on it stays `0`, which is\n * why a chart whose axes all draw nothing resolves to\n * {@link ZERO_INSET} and renders exactly as it did before the inset\n * existed.\n */\n private readonly inset = computed<CngxChartInset>(\n () => {\n const axes = this.axes();\n if (axes.length === 0) {\n return ZERO_INSET;\n }\n let inlineStart = 0;\n let inlineEnd = 0;\n let blockStart = 0;\n let blockEnd = 0;\n for (const axis of axes) {\n const room = axis.reservation();\n // Half the extreme tick label hangs past the plot corner along\n // the axis's own line, so every axis also reserves on the two\n // sides perpendicular to it. Without this a left axis's topmost\n // label paints above the viewBox and a bottom axis's last label\n // paints past its right edge, however deep their own gutters are.\n const cross = axis.crossReservation();\n // Two axes on the same side reserve the wider of the two\n // rather than stacking - they draw over each other, so the\n // room they need is the room the deeper one needs.\n switch (axis.position()) {\n case 'left':\n inlineStart = Math.max(inlineStart, room);\n blockStart = Math.max(blockStart, cross);\n blockEnd = Math.max(blockEnd, cross);\n break;\n case 'right':\n inlineEnd = Math.max(inlineEnd, room);\n blockStart = Math.max(blockStart, cross);\n blockEnd = Math.max(blockEnd, cross);\n break;\n case 'top':\n blockStart = Math.max(blockStart, room);\n inlineStart = Math.max(inlineStart, cross);\n inlineEnd = Math.max(inlineEnd, cross);\n break;\n case 'bottom':\n blockEnd = Math.max(blockEnd, room);\n inlineStart = Math.max(inlineStart, cross);\n inlineEnd = Math.max(inlineEnd, cross);\n break;\n }\n }\n return { inlineStart, inlineEnd, blockStart, blockEnd };\n },\n { equal: insetEqual },\n );\n\n /**\n * The plot inset as percentages of the host box, published as the\n * `--cngx-chart-plot-*` custom properties.\n *\n * Custom properties inherit downwards, so these reach the chart's own\n * subtree. An overlay outside the host does not see them and reads\n * {@link plot} off the exported instance instead\n * (`#chart=\"cngxChart\"`) - projected content lands inside the `<svg>`,\n * so an HTML overlay is always a sibling.\n *\n * Percentages rather than pixels, because a user unit is not always a\n * CSS pixel: an explicit `[width]=\"520\"` chart squeezed by\n * `max-width: 100%` keeps a 520-unit viewBox inside a 400px box. A\n * fraction of the viewBox survives that scaling where a px value\n * would not. Block values resolve against the containing block's\n * height and inline values against its width, matching what `top` and\n * `inset-inline-end` expect.\n *\n * Exact while the host's aspect ratio matches the viewBox, which is\n * what {@link explicitAspectRatio} holds it to whenever both `[width]`\n * and `[height]` are bound. Bind only one and it returns `null` on\n * purpose (the consumer drove one dimension deliberately); the SVG\n * then letterboxes under `preserveAspectRatio`, and these percentages\n * address the host box rather than the letterboxed drawing area. The\n * error is the letterbox margin - zero until the host is forced away\n * from the viewBox ratio. Bind both dimensions when an overlay has to\n * land on the plot edge exactly.\n */\n protected readonly plotVars = computed(\n () => {\n const { width, height } = this.dimensions();\n const pct = (v: number, extent: number): string =>\n extent > 0 ? `${+((v / extent) * 100).toFixed(4)}%` : '0%';\n const { inlineStart, inlineEnd, blockStart, blockEnd } = this.inset();\n return {\n inlineStart: pct(inlineStart, width),\n inlineEnd: pct(inlineEnd, width),\n blockStart: pct(blockStart, height),\n blockEnd: pct(blockEnd, height),\n };\n },\n {\n equal: (a, b) =>\n a.inlineStart === b.inlineStart &&\n a.inlineEnd === b.inlineEnd &&\n a.blockStart === b.blockStart &&\n a.blockEnd === b.blockEnd,\n },\n );\n\n /**\n * The plot rectangle published on {@link CngxChartContext}: the\n * viewBox minus {@link inset}. Both scale ranges below and every\n * `[cngxAxis]` resolve against this one derivation, so there is no\n * second place where the box and the reserved room are subtracted\n * from each other and no way for the two to disagree.\n */\n readonly plot = computed<CngxChartPlotArea>(\n () => {\n const { width, height } = this.dimensions();\n const { inlineStart, inlineEnd, blockStart, blockEnd } = this.inset();\n const x1 = width - inlineEnd;\n const y1 = height - blockEnd;\n return {\n x0: inlineStart,\n y0: blockStart,\n x1,\n y1,\n width: x1 - inlineStart,\n height: y1 - blockStart,\n };\n },\n { equal: plotAreaEqual },\n );\n\n /**\n * Render backend: `'canvas'` once the datapoint count exceeds the\n * configured threshold, `'svg'` otherwise. The threshold is a DI\n * constant ({@link CNGX_CHART_RENDERER_THRESHOLD}, default `500`),\n * resolved once at construction; a consumer tunes it via\n * `withChartRendererThreshold(...)` or replaces the whole factory.\n */\n readonly renderMode = computed<'svg' | 'canvas'>(() =>\n this.dataLength() > this.threshold ? 'canvas' : 'svg',\n );\n\n /**\n * SVG-output gate published on {@link CngxChartContext}. Derived from\n * {@link renderMode} - layer atoms self-render their SVG only in SVG\n * mode. Single source of truth; the renderer never writes it.\n */\n readonly renderSvg: Signal<boolean> = computed(() => this.renderMode() === 'svg');\n\n /**\n * Aggregate layer geometries the Canvas backend paints. Element-wise\n * guarded: an unchanged layer contributes a reference-stable geometry\n * object (its own `equal` fn holds), so the mapped array is\n * element-wise-equal and the paint cascade short-circuits.\n */\n protected readonly geometries = computed<readonly LayerGeometry[]>(\n () => this.layers().map((l) => l.geometry()),\n { equal: sameItemsArr },\n );\n\n protected readonly viewBox = computed(() => {\n const { width, height } = this.dimensions();\n return `0 0 ${width || 0} ${height || 0}`;\n });\n\n private readonly xScaleCache = createScaleLru();\n private readonly yScaleCache = createScaleLru();\n\n readonly xScale = computed<ScaleFn<XScaleInput>>(\n () => {\n const axes = this.axes();\n const plot = this.plot();\n // Guard the plot extent, not the box: a chart narrower than the\n // room its axes need would otherwise get a backwards range and\n // paint every mark mirrored.\n if (plot.width <= 0) {\n return NOOP_SCALE;\n }\n const xAxis = axes.find((a) => isHorizontalPosition(a.position()));\n if (!xAxis) {\n return NOOP_SCALE;\n }\n return this.xScaleCache.get(xAxis.type(), xAxis.domain() ?? [], [plot.x0, plot.x1]);\n },\n { equal: (a, b) => a === b },\n );\n\n readonly yScale = computed<ScaleFn<number>>(\n () => {\n const axes = this.axes();\n const plot = this.plot();\n if (plot.height <= 0) {\n return NOOP_Y_SCALE;\n }\n const yAxis = axes.find((a) => isVerticalPosition(a.position()));\n if (!yAxis) {\n return NOOP_Y_SCALE;\n }\n // SVG Y-axis is flipped - domain[max] maps to the plot area's top edge, domain[min] to its bottom edge.\n return this.yScaleCache.get(yAxis.type(), yAxis.domain() ?? [], [\n plot.y1,\n plot.y0,\n ]) as ScaleFn<number>;\n },\n { equal: (a, b) => a === b },\n );\n\n /**\n * Auto-Summary derived from `data` and `<cngx-threshold>` content\n * children. Drives the host's reactive `aria-label`. Layer atoms do\n * not contribute to the summary today; per-layer hints may extend it\n * later.\n */\n readonly summary = computed(\n () => {\n const acc = this.summaryAccessor();\n const data = this.dataInput();\n const values = new Array<number>(data.length);\n for (let i = 0; i < data.length; i++) {\n values[i] = acc(data[i], i);\n }\n const thresholds = this.thresholds().map((t) => t.value());\n return computeChartSummary(values, thresholds);\n },\n {\n equal: (a, b) =>\n a.trend === b.trend &&\n a.min === b.min &&\n a.max === b.max &&\n a.current === b.current &&\n sameNumberArr(a.thresholds, b.thresholds),\n },\n );\n\n /**\n * The most recent significant transition (trend-flip or threshold-cross)\n * derived from {@link summary}, or `null`. The chart stays\n * pure-derivation - a companion `<cngx-chart-announcer>` subscribes to\n * this surface and voices it to assistive technology.\n */\n readonly significantChange = createSignificantChangeTracker(this.summary);\n\n /**\n * Active view for the optional state-machine envelope. Returns\n * `'content'` when no `[state]` is bound, falling through to the\n * default branch that renders the SVG content. Otherwise routes\n * through {@link resolveAsyncView} using the same status / firstLoad\n * / empty triple every preset and async-aware atom in the library\n * uses.\n */\n protected readonly activeView = computed<AsyncView>(() => {\n const s = this.state();\n if (!s) {\n return 'content';\n }\n return resolveAsyncView(s.status(), s.isFirstLoad(), s.isEmpty());\n });\n\n /** True when the chart is currently rendering its skeleton view. */\n protected readonly busy = computed(() => this.activeView() === 'skeleton');\n\n /**\n * True when a fallback view (skeleton / empty / error / none) has\n * replaced the data content. The Canvas overlay is a sibling of the\n * `@switch` and would otherwise keep painting the chart on top of the\n * fallback in canvas mode - this gates it off so the fallback stands\n * alone.\n */\n protected readonly contentHidden = computed(() => {\n const view = this.activeView();\n return view === 'skeleton' || view === 'empty' || view === 'error' || view === 'none';\n });\n\n /**\n * Responsive mode is active when neither `[width]` nor `[height]` is\n * bound. The host then fills its parent's width and derives height\n * from the `--cngx-chart-aspect-ratio` CSS custom property (default\n * `16 / 9`). The resize observer feeds `dimensions()` which drives\n * the SVG sizing + scale math, so axes and layer atoms re-flow\n * reactively as the parent resizes.\n */\n protected readonly isResponsive = computed(\n () => this.width() === undefined && this.height() === undefined,\n );\n\n /**\n * Aspect-ratio host style for the explicit-dimension case. Computed\n * from `[width] / [height]` so the chart stays proportional when\n * `max-width: 100%` shrinks the host below the explicit width on a\n * narrow viewport (mobile portrait, constrained dashboard cell).\n * Returns `null` in responsive mode so the\n * `--cngx-chart-aspect-ratio` CSS variable on `.cngx-chart--responsive`\n * wins, and `null` when only one of width/height is bound (caller\n * intentionally drove just one dimension; we do not invent a ratio).\n */\n protected readonly explicitAspectRatio = computed<string | null>(() => {\n const w = this.width();\n const h = this.height();\n if (w === undefined || h === undefined || w <= 0 || h <= 0) {\n return null;\n }\n return `${w} / ${h}`;\n });\n\n /**\n * Reactive `aria-label` text the host announces. Skeleton / empty /\n * error states announce localised i18n strings; the auto-Summary\n * runs only in the content branch so AT does not read stale data\n * during a refetch.\n */\n protected readonly ariaLabelText = computed(() => {\n const view = this.activeView();\n if (view === 'skeleton') {\n return this.i18n.loading();\n }\n if (view === 'empty') {\n return this.i18n.empty();\n }\n if (view === 'error') {\n return this.i18n.error();\n }\n const explicit = this.ariaLabel();\n if (explicit !== null && explicit !== undefined && explicit !== '') {\n return explicit;\n }\n return this.i18n.summary(this.summary());\n });\n\n /** Numeric projection of `data` reused by the data-table view. */\n protected readonly summaryValues = computed<readonly number[]>(\n () => {\n const acc = this.summaryAccessor();\n const data = this.dataInput();\n const out = new Array<number>(data.length);\n for (let i = 0; i < data.length; i++) {\n out[i] = acc(data[i], i);\n }\n return out;\n },\n { equal: sameNumberArr },\n );\n\n /**\n * Auto-mode predicate. Drives the data-table's `aria-hidden`\n * binding. The id on `aria-describedby` is invariant - it stays on\n * the host whether the table is active or not. Single-value charts\n * speak via the `aria-label` summary; multi-value charts add the\n * table for row-by-row exploration.\n */\n protected readonly tableActive = computed(() => {\n const mode = this.accessibleTable();\n if (mode === 'off') {\n return false;\n }\n return this.dataInput().length > 1;\n });\n}\n\n/** @internal */\nfunction isHorizontalPosition(p: CngxAxisPosition): boolean {\n return p === 'top' || p === 'bottom';\n}\n\n/** @internal */\nfunction isVerticalPosition(p: CngxAxisPosition): boolean {\n return p === 'left' || p === 'right';\n}\n\n/** @internal */\nfunction buildScale(\n type: CngxAxisType,\n domain: readonly unknown[],\n range: readonly [number, number],\n): ScaleFn<XScaleInput> {\n if (domain.length < 2) {\n return NOOP_SCALE;\n }\n switch (type) {\n case 'linear': {\n const linear = createLinearScale(\n [Number(domain[0]), Number(domain[domain.length - 1])],\n range,\n );\n return (v: XScaleInput) => linear(typeof v === 'number' ? v : Number(v));\n }\n case 'time': {\n const time = createTimeScale([toMs(domain[0]), toMs(domain[domain.length - 1])], range);\n return (v: XScaleInput) => time(v instanceof Date ? v : Number(v));\n }\n case 'band': {\n const band = createBandScale<unknown>(domain, range);\n // createBandScale returns the leading edge; chart consumers\n // (ticks, line/area/scatter, threshold/band yScale) want the\n // centre so ticks align with their slot and lines trace through\n // bar centres. Bar atom uses its own slot logic - unaffected.\n const half = band.bandwidth() / 2;\n return (v: XScaleInput) => band(v) + half;\n }\n }\n}\n\n/**\n * Per-chart single-slot LRU on `buildScale`. Caches the\n * `(type, domain-shape, range)` tuple so `xScale`/`yScale` re-emissions\n * with the same axis configuration return the same `ScaleFn` closure\n * instance. Combined with the `equal: (a, b) => a === b` on the\n * `xScale`/`yScale` computeds, an unchanged dimension/axis re-evaluation\n * short-circuits at the cascade guard.\n *\n * Time-typed `Date` endpoints are keyed via `+date` (ms) to handle the\n * common case where a parent re-creates the domain array each tick with\n * `new Date(...)` - raw `Date` references would never `Object.is`-match\n * across ticks.\n *\n * @internal\n */\ninterface ScaleLru {\n get(\n type: CngxAxisType,\n domain: readonly unknown[],\n range: readonly [number, number],\n ): ScaleFn<XScaleInput>;\n}\n\n/** @internal */\nfunction createScaleLru(): ScaleLru {\n let lastType: CngxAxisType | null = null;\n let lastDomainLen = -1;\n let lastDomainStart: number | string | null = null;\n let lastDomainEnd: number | string | null = null;\n let lastDomainAllKeys: string | null = null;\n let lastRange0 = NaN;\n let lastRange1 = NaN;\n let lastFn: ScaleFn<XScaleInput> = NOOP_SCALE;\n\n return {\n get(type, domain, range) {\n const keyStart = endpointKey(domain[0]);\n const keyEnd = endpointKey(domain[domain.length - 1]);\n // For band scales, the cache must invalidate on any reorder/swap of\n // values; cheap stringification of all keys is sufficient because\n // band domains are typically short.\n const allKeys = type === 'band' ? domain.map(endpointKey).join('|') : null;\n if (\n type === lastType &&\n domain.length === lastDomainLen &&\n keyStart === lastDomainStart &&\n keyEnd === lastDomainEnd &&\n allKeys === lastDomainAllKeys &&\n range[0] === lastRange0 &&\n range[1] === lastRange1\n ) {\n return lastFn;\n }\n lastType = type;\n lastDomainLen = domain.length;\n lastDomainStart = keyStart;\n lastDomainEnd = keyEnd;\n lastDomainAllKeys = allKeys;\n lastRange0 = range[0];\n lastRange1 = range[1];\n lastFn = buildScale(type, domain, range);\n return lastFn;\n },\n };\n}\n\n/** @internal */\nfunction endpointKey(v: unknown): number | string {\n if (v instanceof Date) {\n return v.getTime();\n }\n if (typeof v === 'number' || typeof v === 'string') {\n return v;\n }\n return String(v);\n}\n\n/** @internal */\nfunction toMs(v: unknown): number {\n if (typeof v === 'number') {\n return v;\n }\n if (v instanceof Date) {\n return v.getTime();\n }\n return Number(v);\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\n\nimport { CNGX_CHART_I18N } from '../i18n/chart-i18n';\nimport { type CngxChart } from './chart.component';\n\n/**\n * Companion live-region announcer for `<cngx-chart>`. Mount it next to a\n * chart and bind the chart instance; it voices the chart's\n * `significantChange()` events to assistive technology through two\n * always-in-DOM regions with a severity split (W3C ARIA practice):\n *\n * - trend flips -> a polite `role=\"status\"` region (informational);\n * - threshold crossings -> an assertive `role=\"alert\"` region\n * (operationally significant, warrants interruption).\n *\n * Both announcements are pure-derivation `computed`s the template\n * interpolates - there is no `effect()` bridge and nothing to wrap in\n * `untracked()` (same shape as `CngxRecyclerAnnouncer`). Text is localised\n * through {@link CNGX_CHART_I18N}.\n *\n * ```html\n * <cngx-chart #c [data]=\"points()\" />\n * <cngx-chart-announcer [cngxChartAnnouncer]=\"c\" />\n * ```\n *\n * @category common/chart\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/chart-announcer.component.ts\n * @since 0.1.0\n * @relatedTo CngxChart, createSignificantChangeTracker\n *\n * <example-url>http://localhost:4200/#/common/chart/realtime/streaming-telemetry</example-url>\n */\n@Component({\n selector: 'cngx-chart-announcer',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { style: 'display: contents' },\n template: `\n <span role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"cngx-sr-only\">{{\n politeAnnouncement()\n }}</span>\n <span role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"cngx-sr-only\">{{\n assertiveAnnouncement()\n }}</span>\n `,\n // Ship the visually-hidden rule locally (emulated encapsulation scopes it\n // to these spans) so the announcer stays self-contained even when the\n // global @cngx/themes utilities.css is not loaded - an SR-only region\n // must never fall back to visible text.\n styles: [\n `\n .cngx-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n `,\n ],\n})\nexport class CngxChartAnnouncer {\n /** The chart instance whose `significantChange()` this announcer voices. */\n readonly chart = input.required<CngxChart>({ alias: 'cngxChartAnnouncer' });\n\n private readonly i18n = inject(CNGX_CHART_I18N);\n\n /** Polite (informational) text for trend flips; empty otherwise. */\n protected readonly politeAnnouncement = computed(() => {\n const ev = this.chart().significantChange();\n return ev?.kind === 'trend-flip' ? this.i18n.trendChanged(ev.to) : '';\n });\n\n /** Assertive (interrupting) text for threshold crossings; empty otherwise. */\n protected readonly assertiveAnnouncement = computed(() => {\n const ev = this.chart().significantChange();\n return ev?.kind === 'threshold-cross' ? this.i18n.thresholdAlert(ev.threshold) : '';\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { CNGX_CHART_CONTEXT, type CngxChartPlotArea } from '../chart/chart-context';\nimport { CNGX_CHART_AXIS, type CngxChartAxis } from './chart-axis';\nimport { type CngxAxisPosition, type CngxAxisType } from './axis-position';\n\n/** @internal */\nconst DEFAULT_TICK_COUNT = 5;\n/** @internal */\nconst TICK_LENGTH = 5;\n/** @internal */\nconst LABEL_OFFSET = 4;\n/** @internal */\nconst AXIS_LABEL_OFFSET_INLINE = 32;\n/** @internal */\nconst AXIS_LABEL_OFFSET_BLOCK = 36;\n\n/**\n * The declared default of `--cngx-axis-font-size` (see the tick-label\n * rule in `styles` below), in viewBox user units.\n *\n * Duplicated here because {@link CngxAxis.reservation} is arithmetic\n * over label strings and reads nothing from the DOM - resolving the\n * custom property would mean a `getComputedStyle` call in the reactive\n * graph. A consumer restyling the property therefore gets tick labels\n * at their size inside a gutter sized for the default; that is the\n * single limitation the chart-area debt register covers.\n *\n * @internal\n */\nconst AXIS_FONT_SIZE = 11;\n\n/**\n * The declared default of `--cngx-axis-axis-label-font-size`. Same\n * no-DOM-read reasoning as {@link AXIS_FONT_SIZE}.\n *\n * @internal\n */\nconst AXIS_LABEL_FONT_SIZE = 12;\n\n/**\n * Width of one character as a fraction of the font size. An estimate,\n * not the font's real advance width - the axis knows its label strings\n * but not the glyphs they resolve to.\n *\n * `0.65` covers the measured digit advance in the demo app's font\n * stack: at 11px `system-ui` a digit lays out 7.0 units wide, a ratio\n * of 0.636. Digits are the common case on an axis and the widest\n * per-character case in a numeric label - separators and decimal points\n * are narrower, so a thousands-separated label over-reserves, which is\n * the correct direction to be wrong in.\n *\n * @internal\n */\nconst CHAR_ADVANCE_RATIO = 0.65;\n\n/**\n * Height of a rendered line box as a fraction of the font size, sized\n * so that *half* of it still covers the taller half. A label reaches\n * above its ascender and below its descender, so it needs more than the\n * font size: at 11px the browser lays out 13, a ratio of 1.18. It is\n * also not centred on its anchor - a `dominant-baseline: middle` label\n * measures 8.11 above the anchor and 4.89 below, so a symmetric half of\n * the true line box under-reserves on the taller side by exactly the\n * amount that clips the topmost tick label of a left axis.\n *\n * `1.5` is that asymmetry folded into one number: `11 x 1.5 / 2 = 8.25`\n * covers the measured 8.11, and the full value over-reserves a\n * horizontal axis by about three units, which is the direction to be\n * wrong in.\n *\n * @internal\n */\nconst LINE_BOX_RATIO = 1.5;\n\n/** @internal */\ninterface AxisLabelGeometry {\n readonly transform: string;\n readonly anchor: 'start' | 'middle' | 'end';\n readonly baseline: 'auto' | 'middle' | 'hanging';\n}\n\n/** @internal */\ninterface AxisGeometry {\n readonly transform: string;\n readonly line: {\n readonly x1: number;\n readonly y1: number;\n readonly x2: number;\n readonly y2: number;\n };\n}\n\n/** @internal */\ninterface TickRendering {\n readonly key: string;\n readonly transform: string;\n readonly tickLine: {\n readonly x1: number;\n readonly y1: number;\n readonly x2: number;\n readonly y2: number;\n };\n /**\n * Endpoint of the gridline that extends from this tick across the\n * chart's perpendicular dimension. `(x1, y1)` is always `(0, 0)`\n * (the tick's local origin); `(x2, y2)` reaches the opposite side\n * of the chart area. Always present in the tick rendering - the\n * `[showGrid]` input controls whether the line is rendered, not\n * whether the geometry is computed.\n */\n readonly gridLine: { readonly x2: number; readonly y2: number };\n readonly label: {\n readonly x: number;\n readonly y: number;\n readonly anchor: 'start' | 'middle' | 'end';\n readonly baseline: 'auto' | 'middle' | 'hanging';\n readonly text: string;\n };\n}\n\n/**\n * Declarative axis directive. Lives as a content child of\n * `<cngx-chart>`; its `position` + `type` + `domain` inputs feed the\n * parent's scale derivation. Renders SVG ticks and labels in the\n * coordinate system the parent publishes via {@link CNGX_CHART_CONTEXT}.\n *\n * Attribute-selector on `<svg:g>` - the host element IS the SVG group.\n * This keeps the namespace boundary clean: a `<cngx-axis>` element\n * inside `<svg>` would be in the XHTML namespace and SVG layout would\n * not flow through it. By making the directive attribute-only, the\n * host stays in the SVG namespace and the browser lays out tick lines\n * and labels exactly where the geometry says.\n *\n * Host carries `aria-hidden=\"true\"` - axis text is decoration; the\n * semantic data view lives on the parent chart's auto-Summary and\n * Data Table.\n *\n * @category common/chart/axis\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/axis/axis.component.ts\n * @since 0.1.0\n * @relatedTo CngxChart, CngxLine, CngxBar, CngxArea\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxAxis]',\n exportAs: 'cngxAxis',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_AXIS, useExisting: CngxAxis }],\n host: {\n 'aria-hidden': 'true',\n '[attr.transform]': 'axisGeometry()?.transform ?? null',\n '[attr.class]': 'hostClass()',\n },\n template: `\n @if (axisGeometry(); as g) {\n @if (showGrid()) {\n @for (tick of tickRenderings(); track tick.key) {\n <svg:line\n [attr.transform]=\"tick.transform\"\n [attr.x1]=\"0\"\n [attr.y1]=\"0\"\n [attr.x2]=\"tick.gridLine.x2\"\n [attr.y2]=\"tick.gridLine.y2\"\n class=\"cngx-axis__grid-line\"\n />\n }\n }\n <svg:line\n [attr.x1]=\"g.line.x1\"\n [attr.y1]=\"g.line.y1\"\n [attr.x2]=\"g.line.x2\"\n [attr.y2]=\"g.line.y2\"\n class=\"cngx-axis__line\"\n />\n @for (tick of tickRenderings(); track tick.key) {\n <svg:g [attr.transform]=\"tick.transform\" class=\"cngx-axis__tick\">\n <svg:line\n [attr.x1]=\"tick.tickLine.x1\"\n [attr.y1]=\"tick.tickLine.y1\"\n [attr.x2]=\"tick.tickLine.x2\"\n [attr.y2]=\"tick.tickLine.y2\"\n class=\"cngx-axis__tick-line\"\n />\n <svg:text\n [attr.x]=\"tick.label.x\"\n [attr.y]=\"tick.label.y\"\n [attr.text-anchor]=\"tick.label.anchor\"\n [attr.dominant-baseline]=\"tick.label.baseline\"\n class=\"cngx-axis__tick-label\"\n >\n {{ tick.label.text }}\n </svg:text>\n </svg:g>\n }\n @if (axisLabel(); as title) {\n @if (axisLabelGeometry(); as g) {\n <svg:text\n class=\"cngx-axis__axis-label\"\n [attr.transform]=\"g.transform\"\n [attr.text-anchor]=\"g.anchor\"\n [attr.dominant-baseline]=\"g.baseline\"\n >\n {{ title }}\n </svg:text>\n }\n }\n }\n `,\n styles: [\n `\n .cngx-axis__line,\n .cngx-axis__tick-line {\n stroke: var(--cngx-axis-color, var(--cngx-chart-axis-color, currentColor));\n stroke-width: var(--cngx-axis-stroke-width, 1px);\n fill: none;\n }\n .cngx-axis__tick-label {\n fill: var(--cngx-axis-text-color, var(--cngx-chart-text-color, currentColor));\n font-size: var(--cngx-axis-font-size, 11px);\n unicode-bidi: var(--cngx-chart-numeric-bidi, isolate);\n }\n .cngx-axis__grid-line {\n stroke: var(--cngx-axis-grid-color, var(--cngx-chart-grid-color, currentColor));\n stroke-opacity: var(--cngx-axis-grid-opacity, 0.6);\n stroke-width: var(--cngx-axis-grid-stroke-width, 1px);\n stroke-dasharray: var(--cngx-axis-grid-dasharray, 0);\n fill: none;\n pointer-events: none;\n }\n .cngx-axis__axis-label {\n fill: var(--cngx-axis-axis-label-color, var(--cngx-chart-text-color, currentColor));\n font-size: var(--cngx-axis-axis-label-font-size, 12px);\n font-weight: var(--cngx-axis-axis-label-font-weight, 500);\n }\n `,\n ],\n})\nexport class CngxAxis implements CngxChartAxis {\n readonly position = input.required<CngxAxisPosition>();\n readonly type = input<CngxAxisType>('linear');\n readonly domain = input<readonly unknown[] | undefined>(undefined);\n readonly tickCount = input<number | undefined>(undefined, { alias: 'ticks' });\n readonly format = input<(v: unknown) => string>(defaultTickFormat);\n /**\n * Render decorative gridlines extending from each tick across the\n * chart's perpendicular dimension. Theming via the\n * `--cngx-axis-grid-color` / `--cngx-axis-grid-opacity` /\n * `--cngx-axis-grid-stroke-width` / `--cngx-axis-grid-dasharray`\n * CSS custom properties (defaults: chart-level grid colour, 0.6\n * opacity, 1px solid). Aliased as `[grid]` for terseness.\n */\n readonly showGrid = input<boolean>(false, { alias: 'grid' });\n /**\n * Optional axis title rendered alongside the tick labels -\n * \"Months\", \"Revenue (k€)\", etc. The title is positioned outside\n * the tick labels (further from the chart area) and rotated -90°\n * for left/right axes so it reads bottom-to-top. Theming via the\n * `--cngx-axis-axis-label-color` and `--cngx-axis-axis-label-font-size`\n * CSS custom properties (default: chart text colour + 12px). Aliased\n * `[label]` for terseness.\n */\n readonly axisLabel = input<string | null>(null, { alias: 'label' });\n\n private readonly ctx = inject(CNGX_CHART_CONTEXT);\n\n /**\n * Tick values to render. Resolution order:\n * 1. `type='band'` and `[domain]` provided → one tick per domain\n * value.\n * 2. linear/time + `[domain]` provided → `[ticks]`-many evenly\n * spaced positions across the domain (default 5).\n * 3. Otherwise → empty array. Axis still renders the line.\n */\n readonly tickValues = computed<readonly unknown[]>(\n () => {\n const dom = this.domain();\n const count = this.tickCount() ?? DEFAULT_TICK_COUNT;\n const t = this.type();\n\n if (t === 'band') {\n return dom ?? [];\n }\n\n if (!dom || dom.length < 2) {\n return [];\n }\n\n if (t === 'time') {\n const start = toMs(dom[0]);\n const end = toMs(dom.at(-1));\n return spread(start, end, count).map((ms) => new Date(ms));\n }\n\n const start = Number(dom[0]);\n const end = Number(dom.at(-1));\n return spread(start, end, count);\n },\n {\n equal: (a, b) => {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const av = a[i];\n const bv = b[i];\n if (Object.is(av, bv)) {\n continue;\n }\n if (av instanceof Date && bv instanceof Date && av.getTime() === bv.getTime()) {\n continue;\n }\n return false;\n }\n return true;\n },\n },\n );\n\n /**\n * How far this axis's decoration extends perpendicular to its own\n * line, in viewBox user units. The parent chart reads it to size the\n * plot inset on the side {@link position} names; nothing else\n * consumes it.\n *\n * The magnitude is derived, not configured. A vertical axis reserves\n * for the tick gap plus the *longest formatted tick label*, because a\n * left label grows leftward with its character count. A horizontal\n * axis reserves the tick gap plus one line box, because a bottom\n * label grows downward by its height no matter how long it is. An\n * axis carrying a {@link axisLabel} title reserves at least the\n * title's own fixed offset plus its line box, since\n * `buildAxisLabelGeometry` places the title at a constant distance\n * from the line rather than beyond the ticks - so the two extents\n * are alternatives, not addends.\n *\n * Character width is an estimate ({@link CHAR_ADVANCE_RATIO}), which\n * is the one value here that is not derived from state the axis\n * owns. Everything else comes from {@link tickValues} and\n * {@link format}, which the component already computes to render the\n * labels themselves - so this reads no DOM, measures no text, and\n * returns the same number under SSR as in the browser.\n *\n * Acyclic by construction: {@link tickValues} reads `domain` /\n * `ticks` / `type` and never the scale, so\n * `reservation -> inset -> plot -> scale -> tickRenderings` has no\n * back edge.\n */\n readonly reservation = computed<number>(() => {\n const horizontal = this.position() === 'top' || this.position() === 'bottom';\n\n const labelExtent = horizontal ? AXIS_FONT_SIZE * LINE_BOX_RATIO : this.widestTickLabel();\n const tickRoom = TICK_LENGTH + LABEL_OFFSET + labelExtent;\n\n const titleRoom = this.axisLabel()\n ? (horizontal ? AXIS_LABEL_OFFSET_INLINE : AXIS_LABEL_OFFSET_BLOCK) +\n AXIS_LABEL_FONT_SIZE * LINE_BOX_RATIO\n : 0;\n\n // Whole user units, rounded up: the estimate is already an\n // approximation, so rounding down would trade a clean number for a\n // clipped glyph. It also keeps the axis `transform` a short\n // integer string instead of the float noise the ratio produces.\n return Math.ceil(Math.max(tickRoom, titleRoom));\n });\n\n /**\n * How far this axis's decoration extends *along* its own line, past\n * the plot corner at either end. The parent chart reserves it on the\n * two sides perpendicular to {@link position}.\n *\n * A tick label is centred on its tick, and the extreme ticks sit\n * exactly on the plot corners - so half of the first and last label\n * hangs outside the plot no matter how much room the axis's own side\n * reserves. A left axis's topmost label overhangs upward by half a\n * line box; a bottom axis's last label overhangs rightward by half\n * its width. Reserving only on the side the axis occupies leaves\n * both of those painting outside the viewBox, which is the defect\n * this pairs with {@link reservation} to close.\n *\n * The widest label stands in for the two extreme ones. Being wrong\n * here means over-reserving by a few units on an axis whose ends\n * happen to carry its shortest labels, which is cheaper than the\n * per-end bookkeeping the exact answer would need.\n */\n readonly crossReservation = computed<number>(() => {\n const horizontal = this.position() === 'top' || this.position() === 'bottom';\n const extent = horizontal ? this.widestTickLabel() : AXIS_FONT_SIZE * LINE_BOX_RATIO;\n return Math.ceil(extent / 2);\n });\n\n /**\n * Estimated width of the widest formatted tick label, in viewBox user\n * units. Split out so a horizontal axis reads it only where label\n * width actually matters - its own reservation is a line box, and\n * only its cross-axis overhang depends on the strings.\n */\n private readonly widestTickLabel = computed<number>(\n () => this.longestTickLabel() * AXIS_FONT_SIZE * CHAR_ADVANCE_RATIO,\n );\n\n /**\n * Character count of the widest formatted tick label. Split out so\n * that {@link reservation} on a horizontal axis never reads it - a\n * bottom label's own gutter is its height, so tracking the label\n * strings there would add a dependency that cannot change the result.\n * {@link crossReservation} does read it in the horizontal case, where\n * the label's width is exactly what overhangs the plot corner.\n */\n private readonly longestTickLabel = computed<number>(() => {\n const fmt = this.format();\n let longest = 0;\n for (const v of this.tickValues()) {\n const len = fmt(v).length;\n if (len > longest) {\n longest = len;\n }\n }\n return longest;\n });\n\n protected readonly hostClass = computed(() => `cngx-axis cngx-axis--${this.position()}`);\n\n /**\n * The chart's plot area, or `null` once it has collapsed on either\n * dimension - the same condition under which the chart hands out its\n * NOOP scale, so a collapsed chart renders no axis rather than an\n * axis against a backwards range.\n *\n * The rectangle itself is the chart's derivation, read straight off\n * the context. The axis narrows it to a render/do-not-render\n * decision; it never reconstructs it from the box.\n */\n private readonly plot = computed<CngxChartPlotArea | null>(() => {\n const plot = this.ctx.plot();\n return plot.width <= 0 || plot.height <= 0 ? null : plot;\n });\n\n protected readonly axisLabelGeometry = computed<AxisLabelGeometry | null>(\n () => {\n const plot = this.plot();\n if (!plot) {\n return null;\n }\n return buildAxisLabelGeometry(this.position(), plot);\n },\n {\n equal: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.transform === b.transform &&\n a.anchor === b.anchor &&\n a.baseline === b.baseline),\n },\n );\n\n protected readonly axisGeometry = computed<AxisGeometry | null>(\n () => {\n const plot = this.plot();\n if (!plot) {\n return null;\n }\n return buildAxisGeometry(this.position(), plot);\n },\n {\n equal: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.transform === b.transform &&\n a.line.x1 === b.line.x1 &&\n a.line.y1 === b.line.y1 &&\n a.line.x2 === b.line.x2 &&\n a.line.y2 === b.line.y2),\n },\n );\n\n protected readonly tickRenderings = computed<readonly TickRendering[]>(\n () => {\n const pos = this.position();\n const values = this.tickValues();\n const fmt = this.format();\n const plot = this.plot();\n if (!plot) {\n return [];\n }\n const isHorizontal = pos === 'top' || pos === 'bottom';\n const scale = isHorizontal ? this.ctx.xScale() : this.ctx.yScale();\n return values.map((v, i) => {\n const offset = (scale as (input: unknown) => number)(v);\n return buildTickRendering(pos, offset, fmt(v), `${i}-${String(v)}`, plot);\n });\n },\n {\n equal: (a, b) => {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const ta = a[i];\n const tb = b[i];\n if (\n ta.key !== tb.key ||\n ta.transform !== tb.transform ||\n ta.label.text !== tb.label.text ||\n ta.tickLine.x1 !== tb.tickLine.x1 ||\n ta.tickLine.y1 !== tb.tickLine.y1 ||\n ta.tickLine.x2 !== tb.tickLine.x2 ||\n ta.tickLine.y2 !== tb.tickLine.y2 ||\n ta.gridLine.x2 !== tb.gridLine.x2 ||\n ta.gridLine.y2 !== tb.gridLine.y2\n ) {\n return false;\n }\n }\n return true;\n },\n },\n );\n}\n\n/** @internal */\nfunction spread(start: number, end: number, count: number): number[] {\n if (count <= 1) {\n return [start];\n }\n const span = end - start;\n const step = span / (count - 1);\n const out = new Array<number>(count);\n for (let i = 0; i < count; i++) {\n out[i] = start + step * i;\n }\n return out;\n}\n\n/** @internal */\nfunction toMs(v: unknown): number {\n if (typeof v === 'number') {\n return v;\n }\n if (v instanceof Date) {\n return v.getTime();\n }\n return Number(v);\n}\n\n/**\n * Places the axis group on the plot edge and spans its line across the\n * plot extent.\n *\n * The group only translates along the axis's *perpendicular* direction:\n * a bottom axis moves in y and stays at `x = 0`, because the tick\n * offsets the scale hands back are already absolute viewBox\n * coordinates and would double-count an inset baked into the group's\n * own translate.\n *\n * @internal\n */\nfunction buildAxisGeometry(pos: CngxAxisPosition, plot: CngxChartPlotArea): AxisGeometry {\n switch (pos) {\n case 'top':\n return {\n transform: `translate(0,${plot.y0})`,\n line: { x1: plot.x0, y1: 0, x2: plot.x1, y2: 0 },\n };\n case 'bottom':\n return {\n transform: `translate(0,${plot.y1})`,\n line: { x1: plot.x0, y1: 0, x2: plot.x1, y2: 0 },\n };\n case 'left':\n return {\n transform: `translate(${plot.x0},0)`,\n line: { x1: 0, y1: plot.y0, x2: 0, y2: plot.y1 },\n };\n case 'right':\n return {\n transform: `translate(${plot.x1},0)`,\n line: { x1: 0, y1: plot.y0, x2: 0, y2: plot.y1 },\n };\n }\n}\n\n/** @internal */\nfunction buildTickRendering(\n pos: CngxAxisPosition,\n offset: number,\n text: string,\n key: string,\n plot: CngxChartPlotArea,\n): TickRendering {\n switch (pos) {\n case 'bottom':\n return {\n key,\n transform: `translate(${offset},0)`,\n tickLine: { x1: 0, y1: 0, x2: 0, y2: TICK_LENGTH },\n gridLine: { x2: 0, y2: -plot.height },\n label: {\n x: 0,\n y: TICK_LENGTH + LABEL_OFFSET,\n anchor: 'middle',\n baseline: 'hanging',\n text,\n },\n };\n case 'top':\n return {\n key,\n transform: `translate(${offset},0)`,\n tickLine: { x1: 0, y1: 0, x2: 0, y2: -TICK_LENGTH },\n gridLine: { x2: 0, y2: plot.height },\n label: {\n x: 0,\n y: -TICK_LENGTH - LABEL_OFFSET,\n anchor: 'middle',\n baseline: 'auto',\n text,\n },\n };\n case 'left':\n return {\n key,\n transform: `translate(0,${offset})`,\n tickLine: { x1: 0, y1: 0, x2: -TICK_LENGTH, y2: 0 },\n gridLine: { x2: plot.width, y2: 0 },\n label: {\n x: -TICK_LENGTH - LABEL_OFFSET,\n y: 0,\n anchor: 'end',\n baseline: 'middle',\n text,\n },\n };\n case 'right':\n return {\n key,\n transform: `translate(0,${offset})`,\n tickLine: { x1: 0, y1: 0, x2: TICK_LENGTH, y2: 0 },\n gridLine: { x2: -plot.width, y2: 0 },\n label: {\n x: TICK_LENGTH + LABEL_OFFSET,\n y: 0,\n anchor: 'start',\n baseline: 'middle',\n text,\n },\n };\n }\n}\n\n/**\n * Default tick label formatter. Strips floating-point arithmetic\n * noise from non-integer numbers - `6.6000000000000005` becomes\n * `'6.6'`, `2.2` stays `'2.2'`, `25` stays `'25'` - without rounding\n * away meaningful precision. Dates and other types fall through to\n * `String(v)`; consumers needing a richer format bind `[format]`.\n *\n * @internal\n */\nfunction defaultTickFormat(v: unknown): string {\n if (typeof v === 'number') {\n if (Number.isInteger(v)) {\n return String(v);\n }\n if (!Number.isFinite(v)) {\n return String(v);\n }\n // 12 significant digits is more than enough for any sensible\n // chart domain while collapsing the trailing 1e-15 noise\n // produced by accumulated float math.\n return Number(v.toPrecision(12)).toString();\n }\n return String(v);\n}\n\n/** @internal */\nfunction buildAxisLabelGeometry(pos: CngxAxisPosition, plot: CngxChartPlotArea): AxisLabelGeometry {\n // Local to the axis group, so the offsets stay as they were and only\n // the centring runs along the plot extent instead of the box.\n const midX = plot.x0 + plot.width / 2;\n const midY = plot.y0 + plot.height / 2;\n switch (pos) {\n case 'bottom':\n return {\n transform: `translate(${midX},${AXIS_LABEL_OFFSET_INLINE})`,\n anchor: 'middle',\n baseline: 'hanging',\n };\n case 'top':\n return {\n transform: `translate(${midX},${-AXIS_LABEL_OFFSET_INLINE})`,\n anchor: 'middle',\n baseline: 'auto',\n };\n case 'left':\n return {\n transform: `translate(${-AXIS_LABEL_OFFSET_BLOCK},${midY}) rotate(-90)`,\n anchor: 'middle',\n baseline: 'auto',\n };\n case 'right':\n return {\n transform: `translate(${AXIS_LABEL_OFFSET_BLOCK},${midY}) rotate(90)`,\n anchor: 'middle',\n baseline: 'auto',\n };\n }\n}\n","import { Directive, input, signal, type Signal } from '@angular/core';\nimport { CNGX_CHART_AXIS, type CngxChartAxis } from './chart-axis';\nimport { type CngxAxisPosition, type CngxAxisType } from './axis-position';\n\n/**\n * @internal Both reservations of every domain publisher are the same\n * constant, so one frozen node serves all of them rather than two per\n * directive instance.\n */\nconst NO_RESERVATION: Signal<number> = signal(0).asReadonly();\n\n/**\n * Declares a scale domain to the parent `<cngx-chart>` without drawing\n * anything.\n *\n * A chart builds its `xScale` from whichever projected axis occupies a\n * horizontal edge and its `yScale` from a vertical one. Usually that\n * axis also draws ticks and labels, and `[cngxAxis]` is what you want.\n * Sometimes the domain is all you need: a sparkline has no room for\n * decoration, but its line still has to know that y runs 0 to 100.\n *\n * ```html\n * <cngx-chart [data]=\"readings()\">\n * <svg:g cngxAxisDomain position=\"bottom\" type=\"band\" [domain]=\"labels()\"></svg:g>\n * <svg:g cngxAxisDomain position=\"left\" [domain]=\"[0, 100]\"></svg:g>\n * <svg:g cngxLine></svg:g>\n * </cngx-chart>\n * ```\n *\n * Reserving nothing is the behavioural difference that matters. The\n * chart shrinks its plot area by the room each axis's decoration needs;\n * this one has none, so an 80x24 sparkline keeps all 80x24 for its mark\n * instead of losing a gutter to ticks nobody draws.\n *\n * Attribute-selector on `<svg:g>` for the same reason `[cngxAxis]` is:\n * a `<cngx-axis-domain>` element inside `<svg>` would land in the XHTML\n * namespace. Nothing renders either way, but the host stays a legal SVG\n * child.\n *\n * @category common/chart/axis\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/axis/axis-domain.ts\n * @since 0.1.0\n * @relatedTo CngxAxis, CngxChart, CngxChartAxis\n *\n * <example-url>http://localhost:4200/#/ui/chart-panel/basic/titled-panel-with-legend</example-url>\n * <example-url>http://localhost:4200/#/ui/chart-panel/slots/actions-and-footer</example-url>\n */\n@Directive({\n selector: '[cngxAxisDomain]',\n exportAs: 'cngxAxisDomain',\n standalone: true,\n providers: [{ provide: CNGX_CHART_AXIS, useExisting: CngxAxisDomain }],\n})\nexport class CngxAxisDomain implements CngxChartAxis {\n /** Which edge the scale this publishes belongs to. */\n readonly position = input.required<CngxAxisPosition>();\n /** Scale kind the chart builds for this dimension. */\n readonly type = input<CngxAxisType>('linear');\n /** Value range the scale maps from. */\n readonly domain = input<readonly unknown[] | undefined>(undefined);\n\n /**\n * Always `0`. Not an opt-out from a gutter this directive would\n * otherwise get - it draws nothing, so there is nothing to reserve\n * for, and the number stays derived from what the unit does.\n */\n readonly reservation = NO_RESERVATION;\n\n /** Always `0`, for the same reason as {@link reservation}. */\n readonly crossReservation = NO_RESERVATION;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\n\n/**\n * Single legend entry. `color` is optional - when omitted the swatch\n * falls back to the chart-level primary token. `value` is rendered as a\n * trailing `.cngx-chart-legend__value` node when present (`!= null`, so a\n * literal `0` still shows), turning a legend into a readout. It stays\n * intentionally unconstrained so the same field a consumer weights in the\n * row can still carry their domain key (id, layer name, accessor return\n * type, ...) for later interactions without a second lookup.\n *\n * @category common/chart/legend\n */\nexport interface CngxChartLegendItem<T = unknown> {\n readonly label: string;\n readonly color?: string | null;\n readonly value?: T;\n}\n\n/**\n * Presentational legend atom - a row (or column) of coloured swatches\n * paired with labels. Decoupled from `<cngx-chart>` and the layer\n * atoms by design: the consumer drives the items array, so the\n * legend stays a pure rendering surface with zero opinions about\n * series-discovery, visibility-toggling, or interaction.\n *\n * Compose alongside a chart wherever a multi-layer composition needs\n * a label key:\n *\n * ```html\n * <cngx-chart [data]=\"series\">\n * <svg:g cngxLine [data]=\"traffic\" style=\"--cngx-line-color: #3b82f6\"></svg:g>\n * <svg:g cngxLine [data]=\"errors\" style=\"--cngx-line-color: #d2452f\"></svg:g>\n * </cngx-chart>\n * <cngx-chart-legend\n * [items]=\"[\n * { label: 'Traffic', color: '#3b82f6' },\n * { label: 'Errors', color: '#d2452f' }\n * ]\"\n * />\n * ```\n *\n * Theming via `--cngx-chart-legend-gap`,\n * `--cngx-chart-legend-swatch-size`, `--cngx-chart-legend-swatch-radius`,\n * `--cngx-chart-legend-font-size`. A rendered `value` carries its own\n * `--cngx-chart-legend-value-color` and `--cngx-chart-legend-value-font-weight`\n * so a legend doubling as a readout can weight the number apart from the\n * label without a wrapper element. `[orientation]` flips between row\n * and column; `[align]` aligns along the main axis (`start`, `center`,\n * `end`).\n *\n * @category common/chart/legend\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/legend/legend.component.ts\n * @since 0.1.0\n * @relatedTo CngxChart, CngxLine, CngxBar\n */\n@Component({\n selector: 'cngx-chart-legend',\n exportAs: 'cngxChartLegend',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'list',\n class: 'cngx-chart-legend',\n '[class.cngx-chart-legend--vertical]': 'orientation() === \"vertical\"',\n '[style.justify-content]': 'flexAlign()',\n },\n template: `\n @for (item of items(); track $index) {\n <span class=\"cngx-chart-legend__item\" role=\"listitem\">\n <span\n class=\"cngx-chart-legend__swatch\"\n [style.background]=\"item.color ?? null\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"cngx-chart-legend__label\">{{ item.label }}</span>\n @if (item.value != null) {\n <span class=\"cngx-chart-legend__value\">{{ item.value }}</span>\n }\n </span>\n }\n `,\n styles: [\n `\n cngx-chart-legend {\n display: flex;\n flex-wrap: wrap;\n gap: var(--cngx-chart-legend-gap, 12px);\n font-size: var(--cngx-chart-legend-font-size, 0.8125rem);\n color: var(--cngx-chart-legend-color, var(--cngx-chart-text-color, currentColor));\n align-items: center;\n }\n cngx-chart-legend.cngx-chart-legend--vertical {\n flex-direction: column;\n align-items: flex-start;\n }\n cngx-chart-legend .cngx-chart-legend__item {\n display: inline-flex;\n align-items: center;\n gap: var(--cngx-chart-legend-item-gap, 6px);\n }\n cngx-chart-legend .cngx-chart-legend__swatch {\n display: inline-block;\n width: var(--cngx-chart-legend-swatch-size, 12px);\n height: var(--cngx-chart-legend-swatch-size, 12px);\n background: var(--cngx-chart-primary, currentColor);\n border-radius: var(--cngx-chart-legend-swatch-radius, 2px);\n }\n cngx-chart-legend .cngx-chart-legend__value {\n color: var(--cngx-chart-legend-value-color, inherit);\n font-weight: var(--cngx-chart-legend-value-font-weight, 600);\n unicode-bidi: var(--cngx-chart-numeric-bidi, isolate);\n }\n `,\n ],\n})\nexport class CngxChartLegend<T = unknown> {\n readonly items = input.required<readonly CngxChartLegendItem<T>[]>();\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n readonly align = input<'start' | 'center' | 'end'>('start');\n\n protected readonly flexAlign = computed(() => {\n switch (this.align()) {\n case 'center':\n return 'center';\n case 'end':\n return 'flex-end';\n default:\n return 'flex-start';\n }\n });\n}\n","import type { ScaleFn, XScaleInput } from '../chart/chart-context';\nimport type { LineXAccessor, LineYAccessor } from '../path/path-builder';\nimport type { LayerGeometry } from './chart-layer';\n\n/**\n * Scale-projected centre of a single point marker on a line / area\n * layer.\n *\n * @internal\n */\nexport interface PointMark {\n readonly cx: number;\n readonly cy: number;\n}\n\n/**\n * Shared stable empty-marks reference, so the \"no markers\" case does\n * not allocate a fresh array that would defeat the geometry `equal`.\n *\n * @internal\n */\nexport const EMPTY_POINTS: readonly PointMark[] = [];\n\n/**\n * Project the datapoints a line / area layer chooses to mark into\n * pixel-space centres. Markers draw when `mode` is `'always'`, or\n * `'auto'` with a single datum - the frame a warming series passes\n * through that would otherwise paint an invisible zero-length path.\n * Pure: the caller reads the signals inside its `computed`; this only\n * maps the resolved values, so line and area share one derivation.\n *\n * @internal\n */\nexport function derivePointMarks<T>(\n mode: 'auto' | 'always' | 'never',\n data: readonly T[],\n xScale: ScaleFn<XScaleInput>,\n yScale: ScaleFn<number>,\n yAcc: LineYAccessor<T>,\n xAcc: LineXAccessor<T>,\n): readonly PointMark[] {\n const draw = mode === 'always' || (mode === 'auto' && data.length === 1);\n if (!draw || data.length === 0) {\n return EMPTY_POINTS;\n }\n const out = new Array<PointMark>(data.length);\n for (let i = 0; i < data.length; i++) {\n out[i] = { cx: xScale(xAcc(data[i], i)), cy: yScale(yAcc(data[i], i)) };\n }\n return out;\n}\n\n/**\n * Structural equality for the shared `'line' | 'area'` geometry\n * variant: `d` string, scalar stroke / fill / opacity fields, and a\n * length-plus-elementwise comparison of the `points` marker pass. Line\n * and area share it - area's null stroke / fill / color fields compare\n * equal, so one comparator covers both without a per-atom near-copy.\n * Extending (not dropping) the comparator keeps the array field under a\n * working `equal`; an array computed without one cascades on every\n * rebuild.\n *\n * @internal\n */\nexport function lineAreaGeomEqual(a: LayerGeometry, b: LayerGeometry): boolean {\n if (a === b) {\n return true;\n }\n if ((a.kind !== 'line' && a.kind !== 'area') || (b.kind !== 'line' && b.kind !== 'area')) {\n return false;\n }\n if (a.kind !== b.kind) {\n return false;\n }\n return (\n a.d === b.d &&\n a.color === b.color &&\n a.strokeWidth === b.strokeWidth &&\n a.fill === b.fill &&\n a.opacity === b.opacity &&\n pointsEqual(a.points, b.points)\n );\n}\n\n/**\n * Length-plus-elementwise equality for the optional `points` marker\n * pass. Absent and empty are equivalent.\n *\n * @internal\n */\nexport function pointsEqual(\n a: readonly PointMark[] | undefined,\n b: readonly PointMark[] | undefined,\n): boolean {\n const ap = a ?? EMPTY_POINTS;\n const bp = b ?? EMPTY_POINTS;\n if (ap === bp) {\n return true;\n }\n if (ap.length !== bp.length) {\n return false;\n }\n for (let i = 0; i < ap.length; i++) {\n if (ap[i].cx !== bp[i].cx || ap[i].cy !== bp[i].cy) {\n return false;\n }\n }\n return true;\n}\n","/**\n * Curve interpolators for line / area path builders. Each function\n * returns the **interior** path commands that connect a series of\n * points; the caller is responsible for the leading `M` and any\n * trailing close commands.\n *\n * Pure TS, no DOM dependency, no Angular dep.\n *\n * @category common/chart/path\n */\nexport type CngxCurve = 'linear' | 'monotone';\n\n/**\n * Pixel-space point fed into {@link buildCurvePath}.\n *\n * @category common/chart/path\n */\nexport interface PathPoint {\n readonly x: number;\n readonly y: number;\n}\n\n/**\n * Build the SVG `d` attribute for a sequence of points.\n *\n * @param points Pixel-coordinate points to connect.\n * @param curve Interpolation strategy. `'linear'` joins points with\n * straight `L` commands; `'monotone'` uses cubic Béziers with the\n * monotone-X tangent rule (Fritsch-Carlson) so the curve never\n * overshoots between data points.\n * @returns The full path data starting with `M`. Returns `''` when\n * the input is empty; `M x y` when the input has one point.\n *\n * @category common/chart/path\n */\nexport function buildCurvePath(points: readonly PathPoint[], curve: CngxCurve): string {\n if (points.length === 0) {\n return '';\n }\n if (points.length === 1) {\n const p = points[0];\n return `M ${p.x} ${p.y}`;\n }\n if (curve === 'linear') {\n return buildLinearPath(points);\n }\n return buildMonotonePath(points);\n}\n\n/** @internal */\nfunction buildLinearPath(points: readonly PathPoint[]): string {\n const start = points[0];\n let out = `M ${start.x} ${start.y}`;\n for (let i = 1; i < points.length; i++) {\n out += ` L ${points[i].x} ${points[i].y}`;\n }\n return out;\n}\n\n/**\n * Monotone cubic Bézier interpolation (Fritsch-Carlson tangents on the\n * X dimension). Input points must have strictly increasing `x`\n * coordinates.\n *\n * @internal\n */\nfunction buildMonotonePath(points: readonly PathPoint[]): string {\n const n = points.length;\n const slopes = new Array<number>(n - 1);\n for (let i = 0; i < n - 1; i++) {\n const dx = points[i + 1].x - points[i].x;\n slopes[i] = dx === 0 ? 0 : (points[i + 1].y - points[i].y) / dx;\n }\n const tangents = new Array<number>(n);\n tangents[0] = slopes[0];\n tangents[n - 1] = slopes[n - 2];\n for (let i = 1; i < n - 1; i++) {\n const m1 = slopes[i - 1];\n const m2 = slopes[i];\n if (m1 * m2 <= 0) {\n tangents[i] = 0;\n } else {\n tangents[i] = (2 * m1 * m2) / (m1 + m2);\n }\n }\n let out = `M ${points[0].x} ${points[0].y}`;\n for (let i = 0; i < n - 1; i++) {\n const p0 = points[i];\n const p1 = points[i + 1];\n const dx = p1.x - p0.x;\n const c1x = p0.x + dx / 3;\n const c1y = p0.y + (tangents[i] * dx) / 3;\n const c2x = p1.x - dx / 3;\n const c2y = p1.y - (tangents[i + 1] * dx) / 3;\n out += ` C ${c1x} ${c1y}, ${c2x} ${c2y}, ${p1.x} ${p1.y}`;\n }\n return out;\n}\n","import { buildCurvePath, type CngxCurve, type PathPoint } from './curve';\nimport type { ScaleFn, XScaleInput } from '../chart/chart-context';\n\n/**\n * Reads the Y value of a data row at index `i`.\n *\n * @category common/chart/path\n */\nexport type LineYAccessor<T> = (d: T, i: number) => number;\n/**\n * Reads the X value of a data row at index `i`. Default behaviour\n * (when omitted on a builder) is the row's positional index.\n *\n * @category common/chart/path\n */\nexport type LineXAccessor<T> = (d: T, i: number) => XScaleInput;\n\n/**\n * Construction options for {@link createPathBuilder}.\n *\n * @category common/chart/path\n */\nexport interface PathBuilderOptions<T> {\n readonly y: LineYAccessor<T>;\n readonly x?: LineXAccessor<T>;\n readonly curve: CngxCurve;\n}\n\n/**\n * Single-slot LRU cache around an SVG `d`-attribute builder. Returned\n * by {@link createPathBuilder}; consumed by the `<cngx-line>` /\n * `<cngx-area>` family.\n *\n * @category common/chart/path\n */\nexport interface PathBuilder<T> {\n /**\n * Build the SVG `d` attribute for the given data + scales. Same\n * `(data, xScale, yScale)` triple by reference returns the cached\n * string without re-running the O(n) point projection.\n */\n build(data: readonly T[], xScale: ScaleFn<XScaleInput>, yScale: ScaleFn<number>): string;\n\n /**\n * Number of times the internal point-projection + path-string\n * concatenation has run since this builder was constructed. Exposed\n * for the compute-guard isolated spec; not part of the public chart\n * API.\n */\n rebuildCount(): number;\n}\n\n/**\n * Pure-TS path builder with single-slot LRU memo on\n * `(data, xScale, yScale)` reference identity. Pure TS, no Angular\n * dep. Compute guard only - does not know about signals or `equal`\n * functions; the `d` computed in `<cngx-line>` carries the cascade\n * guard separately.\n *\n * The cache returns the previous result when all three inputs are\n * reference-equal to the previous call. Any reference mismatch\n * triggers a rebuild and updates the slot.\n *\n * Each call to `createPathBuilder` returns a fresh builder with its\n * own `lastData / lastX / lastY` slots - there is no cross-call /\n * cross-consumer state. The cascade guard for layer atoms is the\n * `equal: (a, b) => a === b` on the `builder` `computed`; combined\n * with Angular signals' default behaviour of skipping re-emissions\n * when the inputs to the `computed` are unchanged, two consecutive\n * cascade ticks with the same `(y, x, curve)` produce the same\n * builder instance.\n *\n * @category common/chart/path\n */\nexport function createPathBuilder<T>(opts: PathBuilderOptions<T>): PathBuilder<T> {\n const yAcc = opts.y;\n const xAcc: LineXAccessor<T> = opts.x ?? ((_, i) => i);\n const curve = opts.curve;\n\n let lastData: readonly T[] | null = null;\n let lastX: ScaleFn<XScaleInput> | null = null;\n let lastY: ScaleFn<number> | null = null;\n let lastResult = '';\n let rebuilds = 0;\n\n return {\n build(data, xScale, yScale) {\n if (data === lastData && xScale === lastX && yScale === lastY) {\n return lastResult;\n }\n const points = projectPoints(data, xAcc, yAcc, xScale, yScale);\n const d = buildCurvePath(points, curve);\n lastData = data;\n lastX = xScale;\n lastY = yScale;\n lastResult = d;\n rebuilds++;\n return d;\n },\n rebuildCount() {\n return rebuilds;\n },\n };\n}\n\n/** @internal */\nfunction projectPoints<T>(\n data: readonly T[],\n xAcc: LineXAccessor<T>,\n yAcc: (d: T, i: number) => number,\n xScale: ScaleFn<XScaleInput>,\n yScale: ScaleFn<number>,\n): PathPoint[] {\n const out = new Array<PathPoint>(data.length);\n for (let i = 0; i < data.length; i++) {\n out[i] = { x: xScale(xAcc(data[i], i)), y: yScale(yAcc(data[i], i)) };\n }\n return out;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectChartContext } from '../chart/chart-context';\nimport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './chart-layer';\nimport { derivePointMarks, EMPTY_POINTS, lineAreaGeomEqual, type PointMark } from './point-geom';\nimport { type CngxCurve } from '../path/curve';\nimport {\n createPathBuilder,\n type LineXAccessor,\n type LineYAccessor,\n type PathBuilder,\n} from '../path/path-builder';\n\n/**\n * Line layer atom. Renders a single SVG `<path>` connecting the data\n * points projected through the parent chart's scales. Reads scales\n * from {@link CNGX_CHART_CONTEXT}, NOT from a parent class.\n *\n * Attribute-selector on `<svg:g>` - the host element IS the SVG group.\n * Element selectors create XHTML-namespaced custom elements inside\n * SVG, which break layout for the namespaced children. Apply this\n * directive on an `<svg:g>` host instead.\n *\n * The `d` string is cascade-guarded with string equality on its\n * `computed` so downstream effects only re-run when the path\n * geometry actually changes. The `createPathBuilder` cache provides\n * the **compute guard** - same `(data, xScale, yScale)` triple by\n * reference skips the per-datapoint projection work.\n *\n * A single-point series draws no visible path (`M x y` has no length),\n * so a series shorter than two points paints a point marker instead of\n * nothing. `[points]` controls this: `'auto'` (default) marks only the\n * one-datum case, `'always'` marks every datum, `'never'` suppresses it.\n *\n * @category common/chart/layers\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/line.component.ts\n * @since 0.1.0\n * @relatedTo CngxArea, CngxScatter, CngxBar, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxLine]',\n exportAs: 'cngxLine',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_LAYER, useExisting: CngxLine }],\n template: `\n @if (ctx.renderSvg()) {\n <svg:path\n class=\"cngx-line\"\n [attr.d]=\"d()\"\n [attr.fill]=\"'none'\"\n [attr.stroke]=\"color()\"\n [attr.stroke-width]=\"strokeWidth()\"\n [attr.stroke-linejoin]=\"'round'\"\n [attr.stroke-linecap]=\"'round'\"\n />\n @for (p of pointMarks(); track $index) {\n <svg:circle class=\"cngx-line__point\" [attr.cx]=\"p.cx\" [attr.cy]=\"p.cy\" />\n }\n }\n `,\n styles: [\n `\n .cngx-line {\n stroke: var(--cngx-line-color, var(--cngx-chart-primary, currentColor));\n stroke-width: var(--cngx-line-stroke-width, 1.5px);\n animation: cngx-line-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n @keyframes cngx-line-enter {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n .cngx-line__point {\n r: var(--cngx-line-point-radius, 3px);\n fill: var(--cngx-line-color, var(--cngx-chart-primary, currentColor));\n animation: cngx-line-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n @media (prefers-reduced-motion: reduce) {\n .cngx-line,\n .cngx-line__point {\n animation: none;\n }\n }\n `,\n ],\n})\nexport class CngxLine<T = unknown> implements CngxChartLayer {\n readonly accessor = input<LineYAccessor<T>>((d: T) => Number(d));\n readonly xAccessor = input<LineXAccessor<T> | undefined>(undefined);\n readonly color = input<string | null>(null);\n readonly strokeWidth = input<number | string | null>(null);\n readonly curve = input<CngxCurve>('linear');\n readonly data = input<readonly T[] | undefined>(undefined);\n\n /**\n * Point-marker mode. `'auto'` (default) draws a marker only when the\n * resolved series has exactly one datum - the frame a warming buffer\n * passes through on every reload, which paints nothing otherwise.\n * `'always'` marks every datum; `'never'` suppresses markers.\n */\n readonly points = input<'auto' | 'always' | 'never'>('auto');\n\n protected readonly ctx = injectChartContext('CngxLine');\n\n private readonly builder = computed<PathBuilder<T>>(() =>\n createPathBuilder<T>({\n y: this.accessor(),\n x: this.xAccessor(),\n curve: this.curve(),\n }),\n );\n\n private readonly resolvedData = computed<readonly T[]>(() => {\n const local = this.data();\n if (local !== undefined) {\n return local;\n }\n return this.ctx.data<T>();\n });\n\n protected readonly d = computed<string>(\n () => this.builder().build(this.resolvedData(), this.ctx.xScale(), this.ctx.yScale()),\n { equal: (a, b) => a === b },\n );\n\n readonly geometry = computed<LayerGeometry>(\n () => ({\n kind: 'line',\n d: this.d(),\n color: this.color(),\n strokeWidth: this.strokeWidth(),\n fill: 'none',\n points: derivePointMarks(\n this.points(),\n this.resolvedData(),\n this.ctx.xScale(),\n this.ctx.yScale(),\n this.accessor(),\n this.xAccessor() ?? ((_: T, i: number) => i),\n ),\n }),\n { equal: lineAreaGeomEqual },\n );\n\n /**\n * Template view of the geometry's marker pass. Forwards the array\n * reference the `geometry` computed already holds - `lineAreaGeomEqual`\n * keeps that reference stable across a no-op refresh, so this\n * projection stays stable too without a second equality guard.\n */\n protected readonly pointMarks = computed<readonly PointMark[]>(() => {\n const g = this.geometry();\n return g.kind === 'line' ? (g.points ?? EMPTY_POINTS) : EMPTY_POINTS;\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectChartContext } from '../chart/chart-context';\nimport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './chart-layer';\nimport { derivePointMarks, EMPTY_POINTS, lineAreaGeomEqual, type PointMark } from './point-geom';\nimport { type CngxCurve } from '../path/curve';\nimport {\n createPathBuilder,\n type LineXAccessor,\n type LineYAccessor,\n type PathBuilder,\n} from '../path/path-builder';\n\n/**\n * Area layer atom. Reuses {@link createPathBuilder} for the upper edge\n * (same compute guard as `[cngxLine]`) and closes the polygon to a\n * `[baseline]` (default `0`) so SVG can fill it.\n *\n * Attribute-selector on `<svg:g>` - see {@link CngxLine} for why.\n *\n * The `d` string is cascade-guarded with string equality on its\n * `computed` so a no-op data refresh does not force a fill repaint.\n *\n * A single-datum area closes on itself at one x and covers no pixels,\n * so a series shorter than two points paints a point marker instead of\n * nothing. `[points]` mirrors {@link CngxLine}: `'auto'` (default) marks\n * only the one-datum case, `'always'` every datum, `'never'` none.\n *\n * @category common/chart/layers\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/area.component.ts\n * @since 0.1.0\n * @relatedTo CngxLine, CngxBand, CngxThreshold, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxArea]',\n exportAs: 'cngxArea',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_LAYER, useExisting: CngxArea }],\n template: `\n @if (ctx.renderSvg()) {\n <svg:path class=\"cngx-area\" [attr.d]=\"d()\" [attr.fill-opacity]=\"opacity()\" />\n @for (p of pointMarks(); track $index) {\n <svg:circle class=\"cngx-area__point\" [attr.cx]=\"p.cx\" [attr.cy]=\"p.cy\" />\n }\n }\n `,\n styles: [\n `\n .cngx-area {\n fill: var(--cngx-area-fill, var(--cngx-chart-primary, currentColor));\n fill-opacity: var(--cngx-area-opacity, 0.18);\n stroke: none;\n animation: cngx-area-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n @keyframes cngx-area-enter {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n .cngx-area__point {\n r: var(--cngx-area-point-radius, 3px);\n fill: var(--cngx-area-fill, var(--cngx-chart-primary, currentColor));\n animation: cngx-area-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n @media (prefers-reduced-motion: reduce) {\n .cngx-area,\n .cngx-area__point {\n animation: none;\n }\n }\n `,\n ],\n})\nexport class CngxArea<T = unknown> implements CngxChartLayer {\n readonly accessor = input<LineYAccessor<T>>((d: T) => Number(d));\n readonly xAccessor = input<LineXAccessor<T> | undefined>(undefined);\n readonly opacity = input<number | string | null>(null);\n readonly curve = input<CngxCurve>('linear');\n readonly baseline = input<number>(0);\n readonly data = input<readonly T[] | undefined>(undefined);\n\n /**\n * Point-marker mode, mirroring {@link CngxLine}. `'auto'` (default)\n * draws a marker only for a single-datum series - an area closed on\n * itself at one x covers no pixels and paints nothing otherwise.\n * `'always'` marks every datum; `'never'` suppresses markers.\n */\n readonly points = input<'auto' | 'always' | 'never'>('auto');\n\n protected readonly ctx = injectChartContext('CngxArea');\n\n private readonly builder = computed<PathBuilder<T>>(() =>\n createPathBuilder<T>({\n y: this.accessor(),\n x: this.xAccessor(),\n curve: this.curve(),\n }),\n );\n\n private readonly resolvedData = computed<readonly T[]>(() => {\n const local = this.data();\n if (local !== undefined) {\n return local;\n }\n return this.ctx.data<T>();\n });\n\n protected readonly d = computed<string>(\n () => {\n const data = this.resolvedData();\n if (data.length === 0) {\n return '';\n }\n const xScale = this.ctx.xScale();\n const yScale = this.ctx.yScale();\n const upper = this.builder().build(data, xScale, yScale);\n const baselineY = yScale(this.baseline());\n const xAcc = this.xAccessor() ?? ((_: T, i: number) => i);\n const lastX = xScale(xAcc(data[data.length - 1], data.length - 1));\n const firstX = xScale(xAcc(data[0], 0));\n return `${upper} L ${lastX} ${baselineY} L ${firstX} ${baselineY} Z`;\n },\n { equal: (a, b) => a === b },\n );\n\n readonly geometry = computed<LayerGeometry>(\n () => {\n const op = this.opacity();\n return {\n kind: 'area',\n d: this.d(),\n color: null,\n strokeWidth: null,\n fill: null,\n opacity: op == null ? null : Number(op),\n points: derivePointMarks(\n this.points(),\n this.resolvedData(),\n this.ctx.xScale(),\n this.ctx.yScale(),\n this.accessor(),\n this.xAccessor() ?? ((_: T, i: number) => i),\n ),\n };\n },\n { equal: lineAreaGeomEqual },\n );\n\n /**\n * Template view of the geometry's marker pass. Forwards the reference\n * the `geometry` computed already holds - `lineAreaGeomEqual` keeps it\n * stable across a no-op refresh, so no second equality guard is needed.\n */\n protected readonly pointMarks = computed<readonly PointMark[]>(() => {\n const g = this.geometry();\n return g.kind === 'area' ? (g.points ?? EMPTY_POINTS) : EMPTY_POINTS;\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectChartContext } from '../chart/chart-context';\nimport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './chart-layer';\n\n/**\n * Reads the bar height (data-space Y) of a data row at index `i`.\n *\n * @category common/chart/layers\n */\nexport type BarYAccessor<T> = (d: T, i: number) => number;\n\n/** @internal */\ninterface BarRect {\n readonly key: number;\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n}\n\n/** @internal */\nconst FALLBACK_BASELINE = 0;\n\n/**\n * Bar layer atom. Renders one `<rect>` per datapoint. Bar width comes\n * from `dimensions.width / dataLength` (one slot per datapoint) shrunk\n * by the optional `[gap]` ratio. Bar height runs from `yScale(value)`\n * down to `yScale(baseline)` (default 0) - SVG bottom-anchored.\n *\n * Bar does NOT require a band X scale; the slot width is purely\n * geometric. This keeps the atom usable with linear or band X axes\n * interchangeably.\n *\n * Attribute-selector on `<svg:g>` - see {@link CngxLine} for why.\n *\n * @category common/chart/layers\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/bar.component.ts\n * @since 0.1.0\n * @relatedTo CngxLine, CngxArea, CngxStackedBar, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxBar]',\n exportAs: 'cngxBar',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_LAYER, useExisting: CngxBar }],\n template: `\n @if (ctx.renderSvg()) {\n @for (rect of rects(); track rect.key) {\n <svg:rect\n class=\"cngx-bar\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n />\n }\n }\n `,\n styles: [\n `\n .cngx-bar {\n fill: var(--cngx-bar-color, var(--cngx-chart-primary, currentColor));\n transform-origin: 50% 100%;\n transform-box: fill-box;\n animation: cngx-bar-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.34, 1.2, 0.64, 1));\n }\n @keyframes cngx-bar-enter {\n from {\n transform: scaleY(0);\n opacity: 0;\n }\n to {\n transform: scaleY(1);\n opacity: 1;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .cngx-bar {\n animation: none;\n }\n }\n `,\n ],\n})\nexport class CngxBar<T = unknown> implements CngxChartLayer {\n readonly accessor = input<BarYAccessor<T>>(((d: T) => Number(d)) as BarYAccessor<T>);\n readonly gap = input<number>(0.1);\n readonly baseline = input<number>(FALLBACK_BASELINE);\n readonly data = input<readonly T[] | undefined>(undefined);\n\n protected readonly ctx = injectChartContext('CngxBar');\n\n private readonly resolvedData = computed<readonly T[]>(() => {\n const local = this.data();\n if (local !== undefined) {\n return local;\n }\n return this.ctx.data<T>();\n });\n\n protected readonly rects = computed<readonly BarRect[]>(\n () => {\n const data = this.resolvedData();\n const n = data.length;\n if (n === 0) {\n return [];\n }\n // Slots divide the plot, not the box. The y values come from\n // ctx.yScale(), which already ranges over the plot, so measuring\n // x against the box would put the bars and their own baseline in\n // two different coordinate systems - and off the ticks that label\n // them.\n const { x0, width, height } = this.ctx.plot();\n if (width <= 0 || height <= 0) {\n return [];\n }\n const yScale = this.ctx.yScale();\n const slot = width / n;\n const gap = clamp01(this.gap());\n const inner = slot * (1 - gap);\n const offset = (slot - inner) / 2;\n const baselineY = yScale(this.baseline());\n const yAcc = this.accessor();\n const out = new Array<BarRect>(n);\n for (let i = 0; i < n; i++) {\n const value = yAcc(data[i], i);\n const valueY = yScale(value);\n const top = Math.min(valueY, baselineY);\n const bottom = Math.max(valueY, baselineY);\n out[i] = {\n key: i,\n x: x0 + i * slot + offset,\n y: top,\n width: inner,\n height: bottom - top,\n };\n }\n return out;\n },\n { equal: rectsEqual },\n );\n\n readonly geometry = computed<LayerGeometry>(\n () => ({\n kind: 'bar',\n rects: this.rects().map((r) => ({ x: r.x, y: r.y, w: r.width, h: r.height, color: null })),\n }),\n { equal: barGeomEqual },\n );\n}\n\n/** @internal */\nfunction barGeomEqual(a: LayerGeometry, b: LayerGeometry): boolean {\n if (a === b) {\n return true;\n }\n if (a.kind !== 'bar' || b.kind !== 'bar') {\n return false;\n }\n if (a.rects.length !== b.rects.length) {\n return false;\n }\n for (let i = 0; i < a.rects.length; i++) {\n const x = a.rects[i];\n const y = b.rects[i];\n if (x.x !== y.x || x.y !== y.y || x.w !== y.w || x.h !== y.h || x.color !== y.color) {\n return false;\n }\n }\n return true;\n}\n\n/** @internal */\nfunction clamp01(v: number): number {\n if (v < 0) {\n return 0;\n }\n if (v > 1) {\n return 1;\n }\n return v;\n}\n\n/** @internal */\nfunction rectsEqual(a: readonly BarRect[], b: readonly BarRect[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const x = a[i];\n const y = b[i];\n if (x.x !== y.x || x.y !== y.y || x.width !== y.width || x.height !== y.height) {\n return false;\n }\n }\n return true;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectChartContext, type XScaleInput } from '../chart/chart-context';\nimport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './chart-layer';\n\n/**\n * Reads the data-space X value of a scatter row at index `i`.\n *\n * @category common/chart/layers\n */\nexport type ScatterXAccessor<T> = (d: T, i: number) => XScaleInput;\n/**\n * Reads the data-space Y value of a scatter row at index `i`.\n *\n * @category common/chart/layers\n */\nexport type ScatterYAccessor<T> = (d: T, i: number) => number;\n\n/** @internal */\ninterface ScatterCircle {\n readonly key: number;\n readonly cx: number;\n readonly cy: number;\n}\n\n/**\n * Scatter layer atom. Renders one `<circle>` per datapoint. X and Y\n * accessors are independent - neither defaults to index, since the\n * defining trait of a scatter chart is two genuine data dimensions.\n *\n * Attribute-selector on `<svg:g>` - see {@link CngxLine} for why.\n *\n * @category common/chart/layers\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/scatter.component.ts\n * @since 0.1.0\n * @relatedTo CngxLine, CngxBar, CngxArea, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxScatter]',\n exportAs: 'cngxScatter',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_LAYER, useExisting: CngxScatter }],\n template: `\n @if (ctx.renderSvg()) {\n @for (c of circles(); track c.key) {\n <svg:circle class=\"cngx-scatter\" [attr.cx]=\"c.cx\" [attr.cy]=\"c.cy\" [attr.r]=\"radius()\" />\n }\n }\n `,\n styles: [\n `\n .cngx-scatter {\n fill: var(--cngx-scatter-color, var(--cngx-chart-primary, currentColor));\n transform-origin: 50% 50%;\n transform-box: fill-box;\n animation: cngx-scatter-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.34, 1.56, 0.64, 1)) backwards;\n }\n @keyframes cngx-scatter-enter {\n from {\n transform: scale(0);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .cngx-scatter {\n animation: none;\n }\n }\n `,\n ],\n})\nexport class CngxScatter<T = unknown> implements CngxChartLayer {\n readonly x = input.required<ScatterXAccessor<T>>();\n readonly y = input.required<ScatterYAccessor<T>>();\n readonly radius = input<number>(3);\n readonly data = input<readonly T[] | undefined>(undefined);\n\n protected readonly ctx = injectChartContext('CngxScatter');\n\n private readonly resolvedData = computed<readonly T[]>(() => {\n const local = this.data();\n if (local !== undefined) {\n return local;\n }\n return this.ctx.data<T>();\n });\n\n protected readonly circles = computed<readonly ScatterCircle[]>(\n () => {\n const data = this.resolvedData();\n const xScale = this.ctx.xScale();\n const yScale = this.ctx.yScale();\n const xAcc = this.x();\n const yAcc = this.y();\n const out = new Array<ScatterCircle>(data.length);\n for (let i = 0; i < data.length; i++) {\n out[i] = {\n key: i,\n cx: xScale(xAcc(data[i], i)),\n cy: yScale(yAcc(data[i], i)),\n };\n }\n return out;\n },\n { equal: circlesEqual },\n );\n\n readonly geometry = computed<LayerGeometry>(\n () => {\n const r = this.radius();\n return {\n kind: 'scatter',\n marks: this.circles().map((c) => ({ cx: c.cx, cy: c.cy, r, color: null })),\n };\n },\n { equal: scatterGeomEqual },\n );\n}\n\n/** @internal */\nfunction scatterGeomEqual(a: LayerGeometry, b: LayerGeometry): boolean {\n if (a === b) {\n return true;\n }\n if (a.kind !== 'scatter' || b.kind !== 'scatter') {\n return false;\n }\n if (a.marks.length !== b.marks.length) {\n return false;\n }\n for (let i = 0; i < a.marks.length; i++) {\n const x = a.marks[i];\n const y = b.marks[i];\n if (x.cx !== y.cx || x.cy !== y.cy || x.r !== y.r || x.color !== y.color) {\n return false;\n }\n }\n return true;\n}\n\n/** @internal */\nfunction circlesEqual(a: readonly ScatterCircle[], b: readonly ScatterCircle[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i].cx !== b[i].cx || a[i].cy !== b[i].cy) {\n return false;\n }\n }\n return true;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectChartContext } from '../chart/chart-context';\nimport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './chart-layer';\n\n/**\n * Band reference atom. Renders a `<rect>` across a vertical Y-range\n * (`from..to`) spanning the chart's full width. Use to highlight a\n * value range (e.g. \"good zone\", \"watch zone\") behind primary layers.\n *\n * Default opacity is low (`var(--cngx-band-opacity, 0.12)`) so the\n * band sits behind line / area / bar layers without dominating.\n *\n * Attribute-selector on `<svg:g>` - see {@link CngxLine} for why.\n *\n * @category common/chart/layers\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/band.component.ts\n * @since 0.1.0\n * @relatedTo CngxThreshold, CngxArea, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxBand]',\n exportAs: 'cngxBand',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_LAYER, useExisting: CngxBand }],\n template: `\n @if (rect(); as r) {\n @if (ctx.renderSvg()) {\n <svg:rect\n class=\"cngx-band__rect\"\n [attr.x]=\"r.x\"\n [attr.y]=\"r.y\"\n [attr.width]=\"r.width\"\n [attr.height]=\"r.height\"\n [attr.fill-opacity]=\"opacity()\"\n />\n }\n <!--\n Outside the renderSvg gate on purpose - see CngxThreshold: the\n canvas backend paints no text, so a gated label vanishes at the\n auto-switch threshold.\n -->\n @if (label(); as l) {\n <svg:text\n class=\"cngx-band__label\"\n [attr.x]=\"r.x + 4\"\n [attr.y]=\"r.y + r.height / 2\"\n text-anchor=\"start\"\n dominant-baseline=\"middle\"\n >\n {{ l }}\n </svg:text>\n }\n }\n `,\n styles: [\n `\n .cngx-band__rect {\n fill: var(--cngx-band-color, var(--cngx-chart-secondary, currentColor));\n fill-opacity: var(--cngx-band-opacity, 0.12);\n stroke: none;\n animation: cngx-band-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n .cngx-band__label {\n fill: var(--cngx-band-text-color, var(--cngx-chart-text-color, currentColor));\n font-size: var(--cngx-band-font-size, 11px);\n unicode-bidi: var(--cngx-chart-numeric-bidi, isolate);\n animation: cngx-band-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n @keyframes cngx-band-enter {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .cngx-band__rect,\n .cngx-band__label {\n animation: none;\n }\n }\n `,\n ],\n})\nexport class CngxBand implements CngxChartLayer {\n readonly from = input.required<number>();\n readonly to = input.required<number>();\n readonly label = input<string | null>(null);\n readonly opacity = input<number | string | null>(null);\n\n protected readonly ctx = injectChartContext('CngxBand');\n\n protected readonly rect = computed<{\n x: number;\n width: number;\n y: number;\n height: number;\n } | null>(\n () => {\n // The plot, not the box: the band spans the area the marks live\n // in, so it stops at the axis gutter instead of painting over\n // the tick labels the chart now reserves room for.\n const { x0, width, height } = this.ctx.plot();\n if (width <= 0 || height <= 0) {\n return null;\n }\n const yScale = this.ctx.yScale();\n const yA = yScale(this.from());\n const yB = yScale(this.to());\n const top = Math.min(yA, yB);\n const bottom = Math.max(yA, yB);\n return { x: x0, width, y: top, height: bottom - top };\n },\n {\n equal: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.x === b.x &&\n a.width === b.width &&\n a.y === b.y &&\n a.height === b.height),\n },\n );\n\n readonly geometry = computed<LayerGeometry>(\n () => {\n const r = this.rect();\n const op = this.opacity();\n return {\n kind: 'band',\n x: r?.x ?? 0,\n y: r?.y ?? 0,\n w: r?.width ?? 0,\n h: r?.height ?? 0,\n color: null,\n opacity: op == null ? null : Number(op),\n };\n },\n { equal: bandGeomEqual },\n );\n}\n\n/** @internal */\nfunction bandGeomEqual(a: LayerGeometry, b: LayerGeometry): boolean {\n if (a === b) {\n return true;\n }\n if (a.kind !== 'band' || b.kind !== 'band') {\n return false;\n }\n return (\n a.x === b.x &&\n a.y === b.y &&\n a.w === b.w &&\n a.h === b.h &&\n a.color === b.color &&\n a.opacity === b.opacity\n );\n}\n","import { computed, inject, type Signal } from '@angular/core';\nimport { resolveAsyncView, type AsyncView } from '@cngx/common/data';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { CNGX_CHART_I18N, type CngxChartI18n } from '../i18n/chart-i18n';\n\n/**\n * Reactive bundle returned by {@link injectPresetState}. Each preset\n * exposes `i18n` for fallback labels and `activeView` for the\n * `@switch` template branch.\n *\n * @internal\n */\nexport interface PresetStateContext {\n readonly i18n: CngxChartI18n;\n readonly activeView: Signal<AsyncView>;\n}\n\n/**\n * Shared `[state]` → `activeView` derivation for chart presets. Maps\n * a `CngxAsyncState` (when bound) to the same `AsyncView` discriminator\n * the select family uses; presets render skeleton / empty / error /\n * content branches off the same enum.\n *\n * Returns `'content'` when `state` is unbound - the preset renders its\n * SVG/DOM body without any state envelope. Treats `'content+error'`\n * the same as `'content'` for v1: a four-rect chart preset has no\n * room for an inline-error overlay; consumers compose\n * `<cngx-banner-on />` against the same `[state]` if they need\n * explicit transition feedback.\n *\n * @internal\n */\nexport function injectPresetState(\n state: () => CngxAsyncState<unknown> | undefined,\n): PresetStateContext {\n const i18n = inject(CNGX_CHART_I18N);\n const activeView = computed<AsyncView>(() => {\n const s = state();\n if (!s) {\n return 'content';\n }\n return resolveAsyncView(s.status(), s.isFirstLoad(), s.isEmpty());\n });\n return { i18n, activeView };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { CngxChart } from '../chart/chart.component';\nimport { CngxAxisDomain } from '../axis/axis-domain';\nimport { CngxLine } from '../layers/line.component';\nimport { CngxArea } from '../layers/area.component';\nimport { injectPresetState } from './preset-state';\n\n/**\n * Inline sparkline - a tiny line chart for KPI cards and dashboard\n * tiles. Composes `<cngx-chart>` + `<cngx-line>` (+ optional\n * `<cngx-area>`) with hidden axes that publish the scale domain\n * derived from the `data` array.\n *\n * Default viewBox is 80×24, intended for inline placement next to a\n * label or numeric value. Theming via `--cngx-sparkline-color`\n * (atom-local) → `--cngx-chart-primary` (chart-level) cascade.\n *\n * The host carries `role=\"img\"` and a reactive `aria-label` derived\n * from the chart's auto-Summary; consumers can override via\n * `[ariaLabel]`.\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/sparkline.component.ts\n * @since 0.1.0\n * @relatedTo CngxMiniArea, CngxMiniBar, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/sparkline/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/sparkline/basic-sparklines</example-url>\n * <example-url>http://localhost:4200/#/common/chart/sparkline/with-area-fill</example-url>\n */\n@Component({\n selector: 'cngx-sparkline',\n exportAs: 'cngxSparkline',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CngxChart, CngxAxisDomain, CngxLine, CngxArea],\n host: { class: 'cngx-sparkline' },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span\n class=\"cngx-preset-skeleton\"\n [style.width.px]=\"width()\"\n [style.height.px]=\"height()\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"i18n.loading()\"\n ></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n.empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n.error() }}</span>\n }\n @case ('none') {}\n @default {\n <cngx-chart\n [data]=\"data()\"\n [width]=\"width()\"\n [height]=\"height()\"\n [aria-label]=\"ariaLabel()\"\n >\n <svg:g\n cngxAxisDomain\n position=\"bottom\"\n type=\"linear\"\n [domain]=\"xDomain()\"\n ></svg:g>\n <svg:g\n cngxAxisDomain\n position=\"left\"\n type=\"linear\"\n [domain]=\"yDomain()\"\n ></svg:g>\n @if (showArea()) {\n <svg:g cngxArea [baseline]=\"yDomain()[0]\"></svg:g>\n }\n <svg:g cngxLine [strokeWidth]=\"strokeWidth()\"></svg:g>\n </cngx-chart>\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-sparkline {\n display: inline-block;\n line-height: 0;\n --cngx-line-color: var(--cngx-sparkline-color, var(--cngx-chart-primary, currentColor));\n --cngx-area-fill: var(--cngx-sparkline-color, var(--cngx-chart-primary, currentColor));\n }\n cngx-sparkline .cngx-preset-skeleton {\n display: inline-block;\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-preset-skeleton-radius, 2px);\n animation: cngx-preset-shimmer 1.4s linear infinite;\n background-image: linear-gradient(\n 90deg,\n transparent 0,\n var(--cngx-skeleton-shimmer, rgb(255 255 255 / 0.3)) 50%,\n transparent 100%\n );\n background-size: 200% 100%;\n }\n cngx-sparkline .cngx-preset-fallback {\n display: inline-block;\n line-height: normal;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n color: var(--cngx-chart-text-color, currentColor);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-sparkline .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n @keyframes cngx-preset-shimmer {\n 0% {\n background-position: 200% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n cngx-sparkline .cngx-preset-skeleton {\n animation: none;\n }\n }\n `,\n ],\n})\nexport class CngxSparkline {\n readonly data = input.required<readonly number[]>();\n readonly width = input<number>(80);\n readonly height = input<number>(24);\n readonly strokeWidth = input<number | string | null>(null);\n readonly showArea = input<boolean>(false);\n readonly state = input<CngxAsyncState<readonly number[]> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n protected readonly xDomain = computed<readonly number[]>(() => {\n const n = this.data().length;\n return n < 2 ? [0, 1] : [0, n - 1];\n });\n\n protected readonly yDomain = computed<readonly number[]>(() => {\n const d = this.data();\n if (d.length === 0) {\n return [0, 1];\n }\n let min = d[0];\n let max = d[0];\n for (let i = 1; i < d.length; i++) {\n const v = d[i];\n if (v < min) {\n min = v;\n }\n if (v > max) {\n max = v;\n }\n }\n if (min === max) {\n return [min - 1, max + 1];\n }\n return [min, max];\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { injectPresetState } from './preset-state';\n\n/**\n * Mini horizontal bar - a single-value bounded indicator. Renders\n * pure DOM (no SVG), positioned with CSS only. Host carries\n * `role=\"meter\"` per the WAI-ARIA pattern for single-value bounded\n * indicators; `aria-valuenow` / `aria-valuemin` / `aria-valuemax`\n * tell AT the exact reading without a separate Summary.\n *\n * `label` renders a visible caption above the track and doubles as the\n * host's accessible name: with `label` bound and `[aria-label]` unbound\n * the meter names itself from the caption, so it is no longer an unnamed\n * `role=\"meter\"`. A bound `[aria-label]` always wins and overrides the\n * visible caption.\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/mini-bar.component.ts\n * @since 0.1.0\n * @relatedTo CngxMiniArea, CngxSparkline, CngxDonut, CngxBullet\n *\n * <example-url>http://localhost:4200/#/common/chart/mini-bar/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/mini-bar/basic-readings</example-url>\n */\n@Component({\n selector: 'cngx-mini-bar',\n exportAs: 'cngxMiniBar',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'meter',\n '[attr.aria-valuenow]': 'value()',\n '[attr.aria-valuemin]': 'min()',\n '[attr.aria-valuemax]': 'max()',\n '[attr.aria-label]': 'ariaLabel() ?? label()',\n class: 'cngx-mini-bar',\n },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span\n class=\"cngx-preset-skeleton\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"i18n.loading()\"\n ></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n.empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n.error() }}</span>\n }\n @case ('none') {}\n @default {\n @if (label(); as l) {\n <span class=\"cngx-mini-bar__label\">{{ l }}</span>\n }\n <div class=\"cngx-mini-bar__track\">\n <div class=\"cngx-mini-bar__fill\" [style.width.%]=\"percent()\"></div>\n </div>\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-mini-bar {\n display: inline-block;\n width: var(--cngx-mini-bar-width, 80px);\n --cngx-mini-bar-color: var(--cngx-bar-color, var(--cngx-chart-primary, currentColor));\n }\n cngx-mini-bar .cngx-mini-bar__label {\n display: block;\n font-size: var(--cngx-mini-bar-label-font-size, 0.75rem);\n color: var(--cngx-mini-bar-label-color, inherit);\n unicode-bidi: var(--cngx-chart-numeric-bidi, isolate);\n }\n cngx-mini-bar .cngx-mini-bar__track {\n position: relative;\n height: var(--cngx-mini-bar-height, 6px);\n background: var(--cngx-mini-bar-track, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-mini-bar-radius, 3px);\n overflow: hidden;\n }\n cngx-mini-bar .cngx-mini-bar__fill {\n height: 100%;\n background: var(--cngx-mini-bar-color);\n border-radius: inherit;\n transition: width var(--cngx-mini-bar-transition, 240ms) ease-out;\n }\n cngx-mini-bar .cngx-preset-skeleton {\n display: block;\n height: var(--cngx-mini-bar-height, 6px);\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-mini-bar-radius, 3px);\n }\n cngx-mini-bar .cngx-preset-fallback {\n display: inline-block;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-mini-bar .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n `,\n ],\n})\nexport class CngxMiniBar {\n readonly value = input.required<number>();\n readonly max = input<number>(100);\n readonly min = input<number>(0);\n readonly label = input<string | null>(null);\n readonly state = input<CngxAsyncState<number> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n protected readonly percent = computed(() => {\n const v = this.value();\n const lo = this.min();\n const hi = this.max();\n if (hi === lo) {\n return 0;\n }\n const ratio = ((v - lo) / (hi - lo)) * 100;\n if (ratio < 0) {\n return 0;\n }\n if (ratio > 100) {\n return 100;\n }\n return ratio;\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { injectPresetState } from './preset-state';\n\n/**\n * Mini deviation bar - a single-value indicator that diverges from a\n * `[baseline]` (default `0`) in either direction. Negative deviations\n * render to the left of the baseline mark, positive to the right.\n * Pure DOM, no SVG. Host carries `role=\"meter\"`.\n *\n * Use cases: budget variance (\"$+45k over\"), score deltas (\"−12%\n * vs target\"), KPI swing visualisations.\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/deviation-bar.component.ts\n * @since 0.1.0\n * @relatedTo CngxMiniBar, CngxBullet, CngxStackedBar\n *\n * <example-url>http://localhost:4200/#/common/chart/deviation-bar/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/deviation-bar/variance-readings</example-url>\n */\n@Component({\n selector: 'cngx-deviation-bar',\n exportAs: 'cngxDeviationBar',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'meter',\n '[attr.aria-valuenow]': 'value()',\n '[attr.aria-valuemin]': '-magnitude()',\n '[attr.aria-valuemax]': 'magnitude()',\n '[attr.aria-label]': 'ariaLabel()',\n class: 'cngx-deviation-bar',\n },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span\n class=\"cngx-preset-skeleton\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"i18n.loading()\"\n ></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n.empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n.error() }}</span>\n }\n @case ('none') {}\n @default {\n <div class=\"cngx-deviation-bar__track\">\n <div class=\"cngx-deviation-bar__baseline\"></div>\n @if (geometry(); as g) {\n <div\n class=\"cngx-deviation-bar__fill\"\n [class.cngx-deviation-bar__fill--positive]=\"g.positive\"\n [class.cngx-deviation-bar__fill--negative]=\"!g.positive\"\n [style.left.%]=\"g.left\"\n [style.width.%]=\"g.width\"\n ></div>\n }\n </div>\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-deviation-bar {\n display: inline-block;\n width: var(--cngx-deviation-bar-width, 100px);\n --cngx-deviation-positive: var(--cngx-chart-success, #1f9d55);\n --cngx-deviation-negative: var(--cngx-chart-danger, #d2452f);\n }\n cngx-deviation-bar .cngx-deviation-bar__track {\n position: relative;\n height: var(--cngx-deviation-bar-height, 6px);\n background: var(\n --cngx-deviation-bar-track,\n var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08))\n );\n border-radius: var(--cngx-deviation-bar-radius, 3px);\n overflow: hidden;\n }\n cngx-deviation-bar .cngx-deviation-bar__baseline {\n position: absolute;\n left: 50%;\n top: 0;\n bottom: 0;\n width: 1px;\n background: var(\n --cngx-deviation-bar-baseline-color,\n var(--cngx-chart-axis-color, currentColor)\n );\n opacity: var(--cngx-deviation-bar-baseline-opacity, 0.5);\n }\n cngx-deviation-bar .cngx-deviation-bar__fill {\n position: absolute;\n top: 0;\n bottom: 0;\n transition:\n left var(--cngx-deviation-bar-transition, 240ms) ease-out,\n width var(--cngx-deviation-bar-transition, 240ms) ease-out;\n }\n cngx-deviation-bar .cngx-deviation-bar__fill--positive {\n background: var(--cngx-deviation-positive);\n }\n cngx-deviation-bar .cngx-deviation-bar__fill--negative {\n background: var(--cngx-deviation-negative);\n }\n cngx-deviation-bar .cngx-preset-skeleton {\n display: block;\n height: var(--cngx-deviation-bar-height, 6px);\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-deviation-bar-radius, 3px);\n }\n cngx-deviation-bar .cngx-preset-fallback {\n display: inline-block;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-deviation-bar .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n `,\n ],\n})\nexport class CngxDeviationBar {\n readonly value = input.required<number>();\n readonly baseline = input<number>(0);\n readonly magnitude = input<number>(100);\n readonly state = input<CngxAsyncState<number> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n protected readonly geometry = computed<{\n positive: boolean;\n left: number;\n width: number;\n } | null>(() => {\n const v = this.value();\n const b = this.baseline();\n const m = this.magnitude();\n if (m <= 0) {\n return null;\n }\n const delta = v - b;\n if (delta === 0) {\n return null;\n }\n const positive = delta > 0;\n const ratio = Math.min(Math.abs(delta) / m, 1) * 50;\n if (positive) {\n return { positive, left: 50, width: ratio };\n }\n return { positive, left: 50 - ratio, width: ratio };\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { CngxChart } from '../chart/chart.component';\nimport { CngxAxisDomain } from '../axis/axis-domain';\nimport { CngxArea } from '../layers/area.component';\nimport { injectPresetState } from './preset-state';\n\n/**\n * Inline mini area - a tiny filled-area chart for KPI cards. Sibling\n * of {@link CngxSparkline}; renders only the area (no line stroke).\n * Default viewBox 80×24. Theming via `--cngx-mini-area-color`\n * (atom-local) → `--cngx-chart-primary` (chart-level) cascade.\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/mini-area.component.ts\n * @since 0.1.0\n * @relatedTo CngxSparkline, CngxMiniBar, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/mini-area/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/mini-area/inline-area-trends</example-url>\n */\n@Component({\n selector: 'cngx-mini-area',\n exportAs: 'cngxMiniArea',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CngxChart, CngxAxisDomain, CngxArea],\n host: { class: 'cngx-mini-area' },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span\n class=\"cngx-preset-skeleton\"\n [style.width.px]=\"width()\"\n [style.height.px]=\"height()\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"i18n.loading()\"\n ></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n.empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n.error() }}</span>\n }\n @case ('none') {}\n @default {\n <cngx-chart\n [data]=\"data()\"\n [width]=\"width()\"\n [height]=\"height()\"\n [aria-label]=\"ariaLabel()\"\n >\n <svg:g\n cngxAxisDomain\n position=\"bottom\"\n type=\"linear\"\n [domain]=\"xDomain()\"\n ></svg:g>\n <svg:g\n cngxAxisDomain\n position=\"left\"\n type=\"linear\"\n [domain]=\"yDomain()\"\n ></svg:g>\n <svg:g cngxArea [opacity]=\"opacity()\" [baseline]=\"yDomain()[0]\"></svg:g>\n </cngx-chart>\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-mini-area {\n display: inline-block;\n line-height: 0;\n --cngx-area-fill: var(--cngx-mini-area-color, var(--cngx-chart-primary, currentColor));\n }\n cngx-mini-area .cngx-preset-skeleton {\n display: inline-block;\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-preset-skeleton-radius, 2px);\n }\n cngx-mini-area .cngx-preset-fallback {\n display: inline-block;\n line-height: normal;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-mini-area .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n `,\n ],\n})\nexport class CngxMiniArea {\n readonly data = input.required<readonly number[]>();\n readonly width = input<number>(80);\n readonly height = input<number>(24);\n readonly opacity = input<number | string | null>(null);\n readonly state = input<CngxAsyncState<readonly number[]> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n protected readonly xDomain = computed<readonly number[]>(() => {\n const n = this.data().length;\n return n < 2 ? [0, 1] : [0, n - 1];\n });\n\n protected readonly yDomain = computed<readonly number[]>(() => {\n const d = this.data();\n if (d.length === 0) {\n return [0, 1];\n }\n let min = d[0];\n let max = d[0];\n for (let i = 1; i < d.length; i++) {\n const v = d[i];\n if (v < min) {\n min = v;\n }\n if (v > max) {\n max = v;\n }\n }\n if (min === max) {\n return [min - 1, max + 1];\n }\n return [min, max];\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { injectPresetState } from './preset-state';\n\n/** @internal */\nconst TWO_PI = Math.PI * 2;\n\n/**\n * Circular donut gauge - a single-value bounded indicator. Renders a\n * background ring + a foreground arc whose length is proportional to\n * `value / max`. Host carries `role=\"meter\"`; the optional `[label]`\n * input renders an SR-only label inside the ring's centre.\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/donut.component.ts\n * @since 0.1.0\n * @relatedTo CngxBullet, CngxMiniBar, CngxDeviationBar\n *\n * <example-url>http://localhost:4200/#/common/chart/donut/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/donut/score-gauges</example-url>\n */\n@Component({\n selector: 'cngx-donut',\n exportAs: 'cngxDonut',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'meter',\n '[attr.aria-valuenow]': 'value()',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuemax]': 'max()',\n '[attr.aria-label]': 'ariaLabel()',\n class: 'cngx-donut',\n },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span\n class=\"cngx-preset-skeleton cngx-donut__skeleton\"\n [style.width.px]=\"size()\"\n [style.height.px]=\"size()\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"i18n.loading()\"\n ></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n.empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n.error() }}</span>\n }\n @case ('none') {}\n @default {\n <svg\n [attr.viewBox]=\"'0 0 ' + size() + ' ' + size()\"\n [attr.width]=\"size()\"\n [attr.height]=\"size()\"\n aria-hidden=\"true\"\n >\n <svg:circle\n class=\"cngx-donut__track\"\n [attr.cx]=\"center()\"\n [attr.cy]=\"center()\"\n [attr.r]=\"radius()\"\n [attr.stroke-width]=\"thickness()\"\n fill=\"none\"\n />\n <svg:circle\n class=\"cngx-donut__fill\"\n [attr.cx]=\"center()\"\n [attr.cy]=\"center()\"\n [attr.r]=\"radius()\"\n [attr.stroke-width]=\"thickness()\"\n [attr.stroke-dasharray]=\"dasharray()\"\n [attr.stroke-dashoffset]=\"dashoffset()\"\n [attr.transform]=\"'rotate(-90 ' + center() + ' ' + center() + ')'\"\n fill=\"none\"\n stroke-linecap=\"round\"\n />\n </svg>\n @if (label(); as l) {\n <span class=\"cngx-donut__label\">{{ l }}</span>\n }\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-donut {\n display: inline-block;\n position: relative;\n line-height: 0;\n --cngx-donut-color: var(--cngx-chart-primary, currentColor);\n }\n cngx-donut .cngx-donut__track {\n stroke: var(--cngx-donut-track, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n }\n cngx-donut .cngx-donut__fill {\n stroke: var(--cngx-donut-color);\n transition: stroke-dashoffset var(--cngx-donut-transition, 320ms) ease-out;\n }\n cngx-donut .cngx-donut__label {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: var(--cngx-donut-label-font-size, 0.875rem);\n line-height: 1;\n color: var(--cngx-chart-text-color, currentColor);\n unicode-bidi: var(--cngx-chart-numeric-bidi, isolate);\n }\n cngx-donut .cngx-preset-skeleton {\n display: inline-block;\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: 50%;\n }\n cngx-donut .cngx-preset-fallback {\n display: inline-block;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-donut .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n `,\n ],\n})\nexport class CngxDonut {\n readonly value = input.required<number>();\n readonly max = input<number>(100);\n readonly size = input<number>(48);\n readonly thickness = input<number>(6);\n readonly label = input<string | null>(null);\n readonly state = input<CngxAsyncState<number> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n protected readonly center = computed(() => this.size() / 2);\n protected readonly radius = computed(() => (this.size() - this.thickness()) / 2);\n protected readonly circumference = computed(() => TWO_PI * this.radius());\n\n protected readonly dasharray = computed(() => {\n const c = this.circumference();\n return `${c} ${c}`;\n });\n\n protected readonly dashoffset = computed(() => {\n const c = this.circumference();\n const m = this.max();\n if (m <= 0) {\n return c;\n }\n const ratio = Math.min(Math.max(this.value() / m, 0), 1);\n return c * (1 - ratio);\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { injectPresetState } from './preset-state';\n\n/**\n * Bullet chart range entry - a colour band stretching from one value\n * to another along the bullet's axis. Typical use: traffic-light\n * bands (\"good\" / \"fair\" / \"poor\") behind the actual+target bar.\n *\n * @category common/chart/presets\n */\nexport interface CngxBulletRange {\n readonly from: number;\n readonly to: number;\n readonly color?: string;\n readonly label?: string;\n}\n\n/** @internal */\ninterface RangeRendering {\n readonly key: string;\n readonly left: number;\n readonly width: number;\n readonly color: string | null;\n}\n\n/**\n * Bullet chart - Stephen Few's compact KPI visualisation. Three\n * stacked layers: background `[ranges]` (qualitative bands), an\n * `[actual]` filled bar, and a `[target]` vertical marker. Pure DOM,\n * no SVG. Host carries `role=\"meter\"`.\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/bullet.component.ts\n * @since 0.1.0\n * @relatedTo CngxDonut, CngxMiniBar, CngxDeviationBar\n *\n * <example-url>http://localhost:4200/#/common/chart/bullet/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/bullet/performance-vs-target</example-url>\n */\n@Component({\n selector: 'cngx-bullet',\n exportAs: 'cngxBullet',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'meter',\n '[attr.aria-valuenow]': 'actual()',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuemax]': 'maxValue()',\n '[attr.aria-label]': 'ariaLabel()',\n class: 'cngx-bullet',\n },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span\n class=\"cngx-preset-skeleton\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"i18n.loading()\"\n ></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n.empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n.error() }}</span>\n }\n @case ('none') {}\n @default {\n <div class=\"cngx-bullet__track\">\n @for (r of rangeRenderings(); track r.key) {\n <div\n class=\"cngx-bullet__range\"\n [style.left.%]=\"r.left\"\n [style.width.%]=\"r.width\"\n [style.background]=\"r.color\"\n [attr.aria-hidden]=\"true\"\n ></div>\n }\n <div\n class=\"cngx-bullet__actual\"\n [style.width.%]=\"actualPercent()\"\n [attr.aria-hidden]=\"true\"\n ></div>\n <div\n class=\"cngx-bullet__target\"\n [style.left.%]=\"targetPercent()\"\n [attr.aria-hidden]=\"true\"\n ></div>\n </div>\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-bullet {\n display: block;\n width: var(--cngx-bullet-width, 200px);\n --cngx-bullet-actual-color: var(--cngx-chart-primary, currentColor);\n --cngx-bullet-target-color: var(--cngx-chart-text-color, currentColor);\n }\n cngx-bullet .cngx-bullet__track {\n position: relative;\n height: var(--cngx-bullet-height, 16px);\n background: var(--cngx-bullet-track, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.06)));\n border-radius: var(--cngx-bullet-radius, 2px);\n overflow: hidden;\n }\n cngx-bullet .cngx-bullet__range {\n position: absolute;\n top: 0;\n bottom: 0;\n opacity: var(--cngx-bullet-range-opacity, 0.35);\n }\n cngx-bullet .cngx-bullet__actual {\n position: absolute;\n top: 25%;\n bottom: 25%;\n left: 0;\n background: var(--cngx-bullet-actual-color);\n border-radius: var(--cngx-bullet-actual-radius, 1px);\n transition: width var(--cngx-bullet-transition, 240ms) ease-out;\n }\n cngx-bullet .cngx-bullet__target {\n position: absolute;\n top: 10%;\n bottom: 10%;\n width: 2px;\n margin-left: -1px;\n background: var(--cngx-bullet-target-color);\n transition: left var(--cngx-bullet-transition, 240ms) ease-out;\n }\n cngx-bullet .cngx-preset-skeleton {\n display: block;\n height: var(--cngx-bullet-height, 16px);\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-bullet-radius, 2px);\n }\n cngx-bullet .cngx-preset-fallback {\n display: inline-block;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-bullet .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n `,\n ],\n})\nexport class CngxBullet {\n readonly actual = input.required<number>();\n readonly target = input<number | null>(null);\n readonly max = input<number | null>(null);\n readonly ranges = input<readonly CngxBulletRange[]>([]);\n readonly state = input<CngxAsyncState<number> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n protected readonly maxValue = computed(() => {\n const explicit = this.max();\n if (explicit !== null && explicit > 0) {\n return explicit;\n }\n const ranges = this.ranges();\n let m = Math.max(this.actual(), this.target() ?? 0);\n for (const r of ranges) {\n if (r.to > m) {\n m = r.to;\n }\n }\n return m > 0 ? m : 1;\n });\n\n protected readonly actualPercent = computed(() => pct(this.actual(), this.maxValue()));\n\n protected readonly targetPercent = computed(() => {\n const t = this.target();\n if (t === null) {\n return 0;\n }\n return pct(t, this.maxValue());\n });\n\n protected readonly rangeRenderings = computed<readonly RangeRendering[]>(() => {\n const m = this.maxValue();\n return this.ranges().map((r, i) => {\n const lo = Math.min(r.from, r.to);\n const hi = Math.max(r.from, r.to);\n return {\n key: `${i}-${r.label ?? ''}`,\n left: pct(lo, m),\n width: pct(hi - lo, m),\n color: r.color ?? null,\n };\n });\n });\n}\n\n/** @internal */\nfunction pct(v: number, max: number): number {\n if (max <= 0) {\n return 0;\n }\n const ratio = (v / max) * 100;\n if (ratio < 0) {\n return 0;\n }\n if (ratio > 100) {\n return 100;\n }\n return ratio;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { injectPresetState } from './preset-state';\n\n/**\n * One segment in a stacked-bar series: a value, a label, optional colour.\n *\n * @category common/chart/presets\n */\nexport interface CngxStackedSegment {\n readonly value: number;\n readonly color?: string;\n readonly label: string;\n}\n\n/** @internal */\ninterface SegmentRendering {\n readonly key: string;\n readonly left: number;\n readonly width: number;\n readonly color: string | null;\n readonly label: string;\n readonly value: number;\n}\n\n/**\n * Single-bar stacked composition - visualises proportional shares of\n * a fixed total. Pure DOM, no SVG. Host carries `role=\"img\"` because\n * a stacked bar communicates a multi-segment ratio, not a single\n * bounded reading; the SR description enumerates segments via the\n * auto-generated `aria-label` (or the `[ariaLabel]` override).\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/stacked-bar.component.ts\n * @since 0.1.0\n * @relatedTo CngxBar, CngxDeviationBar, CngxBullet\n *\n * <example-url>http://localhost:4200/#/common/chart/stacked-bar/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/stacked-bar/proportional-share-strips</example-url>\n */\n@Component({\n selector: 'cngx-stacked-bar',\n exportAs: 'cngxStackedBar',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'img',\n '[attr.aria-label]': 'effectiveAriaLabel()',\n class: 'cngx-stacked-bar',\n },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span\n class=\"cngx-preset-skeleton\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"i18n.loading()\"\n ></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n.empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n.error() }}</span>\n }\n @case ('none') {}\n @default {\n <div class=\"cngx-stacked-bar__track\">\n @for (s of segmentRenderings(); track s.key) {\n <div\n class=\"cngx-stacked-bar__segment\"\n [style.left.%]=\"s.left\"\n [style.width.%]=\"s.width\"\n [style.background]=\"s.color\"\n [attr.title]=\"s.label + ': ' + s.value\"\n [attr.aria-hidden]=\"true\"\n ></div>\n }\n </div>\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-stacked-bar {\n display: block;\n width: var(--cngx-stacked-bar-width, 200px);\n }\n cngx-stacked-bar .cngx-stacked-bar__track {\n position: relative;\n height: var(--cngx-stacked-bar-height, 12px);\n background: var(--cngx-stacked-bar-track, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.05)));\n border-radius: var(--cngx-stacked-bar-radius, 6px);\n overflow: hidden;\n }\n cngx-stacked-bar .cngx-stacked-bar__segment {\n position: absolute;\n top: 0;\n bottom: 0;\n background: var(--cngx-stacked-bar-segment-color, var(--cngx-chart-primary, currentColor));\n transition:\n width var(--cngx-stacked-bar-transition, 240ms) ease-out,\n left var(--cngx-stacked-bar-transition, 240ms) ease-out;\n }\n cngx-stacked-bar .cngx-preset-skeleton {\n display: block;\n height: var(--cngx-stacked-bar-height, 12px);\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-stacked-bar-radius, 6px);\n }\n cngx-stacked-bar .cngx-preset-fallback {\n display: inline-block;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-stacked-bar .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n `,\n ],\n})\nexport class CngxStackedBar {\n readonly segments = input.required<readonly CngxStackedSegment[]>();\n readonly total = input<number | null>(null);\n readonly state = input<CngxAsyncState<readonly CngxStackedSegment[]> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n protected readonly resolvedTotal = computed(() => {\n const explicit = this.total();\n if (explicit !== null && explicit > 0) {\n return explicit;\n }\n let sum = 0;\n for (const s of this.segments()) {\n sum += s.value;\n }\n return sum > 0 ? sum : 1;\n });\n\n protected readonly segmentRenderings = computed<readonly SegmentRendering[]>(() => {\n const total = this.resolvedTotal();\n let runningLeft = 0;\n return this.segments().map((s, i) => {\n const width = (s.value / total) * 100;\n const left = runningLeft;\n runningLeft += width;\n return {\n key: `${i}-${s.label}`,\n left,\n width,\n color: s.color ?? null,\n label: s.label,\n value: s.value,\n };\n });\n });\n\n protected readonly effectiveAriaLabel = computed(() => {\n const explicit = this.ariaLabel();\n if (explicit !== null && explicit !== '') {\n return explicit;\n }\n const segments = this.segments();\n if (segments.length === 0) {\n return 'Empty stacked bar';\n }\n const total = this.resolvedTotal();\n const parts = segments.map((s) => `${s.label}: ${s.value}`);\n return `Total ${total}. ${parts.join(', ')}.`;\n });\n}\n","/**\n * @module @cngx/common/chart\n *\n * Declarative, Signal-first chart system. Two-level architecture:\n * composable atoms (`<cngx-chart>` element + `[cngxAxis]` and layer\n * atoms applied to `<svg:g>` hosts) and preset molecules\n * (`<cngx-sparkline>`, `<cngx-donut>`, etc.).\n */\nexport {\n createLinearScale,\n createTimeScale,\n createBandScale,\n createOrdinalScale,\n type BandScale,\n} from './scales';\n\nexport {\n downsampleLTTB,\n injectChartBuffer,\n type CngxChartBuffer,\n type ChartBufferOptions,\n} from './buffer';\n\nexport { CngxChart } from './chart/chart.component';\nexport {\n createSignificantChangeTracker,\n type CngxSignificantChange,\n} from './chart/significant-change';\nexport { CngxChartAnnouncer } from './chart/chart-announcer.component';\nexport {\n CNGX_CHART_CONTEXT,\n type CngxChartContext,\n type CngxChartPlotArea,\n type ScaleFn,\n type XScaleInput,\n} from './chart/chart-context';\n\nexport {\n CngxChartLoading,\n CngxChartEmpty,\n CngxChartError,\n CngxChartConnectionError,\n CngxChartReconnecting,\n CngxChartOverlay,\n CHART_SMALL_BREAKPOINT_PX,\n type CngxChartErrorContext,\n type CngxChartConnectionContext,\n type CngxChartSlotContext,\n} from './chart/template-slots';\n\nexport { CngxAxis } from './axis/axis.component';\nexport { CngxAxisDomain } from './axis/axis-domain';\nexport { CNGX_CHART_AXIS, type CngxChartAxis } from './axis/chart-axis';\nexport { type CngxAxisPosition, type CngxAxisType } from './axis/axis-position';\n\nexport { CngxChartLegend, type CngxChartLegendItem } from './legend/legend.component';\n\nexport { CngxLine } from './layers/line.component';\nexport { CngxArea } from './layers/area.component';\nexport { CngxBar } from './layers/bar.component';\nexport type { BarYAccessor } from './layers/bar.component';\nexport {\n CngxScatter,\n type ScatterXAccessor,\n type ScatterYAccessor,\n} from './layers/scatter.component';\nexport { CngxThreshold } from './layers/threshold.component';\nexport { CngxBand } from './layers/band.component';\nexport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './layers/chart-layer';\n\nexport {\n type CngxChartRenderer,\n type CngxChartRendererFactory,\n type ChartRendererDeps,\n} from './renderer/chart-renderer';\nexport { createSvgRenderer } from './renderer/svg-renderer';\nexport { createCanvasRenderer } from './renderer/canvas-renderer';\nexport { CNGX_CHART_RENDERER_THRESHOLD } from './renderer/renderer-threshold';\nexport {\n CNGX_CHART_RENDERER_FACTORY,\n createDefaultChartRenderer,\n provideChartRenderer,\n withChartRendererThreshold,\n withChartRendererFactory,\n type CngxChartRendererFeature,\n} from './renderer/renderer-factory';\nexport {\n createChartRendererController,\n type CngxChartRendererController,\n type ChartRendererControllerDeps,\n} from './renderer/chart-renderer-controller';\n\nexport {\n CNGX_CHART_I18N,\n provideChartI18n,\n type CngxChartI18n,\n type CngxChartSummary,\n} from './i18n/chart-i18n';\n\nexport { CngxSparkline } from './presets/sparkline.component';\nexport { CngxMiniBar } from './presets/mini-bar.component';\nexport { CngxDeviationBar } from './presets/deviation-bar.component';\nexport { CngxMiniArea } from './presets/mini-area.component';\nexport { CngxDonut } from './presets/donut.component';\nexport { CngxBullet, type CngxBulletRange } from './presets/bullet.component';\nexport { CngxStackedBar, type CngxStackedSegment } from './presets/stacked-bar.component';\nexport {\n createPathBuilder,\n type PathBuilder,\n type PathBuilderOptions,\n type LineYAccessor,\n type LineXAccessor,\n buildCurvePath,\n type CngxCurve,\n type PathPoint,\n} from './path';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["toMs"],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AACG,SAAU,iBAAiB,CAC/B,MAAiC,EACjC,KAAgC,EAAA;AAEhC,IAAA,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM;AACvB,IAAA,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK;AACtB,IAAA,MAAM,KAAK,GAAG,EAAE,GAAG,EAAE;AACrB,IAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACf,QAAA,OAAO,MAAM,EAAE;IACjB;AACA,IAAA,MAAM,KAAK,GAAG,EAAE,GAAG,EAAE;AACrB,IAAA,OAAO,CAAC,CAAS,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,KAAK;AACvD;;AC1BA;;;;;;;;;;;;AAYG;AACG,SAAU,eAAe,CAC7B,MAA+C,EAC/C,KAAgC,EAAA;IAEhC,MAAM,EAAE,GAAGA,MAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC1B,MAAM,EAAE,GAAGA,MAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC1B,IAAA,MAAM,MAAM,GAAG,iBAAiB,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC;AACjD,IAAA,OAAO,CAAC,CAAgB,KAAK,MAAM,CAACA,MAAI,CAAC,CAAC,CAAC,CAAC;AAC9C;AAEA;AACA,SAASA,MAAI,CAAC,CAAgB,EAAA;AAC5B,IAAA,OAAO,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE;AACh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kBAAkB,EAAA,QAAA,EAClB,gBAAgB,EAAA,UAAA,EACd,IAAI,EAAA,eAAA,EACC,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,IAAI,EAAA,IAAA,EAC/B;AACJ,wBAAA,IAAI,EAAE,KAAK;AACX,wBAAA,mBAAmB,EAAE,sBAAsB;AAC3C,wBAAA,KAAK,EAAE,kBAAkB;qBAC1B,EAAA,QAAA,EACS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,giDAAA,EAAA,ulCAAA,CAAA,EAAA;;;AC1FH;;;;;;;AAOG;;ACPH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cngx-common-chart.mjs","sources":["../../../projects/common/chart/scales/linear.ts","../../../projects/common/chart/scales/time.ts","../../../projects/common/chart/scales/band.ts","../../../projects/common/chart/scales/ordinal.ts","../../../projects/common/chart/buffer/lttb.ts","../../../projects/common/chart/chart/equal-helpers.ts","../../../projects/common/chart/buffer/ring-buffer.ts","../../../projects/common/chart/buffer/inject-chart-buffer.ts","../../../projects/common/chart/axis/chart-axis.ts","../../../projects/common/chart/chart/chart-context.ts","../../../projects/common/chart/layers/chart-layer.ts","../../../projects/common/chart/layers/threshold.component.ts","../../../projects/common/chart/chart/format-number.ts","../../../projects/common/chart/i18n/chart-language-section.ts","../../../projects/common/chart/i18n/chart-i18n.ts","../../../projects/common/chart/chart/data-table.component.ts","../../../projects/common/chart/chart/template-slots.ts","../../../projects/common/chart/chart/preset-math.ts","../../../projects/common/chart/chart/summary.ts","../../../projects/common/chart/chart/significant-change.ts","../../../projects/common/chart/renderer/chart-renderer-controller.ts","../../../projects/common/chart/renderer/forced-series.ts","../../../projects/common/chart/renderer/canvas-renderer.ts","../../../projects/common/chart/renderer/svg-renderer.ts","../../../projects/common/chart/renderer/renderer-threshold.ts","../../../projects/common/chart/renderer/renderer-factory.ts","../../../projects/common/chart/chart/chart.component.ts","../../../projects/common/chart/chart/chart-announcer.component.ts","../../../projects/common/chart/axis/axis.component.ts","../../../projects/common/chart/axis/axis-domain.ts","../../../projects/common/chart/legend/legend.component.ts","../../../projects/common/chart/layers/point-geom.ts","../../../projects/common/chart/path/curve.ts","../../../projects/common/chart/path/path-builder.ts","../../../projects/common/chart/layers/line.component.ts","../../../projects/common/chart/layers/area.component.ts","../../../projects/common/chart/layers/bar.component.ts","../../../projects/common/chart/layers/scatter.component.ts","../../../projects/common/chart/layers/band.component.ts","../../../projects/common/chart/presets/preset-state.ts","../../../projects/common/chart/presets/sparkline.component.ts","../../../projects/common/chart/presets/mini-bar.component.ts","../../../projects/common/chart/presets/deviation-bar.component.ts","../../../projects/common/chart/presets/mini-area.component.ts","../../../projects/common/chart/presets/donut.component.ts","../../../projects/common/chart/presets/bullet.component.ts","../../../projects/common/chart/presets/stacked-bar.component.ts","../../../projects/common/chart/public-api.ts","../../../projects/common/chart/cngx-common-chart.ts"],"sourcesContent":["/**\n * Pure-TS linear scale. Maps a numeric domain `[d0, d1]` to a numeric\n * range `[r0, r1]` via standard linear interpolation. Domain may be\n * inverted (`d0 > d1`) for SVG Y-axes where the top of the chart is the\n * highest data value but the lowest pixel coordinate.\n *\n * Values outside the domain extrapolate. Charts that need overflow\n * clamping clamp at the data layer, not the scale.\n *\n * @param domain `[start, end]` data range. Equal endpoints collapse the\n * scale to a constant function returning `range[0]`.\n * @param range `[start, end]` output range (typically pixel coordinates).\n * @returns `(v: number) => number` mapping domain values to range values.\n *\n * @category common/chart/scales\n */\nexport function createLinearScale(\n domain: readonly [number, number],\n range: readonly [number, number],\n): (v: number) => number {\n const [d0, d1] = domain;\n const [r0, r1] = range;\n const dSpan = d1 - d0;\n if (dSpan === 0) {\n return () => r0;\n }\n const rSpan = r1 - r0;\n return (v: number) => r0 + ((v - d0) / dSpan) * rSpan;\n}\n","import { createLinearScale } from './linear';\n\n/**\n * Pure-TS time scale. Reuses {@link createLinearScale} after coercing\n * `Date` endpoints (and inputs) to epoch milliseconds. Supports\n * inverted domains and bare-number timestamps interchangeably.\n *\n * @param domain `[start, end]` time range. `Date` and `number` are\n * interchangeable on either endpoint.\n * @param range `[start, end]` output range (typically pixel coordinates).\n * @returns `(v: Date | number) => number` mapping time values to range\n * values.\n *\n * @category common/chart/scales\n */\nexport function createTimeScale(\n domain: readonly [Date | number, Date | number],\n range: readonly [number, number],\n): (v: Date | number) => number {\n const d0 = toMs(domain[0]);\n const d1 = toMs(domain[1]);\n const linear = createLinearScale([d0, d1], range);\n return (v: Date | number) => linear(toMs(v));\n}\n\n/** @internal */\nfunction toMs(v: Date | number): number {\n return typeof v === 'number' ? v : v.getTime();\n}\n","/**\n * Pure-TS band scale. Maps a discrete categorical domain to evenly\n * spaced positions along a numeric range. Each band reserves equal\n * width; padding shrinks the band by a fraction of its slot.\n *\n * Result is a callable carrying a `bandwidth()` method so layer atoms\n * (`<cngx-bar>`, ...) can read both the position and the slot width.\n *\n * @param domain Ordered list of categorical values. Values are matched\n * by reference equality on lookup; pass primitives or stable refs.\n * @param range `[start, end]` output range.\n * @param padding Fraction of each slot reserved as inter-band gap.\n * Default `0` (no gap). Range `[0, 1)`.\n * @returns Callable `(v: T) => number` returning the **leading edge** of\n * the band, with a `bandwidth()` method returning the band width.\n * Lookup of an unknown value returns `NaN`.\n *\n * @category common/chart/scales\n */\nexport interface BandScale<T> {\n (v: T): number;\n bandwidth(): number;\n}\n\n/**\n * Construct a {@link BandScale} from a categorical domain and a numeric\n * range. See the type-level documentation above for parameter\n * semantics.\n *\n * @category common/chart/scales\n */\nexport function createBandScale<T>(\n domain: readonly T[],\n range: readonly [number, number],\n padding = 0,\n): BandScale<T> {\n const [r0, r1] = range;\n const n = domain.length;\n const span = r1 - r0;\n const slot = n === 0 ? 0 : span / n;\n // Clamp to the documented [0, 1) contract: padding >= 1 would flip\n // the bandwidth negative and a negative padding would overlap bands.\n const p = Math.min(Math.max(padding, 0), 1);\n const inner = slot * (1 - p);\n const offset = (slot - inner) / 2;\n\n const lookup = new Map<T, number>();\n for (let i = 0; i < n; i++) {\n lookup.set(domain[i], r0 + i * slot + offset);\n }\n\n const fn: BandScale<T> = ((v: T) => {\n return lookup.get(v) ?? NaN;\n }) as BandScale<T>;\n fn.bandwidth = () => inner;\n return fn;\n}\n","/**\n * Pure-TS ordinal scale. Maps a discrete categorical domain to a\n * cycling palette of values (typically colours). When the domain is\n * longer than the palette, mappings wrap modulo palette length.\n *\n * @param domain Ordered list of categorical values. Values are matched\n * by reference equality on lookup.\n * @param colors Palette to cycle through. Must have at least one entry;\n * an empty palette throws synchronously at construction time.\n * @returns Callable `(v: T) => string` returning the palette entry for\n * `v`. Lookup of an unknown value returns the palette's first entry.\n *\n * @category common/chart/scales\n */\nexport function createOrdinalScale<T>(\n domain: readonly T[],\n colors: readonly string[],\n): (v: T) => string {\n if (colors.length === 0) {\n throw new Error('createOrdinalScale: colors palette must not be empty');\n }\n const lookup = new Map<T, string>();\n for (let i = 0; i < domain.length; i++) {\n lookup.set(domain[i], colors[i % colors.length]);\n }\n return (v: T) => lookup.get(v) ?? colors[0];\n}\n","/**\n * Largest-Triangle-Three-Buckets downsampling. Reduces a dense series to\n * `targetSize` points while preserving the perceptual shape of the line -\n * peaks, troughs, and inflections survive where naive uniform (every-Nth)\n * sampling would drop them. This is the realtime-charting literature's\n * default downsampler (Steinarsson 2013).\n *\n * Pure TS: no Angular, no signal, no RxJS dependency. Tree-shakeable, so\n * static-chart consumers that never buffer pay nothing. The `<cngx-chart>`\n * buffer ({@link injectChartBuffer}) is the single downsampling boundary at\n * v2; this is its algorithm.\n *\n * The first and last points are always kept. The middle `targetSize - 2`\n * points are chosen one per bucket by the largest-triangle-area heuristic:\n * for each bucket, the point forming the largest triangle with the previous\n * selected point and the next bucket's average is retained.\n *\n * @param data source series, read-only.\n * @param targetSize desired output length. When `>= data.length` (or `<= 0`),\n * the input is returned unchanged by reference - no allocation, no copy.\n * @param xAccessor projects a row to its numeric X (typically a timestamp or\n * positional index).\n * @param yAccessor projects a row to its numeric Y (the value the triangle\n * area is computed against).\n * @returns a fresh array of at most `targetSize` rows, or the input by\n * reference when no reduction is needed.\n *\n * @category common/chart/buffer\n */\nexport function downsampleLTTB<T>(\n data: readonly T[],\n targetSize: number,\n xAccessor: (d: T, i: number) => number,\n yAccessor: (d: T, i: number) => number,\n): readonly T[] {\n const n = data.length;\n if (targetSize <= 0 || targetSize >= n) {\n return data;\n }\n if (targetSize === 1) {\n return [data[0]];\n }\n if (targetSize === 2) {\n return [data[0], data[n - 1]];\n }\n\n const sampled: T[] = [data[0]];\n // Middle buckets span the interior points [1, n-2]; first and last are\n // reserved. A fractional bucket size keeps the buckets evenly balanced.\n const bucketSize = (n - 2) / (targetSize - 2);\n let anchor = 0;\n\n for (let i = 0; i < targetSize - 2; i++) {\n const bucketStart = Math.floor(i * bucketSize) + 1;\n const bucketEnd = Math.floor((i + 1) * bucketSize) + 1;\n\n // Average of the next bucket forms the third triangle vertex.\n const nextStart = bucketEnd;\n const nextEnd = Math.min(Math.floor((i + 2) * bucketSize) + 1, n);\n const nextLen = nextEnd - nextStart;\n let avgX = 0;\n let avgY = 0;\n for (let j = nextStart; j < nextEnd; j++) {\n avgX += xAccessor(data[j], j);\n avgY += yAccessor(data[j], j);\n }\n avgX /= nextLen;\n avgY /= nextLen;\n\n const anchorX = xAccessor(data[anchor], anchor);\n const anchorY = yAccessor(data[anchor], anchor);\n\n let maxArea = -1;\n let maxIndex = bucketStart;\n for (let j = bucketStart; j < bucketEnd; j++) {\n const area =\n Math.abs(\n (anchorX - avgX) * (yAccessor(data[j], j) - anchorY) -\n (anchorX - xAccessor(data[j], j)) * (avgY - anchorY),\n ) * 0.5;\n if (area > maxArea) {\n maxArea = area;\n maxIndex = j;\n }\n }\n\n sampled.push(data[maxIndex]);\n anchor = maxIndex;\n }\n\n sampled.push(data[n - 1]);\n return sampled;\n}\n","/**\n * Internal `equal` fn helpers shared by the chart graph's bespoke\n * cascade guards. Each helper is two-line trivial; the bespoke fns on\n * heterogeneous shapes (axis tick rendering, layer rect/circle arrays)\n * stay inline at their call sites - this file only carries the\n * recurring shapes (numeric arrays, dimension objects).\n *\n * Not exported from `public-api.ts`. Internal to `@cngx/common/chart`.\n *\n * @internal\n */\n\nimport type { CngxChartInset, CngxChartPlotArea } from './chart-context';\nimport type { CngxChartSlotContext } from './template-slots';\n\n/**\n * Length + `Object.is` per-index equality on a readonly numeric array.\n * Used by `summaryValues` and `summary.thresholds`. Reference-equal\n * arrays short-circuit immediately.\n */\nexport function sameNumberArr(a: readonly number[], b: readonly number[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (!Object.is(a[i], b[i])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Length + `Object.is` per-index equality on any readonly array. The\n * generic sibling of {@link sameNumberArr}: `injectChartBuffer` stores the\n * pushed rows by reference, so a flush that reselects the same rows in the\n * same order yields an element-wise-identical projection even though\n * `snapshot()` allocates a fresh wrapper each call. Reference equality would\n * never fire here (the wrapper is always new); element-wise is the only\n * guard that dedups the buffer's `points` cascade.\n */\nexport function sameItemsArr<T>(a: readonly T[], b: readonly T[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (!Object.is(a[i], b[i])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Field-wise equality on the chart's `{ width, height }` dimension\n * shape. Used by the `dimensions` computed; every `ResizeObserver` tick\n * produces a fresh literal even when the numeric pair is unchanged, so\n * an `equal` fn on this signal is the foundation of the chart-graph\n * cascade short-circuit.\n */\nexport function dimensionsEqual(\n a: { width: number; height: number },\n b: { width: number; height: number },\n): boolean {\n return a.width === b.width && a.height === b.height;\n}\n\n/**\n * Field-wise equality on the chart's four-sided axis inset. The `inset`\n * computed rebuilds its literal whenever the projected axis set\n * re-emits, so without this guard an unchanged axis set would cascade\n * into the plot area and from there into both scale ranges and every\n * axis geometry on each pass.\n */\nexport function insetEqual(a: CngxChartInset, b: CngxChartInset): boolean {\n return (\n a.inlineStart === b.inlineStart &&\n a.inlineEnd === b.inlineEnd &&\n a.blockStart === b.blockStart &&\n a.blockEnd === b.blockEnd\n );\n}\n\n/**\n * Field-wise equality on the published plot rectangle. Only the four\n * corners are compared - `width`/`height` are derived from them, so an\n * equal pair of corners implies equal extents.\n */\nexport function plotAreaEqual(a: CngxChartPlotArea, b: CngxChartPlotArea): boolean {\n return a.x0 === b.x0 && a.y0 === b.y0 && a.x1 === b.x1 && a.y1 === b.y1;\n}\n\n/**\n * Field-wise equality on the slot context handed to every fallback\n * template. `small` is derived from `width`, so comparing it would be\n * redundant.\n *\n * The context is a fresh literal on every read, so without this a\n * resize that lands on the same pixel still re-renders every projected\n * loading / empty / error template.\n */\nexport function slotContextEqual(a: CngxChartSlotContext, b: CngxChartSlotContext): boolean {\n return a.width === b.width && a.height === b.height && plotAreaEqual(a.plot, b.plot);\n}\n","/**\n * Fixed-capacity FIFO ring. Once full, every `push` overwrites the oldest\n * entry - the buffer never grows past `capacity`, so a high-frequency\n * producer cannot leak memory into it. Pure TS, no signal dependency; the\n * reactive wrapper is {@link injectChartBuffer}.\n *\n * @internal - the public realtime surface is {@link injectChartBuffer};\n * consumers never touch the raw ring.\n *\n * @category common/chart/buffer\n */\nexport interface RingBuffer<T> {\n /** Append one value, evicting the oldest when at capacity. */\n push(value: T): void;\n /**\n * Append many values in order. When `values` exceeds `capacity`, only the\n * final `capacity` entries can survive, so the doomed prefix is skipped\n * rather than pushed-then-overwritten.\n */\n pushBatch(values: readonly T[]): void;\n /** Reset length to zero without re-allocating the backing store. */\n clear(): void;\n /**\n * A fresh in-order array (oldest first, newest last). Allocates on every\n * call - the caller is the cascade boundary and owns dedup.\n */\n snapshot(): readonly T[];\n /** Current element count, `0..capacity`. */\n length(): number;\n /** The fixed maximum element count. */\n readonly capacity: number;\n}\n\n/**\n * Construct a {@link RingBuffer} with a fixed `capacity`. The backing array\n * is allocated once; no growth, no per-push allocation.\n *\n * @param capacity positive integer maximum element count.\n * @throws when `capacity` is not a positive integer.\n *\n * @category common/chart/buffer\n */\nexport function createRingBuffer<T>(capacity: number): RingBuffer<T> {\n if (!Number.isInteger(capacity) || capacity <= 0) {\n throw new Error(`createRingBuffer: capacity must be a positive integer, got ${capacity}`);\n }\n\n const store = new Array<T>(capacity);\n let head = 0; // next write slot\n let size = 0;\n\n function push(value: T): void {\n store[head] = value;\n head = (head + 1) % capacity;\n if (size < capacity) {\n size++;\n }\n }\n\n function pushBatch(values: readonly T[]): void {\n const start = values.length > capacity ? values.length - capacity : 0;\n for (let i = start; i < values.length; i++) {\n push(values[i]);\n }\n }\n\n function clear(): void {\n head = 0;\n size = 0;\n }\n\n function snapshot(): readonly T[] {\n const out = new Array<T>(size);\n const oldest = (head - size + capacity) % capacity;\n for (let i = 0; i < size; i++) {\n out[i] = store[(oldest + i) % capacity];\n }\n return out;\n }\n\n function length(): number {\n return size;\n }\n\n return { push, pushBatch, clear, snapshot, length, capacity };\n}\n","import { DestroyRef, computed, inject, signal, type Signal } from '@angular/core';\n\nimport { sameItemsArr } from '../chart/equal-helpers';\nimport { downsampleLTTB } from './lttb';\nimport { createRingBuffer } from './ring-buffer';\n\n/**\n * Construction options for {@link injectChartBuffer}.\n *\n * @category common/chart/buffer\n */\nexport interface ChartBufferOptions<T> {\n /** Ring capacity - the maximum rows retained before eviction. */\n readonly capacity: number;\n /**\n * When set and the ring holds more than this many rows, `points` is\n * LTTB-downsampled to exactly this length. Omit to emit the raw window.\n */\n readonly downsampleTo?: number;\n /** Projects a row to its numeric X for the LTTB triangle area. */\n readonly xAccessor: (d: T, i: number) => number;\n /** Projects a row to its numeric Y for the LTTB triangle area. */\n readonly yAccessor: (d: T, i: number) => number;\n}\n\n/**\n * The realtime feed handle returned by {@link injectChartBuffer}. Bind\n * `points` to a chart data input; drive it from any high-frequency producer\n * via `push` / `pushBatch`.\n *\n * @category common/chart/buffer\n */\nexport interface CngxChartBuffer<T> {\n /**\n * The current (optionally downsampled) window, rAF-coalesced. Carries an\n * element-wise `equal` guard so a flush reselecting the same rows does not\n * cascade downstream.\n */\n readonly points: Signal<readonly T[]>;\n /** Append one row; schedules a flush for the next animation frame. */\n push(value: T): void;\n /** Append many rows in order; schedules a single flush. */\n pushBatch(values: readonly T[]): void;\n /** Empty the ring; the emptied window emits on the next flush. */\n clear(): void;\n /** The fixed ring capacity. */\n readonly capacity: number;\n /** Current retained row count, `0..capacity`, reflecting the last flush. */\n readonly length: Signal<number>;\n /** `true` while a flush is scheduled but not yet applied - drive a busy hint. */\n readonly pendingFlush: Signal<boolean>;\n}\n\n/**\n * Bounded, rAF-coalesced realtime feed for `<cngx-chart>`. Wraps a\n * fixed-capacity ring ({@link createRingBuffer}) with an optional LTTB\n * downsample ({@link downsampleLTTB}) and exposes the window as a `Signal`.\n *\n * Multiple `push` / `pushBatch` / `clear` calls within one animation frame\n * collapse into a single `points` emission: each mutation writes the ring\n * imperatively and schedules one `requestAnimationFrame(flush)`; the flush\n * bumps a revision signal that `points` derives from. The flush is a plain\n * callback writing a signal - not an `effect()` body - so no reactive\n * exception class is involved.\n *\n * Runs in an injection context; the rAF handle is cancelled via `DestroyRef`.\n *\n * ```typescript\n * export class Telemetry {\n * private readonly buffer = injectChartBuffer<Sample>({\n * capacity: 1000,\n * downsampleTo: 600,\n * xAccessor: (s) => s.t,\n * yAccessor: (s) => s.value,\n * });\n * protected readonly points = this.buffer.points; // -> <cngx-chart [data]>\n * onSample(s: Sample): void {\n * this.buffer.push(s);\n * }\n * }\n * ```\n *\n * @category common/chart/buffer\n */\nexport function injectChartBuffer<T>(opts: ChartBufferOptions<T>): CngxChartBuffer<T> {\n const destroyRef = inject(DestroyRef);\n const ring = createRingBuffer<T>(opts.capacity);\n\n const revision = signal(0);\n const pending = signal(false);\n let rafHandle: number | null = null;\n\n const points = computed<readonly T[]>(\n () => {\n revision();\n const snap = ring.snapshot();\n if (opts.downsampleTo === undefined || snap.length <= opts.downsampleTo) {\n return snap;\n }\n return downsampleLTTB(snap, opts.downsampleTo, opts.xAccessor, opts.yAccessor);\n },\n { equal: sameItemsArr },\n );\n\n const length = computed(() => {\n revision();\n return ring.length();\n });\n\n function flush(): void {\n rafHandle = null;\n pending.set(false);\n revision.update((n) => n + 1);\n }\n\n function scheduleFlush(): void {\n if (rafHandle !== null) {\n return;\n }\n if (typeof requestAnimationFrame !== 'function') {\n // SSR / non-browser: there is no frame to coalesce onto, so flush\n // synchronously instead of dropping the push on the floor.\n flush();\n return;\n }\n pending.set(true);\n rafHandle = requestAnimationFrame(flush);\n }\n\n function push(value: T): void {\n ring.push(value);\n scheduleFlush();\n }\n\n function pushBatch(values: readonly T[]): void {\n ring.pushBatch(values);\n scheduleFlush();\n }\n\n function clear(): void {\n ring.clear();\n scheduleFlush();\n }\n\n destroyRef.onDestroy(() => {\n if (rafHandle !== null) {\n cancelAnimationFrame(rafHandle);\n rafHandle = null;\n }\n });\n\n return {\n points,\n push,\n pushBatch,\n clear,\n capacity: opts.capacity,\n length,\n pendingFlush: pending.asReadonly(),\n };\n}\n","import { InjectionToken, type Signal } from '@angular/core';\nimport { type CngxAxisPosition, type CngxAxisType } from './axis-position';\n\n/**\n * What `<cngx-chart>` needs from an axis, and nothing more.\n *\n * Two things travel over this contract. The scale half (`position` /\n * `type` / `domain`) tells the chart which scale to build and over what\n * range of values. The geometry half (`reservation` /\n * `crossReservation`) tells it how much of the box that axis's\n * decoration needs, so the chart can shrink the plot area to fit.\n *\n * Both implementations in the library are axes in the loose sense but\n * differ in what they do: {@link CngxAxis} draws ticks, labels and a\n * title and reserves room for them; `CngxAxisDomain` draws nothing and\n * reserves nothing, existing purely to publish a scale domain. The\n * chart cannot tell them apart, which is the point - it places and\n * sizes against the contract, never against a concrete class.\n *\n * Implement it on your own directive when you need an axis the chart\n * participates with but the library does not ship: a logarithmic scale\n * publisher, an axis whose domain comes from a service, a decoration\n * you draw yourself. Provide it with `useExisting` and the chart picks\n * the directive up through its content query.\n *\n * @category common/chart/axis\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/axis/chart-axis.ts\n * @since 0.1.0\n * @relatedTo CngxAxis, CngxAxisDomain, CngxChart\n */\nexport interface CngxChartAxis {\n /** Which edge of the plot area this axis occupies. */\n readonly position: Signal<CngxAxisPosition>;\n /** Scale kind the chart builds for this axis's dimension. */\n readonly type: Signal<CngxAxisType>;\n /** Value range the scale maps from. `undefined` yields a NOOP scale. */\n readonly domain: Signal<readonly unknown[] | undefined>;\n /**\n * How far this axis's decoration extends perpendicular to its own\n * line, in viewBox user units. The chart reserves it on the side\n * {@link position} names. Return `0` to claim no room.\n */\n readonly reservation: Signal<number>;\n /**\n * How far this axis's decoration extends *along* its own line, past\n * the plot corner at either end. The chart reserves it on the two\n * sides perpendicular to {@link position}. Return `0` to claim no\n * room.\n */\n readonly crossReservation: Signal<number>;\n}\n\n/**\n * Contract token every axis provides and `<cngx-chart>` queries.\n *\n * The chart's content query resolves this rather than a concrete class,\n * so a consumer-authored axis participates in scale building and plot\n * insetting on equal terms with the ones the library ships.\n *\n * @category common/chart/axis\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/axis/chart-axis.ts\n * @since 0.1.0\n * @relatedTo CngxChartAxis, CngxAxis, CngxAxisDomain\n */\nexport const CNGX_CHART_AXIS = new InjectionToken<CngxChartAxis>('CNGX_CHART_AXIS');\n","import { inject, InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Numeric input shape every concrete scale accepts. Linear scales take\n * `number`, time scales take `Date | number`, band scales take `string`\n * or arbitrary references via {@link createBandScale}'s generic. The\n * union narrows at the layer atom (`[cngxLine]`, `[cngxBar]`, ...);\n * the chart context surface stays scale-agnostic.\n *\n * @category common/chart\n */\nexport type XScaleInput = number | Date | string;\n\n/**\n * Generic scale function shape. Maps a domain value of type `TIn` to a\n * range value (typically a pixel coordinate). Mirrors the result type\n * of every `create*Scale` factory in `@cngx/common/chart`.\n *\n * @category common/chart\n */\nexport type ScaleFn<TIn> = (v: TIn) => number;\n\n/**\n * Space reserved inside the viewBox for axis decoration, in viewBox\n * user units. Logical, not physical: `inlineStart` is the left edge in\n * an LTR writing mode. A side with no axis on it reserves `0`.\n *\n * Chart-internal. The context publishes the resulting\n * {@link CngxChartPlotArea} instead, so the rectangle is derived once\n * rather than reconstructed from the box and the inset at every reader.\n *\n * @internal\n */\nexport interface CngxChartInset {\n readonly inlineStart: number;\n readonly inlineEnd: number;\n readonly blockStart: number;\n readonly blockEnd: number;\n}\n\n/**\n * The rectangle the chart's scales map onto: the viewBox minus the\n * space reserved for axis decoration, in viewBox user units. Without\n * axes it equals the box.\n *\n * `x0`/`y0` are the top-left corner, `x1`/`y1` the bottom-right one,\n * and `width`/`height` the extents between them. Every chart child that\n * needs to know where the plot starts reads this rather than\n * subtracting an inset from the box itself - one derivation, so the\n * scales and the axis lines cannot drift apart.\n *\n * A collapsed plot (a box narrower than the room its axes need) reports\n * `width` or `height` at or below `0`. Readers guard on the extent; the\n * chart hands out its NOOP scale in the same case.\n *\n * @category common/chart\n */\nexport interface CngxChartPlotArea {\n readonly x0: number;\n readonly y0: number;\n readonly x1: number;\n readonly y1: number;\n readonly width: number;\n readonly height: number;\n}\n\n/**\n * Reactive context published by `<cngx-chart>` to its content children.\n * Layer atoms (`[cngxLine]`, `[cngxBar]`, ...) and `[cngxAxis]` inject\n * {@link CNGX_CHART_CONTEXT} to read the parent chart's scales,\n * dimensions, data length, and data array without needing a direct\n * reference to the parent class. Token is non-generic at the DI\n * boundary; layer atoms call `data<T>()` to narrow the array to their\n * own `<T>` - the single boundary cast lives inside `CngxChart`'s\n * `data<U>()` method, not at every consumer site.\n *\n * @category common/chart\n */\nexport interface CngxChartContext<TX = XScaleInput, TY = number> {\n readonly xScale: Signal<ScaleFn<TX>>;\n readonly yScale: Signal<ScaleFn<TY>>;\n readonly dimensions: Signal<{ width: number; height: number }>;\n /**\n * The plot rectangle inside the viewBox, after the room the projected\n * axes need for their decoration. The chart's own scale ranges and\n * `[cngxAxis]`'s line placement both read this single derivation, so\n * ticks always line up with marks. A chart without axes gets the full\n * box.\n */\n readonly plot: Signal<CngxChartPlotArea>;\n readonly dataLength: Signal<number>;\n /**\n * Generic-aware data accessor. Reads the chart's reactive data\n * array; the consumer's `<T>` parameter narrows the returned type\n * without a per-call cast at the consumer site. The chart performs\n * one boundary cast in its implementation.\n */\n data<T = unknown>(): readonly T[];\n /**\n * SVG-output gate (default `true`). Layer atoms wrap their own\n * `<svg:path>` / `<svg:rect>` / `<svg:circle>` emission behind\n * `@if (ctx.renderSvg())`. The chart shell drives this `false` only\n * when Canvas mode is active - an atom asks \"should I render my own\n * SVG?\", never \"what mode am I in?\".\n */\n readonly renderSvg: Signal<boolean>;\n}\n\n/**\n * Injection token consumed by every chart child (`[cngxAxis]`, layer\n * atoms, `<cngx-chart-data-table>`). `<cngx-chart>` provides itself\n * via `useExisting`; child queries narrow the generic on the consumer\n * side.\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/chart-context.ts\n * @since 0.1.0\n */\nexport const CNGX_CHART_CONTEXT = new InjectionToken<CngxChartContext>('CngxChartContext');\n\n/**\n * Inject the parent chart's reactive context. Throws a clear dev-mode\n * error when the consumer is not mounted as a content child of\n * `<cngx-chart>`. The `consumerName` argument is interpolated into the\n * error message so the consumer-class name surfaces at the call site\n * rather than a generic guard string.\n *\n * Use it from custom layer directives mounted on `<svg:g>` hosts to\n * read `plot`, the scales and `renderSvg` the same way the built-in\n * layer atoms do.\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/chart-context.ts\n * @since 0.1.0\n */\nexport function injectChartContext(consumerName: string): CngxChartContext {\n const ctx = inject(CNGX_CHART_CONTEXT, { optional: true });\n if (!ctx) {\n throw new Error(\n `${consumerName}: missing CNGX_CHART_CONTEXT - must be a content child of <cngx-chart>`,\n );\n }\n return ctx;\n}\n","import { InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Backend-agnostic geometry a layer atom publishes for rendering. A\n * discriminated union: each variant carries exactly the primitives its\n * kind needs, and nothing more. Both the SVG self-render path and the\n * Canvas renderer paint against this same shape, so a single\n * layer-authoring API drives either backend.\n *\n * Coordinates are already scale-projected (pixel space); `color` is\n * `null` when the atom defers to its CSS custom property (the SVG path\n * reads the var directly, the Canvas renderer resolves it via\n * `getComputedStyle`).\n *\n * @category common/chart/layers\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/chart-layer.ts\n * @since 0.1.0\n */\nexport type LayerGeometry =\n | {\n readonly kind: 'line' | 'area';\n readonly d: string;\n readonly color: string | null;\n readonly strokeWidth: number | string | null;\n readonly fill?: string | null;\n readonly opacity?: number | null;\n /**\n * Optional point-marker pass a mark layer emits alongside its\n * path - the scale-projected centres of the datapoints the layer\n * chooses to mark (e.g. the lone datum of a warming series). Both\n * the SVG template and the Canvas renderer paint these as small\n * filled circles in the layer's resolved colour. Absent / empty\n * when the layer draws no markers.\n */\n readonly points?: readonly { readonly cx: number; readonly cy: number }[];\n }\n | {\n readonly kind: 'bar';\n readonly rects: readonly {\n readonly x: number;\n readonly y: number;\n readonly w: number;\n readonly h: number;\n readonly color: string | null;\n }[];\n }\n | {\n readonly kind: 'scatter';\n readonly marks: readonly {\n readonly cx: number;\n readonly cy: number;\n readonly r: number;\n readonly color: string | null;\n }[];\n }\n | {\n readonly kind: 'threshold';\n readonly x1: number;\n readonly y1: number;\n readonly x2: number;\n readonly y2: number;\n readonly color: string | null;\n readonly dashed: boolean;\n }\n | {\n readonly kind: 'band';\n readonly x: number;\n readonly y: number;\n readonly w: number;\n readonly h: number;\n readonly color: string | null;\n readonly opacity: number | null;\n };\n\n/**\n * Contract every layer atom (`[cngxLine]`, `[cngxBar]`, ...) self-provides\n * via {@link CNGX_CHART_LAYER}. The chart shell and the Canvas renderer\n * read layer geometry through this token instead of scraping the DOM.\n *\n * @category common/chart/layers\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/chart-layer.ts\n * @since 0.1.0\n */\nexport interface CngxChartLayer {\n /** The layer's scale-projected geometry, cascade-guarded by an `equal` fn. */\n readonly geometry: Signal<LayerGeometry>;\n}\n\n/**\n * Injection token each layer atom provides via\n * `{ provide: CNGX_CHART_LAYER, useExisting: CngxX }`. A\n * `contentChildren(CNGX_CHART_LAYER, { descendants: true })` query on the\n * chart shell collects every mounted layer's geometry through DI.\n *\n * @category common/chart/layers\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/chart-layer.ts\n * @since 0.1.0\n * @relatedTo CngxLine, CngxArea, CngxBar, CngxScatter, CngxThreshold, CngxBand\n */\nexport const CNGX_CHART_LAYER = new InjectionToken<CngxChartLayer>('CngxChartLayer');\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectChartContext } from '../chart/chart-context';\nimport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './chart-layer';\n\n/**\n * Threshold reference atom. Renders a single horizontal `<line>` at\n * `yScale(value)` spanning the chart's full width, plus an optional\n * `<text>` label at the right edge.\n *\n * Common use: target threshold (\"budget cap\"), warning bands, or any\n * \"line at value\" reference. Always reads scales from\n * {@link CNGX_CHART_CONTEXT}.\n *\n * Attribute-selector on `<svg:g>` - see {@link CngxLine} for why.\n *\n * @category common/chart/layers\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/threshold.component.ts\n * @since 0.1.0\n * @relatedTo CngxBand, CngxChart, CngxLine\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxThreshold]',\n exportAs: 'cngxThreshold',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_LAYER, useExisting: CngxThreshold }],\n template: `\n @if (bounds(); as g) {\n @if (ctx.renderSvg()) {\n <svg:line\n class=\"cngx-threshold__line\"\n [attr.x1]=\"g.x1\"\n [attr.y1]=\"g.y\"\n [attr.x2]=\"g.x2\"\n [attr.y2]=\"g.y\"\n [style.stroke]=\"color()\"\n [attr.stroke-dasharray]=\"dashed() ? '4 3' : null\"\n />\n }\n <!--\n Outside the renderSvg gate on purpose: the canvas backend paints\n marks, never text, so gating the label on it would delete the\n label at the auto-switch threshold. Same split CngxAxis already\n makes - decoration stays SVG in both modes, only the\n volume-dependent geometry moves to canvas.\n -->\n @if (label(); as l) {\n <svg:text\n class=\"cngx-threshold__label\"\n [attr.x]=\"g.x2 - 4\"\n [attr.y]=\"g.y - 4\"\n text-anchor=\"end\"\n >\n {{ l }}\n </svg:text>\n }\n }\n `,\n styles: [\n `\n .cngx-threshold__line {\n stroke: var(--cngx-threshold-color, var(--cngx-chart-danger, currentColor));\n stroke-width: var(--cngx-threshold-stroke-width, 1px);\n fill: none;\n animation: cngx-threshold-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n .cngx-threshold__label {\n fill: var(--cngx-threshold-text-color, var(--cngx-chart-danger, currentColor));\n font-size: var(--cngx-threshold-font-size, 11px);\n unicode-bidi: var(--cngx-chart-numeric-bidi, isolate);\n animation: cngx-threshold-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n @keyframes cngx-threshold-enter {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .cngx-threshold__line,\n .cngx-threshold__label {\n animation: none;\n }\n }\n /* forced-colors (WHCM): Chromium keeps author stroke and fill inside\n SVG (preserve-parent-color). The line and its label follow the user\n palette; [dashed] keeps its dash. A threshold is no legend entry and\n not a series, its label names it. !important beats the inline\n [style.stroke] of the [color] input. */\n @media (forced-colors: active) {\n .cngx-threshold__line {\n stroke: CanvasText !important;\n }\n .cngx-threshold__label {\n fill: CanvasText;\n }\n }\n `,\n ],\n})\nexport class CngxThreshold implements CngxChartLayer {\n readonly value = input.required<number>();\n readonly label = input<string | null>(null);\n readonly dashed = input<boolean>(false);\n readonly color = input<string | null>(null);\n\n protected readonly ctx = injectChartContext('CngxThreshold');\n\n protected readonly bounds = computed<{ x1: number; x2: number; y: number } | null>(\n () => {\n // Spans the plot, not the box - a threshold line running under\n // the left axis's tick labels reads as a stray rule through the\n // gutter rather than as a level on the chart.\n const { x0, x1, width, height } = this.ctx.plot();\n if (width <= 0 || height <= 0) {\n return null;\n }\n const y = this.ctx.yScale()(this.value());\n return { x1: x0, x2: x1, y };\n },\n {\n equal: (a, b) =>\n a === b || (a !== null && b !== null && a.x1 === b.x1 && a.x2 === b.x2 && a.y === b.y),\n },\n );\n\n readonly geometry = computed<LayerGeometry>(\n () => {\n const b = this.bounds();\n const y = b?.y ?? 0;\n return {\n kind: 'threshold',\n x1: b?.x1 ?? 0,\n y1: y,\n x2: b?.x2 ?? 0,\n y2: y,\n color: this.color(),\n dashed: this.dashed(),\n };\n },\n { equal: thresholdGeomEqual },\n );\n}\n\n/** @internal */\nfunction thresholdGeomEqual(a: LayerGeometry, b: LayerGeometry): boolean {\n if (a === b) {\n return true;\n }\n if (a.kind !== 'threshold' || b.kind !== 'threshold') {\n return false;\n }\n return (\n a.x1 === b.x1 &&\n a.y1 === b.y1 &&\n a.x2 === b.x2 &&\n a.y2 === b.y2 &&\n a.color === b.color &&\n a.dashed === b.dashed\n );\n}\n","import { numberFormatterFor } from '@cngx/core/utils';\n\nconst FRACTION_OPTIONS: Intl.NumberFormatOptions = {\n maximumSignificantDigits: 12,\n useGrouping: false,\n};\n\nconst INTEGER_OPTIONS: Intl.NumberFormatOptions = {\n maximumFractionDigits: 0,\n useGrouping: false,\n};\n\n/**\n * Strip floating-point arithmetic noise from a number destined for\n * human-facing text and format it in `locale`: `6.6000000000000005`\n * becomes `'6.6'` (`'6,6'` in `de`), `2.2` stays `'2.2'`, `25` stays\n * `'25'`. 12 significant digits keep every sensible chart value intact\n * while collapsing the trailing 1e-15 noise accumulated float math\n * produces; integers keep every digit. No grouping, so en-US output\n * matches the plain `String(v)` it replaced for every value `String`\n * prints without an exponent; exponential magnitudes print positionally\n * instead (`1e-7` -> `0.0000001`, `1e21` -> 22 digits). Non-finite values\n * format in `locale` too (`∞`, `-∞`, `NaN`), never as the English\n * `Infinity`.\n *\n * Shared by the default axis tick formatter, the default i18n summary\n * and the SR data table, so all three read the same value the same way.\n *\n * @internal\n */\nexport function formatChartNumber(v: number, locale: string): string {\n const options = Number.isInteger(v) ? INTEGER_OPTIONS : FRACTION_OPTIONS;\n // Intl prints -0 as \"-0\"; String(-0) is \"0\".\n return numberFormatterFor(locale, options).format(v === 0 ? 0 : v);\n}\n","import type { CngxMessage } from '@cngx/core/i18n';\n\n/**\n * The chart section of a {@link CngxLanguagePack}: the copy of\n * `@cngx/common/chart`. Numbers reach the messages already formatted for\n * the app locale. `summary` and `stackedBarSummary` are assembled from\n * several keys, so a pack owns their words, their order and their list\n * separator.\n *\n * @category common/chart/i18n\n * @since 0.1.0\n * @relatedTo CNGX_CHART_I18N\n */\nexport interface CngxChartLanguageSection {\n /** `{trend}`, `{min}`, `{max}`, `{current}`, `{thresholds}`: the chart's accessible name. */\n readonly summary: CngxMessage;\n readonly summaryTrendUp: string;\n readonly summaryTrendDown: string;\n readonly summaryTrendFlat: string;\n /** The `{thresholds}` part of `summary` when no threshold is crossed. */\n readonly summaryNoThresholds: string;\n /** Plural on `{count}`: the `{thresholds}` part of `summary`. */\n readonly summaryThresholds: CngxMessage;\n /** Caption of the screen-reader data table. */\n readonly dataTable: string;\n /** Header of the data table's index column. */\n readonly indexColumnLabel: string;\n /** Header of the data table's value column. */\n readonly valueColumnLabel: string;\n readonly trendChangedUp: string;\n readonly trendChangedDown: string;\n readonly trendFlattened: string;\n /** `{threshold}`: announced when a threshold is crossed. */\n readonly thresholdAlert: CngxMessage;\n readonly connectionLost: string;\n readonly connectionReconnecting: string;\n readonly connectionRestored: string;\n readonly empty: string;\n readonly loading: string;\n readonly error: string;\n /** Accessible name of a stacked bar with no segments. */\n readonly stackedBarEmpty: string;\n /** `{total}`, `{segments}`: accessible name of a stacked bar. */\n readonly stackedBarSummary: CngxMessage;\n /** `{label}`, `{value}`: one stacked-bar segment, in its tooltip and in the summary. */\n readonly stackedBarSegmentTitle: CngxMessage;\n /** Joins the segments of `stackedBarSummary`. */\n readonly listSeparator: string;\n}\n\n/**\n * The English chart section: the single source of the chart's English copy.\n * `CNGX_CHART_I18N` defaults to it.\n *\n * @category common/chart/i18n\n * @since 0.1.0\n * @relatedTo CNGX_CHART_I18N\n */\nexport const CNGX_CHART_LANGUAGE_EN: CngxChartLanguageSection = {\n summary: '{trend}. Min {min}, max {max}, current {current}. {thresholds}',\n summaryTrendUp: 'Trending up',\n summaryTrendDown: 'Trending down',\n summaryTrendFlat: 'Flat',\n summaryNoThresholds: 'No thresholds.',\n summaryThresholds: { one: 'One threshold crossing.', other: '{count} threshold crossings.' },\n dataTable: 'Data table',\n indexColumnLabel: '#',\n valueColumnLabel: 'Value',\n trendChangedUp: 'Trend changed to up',\n trendChangedDown: 'Trend changed to down',\n trendFlattened: 'Trend flattened',\n thresholdAlert: 'Threshold {threshold} crossed',\n connectionLost: 'Connection lost',\n connectionReconnecting: 'Reconnecting',\n connectionRestored: 'Connection restored',\n empty: 'No data',\n loading: 'Loading',\n error: 'Error loading chart',\n stackedBarEmpty: 'Empty stacked bar',\n stackedBarSummary: 'Total {total}. {segments}.',\n stackedBarSegmentTitle: '{label}: {value}',\n listSeparator: ', ',\n};\n\ndeclare module '@cngx/core/i18n' {\n interface CngxLanguagePack {\n readonly chart: CngxChartLanguageSection;\n }\n}\n","import { inject, InjectionToken, type Provider, type Signal } from '@angular/core';\nimport { createLanguageSection, createSectionBundle, formatMessage } from '@cngx/core/i18n';\nimport { createOverrideMerge } from '@cngx/core/utils';\n\nimport { formatChartNumber } from '../chart/format-number';\nimport { CNGX_CHART_LANGUAGE_EN, type CngxChartLanguageSection } from './chart-language-section';\n\n/**\n * Summary input describing the chart's current data shape. Consumed by\n * `CngxChartI18n.summary()` to produce the `aria-label` text the\n * `<cngx-chart>` host announces to screen readers.\n *\n * @category common/chart/i18n\n */\nexport interface CngxChartSummary {\n readonly trend: 'up' | 'down' | 'flat';\n readonly min: number;\n readonly max: number;\n readonly current: number;\n readonly thresholds: readonly number[];\n}\n\n/**\n * i18n surface for `@cngx/common/chart`. Mirrors the `CNGX_RECYCLER_I18N`\n * shape from `@cngx/common/data` - factory defaults supply English;\n * consumers override per-app via {@link provideChartI18n}.\n *\n * @category common/chart/i18n\n */\nexport interface CngxChartI18n {\n readonly summary: (input: CngxChartSummary) => string;\n readonly dataTable: () => string;\n /**\n * Header of the data table's index column. Optional so pre-existing full\n * overrides keep compiling; English `#`.\n */\n readonly indexColumnLabel?: () => string;\n readonly valueColumnLabel: () => string;\n readonly trendChanged: (trend: 'up' | 'down' | 'flat') => string;\n readonly thresholdAlert: (threshold: number) => string;\n readonly connectionLost: () => string;\n readonly connectionReconnecting: () => string;\n readonly connectionRestored: () => string;\n readonly empty: () => string;\n readonly loading: () => string;\n readonly error: () => string;\n /**\n * Accname for a `<cngx-stacked-bar>` with no segments. Optional so\n * pre-existing full overrides keep compiling; the token factory\n * supplies English and the component falls back to its built-in\n * phrasing when a custom override omits the key.\n */\n readonly stackedBarEmpty?: () => string;\n /**\n * Auto-generated accname for a `<cngx-stacked-bar>`: the total plus\n * one label/value pair per segment. Optional for the same\n * compatibility reason as {@link CngxChartI18n.stackedBarEmpty}.\n */\n readonly stackedBarSummary?: (\n total: number,\n segments: readonly { readonly label: string; readonly value: number }[],\n ) => string;\n /**\n * Tooltip of one stacked-bar segment. Receives the segment label and its\n * value, already formatted for the app locale. Optional for the same\n * compatibility reason as {@link CngxChartI18n.stackedBarEmpty}; English\n * `label: value`.\n */\n readonly stackedBarSegmentTitle?: (label: string, value: string) => string;\n}\n\ntype ChartTrend = CngxChartSummary['trend'];\n\n/** @internal The section word for each trend in the summary sentence. */\nconst SUMMARY_TREND_KEY = {\n up: 'summaryTrendUp',\n down: 'summaryTrendDown',\n flat: 'summaryTrendFlat',\n} as const satisfies Record<ChartTrend, keyof CngxChartLanguageSection>;\n\n/** @internal The section phrase announced when the trend changes. */\nconst TREND_CHANGED_KEY = {\n up: 'trendChangedUp',\n down: 'trendChangedDown',\n flat: 'trendFlattened',\n} as const satisfies Record<ChartTrend, keyof CngxChartLanguageSection>;\n\n/** @internal Turns a chart section into the token's keys for a locale. */\nfunction chartBundleFrom(\n section: CngxChartLanguageSection,\n locale: string,\n): Required<CngxChartI18n> {\n const num = (v: number): string => formatChartNumber(v, locale);\n const segmentTitle = (label: string, value: string): string =>\n formatMessage(section.stackedBarSegmentTitle, { label, value }, locale);\n return {\n summary: ({ trend, min, max, current, thresholds }) => {\n const trendText = section[SUMMARY_TREND_KEY[trend]];\n const thresholdText =\n thresholds.length === 0\n ? section.summaryNoThresholds\n : formatMessage(section.summaryThresholds, { count: thresholds.length }, locale);\n return formatMessage(\n section.summary,\n {\n trend: trendText,\n min: num(min),\n max: num(max),\n current: num(current),\n thresholds: thresholdText,\n },\n locale,\n );\n },\n dataTable: () => section.dataTable,\n indexColumnLabel: () => section.indexColumnLabel,\n valueColumnLabel: () => section.valueColumnLabel,\n trendChanged: (trend) => section[TREND_CHANGED_KEY[trend]],\n thresholdAlert: (threshold) =>\n formatMessage(section.thresholdAlert, { threshold: num(threshold) }, locale),\n connectionLost: () => section.connectionLost,\n connectionReconnecting: () => section.connectionReconnecting,\n connectionRestored: () => section.connectionRestored,\n empty: () => section.empty,\n loading: () => section.loading,\n error: () => section.error,\n stackedBarEmpty: () => section.stackedBarEmpty,\n stackedBarSummary: (total, segments) =>\n formatMessage(\n section.stackedBarSummary,\n {\n total: num(total),\n segments: segments\n .map((s) => segmentTitle(s.label, num(s.value)))\n .join(section.listSeparator),\n },\n locale,\n ),\n stackedBarSegmentTitle: segmentTitle,\n };\n}\n\n/**\n * The default chart copy for one section and one number locale - the single\n * source every fallback path resolves against. Numbers inside the copy\n * (summary min / max / current, threshold, stacked-bar values) format in\n * `locale`; the words come from `section`.\n *\n * @internal\n */\nexport const createChartI18nDefaults = chartBundleFrom;\n\n/** @internal The English chart section with the active pack's chart section on top. */\nconst injectChartSection = createLanguageSection('chart', CNGX_CHART_LANGUAGE_EN);\n\n/** @internal Builds and reads the token, formatted for the reading locale. */\nconst chartBundle = createSectionBundle<CngxChartLanguageSection, CngxChartI18n>({\n section: injectChartSection,\n toBundle: chartBundleFrom,\n});\n\n/**\n * Injection token for chart i18n strings, a `Signal` so the copy follows a\n * runtime language switch. Defaults to English via `factory:`, with numbers\n * in the root app locale (`CNGX_LOCALE`, falling back to `LOCALE_ID`), read\n * live. Override at app root with {@link provideChartI18n}; every key left\n * at its default still follows the app locale at the use site, including a\n * runtime `CNGX_LOCALE` flip.\n *\n * @category common/chart/i18n\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/i18n/chart-i18n.ts\n * @since 0.1.0\n */\nexport const CNGX_CHART_I18N = new InjectionToken<Signal<CngxChartI18n>>('CngxChartI18n', {\n providedIn: 'root',\n factory: () => chartBundle.build(),\n});\n\n/**\n * Branded feature-fn for {@link provideChartI18n}.\n *\n * @category common/chart/i18n\n */\nexport type CngxChartI18nFeature = ((bundle: Signal<CngxChartI18n>) => Signal<CngxChartI18n>) & {\n readonly _target: 'i18n';\n};\n\n/** @internal */\nfunction defineChartI18nFeature(\n fn: (bundle: Signal<CngxChartI18n>) => Signal<CngxChartI18n>,\n): CngxChartI18nFeature {\n return Object.assign(fn, { _target: 'i18n' as const });\n}\n\n/**\n * Override chart copy via a partial bundle - unset keys keep the language\n * pack's copy, or the English default, and keep following the app locale.\n * Pass a `Signal` to switch the language at runtime.\n *\n * @category common/chart/i18n\n */\nexport function withChartI18nLabels(\n overrides: Partial<CngxChartI18n> | Signal<Partial<CngxChartI18n>>,\n): CngxChartI18nFeature {\n return defineChartI18nFeature((bundle) => createOverrideMerge(bundle, overrides));\n}\n\n/**\n * Provider for the chart i18n bundle. The features apply on top of the\n * active language pack, so a consumer localises only the keys they care\n * about; every key left out keeps the pack's copy and follows the app locale.\n *\n * ```typescript\n * providers: [\n * provideChartI18n(\n * withChartI18nLabels({\n * dataTable: () => 'Datentabelle',\n * }),\n * ),\n * ]\n * ```\n *\n * @category common/chart/i18n\n */\nexport function provideChartI18n(...features: readonly CngxChartI18nFeature[]): Provider {\n return {\n provide: CNGX_CHART_I18N,\n useFactory: (): Signal<CngxChartI18n> => chartBundle.build(features),\n };\n}\n\n/**\n * @internal - the chart i18n bundle for the reading site. Every key the\n * token value leaves out, or leaves at its default, follows the use site's\n * pack section and locale; a key the consumer set stays theirs verbatim.\n * One signal per (token value, pack section, locale), shared by every chart\n * part under one injector.\n */\nexport function injectChartI18n(): Signal<Required<CngxChartI18n>> {\n // resolve() fills every key the value leaves out from the complete section bundle.\n return chartBundle.resolve(inject(CNGX_CHART_I18N)) as Signal<Required<CngxChartI18n>>;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectLocale, nextUid } from '@cngx/core/utils';\nimport { injectChartI18n } from '../i18n/chart-i18n';\nimport { formatChartNumber } from './format-number';\n\n/**\n * Internal SR-only data-table view. The parent `<cngx-chart>` mounts\n * one of these and links it via `aria-describedby`\n * (`chart.component.ts`), and that link never disappears from the host.\n * The element is always visually SR-only (the clip/offscreen host\n * styles below), so nothing about it ever paints. What toggles is its\n * accessibility-tree visibility: the chart binds the `hidden` input\n * (`chart.component.ts`) from its `tableActive` predicate and\n * `activeView`, and the host maps that input to `[attr.aria-hidden]`.\n * This is the Pillar-2 always-in-DOM contract: the `aria-describedby`\n * id stays referenced whether or not the table is exposed to AT; only\n * `aria-hidden` flips.\n *\n * The current surface is single-column (\"Value\") backed by the chart's\n * `summary`-projected numeric values; the column header derivation is\n * intentionally minimal, and may later widen to one column per layer\n * accessor.\n *\n * @internal\n */\n@Component({\n selector: 'cngx-chart-data-table',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n '[id]': 'resolvedId()',\n '[attr.aria-hidden]': 'hidden() ? \"true\" : \"false\"',\n },\n template: `\n <table class=\"cngx-chart-data-table__table\">\n <caption>\n {{\n caption()\n }}\n </caption>\n <thead>\n <tr>\n <th scope=\"col\">{{ indexColumnLabel() }}</th>\n <th scope=\"col\">{{ valueColumnLabel() }}</th>\n </tr>\n </thead>\n <tbody>\n @for (row of rows(); track row.index) {\n <tr>\n <th scope=\"row\">{{ fmt()(row.index + 1) }}</th>\n <td>{{ fmt()(row.value) }}</td>\n </tr>\n }\n </tbody>\n </table>\n `,\n styles: [\n `\n cngx-chart-data-table {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n }\n `,\n ],\n})\nexport class CngxChartDataTable {\n readonly values = input.required<readonly number[]>();\n readonly hidden = input.required<boolean>();\n /**\n * Stable id consumed by the chart's `aria-describedby` binding.\n * Optional input - when omitted, falls back to a per-instance\n * `nextUid`-allocated default. Two standalone tables without an\n * explicit `[id]` therefore receive different ids; the always-in-\n * DOM rule cannot be violated by an unset input.\n */\n readonly id = input<string | undefined>(undefined);\n\n private readonly defaultId = nextUid('cngx-chart-data-table');\n private readonly i18n = injectChartI18n();\n private readonly locale = injectLocale();\n\n /**\n * Resolved host id - the explicit `[id]` input wins over the\n * per-instance default. The host binding reads this signal so\n * external `aria-describedby` references stay live across input\n * changes.\n */\n protected readonly resolvedId = computed(() => this.id() ?? this.defaultId);\n\n protected readonly caption = computed(() => this.i18n().dataTable());\n protected readonly indexColumnLabel = computed(() => this.i18n().indexColumnLabel());\n protected readonly valueColumnLabel = computed(() => this.i18n().valueColumnLabel());\n\n /** Noise-stripped display text in the app locale - see {@link formatChartNumber}. */\n protected readonly fmt = computed(() => {\n const locale = this.locale();\n return (v: number): string => formatChartNumber(v, locale);\n });\n\n protected readonly rows = computed<readonly { index: number; value: number }[]>(\n () => {\n const vs = this.values();\n const out = new Array<{ index: number; value: number }>(vs.length);\n for (let i = 0; i < vs.length; i++) {\n out[i] = { index: i, value: vs[i] };\n }\n return out;\n },\n {\n equal: (a, b) => {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i].index !== b[i].index || !Object.is(a[i].value, b[i].value)) {\n return false;\n }\n }\n return true;\n },\n },\n );\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\nimport type { CngxChartPlotArea } from './chart-context';\n\n/**\n * Common context shape passed into every chart slot template\n * (loading, empty, error). Carries the chart's current rendered\n * dimensions plus a `small` discriminator so consumers can switch\n * between a compact and a richer fallback in the same template:\n *\n * ```html\n * <ng-template cngxChartEmpty let-small=\"small\">\n * @if (small) {\n * <span class=\"cngx-empty-compact\">No data</span>\n * } @else {\n * <cngx-empty-state title=\"No telemetry yet\" description=\"...\" />\n * }\n * </ng-template>\n * ```\n *\n * The `small` flag is true when the chart's rendered width is below\n * the exported `CHART_SMALL_BREAKPOINT_PX` constant (400).\n * Container-size based, not viewport-based, so it works correctly\n * inside dashboard cells of any size.\n *\n * @category common/chart\n */\nexport interface CngxChartSlotContext {\n readonly width: number;\n readonly height: number;\n readonly small: boolean;\n /**\n * The rectangle the chart's marks occupy: the viewBox minus the room\n * the projected axes reserved for their decoration. Without axes it\n * equals the box.\n *\n * Slot templates paint over the chart, and since the axis gutter\n * landed the box is no longer the drawing surface - a fallback\n * centred on `width`/`height` sits off-centre from the marks it\n * replaces. Align to this instead when the fallback should line up\n * with the plot rather than with the host.\n *\n * In viewBox user units. `width`/`height` above stay the *rendered*\n * host size, so the two are in different spaces whenever an explicit\n * `[width]` chart is squeezed; use the `--cngx-chart-plot-*` custom\n * properties for CSS-side alignment, which are resolution-independent.\n */\n readonly plot: CngxChartPlotArea;\n}\n\n/**\n * Threshold (px) below which `CngxChartSlotContext.small` is true.\n * Hardcoded for v1; later releases may make this a config token.\n *\n * @category common/chart\n */\nexport const CHART_SMALL_BREAKPOINT_PX = 400;\n\n/**\n * Per-instance loading slot for `<cngx-chart>`. Project an\n * `<ng-template cngxChartLoading>` to override the default centred\n * spinner. The template receives a {@link CngxChartSlotContext} with\n * the chart's rendered width/height plus a `small` flag for\n * container-size-aware branching.\n *\n * ```html\n * <cngx-chart [state]=\"state()\">\n * <ng-template cngxChartLoading let-small=\"small\">\n * @if (small) { <my-mini-spinner /> }\n * @else { <my-branded-spinner /> }\n * </ng-template>\n * </cngx-chart>\n * ```\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts\n * @since 0.1.0\n * @relatedTo CngxChartSlotContext, CngxChartEmpty, CngxChartError, CngxChart\n */\n@Directive({\n selector: 'ng-template[cngxChartLoading]',\n standalone: true,\n})\nexport class CngxChartLoading {\n readonly templateRef = inject(TemplateRef<CngxChartSlotContext>);\n}\n\n/**\n * Per-instance empty slot for `<cngx-chart>`. Receives a\n * {@link CngxChartSlotContext} so the consumer can branch on chart\n * size - typically a compact text fallback when `small` is true and\n * a richer surface (`<cngx-empty-state>`, illustration, action) at\n * regular sizes.\n *\n * ```html\n * <cngx-chart [state]=\"state()\">\n * <ng-template cngxChartEmpty let-small=\"small\" let-plot=\"plot\">\n * <span>No readings in this range ({{ plot.width }} wide)</span>\n * </ng-template>\n * </cngx-chart>\n * ```\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts\n * @since 0.1.0\n * @relatedTo CngxChartSlotContext, CngxChartLoading, CngxChartError, CngxChart\n */\n@Directive({\n selector: 'ng-template[cngxChartEmpty]',\n standalone: true,\n})\nexport class CngxChartEmpty {\n readonly templateRef = inject(TemplateRef<CngxChartSlotContext>);\n}\n\n/**\n * Context for the `*cngxChartError` slot template. Extends the\n * common slot context with the live error value via `$implicit` and\n * `error` keys, so consumers can render a typed message AND branch\n * on chart size.\n *\n * @category common/chart\n */\nexport interface CngxChartErrorContext extends CngxChartSlotContext {\n readonly $implicit: unknown;\n readonly error: unknown;\n}\n\n/**\n * `*cngxChartError` slot - overrides the chart-level error placeholder.\n * Receives a {@link CngxChartErrorContext}.\n *\n * ```html\n * <cngx-chart [state]=\"state()\">\n * <ng-template cngxChartError let-error let-small=\"small\">\n * <span>Could not load: {{ error?.message }}</span>\n * </ng-template>\n * </cngx-chart>\n * ```\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts\n * @since 0.1.0\n * @relatedTo CngxChartErrorContext, CngxChartLoading, CngxChartEmpty, CngxChart\n */\n@Directive({\n selector: 'ng-template[cngxChartError]',\n standalone: true,\n})\nexport class CngxChartError {\n readonly templateRef = inject(TemplateRef<CngxChartErrorContext>);\n}\n\n/**\n * Context for the connection-lifecycle slots (`*cngxChartConnectionError`,\n * `*cngxChartReconnecting`). Extends the common slot context with the live\n * connection error value via `$implicit` / `error`, mirroring\n * {@link CngxChartErrorContext}. The connection channel is separate from\n * the data `[state]` channel, so this context reflects `[connectionState]`.\n *\n * @category common/chart\n */\nexport interface CngxChartConnectionContext extends CngxChartSlotContext {\n readonly $implicit: unknown;\n readonly error: unknown;\n}\n\n/**\n * `*cngxChartConnectionError` slot - overrides the default banner shown\n * when `[connectionState]` reports `'error'` (connection lost). Overlaid on\n * top of the data view with `role=\"alert\"`; receives a\n * {@link CngxChartConnectionContext}.\n *\n * ```html\n * <cngx-chart [connectionState]=\"socket\">\n * <ng-template cngxChartConnectionError let-error>\n * <span>Live feed lost: {{ error?.message }}</span>\n * </ng-template>\n * </cngx-chart>\n * ```\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts\n * @since 0.1.0\n * @relatedTo CngxChartConnectionContext, CngxChartReconnecting, CngxChart\n */\n@Directive({\n selector: 'ng-template[cngxChartConnectionError]',\n standalone: true,\n})\nexport class CngxChartConnectionError {\n readonly templateRef = inject(TemplateRef<CngxChartConnectionContext>);\n}\n\n/**\n * `*cngxChartReconnecting` slot - overrides the default subtle indicator\n * shown when `[connectionState]` reports `'refreshing'` (reconnecting).\n * Overlaid with `role=\"status\"` (polite); receives a\n * {@link CngxChartConnectionContext}.\n *\n * ```html\n * <cngx-chart [connectionState]=\"socket\">\n * <ng-template cngxChartReconnecting let-small=\"small\">\n * <span>{{ small ? 'Reconnecting' : 'Reconnecting to the live feed' }}</span>\n * </ng-template>\n * </cngx-chart>\n * ```\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts\n * @since 0.1.0\n * @relatedTo CngxChartConnectionContext, CngxChartConnectionError, CngxChart\n */\n@Directive({\n selector: 'ng-template[cngxChartReconnecting]',\n standalone: true,\n})\nexport class CngxChartReconnecting {\n readonly templateRef = inject(TemplateRef<CngxChartConnectionContext>);\n}\n\n/**\n * `*cngxChartOverlay` slot - projects HTML *on top of the marks*, inside\n * the plot area. Unlike the loading / empty / error slots (which replace\n * the marks in their respective fallback arms), the overlay renders in the\n * `@default` content arm alongside the drawn chart, so it is where\n * crosshair readouts, hover tooltips, annotation callouts and brush\n * affordances belong.\n *\n * The chart positions the overlay frame itself, inset to the plot area via\n * the `--cngx-chart-plot-*` custom properties it already publishes - the\n * consumer performs no `exportAs`, no `plot()` / `dimensions()` arithmetic,\n * and needs no wrapper of their own to act as a containing block. Receives\n * the shared {@link CngxChartSlotContext}, so `plot` / `width` / `height` /\n * `small` are all readable from the template:\n *\n * ```html\n * <cngx-chart [data]=\"series()\" [width]=\"480\" [height]=\"200\">\n * <svg:g cngxAxis position=\"left\" type=\"linear\" [domain]=\"[0, 100000]\"></svg:g>\n * <svg:g cngxLine></svg:g>\n * <ng-template cngxChartOverlay let-plot=\"plot\">\n * <div class=\"my-callout\">{{ plot.width }}x{{ plot.height }} plot</div>\n * </ng-template>\n * </cngx-chart>\n * ```\n *\n * Pointer events: the frame is `pointer-events: none`, so it never\n * intercepts a click, hover or drag meant for the marks beneath it. An\n * interactive element inside the overlay opts back in per element with\n * `pointer-events: auto`. The default is off deliberately - an overlay\n * that silently swallows every pointer event on the chart is invisible\n * until some other interaction (a tooltip, a brush) stops firing, and\n * that is a debugging session; opting a single element back in is one\n * declaration.\n *\n * Accessibility: the chart host is `role=\"img\"` with an auto-summary\n * `aria-label`, so assistive technology sees the chart as a single\n * labelled graphic and never traverses into the overlay. Treat overlay\n * content as *visual* - a hover readout, a tint, an annotation callout.\n * Any state that has to reach AT belongs on the reactive summary or the\n * SR data-table (the `aria-describedby` channel the chart already owns),\n * not on an element projected here.\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/template-slots.ts\n * @since 0.1.0\n * @relatedTo CngxChartSlotContext, CngxChartLoading, CngxChartEmpty, CngxChartError, CngxChart\n */\n@Directive({\n selector: 'ng-template[cngxChartOverlay]',\n standalone: true,\n})\nexport class CngxChartOverlay {\n readonly templateRef = inject(TemplateRef<CngxChartSlotContext>);\n}\n","/**\n * Shared numeric helpers for the chart presets and the auto-summary.\n * Pure TS, no Angular dep, only the Level-0 `clamp` kernel imported -\n * which is why it lives in the core `chart/` folder: presets compose\n * `chart/`, so a helper both sides consume must not sit in `presets/`.\n * Internal - the presets and the summary are the API surface.\n */\n\nimport { clamp } from '@cngx/utils';\n\n/**\n * Single-pass min/max scan. Returns `null` for an empty input so the\n * caller decides its own fallback domain.\n *\n * @internal\n */\nexport function scanMinMax(values: readonly number[]): { min: number; max: number } | null {\n if (values.length === 0) {\n return null;\n }\n let min = values[0];\n let max = values[0];\n for (let i = 1; i < values.length; i++) {\n const v = values[i];\n if (v < min) {\n min = v;\n }\n if (v > max) {\n max = v;\n }\n }\n return { min, max };\n}\n\n/**\n * Positional x-domain for an index-keyed preset series: `[0, n - 1]`,\n * falling back to `[0, 1]` below two points so the scale never\n * degenerates to a zero-width domain.\n *\n * @internal\n */\nexport function presetIndexDomain(length: number): readonly number[] {\n return length < 2 ? [0, 1] : [0, length - 1];\n}\n\n/**\n * Value y-domain for a preset series: `[min, max]` of the data, padded\n * to `[v - 1, v + 1]` when the series is flat (a zero-height domain\n * would collapse the scale) and `[0, 1]` when it is empty.\n *\n * @internal\n */\nexport function presetValueDomain(values: readonly number[]): readonly number[] {\n const scan = scanMinMax(values);\n if (scan === null) {\n return [0, 1];\n }\n if (scan.min === scan.max) {\n return [scan.min - 1, scan.max + 1];\n }\n return [scan.min, scan.max];\n}\n\n/**\n * Position of `value` inside `[min, max]` as a ratio clamped to\n * `[0, 1]`. A degenerate range (`max <= min`) yields `0` - every\n * preset renders an empty fill rather than dividing by zero.\n *\n * @internal\n */\nexport function clampedRatio(value: number, min: number, max: number): number {\n if (max <= min) {\n return 0;\n }\n return clamp((value - min) / (max - min), 0, 1);\n}\n","import type { CngxChartSummary } from '../i18n/chart-i18n';\nimport { scanMinMax } from './preset-math';\n\n/**\n * Pure helper that derives a `CngxChartSummary` from already-projected\n * numeric values plus a list of threshold values. The chart component\n * passes the result to `CngxChartI18n.summary()` to produce the\n * `aria-label` text the host announces to screen readers.\n *\n * Trend rule: if the last value is more than 5% of the data's range\n * above the first, the trend is `'up'`; below, `'down'`; otherwise\n * `'flat'`. The 5% deadband prevents trivial fluctuations from\n * flipping the trend label and keeps the summary stable across\n * minor data refreshes.\n *\n * Threshold rule: a threshold is \"crossed\" if the data series goes\n * from above to below or vice versa anywhere in the projected range.\n * The returned `thresholds` list is the subset of input thresholds\n * the data actually crosses, in input order.\n *\n * @internal\n */\nexport function computeChartSummary(\n values: readonly number[],\n thresholds: readonly number[],\n): CngxChartSummary {\n const scan = scanMinMax(values);\n if (scan === null) {\n return { trend: 'flat', min: 0, max: 0, current: 0, thresholds: [] };\n }\n const { min, max } = scan;\n const first = values[0];\n const current = values[values.length - 1];\n const range = max - min;\n const deadband = range * 0.05;\n const delta = current - first;\n const trend: 'up' | 'down' | 'flat' =\n delta > deadband ? 'up' : delta < -deadband ? 'down' : 'flat';\n const crossed = thresholds.filter((t) => crossesThreshold(values, t));\n return { trend, min, max, current, thresholds: crossed };\n}\n\n/** @internal */\nfunction crossesThreshold(values: readonly number[], threshold: number): boolean {\n let above = values[0] > threshold;\n for (let i = 1; i < values.length; i++) {\n const nowAbove = values[i] > threshold;\n if (nowAbove !== above) {\n return true;\n }\n above = nowAbove;\n }\n return false;\n}\n","import { computed, linkedSignal, type Signal } from '@angular/core';\n\nimport { type CngxChartSummary } from '../i18n/chart-i18n';\n\n/** @internal */\ntype Trend = 'up' | 'down' | 'flat';\n\n/**\n * A significant, AT-worthy transition derived from the chart summary:\n * either the trend flipped, or the current value crossed a threshold.\n * A discriminated union - each variant carries exactly its own fields.\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/significant-change.ts\n * @since 0.1.0\n */\nexport type CngxSignificantChange =\n | { readonly kind: 'trend-flip'; readonly from: Trend; readonly to: Trend }\n | {\n readonly kind: 'threshold-cross';\n readonly threshold: number;\n readonly direction: 'up' | 'down';\n };\n\n/** @internal Structural equality so a re-emitted identical event does not cascade. */\nfunction significantChangeEqual(\n a: CngxSignificantChange | null,\n b: CngxSignificantChange | null,\n): boolean {\n if (a === b) {\n return true;\n }\n if (a === null || b === null) {\n return false;\n }\n if (a.kind !== b.kind) {\n return false;\n }\n if (a.kind === 'trend-flip' && b.kind === 'trend-flip') {\n return a.from === b.from && a.to === b.to;\n }\n if (a.kind === 'threshold-cross' && b.kind === 'threshold-cross') {\n return a.threshold === b.threshold && a.direction === b.direction;\n }\n return false;\n}\n\n/**\n * Derive the most recent significant transition from a chart-summary\n * signal, or `null` when the latest update carried no significance.\n *\n * Mirrors `createTransitionTracker`'s current/previous discipline: an\n * internal `linkedSignal` holds the current summary and the one before it\n * (structural-equality guarded), and the public signal is a `computed`\n * with its own structural `equal` - so a summary that re-emits an\n * equivalent shape yields the same `null` reference and never re-fires a\n * downstream effect. Threshold crossings take precedence over trend flips\n * (they are operationally more significant).\n *\n * The chart stays pure-derivation: effects that react to the event live in\n * the companion announcer, not here.\n *\n * @param summary the chart's `CngxChartSummary` signal.\n *\n * @category common/chart\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/significant-change.ts\n * @since 0.1.0\n */\nexport function createSignificantChangeTracker(\n summary: Signal<CngxChartSummary>,\n): Signal<CngxSignificantChange | null> {\n const pair = linkedSignal<\n CngxChartSummary,\n { current: CngxChartSummary; previous: CngxChartSummary | null }\n >({\n source: summary,\n computation: (current, prev) => ({ current, previous: prev?.value.current ?? null }),\n equal: (a, b) => a.current === b.current && a.previous === b.previous,\n });\n\n return computed<CngxSignificantChange | null>(\n () => {\n const { current, previous } = pair();\n if (!previous) {\n return null;\n }\n for (const threshold of current.thresholds) {\n const before = previous.current - threshold;\n const after = current.current - threshold;\n if (before !== 0 && after !== 0 && Math.sign(before) !== Math.sign(after)) {\n return { kind: 'threshold-cross', threshold, direction: after > 0 ? 'up' : 'down' };\n }\n }\n if (current.trend !== previous.trend) {\n return { kind: 'trend-flip', from: previous.trend, to: current.trend };\n }\n return null;\n },\n { equal: significantChangeEqual },\n );\n}\n","import { type DestroyRef, effect, linkedSignal, type Signal, untracked } from '@angular/core';\n\nimport { createMediaQuerySignal } from '@cngx/core/utils';\n\nimport { type CngxChartContext } from '../chart/chart-context';\nimport { dimensionsEqual } from '../chart/equal-helpers';\nimport { type LayerGeometry } from '../layers/chart-layer';\nimport { type CngxChartRenderer, type CngxChartRendererFactory } from './chart-renderer';\n\n/**\n * Construction dependencies for {@link createChartRendererController}.\n *\n * @category common/chart/renderer\n */\nexport interface ChartRendererControllerDeps {\n readonly host: HTMLElement;\n readonly ctx: CngxChartContext;\n readonly mode: Signal<'svg' | 'canvas'>;\n readonly geometries: Signal<readonly LayerGeometry[]>;\n readonly factory: CngxChartRendererFactory;\n readonly destroyRef: DestroyRef;\n}\n\n/**\n * Handle returned by {@link createChartRendererController}.\n *\n * @category common/chart/renderer\n */\nexport interface CngxChartRendererController {\n readonly currentMode: Signal<'svg' | 'canvas'>;\n destroy(): void;\n}\n\n/**\n * Owns the renderer mount / destroy / paint reactive lifecycle so the\n * chart shell holds no rendering brain. Installs two effects:\n *\n * - **mount** - tracks `mode()`; on change, destroys the previous backend,\n * builds the new one via `factory`, mounts it, and seeds the first paint.\n * - **paint** - tracks `geometries()`, the (structurally-deduped)\n * dimensions and the `(forced-colors: active)` /\n * `(prefers-color-scheme: dark)` media queries; repaints on every\n * geometry emission and invalidates the backend's color cache when the\n * dimensions or either media query actually change, so a contrast-theme\n * or OS colour-scheme switch repaints at once instead of after the next\n * resize.\n *\n * Both effects wrap their imperative renderer calls in `untracked()` so\n * the renderer's own signal reads never feed back into the effect graph.\n * The dimensions are tracked through a `linkedSignal` guarded by\n * {@link dimensionsEqual}, so a resize observer re-emitting the same\n * width/height literal does not trigger a redundant cache invalidation.\n *\n * Must run in an injection context (the chart shell calls it from a field\n * initialiser / constructor). Ships as a plain `create*` factory the shell\n * calls directly - no DI token, since the only second consumer today is a\n * test double, which injects a fake `factory` through the deps.\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/chart-renderer-controller.ts\n * @since 0.1.0\n */\nexport function createChartRendererController(\n deps: ChartRendererControllerDeps,\n): CngxChartRendererController {\n let current: CngxChartRenderer | null = null;\n\n // Structural-equality tracker: the resize observer re-emits a fresh\n // { width, height } literal every tick; dimensionsEqual short-circuits\n // the redundant re-paints / cache invalidations.\n const dims = linkedSignal(() => deps.ctx.dimensions(), { equal: dimensionsEqual });\n let lastDims = untracked(dims);\n\n const view = deps.host.ownerDocument.defaultView;\n const forced = createMediaQuerySignal('(forced-colors: active)', deps.destroyRef, view);\n const darkScheme = createMediaQuerySignal('(prefers-color-scheme: dark)', deps.destroyRef, view);\n let lastForced = untracked(forced);\n let lastDark = untracked(darkScheme);\n\n // Mount effect: rebuild the backend whenever the mode flips, then seed\n // the first paint (the paint effect does not track `mode`, so the fresh\n // backend would otherwise stay blank until the next geometry change).\n effect(() => {\n const mode = deps.mode();\n untracked(() => {\n current?.destroy();\n current = deps.factory(mode, {\n ctx: deps.ctx,\n destroyRef: deps.destroyRef,\n forcedColors: forced,\n });\n current.mount(deps.host, deps.ctx);\n current.paint(deps.geometries());\n });\n });\n\n // Paint effect: repaint on geometry change; invalidate the color cache\n // only when the deduped dimensions or a palette media query actually\n // changed (a palette flip re-resolves colors like a theming reflow).\n effect(() => {\n const geometries = deps.geometries();\n const nextDims = dims();\n const nextForced = forced();\n const nextDark = darkScheme();\n untracked(() => {\n const paletteChanged = nextForced !== lastForced || nextDark !== lastDark;\n if (nextDims !== lastDims || paletteChanged) {\n lastDims = nextDims;\n lastForced = nextForced;\n lastDark = nextDark;\n current?.invalidateColorCache?.();\n }\n current?.paint(geometries);\n });\n });\n\n deps.destroyRef.onDestroy(() => current?.destroy());\n\n return {\n currentMode: deps.mode,\n destroy: () => current?.destroy(),\n };\n}\n","import { type LayerGeometry } from '../layers/chart-layer';\n\n// Forced-colors support for the Canvas backend. Canvas pixels are never\n// forced by the browser, so the backend paints the system palette itself.\n// Internal: not exported from the public API.\n\n/** @internal The two system colours a forced Canvas paint uses. */\nexport interface ForcedSystemColors {\n /** `CanvasText` - every mark, stroke and ring. */\n readonly ink: string;\n /** `Canvas` - hatch gaps and hollow-mark interiors. */\n readonly canvas: string;\n}\n\n/** @internal Reads the forced system palette without touching the DOM. */\nexport interface SystemColorProbe {\n /** Resolve CanvasText / Canvas from the probe's current computed style. */\n read(): ForcedSystemColors;\n /** Detach the probe from its host. */\n remove(): void;\n}\n\n/**\n * @internal Mount a hidden probe under `host` that resolves `CanvasText` /\n * `Canvas` to concrete colours. Two child spans carry the keywords and opt\n * out with `forced-color-adjust: none`; without it a forced `color: Canvas`\n * would compute to the forced text colour. The probe lives as long as the\n * renderer, so a re-read on a palette flip is two style reads and never a\n * host mutation inside `paint()`. Falls back to the keywords when the host\n * resolves nothing (jsdom).\n */\nexport function createSystemColorProbe(host: HTMLElement): SystemColorProbe {\n const doc = host.ownerDocument;\n const root = doc.createElement('span');\n root.className = 'cngx-chart__palette-probe';\n root.setAttribute('aria-hidden', 'true');\n root.style.display = 'none';\n const swatch = (keyword: string): HTMLElement => {\n const el = doc.createElement('span');\n el.style.setProperty('forced-color-adjust', 'none');\n el.style.color = keyword;\n root.appendChild(el);\n return el;\n };\n const ink = swatch('CanvasText');\n // Lowercase on purpose: CSS keywords are case-insensitive, and the\n // capitalised form reads as copy to the user-facing string guard.\n const canvas = swatch('canvas');\n host.appendChild(root);\n return {\n read: () => ({\n ink: getComputedStyle(ink).color || 'CanvasText',\n canvas: getComputedStyle(canvas).color || 'canvas',\n }),\n remove: () => root.remove(),\n };\n}\n\n/** @internal Position of a series in the legend's four-step forced-colors cycle. */\nexport type ForcedSeriesStep = 0 | 1 | 2 | 3;\n\n/**\n * @internal Line dash per step: solid, dashed, dotted, dash-dot. Same\n * values as the `stroke-dasharray` in the line layer's forced-colors CSS.\n */\nexport const FORCED_LINE_DASHES: readonly number[][] = [[], [6, 3], [0.1, 4], [8, 3, 0.1, 3]];\n\nconst stepMemo = new WeakMap<readonly LayerGeometry[], readonly (ForcedSeriesStep | null)[]>();\n\n/**\n * @internal The forced-colors step of every geometry, `null` for the kinds\n * outside the cycle. Line, bar and scatter count, area, threshold and band\n * do not - the same rule as the SVG\n * `:nth-child(4n + k of .cngx-chart-series)` selectors. Memoised by the\n * array reference: the chart keeps the same geometries array while no\n * layer emits a new geometry, so repaints without data (resize, DPR or\n * palette flip) reuse the steps. A streaming chart gets a new array on\n * every data tick and recomputes one small array per frame.\n */\nexport function forcedSeriesSteps(\n geometries: readonly LayerGeometry[],\n): readonly (ForcedSeriesStep | null)[] {\n const cached = stepMemo.get(geometries);\n if (cached) {\n return cached;\n }\n let series = 0;\n const steps = geometries.map((g): ForcedSeriesStep | null => {\n const counts = g.kind === 'line' || g.kind === 'bar' || g.kind === 'scatter';\n if (!counts) {\n return null;\n }\n const step = (series % 4) as ForcedSeriesStep;\n series++;\n return step;\n });\n stepMemo.set(geometries, steps);\n return steps;\n}\n\n/** @internal The two hatch fills of the forced cycle; `null` where the host cannot build one. */\nexport interface ForcedHatches {\n /** Step 1: 45deg stripes. */\n readonly diagonal: CanvasPattern | null;\n /** Step 3: 0deg stripes. */\n readonly horizontal: CanvasPattern | null;\n}\n\nconst NO_HATCHES: ForcedHatches = { diagonal: null, horizontal: null };\n\n/**\n * @internal Build the hatch patterns the SVG chart draws as `<pattern>`\n * defs: a 4px tile with a 2px ink stripe on a Canvas gap (the gap keeps a\n * hatched mark readable where it overlaps another). The tile is drawn at\n * device-pixel size and scaled back through the pattern transform, so the\n * 0deg hatch maps one tile pixel to one device pixel and stays pure ink\n * and canvas on a high-DPR screen. The 45deg hatch is rotated and therefore\n * resampled; its stripe edges blend ink into canvas, as the SVG pattern's\n * do. Returns nulls when the host lacks `createPattern` or `DOMMatrix`; the\n * caller then fills with ink.\n */\nexport function createForcedHatches(\n doc: Document,\n target: CanvasRenderingContext2D,\n colors: ForcedSystemColors,\n dpr: number,\n): ForcedHatches {\n if (typeof target.createPattern !== 'function' || typeof DOMMatrix !== 'function') {\n return NO_HATCHES;\n }\n const size = Math.max(1, Math.round(4 * dpr));\n const stripe = Math.max(1, Math.round(2 * dpr));\n const tile = doc.createElement('canvas');\n tile.width = size;\n tile.height = size;\n const t = tile.getContext('2d');\n if (!t) {\n return NO_HATCHES;\n }\n t.fillStyle = colors.canvas;\n t.fillRect(0, 0, size, size);\n t.fillStyle = colors.ink;\n t.fillRect(0, 0, size, stripe);\n\n const back = 4 / size;\n const diagonal = target.createPattern(tile, 'repeat');\n diagonal?.setTransform(new DOMMatrix().scale(back).rotate(45));\n const horizontal = target.createPattern(tile, 'repeat');\n horizontal?.setTransform(new DOMMatrix().scale(back));\n return { diagonal, horizontal };\n}\n","import { type CngxChartContext } from '../chart/chart-context';\nimport { type LayerGeometry } from '../layers/chart-layer';\nimport { type ChartRendererDeps, type CngxChartRenderer } from './chart-renderer';\nimport {\n createForcedHatches,\n FORCED_LINE_DASHES,\n type ForcedHatches,\n type ForcedSeriesStep,\n forcedSeriesSteps,\n type ForcedSystemColors,\n type SystemColorProbe,\n createSystemColorProbe,\n} from './forced-series';\n\n/**\n * @internal Per-kind CSS custom-property fallback chain, resolved when a\n * geometry emits `color: null`. Mirrors each layer atom's SVG cascade\n * (`var(--cngx-<kind>-*, var(--cngx-chart-*, currentColor))`) so a\n * consumer's per-atom theming survives the SVG->Canvas crossover instead\n * of collapsing to the three chart-family colors.\n */\nconst KIND_VARS: Record<LayerGeometry['kind'], readonly string[]> = {\n line: ['--cngx-line-color', '--cngx-chart-primary'],\n area: ['--cngx-area-fill', '--cngx-chart-primary'],\n bar: ['--cngx-bar-color', '--cngx-chart-primary'],\n scatter: ['--cngx-scatter-color', '--cngx-chart-primary'],\n threshold: ['--cngx-threshold-color', '--cngx-chart-danger'],\n band: ['--cngx-band-color', '--cngx-chart-secondary'],\n};\n\n/** @internal */\nconst DEFAULT_STROKE_WIDTH = 1.5;\n/** @internal */\nconst DEFAULT_AREA_OPACITY = 0.18;\n/** @internal */\nconst DEFAULT_BAND_OPACITY = 0.12;\n/** @internal Fallback point-marker radius, matching the layers' CSS token defaults. */\nconst DEFAULT_POINT_RADIUS = 3;\n/** @internal Shared solid dash, so resetting after a dashed stroke allocates nothing. */\nconst SOLID_DASH: number[] = [];\n\n/**\n * Canvas rendering backend. Mounts a `<canvas>` absolutely positioned\n * over the chart's SVG frame and paints each {@link LayerGeometry} onto\n * its 2D context: `Path2D` stroke/fill for line/area, per-mark loops for\n * bar/scatter, `moveTo`/`lineTo` for threshold, `fillRect` for band.\n *\n * Colors resolve through a closure-local cache: the first `paint()` reads\n * each CSS custom property once via `getComputedStyle(host)`; subsequent\n * paints hit the cache, so the paint hot path performs zero synchronous\n * DOM reads. {@link CngxChartRenderer.invalidateColorCache} clears it -\n * the renderer controller calls it on a `dimensions()` change (a proxy\n * for layout / theming reflow). It never writes the chart context's\n * `renderSvg` gate; the shell owns that.\n *\n * The plot inset needs no handling here. Every geometry this backend\n * paints was derived from `ctx.xScale()` / `ctx.yScale()`, whose ranges\n * are already the inset plot area, so canvas marks land exactly where\n * SVG marks would without the renderer knowing an inset exists. Axis\n * decoration never reaches this file at all: there is no axis branch in\n * {@link KIND_VARS} and no text call anywhere in the backend, because\n * `CngxAxis` renders its own SVG ungated by `renderSvg` in both modes.\n * The two paths therefore cannot disagree on where the plot area is,\n * and only one of them ever draws an axis.\n *\n * They do differ on what happens past the box edge: a canvas clips\n * natively at the element bounds, and since the SVG root no longer sets\n * `overflow: visible` it now clips there too. Out-of-domain data is cut\n * off on both paths.\n *\n * Under forced colors the canvas follows the same contract as the SVG\n * layers, since the browser never forces canvas pixels: every mark paints\n * CanvasText, ignoring `[color]` and the colour tokens; areas and bands keep\n * their opacity; line, bar and scatter take the legend's four-step cycle by\n * series index (lines solid / dashed / dotted / dash-dot, bars and points\n * solid / 45deg hatch / hollow / 0deg hatch), with area, threshold and band\n * not counting. CanvasText and Canvas are resolved through a probe element\n * opted out of forcing and cached like the author colours. Chromium also\n * resolves the system keywords on a 2D context to the forced palette, but\n * other engines are unverified, so the backend paints the probed values.\n * The renderer controller watches `(forced-colors: active)` and\n * `(prefers-color-scheme: dark)` and invalidates the colour cache before\n * repainting on a flip, so a contrast-theme switch repaints at once. One\n * difference from SVG: a layer wrapped in an extra `<svg:g>` still counts\n * here, since the backend only sees the layer order.\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/canvas-renderer.ts\n * @since 0.1.0\n */\nexport function createCanvasRenderer(deps: ChartRendererDeps): CngxChartRenderer {\n let canvas: HTMLCanvasElement | null = null;\n let hostEl: HTMLElement | null = null;\n let ctx2d: CanvasRenderingContext2D | null = null;\n let lastW = -1;\n let lastH = -1;\n let lastGeometries: readonly LayerGeometry[] = [];\n let dprCleanup: (() => void) | null = null;\n const colorCache = new Map<string, string>();\n const numberCache = new Map<string, number>();\n // Snapshot of deps.forcedColors, taken once per paint() so the per-mark\n // colour lookups do not re-read the signal.\n let forcedNow = false;\n // Forced system palette; cleared with colorCache so a flip re-probes it.\n let sysColors: ForcedSystemColors | null = null;\n let probe: SystemColorProbe | null = null;\n // Hatch patterns for the forced cycle, per palette and DPR.\n let hatches: ForcedHatches | null = null;\n let hatchDpr = -1;\n\n function readVar(name: string): string {\n return hostEl ? getComputedStyle(hostEl).getPropertyValue(name).trim() : '';\n }\n\n /**\n * Read a numeric CSS custom property (e.g. `--cngx-area-opacity`,\n * `--cngx-line-stroke-width`), cached like colors so the paint hot path\n * stays free of synchronous DOM reads. Falls back when unset / unparseable.\n */\n function resolveNumberVar(name: string, fallback: number): number {\n const cached = numberCache.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const raw = readVar(name);\n const parsed = raw ? parseFloat(raw) : NaN;\n const value = Number.isFinite(parsed) ? parsed : fallback;\n numberCache.set(name, value);\n return value;\n }\n\n /**\n * The forced system palette, probed once per palette and dropped by\n * `invalidateColorCache()`, so a forced-colors flip re-probes it.\n */\n function systemColors(): ForcedSystemColors {\n sysColors ??= probe?.read() ?? { ink: 'CanvasText', canvas: 'canvas' };\n return sysColors;\n }\n\n function forcedHatches(c: CanvasRenderingContext2D): ForcedHatches {\n const dpr = globalThis.devicePixelRatio ?? 1;\n if (!hatches || hatchDpr !== dpr) {\n const doc = hostEl?.ownerDocument ?? document;\n hatches = createForcedHatches(doc, c, systemColors(), dpr);\n hatchDpr = dpr;\n }\n return hatches;\n }\n\n /**\n * Set the fill of a bar / scatter mark at its forced step and return the\n * ink ring width (0 = no ring): solid ink; diagonal hatch with a 1px ring;\n * hollow Canvas with a 1.5px ring; horizontal hatch with a 1px ring. A\n * missing pattern falls back to an ink fill. Mirrors the bar / scatter\n * layers' forced-colors CSS.\n */\n function applyForcedMark(c: CanvasRenderingContext2D, step: ForcedSeriesStep): number {\n const sys = systemColors();\n switch (step) {\n case 1:\n c.fillStyle = forcedHatches(c).diagonal ?? sys.ink;\n return 1;\n case 2:\n c.fillStyle = sys.canvas;\n return 1.5;\n case 3:\n c.fillStyle = forcedHatches(c).horizontal ?? sys.ink;\n return 1;\n default:\n c.fillStyle = sys.ink;\n return 0;\n }\n }\n\n function colorOf(color: string | null, kind: LayerGeometry['kind']): string {\n // Forced colors: every mark paints CanvasText, ignoring the [color]\n // literal and the var chain (parity with the layers' !important rules).\n if (forcedNow) {\n return systemColors().ink;\n }\n // An explicit literal color (e.g. [cngxLine] [color]=\"'#f00'\") passes\n // through untouched - no var resolution, no cache.\n if (color !== null && !color.startsWith('--')) {\n return color;\n }\n const key = color ?? `@${kind}`;\n const cached = colorCache.get(key);\n if (cached !== undefined) {\n return cached;\n }\n let resolved = 'currentColor';\n if (color !== null) {\n resolved = readVar(color) || 'currentColor';\n } else {\n // Walk the per-atom -> family fallback chain, first hit wins.\n for (const name of KIND_VARS[kind]) {\n const value = readVar(name);\n if (value) {\n resolved = value;\n break;\n }\n }\n }\n colorCache.set(key, resolved);\n return resolved;\n }\n\n function strokeWidthOf(sw: number | string | null): number {\n // Unset -> the same `--cngx-line-stroke-width` var the SVG line reads,\n // so per-atom stroke width survives the SVG->Canvas crossover.\n if (sw === null) {\n return resolveNumberVar('--cngx-line-stroke-width', DEFAULT_STROKE_WIDTH);\n }\n const n = typeof sw === 'number' ? sw : parseFloat(sw);\n return Number.isFinite(n) ? n : DEFAULT_STROKE_WIDTH;\n }\n\n /**\n * Draw the optional point-marker pass a line / area geometry carries,\n * as filled arcs in the layer's resolved colour. Same colour path as\n * the stroke / fill so no second colour resolution is introduced.\n */\n function drawPointMarks(\n c: CanvasRenderingContext2D,\n points: readonly { readonly cx: number; readonly cy: number }[] | undefined,\n color: string | null,\n kind: LayerGeometry['kind'],\n radiusVar: string,\n ): void {\n if (!points || points.length === 0) {\n return;\n }\n const r = resolveNumberVar(radiusVar, DEFAULT_POINT_RADIUS);\n c.fillStyle = colorOf(color, kind);\n for (const p of points) {\n c.beginPath();\n c.arc(p.cx, p.cy, r, 0, Math.PI * 2);\n c.fill();\n }\n }\n\n function sizeCanvas(): void {\n if (!canvas || !ctx2d) {\n return;\n }\n const { width, height } = deps.ctx.dimensions();\n const dpr = globalThis.devicePixelRatio ?? 1;\n const w = Math.max(0, Math.round(width * dpr));\n const h = Math.max(0, Math.round(height * dpr));\n if (w === lastW && h === lastH) {\n return;\n }\n lastW = w;\n lastH = h;\n // Assigning width/height reallocates and clears the bitmap - only when\n // the device-pixel size actually changed. paint() clears each frame via\n // clearRect regardless, so the realtime hot path pays nothing here.\n canvas.width = w;\n canvas.height = h;\n // Draw in logical pixels; the bitmap is scaled for the device.\n ctx2d.setTransform(dpr, 0, 0, dpr, 0, 0);\n }\n\n /**\n * Repaint when the device-pixel ratio changes without any data change\n * (window dragged to another monitor, browser zoom). The paint path\n * re-reads the DPR via `sizeCanvas()`, but nothing triggers it on a\n * DPR-only change, so the bitmap stays at the old density and renders\n * blurry until the next data tick. A `resolution` media query fires\n * exactly on that edge; it matches only the current ratio, so it is\n * re-armed with the new ratio after every change.\n */\n function watchDpr(): void {\n if (typeof matchMedia !== 'function') {\n return;\n }\n const mql = matchMedia(`(resolution: ${globalThis.devicePixelRatio ?? 1}dppx)`);\n const onChange = (): void => {\n dprCleanup?.();\n dprCleanup = null;\n paint(lastGeometries);\n watchDpr();\n };\n mql.addEventListener('change', onChange, { once: true });\n dprCleanup = () => mql.removeEventListener('change', onChange);\n }\n\n function mount(host: HTMLElement): void {\n hostEl = host;\n const el = host.ownerDocument.createElement('canvas');\n // Structural positioning lives with the skin (the `.cngx-chart__canvas`\n // rule in the chart stylesheet), not inline here - so a decomposed skin\n // can restyle the overlay without editing this brain.\n el.className = 'cngx-chart__canvas';\n el.setAttribute('aria-hidden', 'true');\n host.appendChild(el);\n canvas = el;\n ctx2d = el.getContext('2d');\n probe = createSystemColorProbe(host);\n sizeCanvas();\n watchDpr();\n // Teardown is owned by the renderer controller (it destroys on mode\n // flip and on the chart's DestroyRef). Self-registering here would\n // pile up one never-unregistered closure per svg<->canvas flip.\n }\n\n function paint(geometries: readonly LayerGeometry[]): void {\n lastGeometries = geometries;\n const c = ctx2d;\n if (!canvas || !c) {\n return;\n }\n sizeCanvas();\n forcedNow = deps.forcedColors?.() ?? false;\n const { width, height } = deps.ctx.dimensions();\n c.clearRect(0, 0, width, height);\n const steps = forcedNow ? forcedSeriesSteps(geometries) : null;\n for (let i = 0; i < geometries.length; i++) {\n paintOne(c, geometries[i], steps?.[i] ?? null);\n }\n }\n\n function paintOne(\n c: CanvasRenderingContext2D,\n g: LayerGeometry,\n step: ForcedSeriesStep | null,\n ): void {\n switch (g.kind) {\n case 'line': {\n c.strokeStyle = colorOf(g.color, 'line');\n c.lineWidth = strokeWidthOf(g.strokeWidth);\n c.lineJoin = 'round';\n c.lineCap = 'round';\n // Forced colors: the legend's dash for this series step (round caps\n // turn the 0.1 dash into a dot, as in SVG).\n if (step !== null) {\n c.setLineDash(FORCED_LINE_DASHES[step]);\n }\n c.stroke(new Path2D(g.d));\n if (step !== null) {\n c.setLineDash(SOLID_DASH);\n }\n drawPointMarks(c, g.points, g.color, 'line', '--cngx-line-point-radius');\n break;\n }\n case 'area': {\n c.fillStyle = colorOf(g.color, 'area');\n c.globalAlpha = g.opacity ?? resolveNumberVar('--cngx-area-opacity', DEFAULT_AREA_OPACITY);\n c.fill(new Path2D(g.d));\n c.globalAlpha = 1;\n drawPointMarks(c, g.points, g.color, 'area', '--cngx-area-point-radius');\n break;\n }\n case 'bar': {\n const ring = step === null ? 0 : applyForcedMark(c, step);\n if (ring > 0) {\n c.strokeStyle = systemColors().ink;\n c.lineWidth = ring;\n }\n for (const r of g.rects) {\n if (step === null) {\n c.fillStyle = colorOf(r.color, 'bar');\n }\n c.fillRect(r.x, r.y, r.w, r.h);\n if (ring > 0) {\n c.strokeRect(r.x, r.y, r.w, r.h);\n }\n }\n break;\n }\n case 'scatter': {\n const ring = step === null ? 0 : applyForcedMark(c, step);\n if (ring > 0) {\n c.strokeStyle = systemColors().ink;\n c.lineWidth = ring;\n }\n for (const m of g.marks) {\n if (step === null) {\n c.fillStyle = colorOf(m.color, 'scatter');\n }\n c.beginPath();\n c.arc(m.cx, m.cy, m.r, 0, Math.PI * 2);\n c.fill();\n if (ring > 0) {\n c.stroke();\n }\n }\n break;\n }\n case 'threshold': {\n c.strokeStyle = colorOf(g.color, 'threshold');\n c.lineWidth = 1;\n c.setLineDash(g.dashed ? [4, 3] : []);\n c.beginPath();\n c.moveTo(g.x1, g.y1);\n c.lineTo(g.x2, g.y2);\n c.stroke();\n c.setLineDash([]);\n break;\n }\n case 'band': {\n c.fillStyle = colorOf(g.color, 'band');\n c.globalAlpha = g.opacity ?? resolveNumberVar('--cngx-band-opacity', DEFAULT_BAND_OPACITY);\n c.fillRect(g.x, g.y, g.w, g.h);\n c.globalAlpha = 1;\n break;\n }\n }\n }\n\n function invalidateColorCache(): void {\n colorCache.clear();\n numberCache.clear();\n sysColors = null;\n hatches = null;\n }\n\n function destroy(): void {\n dprCleanup?.();\n dprCleanup = null;\n lastGeometries = [];\n canvas?.remove();\n canvas = null;\n probe?.remove();\n probe = null;\n ctx2d = null;\n hostEl = null;\n lastW = -1;\n lastH = -1;\n colorCache.clear();\n numberCache.clear();\n sysColors = null;\n hatches = null;\n }\n\n return {\n mode: 'canvas',\n mount: (host: HTMLElement, _ctx: CngxChartContext) => mount(host),\n paint,\n destroy,\n invalidateColorCache,\n };\n}\n","import { type ChartRendererDeps, type CngxChartRenderer } from './chart-renderer';\n\n/**\n * SVG passthrough renderer. Layer atoms render their own `<svg:path>` /\n * `<svg:rect>` / `<svg:circle>`, gated by the chart shell's `renderSvg`\n * computed, so this backend has nothing to do: every method is a no-op.\n * It never writes back to the chart context - `renderSvg` ownership stays\n * in the chart shell as the single source of truth.\n *\n * @param _deps unused; kept for factory signature symmetry with\n * {@link createCanvasRenderer}.\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/svg-renderer.ts\n * @since 0.1.0\n */\nexport function createSvgRenderer(_deps: ChartRendererDeps): CngxChartRenderer {\n const noop = (): void => undefined;\n return {\n mode: 'svg',\n mount: noop,\n paint: noop,\n destroy: noop,\n invalidateColorCache: noop,\n };\n}\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Datapoint count above which `<cngx-chart>` auto-switches from SVG to\n * Canvas rendering. Default `500` - the point at which the SVG backend's\n * per-layer DOM-node cost starts to dominate on a mid-range laptop.\n *\n * Override enterprise-wide via {@link withChartRendererThreshold} (or a\n * bare provider) to tune the SVG/Canvas crossover for a given app's\n * hardware profile.\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/renderer-threshold.ts\n * @since 0.1.0\n * @relatedTo provideChartRenderer, withChartRendererThreshold\n */\nexport const CNGX_CHART_RENDERER_THRESHOLD = new InjectionToken<number>(\n 'CngxChartRendererThreshold',\n { providedIn: 'root', factory: () => 500 },\n);\n","import { InjectionToken, type Provider } from '@angular/core';\n\nimport { type CngxChartRendererFactory } from './chart-renderer';\nimport { createCanvasRenderer } from './canvas-renderer';\nimport { createSvgRenderer } from './svg-renderer';\nimport { CNGX_CHART_RENDERER_THRESHOLD } from './renderer-threshold';\n\n/**\n * The default renderer factory: dispatches `'svg'` to\n * {@link createSvgRenderer} and `'canvas'` to {@link createCanvasRenderer}.\n * Inlines the two-backend switch; a consumer wanting a third backend\n * (WebGL, ...) supplies a whole replacement via\n * {@link withChartRendererFactory}.\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/renderer-factory.ts\n * @since 0.1.0\n */\nexport const createDefaultChartRenderer: CngxChartRendererFactory = (mode, deps) =>\n mode === 'svg' ? createSvgRenderer(deps) : createCanvasRenderer(deps);\n\n/**\n * The renderer-factory the chart shell resolves to build its backend.\n * Default {@link createDefaultChartRenderer}; override enterprise-wide via\n * {@link withChartRendererFactory} to add a backend without touching layer\n * atoms.\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/renderer-factory.ts\n * @since 0.1.0\n * @relatedTo provideChartRenderer, withChartRendererFactory\n */\nexport const CNGX_CHART_RENDERER_FACTORY = new InjectionToken<CngxChartRendererFactory>(\n 'CngxChartRendererFactory',\n { providedIn: 'root', factory: () => createDefaultChartRenderer },\n);\n\n/**\n * A single renderer-config override produced by a `with*` feature and\n * folded by {@link provideChartRenderer}.\n *\n * @category common/chart/renderer\n */\nexport interface CngxChartRendererFeature {\n readonly providers: Provider[];\n}\n\n/**\n * Override the SVG->Canvas auto-switch cutoff (default `500`).\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/renderer-factory.ts\n * @since 0.1.0\n */\nexport function withChartRendererThreshold(n: number): CngxChartRendererFeature {\n return { providers: [{ provide: CNGX_CHART_RENDERER_THRESHOLD, useValue: n }] };\n}\n\n/**\n * Replace the renderer factory - e.g. to force one backend or add a\n * third. Consumers wanting a heuristic swap supply a custom factory here\n * (the heuristic-swap axis ships no dedicated token at v2).\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/renderer-factory.ts\n * @since 0.1.0\n */\nexport function withChartRendererFactory(fn: CngxChartRendererFactory): CngxChartRendererFeature {\n return { providers: [{ provide: CNGX_CHART_RENDERER_FACTORY, useValue: fn }] };\n}\n\n/**\n * Aggregate renderer-config features into a provider set. Place in a\n * bootstrap `providers` array (app-wide) or a component's `viewProviders`\n * (subtree scope).\n *\n * ```typescript\n * provideChartRenderer(withChartRendererThreshold(2000))\n * ```\n *\n * @category common/chart/renderer\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/renderer/renderer-factory.ts\n * @since 0.1.0\n * @relatedTo withChartRendererThreshold, withChartRendererFactory\n */\nexport function provideChartRenderer(...features: CngxChartRendererFeature[]): Provider[] {\n return features.flatMap((f) => f.providers);\n}\n","import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n contentChildren,\n DestroyRef,\n ElementRef,\n inject,\n input,\n isDevMode,\n type Signal,\n untracked,\n ViewEncapsulation,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { CngxResizeObserver } from '@cngx/common/layout';\nimport { resolveAsyncView, type AsyncView } from '@cngx/common/data';\nimport { createTransitionTracker, nextUid, type CngxAsyncState } from '@cngx/core/utils';\nimport { type CngxAxisPosition, type CngxAxisType } from '../axis/axis-position';\nimport { CNGX_CHART_AXIS } from '../axis/chart-axis';\nimport { CngxThreshold } from '../layers/threshold.component';\nimport { injectChartI18n } from '../i18n/chart-i18n';\nimport { CngxChartDataTable } from './data-table.component';\nimport {\n CHART_SMALL_BREAKPOINT_PX,\n CngxChartConnectionError,\n type CngxChartConnectionContext,\n CngxChartEmpty,\n CngxChartError,\n CngxChartLoading,\n CngxChartOverlay,\n CngxChartReconnecting,\n type CngxChartSlotContext,\n} from './template-slots';\nimport { createBandScale, createLinearScale, createTimeScale } from '../scales';\nimport {\n CNGX_CHART_CONTEXT,\n type CngxChartContext,\n type CngxChartInset,\n type CngxChartPlotArea,\n type ScaleFn,\n type XScaleInput,\n} from './chart-context';\nimport { computeChartSummary } from './summary';\nimport { createSignificantChangeTracker } from './significant-change';\nimport {\n dimensionsEqual,\n insetEqual,\n plotAreaEqual,\n sameItemsArr,\n sameNumberArr,\n slotContextEqual,\n} from './equal-helpers';\nimport { CNGX_CHART_LAYER, type LayerGeometry } from '../layers/chart-layer';\nimport { createChartRendererController } from '../renderer/chart-renderer-controller';\nimport { CNGX_CHART_RENDERER_FACTORY } from '../renderer/renderer-factory';\nimport { CNGX_CHART_RENDERER_THRESHOLD } from '../renderer/renderer-threshold';\n\n/** @internal */\nconst NOOP_SCALE: ScaleFn<XScaleInput> = () => 0;\n/** @internal */\nconst NOOP_Y_SCALE: ScaleFn<number> = () => 0;\n\n/**\n * Reserve-nothing inset. A stable reference, so a chart whose axis set\n * never changes hands the same object to every reader and the `equal`\n * guard on {@link CngxChart.inset} short-circuits on identity.\n *\n * @internal\n */\nconst ZERO_INSET: CngxChartInset = {\n inlineStart: 0,\n inlineEnd: 0,\n blockStart: 0,\n blockEnd: 0,\n};\n\n/**\n * Stable reference for the default `summaryAccessor`. Exposed so the\n * dev-mode warning can detect \"consumer omitted [summaryAccessor] on\n * non-numeric data\" without false positives when the consumer happens\n * to pass an identical-looking arrow.\n *\n * @internal\n */\nconst DEFAULT_SUMMARY_ACCESSOR = <T>(d: T): number => Number(d as unknown);\n\n/**\n * Top-level chart container. Hosts an `<svg>` viewBox, applies\n * {@link CngxResizeObserver} via `hostDirectives` to track its rendered\n * size, and provides {@link CNGX_CHART_CONTEXT} so child atoms\n * (`[cngxAxis]`, layer atoms) read the live scales without injecting\n * the concrete `CngxChart` class.\n *\n * Layer atoms and `[cngxAxis]` are attribute directives: consumers\n * mount them on `<svg:g>` hosts inside the chart so the SVG namespace\n * boundary stays clean. An element selector (`<cngx-axis>` etc.)\n * inside `<svg>` would create an XHTML-namespaced custom element\n * whose SVG-namespaced children would not lay out, leaving the chart\n * blank in real browsers (jsdom is permissive and would mask this).\n *\n * Scales are derived from content-child `[cngxAxis]` directives:\n * the X axis (top/bottom position) drives `xScale`, the Y axis\n * (left/right) drives `yScale`. With no axis present, the\n * corresponding scale falls back to a no-op `() => 0` and content\n * children may render off-canvas - consumers must mount at least\n * one axis per direction they actually use.\n *\n * The `[width]` / `[height]` inputs override the resize observer for\n * fixed-dimension presets (inline sparkline at 80×24, etc.).\n *\n * ## The plot area\n *\n * Marks are mapped onto the *plot area*, not onto the whole viewBox:\n * the viewBox minus the room the projected axes need for their tick\n * labels and titles. The chart publishes the resulting rectangle on\n * {@link CngxChartContext.plot}, and both its own scale ranges and\n * every `[cngxAxis]` line resolve against that one derivation, so a\n * tick can never drift away from the mark it labels.\n *\n * The reserved room is derived, not configured. Which sides reserve\n * comes from the projected axis set; how much each side reserves comes\n * from the axis itself, which sizes the gutter from the tick labels it\n * already formats. There is no input, no CSS custom property and no DI\n * token to tune it - a chart without axes reserves nothing and fills\n * its box exactly as it did before the plot area existed, as does one\n * whose axes are {@link CngxAxisDomain}, which draws nothing.\n *\n * Every axis reserves on its own side and a little on the two\n * perpendicular ones, because a tick label is centred on its tick and\n * the end ticks sit on the plot corners.\n *\n * Nothing here reads the DOM. The gutter is arithmetic over label\n * strings, so it is at final width in the first painted frame and\n * renders identically under SSR. The cost is that one character's\n * width is an estimate rather than the font's real advance width; a\n * consumer restyling `--cngx-axis-font-size` gets labels at their own\n * size inside a gutter sized for the default.\n *\n * @category common/chart\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/chart.component.ts\n * @since 0.1.0\n * @relatedTo CngxAxis, CngxLine, CngxArea, CngxBar, CngxChartLegend\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/overlay-aligned-to-the-plot</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n * @slot cngxChartLoading Replaces the centred spinner shown during the first load.\n * @slot cngxChartEmpty Rendered when the data resolves to nothing.\n * @slot cngxChartError Rendered when the load fails; gets the error.\n * @slot cngxChartConnectionError Rendered over the chart when the live connection drops.\n * @slot cngxChartReconnecting Rendered over the chart while the connection retries.\n * @slot cngxChartOverlay HTML layered over the marks in the content view; the chart insets it to the plot area, pointer-events off by default.\n */\n@Component({\n selector: 'cngx-chart',\n exportAs: 'cngxChart',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'img',\n '[attr.aria-label]': 'ariaLabelText()',\n '[attr.aria-describedby]': 'dataTableId',\n '[attr.aria-busy]': 'busy() ? \"true\" : null',\n '[class.cngx-chart--responsive]': 'isResponsive()',\n '[class.cngx-chart--content-hidden]': 'contentHidden()',\n '[style.width.px]': 'width() ?? null',\n '[style.aspect-ratio]': 'explicitAspectRatio()',\n // The resolved plot inset, published so HTML overlays positioned\n // against the host box can align to the plot area instead.\n '[style.--cngx-chart-plot-block-start]': 'plotVars().blockStart',\n '[style.--cngx-chart-plot-block-end]': 'plotVars().blockEnd',\n '[style.--cngx-chart-plot-inline-start]': 'plotVars().inlineStart',\n '[style.--cngx-chart-plot-inline-end]': 'plotVars().inlineEnd',\n // Hatch fills the bar and scatter layers reference in forced colors.\n '[style.--_cngx-chart-hatch-diagonal]': 'hatchFill.diagonal',\n '[style.--_cngx-chart-hatch-horizontal]': 'hatchFill.horizontal',\n },\n hostDirectives: [CngxResizeObserver],\n providers: [{ provide: CNGX_CHART_CONTEXT, useExisting: CngxChart }],\n imports: [CngxChartDataTable, NgTemplateOutlet],\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n @if (loadingTpl(); as tpl) {\n <div class=\"cngx-chart__fallback-frame\">\n <ng-container *ngTemplateOutlet=\"tpl; context: slotContext()\" />\n </div>\n } @else {\n <div class=\"cngx-chart__loading\" [attr.aria-hidden]=\"true\">\n <div class=\"cngx-chart__spinner\"></div>\n </div>\n }\n }\n @case ('empty') {\n @if (emptyTpl(); as tpl) {\n <div class=\"cngx-chart__fallback-frame\">\n <ng-container *ngTemplateOutlet=\"tpl; context: slotContext()\" />\n </div>\n } @else {\n <div class=\"cngx-chart__fallback\" [attr.aria-hidden]=\"true\">{{ i18n().empty() }}</div>\n }\n }\n @case ('error') {\n @if (errorTpl(); as tpl) {\n <div class=\"cngx-chart__fallback-frame\">\n <ng-container *ngTemplateOutlet=\"tpl; context: errorContext()\" />\n </div>\n } @else {\n <div class=\"cngx-chart__fallback cngx-chart__fallback--error\" [attr.aria-hidden]=\"true\">\n {{ i18n().error() }}\n </div>\n }\n }\n @case ('none') {}\n @default {\n <svg [attr.viewBox]=\"viewBox()\" [attr.preserveAspectRatio]=\"preserveAspectRatio()\">\n <svg:title>{{ ariaLabelText() }}</svg:title>\n <svg:defs>\n <svg:pattern\n [attr.id]=\"hatchId + '-diagonal'\"\n width=\"4\"\n height=\"4\"\n patternUnits=\"userSpaceOnUse\"\n patternTransform=\"rotate(45)\"\n >\n <svg:rect class=\"cngx-chart__hatch-gap\" width=\"4\" height=\"4\" />\n <svg:rect class=\"cngx-chart__hatch-ink\" width=\"4\" height=\"2\" />\n </svg:pattern>\n <svg:pattern [attr.id]=\"hatchId + '-horizontal'\" width=\"4\" height=\"4\" patternUnits=\"userSpaceOnUse\">\n <svg:rect class=\"cngx-chart__hatch-gap\" width=\"4\" height=\"4\" />\n <svg:rect class=\"cngx-chart__hatch-ink\" width=\"4\" height=\"2\" />\n </svg:pattern>\n </svg:defs>\n <ng-content />\n </svg>\n @if (overlayTpl(); as tpl) {\n <div class=\"cngx-chart__overlay-frame\">\n <ng-container *ngTemplateOutlet=\"tpl; context: slotContext()\" />\n </div>\n }\n }\n }\n @if (connectionView() === 'error') {\n @if (connectionErrorTpl(); as tpl) {\n <div\n class=\"cngx-chart__connection-overlay cngx-chart__connection-overlay--error\"\n role=\"alert\"\n >\n <ng-container *ngTemplateOutlet=\"tpl; context: connectionCtx()\" />\n </div>\n } @else {\n <div\n class=\"cngx-chart__connection-overlay cngx-chart__connection-overlay--error\"\n role=\"alert\"\n >\n {{ connectionOverlayText() }}\n </div>\n }\n } @else if (connectionView() === 'reconnecting') {\n @if (reconnectingTpl(); as tpl) {\n <div\n class=\"cngx-chart__connection-overlay cngx-chart__connection-overlay--reconnecting\"\n role=\"status\"\n >\n <ng-container *ngTemplateOutlet=\"tpl; context: connectionCtx()\" />\n </div>\n } @else {\n <div\n class=\"cngx-chart__connection-overlay cngx-chart__connection-overlay--reconnecting\"\n role=\"status\"\n >\n {{ connectionOverlayText() }}\n </div>\n }\n }\n <span role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"cngx-chart__sr-status\">{{\n connectionRestoredAnnouncement()\n }}</span>\n <cngx-chart-data-table\n [id]=\"dataTableId\"\n [values]=\"summaryValues()\"\n [hidden]=\"!tableActive() || activeView() !== 'content'\"\n />\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n /* Hatch fills for the forced-colors series cycle (bar, scatter), the\n SVG counterpart of the legend's hatched swatches. Inert until a layer\n references them; system colours so they follow the user palette. */\n cngx-chart .cngx-chart__hatch-ink {\n fill: CanvasText;\n }\n cngx-chart .cngx-chart__hatch-gap {\n fill: Canvas;\n }\n cngx-chart {\n display: inline-block;\n /* Positioning context for the SR-only cngx-chart-data-table (a\n direct absolute descendant). Without it the table's containing\n block is the initial containing block, so it escapes ancestor\n overflow clipping and contributes to the document's scroll\n height - in a virtualized list of charts that destabilises the\n recycler's viewport math. Zero visual effect: the host has no\n absolutely-positioned children that offset from it. */\n position: relative;\n /* Cap the host at its parent's content width so explicit\n [width] values shrink on narrower viewports (mobile portrait,\n constrained dashboard cells). The aspect-ratio derived from\n [width]/[height] keeps the chart proportional when squeezed -\n the SVG viewBox stays in logical coords so axes / threshold\n labels / scales reflow cleanly. */\n max-width: 100%;\n }\n /* Responsive mode: when neither width nor height is bound, the\n host fills its parent and derives height from the\n --cngx-chart-aspect-ratio CSS variable (default 5 / 2). The\n resize observer measures the rendered size; dimensions() then\n drives the SVG width/height + viewBox + scale math, so axes\n and layer atoms re-flow as the parent resizes. */\n cngx-chart.cngx-chart--responsive {\n display: block;\n width: 100%;\n aspect-ratio: var(--cngx-chart-aspect-ratio, 5 / 2);\n }\n cngx-chart > .cngx-chart__canvas {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n /* The canvas is host.appendChild()-ed at runtime, so it lands\n after all template content in DOM order and would paint over an\n overlay by default. An explicit order keeps the overlay on top\n across the SVG/canvas crossover; DOM order alone does not. */\n z-index: var(--cngx-chart-canvas-z, 0);\n }\n cngx-chart.cngx-chart--content-hidden > .cngx-chart__canvas {\n display: none;\n }\n cngx-chart > svg {\n display: block;\n width: 100%;\n height: 100%;\n /* No overflow: visible here, deliberately. The plot inset\n reserves room for tick labels and axis titles inside the\n viewBox, so nothing the chart authors lands outside it and the\n SVG default is the correct one. Two things do still cross the\n edge and now clip: half the stroke width of a mark sitting on\n the plot boundary, and out-of-domain data. Both already clip\n on the canvas backend, which clips natively at the element\n box - so the backends agree on where a chart ends. */\n }\n cngx-chart > .cngx-chart__fallback-frame {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n }\n /*\n Inset to the plot area from the four --cngx-chart-plot-* percentages\n the host already publishes, so an overlay lands on the marks without\n the consumer re-deriving the rectangle. pointer-events: none so the\n frame never swallows chart interaction; an element inside it opts\n back in with pointer-events: auto.\n */\n cngx-chart > .cngx-chart__overlay-frame {\n position: absolute;\n inset-block-start: var(--cngx-chart-plot-block-start, 0px);\n inset-block-end: var(--cngx-chart-plot-block-end, 0px);\n inset-inline-start: var(--cngx-chart-plot-inline-start, 0px);\n inset-inline-end: var(--cngx-chart-plot-inline-end, 0px);\n /* Above the canvas backend (see .cngx-chart__canvas). */\n z-index: var(--cngx-chart-overlay-z, 1);\n pointer-events: none;\n }\n cngx-chart > .cngx-chart__loading {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n }\n cngx-chart .cngx-chart__spinner {\n width: var(--cngx-chart-spinner-size, 32px);\n height: var(--cngx-chart-spinner-size, 32px);\n border: var(--cngx-chart-spinner-thickness, 3px) solid\n var(--cngx-chart-spinner-track, rgb(0 0 0 / 0.08));\n border-top-color: var(--cngx-chart-spinner-color, var(--cngx-chart-primary, currentColor));\n border-radius: 50%;\n animation: cngx-chart-spin 800ms linear infinite;\n }\n cngx-chart > .cngx-chart__fallback {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n min-height: var(--cngx-chart-fallback-min-height, 48px);\n font-size: var(--cngx-chart-fallback-font-size, 0.875rem);\n color: var(--cngx-chart-text-color, currentColor);\n opacity: var(--cngx-chart-fallback-opacity, 0.7);\n padding: var(--cngx-chart-fallback-padding, 1rem);\n text-align: center;\n box-sizing: border-box;\n }\n cngx-chart > .cngx-chart__fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n opacity: 1;\n }\n /*\n Anchored to the plot area's top-inline-end corner, not the host\n box: centred over the box it lands on the marks, and on a chart\n with axes it can sit over the tick labels. The plot inset comes\n off the host as custom properties, so the pill tracks the gutter\n the axes reserved without knowing an axis exists.\n */\n cngx-chart > .cngx-chart__connection-overlay {\n position: absolute;\n top: calc(\n var(--cngx-chart-plot-block-start, 0px) + var(--cngx-chart-connection-inset, 0.5rem)\n );\n inset-inline-end: calc(\n var(--cngx-chart-plot-inline-end, 0px) + var(--cngx-chart-connection-inset, 0.5rem)\n );\n max-inline-size: calc(\n 100% - var(--cngx-chart-plot-inline-start, 0px) - var(--cngx-chart-plot-inline-end, 0px) -\n 2 * var(--cngx-chart-connection-inset, 0.5rem)\n );\n display: flex;\n align-items: center;\n gap: var(--cngx-chart-connection-gap, 0.375rem);\n padding: var(--cngx-chart-connection-padding, 0.25rem 0.625rem);\n border-radius: var(--cngx-chart-connection-radius, 999px);\n font-size: var(--cngx-chart-connection-font-size, 0.75rem);\n line-height: 1.4;\n pointer-events: none;\n box-shadow: var(--cngx-chart-connection-shadow, 0 1px 3px rgb(0 0 0 / 0.12));\n }\n cngx-chart > .cngx-chart__connection-overlay--error {\n background: var(--cngx-chart-connection-error-bg, var(--cngx-chart-danger, #d32f2f));\n color: var(--cngx-chart-connection-error-color, #fff);\n }\n cngx-chart > .cngx-chart__connection-overlay--reconnecting {\n background: var(--cngx-chart-connection-reconnecting-bg, rgb(0 0 0 / 0.72));\n color: var(--cngx-chart-connection-reconnecting-color, #fff);\n }\n /* Visually-hidden live region for the connection-restored\n announcement. Shipped locally (like the announcer's) so it\n never falls back to visible text without the global\n utilities.css. */\n cngx-chart > .cngx-chart__sr-status {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n @keyframes cngx-chart-spin {\n to {\n transform: rotate(360deg);\n }\n }\n @media (prefers-reduced-motion: reduce) {\n cngx-chart .cngx-chart__spinner {\n animation: none;\n }\n }\n `,\n ],\n})\nexport class CngxChart<T = unknown> implements CngxChartContext<XScaleInput, number> {\n /**\n * Raw data input. Aliased as `data` at the template-binding level so\n * consumer markup stays `<cngx-chart [data]=\"rows\">`. The public,\n * typed read surface is the `data<U>()` method below - layer atoms\n * call `this.ctx.data<T>()` to narrow without per-site casts.\n *\n * @internal - alias for the public `data<U>()` method\n */\n readonly dataInput = input.required<readonly T[]>({ alias: 'data' });\n readonly width = input<number | undefined>(undefined);\n readonly height = input<number | undefined>(undefined);\n readonly preserveAspectRatio = input<string>('xMidYMid meet');\n /**\n * Optional explicit `aria-label` override. When set, supersedes the\n * auto-Summary derived from data + threshold layers. Use when the\n * default summary phrasing does not fit the chart's domain.\n */\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n /**\n * Numeric accessor used to project generic data to the values fed\n * into the auto-Summary. Default `Number(d)` works for `readonly\n * number[]` data; structured data must override.\n */\n readonly summaryAccessor = input<(d: T, i: number) => number>(DEFAULT_SUMMARY_ACCESSOR);\n /**\n * Controls when the SR-only data-table view is exposed to assistive\n * technology. `'auto'` (default) shows the table whenever the data\n * has more than one point - a single value is announced via the\n * `aria-label`, no table needed. `'off'` keeps the table hidden\n * regardless. The table element is always present in the DOM -\n * visibility flips through `aria-hidden`, the linked id on\n * `aria-describedby` never disappears.\n */\n readonly accessibleTable = input<'auto' | 'off'>('auto');\n /**\n * Optional async-state envelope. When bound, the chart routes through\n * the same skeleton / empty / error / content state machine that the\n * preset molecules use. Without this input, the chart always renders\n * its content (Pillar-2 always-in-DOM data-table id stays stable, but\n * the SR data-table only flips out of `aria-hidden` when the active\n * view is `'content'`).\n *\n * Accepts the standard `CngxAsyncState<T>` shape (any producer:\n * `createManualState`, `createAsyncState`, `injectAsyncState`,\n * `fromHttpResource`, `tap*` pipeline output). The chart exposes its\n * state via this explicit input, not a `CNGX_STATEFUL` provision - bind\n * bridges directly, e.g. `<cngx-toast-on [state]=\"chart.state()\">`. The\n * separate `[connectionState]` input tracks connection lifecycle so the\n * two channels never contend for a single precedence seat.\n */\n readonly state = input<CngxAsyncState<readonly T[]> | undefined>(undefined);\n /**\n * Optional connection-lifecycle envelope, additive and independent of\n * `[state]`. Bind a websocket/SSE adapter's `CngxAsyncState<unknown>` so\n * connection blips surface via the `*cngxChartConnectionError` /\n * `*cngxChartReconnecting` overlays without overriding the data view.\n * Consumers care only about the status surface, hence `unknown` as `T`.\n */\n readonly connectionState = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n private readonly resize = inject(CngxResizeObserver, { host: true });\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly rendererFactory = inject(CNGX_CHART_RENDERER_FACTORY);\n private readonly threshold = inject(CNGX_CHART_RENDERER_THRESHOLD);\n private readonly axes = contentChildren(CNGX_CHART_AXIS, { descendants: true });\n private readonly thresholds = contentChildren(CngxThreshold, { descendants: true });\n private readonly layers = contentChildren(CNGX_CHART_LAYER, { descendants: true });\n protected readonly i18n = injectChartI18n();\n protected readonly dataTableId = nextUid('cngx-chart-data-table');\n protected readonly hatchId = nextUid('cngx-chart-hatch');\n protected readonly hatchFill = {\n diagonal: `url(#${this.hatchId}-diagonal)`,\n horizontal: `url(#${this.hatchId}-horizontal)`,\n };\n\n private readonly loadingSlot = contentChild(CngxChartLoading);\n private readonly emptySlot = contentChild(CngxChartEmpty);\n private readonly errorSlot = contentChild(CngxChartError);\n private readonly connectionErrorSlot = contentChild(CngxChartConnectionError);\n private readonly reconnectingSlot = contentChild(CngxChartReconnecting);\n private readonly overlaySlot = contentChild(CngxChartOverlay);\n // Only the first overlay renders (contentChild above). This parallel\n // query exists solely to warn in dev when a consumer projects more\n // than one, since the extra templates drop silently otherwise.\n private readonly overlaySlots = contentChildren(CngxChartOverlay);\n\n /** Resolved consumer-projected loading template (null when no slot bound). */\n protected readonly loadingTpl = computed(() => this.loadingSlot()?.templateRef ?? null);\n /** Resolved consumer-projected empty template (null when no slot bound). */\n protected readonly emptyTpl = computed(() => this.emptySlot()?.templateRef ?? null);\n /** Resolved consumer-projected error template (null when no slot bound). */\n protected readonly errorTpl = computed(() => this.errorSlot()?.templateRef ?? null);\n /** Resolved consumer-projected connection-error template. */\n protected readonly connectionErrorTpl = computed(\n () => this.connectionErrorSlot()?.templateRef ?? null,\n );\n /** Resolved consumer-projected reconnecting template. */\n protected readonly reconnectingTpl = computed(() => this.reconnectingSlot()?.templateRef ?? null);\n /** Resolved consumer-projected overlay template (null when no slot bound). */\n protected readonly overlayTpl = computed(() => this.overlaySlot()?.templateRef ?? null);\n\n /**\n * Common context for every slot template (loading, empty, error).\n * Carries the chart's current rendered width/height plus a `small`\n * flag flipped at the {@link CHART_SMALL_BREAKPOINT_PX} threshold,\n * so consumers can branch on container size:\n *\n * ```html\n * <ng-template cngxChartEmpty let-small=\"small\">\n * @if (small) { <span>No data</span> }\n * @else { <cngx-empty-state title=\"No telemetry yet\" /> }\n * </ng-template>\n * ```\n *\n * Reads directly from the resize observer (host's actual painted\n * size) - NOT from `dimensions()` which prefers the logical\n * `[width]`/`[height]` inputs. This matters when an explicit\n * `[width]=\"480\"` chart squeezes via `max-width: 100%` on a narrow\n * viewport: the rendered width is what the consumer cares about\n * for fallback layout, not the logical viewBox dimension.\n */\n protected readonly slotContext = computed<CngxChartSlotContext>(\n () => {\n const width = this.resize.width();\n const height = this.resize.height();\n return {\n width,\n height,\n small: width > 0 && width < CHART_SMALL_BREAKPOINT_PX,\n // The same derivation the scales and the axes read. A slot\n // template that centres on width/height alone would sit\n // off-centre from the marks it stands in for.\n plot: this.plot(),\n };\n },\n { equal: slotContextEqual },\n );\n\n /**\n * Error-slot context - extends {@link slotContext} with the live\n * error value under `$implicit` and `error` keys, so a consumer can\n * render a typed message AND branch on chart size in the same\n * template.\n */\n protected readonly errorContext = computed(\n () => {\n const err = this.state()?.error?.() ?? null;\n return { ...this.slotContext(), $implicit: err, error: err };\n },\n { equal: (a, b) => Object.is(a.error, b.error) && slotContextEqual(a, b) },\n );\n\n /**\n * Connection-lifecycle view derived from `[connectionState]`'s status.\n * NOT routed through `resolveAsyncView` - that `AsyncView` union has no\n * `'refreshing'` member and folds a refreshing status into the data\n * view. The connection channel maps status directly: `'error'` ->\n * connection-lost overlay, `'refreshing'` -> reconnecting overlay,\n * everything else -> no overlay. Independent of `activeView()`.\n */\n protected readonly connectionView = computed<'error' | 'reconnecting' | 'none'>(() => {\n const s = this.connectionState();\n if (!s) {\n return 'none';\n }\n const status = s.status();\n if (status === 'error') {\n return 'error';\n }\n if (status === 'refreshing') {\n return 'reconnecting';\n }\n return 'none';\n });\n\n /**\n * Text of the default connection overlay (a `role=\"alert\"` /\n * `role=\"status\"` live region). Only the connection view is tracked;\n * the copy is read untracked, so a runtime copy or locale flip does not\n * rewrite a shown announcement - the next transition speaks the new one.\n */\n protected readonly connectionOverlayText = computed(() => {\n const view = this.connectionView();\n return untracked(() => {\n const i18n = this.i18n();\n if (view === 'error') {\n return i18n.connectionLost();\n }\n return view === 'reconnecting' ? i18n.connectionReconnecting() : '';\n });\n });\n\n /**\n * Context for the connection-slot templates - the connection-channel\n * twin of {@link errorContext}, carrying the live connection error.\n */\n protected readonly connectionCtx = computed<CngxChartConnectionContext>(() => {\n const err = this.connectionState()?.error?.() ?? null;\n return { ...this.slotContext(), $implicit: err, error: err };\n });\n\n /**\n * Current/previous pair for the connection channel's status,\n * unbound-safe via the `'idle'` fallback.\n */\n private readonly connectionTransition = createTransitionTracker(\n () => this.connectionState()?.status() ?? 'idle',\n );\n\n /**\n * Text for the always-in-DOM polite live region that voices the\n * recovery transition. The lost/reconnecting overlays announce\n * themselves through their `role=\"alert\"` / `role=\"status\"` - but\n * on recovery they simply vanish, which is a silent state change\n * (Pillar 2). This computed says {@link CngxChartI18n.connectionRestored}\n * exactly on the error/refreshing -> success edge and clears again\n * on the next connection transition. Pure derivation, no `effect()`.\n */\n protected readonly connectionRestoredAnnouncement = computed(() => {\n const current = this.connectionTransition.current();\n const previous = this.connectionTransition.previous();\n const restored = current === 'success' && (previous === 'error' || previous === 'refreshing');\n return restored ? untracked(() => this.i18n().connectionRestored()) : '';\n });\n\n constructor() {\n // The controller owns the mount / destroy / paint reactive lifecycle;\n // its effects and teardown are held by this injection context's\n // DestroyRef, so the shell keeps no rendering brain and no handle.\n createChartRendererController({\n host: this.hostEl.nativeElement,\n ctx: this,\n mode: this.renderMode,\n geometries: this.geometries,\n factory: this.rendererFactory,\n destroyRef: this.destroyRef,\n });\n\n if (isDevMode()) {\n afterNextRender(() => {\n if (this.summaryAccessor() !== DEFAULT_SUMMARY_ACCESSOR) {\n return;\n }\n const data = this.dataInput();\n if (data.length === 0) {\n return;\n }\n const projected = Number(data[0] as unknown);\n if (Number.isFinite(projected)) {\n return;\n }\n console.warn(\n 'CngxChart: data is non-numeric and no [summaryAccessor] is bound. ' +\n 'Auto-Summary and the SR data-table will silently fall back to NaN. ' +\n 'Bind [summaryAccessor]=\"(d) => d.yourField\" or pass a numeric data array.',\n );\n });\n afterNextRender(() => {\n if (this.overlaySlots().length > 1) {\n console.warn(\n 'CngxChart: more than one *cngxChartOverlay projected; only the first renders. ' +\n 'Compose multiple overlays inside a single overlay template.',\n );\n }\n });\n afterNextRender(() => {\n const axes = this.axes();\n const horizontal = axes.filter((a) => isHorizontalPosition(a.position()));\n const vertical = axes.filter((a) => isVerticalPosition(a.position()));\n if (horizontal.length > 1 || vertical.length > 1) {\n console.warn(\n 'CngxChart: multiple axes share one orientation; only the first drives ' +\n 'the scale, the rest render their line and ticks but their [domain] ' +\n 'is silently ignored. Mount one X and one Y axis per chart.',\n );\n }\n });\n }\n }\n\n readonly dataLength = computed(() => this.dataInput().length);\n\n /**\n * Generic-aware data accessor satisfying {@link CngxChartContext.data}.\n * The single boundary cast lives here; layer atoms call\n * `this.ctx.data<T>()` and receive `readonly T[]` directly with no\n * per-site `as` cast.\n */\n data<U = T>(): readonly U[] {\n return this.dataInput() as unknown as readonly U[];\n }\n\n readonly dimensions = computed(\n () => ({\n width: this.width() ?? this.resize.width(),\n height: this.height() ?? this.resize.height(),\n }),\n { equal: dimensionsEqual },\n );\n\n /**\n * Room the projected axes need for their decoration, per side.\n * Chart-internal: it exists only to produce {@link plot}, which is\n * what every reader actually wants.\n *\n * Which sides reserve is derived from the same `axes()` query the\n * scale lookups below already read - a consumer input would be a\n * second source for something the chart can see. How much each side\n * reserves is the axis's own {@link CngxChartAxis.reservation}: the\n * chart never learns what a tick label is, and the axis never learns\n * where the plot ends. A side with no axis on it stays `0`, which is\n * why a chart whose axes all draw nothing resolves to\n * {@link ZERO_INSET} and renders exactly as it did before the inset\n * existed.\n */\n private readonly inset = computed<CngxChartInset>(\n () => {\n const axes = this.axes();\n if (axes.length === 0) {\n return ZERO_INSET;\n }\n let inlineStart = 0;\n let inlineEnd = 0;\n let blockStart = 0;\n let blockEnd = 0;\n for (const axis of axes) {\n const room = axis.reservation();\n // Half the extreme tick label hangs past the plot corner along\n // the axis's own line, so every axis also reserves on the two\n // sides perpendicular to it. Without this a left axis's topmost\n // label paints above the viewBox and a bottom axis's last label\n // paints past its right edge, however deep their own gutters are.\n const cross = axis.crossReservation();\n // Two axes on the same side reserve the wider of the two\n // rather than stacking - they draw over each other, so the\n // room they need is the room the deeper one needs.\n switch (axis.position()) {\n case 'left':\n inlineStart = Math.max(inlineStart, room);\n blockStart = Math.max(blockStart, cross);\n blockEnd = Math.max(blockEnd, cross);\n break;\n case 'right':\n inlineEnd = Math.max(inlineEnd, room);\n blockStart = Math.max(blockStart, cross);\n blockEnd = Math.max(blockEnd, cross);\n break;\n case 'top':\n blockStart = Math.max(blockStart, room);\n inlineStart = Math.max(inlineStart, cross);\n inlineEnd = Math.max(inlineEnd, cross);\n break;\n case 'bottom':\n blockEnd = Math.max(blockEnd, room);\n inlineStart = Math.max(inlineStart, cross);\n inlineEnd = Math.max(inlineEnd, cross);\n break;\n }\n }\n return { inlineStart, inlineEnd, blockStart, blockEnd };\n },\n { equal: insetEqual },\n );\n\n /**\n * The plot inset as percentages of the host box, published as the\n * `--cngx-chart-plot-*` custom properties.\n *\n * Custom properties inherit downwards, so these reach the chart's own\n * subtree. An overlay outside the host does not see them and reads\n * {@link plot} off the exported instance instead\n * (`#chart=\"cngxChart\"`) - projected content lands inside the `<svg>`,\n * so an HTML overlay is always a sibling.\n *\n * Percentages rather than pixels, because a user unit is not always a\n * CSS pixel: an explicit `[width]=\"520\"` chart squeezed by\n * `max-width: 100%` keeps a 520-unit viewBox inside a 400px box. A\n * fraction of the viewBox survives that scaling where a px value\n * would not. Block values resolve against the containing block's\n * height and inline values against its width, matching what `top` and\n * `inset-inline-end` expect.\n *\n * Exact while the host's aspect ratio matches the viewBox, which is\n * what {@link explicitAspectRatio} holds it to whenever both `[width]`\n * and `[height]` are bound. Bind only one and it returns `null` on\n * purpose (the consumer drove one dimension deliberately); the SVG\n * then letterboxes under `preserveAspectRatio`, and these percentages\n * address the host box rather than the letterboxed drawing area. The\n * error is the letterbox margin - zero until the host is forced away\n * from the viewBox ratio. Bind both dimensions when an overlay has to\n * land on the plot edge exactly.\n */\n protected readonly plotVars = computed(\n () => {\n const { width, height } = this.dimensions();\n const pct = (v: number, extent: number): string =>\n extent > 0 ? `${+((v / extent) * 100).toFixed(4)}%` : '0%';\n const { inlineStart, inlineEnd, blockStart, blockEnd } = this.inset();\n return {\n inlineStart: pct(inlineStart, width),\n inlineEnd: pct(inlineEnd, width),\n blockStart: pct(blockStart, height),\n blockEnd: pct(blockEnd, height),\n };\n },\n {\n equal: (a, b) =>\n a.inlineStart === b.inlineStart &&\n a.inlineEnd === b.inlineEnd &&\n a.blockStart === b.blockStart &&\n a.blockEnd === b.blockEnd,\n },\n );\n\n /**\n * The plot rectangle published on {@link CngxChartContext}: the\n * viewBox minus {@link inset}. Both scale ranges below and every\n * `[cngxAxis]` resolve against this one derivation, so there is no\n * second place where the box and the reserved room are subtracted\n * from each other and no way for the two to disagree.\n */\n readonly plot = computed<CngxChartPlotArea>(\n () => {\n const { width, height } = this.dimensions();\n const { inlineStart, inlineEnd, blockStart, blockEnd } = this.inset();\n const x1 = width - inlineEnd;\n const y1 = height - blockEnd;\n return {\n x0: inlineStart,\n y0: blockStart,\n x1,\n y1,\n width: x1 - inlineStart,\n height: y1 - blockStart,\n };\n },\n { equal: plotAreaEqual },\n );\n\n /**\n * Render backend: `'canvas'` once the datapoint count exceeds the\n * configured threshold, `'svg'` otherwise. The threshold is a DI\n * constant ({@link CNGX_CHART_RENDERER_THRESHOLD}, default `500`),\n * resolved once at construction; a consumer tunes it via\n * `withChartRendererThreshold(...)` or replaces the whole factory.\n */\n readonly renderMode = computed<'svg' | 'canvas'>(() =>\n this.dataLength() > this.threshold ? 'canvas' : 'svg',\n );\n\n /**\n * SVG-output gate published on {@link CngxChartContext}. Derived from\n * {@link renderMode} - layer atoms self-render their SVG only in SVG\n * mode. Single source of truth; the renderer never writes it.\n */\n readonly renderSvg: Signal<boolean> = computed(() => this.renderMode() === 'svg');\n\n /**\n * Aggregate layer geometries the Canvas backend paints. Element-wise\n * guarded: an unchanged layer contributes a reference-stable geometry\n * object (its own `equal` fn holds), so the mapped array is\n * element-wise-equal and the paint cascade short-circuits.\n */\n protected readonly geometries = computed<readonly LayerGeometry[]>(\n () => this.layers().map((l) => l.geometry()),\n { equal: sameItemsArr },\n );\n\n protected readonly viewBox = computed(() => {\n const { width, height } = this.dimensions();\n return `0 0 ${width || 0} ${height || 0}`;\n });\n\n private readonly xScaleCache = createScaleLru();\n private readonly yScaleCache = createScaleLru();\n\n readonly xScale = computed<ScaleFn<XScaleInput>>(\n () => {\n const axes = this.axes();\n const plot = this.plot();\n // Guard the plot extent, not the box: a chart narrower than the\n // room its axes need would otherwise get a backwards range and\n // paint every mark mirrored.\n if (plot.width <= 0) {\n return NOOP_SCALE;\n }\n const xAxis = axes.find((a) => isHorizontalPosition(a.position()));\n if (!xAxis) {\n return NOOP_SCALE;\n }\n return this.xScaleCache.get(xAxis.type(), xAxis.domain() ?? [], [plot.x0, plot.x1]);\n },\n { equal: (a, b) => a === b },\n );\n\n readonly yScale = computed<ScaleFn<number>>(\n () => {\n const axes = this.axes();\n const plot = this.plot();\n if (plot.height <= 0) {\n return NOOP_Y_SCALE;\n }\n const yAxis = axes.find((a) => isVerticalPosition(a.position()));\n if (!yAxis) {\n return NOOP_Y_SCALE;\n }\n // SVG Y-axis is flipped - domain[max] maps to the plot area's top edge, domain[min] to its bottom edge.\n return this.yScaleCache.get(yAxis.type(), yAxis.domain() ?? [], [\n plot.y1,\n plot.y0,\n ]) as ScaleFn<number>;\n },\n { equal: (a, b) => a === b },\n );\n\n /**\n * Auto-Summary derived from `data` and `<cngx-threshold>` content\n * children. Drives the host's reactive `aria-label`. Layer atoms do\n * not contribute to the summary today; per-layer hints may extend it\n * later.\n */\n readonly summary = computed(\n () => {\n const thresholds = this.thresholds().map((t) => t.value());\n return computeChartSummary(this.summaryValues(), thresholds);\n },\n {\n equal: (a, b) =>\n a.trend === b.trend &&\n a.min === b.min &&\n a.max === b.max &&\n a.current === b.current &&\n sameNumberArr(a.thresholds, b.thresholds),\n },\n );\n\n /**\n * The most recent significant transition (trend-flip or threshold-cross)\n * derived from {@link summary}, or `null`. The chart stays\n * pure-derivation - a companion `<cngx-chart-announcer>` subscribes to\n * this surface and voices it to assistive technology.\n */\n readonly significantChange = createSignificantChangeTracker(this.summary);\n\n /**\n * Active view for the optional state-machine envelope. Returns\n * `'content'` when no `[state]` is bound, falling through to the\n * default branch that renders the SVG content. Otherwise routes\n * through {@link resolveAsyncView} using the same status / firstLoad\n * / empty triple every preset and async-aware atom in the library\n * uses.\n */\n protected readonly activeView = computed<AsyncView>(() => {\n const s = this.state();\n if (!s) {\n return 'content';\n }\n return resolveAsyncView(s.status(), s.isFirstLoad(), s.isEmpty());\n });\n\n /** True when the chart is currently rendering its skeleton view. */\n protected readonly busy = computed(() => this.activeView() === 'skeleton');\n\n /**\n * True when a fallback view (skeleton / empty / error / none) has\n * replaced the data content. The Canvas overlay is a sibling of the\n * `@switch` and would otherwise keep painting the chart on top of the\n * fallback in canvas mode - this gates it off so the fallback stands\n * alone.\n */\n protected readonly contentHidden = computed(() => {\n const view = this.activeView();\n return view === 'skeleton' || view === 'empty' || view === 'error' || view === 'none';\n });\n\n /**\n * Responsive mode is active when neither `[width]` nor `[height]` is\n * bound. The host then fills its parent's width and derives height\n * from the `--cngx-chart-aspect-ratio` CSS custom property (default\n * `5 / 2`). The resize observer feeds `dimensions()` which drives\n * the SVG sizing + scale math, so axes and layer atoms re-flow\n * reactively as the parent resizes.\n */\n protected readonly isResponsive = computed(\n () => this.width() === undefined && this.height() === undefined,\n );\n\n /**\n * Aspect-ratio host style for the explicit-dimension case. Computed\n * from `[width] / [height]` so the chart stays proportional when\n * `max-width: 100%` shrinks the host below the explicit width on a\n * narrow viewport (mobile portrait, constrained dashboard cell).\n * Returns `null` in responsive mode so the\n * `--cngx-chart-aspect-ratio` CSS variable on `.cngx-chart--responsive`\n * wins, and `null` when only one of width/height is bound (caller\n * intentionally drove just one dimension; we do not invent a ratio).\n */\n protected readonly explicitAspectRatio = computed<string | null>(() => {\n const w = this.width();\n const h = this.height();\n if (w === undefined || h === undefined || w <= 0 || h <= 0) {\n return null;\n }\n return `${w} / ${h}`;\n });\n\n /**\n * Reactive `aria-label` text the host announces. Skeleton / empty /\n * error states announce localised i18n strings; the auto-Summary\n * runs only in the content branch so AT does not read stale data\n * during a refetch.\n */\n protected readonly ariaLabelText = computed(() => {\n const view = this.activeView();\n if (view === 'skeleton') {\n return this.i18n().loading();\n }\n if (view === 'empty') {\n return this.i18n().empty();\n }\n if (view === 'error') {\n return this.i18n().error();\n }\n const explicit = this.ariaLabel();\n if (explicit !== null && explicit !== undefined && explicit !== '') {\n return explicit;\n }\n return this.i18n().summary(this.summary());\n });\n\n /**\n * The single numeric projection of `data` through `summaryAccessor`.\n * Both {@link summary} and the data-table view derive from it, so the\n * projection runs once per data change and its `sameNumberArr` equal\n * stops the cascade when a refresh produces identical values.\n */\n protected readonly summaryValues = computed<readonly number[]>(\n () => {\n const acc = this.summaryAccessor();\n const data = this.dataInput();\n const out = new Array<number>(data.length);\n for (let i = 0; i < data.length; i++) {\n out[i] = acc(data[i], i);\n }\n return out;\n },\n { equal: sameNumberArr },\n );\n\n /**\n * Auto-mode predicate. Drives the data-table's `aria-hidden`\n * binding. The id on `aria-describedby` is invariant - it stays on\n * the host whether the table is active or not. Single-value charts\n * speak via the `aria-label` summary; multi-value charts add the\n * table for row-by-row exploration.\n */\n protected readonly tableActive = computed(() => {\n const mode = this.accessibleTable();\n if (mode === 'off') {\n return false;\n }\n return this.dataInput().length > 1;\n });\n}\n\n/** @internal */\nfunction isHorizontalPosition(p: CngxAxisPosition): boolean {\n return p === 'top' || p === 'bottom';\n}\n\n/** @internal */\nfunction isVerticalPosition(p: CngxAxisPosition): boolean {\n return p === 'left' || p === 'right';\n}\n\n/** @internal */\nfunction buildScale(\n type: CngxAxisType,\n domain: readonly unknown[],\n range: readonly [number, number],\n): ScaleFn<XScaleInput> {\n if (domain.length < 2) {\n return NOOP_SCALE;\n }\n switch (type) {\n case 'linear': {\n const linear = createLinearScale(\n [Number(domain[0]), Number(domain[domain.length - 1])],\n range,\n );\n return (v: XScaleInput) => linear(typeof v === 'number' ? v : Number(v));\n }\n case 'time': {\n const time = createTimeScale([toMs(domain[0]), toMs(domain[domain.length - 1])], range);\n return (v: XScaleInput) => time(v instanceof Date ? v : Number(v));\n }\n case 'band': {\n const band = createBandScale<unknown>(domain, range);\n // createBandScale returns the leading edge; chart consumers\n // (ticks, line/area/scatter, threshold/band yScale) want the\n // centre so ticks align with their slot and lines trace through\n // bar centres. Bar atom uses its own slot logic - unaffected.\n const half = band.bandwidth() / 2;\n return (v: XScaleInput) => band(v) + half;\n }\n }\n}\n\n/**\n * Per-chart single-slot LRU on `buildScale`. Caches the\n * `(type, domain-shape, range)` tuple so `xScale`/`yScale` re-emissions\n * with the same axis configuration return the same `ScaleFn` closure\n * instance. Combined with the `equal: (a, b) => a === b` on the\n * `xScale`/`yScale` computeds, an unchanged dimension/axis re-evaluation\n * short-circuits at the cascade guard.\n *\n * Time-typed `Date` endpoints are keyed via `+date` (ms) to handle the\n * common case where a parent re-creates the domain array each tick with\n * `new Date(...)` - raw `Date` references would never `Object.is`-match\n * across ticks.\n *\n * @internal\n */\ninterface ScaleLru {\n get(\n type: CngxAxisType,\n domain: readonly unknown[],\n range: readonly [number, number],\n ): ScaleFn<XScaleInput>;\n}\n\n/** @internal */\nfunction createScaleLru(): ScaleLru {\n let lastType: CngxAxisType | null = null;\n let lastDomainLen = -1;\n let lastDomainStart: number | string | null = null;\n let lastDomainEnd: number | string | null = null;\n let lastDomainAllKeys: string | null = null;\n let lastRange0 = NaN;\n let lastRange1 = NaN;\n let lastFn: ScaleFn<XScaleInput> = NOOP_SCALE;\n\n return {\n get(type, domain, range) {\n const keyStart = endpointKey(domain[0]);\n const keyEnd = endpointKey(domain[domain.length - 1]);\n // For band scales, the cache must invalidate on any reorder/swap of\n // values; cheap stringification of all keys is sufficient because\n // band domains are typically short.\n const allKeys = type === 'band' ? domain.map(endpointKey).join('|') : null;\n if (\n type === lastType &&\n domain.length === lastDomainLen &&\n keyStart === lastDomainStart &&\n keyEnd === lastDomainEnd &&\n allKeys === lastDomainAllKeys &&\n range[0] === lastRange0 &&\n range[1] === lastRange1\n ) {\n return lastFn;\n }\n lastType = type;\n lastDomainLen = domain.length;\n lastDomainStart = keyStart;\n lastDomainEnd = keyEnd;\n lastDomainAllKeys = allKeys;\n lastRange0 = range[0];\n lastRange1 = range[1];\n lastFn = buildScale(type, domain, range);\n return lastFn;\n },\n };\n}\n\n/** @internal */\nfunction endpointKey(v: unknown): number | string {\n if (v instanceof Date) {\n return v.getTime();\n }\n if (typeof v === 'number' || typeof v === 'string') {\n return v;\n }\n return String(v);\n}\n\n/** @internal */\nfunction toMs(v: unknown): number {\n if (typeof v === 'number') {\n return v;\n }\n if (v instanceof Date) {\n return v.getTime();\n }\n return Number(v);\n}\n","import { ChangeDetectionStrategy, Component, computed, input, untracked } from '@angular/core';\n\nimport { injectChartI18n } from '../i18n/chart-i18n';\nimport { type CngxChart } from './chart.component';\n\n/**\n * Companion live-region announcer for `<cngx-chart>`. Mount it next to a\n * chart and bind the chart instance; it voices the chart's\n * `significantChange()` events to assistive technology through two\n * always-in-DOM regions with a severity split (W3C ARIA practice):\n *\n * - trend flips -> a polite `role=\"status\"` region (informational);\n * - threshold crossings -> an assertive `role=\"alert\"` region\n * (operationally significant, warrants interruption).\n *\n * Both announcements are pure-derivation `computed`s the template\n * interpolates - there is no `effect()` bridge and nothing to wrap in\n * `untracked()` (same shape as `CngxRecyclerAnnouncer`). Text is localised\n * through {@link CNGX_CHART_I18N}.\n *\n * ```html\n * <cngx-chart #c [data]=\"points()\" />\n * <cngx-chart-announcer [cngxChartAnnouncer]=\"c\" />\n * ```\n *\n * @category common/chart\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/chart-announcer.component.ts\n * @since 0.1.0\n * @relatedTo CngxChart, createSignificantChangeTracker\n *\n * <example-url>http://localhost:4200/#/common/chart/realtime/streaming-telemetry</example-url>\n */\n@Component({\n selector: 'cngx-chart-announcer',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { style: 'display: contents' },\n template: `\n <span role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" class=\"cngx-sr-only\">{{\n politeAnnouncement()\n }}</span>\n <span role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\" class=\"cngx-sr-only\">{{\n assertiveAnnouncement()\n }}</span>\n `,\n // Ship the visually-hidden rule locally (emulated encapsulation scopes it\n // to these spans) so the announcer stays self-contained even when the\n // global @cngx/themes utilities.css is not loaded - an SR-only region\n // must never fall back to visible text.\n styles: [\n `\n .cngx-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n `,\n ],\n})\nexport class CngxChartAnnouncer {\n /** The chart instance whose `significantChange()` this announcer voices. */\n readonly chart = input.required<CngxChart>({ alias: 'cngxChartAnnouncer' });\n\n private readonly i18n = injectChartI18n();\n\n /**\n * Polite (informational) text for trend flips; empty otherwise. The copy\n * is read untracked: only the chart event re-derives a live region, so a\n * copy or locale flip never re-speaks a shown announcement.\n */\n protected readonly politeAnnouncement = computed(() => {\n const ev = this.chart().significantChange();\n return ev?.kind === 'trend-flip' ? untracked(() => this.i18n().trendChanged(ev.to)) : '';\n });\n\n /** Assertive (interrupting) text for threshold crossings; empty otherwise. Copy untracked, as above. */\n protected readonly assertiveAnnouncement = computed(() => {\n const ev = this.chart().significantChange();\n return ev?.kind === 'threshold-cross'\n ? untracked(() => this.i18n().thresholdAlert(ev.threshold))\n : '';\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { CNGX_CHART_CONTEXT, type CngxChartPlotArea } from '../chart/chart-context';\nimport { CNGX_CHART_AXIS, type CngxChartAxis } from './chart-axis';\nimport { dateTimeFormatterFor, injectLocale } from '@cngx/core/utils';\nimport { formatChartNumber } from '../chart/format-number';\nimport { type CngxAxisPosition, type CngxAxisType } from './axis-position';\n\n/** @internal */\nconst DEFAULT_TICK_COUNT = 5;\n/** @internal */\nconst TICK_LENGTH = 5;\n/** @internal */\nconst LABEL_OFFSET = 4;\n/** @internal */\nconst AXIS_LABEL_OFFSET_INLINE = 32;\n/** @internal */\nconst AXIS_LABEL_OFFSET_BLOCK = 36;\n\n/**\n * The declared default of `--cngx-axis-font-size` (see the tick-label\n * rule in `styles` below), in viewBox user units.\n *\n * Duplicated here because {@link CngxAxis.reservation} is arithmetic\n * over label strings and reads nothing from the DOM - resolving the\n * custom property would mean a `getComputedStyle` call in the reactive\n * graph. A consumer restyling the property therefore gets tick labels\n * at their size inside a gutter sized for the default; that is the\n * single limitation the chart-area debt register covers.\n *\n * @internal\n */\nconst AXIS_FONT_SIZE = 11;\n\n/**\n * The declared default of `--cngx-axis-axis-label-font-size`. Same\n * no-DOM-read reasoning as {@link AXIS_FONT_SIZE}.\n *\n * @internal\n */\nconst AXIS_LABEL_FONT_SIZE = 12;\n\n/**\n * Width of one character as a fraction of the font size. An estimate,\n * not the font's real advance width - the axis knows its label strings\n * but not the glyphs they resolve to.\n *\n * `0.65` covers the measured digit advance in the demo app's font\n * stack: at 11px `system-ui` a digit lays out 7.0 units wide, a ratio\n * of 0.636. Digits are the common case on an axis and the widest\n * per-character case in a numeric label - separators and decimal points\n * are narrower, so a thousands-separated label over-reserves, which is\n * the correct direction to be wrong in.\n *\n * @internal\n */\nconst CHAR_ADVANCE_RATIO = 0.65;\n\n/**\n * Height of a rendered line box as a fraction of the font size, sized\n * so that *half* of it still covers the taller half. A label reaches\n * above its ascender and below its descender, so it needs more than the\n * font size: at 11px the browser lays out 13, a ratio of 1.18. It is\n * also not centred on its anchor - a `dominant-baseline: middle` label\n * measures 8.11 above the anchor and 4.89 below, so a symmetric half of\n * the true line box under-reserves on the taller side by exactly the\n * amount that clips the topmost tick label of a left axis.\n *\n * `1.5` is that asymmetry folded into one number: `11 x 1.5 / 2 = 8.25`\n * covers the measured 8.11, and the full value over-reserves a\n * horizontal axis by about three units, which is the direction to be\n * wrong in.\n *\n * @internal\n */\nconst LINE_BOX_RATIO = 1.5;\n\n/** @internal */\ninterface AxisLabelGeometry {\n readonly transform: string;\n readonly anchor: 'start' | 'middle' | 'end';\n readonly baseline: 'auto' | 'middle' | 'hanging';\n}\n\n/** @internal */\ninterface AxisGeometry {\n readonly transform: string;\n readonly line: {\n readonly x1: number;\n readonly y1: number;\n readonly x2: number;\n readonly y2: number;\n };\n}\n\n/** @internal */\ninterface TickRendering {\n readonly key: string;\n readonly transform: string;\n readonly tickLine: {\n readonly x1: number;\n readonly y1: number;\n readonly x2: number;\n readonly y2: number;\n };\n /**\n * Endpoint of the gridline that extends from this tick across the\n * chart's perpendicular dimension. `(x1, y1)` is always `(0, 0)`\n * (the tick's local origin); `(x2, y2)` reaches the opposite side\n * of the chart area. Always present in the tick rendering - the\n * `[showGrid]` input controls whether the line is rendered, not\n * whether the geometry is computed.\n */\n readonly gridLine: { readonly x2: number; readonly y2: number };\n readonly label: {\n readonly x: number;\n readonly y: number;\n readonly anchor: 'start' | 'middle' | 'end';\n readonly baseline: 'auto' | 'middle' | 'hanging';\n readonly text: string;\n };\n}\n\n/**\n * Declarative axis directive. Lives as a content child of\n * `<cngx-chart>`; its `position` + `type` + `domain` inputs feed the\n * parent's scale derivation. Renders SVG ticks and labels in the\n * coordinate system the parent publishes via {@link CNGX_CHART_CONTEXT}.\n *\n * Attribute-selector on `<svg:g>` - the host element IS the SVG group.\n * This keeps the namespace boundary clean: a `<cngx-axis>` element\n * inside `<svg>` would be in the XHTML namespace and SVG layout would\n * not flow through it. By making the directive attribute-only, the\n * host stays in the SVG namespace and the browser lays out tick lines\n * and labels exactly where the geometry says.\n *\n * Host carries `aria-hidden=\"true\"` - axis text is decoration; the\n * semantic data view lives on the parent chart's auto-Summary and\n * Data Table.\n *\n * @category common/chart/axis\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/axis/axis.component.ts\n * @since 0.1.0\n * @relatedTo CngxChart, CngxLine, CngxBar, CngxArea\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxAxis]',\n exportAs: 'cngxAxis',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_AXIS, useExisting: CngxAxis }],\n host: {\n 'aria-hidden': 'true',\n '[attr.transform]': 'axisGeometry()?.transform ?? null',\n '[attr.class]': 'hostClass()',\n },\n template: `\n @if (axisGeometry(); as g) {\n @if (showGrid()) {\n @for (tick of tickRenderings(); track tick.key) {\n <svg:line\n [attr.transform]=\"tick.transform\"\n [attr.x1]=\"0\"\n [attr.y1]=\"0\"\n [attr.x2]=\"tick.gridLine.x2\"\n [attr.y2]=\"tick.gridLine.y2\"\n class=\"cngx-axis__grid-line\"\n />\n }\n }\n <svg:line\n [attr.x1]=\"g.line.x1\"\n [attr.y1]=\"g.line.y1\"\n [attr.x2]=\"g.line.x2\"\n [attr.y2]=\"g.line.y2\"\n class=\"cngx-axis__line\"\n />\n @for (tick of tickRenderings(); track tick.key) {\n <svg:g [attr.transform]=\"tick.transform\" class=\"cngx-axis__tick\">\n <svg:line\n [attr.x1]=\"tick.tickLine.x1\"\n [attr.y1]=\"tick.tickLine.y1\"\n [attr.x2]=\"tick.tickLine.x2\"\n [attr.y2]=\"tick.tickLine.y2\"\n class=\"cngx-axis__tick-line\"\n />\n <svg:text\n [attr.x]=\"tick.label.x\"\n [attr.y]=\"tick.label.y\"\n [attr.text-anchor]=\"tick.label.anchor\"\n [attr.dominant-baseline]=\"tick.label.baseline\"\n class=\"cngx-axis__tick-label\"\n >\n {{ tick.label.text }}\n </svg:text>\n </svg:g>\n }\n @if (axisLabel(); as title) {\n @if (axisLabelGeometry(); as g) {\n <svg:text\n class=\"cngx-axis__axis-label\"\n [attr.transform]=\"g.transform\"\n [attr.text-anchor]=\"g.anchor\"\n [attr.dominant-baseline]=\"g.baseline\"\n >\n {{ title }}\n </svg:text>\n }\n }\n }\n `,\n styles: [\n `\n .cngx-axis__line,\n .cngx-axis__tick-line {\n stroke: var(--cngx-axis-color, var(--cngx-chart-axis-color, currentColor));\n stroke-width: var(--cngx-axis-stroke-width, 1px);\n fill: none;\n }\n .cngx-axis__tick-label {\n fill: var(--cngx-axis-text-color, var(--cngx-chart-text-color, currentColor));\n font-size: var(--cngx-axis-font-size, 11px);\n unicode-bidi: var(--cngx-chart-numeric-bidi, isolate);\n }\n .cngx-axis__grid-line {\n stroke: var(--cngx-axis-grid-color, var(--cngx-chart-grid-color, currentColor));\n stroke-opacity: var(--cngx-axis-grid-opacity, 0.6);\n stroke-width: var(--cngx-axis-grid-stroke-width, 1px);\n stroke-dasharray: var(--cngx-axis-grid-dasharray, 0);\n fill: none;\n pointer-events: none;\n }\n .cngx-axis__axis-label {\n fill: var(--cngx-axis-axis-label-color, var(--cngx-chart-text-color, currentColor));\n font-size: var(--cngx-axis-axis-label-font-size, 12px);\n font-weight: var(--cngx-axis-axis-label-font-weight, 500);\n }\n /* forced-colors (WHCM): Chromium keeps author stroke and fill inside\n SVG (preserve-parent-color), so the axes kept their greys while the\n series follow the user palette. Rules and labels paint CanvasText;\n the grid is CanvasText at a reduced opacity (GrayText is a loud hue\n in several contrast themes and would compete with the series). */\n @media (forced-colors: active) {\n .cngx-axis__line,\n .cngx-axis__tick-line,\n .cngx-axis__grid-line {\n stroke: CanvasText;\n }\n .cngx-axis__grid-line {\n stroke-opacity: 0.35;\n }\n .cngx-axis__tick-label,\n .cngx-axis__axis-label {\n fill: CanvasText;\n }\n }\n `,\n ],\n})\nexport class CngxAxis implements CngxChartAxis {\n readonly position = input.required<CngxAxisPosition>();\n readonly type = input<CngxAxisType>('linear');\n readonly domain = input<readonly unknown[] | undefined>(undefined);\n readonly tickCount = input<number | undefined>(undefined, { alias: 'ticks' });\n readonly format = input<(v: unknown) => string>(defaultTickFormat);\n /**\n * Render decorative gridlines extending from each tick across the\n * chart's perpendicular dimension. Theming via the\n * `--cngx-axis-grid-color` / `--cngx-axis-grid-opacity` /\n * `--cngx-axis-grid-stroke-width` / `--cngx-axis-grid-dasharray`\n * CSS custom properties (defaults: chart-level grid colour, 0.6\n * opacity, 1px solid). Aliased as `[grid]` for terseness.\n */\n readonly showGrid = input<boolean>(false, { alias: 'grid' });\n /**\n * Optional axis title rendered alongside the tick labels -\n * \"Months\", \"Revenue (k€)\", etc. The title is positioned outside\n * the tick labels (further from the chart area) and rotated -90°\n * for left/right axes so it reads bottom-to-top. Theming via the\n * `--cngx-axis-axis-label-color` and `--cngx-axis-axis-label-font-size`\n * CSS custom properties (default: chart text colour + 12px). Aliased\n * `[label]` for terseness.\n */\n readonly axisLabel = input<string | null>(null, { alias: 'label' });\n\n private readonly ctx = inject(CNGX_CHART_CONTEXT);\n private readonly locale = injectLocale();\n\n /**\n * The bound `[format]`, or the default tick formatter bound to the app\n * locale (`CNGX_LOCALE`), so a locale flip re-formats the default labels.\n */\n private readonly resolvedFormat = computed<(v: unknown) => string>(() => {\n const fmt = this.format();\n if (fmt !== defaultTickFormat) {\n return fmt;\n }\n const locale = this.locale();\n return (v) => defaultTickFormat(v, locale);\n });\n\n /**\n * Tick values to render. Resolution order:\n * 1. `type='band'` and `[domain]` provided → one tick per domain\n * value.\n * 2. linear/time + `[domain]` provided → `[ticks]`-many evenly\n * spaced positions across the domain (default 5).\n * 3. Otherwise → empty array. Axis still renders the line.\n */\n readonly tickValues = computed<readonly unknown[]>(\n () => {\n const dom = this.domain();\n const count = this.tickCount() ?? DEFAULT_TICK_COUNT;\n const t = this.type();\n\n if (t === 'band') {\n return dom ?? [];\n }\n\n if (!dom || dom.length < 2) {\n return [];\n }\n\n if (t === 'time') {\n const start = toMs(dom[0]);\n const end = toMs(dom.at(-1));\n return spread(start, end, count).map((ms) => new Date(ms));\n }\n\n const start = Number(dom[0]);\n const end = Number(dom.at(-1));\n return spread(start, end, count);\n },\n {\n equal: (a, b) => {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const av = a[i];\n const bv = b[i];\n if (Object.is(av, bv)) {\n continue;\n }\n if (av instanceof Date && bv instanceof Date && av.getTime() === bv.getTime()) {\n continue;\n }\n return false;\n }\n return true;\n },\n },\n );\n\n /**\n * How far this axis's decoration extends perpendicular to its own\n * line, in viewBox user units. The parent chart reads it to size the\n * plot inset on the side {@link position} names; nothing else\n * consumes it.\n *\n * The magnitude is derived, not configured. A vertical axis reserves\n * for the tick gap plus the *longest formatted tick label*, because a\n * left label grows leftward with its character count. A horizontal\n * axis reserves the tick gap plus one line box, because a bottom\n * label grows downward by its height no matter how long it is. An\n * axis carrying a {@link axisLabel} title reserves at least the\n * title's own fixed offset plus its line box, since\n * `buildAxisLabelGeometry` places the title at a constant distance\n * from the line rather than beyond the ticks - so the two extents\n * are alternatives, not addends.\n *\n * Character width is an estimate ({@link CHAR_ADVANCE_RATIO}), which\n * is the one value here that is not derived from state the axis\n * owns. Everything else comes from {@link tickValues} and\n * {@link format}, which the component already computes to render the\n * labels themselves - so this reads no DOM, measures no text, and\n * returns the same number under SSR as in the browser.\n *\n * Acyclic by construction: {@link tickValues} reads `domain` /\n * `ticks` / `type` and never the scale, so\n * `reservation -> inset -> plot -> scale -> tickRenderings` has no\n * back edge.\n */\n readonly reservation = computed<number>(() => {\n const horizontal = this.position() === 'top' || this.position() === 'bottom';\n\n const labelExtent = horizontal ? AXIS_FONT_SIZE * LINE_BOX_RATIO : this.widestTickLabel();\n const tickRoom = TICK_LENGTH + LABEL_OFFSET + labelExtent;\n\n const titleRoom = this.axisLabel()\n ? (horizontal ? AXIS_LABEL_OFFSET_INLINE : AXIS_LABEL_OFFSET_BLOCK) +\n AXIS_LABEL_FONT_SIZE * LINE_BOX_RATIO\n : 0;\n\n // Whole user units, rounded up: the estimate is already an\n // approximation, so rounding down would trade a clean number for a\n // clipped glyph. It also keeps the axis `transform` a short\n // integer string instead of the float noise the ratio produces.\n return Math.ceil(Math.max(tickRoom, titleRoom));\n });\n\n /**\n * How far this axis's decoration extends *along* its own line, past\n * the plot corner at either end. The parent chart reserves it on the\n * two sides perpendicular to {@link position}.\n *\n * A tick label is centred on its tick, and the extreme ticks sit\n * exactly on the plot corners - so half of the first and last label\n * hangs outside the plot no matter how much room the axis's own side\n * reserves. A left axis's topmost label overhangs upward by half a\n * line box; a bottom axis's last label overhangs rightward by half\n * its width. Reserving only on the side the axis occupies leaves\n * both of those painting outside the viewBox, which is the defect\n * this pairs with {@link reservation} to close.\n *\n * The widest label stands in for the two extreme ones. Being wrong\n * here means over-reserving by a few units on an axis whose ends\n * happen to carry its shortest labels, which is cheaper than the\n * per-end bookkeeping the exact answer would need.\n */\n readonly crossReservation = computed<number>(() => {\n const horizontal = this.position() === 'top' || this.position() === 'bottom';\n const extent = horizontal ? this.widestTickLabel() : AXIS_FONT_SIZE * LINE_BOX_RATIO;\n return Math.ceil(extent / 2);\n });\n\n /**\n * Estimated width of the widest formatted tick label, in viewBox user\n * units. Split out so a horizontal axis reads it only where label\n * width actually matters - its own reservation is a line box, and\n * only its cross-axis overhang depends on the strings.\n */\n private readonly widestTickLabel = computed<number>(\n () => this.longestTickLabel() * AXIS_FONT_SIZE * CHAR_ADVANCE_RATIO,\n );\n\n /**\n * Character count of the widest formatted tick label. Split out so\n * that {@link reservation} on a horizontal axis never reads it - a\n * bottom label's own gutter is its height, so tracking the label\n * strings there would add a dependency that cannot change the result.\n * {@link crossReservation} does read it in the horizontal case, where\n * the label's width is exactly what overhangs the plot corner.\n */\n private readonly longestTickLabel = computed<number>(() => {\n const fmt = this.resolvedFormat();\n let longest = 0;\n for (const v of this.tickValues()) {\n const len = fmt(v).length;\n if (len > longest) {\n longest = len;\n }\n }\n return longest;\n });\n\n protected readonly hostClass = computed(() => `cngx-axis cngx-axis--${this.position()}`);\n\n /**\n * The chart's plot area, or `null` once it has collapsed on either\n * dimension - the same condition under which the chart hands out its\n * NOOP scale, so a collapsed chart renders no axis rather than an\n * axis against a backwards range.\n *\n * The rectangle itself is the chart's derivation, read straight off\n * the context. The axis narrows it to a render/do-not-render\n * decision; it never reconstructs it from the box.\n */\n private readonly plot = computed<CngxChartPlotArea | null>(() => {\n const plot = this.ctx.plot();\n return plot.width <= 0 || plot.height <= 0 ? null : plot;\n });\n\n protected readonly axisLabelGeometry = computed<AxisLabelGeometry | null>(\n () => {\n const plot = this.plot();\n if (!plot) {\n return null;\n }\n return buildAxisLabelGeometry(this.position(), plot);\n },\n {\n equal: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.transform === b.transform &&\n a.anchor === b.anchor &&\n a.baseline === b.baseline),\n },\n );\n\n protected readonly axisGeometry = computed<AxisGeometry | null>(\n () => {\n const plot = this.plot();\n if (!plot) {\n return null;\n }\n return buildAxisGeometry(this.position(), plot);\n },\n {\n equal: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.transform === b.transform &&\n a.line.x1 === b.line.x1 &&\n a.line.y1 === b.line.y1 &&\n a.line.x2 === b.line.x2 &&\n a.line.y2 === b.line.y2),\n },\n );\n\n protected readonly tickRenderings = computed<readonly TickRendering[]>(\n () => {\n const pos = this.position();\n const values = this.tickValues();\n const fmt = this.resolvedFormat();\n const plot = this.plot();\n if (!plot) {\n return [];\n }\n const isHorizontal = pos === 'top' || pos === 'bottom';\n const scale = isHorizontal ? this.ctx.xScale() : this.ctx.yScale();\n return values.map((v, i) => {\n const offset = (scale as (input: unknown) => number)(v);\n return buildTickRendering(pos, offset, fmt(v), `${i}-${String(v)}`, plot);\n });\n },\n {\n equal: (a, b) => {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const ta = a[i];\n const tb = b[i];\n if (\n ta.key !== tb.key ||\n ta.transform !== tb.transform ||\n ta.label.text !== tb.label.text ||\n ta.tickLine.x1 !== tb.tickLine.x1 ||\n ta.tickLine.y1 !== tb.tickLine.y1 ||\n ta.tickLine.x2 !== tb.tickLine.x2 ||\n ta.tickLine.y2 !== tb.tickLine.y2 ||\n ta.gridLine.x2 !== tb.gridLine.x2 ||\n ta.gridLine.y2 !== tb.gridLine.y2\n ) {\n return false;\n }\n }\n return true;\n },\n },\n );\n}\n\n/** @internal */\nfunction spread(start: number, end: number, count: number): number[] {\n if (count <= 1) {\n return [start];\n }\n const span = end - start;\n const step = span / (count - 1);\n const out = new Array<number>(count);\n for (let i = 0; i < count; i++) {\n out[i] = start + step * i;\n }\n return out;\n}\n\n/** @internal */\nfunction toMs(v: unknown): number {\n if (typeof v === 'number') {\n return v;\n }\n if (v instanceof Date) {\n return v.getTime();\n }\n return Number(v);\n}\n\n/**\n * Places the axis group on the plot edge and spans its line across the\n * plot extent.\n *\n * The group only translates along the axis's *perpendicular* direction:\n * a bottom axis moves in y and stays at `x = 0`, because the tick\n * offsets the scale hands back are already absolute viewBox\n * coordinates and would double-count an inset baked into the group's\n * own translate.\n *\n * @internal\n */\nfunction buildAxisGeometry(pos: CngxAxisPosition, plot: CngxChartPlotArea): AxisGeometry {\n switch (pos) {\n case 'top':\n return {\n transform: `translate(0,${plot.y0})`,\n line: { x1: plot.x0, y1: 0, x2: plot.x1, y2: 0 },\n };\n case 'bottom':\n return {\n transform: `translate(0,${plot.y1})`,\n line: { x1: plot.x0, y1: 0, x2: plot.x1, y2: 0 },\n };\n case 'left':\n return {\n transform: `translate(${plot.x0},0)`,\n line: { x1: 0, y1: plot.y0, x2: 0, y2: plot.y1 },\n };\n case 'right':\n return {\n transform: `translate(${plot.x1},0)`,\n line: { x1: 0, y1: plot.y0, x2: 0, y2: plot.y1 },\n };\n }\n}\n\n/** @internal */\nfunction buildTickRendering(\n pos: CngxAxisPosition,\n offset: number,\n text: string,\n key: string,\n plot: CngxChartPlotArea,\n): TickRendering {\n switch (pos) {\n case 'bottom':\n return {\n key,\n transform: `translate(${offset},0)`,\n tickLine: { x1: 0, y1: 0, x2: 0, y2: TICK_LENGTH },\n gridLine: { x2: 0, y2: -plot.height },\n label: {\n x: 0,\n y: TICK_LENGTH + LABEL_OFFSET,\n anchor: 'middle',\n baseline: 'hanging',\n text,\n },\n };\n case 'top':\n return {\n key,\n transform: `translate(${offset},0)`,\n tickLine: { x1: 0, y1: 0, x2: 0, y2: -TICK_LENGTH },\n gridLine: { x2: 0, y2: plot.height },\n label: {\n x: 0,\n y: -TICK_LENGTH - LABEL_OFFSET,\n anchor: 'middle',\n baseline: 'auto',\n text,\n },\n };\n case 'left':\n return {\n key,\n transform: `translate(0,${offset})`,\n tickLine: { x1: 0, y1: 0, x2: -TICK_LENGTH, y2: 0 },\n gridLine: { x2: plot.width, y2: 0 },\n label: {\n x: -TICK_LENGTH - LABEL_OFFSET,\n y: 0,\n anchor: 'end',\n baseline: 'middle',\n text,\n },\n };\n case 'right':\n return {\n key,\n transform: `translate(0,${offset})`,\n tickLine: { x1: 0, y1: 0, x2: TICK_LENGTH, y2: 0 },\n gridLine: { x2: -plot.width, y2: 0 },\n label: {\n x: TICK_LENGTH + LABEL_OFFSET,\n y: 0,\n anchor: 'start',\n baseline: 'middle',\n text,\n },\n };\n }\n}\n\n/**\n * Default tick label formatter. Strips floating-point arithmetic\n * noise from non-integer numbers - `6.6000000000000005` becomes\n * `'6.6'`, `2.2` stays `'2.2'`, `25` stays `'25'` - without rounding\n * away meaningful precision, in the app locale's decimal separator.\n * Dates go through cached `Intl` formatters ({@link formatDateTick});\n * other types fall through to `String(v)`. Consumers needing a richer\n * format bind `[format]`. `CngxAxis` calls it with the `CNGX_LOCALE`\n * value; the `en-US` default only applies to a direct call.\n *\n * @internal\n */\nfunction defaultTickFormat(v: unknown, locale = 'en-US'): string {\n if (typeof v === 'number') {\n return formatChartNumber(v, locale);\n }\n if (v instanceof Date) {\n return formatDateTick(v, locale);\n }\n return String(v);\n}\n\n/** @internal */\nconst DATE_TICK_OPTIONS: Intl.DateTimeFormatOptions = { month: 'short', day: 'numeric' };\n/** @internal */\nconst TIME_TICK_OPTIONS: Intl.DateTimeFormatOptions = { hour: '2-digit', minute: '2-digit' };\n/** @internal */\nconst TIME_SECONDS_TICK_OPTIONS: Intl.DateTimeFormatOptions = {\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n};\n\n/**\n * Compact Date tick label. `String(Date)` produces a ~60-character\n * string whose length flows into {@link CngxAxis.reservation} and\n * collapses the plot to a sliver of gutter. Instead: a date at local\n * midnight labels as a short date (`Sep 4`), any other instant as a\n * time (`09:14`, with seconds only when the instant carries them) -\n * the resolution a generated time-axis tick actually has. Formatters\n * come from the bounded `dateTimeFormatterFor` cache (constructing one\n * is expensive; the labels feed the gutter arithmetic on every tick\n * recompute).\n *\n * @internal\n */\nfunction formatDateTick(v: Date, locale: string): string {\n if (Number.isNaN(v.getTime())) {\n return '';\n }\n const midnight =\n v.getHours() === 0 && v.getMinutes() === 0 && v.getSeconds() === 0 && v.getMilliseconds() === 0;\n if (midnight) {\n return dateTimeFormatterFor(locale, DATE_TICK_OPTIONS).format(v);\n }\n if (v.getSeconds() === 0 && v.getMilliseconds() === 0) {\n return dateTimeFormatterFor(locale, TIME_TICK_OPTIONS).format(v);\n }\n return dateTimeFormatterFor(locale, TIME_SECONDS_TICK_OPTIONS).format(v);\n}\n\n/** @internal */\nfunction buildAxisLabelGeometry(pos: CngxAxisPosition, plot: CngxChartPlotArea): AxisLabelGeometry {\n // Local to the axis group, so the offsets stay as they were and only\n // the centring runs along the plot extent instead of the box.\n const midX = plot.x0 + plot.width / 2;\n const midY = plot.y0 + plot.height / 2;\n switch (pos) {\n case 'bottom':\n return {\n transform: `translate(${midX},${AXIS_LABEL_OFFSET_INLINE})`,\n anchor: 'middle',\n baseline: 'hanging',\n };\n case 'top':\n return {\n transform: `translate(${midX},${-AXIS_LABEL_OFFSET_INLINE})`,\n anchor: 'middle',\n baseline: 'auto',\n };\n case 'left':\n return {\n transform: `translate(${-AXIS_LABEL_OFFSET_BLOCK},${midY}) rotate(-90)`,\n anchor: 'middle',\n baseline: 'auto',\n };\n case 'right':\n return {\n transform: `translate(${AXIS_LABEL_OFFSET_BLOCK},${midY}) rotate(90)`,\n anchor: 'middle',\n baseline: 'auto',\n };\n }\n}\n","import { Directive, input, signal, type Signal } from '@angular/core';\nimport { CNGX_CHART_AXIS, type CngxChartAxis } from './chart-axis';\nimport { type CngxAxisPosition, type CngxAxisType } from './axis-position';\n\n/**\n * @internal Both reservations of every domain publisher are the same\n * constant, so one frozen node serves all of them rather than two per\n * directive instance.\n */\nconst NO_RESERVATION: Signal<number> = signal(0).asReadonly();\n\n/**\n * Declares a scale domain to the parent `<cngx-chart>` without drawing\n * anything.\n *\n * A chart builds its `xScale` from whichever projected axis occupies a\n * horizontal edge and its `yScale` from a vertical one. Usually that\n * axis also draws ticks and labels, and `[cngxAxis]` is what you want.\n * Sometimes the domain is all you need: a sparkline has no room for\n * decoration, but its line still has to know that y runs 0 to 100.\n *\n * ```html\n * <cngx-chart [data]=\"readings()\">\n * <svg:g cngxAxisDomain position=\"bottom\" type=\"band\" [domain]=\"labels()\"></svg:g>\n * <svg:g cngxAxisDomain position=\"left\" [domain]=\"[0, 100]\"></svg:g>\n * <svg:g cngxLine></svg:g>\n * </cngx-chart>\n * ```\n *\n * Reserving nothing is the behavioural difference that matters. The\n * chart shrinks its plot area by the room each axis's decoration needs;\n * this one has none, so an 80x24 sparkline keeps all 80x24 for its mark\n * instead of losing a gutter to ticks nobody draws.\n *\n * Attribute-selector on `<svg:g>` for the same reason `[cngxAxis]` is:\n * a `<cngx-axis-domain>` element inside `<svg>` would land in the XHTML\n * namespace. Nothing renders either way, but the host stays a legal SVG\n * child.\n *\n * @category common/chart/axis\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/axis/axis-domain.ts\n * @since 0.1.0\n * @relatedTo CngxAxis, CngxChart, CngxChartAxis\n *\n * <example-url>http://localhost:4200/#/ui/chart-panel/basic/titled-panel-with-legend</example-url>\n * <example-url>http://localhost:4200/#/ui/chart-panel/slots/actions-and-footer</example-url>\n */\n@Directive({\n selector: '[cngxAxisDomain]',\n exportAs: 'cngxAxisDomain',\n standalone: true,\n providers: [{ provide: CNGX_CHART_AXIS, useExisting: CngxAxisDomain }],\n})\nexport class CngxAxisDomain implements CngxChartAxis {\n /** Which edge the scale this publishes belongs to. */\n readonly position = input.required<CngxAxisPosition>();\n /** Scale kind the chart builds for this dimension. */\n readonly type = input<CngxAxisType>('linear');\n /** Value range the scale maps from. */\n readonly domain = input<readonly unknown[] | undefined>(undefined);\n\n /**\n * Always `0`. Not an opt-out from a gutter this directive would\n * otherwise get - it draws nothing, so there is nothing to reserve\n * for, and the number stays derived from what the unit does.\n */\n readonly reservation = NO_RESERVATION;\n\n /** Always `0`, for the same reason as {@link reservation}. */\n readonly crossReservation = NO_RESERVATION;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectLocale } from '@cngx/core/utils';\nimport { arrayEqual } from '@cngx/utils';\n\nimport { formatChartNumber } from '../chart/format-number';\n\n/**\n * Single legend entry. `color` is optional - when omitted the swatch\n * falls back to the chart-level primary token. `value` is rendered as a\n * trailing `.cngx-chart-legend__value` node when present (`!= null`, so a\n * literal `0` still shows), turning a legend into a readout. A number value\n * renders in the app locale (`6,6` in German); any other value as text. It stays\n * intentionally unconstrained so the same field a consumer weights in the\n * row can still carry their domain key (id, layer name, accessor return\n * type, ...) for later interactions without a second lookup.\n *\n * @category common/chart/legend\n */\nexport interface CngxChartLegendItem<T = unknown> {\n readonly label: string;\n readonly color?: string | null;\n readonly value?: T;\n}\n\n/**\n * Presentational legend atom - a row (or column) of coloured swatches\n * paired with labels. Decoupled from `<cngx-chart>` and the layer\n * atoms by design: the consumer drives the items array, so the\n * legend stays a pure rendering surface with zero opinions about\n * series-discovery, visibility-toggling, or interaction.\n *\n * Compose alongside a chart wherever a multi-layer composition needs\n * a label key:\n *\n * ```html\n * <cngx-chart [data]=\"series\">\n * <svg:g cngxLine [data]=\"traffic\" style=\"--cngx-line-color: #3b82f6\"></svg:g>\n * <svg:g cngxLine [data]=\"errors\" style=\"--cngx-line-color: #d2452f\"></svg:g>\n * </cngx-chart>\n * <cngx-chart-legend\n * [items]=\"[\n * { label: 'Traffic', color: '#3b82f6' },\n * { label: 'Errors', color: '#d2452f' }\n * ]\"\n * />\n * ```\n *\n * Theming via `--cngx-chart-legend-gap`,\n * `--cngx-chart-legend-swatch-size`, `--cngx-chart-legend-swatch-radius`,\n * `--cngx-chart-legend-font-size`. A rendered `value` carries its own\n * `--cngx-chart-legend-value-color` and `--cngx-chart-legend-value-font-weight`\n * so a legend doubling as a readout can weight the number apart from the\n * label without a wrapper element. `[orientation]` flips between row\n * and column; `[align]` aligns along the main axis (`start`, `center`,\n * `end`).\n *\n * Under forced colors the swatches turn into a four-step pattern by\n * entry index (solid, 45deg hatch, hollow, 0deg hatch). The stacked-bar\n * segments and the chart series carry the same step by index: lines as\n * solid, dashed, dotted, dash-dot; bars and scatter points as the swatch\n * patterns. Series count line, bar and scatter layers in source order\n * (areas, thresholds, bands and axes do not count), so list the entries\n * in the order of those layers.\n *\n * @category common/chart/legend\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/legend/legend.component.ts\n * @since 0.1.0\n * @relatedTo CngxChart, CngxLine, CngxBar\n */\n@Component({\n selector: 'cngx-chart-legend',\n exportAs: 'cngxChartLegend',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'list',\n class: 'cngx-chart-legend',\n '[class.cngx-chart-legend--vertical]': 'orientation() === \"vertical\"',\n '[style.justify-content]': 'flexAlign()',\n },\n template: `\n @for (item of items(); track $index; let i = $index) {\n <span class=\"cngx-chart-legend__item\" role=\"listitem\">\n <span\n class=\"cngx-chart-legend__swatch\"\n [style.background]=\"item.color ?? null\"\n aria-hidden=\"true\"\n ></span>\n <span class=\"cngx-chart-legend__label\">{{ item.label }}</span>\n @if (item.value != null) {\n <span class=\"cngx-chart-legend__value\">{{ displayValues()[i] }}</span>\n }\n </span>\n }\n `,\n styles: [\n `\n cngx-chart-legend {\n display: flex;\n flex-wrap: wrap;\n gap: var(--cngx-chart-legend-gap, 12px);\n font-size: var(--cngx-chart-legend-font-size, 0.8125rem);\n color: var(--cngx-chart-legend-color, var(--cngx-chart-text-color, currentColor));\n align-items: center;\n }\n cngx-chart-legend.cngx-chart-legend--vertical {\n flex-direction: column;\n align-items: flex-start;\n }\n cngx-chart-legend .cngx-chart-legend__item {\n display: inline-flex;\n align-items: center;\n gap: var(--cngx-chart-legend-item-gap, 6px);\n }\n cngx-chart-legend .cngx-chart-legend__swatch {\n display: inline-block;\n width: var(--cngx-chart-legend-swatch-size, 12px);\n height: var(--cngx-chart-legend-swatch-size, 12px);\n background: var(--cngx-chart-primary, currentColor);\n border-radius: var(--cngx-chart-legend-swatch-radius, 2px);\n }\n /* forced-colors (WHCM): the swatch is a background-only fill and\n flattens into Canvas. Swatches cycle by index through solid, 45deg\n hatch, hollow and 0deg hatch - the same cycle the stacked-bar preset\n gives its segments and the chart series their dashes and fills - so\n an entry still points at its series.\n !important beats the inline [style.background] binding. */\n @media (forced-colors: active) {\n cngx-chart-legend .cngx-chart-legend__swatch {\n forced-color-adjust: none;\n background: CanvasText !important;\n }\n cngx-chart-legend .cngx-chart-legend__item:nth-child(4n + 2) .cngx-chart-legend__swatch {\n background: repeating-linear-gradient(45deg, CanvasText 0 2px, Canvas 2px 4px) !important;\n }\n cngx-chart-legend .cngx-chart-legend__item:nth-child(4n + 3) .cngx-chart-legend__swatch {\n background: Canvas !important;\n box-shadow: inset 0 0 0 1px CanvasText;\n }\n cngx-chart-legend .cngx-chart-legend__item:nth-child(4n + 4) .cngx-chart-legend__swatch {\n background: repeating-linear-gradient(0deg, CanvasText 0 2px, Canvas 2px 4px) !important;\n }\n }\n cngx-chart-legend .cngx-chart-legend__value {\n color: var(--cngx-chart-legend-value-color, inherit);\n font-weight: var(--cngx-chart-legend-value-font-weight, 600);\n unicode-bidi: var(--cngx-chart-numeric-bidi, isolate);\n }\n `,\n ],\n})\nexport class CngxChartLegend<T = unknown> {\n readonly items = input.required<readonly CngxChartLegendItem<T>[]>();\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n readonly align = input<'start' | 'center' | 'end'>('start');\n\n private readonly locale = injectLocale();\n\n /** @internal Each item's value as display text; numbers in the app locale. */\n protected readonly displayValues = computed(\n () => {\n const locale = this.locale();\n return this.items().map(({ value }) =>\n typeof value === 'number' ? formatChartNumber(value, locale) : String(value),\n );\n },\n { equal: arrayEqual },\n );\n\n protected readonly flexAlign = computed(() => {\n switch (this.align()) {\n case 'center':\n return 'center';\n case 'end':\n return 'flex-end';\n default:\n return 'flex-start';\n }\n });\n}\n","import type { ScaleFn, XScaleInput } from '../chart/chart-context';\nimport type { LineXAccessor, LineYAccessor } from '../path/path-builder';\nimport type { LayerGeometry } from './chart-layer';\n\n/**\n * Scale-projected centre of a single point marker on a line / area\n * layer.\n *\n * @internal\n */\nexport interface PointMark {\n readonly cx: number;\n readonly cy: number;\n}\n\n/**\n * Shared stable empty-marks reference, so the \"no markers\" case does\n * not allocate a fresh array that would defeat the geometry `equal`.\n *\n * @internal\n */\nexport const EMPTY_POINTS: readonly PointMark[] = [];\n\n/**\n * Project the datapoints a line / area layer chooses to mark into\n * pixel-space centres. Markers draw when `mode` is `'always'`, or\n * `'auto'` with a single datum - the frame a warming series passes\n * through that would otherwise paint an invisible zero-length path.\n * Pure: the caller reads the signals inside its `computed`; this only\n * maps the resolved values, so line and area share one derivation.\n *\n * @internal\n */\nexport function derivePointMarks<T>(\n mode: 'auto' | 'always' | 'never',\n data: readonly T[],\n xScale: ScaleFn<XScaleInput>,\n yScale: ScaleFn<number>,\n yAcc: LineYAccessor<T>,\n xAcc: LineXAccessor<T>,\n): readonly PointMark[] {\n const draw = mode === 'always' || (mode === 'auto' && data.length === 1);\n if (!draw || data.length === 0) {\n return EMPTY_POINTS;\n }\n const out = new Array<PointMark>(data.length);\n for (let i = 0; i < data.length; i++) {\n out[i] = { cx: xScale(xAcc(data[i], i)), cy: yScale(yAcc(data[i], i)) };\n }\n return out;\n}\n\n/**\n * Structural equality for the shared `'line' | 'area'` geometry\n * variant: `d` string, scalar stroke / fill / opacity fields, and a\n * length-plus-elementwise comparison of the `points` marker pass. Line\n * and area share it - area's null stroke / fill / color fields compare\n * equal, so one comparator covers both without a per-atom near-copy.\n * Extending (not dropping) the comparator keeps the array field under a\n * working `equal`; an array computed without one cascades on every\n * rebuild.\n *\n * @internal\n */\nexport function lineAreaGeomEqual(a: LayerGeometry, b: LayerGeometry): boolean {\n if (a === b) {\n return true;\n }\n if ((a.kind !== 'line' && a.kind !== 'area') || (b.kind !== 'line' && b.kind !== 'area')) {\n return false;\n }\n if (a.kind !== b.kind) {\n return false;\n }\n return (\n a.d === b.d &&\n a.color === b.color &&\n a.strokeWidth === b.strokeWidth &&\n a.fill === b.fill &&\n a.opacity === b.opacity &&\n pointsEqual(a.points, b.points)\n );\n}\n\n/**\n * Length-plus-elementwise equality for the optional `points` marker\n * pass. Absent and empty are equivalent.\n *\n * @internal\n */\nexport function pointsEqual(\n a: readonly PointMark[] | undefined,\n b: readonly PointMark[] | undefined,\n): boolean {\n const ap = a ?? EMPTY_POINTS;\n const bp = b ?? EMPTY_POINTS;\n if (ap === bp) {\n return true;\n }\n if (ap.length !== bp.length) {\n return false;\n }\n for (let i = 0; i < ap.length; i++) {\n if (ap[i].cx !== bp[i].cx || ap[i].cy !== bp[i].cy) {\n return false;\n }\n }\n return true;\n}\n","/**\n * Curve interpolators for line / area path builders. Each function\n * returns the **interior** path commands that connect a series of\n * points; the caller is responsible for the leading `M` and any\n * trailing close commands.\n *\n * Pure TS, no DOM dependency, no Angular dep.\n *\n * @category common/chart/path\n */\nexport type CngxCurve = 'linear' | 'monotone';\n\n/**\n * Pixel-space point fed into {@link buildCurvePath}.\n *\n * @category common/chart/path\n */\nexport interface PathPoint {\n readonly x: number;\n readonly y: number;\n}\n\n/**\n * Build the SVG `d` attribute for a sequence of points.\n *\n * @param points Pixel-coordinate points to connect.\n * @param curve Interpolation strategy. `'linear'` joins points with\n * straight `L` commands; `'monotone'` uses cubic Béziers with the\n * monotone-X tangent rule (Fritsch-Carlson) so the curve never\n * overshoots between data points.\n * @returns The full path data starting with `M`. Returns `''` when\n * the input is empty; `M x y` when the input has one point.\n *\n * @category common/chart/path\n */\nexport function buildCurvePath(points: readonly PathPoint[], curve: CngxCurve): string {\n if (points.length === 0) {\n return '';\n }\n if (points.length === 1) {\n const p = points[0];\n return `M ${p.x} ${p.y}`;\n }\n if (curve === 'linear') {\n return buildLinearPath(points);\n }\n return buildMonotonePath(points);\n}\n\n/** @internal */\nfunction buildLinearPath(points: readonly PathPoint[]): string {\n const start = points[0];\n let out = `M ${start.x} ${start.y}`;\n for (let i = 1; i < points.length; i++) {\n out += ` L ${points[i].x} ${points[i].y}`;\n }\n return out;\n}\n\n/**\n * Monotone cubic Bézier interpolation (Fritsch-Carlson tangents on the\n * X dimension). Input points must have strictly increasing `x`\n * coordinates.\n *\n * @internal\n */\nfunction buildMonotonePath(points: readonly PathPoint[]): string {\n const n = points.length;\n const slopes = new Array<number>(n - 1);\n for (let i = 0; i < n - 1; i++) {\n const dx = points[i + 1].x - points[i].x;\n slopes[i] = dx === 0 ? 0 : (points[i + 1].y - points[i].y) / dx;\n }\n const tangents = new Array<number>(n);\n tangents[0] = slopes[0];\n tangents[n - 1] = slopes[n - 2];\n for (let i = 1; i < n - 1; i++) {\n const m1 = slopes[i - 1];\n const m2 = slopes[i];\n if (m1 * m2 <= 0) {\n tangents[i] = 0;\n } else {\n tangents[i] = (2 * m1 * m2) / (m1 + m2);\n }\n }\n let out = `M ${points[0].x} ${points[0].y}`;\n for (let i = 0; i < n - 1; i++) {\n const p0 = points[i];\n const p1 = points[i + 1];\n const dx = p1.x - p0.x;\n const c1x = p0.x + dx / 3;\n const c1y = p0.y + (tangents[i] * dx) / 3;\n const c2x = p1.x - dx / 3;\n const c2y = p1.y - (tangents[i + 1] * dx) / 3;\n out += ` C ${c1x} ${c1y}, ${c2x} ${c2y}, ${p1.x} ${p1.y}`;\n }\n return out;\n}\n","import { buildCurvePath, type CngxCurve, type PathPoint } from './curve';\nimport type { ScaleFn, XScaleInput } from '../chart/chart-context';\n\n/**\n * Reads the Y value of a data row at index `i`.\n *\n * @category common/chart/path\n */\nexport type LineYAccessor<T> = (d: T, i: number) => number;\n/**\n * Reads the X value of a data row at index `i`. Default behaviour\n * (when omitted on a builder) is the row's positional index.\n *\n * @category common/chart/path\n */\nexport type LineXAccessor<T> = (d: T, i: number) => XScaleInput;\n\n/**\n * Construction options for {@link createPathBuilder}.\n *\n * @category common/chart/path\n */\nexport interface PathBuilderOptions<T> {\n readonly y: LineYAccessor<T>;\n readonly x?: LineXAccessor<T>;\n readonly curve: CngxCurve;\n}\n\n/**\n * One run of consecutive finite points, as produced by\n * {@link PathBuilder.buildSegments}. `firstX` / `lastX` are the run's\n * projected end coordinates, exposed so an area layer can close the\n * run to its baseline without re-projecting the data.\n *\n * @category common/chart/path\n */\nexport interface PathSegment {\n readonly d: string;\n readonly firstX: number;\n readonly lastX: number;\n}\n\n/**\n * Single-slot LRU cache around an SVG `d`-attribute builder. Returned\n * by {@link createPathBuilder}; consumed by the `<cngx-line>` /\n * `<cngx-area>` family.\n *\n * @category common/chart/path\n */\nexport interface PathBuilder<T> {\n /**\n * Build the SVG `d` attribute for the given data + scales. Same\n * `(data, xScale, yScale)` triple by reference returns the cached\n * string without re-running the O(n) point projection.\n *\n * A row whose projected `x` or `y` is non-finite (a `NaN` value, an\n * invalid Date, a log scale fed zero) is not emitted as a path\n * command - it breaks the path into subpaths, d3's `defined()`\n * semantics. One `NaN` therefore renders as a gap in the line rather\n * than invalidating the whole `d` string.\n */\n build(data: readonly T[], xScale: ScaleFn<XScaleInput>, yScale: ScaleFn<number>): string;\n\n /**\n * The same projection split at non-finite rows: one entry per run of\n * consecutive finite points, carrying the run's path data and its\n * first/last projected `x`. `<cngx-area>` consumes this to close\n * every run to the baseline individually - closing the joined string\n * once would fill straight across the gaps. Shares the single-slot\n * cache with {@link build}.\n */\n buildSegments(\n data: readonly T[],\n xScale: ScaleFn<XScaleInput>,\n yScale: ScaleFn<number>,\n ): readonly PathSegment[];\n\n /**\n * Number of times the internal point-projection + path-string\n * concatenation has run since this builder was constructed. Exposed\n * for the compute-guard isolated spec; not part of the public chart\n * API.\n */\n rebuildCount(): number;\n}\n\n/**\n * Pure-TS path builder with single-slot LRU memo on\n * `(data, xScale, yScale)` reference identity. Pure TS, no Angular\n * dep. Compute guard only - does not know about signals or `equal`\n * functions; the `d` computed in `<cngx-line>` carries the cascade\n * guard separately.\n *\n * The cache returns the previous result when all three inputs are\n * reference-equal to the previous call. Any reference mismatch\n * triggers a rebuild and updates the slot.\n *\n * Each call to `createPathBuilder` returns a fresh builder with its\n * own `lastData / lastX / lastY` slots - there is no cross-call /\n * cross-consumer state. The cascade guard for layer atoms is the\n * `equal: (a, b) => a === b` on the `builder` `computed`; combined\n * with Angular signals' default behaviour of skipping re-emissions\n * when the inputs to the `computed` are unchanged, two consecutive\n * cascade ticks with the same `(y, x, curve)` produce the same\n * builder instance.\n *\n * @category common/chart/path\n */\nexport function createPathBuilder<T>(opts: PathBuilderOptions<T>): PathBuilder<T> {\n const yAcc = opts.y;\n const xAcc: LineXAccessor<T> = opts.x ?? ((_, i) => i);\n const curve = opts.curve;\n\n let lastData: readonly T[] | null = null;\n let lastX: ScaleFn<XScaleInput> | null = null;\n let lastY: ScaleFn<number> | null = null;\n let lastSegments: readonly PathSegment[] = [];\n let lastResult = '';\n let rebuilds = 0;\n\n const rebuild = (\n data: readonly T[],\n xScale: ScaleFn<XScaleInput>,\n yScale: ScaleFn<number>,\n ): void => {\n if (data === lastData && xScale === lastX && yScale === lastY) {\n return;\n }\n const runs = projectFiniteRuns(data, xAcc, yAcc, xScale, yScale);\n lastSegments = runs.map((run) => ({\n d: buildCurvePath(run, curve),\n firstX: run[0].x,\n lastX: run[run.length - 1].x,\n }));\n lastResult = lastSegments.map((s) => s.d).join(' ');\n lastData = data;\n lastX = xScale;\n lastY = yScale;\n rebuilds++;\n };\n\n return {\n build(data, xScale, yScale) {\n rebuild(data, xScale, yScale);\n return lastResult;\n },\n buildSegments(data, xScale, yScale) {\n rebuild(data, xScale, yScale);\n return lastSegments;\n },\n rebuildCount() {\n return rebuilds;\n },\n };\n}\n\n/**\n * Project every row and split the result at non-finite coordinates:\n * returns the runs of consecutive points whose `x` and `y` are both\n * finite. Non-finite rows appear in no run - they are the breaks.\n *\n * @internal\n */\nfunction projectFiniteRuns<T>(\n data: readonly T[],\n xAcc: LineXAccessor<T>,\n yAcc: (d: T, i: number) => number,\n xScale: ScaleFn<XScaleInput>,\n yScale: ScaleFn<number>,\n): PathPoint[][] {\n const runs: PathPoint[][] = [];\n let current: PathPoint[] | null = null;\n for (let i = 0; i < data.length; i++) {\n const x = xScale(xAcc(data[i], i));\n const y = yScale(yAcc(data[i], i));\n if (Number.isFinite(x) && Number.isFinite(y)) {\n if (current === null) {\n current = [];\n runs.push(current);\n }\n current.push({ x, y });\n } else {\n current = null;\n }\n }\n return runs;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectChartContext } from '../chart/chart-context';\nimport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './chart-layer';\nimport { derivePointMarks, EMPTY_POINTS, lineAreaGeomEqual, type PointMark } from './point-geom';\nimport { type CngxCurve } from '../path/curve';\nimport {\n createPathBuilder,\n type LineXAccessor,\n type LineYAccessor,\n type PathBuilder,\n} from '../path/path-builder';\n\n/**\n * Line layer atom. Renders a single SVG `<path>` connecting the data\n * points projected through the parent chart's scales. Reads scales\n * from {@link CNGX_CHART_CONTEXT}, NOT from a parent class.\n *\n * Attribute-selector on `<svg:g>` - the host element IS the SVG group.\n * Element selectors create XHTML-namespaced custom elements inside\n * SVG, which break layout for the namespaced children. Apply this\n * directive on an `<svg:g>` host instead.\n *\n * The `d` string is cascade-guarded with string equality on its\n * `computed` so downstream effects only re-run when the path\n * geometry actually changes. The `createPathBuilder` cache provides\n * the **compute guard** - same `(data, xScale, yScale)` triple by\n * reference skips the per-datapoint projection work.\n *\n * A single-point series draws no visible path (`M x y` has no length),\n * so a series shorter than two points paints a point marker instead of\n * nothing. `[points]` controls this: `'auto'` (default) marks only the\n * one-datum case, `'always'` marks every datum, `'never'` suppresses it.\n *\n * @category common/chart/layers\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/line.component.ts\n * @since 0.1.0\n * @relatedTo CngxArea, CngxScatter, CngxBar, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxLine]',\n exportAs: 'cngxLine',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_LAYER, useExisting: CngxLine }],\n host: { class: 'cngx-chart-series' },\n template: `\n @if (ctx.renderSvg()) {\n <svg:path\n class=\"cngx-line\"\n [attr.d]=\"d()\"\n [attr.fill]=\"'none'\"\n [style.stroke]=\"color()\"\n [attr.stroke-width]=\"strokeWidth()\"\n [attr.stroke-linejoin]=\"'round'\"\n [attr.stroke-linecap]=\"'round'\"\n />\n @for (p of pointMarks(); track $index) {\n <svg:circle class=\"cngx-line__point\" [attr.cx]=\"p.cx\" [attr.cy]=\"p.cy\" />\n }\n }\n `,\n styles: [\n `\n .cngx-line {\n stroke: var(--cngx-line-color, var(--cngx-chart-primary, currentColor));\n stroke-width: var(--cngx-line-stroke-width, 1.5px);\n animation: cngx-line-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n @keyframes cngx-line-enter {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n .cngx-line__point {\n r: var(--cngx-line-point-radius, 3px);\n fill: var(--cngx-line-color, var(--cngx-chart-primary, currentColor));\n animation: cngx-line-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n @media (prefers-reduced-motion: reduce) {\n .cngx-line,\n .cngx-line__point {\n animation: none;\n }\n }\n /* forced-colors (WHCM): Chromium keeps author fill and stroke inside\n SVG (preserve-parent-color), so the line kept its colour while the\n legend swatches turn into patterns. The line follows the user palette\n and takes the legend's four-step cycle by series index: solid, dashed,\n dotted, dash-dot. The index counts the .cngx-chart-series layers\n (line, bar, scatter) of one chart, so legend entry N and the Nth such\n layer share a step. !important beats the inline [style.stroke] of the\n [color] input. */\n @media (forced-colors: active) {\n .cngx-line {\n stroke: CanvasText !important;\n }\n .cngx-line__point {\n fill: CanvasText;\n }\n cngx-chart > svg > :nth-child(4n + 2 of .cngx-chart-series) > .cngx-line {\n stroke-dasharray: 6 3;\n }\n cngx-chart > svg > :nth-child(4n + 3 of .cngx-chart-series) > .cngx-line {\n stroke-dasharray: 0.1 4;\n }\n cngx-chart > svg > :nth-child(4n + 4 of .cngx-chart-series) > .cngx-line {\n stroke-dasharray: 8 3 0.1 3;\n }\n }\n `,\n ],\n})\nexport class CngxLine<T = unknown> implements CngxChartLayer {\n readonly accessor = input<LineYAccessor<T>>((d: T) => Number(d));\n readonly xAccessor = input<LineXAccessor<T> | undefined>(undefined);\n readonly color = input<string | null>(null);\n readonly strokeWidth = input<number | string | null>(null);\n readonly curve = input<CngxCurve>('linear');\n readonly data = input<readonly T[] | undefined>(undefined);\n\n /**\n * Point-marker mode. `'auto'` (default) draws a marker only when the\n * resolved series has exactly one datum - the frame a warming buffer\n * passes through on every reload, which paints nothing otherwise.\n * `'always'` marks every datum; `'never'` suppresses markers.\n */\n readonly points = input<'auto' | 'always' | 'never'>('auto');\n\n protected readonly ctx = injectChartContext('CngxLine');\n\n private readonly builder = computed<PathBuilder<T>>(() =>\n createPathBuilder<T>({\n y: this.accessor(),\n x: this.xAccessor(),\n curve: this.curve(),\n }),\n );\n\n private readonly resolvedData = computed<readonly T[]>(() => {\n const local = this.data();\n if (local !== undefined) {\n return local;\n }\n return this.ctx.data<T>();\n });\n\n protected readonly d = computed<string>(\n () => this.builder().build(this.resolvedData(), this.ctx.xScale(), this.ctx.yScale()),\n { equal: (a, b) => a === b },\n );\n\n readonly geometry = computed<LayerGeometry>(\n () => ({\n kind: 'line',\n d: this.d(),\n color: this.color(),\n strokeWidth: this.strokeWidth(),\n fill: 'none',\n points: derivePointMarks(\n this.points(),\n this.resolvedData(),\n this.ctx.xScale(),\n this.ctx.yScale(),\n this.accessor(),\n this.xAccessor() ?? ((_: T, i: number) => i),\n ),\n }),\n { equal: lineAreaGeomEqual },\n );\n\n /**\n * Template view of the geometry's marker pass. Forwards the array\n * reference the `geometry` computed already holds - `lineAreaGeomEqual`\n * keeps that reference stable across a no-op refresh, so this\n * projection stays stable too without a second equality guard.\n */\n protected readonly pointMarks = computed<readonly PointMark[]>(() => {\n const g = this.geometry();\n return g.kind === 'line' ? (g.points ?? EMPTY_POINTS) : EMPTY_POINTS;\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectChartContext } from '../chart/chart-context';\nimport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './chart-layer';\nimport { derivePointMarks, EMPTY_POINTS, lineAreaGeomEqual, type PointMark } from './point-geom';\nimport { type CngxCurve } from '../path/curve';\nimport {\n createPathBuilder,\n type LineXAccessor,\n type LineYAccessor,\n type PathBuilder,\n} from '../path/path-builder';\n\n/**\n * Area layer atom. Reuses {@link createPathBuilder} for the upper edge\n * (same compute guard as `[cngxLine]`) and closes the polygon to a\n * `[baseline]` (default `0`) so SVG can fill it.\n *\n * Attribute-selector on `<svg:g>` - see {@link CngxLine} for why.\n *\n * The `d` string is cascade-guarded with string equality on its\n * `computed` so a no-op data refresh does not force a fill repaint.\n *\n * A single-datum area closes on itself at one x and covers no pixels,\n * so a series shorter than two points paints a point marker instead of\n * nothing. `[points]` mirrors {@link CngxLine}: `'auto'` (default) marks\n * only the one-datum case, `'always'` every datum, `'never'` none.\n *\n * @category common/chart/layers\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/area.component.ts\n * @since 0.1.0\n * @relatedTo CngxLine, CngxBand, CngxThreshold, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxArea]',\n exportAs: 'cngxArea',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_LAYER, useExisting: CngxArea }],\n template: `\n @if (ctx.renderSvg()) {\n <svg:path\n class=\"cngx-area\"\n [attr.d]=\"d()\"\n [style.fill]=\"color()\"\n [style.fill-opacity]=\"opacity()\"\n />\n @for (p of pointMarks(); track $index) {\n <svg:circle class=\"cngx-area__point\" [attr.cx]=\"p.cx\" [attr.cy]=\"p.cy\" />\n }\n }\n `,\n styles: [\n `\n .cngx-area {\n fill: var(--cngx-area-fill, var(--cngx-chart-primary, currentColor));\n fill-opacity: var(--cngx-area-opacity, 0.18);\n stroke: none;\n animation: cngx-area-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n @keyframes cngx-area-enter {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n .cngx-area__point {\n r: var(--cngx-area-point-radius, 3px);\n fill: var(--cngx-area-fill, var(--cngx-chart-primary, currentColor));\n animation: cngx-area-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n @media (prefers-reduced-motion: reduce) {\n .cngx-area,\n .cngx-area__point {\n animation: none;\n }\n }\n /* forced-colors (WHCM): Chromium keeps author fill inside SVG\n (preserve-parent-color). The area follows the user palette as a\n CanvasText wash at its own fill-opacity. It takes no pattern and does\n not count as a series: an area is the fill under the line it pairs\n with, which carries the series step. !important beats the inline\n [style.fill] of the [color] input. */\n @media (forced-colors: active) {\n .cngx-area {\n fill: CanvasText !important;\n }\n .cngx-area__point {\n fill: CanvasText;\n }\n }\n `,\n ],\n})\nexport class CngxArea<T = unknown> implements CngxChartLayer {\n readonly accessor = input<LineYAccessor<T>>((d: T) => Number(d));\n readonly xAccessor = input<LineXAccessor<T> | undefined>(undefined);\n readonly opacity = input<number | string | null>(null);\n readonly color = input<string | null>(null);\n readonly curve = input<CngxCurve>('linear');\n readonly baseline = input<number>(0);\n readonly data = input<readonly T[] | undefined>(undefined);\n\n /**\n * Point-marker mode, mirroring {@link CngxLine}. `'auto'` (default)\n * draws a marker only for a single-datum series - an area closed on\n * itself at one x covers no pixels and paints nothing otherwise.\n * `'always'` marks every datum; `'never'` suppresses markers.\n */\n readonly points = input<'auto' | 'always' | 'never'>('auto');\n\n protected readonly ctx = injectChartContext('CngxArea');\n\n private readonly builder = computed<PathBuilder<T>>(() =>\n createPathBuilder<T>({\n y: this.accessor(),\n x: this.xAccessor(),\n curve: this.curve(),\n }),\n );\n\n private readonly resolvedData = computed<readonly T[]>(() => {\n const local = this.data();\n if (local !== undefined) {\n return local;\n }\n return this.ctx.data<T>();\n });\n\n protected readonly d = computed<string>(\n () => {\n const data = this.resolvedData();\n if (data.length === 0) {\n return '';\n }\n const xScale = this.ctx.xScale();\n const yScale = this.ctx.yScale();\n const baselineY = yScale(this.baseline());\n // Close every finite run to the baseline individually - a gap\n // (non-finite row) must stay unfilled, not be bridged by one\n // whole-path closure.\n return this.builder()\n .buildSegments(data, xScale, yScale)\n .map((seg) => `${seg.d} L ${seg.lastX} ${baselineY} L ${seg.firstX} ${baselineY} Z`)\n .join(' ');\n },\n { equal: (a, b) => a === b },\n );\n\n readonly geometry = computed<LayerGeometry>(\n () => {\n const op = this.opacity();\n return {\n kind: 'area',\n d: this.d(),\n color: this.color(),\n strokeWidth: null,\n fill: null,\n opacity: op == null ? null : Number(op),\n points: derivePointMarks(\n this.points(),\n this.resolvedData(),\n this.ctx.xScale(),\n this.ctx.yScale(),\n this.accessor(),\n this.xAccessor() ?? ((_: T, i: number) => i),\n ),\n };\n },\n { equal: lineAreaGeomEqual },\n );\n\n /**\n * Template view of the geometry's marker pass. Forwards the reference\n * the `geometry` computed already holds - `lineAreaGeomEqual` keeps it\n * stable across a no-op refresh, so no second equality guard is needed.\n */\n protected readonly pointMarks = computed<readonly PointMark[]>(() => {\n const g = this.geometry();\n return g.kind === 'area' ? (g.points ?? EMPTY_POINTS) : EMPTY_POINTS;\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectChartContext } from '../chart/chart-context';\nimport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './chart-layer';\n\n/**\n * Reads the bar height (data-space Y) of a data row at index `i`.\n *\n * @category common/chart/layers\n */\nexport type BarYAccessor<T> = (d: T, i: number) => number;\n\n/** @internal */\ninterface BarRect {\n readonly key: number;\n readonly x: number;\n readonly y: number;\n readonly width: number;\n readonly height: number;\n}\n\n/** @internal */\nconst FALLBACK_BASELINE = 0;\n\n/**\n * Bar layer atom. Renders one `<rect>` per datapoint. Bar width comes\n * from `dimensions.width / dataLength` (one slot per datapoint) shrunk\n * by the optional `[gap]` ratio. Bar height runs from `yScale(value)`\n * down to `yScale(baseline)` (default 0) - SVG bottom-anchored.\n *\n * Bar does NOT require a band X scale; the slot width is purely\n * geometric. This keeps the atom usable with linear or band X axes\n * interchangeably.\n *\n * Attribute-selector on `<svg:g>` - see {@link CngxLine} for why.\n *\n * @category common/chart/layers\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/bar.component.ts\n * @since 0.1.0\n * @relatedTo CngxLine, CngxArea, CngxStackedBar, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxBar]',\n exportAs: 'cngxBar',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_LAYER, useExisting: CngxBar }],\n host: { class: 'cngx-chart-series' },\n template: `\n @if (ctx.renderSvg()) {\n @for (rect of rects(); track rect.key) {\n <svg:rect\n class=\"cngx-bar\"\n [attr.x]=\"rect.x\"\n [attr.y]=\"rect.y\"\n [attr.width]=\"rect.width\"\n [attr.height]=\"rect.height\"\n [style.fill]=\"color()\"\n />\n }\n }\n `,\n styles: [\n `\n .cngx-bar {\n fill: var(--cngx-bar-color, var(--cngx-chart-primary, currentColor));\n transform-origin: 50% 100%;\n transform-box: fill-box;\n animation: cngx-bar-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.34, 1.2, 0.64, 1));\n }\n @keyframes cngx-bar-enter {\n from {\n transform: scaleY(0);\n opacity: 0;\n }\n to {\n transform: scaleY(1);\n opacity: 1;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .cngx-bar {\n animation: none;\n }\n }\n /* forced-colors (WHCM): Chromium keeps author fill inside SVG\n (preserve-parent-color), so the bars kept their colour while the\n legend swatches turn into patterns. Bars follow the user palette and\n take the legend's four-step cycle by series index: solid, 45deg\n hatch, hollow, 0deg hatch. The index counts the .cngx-chart-series\n layers (line, bar, scatter) of one chart. The hatches are patterns\n CngxChart renders once per chart; they carry a Canvas gap, so a bar\n drawn over another keeps its hatch. !important beats the inline\n [style.fill] of the [color] input. */\n @media (forced-colors: active) {\n .cngx-bar {\n fill: CanvasText !important;\n }\n cngx-chart > svg > :nth-child(4n + 2 of .cngx-chart-series) > .cngx-bar {\n fill: var(--_cngx-chart-hatch-diagonal, CanvasText) !important;\n stroke: CanvasText;\n stroke-width: 1px;\n }\n cngx-chart > svg > :nth-child(4n + 3 of .cngx-chart-series) > .cngx-bar {\n fill: Canvas !important;\n stroke: CanvasText;\n stroke-width: 1.5px;\n }\n cngx-chart > svg > :nth-child(4n + 4 of .cngx-chart-series) > .cngx-bar {\n fill: var(--_cngx-chart-hatch-horizontal, CanvasText) !important;\n stroke: CanvasText;\n stroke-width: 1px;\n }\n }\n `,\n ],\n})\nexport class CngxBar<T = unknown> implements CngxChartLayer {\n readonly accessor = input<BarYAccessor<T>>(((d: T) => Number(d)) as BarYAccessor<T>);\n readonly gap = input<number>(0.1);\n readonly baseline = input<number>(FALLBACK_BASELINE);\n readonly data = input<readonly T[] | undefined>(undefined);\n readonly color = input<string | null>(null);\n\n protected readonly ctx = injectChartContext('CngxBar');\n\n private readonly resolvedData = computed<readonly T[]>(() => {\n const local = this.data();\n if (local !== undefined) {\n return local;\n }\n return this.ctx.data<T>();\n });\n\n protected readonly rects = computed<readonly BarRect[]>(\n () => {\n const data = this.resolvedData();\n const n = data.length;\n if (n === 0) {\n return [];\n }\n // Slots divide the plot, not the box. The y values come from\n // ctx.yScale(), which already ranges over the plot, so measuring\n // x against the box would put the bars and their own baseline in\n // two different coordinate systems - and off the ticks that label\n // them.\n const { x0, width, height } = this.ctx.plot();\n if (width <= 0 || height <= 0) {\n return [];\n }\n const yScale = this.ctx.yScale();\n const slot = width / n;\n const gap = clamp01(this.gap());\n const inner = slot * (1 - gap);\n const offset = (slot - inner) / 2;\n const baselineY = yScale(this.baseline());\n const yAcc = this.accessor();\n const out = new Array<BarRect>(n);\n for (let i = 0; i < n; i++) {\n const value = yAcc(data[i], i);\n const valueY = yScale(value);\n const top = Math.min(valueY, baselineY);\n const bottom = Math.max(valueY, baselineY);\n out[i] = {\n key: i,\n x: x0 + i * slot + offset,\n y: top,\n width: inner,\n height: bottom - top,\n };\n }\n return out;\n },\n { equal: rectsEqual },\n );\n\n readonly geometry = computed<LayerGeometry>(\n () => ({\n kind: 'bar',\n rects: this.rects().map((r) => ({\n x: r.x,\n y: r.y,\n w: r.width,\n h: r.height,\n color: this.color(),\n })),\n }),\n { equal: barGeomEqual },\n );\n}\n\n/** @internal */\nfunction barGeomEqual(a: LayerGeometry, b: LayerGeometry): boolean {\n if (a === b) {\n return true;\n }\n if (a.kind !== 'bar' || b.kind !== 'bar') {\n return false;\n }\n if (a.rects.length !== b.rects.length) {\n return false;\n }\n for (let i = 0; i < a.rects.length; i++) {\n const x = a.rects[i];\n const y = b.rects[i];\n if (x.x !== y.x || x.y !== y.y || x.w !== y.w || x.h !== y.h || x.color !== y.color) {\n return false;\n }\n }\n return true;\n}\n\n/** @internal */\nfunction clamp01(v: number): number {\n if (v < 0) {\n return 0;\n }\n if (v > 1) {\n return 1;\n }\n return v;\n}\n\n/** @internal */\nfunction rectsEqual(a: readonly BarRect[], b: readonly BarRect[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const x = a[i];\n const y = b[i];\n if (x.x !== y.x || x.y !== y.y || x.width !== y.width || x.height !== y.height) {\n return false;\n }\n }\n return true;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectChartContext, type XScaleInput } from '../chart/chart-context';\nimport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './chart-layer';\n\n/**\n * Reads the data-space X value of a scatter row at index `i`.\n *\n * @category common/chart/layers\n */\nexport type ScatterXAccessor<T> = (d: T, i: number) => XScaleInput;\n/**\n * Reads the data-space Y value of a scatter row at index `i`.\n *\n * @category common/chart/layers\n */\nexport type ScatterYAccessor<T> = (d: T, i: number) => number;\n\n/** @internal */\ninterface ScatterCircle {\n readonly key: number;\n readonly cx: number;\n readonly cy: number;\n}\n\n/**\n * Scatter layer atom. Renders one `<circle>` per datapoint. X and Y\n * accessors are independent - neither defaults to index, since the\n * defining trait of a scatter chart is two genuine data dimensions.\n *\n * Attribute-selector on `<svg:g>` - see {@link CngxLine} for why.\n *\n * @category common/chart/layers\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/scatter.component.ts\n * @since 0.1.0\n * @relatedTo CngxLine, CngxBar, CngxArea, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxScatter]',\n exportAs: 'cngxScatter',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_LAYER, useExisting: CngxScatter }],\n host: { class: 'cngx-chart-series' },\n template: `\n @if (ctx.renderSvg()) {\n @for (c of circles(); track c.key) {\n <svg:circle\n class=\"cngx-scatter\"\n [attr.cx]=\"c.cx\"\n [attr.cy]=\"c.cy\"\n [attr.r]=\"radius()\"\n [style.fill]=\"color()\"\n />\n }\n }\n `,\n styles: [\n `\n .cngx-scatter {\n fill: var(--cngx-scatter-color, var(--cngx-chart-primary, currentColor));\n transform-origin: 50% 50%;\n transform-box: fill-box;\n animation: cngx-scatter-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.34, 1.56, 0.64, 1)) backwards;\n }\n @keyframes cngx-scatter-enter {\n from {\n transform: scale(0);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .cngx-scatter {\n animation: none;\n }\n }\n /* forced-colors (WHCM): Chromium keeps author fill inside SVG\n (preserve-parent-color). Points follow the user palette and take the\n legend's four-step cycle by series index, the same cycle CngxBar\n uses: solid, 45deg hatch, hollow, 0deg hatch, each patterned dot\n ringed so its edge reads. !important beats the inline [style.fill]\n of the [color] input. */\n @media (forced-colors: active) {\n .cngx-scatter {\n fill: CanvasText !important;\n }\n cngx-chart > svg > :nth-child(4n + 2 of .cngx-chart-series) > .cngx-scatter {\n fill: var(--_cngx-chart-hatch-diagonal, CanvasText) !important;\n stroke: CanvasText;\n stroke-width: 1px;\n }\n cngx-chart > svg > :nth-child(4n + 3 of .cngx-chart-series) > .cngx-scatter {\n fill: Canvas !important;\n stroke: CanvasText;\n stroke-width: 1.5px;\n }\n cngx-chart > svg > :nth-child(4n + 4 of .cngx-chart-series) > .cngx-scatter {\n fill: var(--_cngx-chart-hatch-horizontal, CanvasText) !important;\n stroke: CanvasText;\n stroke-width: 1px;\n }\n }\n `,\n ],\n})\nexport class CngxScatter<T = unknown> implements CngxChartLayer {\n readonly x = input.required<ScatterXAccessor<T>>();\n readonly y = input.required<ScatterYAccessor<T>>();\n readonly radius = input<number>(3);\n readonly data = input<readonly T[] | undefined>(undefined);\n readonly color = input<string | null>(null);\n\n protected readonly ctx = injectChartContext('CngxScatter');\n\n private readonly resolvedData = computed<readonly T[]>(() => {\n const local = this.data();\n if (local !== undefined) {\n return local;\n }\n return this.ctx.data<T>();\n });\n\n protected readonly circles = computed<readonly ScatterCircle[]>(\n () => {\n const data = this.resolvedData();\n const xScale = this.ctx.xScale();\n const yScale = this.ctx.yScale();\n const xAcc = this.x();\n const yAcc = this.y();\n const out = new Array<ScatterCircle>(data.length);\n for (let i = 0; i < data.length; i++) {\n out[i] = {\n key: i,\n cx: xScale(xAcc(data[i], i)),\n cy: yScale(yAcc(data[i], i)),\n };\n }\n return out;\n },\n { equal: circlesEqual },\n );\n\n readonly geometry = computed<LayerGeometry>(\n () => {\n const r = this.radius();\n return {\n kind: 'scatter',\n marks: this.circles().map((c) => ({ cx: c.cx, cy: c.cy, r, color: this.color() })),\n };\n },\n { equal: scatterGeomEqual },\n );\n}\n\n/** @internal */\nfunction scatterGeomEqual(a: LayerGeometry, b: LayerGeometry): boolean {\n if (a === b) {\n return true;\n }\n if (a.kind !== 'scatter' || b.kind !== 'scatter') {\n return false;\n }\n if (a.marks.length !== b.marks.length) {\n return false;\n }\n for (let i = 0; i < a.marks.length; i++) {\n const x = a.marks[i];\n const y = b.marks[i];\n if (x.cx !== y.cx || x.cy !== y.cy || x.r !== y.r || x.color !== y.color) {\n return false;\n }\n }\n return true;\n}\n\n/** @internal */\nfunction circlesEqual(a: readonly ScatterCircle[], b: readonly ScatterCircle[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i].cx !== b[i].cx || a[i].cy !== b[i].cy) {\n return false;\n }\n }\n return true;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectChartContext } from '../chart/chart-context';\nimport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './chart-layer';\n\n/**\n * Band reference atom. Renders a `<rect>` across a vertical Y-range\n * (`from..to`) spanning the chart's full width. Use to highlight a\n * value range (e.g. \"good zone\", \"watch zone\") behind primary layers.\n *\n * Default opacity is low (`var(--cngx-band-opacity, 0.12)`) so the\n * band sits behind line / area / bar layers without dominating.\n *\n * Attribute-selector on `<svg:g>` - see {@link CngxLine} for why.\n *\n * @category common/chart/layers\n * @docsKind primary\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/layers/band.component.ts\n * @since 0.1.0\n * @relatedTo CngxThreshold, CngxArea, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/primitives/async-state-machine-on-the-primitive</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/combo-bars-moving-average-line</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/line-area-threshold-band</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/multi-series-line-axis-labels-legend</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/responsive-fills-parent-width</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/scatter-with-performance-zones</example-url>\n * <example-url>http://localhost:4200/#/common/chart/primitives/time-series-with-threshold-zones</example-url>\n */\n@Component({\n selector: '[cngxBand]',\n exportAs: 'cngxBand',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [{ provide: CNGX_CHART_LAYER, useExisting: CngxBand }],\n template: `\n @if (rect(); as r) {\n @if (ctx.renderSvg()) {\n <svg:rect\n class=\"cngx-band__rect\"\n [attr.x]=\"r.x\"\n [attr.y]=\"r.y\"\n [attr.width]=\"r.width\"\n [attr.height]=\"r.height\"\n [style.fill]=\"color()\"\n [style.fill-opacity]=\"opacity()\"\n />\n }\n <!--\n Outside the renderSvg gate on purpose - see CngxThreshold: the\n canvas backend paints no text, so a gated label vanishes at the\n auto-switch threshold.\n -->\n @if (label(); as l) {\n <svg:text\n class=\"cngx-band__label\"\n [attr.x]=\"r.x + 4\"\n [attr.y]=\"r.y + r.height / 2\"\n text-anchor=\"start\"\n dominant-baseline=\"middle\"\n >\n {{ l }}\n </svg:text>\n }\n }\n `,\n styles: [\n `\n .cngx-band__rect {\n fill: var(--cngx-band-color, var(--cngx-chart-secondary, currentColor));\n fill-opacity: var(--cngx-band-opacity, 0.12);\n stroke: none;\n animation: cngx-band-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n .cngx-band__label {\n fill: var(--cngx-band-text-color, var(--cngx-chart-text-color, currentColor));\n font-size: var(--cngx-band-font-size, 11px);\n unicode-bidi: var(--cngx-chart-numeric-bidi, isolate);\n animation: cngx-band-enter var(--cngx-chart-enter-duration, 480ms)\n var(--cngx-chart-enter-easing, cubic-bezier(0.4, 0, 0.2, 1));\n }\n @keyframes cngx-band-enter {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n .cngx-band__rect,\n .cngx-band__label {\n animation: none;\n }\n }\n /* forced-colors (WHCM): Chromium keeps author fill inside SVG\n (preserve-parent-color). The band follows the user palette as a\n CanvasText wash at its own fill-opacity, and its label as CanvasText.\n A band is no legend entry and not a series, its label names it.\n !important beats the inline [style.fill] of the [color] input. */\n @media (forced-colors: active) {\n .cngx-band__rect {\n fill: CanvasText !important;\n }\n .cngx-band__label {\n fill: CanvasText;\n }\n }\n `,\n ],\n})\nexport class CngxBand implements CngxChartLayer {\n readonly from = input.required<number>();\n readonly to = input.required<number>();\n readonly label = input<string | null>(null);\n readonly opacity = input<number | string | null>(null);\n readonly color = input<string | null>(null);\n\n protected readonly ctx = injectChartContext('CngxBand');\n\n protected readonly rect = computed<{\n x: number;\n width: number;\n y: number;\n height: number;\n } | null>(\n () => {\n // The plot, not the box: the band spans the area the marks live\n // in, so it stops at the axis gutter instead of painting over\n // the tick labels the chart now reserves room for.\n const { x0, width, height } = this.ctx.plot();\n if (width <= 0 || height <= 0) {\n return null;\n }\n const yScale = this.ctx.yScale();\n const yA = yScale(this.from());\n const yB = yScale(this.to());\n const top = Math.min(yA, yB);\n const bottom = Math.max(yA, yB);\n return { x: x0, width, y: top, height: bottom - top };\n },\n {\n equal: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.x === b.x &&\n a.width === b.width &&\n a.y === b.y &&\n a.height === b.height),\n },\n );\n\n readonly geometry = computed<LayerGeometry>(\n () => {\n const r = this.rect();\n const op = this.opacity();\n return {\n kind: 'band',\n x: r?.x ?? 0,\n y: r?.y ?? 0,\n w: r?.width ?? 0,\n h: r?.height ?? 0,\n color: this.color(),\n opacity: op == null ? null : Number(op),\n };\n },\n { equal: bandGeomEqual },\n );\n}\n\n/** @internal */\nfunction bandGeomEqual(a: LayerGeometry, b: LayerGeometry): boolean {\n if (a === b) {\n return true;\n }\n if (a.kind !== 'band' || b.kind !== 'band') {\n return false;\n }\n return (\n a.x === b.x &&\n a.y === b.y &&\n a.w === b.w &&\n a.h === b.h &&\n a.color === b.color &&\n a.opacity === b.opacity\n );\n}\n","import {\n afterNextRender,\n computed,\n ElementRef,\n inject,\n isDevMode,\n type Signal,\n} from '@angular/core';\nimport { resolveAsyncView, type AsyncView } from '@cngx/common/data';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { injectChartI18n, type CngxChartI18n } from '../i18n/chart-i18n';\n\n/**\n * Reactive bundle returned by {@link injectPresetState}. Each preset\n * exposes `i18n` for fallback labels and `activeView` for the\n * `@switch` template branch.\n *\n * @internal\n */\nexport interface PresetStateContext {\n readonly i18n: Signal<Required<CngxChartI18n>>;\n readonly activeView: Signal<AsyncView>;\n}\n\n/**\n * Shared `[state]` → `activeView` derivation for chart presets. Maps\n * a `CngxAsyncState` (when bound) to the same `AsyncView` discriminator\n * the select family uses; presets render skeleton / empty / error /\n * content branches off the same enum.\n *\n * Returns `'content'` when `state` is unbound - the preset renders its\n * SVG/DOM body without any state envelope. Treats `'content+error'`\n * the same as `'content'` for v1: a four-rect chart preset has no\n * room for an inline-error overlay; consumers compose\n * `<cngx-banner-on />` against the same `[state]` if they need\n * explicit transition feedback.\n *\n * @internal\n */\nexport function injectPresetState(\n state: () => CngxAsyncState<unknown> | undefined,\n): PresetStateContext {\n const i18n = injectChartI18n();\n const activeView = computed<AsyncView>(() => {\n const s = state();\n if (!s) {\n return 'content';\n }\n return resolveAsyncView(s.status(), s.isFirstLoad(), s.isEmpty());\n });\n return { i18n, activeView };\n}\n\n/**\n * Dev-mode guard for the named-role presets (`role=\"meter\"` /\n * `role=\"img\"`): warns once after first render when the host ended up\n * with no accessible name - an unnamed meter reads to AT as a bare\n * number with no subject. Same shape as the `cngx-status` warning.\n * Call from the preset's constructor (needs the injection context for\n * `ElementRef` and `afterNextRender`); no-op in production builds.\n *\n * @internal\n */\nexport function warnIfUnnamedPreset(selector: string, hint: string, hasName: () => boolean): void {\n if (!isDevMode()) {\n return;\n }\n const el = inject(ElementRef).nativeElement as HTMLElement;\n afterNextRender(() => {\n if (hasName()) {\n return;\n }\n // The inputs say unnamed - a consumer can still name the host\n // externally via a plain aria-labelledby attribute.\n if (el.getAttribute('aria-label') || el.getAttribute('aria-labelledby')) {\n return;\n }\n console.warn(\n `${selector}: role=\"${el.getAttribute('role') ?? 'meter'}\" has no accessible name - ` +\n `AT announces the value with no subject. ${hint}`,\n );\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { CngxChart } from '../chart/chart.component';\nimport { CngxAxisDomain } from '../axis/axis-domain';\nimport { CngxLine } from '../layers/line.component';\nimport { CngxArea } from '../layers/area.component';\nimport { sameNumberArr } from '../chart/equal-helpers';\nimport { presetIndexDomain, presetValueDomain } from '../chart/preset-math';\nimport { injectPresetState } from './preset-state';\n\n/**\n * Inline sparkline - a tiny line chart for KPI cards and dashboard\n * tiles. Composes `<cngx-chart>` + `<cngx-line>` (+ optional\n * `<cngx-area>`) with hidden axes that publish the scale domain\n * derived from the `data` array.\n *\n * Default viewBox is 80×24, intended for inline placement next to a\n * label or numeric value. Theming via `--cngx-sparkline-color`\n * (atom-local) → `--cngx-chart-primary` (chart-level) cascade.\n *\n * The host carries `role=\"img\"` and a reactive `aria-label` derived\n * from the chart's auto-Summary; consumers can override via\n * `[ariaLabel]`.\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/sparkline.component.ts\n * @since 0.1.0\n * @relatedTo CngxMiniArea, CngxMiniBar, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/sparkline/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/sparkline/basic-sparklines</example-url>\n * <example-url>http://localhost:4200/#/common/chart/sparkline/with-area-fill</example-url>\n */\n@Component({\n selector: 'cngx-sparkline',\n exportAs: 'cngxSparkline',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CngxChart, CngxAxisDomain, CngxLine, CngxArea],\n host: {\n class: 'cngx-sparkline',\n '[attr.aria-busy]': 'busy() ? \"true\" : null',\n },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span\n class=\"cngx-preset-skeleton\"\n [style.width.px]=\"width()\"\n [style.height.px]=\"height()\"\n aria-hidden=\"true\"\n ></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n().empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n().error() }}</span>\n }\n @case ('none') {}\n @default {\n <cngx-chart\n [data]=\"data()\"\n [width]=\"width()\"\n [height]=\"height()\"\n [aria-label]=\"ariaLabel()\"\n >\n <svg:g cngxAxisDomain position=\"bottom\" type=\"linear\" [domain]=\"xDomain()\"></svg:g>\n <svg:g cngxAxisDomain position=\"left\" type=\"linear\" [domain]=\"yDomain()\"></svg:g>\n @if (showArea()) {\n <svg:g cngxArea [baseline]=\"yDomain()[0]\"></svg:g>\n }\n <svg:g cngxLine [strokeWidth]=\"strokeWidth()\"></svg:g>\n </cngx-chart>\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-sparkline {\n display: inline-block;\n line-height: 0;\n --cngx-line-color: var(--cngx-sparkline-color, var(--cngx-chart-primary, currentColor));\n --cngx-area-fill: var(--cngx-sparkline-color, var(--cngx-chart-primary, currentColor));\n }\n cngx-sparkline .cngx-preset-skeleton {\n display: inline-block;\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-preset-skeleton-radius, 2px);\n animation: cngx-preset-shimmer 1.4s linear infinite;\n background-image: linear-gradient(\n 90deg,\n transparent 0,\n var(--cngx-skeleton-shimmer, rgb(255 255 255 / 0.3)) 50%,\n transparent 100%\n );\n background-size: 200% 100%;\n }\n cngx-sparkline .cngx-preset-fallback {\n display: inline-block;\n line-height: normal;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n color: var(--cngx-chart-text-color, currentColor);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-sparkline .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n @keyframes cngx-preset-shimmer {\n 0% {\n background-position: 200% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n }\n @media (prefers-reduced-motion: reduce) {\n cngx-sparkline .cngx-preset-skeleton {\n animation: none;\n }\n }\n `,\n ],\n})\nexport class CngxSparkline {\n readonly data = input.required<readonly number[]>();\n readonly width = input<number>(80);\n readonly height = input<number>(24);\n readonly strokeWidth = input<number | string | null>(null);\n readonly showArea = input<boolean>(false);\n readonly state = input<CngxAsyncState<readonly number[]> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n /** True while the skeleton branch renders - the host announces busy, the span stays decorative. */\n protected readonly busy = computed(() => this.activeView() === 'skeleton');\n\n protected readonly xDomain = computed<readonly number[]>(\n () => presetIndexDomain(this.data().length),\n { equal: sameNumberArr },\n );\n\n protected readonly yDomain = computed<readonly number[]>(() => presetValueDomain(this.data()), {\n equal: sameNumberArr,\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { clampedRatio } from '../chart/preset-math';\nimport { injectPresetState, warnIfUnnamedPreset } from './preset-state';\n\n/**\n * Mini horizontal bar - a single-value bounded indicator. Renders\n * pure DOM (no SVG), positioned with CSS only. Host carries\n * `role=\"meter\"` per the WAI-ARIA pattern for single-value bounded\n * indicators; `aria-valuenow` / `aria-valuemin` / `aria-valuemax`\n * tell AT the exact reading without a separate Summary.\n *\n * `label` renders a visible caption above the track and doubles as the\n * host's accessible name: with `label` bound and `[aria-label]` unbound\n * the meter names itself from the caption, so it is no longer an unnamed\n * `role=\"meter\"`. A bound `[aria-label]` always wins and overrides the\n * visible caption.\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/mini-bar.component.ts\n * @since 0.1.0\n * @relatedTo CngxMiniArea, CngxSparkline, CngxDonut, CngxBullet\n *\n * <example-url>http://localhost:4200/#/common/chart/mini-bar/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/mini-bar/basic-readings</example-url>\n */\n@Component({\n selector: 'cngx-mini-bar',\n exportAs: 'cngxMiniBar',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'meter',\n '[attr.aria-valuenow]': 'showsMeterValue() ? value() : null',\n '[attr.aria-valuemin]': 'showsMeterValue() ? min() : null',\n '[attr.aria-valuemax]': 'showsMeterValue() ? max() : null',\n '[attr.aria-label]': 'ariaLabel() ?? label()',\n '[attr.aria-busy]': 'busy() ? \"true\" : null',\n class: 'cngx-mini-bar',\n },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span class=\"cngx-preset-skeleton\" aria-hidden=\"true\"></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n().empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n().error() }}</span>\n }\n @case ('none') {}\n @default {\n @if (label(); as l) {\n <span class=\"cngx-mini-bar__label\">{{ l }}</span>\n }\n <div class=\"cngx-mini-bar__track\">\n <div class=\"cngx-mini-bar__fill\" [style.width.%]=\"percent()\"></div>\n </div>\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-mini-bar {\n display: inline-block;\n width: var(--cngx-mini-bar-width, 80px);\n --cngx-mini-bar-color: var(--cngx-bar-color, var(--cngx-chart-primary, currentColor));\n }\n cngx-mini-bar .cngx-mini-bar__label {\n display: block;\n font-size: var(--cngx-mini-bar-label-font-size, 0.75rem);\n color: var(--cngx-mini-bar-label-color, inherit);\n unicode-bidi: var(--cngx-chart-numeric-bidi, isolate);\n }\n cngx-mini-bar .cngx-mini-bar__track {\n position: relative;\n height: var(--cngx-mini-bar-height, 6px);\n background: var(--cngx-mini-bar-track, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-mini-bar-radius, 3px);\n overflow: hidden;\n }\n cngx-mini-bar .cngx-mini-bar__fill {\n height: 100%;\n background: var(--cngx-mini-bar-color);\n border-radius: inherit;\n transition: width var(--cngx-mini-bar-transition, 240ms) ease-out;\n }\n cngx-mini-bar .cngx-preset-skeleton {\n display: block;\n height: var(--cngx-mini-bar-height, 6px);\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-mini-bar-radius, 3px);\n }\n cngx-mini-bar .cngx-preset-fallback {\n display: inline-block;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-mini-bar .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n `,\n ],\n})\nexport class CngxMiniBar {\n readonly value = input.required<number>();\n readonly max = input<number>(100);\n readonly min = input<number>(0);\n readonly label = input<string | null>(null);\n readonly state = input<CngxAsyncState<number> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n /** True while the skeleton branch renders - the host announces busy, the span stays decorative. */\n protected readonly busy = computed(() => this.activeView() === 'skeleton');\n\n /**\n * Meter value attributes render only in the content view: keeping\n * `aria-valuenow` while the skeleton or error fallback shows would\n * announce a stale reading for a value that is not on screen.\n */\n protected readonly showsMeterValue = computed(() => this.activeView() === 'content');\n\n constructor() {\n warnIfUnnamedPreset(\n 'cngx-mini-bar',\n 'Bind [label] or [aria-label].',\n () => (this.ariaLabel() ?? this.label()) !== null,\n );\n }\n\n protected readonly percent = computed(\n () => clampedRatio(this.value(), this.min(), this.max()) * 100,\n );\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { clampedRatio } from '../chart/preset-math';\nimport { injectPresetState, warnIfUnnamedPreset } from './preset-state';\n\n/**\n * Mini deviation bar - a single-value indicator that diverges from a\n * `[baseline]` (default `0`) in either direction. Negative deviations\n * render to the left of the baseline mark, positive to the right.\n * Pure DOM, no SVG. Host carries `role=\"meter\"`.\n *\n * Use cases: budget variance (\"$+45k over\"), score deltas (\"−12%\n * vs target\"), KPI swing visualisations.\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/deviation-bar.component.ts\n * @since 0.1.0\n * @relatedTo CngxMiniBar, CngxBullet, CngxStackedBar\n *\n * <example-url>http://localhost:4200/#/common/chart/deviation-bar/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/deviation-bar/variance-readings</example-url>\n */\n@Component({\n selector: 'cngx-deviation-bar',\n exportAs: 'cngxDeviationBar',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'meter',\n '[attr.aria-valuenow]': 'showsMeterValue() ? value() : null',\n '[attr.aria-valuemin]': 'showsMeterValue() ? minValue() : null',\n '[attr.aria-valuemax]': 'showsMeterValue() ? maxValue() : null',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-busy]': 'busy() ? \"true\" : null',\n class: 'cngx-deviation-bar',\n },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span class=\"cngx-preset-skeleton\" aria-hidden=\"true\"></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n().empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n().error() }}</span>\n }\n @case ('none') {}\n @default {\n <div class=\"cngx-deviation-bar__track\">\n <div class=\"cngx-deviation-bar__baseline\"></div>\n @if (geometry(); as g) {\n <div\n class=\"cngx-deviation-bar__fill\"\n [class.cngx-deviation-bar__fill--positive]=\"g.positive\"\n [class.cngx-deviation-bar__fill--negative]=\"!g.positive\"\n [style.left.%]=\"g.left\"\n [style.width.%]=\"g.width\"\n ></div>\n }\n </div>\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-deviation-bar {\n display: inline-block;\n width: var(--cngx-deviation-bar-width, 100px);\n --cngx-deviation-positive: var(--cngx-chart-success, #1f9d55);\n --cngx-deviation-negative: var(--cngx-chart-danger, #d2452f);\n }\n cngx-deviation-bar .cngx-deviation-bar__track {\n position: relative;\n height: var(--cngx-deviation-bar-height, 6px);\n background: var(\n --cngx-deviation-bar-track,\n var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08))\n );\n border-radius: var(--cngx-deviation-bar-radius, 3px);\n overflow: hidden;\n }\n cngx-deviation-bar .cngx-deviation-bar__baseline {\n position: absolute;\n left: 50%;\n top: 0;\n bottom: 0;\n width: 1px;\n background: var(\n --cngx-deviation-bar-baseline-color,\n var(--cngx-chart-axis-color, currentColor)\n );\n opacity: var(--cngx-deviation-bar-baseline-opacity, 0.5);\n }\n cngx-deviation-bar .cngx-deviation-bar__fill {\n position: absolute;\n top: 0;\n bottom: 0;\n transition:\n left var(--cngx-deviation-bar-transition, 240ms) ease-out,\n width var(--cngx-deviation-bar-transition, 240ms) ease-out;\n }\n cngx-deviation-bar .cngx-deviation-bar__fill--positive {\n background: var(--cngx-deviation-positive);\n }\n cngx-deviation-bar .cngx-deviation-bar__fill--negative {\n background: var(--cngx-deviation-negative);\n }\n cngx-deviation-bar .cngx-preset-skeleton {\n display: block;\n height: var(--cngx-deviation-bar-height, 6px);\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-deviation-bar-radius, 3px);\n }\n cngx-deviation-bar .cngx-preset-fallback {\n display: inline-block;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-deviation-bar .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n `,\n ],\n})\nexport class CngxDeviationBar {\n readonly value = input.required<number>();\n readonly baseline = input<number>(0);\n readonly magnitude = input<number>(100);\n readonly state = input<CngxAsyncState<number> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n /** True while the skeleton branch renders - the host announces busy, the span stays decorative. */\n protected readonly busy = computed(() => this.activeView() === 'skeleton');\n\n /**\n * Meter value attributes render only in the content view: keeping\n * `aria-valuenow` while the skeleton or error fallback shows would\n * announce a stale reading for a value that is not on screen.\n */\n protected readonly showsMeterValue = computed(() => this.activeView() === 'content');\n\n constructor() {\n warnIfUnnamedPreset(\n 'cngx-deviation-bar',\n 'Bind [aria-label].',\n () => this.ariaLabel() !== null,\n );\n }\n\n /**\n * The meter's valid range is centred on the baseline, not on zero:\n * a deviation bar with `[baseline]=\"100\" [magnitude]=\"50\"` reads\n * values in `[50, 150]`. Anchoring min/max at `±magnitude` alone\n * puts any non-zero-baseline reading outside its own declared range,\n * which is invalid meter semantics.\n */\n protected readonly minValue = computed(() => this.baseline() - this.magnitude());\n protected readonly maxValue = computed(() => this.baseline() + this.magnitude());\n\n protected readonly geometry = computed<{\n positive: boolean;\n left: number;\n width: number;\n } | null>(\n () => {\n const v = this.value();\n const b = this.baseline();\n const m = this.magnitude();\n if (m <= 0) {\n return null;\n }\n const delta = v - b;\n if (delta === 0) {\n return null;\n }\n const positive = delta > 0;\n const ratio = clampedRatio(Math.abs(delta), 0, m) * 50;\n if (positive) {\n return { positive, left: 50, width: ratio };\n }\n return { positive, left: 50 - ratio, width: ratio };\n },\n {\n equal: (a, b) =>\n a === b ||\n (a !== null &&\n b !== null &&\n a.positive === b.positive &&\n a.left === b.left &&\n a.width === b.width),\n },\n );\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { CngxChart } from '../chart/chart.component';\nimport { CngxAxisDomain } from '../axis/axis-domain';\nimport { CngxArea } from '../layers/area.component';\nimport { sameNumberArr } from '../chart/equal-helpers';\nimport { presetIndexDomain, presetValueDomain } from '../chart/preset-math';\nimport { injectPresetState } from './preset-state';\n\n/**\n * Inline mini area - a tiny filled-area chart for KPI cards. Sibling\n * of {@link CngxSparkline}; renders only the area (no line stroke).\n * Default viewBox 80×24. Theming via `--cngx-mini-area-color`\n * (atom-local) → `--cngx-chart-primary` (chart-level) cascade.\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/mini-area.component.ts\n * @since 0.1.0\n * @relatedTo CngxSparkline, CngxMiniBar, CngxChart\n *\n * <example-url>http://localhost:4200/#/common/chart/mini-area/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/mini-area/inline-area-trends</example-url>\n */\n@Component({\n selector: 'cngx-mini-area',\n exportAs: 'cngxMiniArea',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [CngxChart, CngxAxisDomain, CngxArea],\n host: {\n class: 'cngx-mini-area',\n '[attr.aria-busy]': 'busy() ? \"true\" : null',\n },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span\n class=\"cngx-preset-skeleton\"\n [style.width.px]=\"width()\"\n [style.height.px]=\"height()\"\n aria-hidden=\"true\"\n ></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n().empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n().error() }}</span>\n }\n @case ('none') {}\n @default {\n <cngx-chart\n [data]=\"data()\"\n [width]=\"width()\"\n [height]=\"height()\"\n [aria-label]=\"ariaLabel()\"\n >\n <svg:g cngxAxisDomain position=\"bottom\" type=\"linear\" [domain]=\"xDomain()\"></svg:g>\n <svg:g cngxAxisDomain position=\"left\" type=\"linear\" [domain]=\"yDomain()\"></svg:g>\n <svg:g cngxArea [opacity]=\"opacity()\" [baseline]=\"yDomain()[0]\"></svg:g>\n </cngx-chart>\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-mini-area {\n display: inline-block;\n line-height: 0;\n --cngx-area-fill: var(--cngx-mini-area-color, var(--cngx-chart-primary, currentColor));\n }\n cngx-mini-area .cngx-preset-skeleton {\n display: inline-block;\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-preset-skeleton-radius, 2px);\n }\n cngx-mini-area .cngx-preset-fallback {\n display: inline-block;\n line-height: normal;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-mini-area .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n `,\n ],\n})\nexport class CngxMiniArea {\n readonly data = input.required<readonly number[]>();\n readonly width = input<number>(80);\n readonly height = input<number>(24);\n readonly opacity = input<number | string | null>(null);\n readonly state = input<CngxAsyncState<readonly number[]> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n /** True while the skeleton branch renders - the host announces busy, the span stays decorative. */\n protected readonly busy = computed(() => this.activeView() === 'skeleton');\n\n protected readonly xDomain = computed<readonly number[]>(\n () => presetIndexDomain(this.data().length),\n { equal: sameNumberArr },\n );\n\n protected readonly yDomain = computed<readonly number[]>(() => presetValueDomain(this.data()), {\n equal: sameNumberArr,\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { clampedRatio } from '../chart/preset-math';\nimport { injectPresetState, warnIfUnnamedPreset } from './preset-state';\n\n/** @internal */\nconst TWO_PI = Math.PI * 2;\n\n/**\n * Circular donut gauge - a single-value bounded indicator. Renders a\n * background ring + a foreground arc whose length is proportional to\n * `value / max`. Host carries `role=\"meter\"`; the optional `[label]`\n * input renders a visible label inside the ring's centre and doubles\n * as the host's accessible name when `[aria-label]` is unbound - the\n * same fallback `CngxMiniBar` uses. A bound `[aria-label]` always\n * wins.\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/donut.component.ts\n * @since 0.1.0\n * @relatedTo CngxBullet, CngxMiniBar, CngxDeviationBar\n *\n * <example-url>http://localhost:4200/#/common/chart/donut/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/donut/score-gauges</example-url>\n */\n@Component({\n selector: 'cngx-donut',\n exportAs: 'cngxDonut',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'meter',\n '[attr.aria-valuenow]': 'showsMeterValue() ? value() : null',\n '[attr.aria-valuemin]': 'showsMeterValue() ? 0 : null',\n '[attr.aria-valuemax]': 'showsMeterValue() ? max() : null',\n '[attr.aria-label]': 'ariaLabel() ?? label()',\n '[attr.aria-busy]': 'busy() ? \"true\" : null',\n class: 'cngx-donut',\n },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span\n class=\"cngx-preset-skeleton cngx-donut__skeleton\"\n [style.width.px]=\"size()\"\n [style.height.px]=\"size()\"\n aria-hidden=\"true\"\n ></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n().empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n().error() }}</span>\n }\n @case ('none') {}\n @default {\n <svg\n [attr.viewBox]=\"'0 0 ' + size() + ' ' + size()\"\n [attr.width]=\"size()\"\n [attr.height]=\"size()\"\n aria-hidden=\"true\"\n >\n <svg:circle\n class=\"cngx-donut__track\"\n [attr.cx]=\"center()\"\n [attr.cy]=\"center()\"\n [attr.r]=\"radius()\"\n [attr.stroke-width]=\"thickness()\"\n fill=\"none\"\n />\n <svg:circle\n class=\"cngx-donut__fill\"\n [attr.cx]=\"center()\"\n [attr.cy]=\"center()\"\n [attr.r]=\"radius()\"\n [attr.stroke-width]=\"thickness()\"\n [attr.stroke-dasharray]=\"dasharray()\"\n [attr.stroke-dashoffset]=\"dashoffset()\"\n [attr.transform]=\"'rotate(-90 ' + center() + ' ' + center() + ')'\"\n fill=\"none\"\n stroke-linecap=\"round\"\n />\n </svg>\n @if (label(); as l) {\n <span class=\"cngx-donut__label\">{{ l }}</span>\n }\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-donut {\n display: inline-block;\n position: relative;\n line-height: 0;\n --cngx-donut-color: var(--cngx-chart-primary, currentColor);\n }\n cngx-donut .cngx-donut__track {\n stroke: var(--cngx-donut-track, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n }\n cngx-donut .cngx-donut__fill {\n stroke: var(--cngx-donut-color);\n transition: stroke-dashoffset var(--cngx-donut-transition, 320ms) ease-out;\n }\n cngx-donut .cngx-donut__label {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: var(--cngx-donut-label-font-size, 0.875rem);\n line-height: 1;\n color: var(--cngx-chart-text-color, currentColor);\n unicode-bidi: var(--cngx-chart-numeric-bidi, isolate);\n }\n cngx-donut .cngx-preset-skeleton {\n display: inline-block;\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: 50%;\n }\n cngx-donut .cngx-preset-fallback {\n display: inline-block;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-donut .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n `,\n ],\n})\nexport class CngxDonut {\n readonly value = input.required<number>();\n readonly max = input<number>(100);\n readonly size = input<number>(48);\n readonly thickness = input<number>(6);\n readonly label = input<string | null>(null);\n readonly state = input<CngxAsyncState<number> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n /** True while the skeleton branch renders - the host announces busy, the span stays decorative. */\n protected readonly busy = computed(() => this.activeView() === 'skeleton');\n\n /**\n * Meter value attributes render only in the content view: keeping\n * `aria-valuenow` while the skeleton or error fallback shows would\n * announce a stale reading for a value that is not on screen.\n */\n protected readonly showsMeterValue = computed(() => this.activeView() === 'content');\n\n constructor() {\n warnIfUnnamedPreset(\n 'cngx-donut',\n 'Bind [label] or [aria-label].',\n () => (this.ariaLabel() ?? this.label()) !== null,\n );\n }\n\n protected readonly center = computed(() => this.size() / 2);\n protected readonly radius = computed(() => (this.size() - this.thickness()) / 2);\n protected readonly circumference = computed(() => TWO_PI * this.radius());\n\n protected readonly dasharray = computed(() => {\n const c = this.circumference();\n return `${c} ${c}`;\n });\n\n protected readonly dashoffset = computed(() => {\n const c = this.circumference();\n return c * (1 - clampedRatio(this.value(), 0, this.max()));\n });\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport type { CngxAsyncState } from '@cngx/core/utils';\nimport { clampedRatio } from '../chart/preset-math';\nimport { injectPresetState, warnIfUnnamedPreset } from './preset-state';\n\n/**\n * Bullet chart range entry - a colour band stretching from one value\n * to another along the bullet's axis. Typical use: traffic-light\n * bands (\"good\" / \"fair\" / \"poor\") behind the actual+target bar.\n *\n * @category common/chart/presets\n */\nexport interface CngxBulletRange {\n readonly from: number;\n readonly to: number;\n readonly color?: string;\n readonly label?: string;\n}\n\n/** @internal */\ninterface RangeRendering {\n readonly key: string;\n readonly left: number;\n readonly width: number;\n readonly color: string | null;\n}\n\n/**\n * Bullet chart - Stephen Few's compact KPI visualisation. Three\n * stacked layers: background `[ranges]` (qualitative bands), an\n * `[actual]` filled bar, and a `[target]` vertical marker. Pure DOM,\n * no SVG. Host carries `role=\"meter\"`.\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/bullet.component.ts\n * @since 0.1.0\n * @relatedTo CngxDonut, CngxMiniBar, CngxDeviationBar\n *\n * <example-url>http://localhost:4200/#/common/chart/bullet/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/bullet/performance-vs-target</example-url>\n */\n@Component({\n selector: 'cngx-bullet',\n exportAs: 'cngxBullet',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'meter',\n '[attr.aria-valuenow]': 'showsMeterValue() ? actual() : null',\n '[attr.aria-valuemin]': 'showsMeterValue() ? 0 : null',\n '[attr.aria-valuemax]': 'showsMeterValue() ? maxValue() : null',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-busy]': 'busy() ? \"true\" : null',\n class: 'cngx-bullet',\n },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span class=\"cngx-preset-skeleton\" aria-hidden=\"true\"></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n().empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n().error() }}</span>\n }\n @case ('none') {}\n @default {\n <div class=\"cngx-bullet__track\">\n @for (r of rangeRenderings(); track r.key) {\n <div\n class=\"cngx-bullet__range\"\n [style.left.%]=\"r.left\"\n [style.width.%]=\"r.width\"\n [style.background]=\"r.color\"\n [attr.aria-hidden]=\"true\"\n ></div>\n }\n <div\n class=\"cngx-bullet__actual\"\n [style.width.%]=\"actualPercent()\"\n [attr.aria-hidden]=\"true\"\n ></div>\n <div\n class=\"cngx-bullet__target\"\n [style.left.%]=\"targetPercent()\"\n [attr.aria-hidden]=\"true\"\n ></div>\n </div>\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-bullet {\n display: block;\n width: var(--cngx-bullet-width, 200px);\n --cngx-bullet-actual-color: var(--cngx-chart-primary, currentColor);\n --cngx-bullet-target-color: var(--cngx-chart-text-color, currentColor);\n }\n cngx-bullet .cngx-bullet__track {\n position: relative;\n height: var(--cngx-bullet-height, 16px);\n background: var(--cngx-bullet-track, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.06)));\n border-radius: var(--cngx-bullet-radius, 2px);\n overflow: hidden;\n }\n cngx-bullet .cngx-bullet__range {\n position: absolute;\n top: 0;\n bottom: 0;\n opacity: var(--cngx-bullet-range-opacity, 0.35);\n }\n cngx-bullet .cngx-bullet__actual {\n position: absolute;\n top: 25%;\n bottom: 25%;\n left: 0;\n background: var(--cngx-bullet-actual-color);\n border-radius: var(--cngx-bullet-actual-radius, 1px);\n transition: width var(--cngx-bullet-transition, 240ms) ease-out;\n }\n cngx-bullet .cngx-bullet__target {\n position: absolute;\n top: 10%;\n bottom: 10%;\n width: 2px;\n margin-left: -1px;\n background: var(--cngx-bullet-target-color);\n transition: left var(--cngx-bullet-transition, 240ms) ease-out;\n }\n cngx-bullet .cngx-preset-skeleton {\n display: block;\n height: var(--cngx-bullet-height, 16px);\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-bullet-radius, 2px);\n }\n cngx-bullet .cngx-preset-fallback {\n display: inline-block;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-bullet .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n `,\n ],\n})\nexport class CngxBullet {\n readonly actual = input.required<number>();\n readonly target = input<number | null>(null);\n readonly max = input<number | null>(null);\n readonly ranges = input<readonly CngxBulletRange[]>([]);\n readonly state = input<CngxAsyncState<number> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n protected readonly activeView = this.preset.activeView;\n\n /** True while the skeleton branch renders - the host announces busy, the span stays decorative. */\n protected readonly busy = computed(() => this.activeView() === 'skeleton');\n\n /**\n * Meter value attributes render only in the content view: keeping\n * `aria-valuenow` while the skeleton or error fallback shows would\n * announce a stale reading for a value that is not on screen.\n */\n protected readonly showsMeterValue = computed(() => this.activeView() === 'content');\n\n constructor() {\n warnIfUnnamedPreset('cngx-bullet', 'Bind [aria-label].', () => this.ariaLabel() !== null);\n }\n\n protected readonly maxValue = computed(() => {\n const explicit = this.max();\n if (explicit !== null && explicit > 0) {\n return explicit;\n }\n const ranges = this.ranges();\n let m = Math.max(this.actual(), this.target() ?? 0);\n for (const r of ranges) {\n if (r.to > m) {\n m = r.to;\n }\n }\n return m > 0 ? m : 1;\n });\n\n protected readonly actualPercent = computed(\n () => clampedRatio(this.actual(), 0, this.maxValue()) * 100,\n );\n\n protected readonly targetPercent = computed(() => {\n const t = this.target();\n if (t === null) {\n return 0;\n }\n return clampedRatio(t, 0, this.maxValue()) * 100;\n });\n\n protected readonly rangeRenderings = computed<readonly RangeRendering[]>(\n () => {\n const m = this.maxValue();\n return this.ranges().map((r, i) => {\n const lo = Math.min(r.from, r.to);\n const hi = Math.max(r.from, r.to);\n return {\n key: `${i}-${r.label ?? ''}`,\n left: clampedRatio(lo, 0, m) * 100,\n width: clampedRatio(hi - lo, 0, m) * 100,\n color: r.color ?? null,\n };\n });\n },\n { equal: rangeRenderingsEqual },\n );\n}\n\n/** @internal */\nfunction rangeRenderingsEqual(a: readonly RangeRendering[], b: readonly RangeRendering[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const x = a[i];\n const y = b[i];\n if (x.key !== y.key || x.left !== y.left || x.width !== y.width || x.color !== y.color) {\n return false;\n }\n }\n return true;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport { injectLocale, type CngxAsyncState } from '@cngx/core/utils';\nimport { formatChartNumber } from '../chart/format-number';\nimport { injectPresetState } from './preset-state';\n\n/**\n * One segment in a stacked-bar series: a value, a label, optional colour.\n *\n * @category common/chart/presets\n */\nexport interface CngxStackedSegment {\n readonly value: number;\n readonly color?: string;\n readonly label: string;\n}\n\n/** @internal */\ninterface SegmentRendering {\n readonly key: string;\n readonly left: number;\n readonly width: number;\n readonly color: string | null;\n /** `<label>: <value>` with the value in the app locale. */\n readonly title: string;\n}\n\n/**\n * Single-bar stacked composition - visualises proportional shares of\n * a fixed total. Pure DOM, no SVG. Host carries `role=\"img\"` because\n * a stacked bar communicates a multi-segment ratio, not a single\n * bounded reading; the SR description enumerates segments via the\n * auto-generated `aria-label` (or the `[ariaLabel]` override).\n *\n * @category common/chart/presets\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/presets/stacked-bar.component.ts\n * @since 0.1.0\n * @relatedTo CngxBar, CngxDeviationBar, CngxBullet\n *\n * <example-url>http://localhost:4200/#/common/chart/stacked-bar/async-state-machine</example-url>\n * <example-url>http://localhost:4200/#/common/chart/stacked-bar/proportional-share-strips</example-url>\n */\n@Component({\n selector: 'cngx-stacked-bar',\n exportAs: 'cngxStackedBar',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n role: 'img',\n '[attr.aria-label]': 'effectiveAriaLabel()',\n '[attr.aria-busy]': 'busy() ? \"true\" : null',\n class: 'cngx-stacked-bar',\n },\n template: `\n @switch (activeView()) {\n @case ('skeleton') {\n <span class=\"cngx-preset-skeleton\" aria-hidden=\"true\"></span>\n }\n @case ('empty') {\n <span class=\"cngx-preset-fallback\">{{ i18n().empty() }}</span>\n }\n @case ('error') {\n <span class=\"cngx-preset-fallback cngx-preset-fallback--error\">{{ i18n().error() }}</span>\n }\n @case ('none') {}\n @default {\n <div class=\"cngx-stacked-bar__track\">\n @for (s of segmentRenderings(); track s.key) {\n <div\n class=\"cngx-stacked-bar__segment\"\n [style.left.%]=\"s.left\"\n [style.width.%]=\"s.width\"\n [style.background]=\"s.color\"\n [attr.title]=\"s.title\"\n [attr.aria-hidden]=\"true\"\n ></div>\n }\n </div>\n }\n }\n `,\n styleUrls: ['../chart-tokens.css'],\n styles: [\n `\n cngx-stacked-bar {\n display: block;\n width: var(--cngx-stacked-bar-width, 200px);\n }\n cngx-stacked-bar .cngx-stacked-bar__track {\n position: relative;\n height: var(--cngx-stacked-bar-height, 12px);\n background: var(--cngx-stacked-bar-track, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.05)));\n border-radius: var(--cngx-stacked-bar-radius, 6px);\n overflow: hidden;\n }\n cngx-stacked-bar .cngx-stacked-bar__segment {\n position: absolute;\n top: 0;\n bottom: 0;\n background: var(--cngx-stacked-bar-segment-color, var(--cngx-chart-primary, currentColor));\n transition:\n width var(--cngx-stacked-bar-transition, 240ms) ease-out,\n left var(--cngx-stacked-bar-transition, 240ms) ease-out;\n }\n cngx-stacked-bar .cngx-preset-skeleton {\n display: block;\n height: var(--cngx-stacked-bar-height, 12px);\n background: var(--cngx-skeleton-bg, var(--cngx-chart-grid-color, rgb(0 0 0 / 0.08)));\n border-radius: var(--cngx-stacked-bar-radius, 6px);\n }\n cngx-stacked-bar .cngx-preset-fallback {\n display: inline-block;\n font-size: var(--cngx-preset-fallback-font-size, 0.75rem);\n opacity: var(--cngx-preset-fallback-opacity, 0.7);\n }\n cngx-stacked-bar .cngx-preset-fallback--error {\n color: var(--cngx-chart-danger, currentColor);\n }\n `,\n ],\n})\nexport class CngxStackedBar {\n readonly segments = input.required<readonly CngxStackedSegment[]>();\n readonly total = input<number | null>(null);\n readonly state = input<CngxAsyncState<readonly CngxStackedSegment[]> | undefined>(undefined);\n readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });\n\n private readonly preset = injectPresetState(() => this.state());\n protected readonly i18n = this.preset.i18n;\n private readonly locale = injectLocale();\n protected readonly activeView = this.preset.activeView;\n\n /** True while the skeleton branch renders - the host announces busy, the span stays decorative. */\n protected readonly busy = computed(() => this.activeView() === 'skeleton');\n\n protected readonly resolvedTotal = computed(() => {\n const explicit = this.total();\n if (explicit !== null && explicit > 0) {\n return explicit;\n }\n let sum = 0;\n for (const s of this.segments()) {\n sum += s.value;\n }\n return sum > 0 ? sum : 1;\n });\n\n protected readonly segmentRenderings = computed<readonly SegmentRendering[]>(\n () => {\n const total = this.resolvedTotal();\n const locale = this.locale();\n const segmentTitle = this.i18n().stackedBarSegmentTitle;\n let runningLeft = 0;\n return this.segments().map((s, i) => {\n const width = (s.value / total) * 100;\n const left = runningLeft;\n runningLeft += width;\n return {\n key: `${i}-${s.label}`,\n left,\n width,\n color: s.color ?? null,\n title: segmentTitle(s.label, formatChartNumber(s.value, locale)),\n };\n });\n },\n { equal: segmentRenderingsEqual },\n );\n\n protected readonly effectiveAriaLabel = computed(() => {\n // Mirror the meter presets' state gating: outside the content view\n // the segment summary would name data that is not on screen -\n // \"Empty stacked bar\" while aria-busy announces a load in flight.\n const view = this.activeView();\n if (view === 'skeleton') {\n return this.i18n().loading();\n }\n if (view === 'empty') {\n return this.i18n().empty();\n }\n if (view === 'error') {\n return this.i18n().error();\n }\n const explicit = this.ariaLabel();\n if (explicit !== null && explicit !== '') {\n return explicit;\n }\n const segments = this.segments();\n // The resolved bundle fills the optional stacked-bar keys from the\n // locale defaults when a direct useValue token override omits them.\n if (segments.length === 0) {\n return this.i18n().stackedBarEmpty();\n }\n return this.i18n().stackedBarSummary(this.resolvedTotal(), segments);\n });\n}\n\n/** @internal */\nfunction segmentRenderingsEqual(\n a: readonly SegmentRendering[],\n b: readonly SegmentRendering[],\n): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n const x = a[i];\n const y = b[i];\n if (\n x.key !== y.key ||\n x.left !== y.left ||\n x.width !== y.width ||\n x.color !== y.color ||\n x.title !== y.title\n ) {\n return false;\n }\n }\n return true;\n}\n","/**\n * @module @cngx/common/chart\n *\n * Declarative, Signal-first chart system. Two-level architecture:\n * composable atoms (`<cngx-chart>` element + `[cngxAxis]` and layer\n * atoms applied to `<svg:g>` hosts) and preset molecules\n * (`<cngx-sparkline>`, `<cngx-donut>`, etc.).\n */\nexport {\n createLinearScale,\n createTimeScale,\n createBandScale,\n createOrdinalScale,\n type BandScale,\n} from './scales';\n\nexport {\n downsampleLTTB,\n injectChartBuffer,\n type CngxChartBuffer,\n type ChartBufferOptions,\n} from './buffer';\n\nexport { CngxChart } from './chart/chart.component';\nexport {\n createSignificantChangeTracker,\n type CngxSignificantChange,\n} from './chart/significant-change';\nexport { CngxChartAnnouncer } from './chart/chart-announcer.component';\nexport {\n CNGX_CHART_CONTEXT,\n injectChartContext,\n type CngxChartContext,\n type CngxChartPlotArea,\n type ScaleFn,\n type XScaleInput,\n} from './chart/chart-context';\n\nexport {\n CngxChartLoading,\n CngxChartEmpty,\n CngxChartError,\n CngxChartConnectionError,\n CngxChartReconnecting,\n CngxChartOverlay,\n CHART_SMALL_BREAKPOINT_PX,\n type CngxChartErrorContext,\n type CngxChartConnectionContext,\n type CngxChartSlotContext,\n} from './chart/template-slots';\n\nexport { CngxAxis } from './axis/axis.component';\nexport { CngxAxisDomain } from './axis/axis-domain';\nexport { CNGX_CHART_AXIS, type CngxChartAxis } from './axis/chart-axis';\nexport { type CngxAxisPosition, type CngxAxisType } from './axis/axis-position';\n\nexport { CngxChartLegend, type CngxChartLegendItem } from './legend/legend.component';\n\nexport { CngxLine } from './layers/line.component';\nexport { CngxArea } from './layers/area.component';\nexport { CngxBar } from './layers/bar.component';\nexport type { BarYAccessor } from './layers/bar.component';\nexport {\n CngxScatter,\n type ScatterXAccessor,\n type ScatterYAccessor,\n} from './layers/scatter.component';\nexport { CngxThreshold } from './layers/threshold.component';\nexport { CngxBand } from './layers/band.component';\nexport { CNGX_CHART_LAYER, type CngxChartLayer, type LayerGeometry } from './layers/chart-layer';\n\nexport {\n type CngxChartRenderer,\n type CngxChartRendererFactory,\n type ChartRendererDeps,\n} from './renderer/chart-renderer';\nexport { createSvgRenderer } from './renderer/svg-renderer';\nexport { createCanvasRenderer } from './renderer/canvas-renderer';\nexport { CNGX_CHART_RENDERER_THRESHOLD } from './renderer/renderer-threshold';\nexport {\n CNGX_CHART_RENDERER_FACTORY,\n createDefaultChartRenderer,\n provideChartRenderer,\n withChartRendererThreshold,\n withChartRendererFactory,\n type CngxChartRendererFeature,\n} from './renderer/renderer-factory';\nexport {\n createChartRendererController,\n type CngxChartRendererController,\n type ChartRendererControllerDeps,\n} from './renderer/chart-renderer-controller';\n\nexport {\n CNGX_CHART_I18N,\n provideChartI18n,\n withChartI18nLabels,\n type CngxChartI18n,\n type CngxChartI18nFeature,\n type CngxChartSummary,\n} from './i18n/chart-i18n';\nexport {\n CNGX_CHART_LANGUAGE_EN,\n type CngxChartLanguageSection,\n} from './i18n/chart-language-section';\n\nexport { CngxSparkline } from './presets/sparkline.component';\nexport { CngxMiniBar } from './presets/mini-bar.component';\nexport { CngxDeviationBar } from './presets/deviation-bar.component';\nexport { CngxMiniArea } from './presets/mini-area.component';\nexport { CngxDonut } from './presets/donut.component';\nexport { CngxBullet, type CngxBulletRange } from './presets/bullet.component';\nexport { CngxStackedBar, type CngxStackedSegment } from './presets/stacked-bar.component';\nexport {\n createPathBuilder,\n type PathBuilder,\n type PathBuilderOptions,\n type PathSegment,\n type LineYAccessor,\n type LineXAccessor,\n buildCurvePath,\n type CngxCurve,\n type PathPoint,\n} from './path';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["toMs"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AACG,SAAU,iBAAiB,CAC/B,MAAiC,EACjC,KAAgC,EAAA;AAEhC,IAAA,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM;AACvB,IAAA,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK;AACtB,IAAA,MAAM,KAAK,GAAG,EAAE,GAAG,EAAE;AACrB,IAAA,IAAI,KAAK,KAAK,CAAC,EAAE;AACf,QAAA,OAAO,MAAM,EAAE;IACjB;AACA,IAAA,MAAM,KAAK,GAAG,EAAE,GAAG,EAAE;AACrB,IAAA,OAAO,CAAC,CAAS,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,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