From 5594e173271ea0f08cc4841ea1b27a96ba210d55 Mon Sep 17 00:00:00 2001 From: Yanyan-Wang Date: Mon, 24 Aug 2020 15:49:09 +0800 Subject: [PATCH 1/2] fix: indented tree with false dropCap problem. --- src/layout/hierarchy.js | 2 +- src/layout/indented.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layout/hierarchy.js b/src/layout/hierarchy.js index 4507c78..0a2536d 100644 --- a/src/layout/hierarchy.js +++ b/src/layout/hierarchy.js @@ -82,7 +82,7 @@ util.assign(Node.prototype, { let current; while (current = nodes.shift()) { callback(current); - nodes = nodes.concat(current.children); + nodes = current.children.concat(nodes); } }, diff --git a/src/layout/indented.js b/src/layout/indented.js index 4bf7ee6..71b7486 100644 --- a/src/layout/indented.js +++ b/src/layout/indented.js @@ -1,7 +1,7 @@ function positionNode(node, previousNode, dx, dropCap) { if (!dropCap) { try { - if (node.id === node.parent.children[node.parent.children.length - 1].id) { + if (node.id === node.parent.children[0].id) { node.x += dx * node.depth; node.y = previousNode ? previousNode.y : 0; return; From 688dd8a7a7ce95803154874644f27099a725a982 Mon Sep 17 00:00:00 2001 From: Yanyan-Wang Date: Mon, 24 Aug 2020 15:49:36 +0800 Subject: [PATCH 2/2] chore: update version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c5464e0..e83a1f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@antv/hierarchy", - "version": "0.6.5", + "version": "0.6.6", "description": "layout algorithms for visualizing hierarchical data", "main": "build/hierarchy.js", "browser": "build/hierarchy.js",