Skip to content

Hierarchical Data Format

Cameron Yick edited this page May 2, 2019 · 2 revisions

Several of the graph types are hierarchy. You may be wondering about how to structure your data, since a generic data table is not necessarily compatible. Additionally, the D3 code samples for hierarchy visualizations may take a nested data structure, and RAWGraphs expects a table.

Hierarchical Visualizations

  1. For each layer in your hierarchy, define a column.
  2. For each leaf in your hierarchy, define its path through all the layers (columns) you've defined. Every row will end up creating a new leaf.
  3. If you're using a weighted visualization, add any additional numerical columns you need to size/color your leaves appropriately.

Here is snapshot example from the sample orchestra dataset, which can be used for weighted or unweighted visualizations. The first row is for column headers, the second row is where the data actually starts.

Orchestra type,Group,Instrument,Number
Modern orchestra,Brass,Baritone horn,1
Early Romantic orchestra,Woodwinds,Bass Clarinet,1
Late Romantic orchestra,Woodwinds,Bass Clarinet,1
Early Romantic orchestra,Percussion,Bass Drum,1

View the full data here.

Weighted

These visualizations are for showing relationships among the nodes in your hierarchy, and all the nodes are treated equally.

  1. Cluster Dendrogram
  2. Circular Dendrogram

Unweighted

These visualizations let you size and/or color the nodes based on numeric columns.

  1. Sunburst
  2. Circle Packing
  3. Treemap
Clone this wiki locally