Skip to main content
100%

fractal

✓ Published0🌍 Public
CCurran Kelleher
Last edited Oct 9, 2016
Created on Sep 17, 2016

This example shows an interactive tree fractal that branches recursively into hundreds of thousands of circles, with the mouse position controlling the number of branches and their angle. The visualization responds to mouse movement by recalculating the fractal structure and re-rendering the SVG circles. The code uses D3 v4’s `selectAll` and `data` binding with an enter/merge pattern, but omits the `exit()` call, leaving obsolete circles in the DOM. Rendering relies on SVG `circle` elements positioned via `cx`, `cy`, and `r` attributes.

AI-generated description

A tree fractal using SVG and D3 in a broken, incomplete state. This is what happens when you don't use the exit() part of the enter/update/exit pattern.

See also the fully working version.

<a href="http://fineartamerica.com/products/tree-fractal-with-circles-curran-kelleher-canvas-print.html"> <img src="/curran/raw/36163af1a01d41d0cd18bf6397bae774/print.png"></a> You can <strong><a href="http://fineartamerica.com/products/tree-fractal-with-circles-curran-kelleher-canvas-print.html">buy prints of this graphic</a></strong> (with 786,411 circles!).

Built with blockbuilder.org

mit Licensed

Similar vizzes