(num: number, nodes?: unknown)
| 126 | * 动态获取节点距离 |
| 127 | */ |
| 128 | export const getNodeSpacing = (num: number, nodes?: unknown) => { |
| 129 | if (nodes) { |
| 130 | const base: number = getNodeSpacing(num) as number |
| 131 | return (d: { comboId: string }) => { |
| 132 | return d.comboId === 'none-combo' ? base / 2 : base |
| 133 | } |
| 134 | } |
| 135 | if (num <= 15) { |
| 136 | return 100 |
| 137 | } |
| 138 | let result = 100 |
| 139 | let base = 15 |
| 140 | while (num > base) { |
| 141 | result = Math.ceil(result / 2) |
| 142 | base *= 15 |
| 143 | } |
| 144 | return result |
| 145 | } |
| 146 | |
| 147 | export class UnionFind { |
| 148 | private parent: Record<string, string> |
no outgoing calls
no test coverage detected