wujingjing
2024-12-13 667c08a39b523e7afdf00a6af17ac2d4274b659a
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
 
export const enum CustomLayout {
    /** @description 紧凑树布局 n <= 30*/
    NormalTree,
    /** @description 垂直紧凑树,根节点在中间 30 < n <= 50*/
    Vertical,
    /** @description 辐射紧凑树,> 50 */
    Radial,
}
 
export const customLayoutMap ={
    [CustomLayout.NormalTree]:'紧凑树布局',
    [CustomLayout.Vertical]:'垂直对称布局',
    [CustomLayout.Radial]:'辐射状布局'
}
 
 
 
export const getLayoutType = (maxLeafLen: number) => {
    if (maxLeafLen > 50) {
        return CustomLayout.Radial;
    } else if (30 < maxLeafLen) {
        return CustomLayout.Vertical;
    } else {
        return CustomLayout.NormalTree;
    }
};