-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathconfig.ts
65 lines (63 loc) · 1.24 KB
/
config.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
/**
* 组件各项配置
* @author gorgear<cctv1005s@gmail.com>
*/
import Edge from './canvas/edge';
// butterfly 默认配置
export const bfCfg = {
disLinkable: false,
linkable: true,
draggable: true,
zoomable: true,
moveable: true,
theme: {
edge: {
shapeType: 'AdvancedBezier',
arrow: true,
isExpandWidth: true,
arrowPosition: 1,
arrowOffset: 5,
Class: Edge
},
endpoint: {
expandArea: {
left: 0,
right: 0,
top: 0,
botton: 0
}
},
autoFixCanvas: {
enable: true,
autoMovePadding: [20, 20, 20, 20]
},
}
};
export const actions = [
{
key: 'zoom-in',
icon: 'table-build-icon table-build-icon-zoom-in',
title: '放大',
onClick: (canvas) => {
canvas.zoom(canvas._zoomData + 0.1);
}
},
{
key: 'zoom-out',
icon: 'table-build-icon table-build-icon-zoom-out',
title: '缩小',
onClick: (canvas) => {
canvas.zoom(canvas._zoomData - 0.1);
}
},
{
key: 'fit',
icon: 'table-build-icon table-build-icon-quanping2',
title: '居中',
onClick: (canvas) => {
canvas.focusCenterWithAnimate(undefined, () => {
console.log('complete!!!')
});
}
}
];