-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
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
layout is not a function #4441
Comments
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. |
我也碰到和楼主一样的问题了,官方文档是过时了吗? |
应该是文档没及时更新吧,有些 api 还停留在 v1 |
直接看源码的demo |
即使用execute,仍然报错: |
https://github.com/antvis/X6/blob/master/sites/x6-sites/package.json @resetsix 看官方示例代码,需要 安装 这几个 版本 才可以运行 亲测可行 |
最新版本的的布局库和x6库,报楼主相同问题,看了源码需要使用 execute方法,使用后又报 graph.getAllNodes is not a function,原因是 execute传入的不能是x6导出的new Graph实例对象,需要传入这个库导出的Graph实例对象 import { Graph as GraphLib } from "@antv/graphlib" 版本: |
查看源码,每个layout的版本里的api都不一样,初始化主要在init,layout,excute这三个;对于不同的布局;返回的结果也不一定相同 |
请教一下,如过已经用了 import { Graph } from '@antv/x6' |
me too |
我也遇到了,还没官方解决吗o(╥﹏╥)o |
Describe the bug
antv/x6是基于 antv/layout 包实现的布局算法,我按照官网教程尝试使用antv/layout包中的
dagre
布局,但是在实例化布局的时候遇到两个问题。1、提示
type
等参数不在DagreLayout配置中,我跳转到 ts 源码类型提示发现确实没有 type 相关的类型只有图二中nodeSize
和GraphLabel, NodeConfig, EdgeConfig父类型,可是无法跳转了。不知道官网文档示例是否已过时。2、new XXXLayout()实例化对象已经没有
layout
方法了,不知道官网文档示例是否已过时。只有如下类型提示即使我使用
execute
和assign
方法替代layout
,但是传递的data数据提示execute
和assign
的类型传不符。data 数据
我不知道该如何在 antv/x6 中使用
drage
布局算法。Your Example Website or App
https://codesandbox.io/p/sandbox/2xxwj5?file=%2Fsrc%2FApp.tsx
Steps to Reproduce the Bug or Issue
Expected behavior
antv/x6正常使用
dagre
布局Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: