import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import'../../utility/live-region/live-region.class.js';import{type LyraChartChromeLegendPosition}from'./chart-chrome.js';import type{LyraChartDatumActivateDetail,LyraChartFormatter}from'./chart.class.js';export interface LyraLiteChartSeries{readonly label:string;readonly data:readonly(number|null)[]; /** A CSS color. Invalid values and `url()` paint servers fall back to the semantic categorical * color keyed by dataset index. */ readonly color?:string;}export type LyraLiteChartType='bar'|'line'; /** `type="bar"` only: `'linear'` (default) maps a bar's value to height via the standard * `niceDomain`-based fraction; `'sqrt'` compresses via `Math.sqrt(value / domainMax)`. See the * `scale` property's own doc comment below for the full rationale. */ export type LyraLiteChartScale='linear'|'sqrt'|'logarithmic'; /** * `'fit'` (default) squeezes the whole plot into the measured host width, * exactly as this component always behaved. `'scroll'` gives every bar a * fixed `barWidth` instead and lets the plot's content width exceed the * host's, making the host horizontally scrollable. */ export type LyraLiteChartLayout='fit'|'scroll';export type LyraLiteChartExportFormat='csv'|'svg';export type LyraLiteChartTableCellKind='value'|'total'; /** Identifies the accessible-table cell being formatted. A total has no owning dataset/series, * so `datasetIndex` and `seriesLabel` are `null` for `kind: 'total'`. */ export interface LyraLiteChartTableCellContext{kind:LyraLiteChartTableCellKind;datasetIndex:number|null;index:number;label:string;seriesLabel:string|null;} /** Formats one finite numeric value in the built-in multi-series accessible table. */ export type LyraLiteChartTableCellFormatter=(value:number,context:LyraLiteChartTableCellContext)=>string;export interface LyraLiteChartEventMap{'lr-datum-activate':CustomEvent>;'lr-point-click':CustomEvent<{datasetIndex:number;index:number;label:string|undefined;value:number|null;}>;} /** * `` — a dependency-free bar/line chart, plain SVG/DOM * rendering with zero peer dependencies (unlike `lr-chart`, which wraps * `chart.js`). For a project whose architecture forbids a charting * dependency outright, this covers the common bar/line case: grouped or * stacked bars, multi-series lines, per-point click, and hover tooltips * (native SVG ``, no positioning JS needed) — not a full `lr-chart` * replacement (no zoom/pan, no pie/doughnut/radar/scatter/bubble types, no * horizontal/dual-y-axis, no raw-config passthrough, no interactive legend * toggle — unlike `lr-chart`/`lr-box-plot`, clicking a `legend-item` here does * not hide its series; the legend is a static color key). * * Because this renders real DOM (not canvas), it reuses `lr-chart`'s * `--lr-chart-*` theme tokens directly via CSS `var()` — no * `getComputedStyle()`-based re-theming step is needed the way `chart.ts` * needs one for its canvas. * * By default (`layout="fit"`) the plot always squeezes to the measured host * width. Three independent, opt-in escape hatches for dense/aligned data: * `layout="scroll"` (+ `barWidth`) gives every bar a fixed pixel width and * lets the plot overflow the host horizontally (scrollable) instead of * squeezing; `maxLabels` decimates which x-axis text labels render (bars * always still render) once there are more categories than that, with * `maxLabels="auto"` deriving the cap from the allocated plot width; and * `barX` lets a consumer hand in its own per-category x-coordinate function * — e.g. to pixel-align this chart's bars with a sibling `lr-heatmap`'s * calendar columns — overriding the internal slot math for both bars and * their labels. All three are additive and no-ops when left unset. * * Seven further additive, opt-in properties: `pointText` overrides the * per-bar/per-point `<title>` tooltip and accessible-name text (mirrors * `lr-heatmap`'s `cellText` hook), falling back to the built-in raw-value * template when unset; `roundedBars` draws bars as a rounded-top path * instead of a square-cornered rect; `skipZero` omits a bar entirely (not * just zero-height) for an exactly-`0` value; `valueAxisGutter`/`barGapRatio` * override the internal `PAD_LEFT`/`BAR_GROUP_GAP` layout constants, while * `valueAxisGutter="auto"` sizes the gutter from the rendered tick strings; `scale` * (`type="bar"` only) switches the bar-height mapping from the default * linear `niceDomain` fraction to a `Math.sqrt(value / domainMax)` * compression (mirroring `lr-heatmap`'s matrix-mode `sqrt` scale) so a * skewed dataset's smaller bars don't get washed out by one dominant value * — gridlines/tick labels stay on the linear domain regardless, only the bar * marks' own height changes, and `type="line"` ignores `scale` entirely; and * `withoutValueAxis` suppresses `renderGrid()`'s gridlines/tick labels altogether * (x-axis category labels, rendered separately, are unaffected). An eighth, * `legendText`, appends a formatter-supplied string after each series' label in the * built-in legend row (e.g. a value or share) — no-op while `legend` is unset, matching the same * fallback-to-unchanged convention as every other hook here. The built-in multi-series accessible * table can independently format its finite numeric cells through `tableCellFormatter`; for a * stacked bar chart, `tableTotals` adds an opt-in localized total column. Both are no-ops when * unset. * * Public collection properties take bounded, clone-owned readonly snapshots. Create a new * collection and reassign it after changes; mutating the assigned array does not update the view. * * Two `lr-chart` surfaces have no counterpart here, deliberately: a per-series `stack` group id * and a per-axis `stackedAxes` override. This chart has exactly one value scale (no `y2`), so "an * unstacked overlay on a second axis" has no equivalent shape, and `stacked` already sums the * whole category into one segmented bar; a per-series stack-group id would need the bar-geometry * pass below to track independent running offsets per group instead of one per category. Tooltip * title/footer formatters are likewise absent: the hover tooltip here is a native SVG `<title>` * per mark (`pointText`), not a multi-item tooltip with separate regions for several datasets * sharing a hovered category. * * @customElement lr-lite-chart * @event lr-datum-activate - Fired when a bar/point is activated. The * normalized detail includes `kind`, `datasetIndex`, `index`, `label`, and * `value` across the chart family. * @event lr-point-click - Fired when a bar/point is activated (click, or * Enter/Space while focused). `detail: { datasetIndex: number, index: * number, label: string | undefined, value: number | null }` — same shape * as `lr-chart`'s `lr-point-click`. * @csspart base - The host's flex layout wrapper. * @csspart description - The visually hidden accessible chart description, when set. * @csspart grid-line - Each horizontal gridline. * @csspart axis-label - Each axis tick label. * @csspart axis-title - The x/y axis title text, when set. * @csspart bar - Each bar rect (type="bar"). Carries `data-selected` and `aria-pressed="true"` * when its category index is in `selectedIndices`. While `forced-colors: active` matches, its fill * is a per-series SVG texture instead of a flat color, so series that collapse onto the same * system color stay distinguishable. * @csspart line - Each series' stroked line path (type="line"). While `forced-colors: active` * matches, it carries a per-series `stroke-dasharray` for the same reason. * @csspart point - Each series' per-point keyboard target (type="line"). Carries * `data-selected` and explicit `aria-pressed` state. * @csspart legend - The legend row, when `legend` is set. * @csspart legend-item - Each legend entry. * @csspart legend-swatch - Each legend entry's color swatch. While `forced-colors: active` * matches, it carries a `data-encoding` attribute selecting the CSS texture that matches its * series' plotted encoding. * @csspart legend-text - Extra per-item text after the series label, rendered only when `legendText` is set. * @csspart live-region - The current mark announcement for keyboard users. * @csspart data-list - A visually hidden sampled list of plotted data points (single-series only). * @csspart data-table-toggle - The disclosure button rendered by `dataTableToggle`. * @cssprop [--lr-lite-chart-data-table-toggle-hover-bg=var(--lr-color-brand-quiet)] - Hover * background of the `dataTableToggle` disclosure button. * @cssprop --lr-lite-chart-data-table-toggle-active-bg - Pressed background of the * `dataTableToggle` disclosure button; defaults to a mix of the hover background with the shared * active mix partner. * @csspart data-table - A visually hidden sampled category×series data table, rendered instead of * `data-list` when there is more than one dataset so a screen-reader user hears series grouping * rather than one flattened N×M sequence. * @csspart table - The generated semantic table inside the `data-table` container. * @csspart data-truncation - Explanation shown when built-in marks/data alternatives sample more * than 1,000 records. * @slot data-table - An optional consumer-provided complete/paginated accessible data alternative. * @cssprop [--lr-chart-height=var(--lr-size-280px)] - Consumer-owned chart height. The `height` * property supplies only a private fallback, so this public token always wins when set. * @cssprop [--lr-chart-grid-color=var(--lr-color-border)] - Grid-line color. * @cssprop [--lr-chart-tick-color=var(--lr-color-text-quiet)] - Axis and legend-detail color. * @cssprop [--lr-chart-tick-font-size=var(--lr-font-size-2xs)] - Axis tick-label font size. Same * token name as `lr-chart`'s canvas equivalent, so theming either retunes both. * @cssprop [--lr-chart-legend-color=var(--lr-color-text)] - Legend label color. * @cssprop [--lr-chart-legend-side-max=var(--lr-size-15rem)] - Maximum side-legend track size. * @cssprop [--lr-chart-color-1=var(--lr-color-chart-1)] - First series color. * @cssprop [--lr-chart-color-2=var(--lr-color-chart-2)] - Second series color. * @cssprop [--lr-chart-color-3=var(--lr-color-chart-3)] - Third series color. * @cssprop [--lr-chart-color-4=var(--lr-color-chart-4)] - Fourth series color. * @cssprop [--lr-chart-color-5=var(--lr-color-chart-5)] - Fifth series color. * @cssprop [--lr-chart-color-6=var(--lr-color-chart-6)] - Sixth series color. * @cssprop [--lr-chart-color-7=var(--lr-color-chart-7)] - Seventh series color. * @cssprop [--lr-chart-color-8=var(--lr-color-chart-8)] - Eighth series color. * @cssprop [--lr-lite-chart-selected-outline-color=var(--lr-color-brand)] - Stroke for a bar/point whose category index is in `selectedIndices`. * @cssprop [--lr-lite-chart-selected-outline-width=var(--lr-size-2px)] - Stroke width for a bar/point whose category index is in `selectedIndices`. * @cssprop [--lr-chart-pattern-step=var(--lr-space-2xs)] - Tile size of the texture painted on * `[part='legend-swatch']` while `forced-colors: active` matches, where the eight-color series * ramp collapses onto a repeating system-color cycle and the texture becomes the only channel * keeping series apart. Declared on the swatch part rather than the host; the stripe width within * a tile stays `--lr-border-width-thin`, so a larger step spaces the stripes further apart. * Shared verbatim with `<lr-chart>` and `<lr-box-plot>`. * @status stable * @since 4.0.0 */ export declare class LyraLiteChart extends LyraElement<LyraLiteChartEventMap>{protected static readonly ownedCollectionProperties:readonly string[];static styles:import("lit").CSSResultGroup[];type:LyraLiteChartType;labels:readonly string[];private _datasets; /** Series with an array `data` payload. Malformed entries are dropped without hiding siblings. */ get datasets():readonly LyraLiteChartSeries[];set datasets(value:readonly LyraLiteChartSeries[]); /** * Deliberately opt-in (default `false`), unlike `lr-chart`'s negative-polarity `withoutLegend` * (legend shown by default): `lr-lite-chart`'s typical single-series sparkline-adjacent usage is * more often legend-redundant than `lr-chart`'s typical multi-dataset case. */ legend:boolean; /** Logical placement for the optional DOM legend. Deliberately `'bottom'`, unlike `lr-chart`'s * `'top'` default -- shared with `lr-box-plot` via `chart-chrome.ts`'s * `normalizeChartChromeLegendPosition()` default. */ legendPosition:LyraChartChromeLegendPosition; /** A CSS `height`; invalid values leave the default height token in control. The public * `--lr-chart-height` token always takes precedence over this private fallback. */ height:string; /** Horizontal axis title. Long titles ellipsize to fit while retaining their full accessible name. */ xLabel:string; /** Vertical axis title. Long titles ellipsize to fit while retaining their full accessible name. */ yLabel:string;beginAtZero:boolean; /** Stacks each category's bars into one segmented bar. Ignored for `type="line"`. */ stacked:boolean; /** Formats a y-axis tick value for display (e.g. `(v) => \`$${v.toFixed(2)}\``). Falls back to the * built-in nice-number formatter when unset. */ tickFormat?:(value:number)=>string; /** Formats finite numeric cells in the built-in multi-series accessible table, including its * opt-in total cells. Unset preserves locale-aware number formatting. */ tableCellFormatter?:LyraLiteChartTableCellFormatter; /** Unified context-object formatter shared with the Chart.js-backed chart surfaces. */ formatter?:LyraChartFormatter; /** Adds a localized total column to the built-in multi-series accessible table for a stacked * bar chart. Ignored for grouped bars and line charts. */ tableTotals:boolean; /** * Makes the generated data table visible; it stays screen-reader available when false. Same * meaning as `<lr-chart>`'s property of the same name. * @default false */ showDataTable:boolean; /** * Render a disclosure button above the accessible data table so a sighted reader can reveal the * numbers on demand, turning `showDataTable` into the disclosure's INITIAL state rather than its * whole behavior. The table stays in the DOM in both states, so assistive technology never loses * it. * * Matters more here than on `<lr-chart>`: this component exists to avoid the Chart.js peers, so * without it an app that chose it for that reason had to either hand-roll a `<details>` around a * duplicated table or adopt `<lr-chart>` and pull in Chart.js for a button — the cheap component * stuck with the expensive workaround. * @default false */ dataTableToggle:boolean; /** Live disclosure state; null until toggled, so an untouched control follows `showDataTable`. */ private dataTableExpandedOverride;private readonly dataTableId; /** Identical to `showDataTable` whenever `dataTableToggle` is off, keeping the unset path * byte-identical to before. */ private get dataTableVisible();private toggleDataTable; /** `'fit'` (default) squeezes the plot into the measured host width, unchanged from before this * property existed. `'scroll'` gives every bar a fixed `barWidth` instead, letting the plot's * content width exceed the host's — the host becomes horizontally scrollable * (`overflow-x: auto`) so every bar stays exactly `barWidth` wide regardless of category count. * Reflects to the `layout` attribute (e.g. for `:host([layout='scroll'])` host styling). */ private _layout;get layout():LyraLiteChartLayout;set layout(next:LyraLiteChartLayout); /** Fixed per-category bar width in px, used only when `layout="scroll"`. Ignored (as before this * property existed) in `layout="fit"`, the default. Scroll content is capped at 1,000,000px, * so an excessive requested width is reduced as needed to keep SVG and CSS geometry finite. */ barWidth:number; /** Caps how many x-axis category labels render text once `this.labels.length` exceeds it, * decimating roughly evenly while always keeping the first and last label. `'auto'` derives a * deterministic cap from the resolved plot width and widest rendered category label using the * same width estimate as label ellipsis. Bars themselves always render regardless — only the * axis text is decimated. An explicit number is authoritative. Unset (the default) renders every * label, unchanged from before this property existed. Works in either `layout` mode. */ maxLabels?:number|'auto'; /** Overrides the x-origin `renderBars()`/the category labels would otherwise compute internally * for a given category index, for `type="bar"` only (bars and their axis labels stay * consistent with each other either way). Lets a consumer pixel-align this chart's bars with, * e.g., a sibling `lr-heatmap`'s calendar columns by handing both components the same * coordinate function. Unset (the default) uses the existing internal per-category slot math, * unchanged from before this property existed. The callback resolves once per rendered category * per render and its finite result is shared by bars and labels; a non-finite result falls back * to normal slot placement. */ barX?:(index:number)=>number; /** Formats the per-bar/per-point `<title>` tooltip and accessible-name text — receives the category * label, the raw value, and the dataset index. Falls back to the built-in raw-value template * when unset (mirrors `lr-heatmap`'s `cellText` hook). */ pointText?:(label:string,value:number,datasetIndex:number)=>string; /** Formats extra per-item text appended after a series' label in the built-in legend row (e.g. a * value or percentage share) — receives the series label and its dataset index. Falls back to * rendering the label alone when unset (today's exact legend output), mirroring `pointText`'s and * `tickFormat`'s existing opt-in-hook convention. Has no effect while `legend` is `false`. */ legendText?:(label:string,datasetIndex:number)=>string; /** * Visual-only override for one category-axis tick's text — receives that category's own `labels` * entry and its index, and returns the string to draw, or `null` to draw no tick there at all. * * Display, not data: `labels` stays the single authoritative source for the generated accessible * table's row headers, the per-mark `<title>`/accessible name, the live announcement and CSV * export, so blanking a tick here never blanks the same category anywhere a reader or a * spreadsheet needs it. That separation is the whole point — folding the same intent into * `labels` (passing `''` for the categories that should carry no tick) empties the table row * header too, which is what made boundary-aligned ticks impossible before this hook existed. * * Complements `maxLabels` rather than replacing it: `maxLabels` decimates evenly to prevent * label collision and is applied FIRST, so a category it already dropped never reaches this * callback. Use this one for ticks that must line up with an external grouping boundary (a * month, a release, a shift change) instead of an even stride, and leave `maxLabels` unset there. * * The returned string is ellipsized to the tick's own slot exactly like a source label, with the * full text kept as the tick's accessible name; a return value that is neither a string nor * `null` falls back to the source label rather than reaching the DOM. */ axisLabelText?:(label:string,index:number)=>string|null; /** `type="bar"` only: draws each bar as a rounded-top-corner shape instead of the default * square-cornered rect. Default `false` renders exactly today's plain `<rect>`. */ roundedBars:boolean; /** `type="bar"` only: omits a bar entirely (no mark, no `tabindex`, no tooltip) for a value that * is exactly `0` — `null`/non-finite values are always skipped regardless of this flag. Default * `false` preserves today's behavior of a zero-height but focusable/titled bar. */ skipZero:boolean; /** Overrides the internal `PAD_LEFT` (36px) axis-gutter constant, or accepts `'auto'` to size the * gutter from the exact formatted tick strings rendered in the current pass. Automatic sizing * never shrinks below 36px. Fit layout bounds it to the smaller of 240px or 40% of the measured * SVG width; scroll layout bounds it at 240px without feeding the explicitly-sized SVG's own * width back into its gutter. An explicit numeric value is authoritative and retains the * established 0..1,000,000px finite guard. The gutter is on the left in LTR and the right in * RTL, keeping the y axis at logical start. Unset keeps the 36px default. */ valueAxisGutter?:number|'auto'; /** Overrides the internal `BAR_GROUP_GAP` (0.2) fraction of a category slot left as a gap between * categories. Grouped bars share the remaining width with bounded internal gaps; ratios below * 1 retain positive bar widths. Unset (the default) keeps the 0.2 category gap. */ barGapRatio?:number; /** `'linear'` (default) maps values through the standard domain fraction. `'sqrt'` compresses * bar magnitudes while keeping line points and gridlines linear; stacked bars compress each * signed total once and split it proportionally. `'logarithmic'` maps bars, line points and * gridlines onto the same log axis with positive, bounded logarithmic ticks. Logarithmic stacks * map the finite positive total once and * split its extent by raw positive shares; nonpositive segments have zero natural log height. * With minBarHeight unset, the natural logarithmic stack remains within the plot. */ scale:LyraLiteChartScale; /** Suppresses `renderGrid()` entirely — no gridlines, no y-axis tick labels. x-axis category * labels (rendered separately) are unaffected. Default `false` preserves today's behavior. */ withoutValueAxis:boolean; /** A pixel floor for a bar/stacked-segment's rendered height, for a nonzero value that would * otherwise round to sub-pixel and become visually indistinguishable from absent (while still * being focusable/tab-stoppable/announced) — a real accessibility/visibility gap for * heterogeneous-magnitude stacked data. `type="bar"` only; a value of exactly `0` is unaffected * (that's `skipZero`'s job, not this one's). Finite values are capped at 1,000,000px to keep * derived SVG geometry practical. Unset (the default) reproduces today's `Math.max(0, y2 - y1)` * exactly, with no floor. Authored floors can exceed the available plot height. Linear and * logarithmic stacks push subsequent segments along their signed pixel cursor. */ minBarHeight?:number; /** Category indexes to mark `data-selected` and `aria-pressed="true"` on every bar/point at * that index, across every * dataset -- e.g. to highlight a whole selected week's column in a stacked chart. Empty (the * default) reproduces today's exact output: no mark carries `data-selected`. Style the highlight * via the `--lr-lite-chart-selected-outline-color` and * `--lr-lite-chart-selected-outline-width` custom properties -- selectors such as * `::part(bar)[data-selected]` and `::part(point)[data-selected]` are invalid CSS (Shadow Parts * forbids an attribute selector after `::part()`), so the outline is * painted inside the shadow root and exposed through that token. This component takes no opinion * on what the highlight looks like, only which marks it applies to. */ selectedIndices:readonly number[]; /** Overrides the `<svg>`'s auto-derived `aria-label` (`datasets.map(d => d.label).join(', ') || * 'Chart'`) — for a consumer with a real, localized chart description. A host `aria-label` * takes precedence. Unset (the default) keeps today's auto-derived (English-fallback) label * exactly. `lr-lite-chart` keeps this override under its original `accessible-label` name; it * is unrelated to (and was not renamed alongside) the deprecated `accessible-label` alias that * `lr-chart`/`lr-box-plot` dropped in favor of their mirrored `label` property. */ accessibleLabel?:string; /** Accessible chart name. A host `aria-label` wins. */ label:string|null; /** Optional accessible chart description. */ description:string|null; /** Instance-unique prefix for the forced-colors `<pattern>` ids this chart's marks reference. */ private forcedColorPatternId;private descriptionId;private plotWidth;private plotHeight; /** Browser-only fit measurement begins after the first hydrated render so the server fallback * stays structurally identical during hydration. */ private fitMeasurementAvailable; /** One roving tab stop across all bar/point marks. */ private activeMarkIndex;private svgEl?;private liveRegion?;private resizeObserver?;private resizeObserverDocument?;private resizeObserverTarget?;private resizeObserverGeneration;private axisTitleTargets;private axisTitleFrame?;private axisTitleFits;private categoryLabelFits;private forcedColorsQuery?;private forcedColorsWindow?;private refocusMarkAfterUpdate;private refocusChartAfterUpdate;private politeAnnouncementSink?;private lastDataTruncationAnnouncement; /** Gates the sampling notice so an initially supplied large dataset is described, not announced. */ private isMounting; /** * Appends one streamed category to every series and optionally keeps only the newest `maxPoints` * categories. This is a controlled convenience method: it replaces `labels`/`datasets` with new * arrays, so a host can listen for the property update or continue treating the chart as a normal * controlled component. Missing series values become `null` rather than shifting alignment. */ appendData(label:string,values:(number|null)[],maxPoints?:number):void; /** * Returns a spreadsheet-safe CSV snapshot over the complete canonical record domain: the * greatest of the label count and every series' data count. Missing labels and values become * empty aligned cells, so a longer or ragged series is never truncated or shifted. */ exportData(format:LyraLiteChartExportFormat):string;attributeChangedCallback(name:string,oldValue:string|null,value:string|null):void;connectedCallback():void;private armResizeObserver;disconnectedCallback():void;adoptedCallback():void;private readonly onForcedColorsChange;private armForcedColorsWatcher;private disarmForcedColorsWatcher;private syncAnnouncementSink;private releaseAnnouncementSink;private resetResizeObserver;protected firstUpdated(changed:PropertyValues):void;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void; /** Fit using the rendered font after hydration, preserving Lit's text part anchors. */ private fitAxisTitles; /** Truncate one category-axis tick to a real measured `extent`, the same binary-search shape * fitAxisTitles() uses for axis titles: getComputedTextLength() measures what the browser * actually painted, which a character-count estimate (APPROX_LABEL_CHARACTER_WIDTH, used only * for the pre-layout initial paint) cannot. Returns the far edge this tick actually occupies -- * `x + width` for a 'start' anchor, `x - width` for 'end', `x` (its own position; a 'middle' * anchor's occupied edges are each derived from this by its own caller, since a centered label * splits `width` in half each direction) otherwise -- so a caller resolving a neighboring tick * can bound it against what this one really painted instead of its nominal budget. */ private fitOneCategoryLabel; /** Fit every category-axis tick to its real per-survivor slot width after layout. * displayCategoryLabel()'s character-count estimate only sizes the pre-layout initial paint * (renderChart()'s `categoryLabelWidth`, an AVERAGE decimation stride); real glyph widths vary * by platform and font enough that the estimate alone can under-truncate (the painted text * overflows its slot and collides with a neighbor) even where the average exactly matches the * tightest real gap. A per-tick, per-neighbor re-fit is the only way to make "no overlap" an * actual guarantee rather than a usually-true average: * * A center-anchored (interior) survivor splits its own width in half each direction, so if its * extent never exceeds the smaller of its two real neighbor gaps, two such neighbors can never * together claim more than the gap between them. A boundary survivor ('start'/'end', pointed * toward the plot interior -- see renderChart()) grows in one direction only and is fit FIRST, * using the *entire* real gap to its one neighbor, so a long boundary label (this file's own * test coverage requires one to render in full, unellipsized, whenever the plot is wide enough) * is not pre-emptively starved by a neighbor that may not need the room. Its interior neighbor * is then bounded by what the boundary tick ACTUALLY painted (this method's return value), not * by the boundary's nominal budget -- the only order that can satisfy both "a long boundary * label can use the whole gap" and "no realized overlap" at once. The rare case of exactly two * boundary ticks and no interior arbiter between them splits their one shared gap evenly instead * of letting both independently claim it in full. */ private fitCategoryLabels;private syncAxisTitleTargets;private queueAxisTitleFit;private colorFor; /** Effective closed-set type for both attribute and untyped property writes. */ private get effectiveType(); /** * Whether the per-series forced-colors encodings apply. Under `forced-colors: active` the * `--lr-color-chart-*` ramp behind `DEFAULT_PALETTE` is remapped onto the small repeating * system-color cycle the platform exposes, so series 1/4/7 (and 2/5/8, 3/6) paint identically. * Texture and line dash are what keep them apart — the SVG counterpart of the CanvasPattern and * `borderDash` cycle `<lr-chart>` applies to its own repeated colors. */ private forcedColors; /** The paint a mark of `index` uses: a texture reference under forced colors, else the color. */ private markPaint; /** The legend swatch's texture key, or `nothing` on a normal palette. */ private legendEncoding; /** `stroke-dasharray` for a line series, or `nothing` on a normal palette. */ private markDash; /** * One `<pattern>` per series, painted only while forced colors are active. Each tile lays the * series' own (system) color down first, then strokes the encoding's texture in the surface * color, mirroring `createForcedColorPattern()`'s canvas tiles shape for shape. */ private renderForcedColorPatterns; /** Dispatches to the host-provided `pointText` formatter when set, otherwise `undefined` (the * caller falls back to its own built-in template) — mirrors `lr-heatmap`'s `resolveCellText()`. */ private resolvePointText;private formatTableCell;private tableTotalAt; /** The complete category domain, including values supplied without a matching label. */ private recordCount; /** Source indexes shared by SVG marks, keyboard navigation, and the built-in data alternative. */ private recordSample;private generatedDataIsSampled;private dataTruncationMessage;private hasCustomDataTable; /** The ordered set of eligible marks used by both keyboard navigation and * the screen-reader data alternative. */ private interactiveMarks; /** A fit-layout chart needs the SVG's allocated dimensions before any coordinate-based * content can be drawn. Keep the SVG itself mounted so ResizeObserver can provide that first * measurement, while a realm without ResizeObserver keeps the established fallback rendering. */ private awaitingFitMeasurement;private refreshFitMeasurementAvailability;private markIndexMap;private normalizedMarkIndex;private markAnnouncement;private onMarkFocus;private focusMark; /** * A value-to-y-pixel mapping for a bar's top/bottom edge. `'linear'` (the * default) is the standard `niceDomain`-fraction formula. `'sqrt'` * compresses each signed magnitude independently around the linear zero * baseline, so positive and negative bars stay on their respective sides. * * NOT used for the `stacked && scale === 'sqrt'` case — that combination's * proportionality (compress the bar's *total* height once, then split it * linearly by each segment's share) is computed directly in `renderBars()`, * since a per-segment call here (compressing each segment's absolute * cumulative stack position independently) is exactly the non-proportional * bug this method's stacked callers used to have. */ private barValueToY; /** * The `[0, 1]` axis fraction for `value` under the active `scale`. * * `'logarithmic'` routes through `logDomainFraction`; everything else keeps the plain linear * `domainFraction`. Deliberately does NOT fold in `'sqrt'`: that mode compresses bars only, and * has never moved gridlines or line points, so pulling it in here would silently change existing * output. Bars reach this through `barValueToY()`, which applies sqrt before calling in. */ private valueFraction; /** * The lower bound of a logarithmic axis. * * Deliberately NOT the linear `lo`: `beginAtZero` defaults to true, so `lo` is normally `0`, and * zero has no logarithm. Using the smallest POSITIVE datum instead is what makes the axis span * the data's real decades — otherwise a 1..1000 series collapses onto a single decade and every * value below the top one pins to the baseline. Falls back to a decade below the maximum when no * positive datum exists, which keeps the geometry finite for a degenerate series. */ private logDomainFloor; /** Normalizes `minBarHeight` to a non-negative pixel floor, or `undefined` when left unset -- a * non-finite/negative explicit value falls back to `0` (a no-op floor, since a bar's natural * height is never negative) rather than corrupting every stacked-bar Y position it's compared * against/subtracted from in `renderBars()`. A practical ceiling keeps its derived SVG geometry * bounded even when an otherwise finite public property is enormous. */ private effectiveMinBarHeight; /** * A rounded-top-corners `<path>` `d` string for a bar occupying * `[x, y, x+w, y+h]` — an SVG `<rect>` can only express a uniform radius * on all four corners, so `roundedBars` switches the mark to a path * instead of adding `rx`/`ry` to keep the bottom edge square against the * baseline. `r` is clamped so it never exceeds half the bar's width or its * full height (a thin/short bar degrades to a plain rectangle path rather * than self-intersecting). */ private roundedBarPath;private domain;private emitPoint;private emitNearestLinePoint;private onPointKeyDown;private formatValueAxisTick;private renderGrid; /** * `slot` is the per-category width to lay bars out against — either the * measured-width-derived `plotW / n` (`layout="fit"`) or the fixed * `barWidth` (`layout="scroll"`), computed once by the caller * (`renderChart()`) and handed to both this method and the category-label * x-position calc so the two can never drift apart from each other. */ private renderBars;private renderLines;render():TemplateResult;private resolvedValueAxisGutter;private automaticMaxLabels; /** Indexes retained by `maxLabels`, selected from the generated mark sample so an independently * sampled domain cannot erase requested labels at a later set intersection. The generated mark * sample caps the useful result at 1,000, so this selector must do the same rather than allocate * an arbitrary consumer-supplied `maxLabels` count. In auto mode the resolved plot width and * rendered source indexes supply a deterministic cap. `undefined` means every *sampled* label * renders, preserving the default and non-finite-value behavior. */ private visibleLabelIndexes;private displayCategoryLabel;private renderChart;}declare global{interface HTMLElementTagNameMap{'lr-lite-chart':LyraLiteChart;}}