/
chart.d.ts
52 lines (52 loc) · 1.17 KB
/
chart.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
declare type LinkType = 'sourceBeam' | 'targetBeam' | 'normal'
interface FlowChartInitialOptions {
width?: number
height?: number
fontSize?: number
fontColor?: string
lineHeight?: number
edgeColor?: string
edgeWidth?: number
nodeBackgroundColor?: string
nodeBorderColor?: string
nodeMinWidth?: number
nodeMinHeight?: number
extendLength?: number
linkType?: LinkType
}
interface FlowChartNodeOptions {
padding?: [number, number]
fontSize?: number
fontColor?: string
borderColor?: string
backgroundColor?: string
minWidth?: number
minHeight?: number
extendLength?: number
borderRadius?: number
}
interface FlowChartEdgeOptions {
direction?: string
color?: string
width?: number
linkType?: LinkType
}
declare class FlowChart {
private _svg
private nodes
private links
linkType: LinkType
private options
constructor(selector: string, options?: FlowChartInitialOptions)
addNode(
name: string,
x: number,
y: number,
text: string | string[],
options?: FlowChartNodeOptions
): this
addEdge(source: string, target: string, options?: FlowChartEdgeOptions): this
render(): void
drag(): void
}
export default FlowChart