D3JS Forcegraph - Nodes bounce on refresh

Hi everyone,

I’m currently using a D3.js force graph in combination with Grafana and live data. The workflow is set up so that I perform a refresh every 5 seconds, during which new nodes are collected. If these are entirely new nodes, they are added to the appropriate nodes array and passed to the D3.js force simulation.
In the simulation, I’m using a link force among other things, which connects the nodes. My problem is that during a refresh, existing nodes are initially pulled toward the center when a new node appears that is linked to them. Over time, the simulation stabilizes and the existing node gradually moves back toward its original position along with its linked node. The issue is that this behavior harms the overall readability. Is there a way to keep existing nodes relatively static in their position (at least if they already have many nodes linked to them)?

      const simulation = d3.forceSimulation(nodesFinalGraph)
      .force("link", d3.forceLink(linksFinalGraph as any).id((d: any) => d.id).distance(75))
       .force("charge", d3.forceManyBody().strength(-80))
       .force("center", d3.forceCenter(0, 0))