Skip to content

Commit

Permalink
Merge pull request #75 from concord-consortium/187399412-fix-reset-mo…
Browse files Browse the repository at this point in the history
…ved-node

fix: Remove lookup of old node [PT-187399412]
  • Loading branch information
dougmartin authored Oct 2, 2024
2 parents 185ea46 + e4735f0 commit 0ab337d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/components/graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -391,15 +391,11 @@ export const Graph = (props: Props) => {
const {minRadius, maxRadius, minStroke, maxStroke} = settings;

graph.nodes.forEach((node, index) => {
const oldD3Node = d3Graph.nodes.find(n => n.id === node.id);
node.x = oldD3Node?.x ?? node.x ?? 0;
node.y = oldD3Node?.y ?? node.y ?? 0;

const d3Node: D3Node = {
index,
id: node.id,
x: node.x,
y: node.y,
x: node.x ?? 0,
y: node.y ?? 0,
label: node.label,
// radius: 15 + (5 * (node.label.length - 1)) + (5 * node.value),
radius: minRadius + ((maxRadius - minRadius) * (node.value / totalNodeValue)),
Expand Down

0 comments on commit 0ab337d

Please sign in to comment.