2021-02-20 12:55:36 -05:00
|
|
|
export declare type Entry = {
|
|
|
|
timestamp: number;
|
|
|
|
upload?: number;
|
|
|
|
download?: number;
|
|
|
|
highlight?: boolean;
|
|
|
|
};
|
|
|
|
export declare type Style = {
|
2021-05-01 17:38:36 -04:00
|
|
|
backgroundColor: string;
|
|
|
|
separatorColor: string;
|
|
|
|
separatorCount: number;
|
|
|
|
separatorWidth: number;
|
2021-02-20 12:55:36 -05:00
|
|
|
upload: {
|
|
|
|
fill: string;
|
|
|
|
stroke: string;
|
2021-05-01 17:38:36 -04:00
|
|
|
strokeWidth: number;
|
2021-02-20 12:55:36 -05:00
|
|
|
};
|
|
|
|
download: {
|
|
|
|
fill: string;
|
|
|
|
stroke: string;
|
2021-05-01 17:38:36 -04:00
|
|
|
strokeWidth: number;
|
2021-02-20 12:55:36 -05:00
|
|
|
};
|
|
|
|
};
|
|
|
|
export declare type TimeSpan = {
|
|
|
|
origin: {
|
|
|
|
begin: number;
|
|
|
|
end: number;
|
|
|
|
time: number;
|
|
|
|
};
|
|
|
|
target: {
|
|
|
|
begin: number;
|
|
|
|
end: number;
|
|
|
|
time: number;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
export declare class Graph {
|
2021-05-01 17:38:36 -04:00
|
|
|
private static animateCallbacks;
|
|
|
|
private static registerAnimateCallback;
|
|
|
|
private static removerAnimateCallback;
|
2021-02-20 12:55:36 -05:00
|
|
|
style: Style;
|
2021-05-01 17:38:36 -04:00
|
|
|
private canvas;
|
|
|
|
private canvasContext;
|
|
|
|
private entries;
|
|
|
|
private entriesMax;
|
|
|
|
private maxSpace;
|
|
|
|
private maxGap;
|
|
|
|
private animateLoop;
|
|
|
|
timeSpan: TimeSpan;
|
|
|
|
private detailShown;
|
|
|
|
callbackDetailedInfo: (upload: number, download: number, timestamp: number, event: MouseEvent) => any;
|
|
|
|
callbackDetailedHide: () => any;
|
|
|
|
constructor();
|
2021-02-20 12:55:36 -05:00
|
|
|
initialize(): void;
|
2021-05-01 17:38:36 -04:00
|
|
|
finalize(): void;
|
|
|
|
initializeCanvas(canvas: HTMLCanvasElement | undefined): void;
|
|
|
|
maxGapSize(value?: number): number;
|
|
|
|
private recalculateCache;
|
|
|
|
entryCount(): number;
|
|
|
|
pushEntry(entry: Entry): void;
|
|
|
|
insertEntries(entries: Entry[]): void;
|
2021-02-20 12:55:36 -05:00
|
|
|
resize(): void;
|
|
|
|
cleanup(): void;
|
2021-05-01 17:38:36 -04:00
|
|
|
calculateTimespan(): {
|
2021-02-20 12:55:36 -05:00
|
|
|
begin: number;
|
|
|
|
end: number;
|
|
|
|
};
|
2021-05-01 17:38:36 -04:00
|
|
|
private draw;
|
|
|
|
private onMouseMove;
|
|
|
|
private onMouseLeave;
|
2021-02-20 12:55:36 -05:00
|
|
|
}
|