.attr('stroke', d => selected.has(d.id) ? 'black' : 'none')
      update.selectAll('text')
        .html(nodeHtml)
      return update
    },
    exit => {
      exit.call(exit => {
        exit.transition()
          .duration(1000)
          .attr('opacity', 0)
          .remove()
        // backup position/velocity
        const old = new Map(exit.data().map(d => [d.id, d]))
        nodes = nodes.map(d => Object.assign(old.get(d.id) || {}, d))
      })
    })

  link = link.data(newLinks, d => [d.source,