antvis/G6

indented,direction为H时,root节点的左右节点无法同时顶部对齐 #3265

liyuying12 posted onGitHub

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

缩进树,左右模式分布,root节点的左右节点无法同时顶部对齐 layout: { type: 'indented', direction: 'H', dropCap: false, indent: 200, getHeight: () => { return 60; }, }, https://g6.antv.vision/zh/examples/tree/indented#intendAlignTop

What does the proposed API look like?

function positionNode(node, previousNode, dx, dropCap) { if (!dropCap) { try { // TODO H布局 要区分左右的第一个 都这样处理 if (node.id === node.parent.children[0].id) { node.x = dx * node.depth; node.y = previousNode ? previousNode.y : 0; return; } } catch (e) { // skip to normal when a node has no parent } }

node.x = dx * node.depth; node.y = previousNode ? previousNode.y previousNode.height : 0; return; }

<!-- generated by antv-issue-helper. DO NOT REMOVE -->


This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help. 这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。

posted by github-actions[bot] over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests