We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用g6时遇到了一个问题,如下demo
demo
demo中是2000条首尾相连的数据,布局模式使用Dagre
定位到 https://github.com/antvis/layout/blob/master/src/layout/dagre/src/order/init-order.ts 里面的方法dfs
const dfs = (v: string) => { if (visited.hasOwnProperty(v)) return; visited[v] = true; const node = g.node(v); if (!isNaN(node.rank as number)) { layers[node.rank as number].push(v); } g.successors(v)?.forEach((child) => dfs(child as any)); };
此demo中图的深度较大,猜测是递归pending的dfs函数过多导致内存溢出。本地调试改为bfs后不再报错(但导致了初始化时图不居中)
const dfs = (v: string) => { let cur = [v]; while(cur.length) { let temp: any[] = []; cur.forEach((item: any) => { if (visited.hasOwnProperty(item)) return; visited[item] = true; const node = g.node(item); if (!isNaN(node.rank as number)) { layers[node.rank as number].push(item); } temp = [...temp, ...(g.successors(v) || [])]; }); cur = temp; } };
不知是否有相关的配置可以解决这个问题,或者说一个不成熟的建议是提供给用户可选dfs或者bfs进行初始布局?
The text was updated successfully, but these errors were encountered:
有大佬能帮忙解答一下吗,对应的代码,相关的demo都齐全,我这边因为对整体工程还不太了解,不敢贸然提pr。感谢
Sorry, something went wrong.
No branches or pull requests
使用g6时遇到了一个问题,如下demo
demo
demo中是2000条首尾相连的数据,布局模式使用Dagre
定位到 https://github.com/antvis/layout/blob/master/src/layout/dagre/src/order/init-order.ts 里面的方法dfs
此demo中图的深度较大,猜测是递归pending的dfs函数过多导致内存溢出。本地调试改为bfs后不再报错(但导致了初始化时图不居中)
不知是否有相关的配置可以解决这个问题,或者说一个不成熟的建议是提供给用户可选dfs或者bfs进行初始布局?
The text was updated successfully, but these errors were encountered: