66 lines
1.6 KiB
TypeScript
66 lines
1.6 KiB
TypeScript
|
export declare type Entry = {
|
||
|
timestamp: number;
|
||
|
upload?: number;
|
||
|
download?: number;
|
||
|
highlight?: boolean;
|
||
|
};
|
||
|
export declare type Style = {
|
||
|
background_color: string;
|
||
|
separator_color: string;
|
||
|
separator_count: number;
|
||
|
separator_width: number;
|
||
|
upload: {
|
||
|
fill: string;
|
||
|
stroke: string;
|
||
|
strike_width: number;
|
||
|
};
|
||
|
download: {
|
||
|
fill: string;
|
||
|
stroke: string;
|
||
|
strike_width: number;
|
||
|
};
|
||
|
};
|
||
|
export declare type TimeSpan = {
|
||
|
origin: {
|
||
|
begin: number;
|
||
|
end: number;
|
||
|
time: number;
|
||
|
};
|
||
|
target: {
|
||
|
begin: number;
|
||
|
end: number;
|
||
|
time: number;
|
||
|
};
|
||
|
};
|
||
|
export declare class Graph {
|
||
|
private static _loops;
|
||
|
readonly canvas: HTMLCanvasElement;
|
||
|
style: Style;
|
||
|
private _canvas_context;
|
||
|
private _entries;
|
||
|
private _entry_max;
|
||
|
private _max_space;
|
||
|
private _max_gap;
|
||
|
private _animate_loop;
|
||
|
_time_span: TimeSpan;
|
||
|
private _detailed_shown;
|
||
|
callback_detailed_info: (upload: number, download: number, timestamp: number, event: MouseEvent) => any;
|
||
|
callback_detailed_hide: () => any;
|
||
|
constructor(canvas: HTMLCanvasElement);
|
||
|
initialize(): void;
|
||
|
terminate(): void;
|
||
|
max_gap_size(value?: number): number;
|
||
|
private recalculate_cache;
|
||
|
insert_entry(entry: Entry): void;
|
||
|
insert_entries(entries: Entry[]): void;
|
||
|
resize(): void;
|
||
|
cleanup(): void;
|
||
|
calculate_time_span(): {
|
||
|
begin: number;
|
||
|
end: number;
|
||
|
};
|
||
|
draw(): void;
|
||
|
private on_mouse_move;
|
||
|
private on_mouse_leave;
|
||
|
}
|