import { Ratio } from "../../constants" import { OrderedTimeline } from "../../utils/events.worker" import { RawEv3nt, Ev3nt } from "../event" import MinimapBand from "../band/minimap" import EventsBand from "../band/events" export abstract class DomainConfig { } export class BandConfig { // Part of the horizontal space available to this domain. // If the ratio is .1 only 10% of the heigth is used for this domain. heightRatio?: Ratio = 1 // Show rulers? rulers?: boolean = true // Show the labels of the rulers (the corresponding dates) rulerLabels?: boolean = true // Number between 0 and 1 representing the offset from the top // at which the domain should start. A ratio of .3 would make the // domain start at 30% from the top. topOffsetRatio?: Ratio = 0 // domains?: T[] = [] // Number between 0 and 1 representing the visible ratio of the domain // in relation to the total. If the total is 8 months, a ratio of .75 // would show 6 months and hide 2 months. Ie (with center at .5): -[------]- zoomLevel?: number = 0 } export class MinimapBandConfig extends BandConfig { indicatorFor?: number = 0 // The indices of the events domains which are visualized by the minimap targets?: number[] = [] } export class EventsBandConfig extends BandConfig { events?: RawEv3nt[] label?: string orderedEvents?: OrderedTimeline } export default class Config { bands: (EventsBand | MinimapBand)[] center?: number controlBand?: EventsBand imagePath?: string parent?: Ev3nt // The HTML element where the Timeline will be attached to. The element should be a // block element with a width and height. rootElement: HTMLElement }