import { HistogramParams } from '../../histograms/HistogramParams.js'; import { ChartAxes, ChartDimensions, HistogramData, HistogramSVGG, SwimlaneAxes } from '../utils/HistogramUtils.js'; export interface XBucket { start: number; end: number; } /** * A bucket that represents one data entry in the histogram. * This bucket is not shown graphically but will be appended to a virtual context * in order to listen to mouse events. */ export declare class Bucket { /** Inputs. */ private data; private histogramParams; private rootContext; private dimensions; private axes; /** Calculated state. */ private hovered; private context; /** This context is virtual. Buckets are not plotted on the histogram. */ private virtual; constructor(data: HistogramData, histogramParams: HistogramParams, rootContext: HistogramSVGG, dimensions: ChartDimensions, axes: ChartAxes | SwimlaneAxes); /** * Transforms the x value to number and returns it. * @returns the bucket's x value as number */ getBucktXValue(): number; /** * Plot the buckets on the histogram root context. * USE FOR DEBUG PURPOSES ONLY. */ plot(): void; /** Hovers the bucket and notifies the hoveredBucket event that the bucket has been hovered. * However, this notification is sent once. If the bucket remains hovered, no more notifications are sent. */ hover(): void; /** * Leaves the bucket and notifies the hoveredBucket event that the bucket has been left :'(. * However, this notification is sent once. If the bucket has been already left, no more notifications are sent. */ leave(): void; /** * Notifies that the bucket has been hovered. */ notifyHover(): void; /** * Notifies that the bucket has been left. */ notifyLeave(): void; } /** * A Virtual context (in D3 lingo), where no svg elements are drawn. It is used to declare all the buckets that compose * the histogram. * The main objective of this context is to detect which bucket is hovered and to notify the histogram. */ export declare class BucketsVirtualContext { private buckets; private bucketsMap; /** * Add the bucket to the context. * @param b A bucket that represents one data entry. */ append(b: Bucket): void; /** * - Notifies the histogram when hovering a bucket that was not hovered before. * - Notifies the histogram when leaving a bucket that is not hovered anymore. * @param hoveredKey List of current hovered bucket's keys. */ interact(hoveredKey: (string | number)[]): void; /** * Leaves all the given keys */ leaveAll(leftKeys: (string | number)[]): void; }