Skip to main content
100%

Gist 734806

✓ Published0🌍 Public
Aabernier
Last edited Dec 9, 2010
Created on Dec 9, 2010

This example shows a hierarchical visualization of DOM elements, grouping nodes by their class names and revealing the structure of a web page. It uses a force-directed layout powered by `d3.forceSimulation` to position nodes, with the DOM tree traversed via a custom `walkTheDOM` function that also relies on `getElementsByClassName`. The rendering is done with SVG, where each circle represents a DOM node, and edges link parent and child elements. The data source is the live `document.body` of the current page, so the visualization dynamically reflects the page’s real markup.

AI-generated description

Similar vizzes