From d786901874f59d96c47e2a5dfe17b373eefd72e3 Mon Sep 17 00:00:00 2001 From: Yuxin <55794321+yvonneyx@users.noreply.github.com> Date: Fri, 20 Sep 2024 17:17:44 +0800 Subject: [PATCH] fix: fix issue with indent setting not working correctly in intended tree (#32) * fix: fix issue with indent setting not working correctly in intended tree * chore: update version --- package.json | 2 +- src/layout/indented.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 76097c7..8d013e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@antv/hierarchy", - "version": "0.6.13", + "version": "0.6.14", "description": "layout algorithms for visualizing hierarchical data", "main": "build/hierarchy.js", "browser": "build/hierarchy.js", diff --git a/src/layout/indented.js b/src/layout/indented.js index 9d56ca2..f5b2ef3 100644 --- a/src/layout/indented.js +++ b/src/layout/indented.js @@ -3,7 +3,7 @@ const util = require("../util"); function positionNode(node, previousNode, indent, dropCap, align) { // caculate the node's horizontal offset DX, dx's type might be number or function const displacementX = - typeof indent === "function" ? indent(node) : indent * node.depth; + (typeof indent === "function" ? indent(node) : indent) * node.depth; if (!dropCap) { try {