Skip to content
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

使用DagreLayout布局时,ranker参数无效,无论设置成什么,布局样式还是不变。 #234

Open
tuyamanke opened this issue Sep 26, 2024 · 0 comments

Comments

@tuyamanke
Copy link

tuyamanke commented Sep 26, 2024

我看这个 issue #206 中也提到了这个问题,当节点最终有汇合的时候 ranker 参数就不能正常工作。image
使用DagreLayout布局时,ranker参数无效,无论设置成什么,布局样式还是不变。
我用的npm依赖:

  • "@antv/graphlib": "^2.0.3",
  • "@antv/layout": "1.2.14-beta.8",
  • "@antv/x6": "^2.18.1",
import { Graph as GraphLibGraph } from '@antv/graphlib';
import { DagreLayout, EdgeData, NodeData } from '@antv/layout'
const dagre = new DagreLayout({
      rankdir: 'TB',
      ranksep: 80,
      ranker: 'network-simplex',
      nodeSize: nodeData => {
          return [nodeData.data.width, nodeData.data.height]
      }
  });
  const layoutPosition = await dagre.execute(graphLibGraph)

也尝试了下面这种使用方法,也不行。辛苦大佬帮忙看一下具体是什么原因呢?

const option: DagreLayoutOptions = {
    rankdir: 'TB',
    ranksep: 80,
    ranker: 'network-simplex',
    nodeSize: nodeData => {
        return [nodeData.data.width, nodeData.data.height]
    }
}
const dagre = new DagreLayout(option);
const layoutPosition = await dagre.execute(graphLibGraph, option)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant