From c0cb9cb5565f735a98adc99ae2174becea6f57af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 4 Jan 2021 10:39:13 +0100 Subject: [PATCH] fix: Node width in firefox. --- website/web/static/tree.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/web/static/tree.js b/website/web/static/tree.js index eae11e4b..52cb7fe6 100644 --- a/website/web/static/tree.js +++ b/website/web/static/tree.js @@ -427,7 +427,9 @@ function update(root, computed_node_width=0) { .attr('width', d3.select(this).node().getBBox().width + 60); // Set the width for all the nodes - let selected_node_bbox = d3.select(this).node().getBBox(); // Required, as the node width need to include the rectangle + // Required, as the node width need to include the rectangle + // Note: removing .select('rect') breaks rendering on firefox but not on chrome. + let selected_node_bbox = d3.select(this).select('rect').node().getBBox(); d.node_width = selected_node_bbox.width; node_width = node_width > selected_node_bbox.width ? node_width : selected_node_bbox.width;