MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / getNodeSpacing

Function getNodeSpacing

frontend/packages/common/src/utils/systemRunning.ts:128–145  ·  view source on GitHub ↗
(num: number, nodes?: unknown)

Source from the content-addressed store, hash-verified

126 * 动态获取节点距离
127 */
128export 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
147export class UnionFind {
148 private parent: Record<string, string>

Callers 2

SystemRunningFunction · 0.90
SystemTopologyFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected