export interface Group { group: string; data: Line[]; } export interface Line { label: string; data: Segment[]; } export interface Segment { timeRange: [TS, TS]; val: Val; } export type TS = Date | number; export type Val = number | string; // qualitative vs quantitative type GroupLabel = { group: string; label:string; } type Range = [DomainType, DomainType]; type Formatter = (item: ItemType) => string; type CompareFn = (a: ItemType, b: ItemType) => number; type Scale = (input: DomainType) => RangeType; export interface TimelinesChartGenericInstance { (element: HTMLElement): ChainableInstance; width(): number; width(width: number): ChainableInstance; maxHeight(): number; maxHeight(height: number): ChainableInstance; maxLineHeight(): number; maxLineHeight(height: number): ChainableInstance; leftMargin(): number; leftMargin(margin: number): ChainableInstance; rightMargin(): number; rightMargin(margin: number): ChainableInstance; topMargin(): number; topMargin(margin: number): ChainableInstance; bottomMargin(): number; bottomMargin(margin: number): ChainableInstance; data(): Group[]; data(data: Group[]): ChainableInstance; useUtc(): boolean; useUtc(utc: boolean): ChainableInstance; timeFormat(): string; timeFormat(format: string): ChainableInstance; xTickFormat(): Formatter | null; xTickFormat(formatter: Formatter | null): ChainableInstance; dateMarker(): TS | null | boolean; dateMarker(date: TS | null | boolean): ChainableInstance; minSegmentDuration(): number; minSegmentDuration(duration: number): ChainableInstance; getNLines(): number; getTotalNLines(): number; zQualitative(): boolean; zQualitative(isQualitative: boolean): ChainableInstance; zColorScale(): Scale; zColorScale(scale: Scale): ChainableInstance; zDataLabel(): string; zDataLabel(text: string): ChainableInstance; zScaleLabel(): string; zScaleLabel(text: string): ChainableInstance; sort(labelcmpFn: CompareFn, grpcmpFn: CompareFn): ChainableInstance; sortAlpha(ascending: boolean): ChainableInstance; sortChrono(ascending: boolean): ChainableInstance; zoomX(): Range | null; zoomX(xRange: Range | null): ChainableInstance; zoomY(): Range | null; zoomY(yRange: Range | null): ChainableInstance; zoomYLabels(): Range | null; zoomYLabels(yLabelRange: Range | null): ChainableInstance; onZoom(cb: (zoomX: Range | null, zoomY: Range | null) => void): ChainableInstance; enableOverview(): boolean; enableOverview(enable: boolean): ChainableInstance; overviewDomain(): Range; overviewDomain(xRange: Range): ChainableInstance; getVisibleStructure(): Group[]; getSvg(): string; enableAnimations(): boolean; enableAnimations(animations: boolean): ChainableInstance; onLabelClick(cb: (label: string, group: string) => void): ChainableInstance; onSegmentClick(cb: (segment: { group: string, label: string, val: Val, timeRange: Range }) => void): ChainableInstance; segmentTooltipContent(cb: (segment: { group: string, label: string, val: Val, timeRange: Range }) => string): ChainableInstance; refresh(): ChainableInstance; } export type TimelinesChartInstance = TimelinesChartGenericInstance; declare function TimelinesChart(): TimelinesChartInstance; export default TimelinesChart;