fix: update

This commit is contained in:
Fine 2023-10-23 10:29:07 +08:00
parent 66cfbd2700
commit 9cadd80b46

View File

@ -19,7 +19,8 @@ import type { Node, Call } from "@/types/topology";
export function layout(levels: Node[][], calls: Call[], radius: number) {
// precompute level depth
levels.forEach((l: Node[], i: number) => l.forEach((n: any) => (n.level = i)));
console.log(levels);
levels.forEach((l: Node[], i: number) => l.forEach((n: any) => n && (n.level = i)));
const nodes: Node[] = levels.reduce((a, x) => a.concat(x), []);
// layout