fix: avoid querying data with empty parameters (#331)

* fix: Avoid querying data with empty parameters
This commit is contained in:
Fine0830
2023-10-23 10:37:43 +08:00
committed by GitHub
parent 6fb4f074c1
commit d9064e8b45
2 changed files with 12 additions and 2 deletions

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