-
Book Overview & Buying
-
Table Of Contents
Learn D3.js - Second Edition
By :
Trees represent rooted hierarchies using node symbols and connecting lines. While typically shown with the root at the top, trees can also be rendered horizontally or radially. Figure 15.5 shows trees created with D3 from CSV and JSON data sources. The data is not relevant here, just the structure. If you wish to see the details, load the pages from the Examples/ folder in your browser.
Figure 15.5 – Two dendrograms created with D3: a phylogenetic chart and a radial tree connecting countries and continents. Code: Examples/ folder
D3 provides layout generators for two types of trees: the tidy tree, which presents a compact view of the algorithm by positioning nodes of the same level side-by-side, and the cluster or dendrogram, which arranges all leaves at the lowest level. Figure 15.6 illustrates both types rendering the same data. We will generate these trees later in this section.
Figure 15.6 –...