增量节点需要重新布局需要如何使用?
- Dominant language
- TypeScript
- Stars
- 276
- Forks
- 60
- PR merge metrics
- No merged PRs in 30d
Description
版本 `@antv/layout": "^0.3.24`
```
// 创建实例
const layout = new DagreLayout({
type: "dagre",
rankdir: "LR",
align: "UR",
nodesep: 40,
ranksep: 40,
});
// 增量添加节点
layout.updateCfg({
// keepNodeOrder: true,
// nodeOrder: preset.nodes.map((n) => n.id),
preset,
});
// 新老布局合并
preset = {
nodes: preset.nodes.concat(temp.nodes),
edges: preset.nodes.concat(temp.edges)
}
preset = layout.layout(temp)
```
最终的节点位置有问题
测试用例里注释了比较的代码,是因为有问题?


Contributor guide
Research direction
Start with the DagreLayout updateCfg and layout entry points, then reproduce the incremental-node example using the shown preset merge. Check the test case whose comparison code is commented out and determine whether the resulting positions match the expected incremental layout behavior. Done means the incremental usage is clarified and the relevant comparison test has a defined, passing expectation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100