Skip to main content
100%

Simple Tree and Cluster Demo

✓ Published0🌍 Public
Aanotherjavadude
Last edited Jun 21, 2012
Created on Jun 21, 2012

This example displays the same hierarchical JSON dataset as two different D3 layouts: a tree and a cluster. Users toggle between the two views using the "Tree" and "Cluster" buttons, which trigger an `update` function that rebuilds the visualization. The code uses `d3.layout.tree()` and `d3.layout.cluster()` to compute node positions, and `d3.svg.diagonal()` to draw curved links between parent and child nodes. Each node is rendered as a circle with a text label, and the SVG canvas is recreated on every layout change.

AI-generated description

Displaying the same JSON data as tree and cluster. I rather have a transition, still working on it....

Similar vizzes