liveBook · Manning

Root node

As explained in D3.js in Action, Third Edition

A root node is the topmost node of a tree or hierarchy, which has no parent.

A root node is the single topmost node in a hierarchy. It has no parent and separates into one or more branches that eventually end in leaf nodes. section 11.0 section 11.1.1

Represent the root in tabular data with a child value and an empty parent relationship. In the language dataset, “Languages” is the root; language families are its direct children. section 11.1.1

Build and use a root node in a D3 hierarchy:

  • Declare parent-child relationships in CSV columns. section 11.1.1
  • Configure d3-hierarchy stratify() with id and parentId accessors. section 11.1.1
  • Generate the root, then access its descendants and leaves for visualization. section 11.1.1

Languages hierarchy

The root node “Languages” divides into Indo-European and Sino-Tibetan families, which subdivide into branches and then individual languages. A tree chart places this root at the left. section 11.3 section 11.1.1

Figure 11.2 A hierarchical visualization has one single root that separates into one or more branches. It ends with leaf nodes, which in this example are the languages.
figure

Use the diagram to see how one root separates into branches and ends with leaf nodes. section 11.0

How D3.js in Action, Third Edition covers it

How deep it goes
Defines the root’s position and demonstrates its construction with stratify(), but stops short of explaining hierarchy internals.
Examples
Uses “Languages” as the root in CSV data, tree charts, and a hierarchy of language families, branches, and languages.
What it assumes
Assumes basic tabular data and parent-child relationships while introducing hierarchical visualization structure from concrete language data.
What you can do after
Build it from scratch by encoding a root in CSV data and generating a D3 hierarchy for visualization.
How it connects
Connects root nodes to trees, hierarchies, parent-child relationships, leaf nodes, D3 hierarchy, and tree charts.

Also explained in

Compare how 5 books explain root node →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of D3.js in Action, Third Edition. The section links point to the parts of the book it draws on.