Skip to content

Commit

Permalink
vis: fix animated nodes sometimes disappearing and never coming back (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 authored Apr 3, 2024
1 parent 7272203 commit d9a6df7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/ott-vis-panel/src/components/TreeDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,10 @@ const TreeDisplay: React.FC<TreeDisplayProps> = ({
}
const data = node.data()[0] as d3.HierarchyNode<TreeNode>;
const endRadius = data ? getRadius(data.data.group) : 20;
const radiusCurrent = parseFloat(node.attr("r"));
let radiusCurrent = parseFloat(node.attr("r"));
if (isNaN(radiusCurrent)) {
radiusCurrent = 0;
}
const newRadius = Math.max(Math.min(radiusCurrent + 5, 40), endRadius);
node.transition("highlight")
.duration(333)
Expand Down

0 comments on commit d9a6df7

Please sign in to comment.