D3 Workshop: Part 2 - SVGs and d3 Transitions
This interactive tutorial demonstrates D3 transitions on SVG shapes. A button triggers a JavaScript function that animates existing rectangles and circles, moving them to random positions and changing their colors. The code uses d3-selection and d3-transition APIs, including `.transition()`, `.duration()`, and `.attr()` to animate properties. It also demonstrates data joins by binding an array of color objects to newly appended rectangles, which transition through random coordinates before settling into their assigned hues.