layout
layout copied to clipboard
Layout algorithms for graphs.
报错信息:  示例:https://x6.antv.vision/zh/examples/showcase/practices#tree 使用该数据可以重现
求一份X6使用ERLayout布局的文档!
现在引力系数是由画布面积和点数量决定的,而且和斥力系数公用一个。。。导致没法分开调节 https://github.com/antvis/layout/blob/master/src/layout/fruchterman.ts#L195 建议 加一个引力系数 attractive 在这里*common https://github.com/antvis/layout/blob/master/src/layout/fruchterman.ts#L195 或者在 https://github.com/antvis/layout/blob/master/src/layout/fruchterman.ts#L267 这里加个 node.x *= scaleKey,整体缩放,让画布里的点尺寸可以适应 (gpu的也希望同步加些调节参数)
现在的使用方法好像不太对吧,为什么我看到的是要实现 onLayoutEnd 回调函数? 比如gForce 布局,是用的 onLayoutEnd 回调函数? 在源码src/layout/gForce.ts 中,run 方法。
目前最新layout中export的layouts是固定枚举的,导致在用registerLayout自定义布局后,无法创建自定义布局实例,提示`"The layout method: '" + layoutType + "' does not exist! Please specify it first."`   之前版本中代码如下所示,可以成功创建自定义布局  这里是否能修改为原来的样子,或者自定义布局的使用方式是否变了, 应该怎么使用
使用g6时遇到了一个问题,如下demo [demo](https://codesandbox.io/s/blazing-paper-j0dwu6?file=/src/App.vue)  demo中是2000条首尾相连的数据,布局模式使用Dagre 定位到 https://github.com/antvis/layout/blob/master/src/layout/dagre/src/order/init-order.ts 里面的方法dfs ```typescript const dfs = (v: string) => { if (visited.hasOwnProperty(v)) return; visited[v] = true; const node = g.node(v); if (!isNaN(node.rank as number)) {...
 const options:ForceAtlas2LayoutOptions = { center: [600, 400], kr: 10, kg: 1, preventOverlap: true, type:'forceAtlas2' } const layout= new ForceAtlas2Layout(options) layout.init({ nodes: data.nodes, edges: data.edges, }) layout.execute() graph.data(data) graph.render()
工程改进建议
可以直接基于这个模板:https://github.com/antvis/template - [ ] npm 包含上 src https://github.com/ant-design/ant-design-charts/issues/786 - [ ] 去除 tslint,已经不维护了,改成 eslint,参考模板 - [ ] 一些依赖好像并没有直接使用,比如 g-webgpu ,是否去除 https://github.com/antvis/layout/issues/43 - [ ] 如果定位是和 scale 一样,底层依赖,且可以社区使用,建议 readme 和文档参考 [scale](https://github.com/antvis/scale)...
## 问题描述 在使用 ANTV X6 集成 Layout ,使用 GridLayout 初始化模型数据时会出现异常:`nodeSize is not a function or its return value is not iterable`,尝试 Copy 官方源码实验也会出现同样的异常。 尝试使用 Dagre、Circle 的布局模式没有出现异常 ## 版本依赖 - @antv/[email protected]...
服务端用 vite 打包后包含了 dist 目录下的内容,开发环境没问题  排查发现非 commonjs 打包直接用了 window._ 来获取 lodash,求兼容~  所用版本:v0.1.22,文件目录:`node_modules/@antv/layout/dist/layout.min.js`