D3 Workshop: Part 2 - SVGs and d3 Transitions
This example demonstrates basic D3.js (v4) concepts for creating and animating SVG elements through a simple interactive button. It shows how to manually add a yellow rectangle, then uses D3 to append a green rectangle that transitions to a random position. The code also binds an array of color data to newly created rectangles, moving them and updating their fill colors through chained transitions. Key APIs include `d3.select`, `append`, `data`, `enter`, `merge`, and `transition` with `.duration` and `.attr` for animated property changes, all rendered as SVG in the browser.