import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import{type WordCloudRotation,type WordCloudScale,type WordCloudWord}from'./word-cloud-layout.js';export type{WordCloudRotation,WordCloudScale,WordCloudWord};export interface LyraWordCloudEventMap{'lr-word-activate':CustomEvent>;} /** A named CSS-color override shown by the optional word-cloud legend. Invalid colors render a * transparent swatch. */ export interface WordCloudLegendItem{readonly label:string;readonly color:string;} /** * `` — a zero-dependency SVG word/tag cloud. First-party * invention (no Web Awesome equivalent). Each word's rendered size is scaled * from its `weight` and placed via an outward Archimedean-spiral search (the * standard word-cloud heuristic: heaviest words placed first, each one * spiraling out from the center until it clears every word already placed). * * Unlike sibling `lr-sparkline`/`lr-heatmap` (one `role="img"` glyph * standing in for an aggregate value), the individual words here are the * meaningful interactive content — but with up to `MAX_WORDS` of them, making * every single one its own tab stop would be a poor keyboard experience. * Instead, like `lr-heatmap`'s cells, the whole `[part="svg"]` is one tab * stop with roving arrow-key focus (Home/End jump to the first/last word, * Enter/Space activates the focused one), a drawn `[part="focus-ring"]`, and * a shared light-DOM polite status announcement. The application role and * aggregate accessible name live on that same focusable SVG. An authored host * `aria-label` is forwarded to that semantic owner and takes precedence over * the localized generated name; any authored host role remains on the host. * `[part="live-region"]` is an aria-hidden mirror of the most recent announcement. Mount is silent, and identical edge * movements append separate announcements. * * The eight default palette custom properties inherit from theme ancestors; setting one directly * on the word cloud still wins through the normal cascade. * * @customElement lr-word-cloud * @event lr-word-activate - Fired from pointer activation, or Enter/Space on the focused word. * `detail: { text, weight, group }`. * @csspart base - The word-cloud wrapper. * @csspart svg - The word-cloud SVG. * @csspart word - A rendered word. * @csspart legend - The optional color key below the cloud. * @csspart legend-item - One named color entry. * @csspart legend-swatch - The color swatch for a legend entry. * @csspart legend-label - The visible legend label. * @csspart legend-limit - Localized rendered/received legend-entry disclosure when the explicit legend is bounded. * @csspart focus-ring - The keyboard focus ring. * @csspart live-region - An aria-hidden shadow mirror of the current announcement; the actual * announcement uses the shared light-DOM polite sink. * @csspart empty - The empty-state message. * @csspart limit - Numeric rendered/input disclosure when input normalization or layout omits data. * @cssprop [--lr-word-cloud-color-1=var(--lr-color-brand)] - First entry of the default categorical palette. * @cssprop [--lr-word-cloud-color-2=var(--lr-color-success)] - Second entry of the default categorical palette. * @cssprop [--lr-word-cloud-color-3=var(--lr-color-warning)] - Third entry of the default categorical palette. * @cssprop [--lr-word-cloud-color-4=var(--lr-color-danger)] - Fourth entry of the default categorical palette. * @cssprop [--lr-word-cloud-color-5=var(--lr-color-chart-1)] - Fifth entry of the default categorical palette. * @cssprop [--lr-word-cloud-color-6=var(--lr-color-chart-2)] - Sixth entry of the default categorical palette. * @cssprop [--lr-word-cloud-color-7=var(--lr-color-chart-3)] - Seventh entry of the default categorical palette. * @cssprop [--lr-word-cloud-color-8=var(--lr-color-chart-4)] - Eighth entry of the default categorical palette. * @status stable * @since 4.0.0 */ export declare class LyraWordCloud extends LyraElement{static styles:import("lit").CSSResultGroup[];private _words;private inputDroppedCount;private inputTruncatedCount;private inputWordCount; /** Normalized frozen word snapshot. At most 10,000 source records and a bounded aggregate text * budget are scanned; invalid records are skipped, and every accepted weight is the finite * nonnegative value used by layout/events/announcements. Reassign to update. */ get words():readonly WordCloudWord[];set words(value:readonly WordCloudWord[]); /** Font size, in px, for the lowest-weight word. */ minFontSize:number; /** Font size, in px, for the highest-weight word. */ maxFontSize:number; /** Pins the weight-to-font-size input domain to `[min, max]`, so separate clouds can share one * scale instead of each deriving it from its own lightest/heaviest word. Reversed endpoints are * normalized; a degenerate or non-finite pair falls back to the data-derived range. Scaling * stays finite when opposite-sign finite endpoints would overflow on subtraction. */ domain?:[number,number];private _scale; /** `sqrt` compresses the weight->font-size mapping so one heavy word doesn't dwarf the rest. */ get scale():WordCloudScale;set scale(value:WordCloudScale); /** `mixed` lets some words render rotated 90° for denser packing; `none` keeps text horizontal. */ private _wordRotation;get wordRotation():WordCloudRotation;set wordRotation(value:WordCloudRotation); /** Custom CSS-color palette, cycled by word index (or by `group`, see `words`). Invalid entries * and `url()` paint servers are skipped; an all-invalid palette falls back to the * `--lr-word-cloud-color-*` tokens. Assignment freezes at most 64 colors; reassign to update. */ private _palette?;get palette():readonly string[]|undefined;set palette(value:readonly string[]|undefined); /** Named color overrides shown in the optional legend. When omitted, `show-legend` derives * entries from grouped words and explicitly colored words. This is useful when `words[].color` * or grouped colors carry semantic meaning that should not be discoverable only by visual * inspection. Assignment freezes at most 100 entries; reassign to update. */ private _legend;private legendDroppedCount;private legendTruncatedCount;private legendInputCount;get legend():readonly WordCloudLegendItem[];set legend(value:readonly WordCloudLegendItem[]); /** Renders the supplied or derived legend entries below the cloud. It is non-interactive and * does not alter word activation or palette selection. */ showLegend:boolean;private svgEl?;private cachedLayout; /** Roving-focus cursor -- an index into `navOrder()`, not into `cachedLayout.placed`. */ private focusedIndex; /** Text mirrored in `[part="live-region"]`. */ private liveText;private pressedOriginalIndex;private hoveredOriginalIndex;private announcementSink?;private readonly warnedSkipCounts;private typographyThemeSignature;private paletteThemeSignature;constructor();connectedCallback():void;disconnectedCallback():void;private releaseAnnouncementSink;private syncAnnouncementSink;private fontFamily; /** Reads the actual `--lr-font-weight-semibold` value the same way * `fontFamily()` reads `--lr-font` -- must match `[part='word']`'s * `font-weight` in word-cloud.styles.ts, so a theme/consumer override of * that token can't silently desync canvas text measurement (used for the * spiral layout's collision boxes) from the actually rendered glyph width. */ private fontWeight;private paletteColors; /** Stable keyboard tab order -- the order words were declared in `words`, * independent of the weight-sorted placement order. */ private navOrder;protected willUpdate(changed:PropertyValues):void;private relayout; /** Forces a relayout so the font-family theme token (`--lr-font`) is * re-read from computed style — mirrors `lr-chart`'s `refreshTheme()`. ThemeWatcher calls this * automatically only when the effective typography metrics changed; the public method remains * available for host theme systems that need an explicit synchronous refresh. */ refreshTheme():void;private captureThemeSignatures;private onThemeInvalidated;firstUpdated(changed:PropertyValues):void;private activate;private announce;private wordIndex; /** Resolve the nearest word from the single adequately sized SVG pointer surface. Individual * glyphs are not tiny independent hit targets. */ private nearestWord;private onSvgFocus;private onSvgPointerDown;private onSvgPointerMove;private clearPointerPress;private onSvgPointerLeave;private onSvgClick;private onWordClick;private onKeyDown;private collectionSummary;private renderLegend; /** Axis-aligned focus-ring rect for `w`, already accounting for its rotation. */ private focusRingRect;render():TemplateResult; /** `localize()` interpolates with a bare `String(value)`, so a number handed to it renders in * ASCII digits no matter the locale -- mixing two numbering systems inside one translated * sentence. Route every user-facing number through the effective locale instead. */ private formatCount;}declare global{interface HTMLElementTagNameMap{'lr-word-cloud':LyraWordCloud;}}