From af6bf174cac67b99826a5a9f5ff438a73d0e9953 Mon Sep 17 00:00:00 2001 From: Satche Date: Mon, 13 Jun 2022 13:03:59 +0200 Subject: [PATCH] fix(hierarchy tree): disable top node interactions --- modules/dynamic/hierarchy-tree.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/dynamic/hierarchy-tree.js b/modules/dynamic/hierarchy-tree.js index 0b79707b..5380dd6c 100644 --- a/modules/dynamic/hierarchy-tree.js +++ b/modules/dynamic/hierarchy-tree.js @@ -343,6 +343,7 @@ function updateTree() { function selectElement(d) { const dataElement = d.data; + if (d.id == 0) return; const node = nodes.select(`g[data-id="${d.id}"]`); nodes.selectAll("g").style("outline", "none"); @@ -476,6 +477,8 @@ function handleNodeExit(d) { } function dragToReorigin(from) { + if (from.id == 0) return; + dragLine.attr("d", `M${from.x},${from.y}L${from.x},${from.y}`); d3.event.on("drag", () => {