D3 selection examples (exploring phases)
This example demonstrates dynamic data joins in D3 with animated circles whose count, position, and radius oscillate over time. It shows both a commented-out manual `selection.data()`, `enter()`, `append()`, `merge()`, and `exit()` workflow, alongside the active `selection.join()` shorthand which automatically handles entering and exiting elements. The animation runs on a 60fps `setInterval` using `Math.sin` to generate periodic values. It renders SVG circles sized and offset by each datum’s cosine-based properties, updating every frame. The code uses D3 v7’s `select` and `range` from the `d3` package.