Enclosure

Visualization of hierarchical structure using containment.

Kris Sankaran (UW Madison)
01-10-2023

Reading (Chapter 9), Recording, Rmarkdown

  1. If nodes can be conceptually organized into a hierarchy, then it’s possible to use enclosure (i.e., the containment of some visual marks within others) to encode those relationships.
graph <- tbl_graph(flare$vertices, flare$edges)

p1 <- ggraph(graph, "tree") +
  geom_edge_link() +
  geom_node_point(aes(size = size)) +
  scale_size(range = c(0.1, 5))
p2 <- ggraph(graph, "circlepack", weight = size) +
  geom_node_circle(aes(fill = depth)) +
  scale_fill_distiller(direction = 1) +
  coord_fixed()

grid.arrange(p1, p2, ncol = 2)
A tree and the equivalent representation using containment. The outer circle corresponds to the root node in the tree, and paths down the tree are associated with sequences of nested circles.

Figure 1: A tree and the equivalent representation using containment. The outer circle corresponds to the root node in the tree, and paths down the tree are associated with sequences of nested circles.

  1. Hierarchy most obviously occurs in trees, but it can also be present in networks with clustering structure at several levels. (see point 6 below).

  2. Enclosure is used in treemaps. In this visualization, each node is allocated an area, and all its children are drawn within that area (and so on, recursively, down to the leaves).

ggraph(graph, "treemap", weight = size) +
  geom_node_tile(aes(fill = depth, size = depth), size = 0.25) +
  scale_fill_distiller(direction = 1) +
  coord_fixed()
A treemap representation associated with the tree from above.

Figure 2: A treemap representation associated with the tree from above.

  1. This is a particularly useful visualization when it’s important to visualize a continuous attribute associated with each node. For example, a large node might correspond to a large part of a budget or a large directory in a filesystem. Here is an example visualization of Obama’s budget proposal in 2013.

  2. A caveat: treemaps are not so useful for making topological comparisons, like the distance between two nodes in the tree.

  3. In situations where network nodes can be organized hierarchically, containment marks can directly represent the these relationships. For example, in the network below, the red and yellow clusters are contained in a green supercluster. The combination of node-link diagram and containment sets makes this structure clear.

An example of how hierarchy across groups of nodes can be encoded within a network.

Figure 3: An example of how hierarchy across groups of nodes can be encoded within a network.

Citation

For attribution, please cite this work as

Sankaran (2023, Jan. 10). STAT 436 (Spring 2023): Enclosure. Retrieved from https://krisrs1128.github.io/stat436_s23/website/stat436_s23/posts/2022-12-27-week08-04/

BibTeX citation

@misc{sankaran2023enclosure,
  author = {Sankaran, Kris},
  title = {STAT 436 (Spring 2023): Enclosure},
  url = {https://krisrs1128.github.io/stat436_s23/website/stat436_s23/posts/2022-12-27-week08-04/},
  year = {2023}
}