|
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;
|
}
|
};
|