@deltares/fews-web-oc-charts
Version:
FEWS Chart Library
56 lines (55 loc) • 1.84 kB
TypeScript
import { Axes } from '../Axes/axes.js';
import { CartesianAxes, Chart } from '../index.js';
import { Visitor } from './visitor.js';
import { type CrossSectionPoint, type CrossSectionPointStyles } from './crossSectionSelectRenderer.js';
type CrossSectionSelectOptions = {
x?: {
axisIndex: number;
};
draggable?: boolean;
};
export type TraceFilter = 'all' | 'none' | string[];
export declare class CrossSectionSelect<V extends number | Date> implements Visitor {
private trace;
private group;
private backGroup;
private frontGroup;
private readonly pointRadius;
private axis?;
private readonly renderer;
value: V;
currentData: any;
callback: (value: V) => void;
format: (n: number | {
valueOf(): number;
} | Date) => string;
private readonly options;
private visible;
private readonly touchHitboxSize;
constructor(value: V, callback: (value: V) => void, options: CrossSectionSelectOptions, trace?: TraceFilter);
setTrace(trace?: TraceFilter): void;
visit(axis: Axes): void;
private getAxisIndex;
create(axis: CartesianAxes): void;
redraw(): void;
private getTraces;
private collectPoints;
private toCurrentData;
start(event: any): void;
drag(event: any): void;
end(): void;
styleForChart(id: string): CSSStyleDeclaration | undefined;
updateLine(xPos: number): void;
updateDataPoints(points: any[], styles: Record<string, CSSStyleDeclaration>): void;
updateLabels(points: CrossSectionPoint[], styles: CrossSectionPointStyles): void;
limitValue(): boolean;
findNearestPoint(chart: Chart, xPos: number): {
id: string;
x?: number;
y?: number;
value?: string;
d: any;
};
determineLabel(yExtent: any[], yValue: any): string;
}
export {};