Skip to content

Commit

Permalink
fix: Remove lookup of old node [PT-187399412]
Browse files Browse the repository at this point in the history
This was breaking the reset feature and is no longer needed as we update the node directly after dragging.
  • Loading branch information
dougmartin committed Oct 2, 2024
1 parent 185ea46 commit e4735f0
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 e4735f0

Please sign in to comment.