Skip to content

antv-darge布局内initOrder方法应该调用 g.dfs,而不是g.dfsTree深度遍历布局 #243

Description

@kekehaoz

Image

Image

v5版本的ant-darge布局效果和0.8.5版本不一致,因为v5版本初始化节点内顺序的initOrder调用g.dfsTree方法,dfsTree方法依赖g.treeIndices,dag布局下g.treeIndices是没有数据的,导致布局的深度优先遍历,变成了广度优先遍历。

const data = {
nodes: [
{ id: 'B' },
{ id: 'C' },
{ id: 'D' },
{ id: 'E' },
{ id: 'F' },
{ id: 'A' },
],
edges: [
{ source: 'A', target: 'B' },
{ source: 'A', target: 'C' },
{ source: 'A', target: 'F' },
{ source: 'B', target: 'C' },
{ source: 'B', target: 'D' },
{ source: 'B', target: 'F' },
{ source: 'C', target: 'E' },
{ source: 'D', target: 'F' },
],
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions