     });

          // Shrink and fade out
          message
            .transition()
            .delay(2400)
            .duration(300)
            .attr("r", 6)
            .transition()
            .duration(400)
            .style("opacity", 0)
            .attr("r", 0)
            .remove()
            .on("end", () => messagePath.remove());
        });

        setTimeout(animateMessages, 3500);
      }

      // Start animation
      animateMessages();
    </script>
  </body>
</html>
