antvis / G6

♾ A Graph Visualization Framework in JavaScript.
https://g6.antv.antgroup.com/
MIT License
11.03k stars 1.31k forks source link

[v5] layout 方法报不存在 #5945

Closed liseri closed 2 months ago

liseri commented 2 months ago

Describe the bug / 问题描述

  1. 需求或目的:想不渲染只执行布局,从而通过getData()方法获取布局后的x,y坐标
  2. 述求:实现只布局不渲染,通过getData()方法获取布局后的x,y坐标
  3. 图表例子链接: https://g6-next.antv.antgroup.com/zh/examples/layout/dagre/#antv-dagre-combo
  4. 文档链接: https://g6-next.antv.antgroup.com/api/graph/method#graphlayout
  5. 版本:v5.0
  6. 问题描述:graph.layout()方法报方法找不到
  7. 问题截图: image

Reproduction link / 重现链接

https://g6-next.antv.antgroup.com/zh/examples/layout/dagre/#antv-dagre-combo

Steps to Reproduce the Bug or Issue / 重现步骤

G6 Version / G6 版本

🆕 5.x

Operating System / 操作系统

Windows

Browser / 浏览器

Chrome

Additional context / 补充说明

No response

Aarebecca commented 2 months ago

如果你只想获取布局结果,建议直接使用 @antv/layout

hsingh-ds commented 2 months ago

@liseri try to call layout inside a timeout function with 100ms delay.