@thi.ng/viz
Version:
Declarative, functional & multi-format data visualization toolkit based around @thi.ng/hiccup
30 lines • 1.17 kB
TypeScript
import type { Fn, Fn2 } from "@thi.ng/api";
import type { PlotFn } from "../api.js";
export interface StackedIntervalOpts<T> {
/**
* Arbitrary attributes to assign to the root diagram group.
*/
attribs?: any;
/**
* Function which computes/extracts an item's domain interval [start,end]
*/
interval: Fn<T, number[]>;
/**
* Number of domain units added to the end of each item's interval when
* checking for overlaps with other items. If an overlap occurs one of the
* items is being pushed to a new lane/row.
*/
overlap: number;
/**
* Custom comparator to control order of item appearance in the diagram. By
* default sort order is based on the start value of an item's interval.
*/
sort?: Fn2<[number[], T], [number[], T], number>;
/**
* Shape function to represent an item in the diagram as thi.ng/hiccup
* compatible shape/element.
*/
shape: Fn2<[number[], number[], T, number], Fn<number[], number[]>, any>;
}
export declare const stackedIntervals: <T>(data: T[], opts: StackedIntervalOpts<T>) => PlotFn;
//# sourceMappingURL=stacked-intervals.d.ts.map