Skip to main content
100%

AN Scratchpad

✓ Published0🌍 Public
Aadamnieman
Last edited Nov 12, 2017
Created on Nov 12, 2017

A grid of small white rectangles with grey strokes appears on an SVG canvas, arranged in a loose formation based on coordinate pairs. Clicking any rectangle triggers a staggered transition where every block shifts diagonally by a fixed offset, using D3 v4’s `transition().duration()` and `delay()` methods. The animation recalculates each rectangle’s `x` and `y` attributes from updated array values, creating a cascading ripple effect across the entire grid.

AI-generated description

This is the code for Chapter 1, Figure 34 from D3.js in Action that creates various SVG elements and then animates them using D3 transitions.

forked from <a href='http://bl.ocks.org/emeeks/'>emeeks</a>'s block: <a href='http://bl.ocks.org/emeeks/5090dad12ed99da67e77'>Ch. 1, Fig. 34 - D3.js in Action</a>

mit Licensed

Similar vizzes