Skip to content

Commit b3b0bae

Browse files
committed
Fixed bug where AtomsRecoil tab was only rendering on the 2nd click by moving the clusterDataPopulate function right before hierarchy
1 parent 7d5f852 commit b3b0bae

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/app/components/AtomsRelationship.jsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ function Node({ node }) {
7272

7373
if (isRoot) return <RootNode node={node} />;
7474

75+
console.log(node)
76+
7577
return (
7678
<Group top={node.y} left={node.x}>
7779
{node.depth !== 0 && (
@@ -143,12 +145,13 @@ export default function Example({
143145
margin = defaultMargin,
144146
snapshots,
145147
}) {
148+
149+
clusterDataPopulate(snapshots);
150+
146151
const data = useMemo(() => hierarchy(clusterData), []);
147152
const xMax = width - margin.left - margin.right;
148153
const yMax = height - margin.top - margin.bottom;
149154

150-
clusterDataPopulate(snapshots);
151-
152155
return width < 10 ? null : (
153156
<svg width={width} height={height}>
154157
<LinearGradient id="top" from={green} to={aqua} />

0 commit comments

Comments
 (0)