react-plot
Version:
Library of React components to render SVG 2D plots.
28 lines • 1.34 kB
TypeScript
import type { PlotAxisContext, PlotSeriesState } from '../contexts/plotContext.js';
import type { PlotEventsPlotActions } from '../contexts/plotController/usePlotEvents.js';
import type { SeriesPoint } from '../types.js';
export interface ClosestInfo<MethodName extends ClosestMethods> {
point: SeriesPoint;
label?: string;
axis: MethodName extends 'euclidean' ? Record<'x' | 'y', PlotAxisContext> : PlotAxisContext;
}
export type ClosestMethods = 'x' | 'y' | 'euclidean';
export type ClosestInfoResult = Record<string, ClosestInfo<ClosestMethods>>;
export interface TrackingResult<NativeEventType extends MouseEvent> {
event: NativeEventType;
coordinates: Record<string, number>;
clampedCoordinates: Record<string, number>;
movement: Record<string, number>;
domains: Record<string, readonly [number, number]>;
getClosest: (method: ClosestMethods) => ClosestInfoResult;
}
export interface TrackingProps {
plotId: string;
plotEvents: PlotEventsPlotActions;
stateSeries: PlotSeriesState[];
axisContext: Record<string, PlotAxisContext>;
plotWidth: number;
plotHeight: number;
}
export default function Tracking({ plotId, plotEvents, stateSeries, axisContext, plotHeight, plotWidth, }: TrackingProps): import("react/jsx-runtime").JSX.Element;
//# sourceMappingURL=Tracking.d.ts.map