import { LitElement, PropertyValues } from "lit"; type ColourMode = `fixed` | `opacity` | `hue` | `saturation` | `lightness` | `scale`; type ColourMapConfig = { mode: ColourMode; /** Parsed colours for 'scale' mode. Must have ≥ 2 entries. */ palette: string[]; /** ixfx easing name — applied before the colour mode mapping. Takes precedence over valueMap. */ easingName: string; /** Custom value mapping fn (0..1 → 0..1). Used when easingName is empty. */ valueMap: ((v: number) => number) | null; }; type ColourResult = { fill: string; opacity: number; }; /** Read the resolved --plot-color CSS variable from an element. */ declare function readBaseColour(el: Element): string; /** Parse a comma-separated colour string attribute into an array. Falls back to default palette. */ declare function parseColourScaleAttr(attr: string): string[]; /** * Compute the fill colour and opacity for a single data point. * @param scaledValue Normalised value in 0..1 (data range for single-axis; age fraction for xy). * @param baseColour Resolved base colour string (from --plot-color). * @param config Colour map configuration. */ declare function computeColour(scaledValue: number, baseColour: string, config: ColourMapConfig): ColourResult; /** * Apply xy-axis age-style modification on top of a base ColourResult. * 'size' is not handled here — the caller adjusts the radius separately. */ declare function applyAgeModification(base: ColourResult, ageFraction: number, ageStyle: string): ColourResult; type PlotDataSeriesOptions = { /** * Limit of how many data points to store. * Default: 100 */ capacityLimit: number; /** * If _true_, it maintains the same scale over its lifetime. * If _false_, scale adjusts based on items in its cache. * * Default: true */ persistentScaling: boolean; fixedRange: { min: number; max: number; } | null; }; /** * A data series */ declare class PlotDataSeries { #private; values: number[]; /** * Constructor. * * Default options: * - `capacityLimit`: 100 * - `persistentScaling`: true * - `fixedRange`: null * @param options */ constructor(options?: Partial); /** * Sets a manual range, this disabled auto-scaling. * Use {@link unsetRange} to re-enable auto-scaling. * @param min * @param max */ setRange(min: number, max: number): void; /** * Disable the manual range */ unsetRange(): void; get isAutoRange(): boolean; /** * Adds a single value * @param valueOrValues Value to add */ add(valueOrValues: number | number[]): void; /** * Sets the entire data series at once, replacing any existing data. If the number of values exceeds the `capacityLimit`, only the most recent values up to the limit are kept. * @param values */ set(values: number[]): void; /** * Returns the manual range if this is in effect, or the automatic */ get range(): { min: number; max: number; }; /** * Clear all data and reset range. If `persistentScaling` is _false_, also resets scaling to initial state. * @returns _true_ if there was data to clear */ clear(): boolean; } type SingleAxisDrawStyle = `line-sharp` | `line-round` | `circles` | `squares` | `vbar` | `hbar` | `hist-bottom` | `hist-top` | `hist-middle`; type SingleAxisAgeStyle = `none` | `opacity` | `desaturation` | `size`; /** * PlotSingleAxis * * Adding data: * - add(value: number): adds a single value to the end of the data series. * - set(values: number[]): replaces the entire data series at once. */ declare class PlotSingleAxis extends LitElement { #private; drawStyle: SingleAxisDrawStyle; ageStyle: SingleAxisAgeStyle; title: string; precise: boolean; tooltips: boolean; capacity: number; rangeMin: number; rangeMax: number; persistentScale: boolean; paused: boolean; clickPauses: boolean; shaded: boolean; areaColor: string; colorMode: ColourMode; colorEasing: string; colorScale: string; /** Custom value-mapping function (0..1 → 0..1). Ignored when color-easing is set. */ colorValueMap: ((v: number) => number) | null; private _width; private _height; /** Override to customize tooltip label. */ valueFormat: (v: number | undefined) => string; /** * Adds a value to the data series. * * Pass `withholdRedraw = true` to prevent automatic redraw after adding the value. In this case, call `redraw()` manually after adding all values to update the plot. * * Use {@link set} to replace the entire data series at once. * @param valueOrValues Single value, or several values * @param withholdRedraw If _false_ (default) plot is automatically redrawn */ add(valueOrValues: number | number[], withholdRedraw?: boolean): void; /** * Redraws the plot. * Normally not needed, unless add() is called with withholdRedraw = true, or styleSeries() is used to update series styles. */ redraw(): void; /** * Sets the entire data for a series at once, replacing contents. * * Use add() to add values one by one. * * Pass `withholdRedraw = true` to prevent automatic redraw after setting the values. In this case, call `redraw()` manually after setting the values to update the plot. * @param values Values * @param withholdRedraw If _false_ (default) plot is automatically redrawn */ set(values: number[], withholdRedraw?: boolean): void; /** * Clears all data and redraws */ clear(): boolean; protected firstUpdated(_changed: PropertyValues): void; protected updated(changed: PropertyValues): void; get series(): PlotDataSeries; /** * Get all values in the data series as a readonly array. */ get values(): readonly number[]; /** * Get length of data series */ get dataLength(): number; /** * Get value at specific index of data series * @param index */ getValueAt(index: number): number | undefined; /** * Get value index based on client X position * @param clientX */ getIndexFromClientX(clientX: number): number; render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } type PlotSingleAxisPointerMoveDetail = { readonly clientX: number; readonly clientY: number; readonly index: number; }; type PlotSingleAxisPointerMoveEvent = CustomEvent; interface PlotSingleAxisElementEventMap { 'plot-pointer-move': PlotSingleAxisPointerMoveEvent; 'plot-pointer-leave': Event; } declare global { interface HTMLElementTagNameMap { 'ixfx-plot-single-axis': PlotSingleAxis; } } interface PlotSingleAxis { addEventListener: { (type: K, listener: (this: PlotSingleAxis, event: PlotSingleAxisElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; }; } type PlotMultiAxisLayout = `overlap` | `horizontal` | `vertical` | `grid`; type PlotMultiAxisDataPointClickDetail = { readonly value: number; readonly index: number; readonly series: string; }; type PlotMultiAxisDataPointClickEvent = CustomEvent; interface PlotMultiAxisElementEventMap { 'plot-datapoint-click': PlotMultiAxisDataPointClickEvent; } declare class PlotMultiAxis extends LitElement { #private; layout: PlotMultiAxisLayout; gridMinWidth: number; /** Override to customize tooltip value display. */ valueFormat: (v: number | undefined) => string; /** * Adds a single data point * @param name Series name * @param value Value * @param witholdRedraw If _false_ (default) plot is automatically redrawn */ addData(name: string, value: number, witholdRedraw?: boolean): PlotSingleAxis; setData(name: string, values: number[], witholdRedraw?: boolean): PlotSingleAxis; setObjects(data: Record, witholdRedraw?: boolean): void; /** * Calls redraw() on all subplots. */ redraw(): void; /** * Adds a record of data points to the plot. Each key in the record corresponds to a series name, and its value is added as a data point to that series. If a series does not exist for a given key, it will be created. * @param data Data to add * @param witholdRedraw If _false_ (default) plot is automatically redrawn after adding the data. If _true_, plot is not redrawn automatically, and you need to call `redraw()` manually to update the plot after adding the data. */ addObject(data: Record, witholdRedraw?: boolean): void; /** * Styles a series by setting CSS variables on the subplot. * @param name Name of series * @param styles Styles to apply */ styleSeries(name: string, styles: Record): void; /** * Clears data from all sub-plots * @returns _True_ if there was data to clear */ clear(): boolean; /** * Clears data from a given series * @param name Series name * @returns _True_ if series was found and had data */ clearSeries(name: string): boolean; /** * Returns a copy of the series names */ get series(): string[]; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } declare global { interface HTMLElementTagNameMap { 'ixfx-plot-multi-axis': PlotMultiAxis; } } interface PlotMultiAxis { addEventListener: { (type: K, listener: (this: PlotMultiAxis, event: PlotMultiAxisElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; }; } type PlotHistogramOrientation = `horizontal` | `vertical`; /** * - `hover`: floating `ixfx-tooltip` bubble, shown/hidden with a debounce delay. * - `inline`: the title overlay-text switches to the hovered bucket's value, instantly. * - `none`: no hover feedback. */ type PlotHistogramValueTooltips = `hover` | `inline` | `none`; type PlotHistogramInteractionMode = `inspect` | `select`; type PlotHistogramBucketClickDetail = { readonly bucketIndex: number; readonly valueMin: number; readonly valueMax: number; readonly relativeValue: number; }; type PlotHistogramBucketClickEvent = CustomEvent; /** * A bar-range selection. `null` on both fields means "no selection". * - `barIndices` — inclusive bucket indices (`start` ≤ `end`). * - `dataValues` — the value span those buckets cover (`min` is the low edge of * the first bucket, `max` the high edge of the last). */ type PlotHistogramSelectionRange = { readonly barIndices: { readonly start: number; readonly end: number; } | null; readonly dataValues: { readonly min: number; readonly max: number; } | null; }; type PlotHistogramSelectionChangeDetail = PlotHistogramSelectionRange & { /** * `false` while the pointer is still dragging out the range; `true` once the * drag is released, and for `setSelection()` / `clearSelection()`. */ readonly committed: boolean; }; type PlotHistogramSelectionChangeEvent = CustomEvent; interface PlotHistogramElementEventMap { 'plot-bucket-click': PlotHistogramBucketClickEvent; 'plot-selection-change': PlotHistogramSelectionChangeEvent; } declare class PlotHistogram extends LitElement { #private; orientation: PlotHistogramOrientation; resolution: number; min?: number; max?: number; capacity: number; /** * Fallback overlay-text, shown when nothing is hovered. * Not reflected to the native `title` attribute, so the browser's own hover tooltip doesn't show. */ title: string; paused: boolean; /** How hovering a bucket is communicated: a floating tooltip, the inline overlay-text, or nothing. */ valueTooltips: PlotHistogramValueTooltips; /** Delay (ms) before the `hover` tooltip appears/disappears. Switching directly between buckets is instant. */ tooltipDelay: number; /** Max rate (ms) at which an already-shown value display refreshes to match live-changing bucket data. */ valueUpdateInterval: number; /** Interaction mode: 'inspect' for hover tooltips, 'select' for click-drag selection. */ interactionMode: PlotHistogramInteractionMode; /** Override to customize the value/frequency label used by the tooltip and overlay text. */ valueFormat: (valueMin: number, valueMax: number, frequency: number) => string; private _width; private _height; private _hoveredIndex; private _inlineOverlayText; private _coloredRangeMin; private _coloredRangeMax; private _selectionStart; private _selectionEnd; private _isDragging; private _selectionOverlayText; add(v: number): void; set(values: number[]): void; clear(): void; setColoredRange(min: number, max: number): void; clearColoredRange(): void; setSelection(startBarIndex: number, endBarIndex: number): void; clearSelection(): void; getSelectedRange(): PlotHistogramSelectionRange; protected firstUpdated(_changed: PropertyValues): void; protected updated(changed: PropertyValues): void; disconnectedCallback(): void; render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } declare global { interface HTMLElementTagNameMap { 'ixfx-plot-histogram': PlotHistogram; } } interface PlotHistogram { addEventListener: ((type: K, listener: (this: PlotHistogram, event: PlotHistogramElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } type XyDrawStyle = `circles` | `squares`; type XyAgeStyle = `none` | `opacity` | `desaturation` | `size`; declare class PlotXyAxis extends LitElement { #private; drawStyle: XyDrawStyle; ageStyle: XyAgeStyle; title: string; precise: boolean; tooltips: boolean; capacity: number; persistentScale: boolean; paused: boolean; clickPauses: boolean; colorMode: ColourMode; colorEasing: string; colorScale: string; /** * Custom value-mapping fn (0..1 → 0..1). For xy-axis the input is the point's ageFraction * (0 = oldest, 1 = newest). Ignored when color-easing is set. */ colorValueMap: ((v: number) => number) | null; private _width; private _height; /** Override to customize tooltip label. */ valueFormat: (x: number, y: number) => string; add(x: number, y: number): void; setXY(xs: number[], ys: number[]): void; clear(): void; protected firstUpdated(_changed: PropertyValues): void; protected updated(changed: PropertyValues): void; render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } declare global { interface HTMLElementTagNameMap { 'ixfx-plot-xy-axis': PlotXyAxis; } } export { applyAgeModification as A, SingleAxisAgeStyle as C, ColourMapConfig as D, PlotDataSeriesOptions as E, parseColourScaleAttr as M, readBaseColour as N, ColourMode as O, PlotSingleAxisPointerMoveEvent as S, PlotDataSeries as T, PlotMultiAxisElementEventMap as _, PlotHistogramBucketClickDetail as a, PlotSingleAxisElementEventMap as b, PlotHistogramInteractionMode as c, PlotHistogramSelectionChangeEvent as d, PlotHistogramSelectionRange as f, PlotMultiAxisDataPointClickEvent as g, PlotMultiAxisDataPointClickDetail as h, PlotHistogram as i, computeColour as j, ColourResult as k, PlotHistogramOrientation as l, PlotMultiAxis as m, XyAgeStyle as n, PlotHistogramBucketClickEvent as o, PlotHistogramValueTooltips as p, XyDrawStyle as r, PlotHistogramElementEventMap as s, PlotXyAxis as t, PlotHistogramSelectionChangeDetail as u, PlotMultiAxisLayout as v, SingleAxisDrawStyle as w, PlotSingleAxisPointerMoveDetail as x, PlotSingleAxis as y };