ag-charts-enterprise
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
25 lines (24 loc) • 826 B
TypeScript
type Interval = {
start: number;
end: number;
};
/**
* Simple interval set data structure.
*
* This class has a preference for append ranges at the end. This is because when `dataSelection.ts` loops through
* hit-tested nodes, it typically loops in a way that keeps the datum-indices ordered from smallest to largest (although
* this is not actually guaranteed).
*
* There's no guarantee that none of the generated `values()` intervals overlap; This is intentional to avoid some
* potentionally unnecessary mutations to the internal interval-set array.
*
* `start` and `end` are both inclusive.
*/
export declare class IntervalSet {
private readonly intervals;
add(start: number, end: number): void;
has(index: number): boolean;
values(): Iterable<Interval>;
clear(): void;
}
export {};