d3-layouts-hierarchies

Guide D3 hierarchical layouts, force simulations, and quadtree spatial indexing.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/zacharyr0th/next-starter --skill d3-layouts-hierarchies
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: d3-layouts-hierarchies
Source: https://github.com/zacharyr0th/next-starter/tree/main/.claude/skills/d3/d3-layouts-hierarchies
Command: npx skills add https://github.com/zacharyr0th/next-starter --skill d3-layouts-hierarchies

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Use when creating tree diagrams, force-directed networks, treemaps, dendrograms, or spatial indexes. This skill covers hierarchical layouts, Voronoi, Delaunay, quadtrees, and related patterns.

Core Features & Use Cases

  • Tree layouts, cluster, dendrograms
  • Force-directed graphs and simulations
  • Treemap, partition, circle packing
  • Delaunay triangulation and Voronoi diagrams
  • Quadtrees for spatial indexing

Quick Start

Request aOrg chart or network visualization with a force layout.

Frequently Asked Questions about d3-layouts-hierarchies

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a tree layout or org chart visualization with D3?

Tree layouts in D3 use d3.hierarchy to normalize hierarchical data, then apply layout algorithms like d3.tree or d3.cluster to compute node positions. Pass your nested data structure through d3.hierarchy, call the layout function, and render the positioned nodes and links to SVG for org charts, dendrograms, and node-link diagrams.

What's the best way to build a force-directed network visualization?

Force-directed networks use d3.forceSimulation to iteratively position nodes based on repulsive and attractive forces. Configure the simulation with d3.forceManyBody for repulsion, d3.forceLink for edge attraction, and d3.forceCenter for centering. Tune alpha decay and force strength parameters to balance convergence speed and final layout quality.

When should I use Voronoi diagrams or Delaunay triangulation?

Voronoi diagrams partition space into regions closest to each point; Delaunay triangulation connects points with non-overlapping triangles. Use Voronoi for proximity-based interaction, heat maps, or spatial queries. Use Delaunay for mesh generation, collision detection, or spatial relationships when you need dual geometric guarantees.

How do I handle large hierarchical datasets without performance issues?

Optimize hierarchical visualizations with quadtrees for spatial indexing to reduce collision checks in force simulations. Use data normalization with d3.hierarchy to flatten computation. For rendering, choose canvas over SVG for thousands of nodes, implement culling to skip off-screen elements, and update only changed portions during interactions.

Can I use D3 layouts for treemaps and circle packing layouts?

Yes. D3 provides d3.treemap for rectangular partitions, d3.partition for layered hierarchies, and d3.pack for circle packing. Each normalizes hierarchical data with d3.hierarchy, then computes spatial coordinates. Render the positioned rectangles, arcs, or circles to create space-filling visualizations of tree structures.

What's the difference between tree and force-directed layouts for networks?

Tree layouts impose a strict parent-child hierarchy with predetermined positions; ideal for organizational structures and taxonomies. Force-directed layouts use physics simulation to balance repulsion and attraction; better for discovering relationships and handling cyclic or loosely structured networks where hierarchy is implied rather than strict.