import { ChartDataPoint } from '../types'; /** * Spatial indexing for efficient nearest neighbor searches * Uses a simple grid-based approach for O(1) average lookup */ export declare class SpatialIndex { /** Grid map storing points by grid cell */ private grid; /** Size of each grid cell */ private gridSize; /** Bounds of the data space */ private bounds; /** * Creates a new spatial index * @param data - Array of data points to index * @param gridSize - Size of grid cells. If omitted, automatically computed based on data distribution. */ constructor(data: ChartDataPoint[], gridSize?: number); private calculateBounds; private getGridKey; private buildIndex; /** * Find closest point within maxDistance * O(1) average case vs O(n) linear search */ findClosest(x: number, y: number, maxDistance?: number): { dataPoint: ChartDataPoint; distance: number; } | null; }