Gist 15f6017917ad471f4c074015276d2994
✓ Published0🌍 Public
Mmbostock
Last edited Mar 12, 2018
Created on Mar 12, 2018
This visualization renders a shark using a particle system driven by a force-directed simulation. The shark’s shape is defined by an SVG path, and a grid of points samples the path’s pixels via Canvas `getImageData` to determine where particles should settle. The code uses `d3.forceSimulation` with custom forces to push particles toward the target image while maintaining collision avoidance, and each particle is drawn as a small circle on a canvas. The example demonstrates how force layouts can reconstruct a recognizable shape from unordered points.
AI-generated descriptionIt’s a shark!