-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathplotjs.d.ts
100 lines (100 loc) · 2.72 KB
/
plotjs.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
declare namespace Plot {
class BasePlot {
canvas: HTMLCanvasElement;
context: CanvasRenderingContext2D;
draw: () => void;
baseDraw: () => void;
hover: (e) => void;
baseHover: () => void;
options: any;
animateNum: number;
constructor(id: string, options: Object, specificDefaults: any);
animate(): void;
}
}
declare namespace Plot {
class Bar extends BasePlot implements Ianimateable {
data: KVCDatum[];
constructor(id: string, data: any, options: any);
}
}
declare namespace Plot {
class BoxAndWhisker extends BasePlot implements Ianimateable {
data: xData[];
constructor(id: string, data: any, options?: any);
}
}
declare namespace Plot {
class Curve {
formula: (x) => number;
colour: string;
constructor(formula: (x) => number, colour?: string);
}
}
declare namespace Plot {
class KVCDatum {
key: string;
value: number;
colour: string;
constructor(key: string, value: number, colour?: string);
}
}
declare namespace Plot {
interface xDatum {
x: number;
}
class xData {
data: xDatum[];
colour: string;
constructor(values: xDatum[], colour: string);
}
function toXData(items: any): xData[];
}
declare namespace Plot {
interface xyDatum {
x: number;
y: number;
}
class xyData {
data: xyDatum[];
colour: string;
constructor(values: xyDatum[], colour: string);
}
function toXYData(items: any): xyData[];
}
declare module Plot {
interface Ianimateable {
animate: () => void;
}
}
declare namespace Plot.Maths {
function max(items: any[], value: (item: any) => number): number;
function min(items: any[], value: (item: any) => number): number;
function median(items: xDatum[]): number;
function lowerQuartile(items: xDatum[]): number;
function upperQuartile(items: xDatum[]): number;
function getSplits(minNum: any, maxNum: any, splits: any): number[];
function isEqualToAccurate(num1: number, num2: number): Boolean;
}
declare namespace Plot {
class Pie extends BasePlot implements Ianimateable {
data: KVCDatum[];
constructor(id: string, data: any, options?: any);
}
}
declare namespace Plot {
class PlotManager {
plots: BasePlot[];
addPlot: (item: BasePlot) => void;
constructor();
}
var plotManager: PlotManager;
}
declare namespace Plot {
class Scatter extends BasePlot implements Ianimateable {
data: xyData[];
curves: Curve[];
addCurve: (x: any, colour: string) => void;
constructor(id: string, data: any, options: any);
}
}