 to re-select globally, keep selections scoped

    // Update simulation
    simulation.nodes(nodes);
    simulation.force("link").links(links);
    simulation.alpha(0.2).restart();
    // Always raise nodes group to top so nodes render above links
    nodesGroup.raise();
  }

  // Drag functions for nodes
  function drag(simulation) {
    function dragstarted(event) {
      if (!event.active) simulation.alphaTarget(0.3).restart();
      event.subject.fx = event.subject.x;
      event.subject.fy = event.sub