score:1

I guess I needed to set the opacity to 0 before animating it to 1.

  showSelection.transition()
    .style('opacity', 0)
    .duration(animate ? 300 : 0)
    .style('opacity', 1)
    .on('end', () => {
      selection.style('pointer-events', 'inherit');
    });

Related Query

More Query from same tag