Network Layout Ma Maneesh Agrawala CS 448B: Visualization Fall - - PDF document

network layout
SMART_READER_LITE
LIVE PREVIEW

Network Layout Ma Maneesh Agrawala CS 448B: Visualization Fall - - PDF document

Network Layout Ma Maneesh Agrawala CS 448B: Visualization Fall 2020 1 Last Time: Animation 2 1 Implementing Animation 3 Animation Approaches Frame-based Animation Redraw scene at regular interval (e.g., 16ms) Developer defines the


slide-1
SLIDE 1

1

Network Layout

Ma Maneesh Agrawala

CS 448B: Visualization Fall 2020

1

Last Time: Animation

2

slide-2
SLIDE 2

2

Implementing Animation

3

Animation Approaches

Frame-based Animation

Redraw scene at regular interval (e.g., 16ms) Developer defines the redraw function

4

slide-3
SLIDE 3

3

1 2 3 4

Frame-based Animation

5

1 2 3 4

circle(10,10) circle(10,10) circle(15,15) circle(15,15) circle(20,20) circle(20,20) circle(25,25) circle(25,25)

Frame-based Animation

6

slide-4
SLIDE 4

4

1 2 3 4

circle(10,10) circle(10,10) circle(15,15) circle(15,15) circle(20,20) circle(20,20) circle(25,25) circle(25,25)

Frame-based Animation

7

1 2 3 4

circle(10,10) circle(10,10) circle(15,15) circle(15,15) circle(20,20) circle(20,20) circle(25,25) circle(25,25) clear() clear() clear() clear() clear() clear()

Frame-based Animation

8

slide-5
SLIDE 5

5

Animation Approaches

Frame-based Animation

Redraw scene at regular interval (e.g., 16ms) Developer defines the redraw function

9

Animation Approaches

Frame-based Animation

Redraw scene at regular interval (e.g., 16ms) Developer defines the redraw function

Transition-based Animation (Hudson & Stasko ‘93)

Specify property value, duration & easing (tweening) Typically computed via interpolation

step(fraction) { xnow = xstart + fraction * (xend - xstart); }

Timing & redraw managed by UI toolkit

10

slide-6
SLIDE 6

6

Transition-based Animation

from: (10,10) to: (25,25) duration: 3sec

0s 1s 2s 3s

dx=25 dx=25-10 10 x=10+( x=10+(t/3)*dx /3)*dx x=10+( x=10+(t/3)*dx /3)*dx x=10+( x=10+(t/3)*dx /3)*dx x=10+( x=10+(t/3)*dx /3)*dx

11

Transition-based Animation

from: (10,10) to: (25,25) duration: 3sec Toolkit handles frame-by-frame updates

0s 1s 2s 3s

dx=25 dx=25-10 10 x=10+( x=10+(t/3)*dx /3)*dx x=10+( x=10+(t/3)*dx /3)*dx x=10+( x=10+(t/3)*dx /3)*dx x=10+( x=10+(t/3)*dx /3)*dx

12

slide-7
SLIDE 7

7

Any d3 selection can be used to drive animation.

D3 Transitions

13

Any d3 selection can be used to drive animation.

// Select SVG rectangles and bind them to data values.

var bars = svg.selectAll(“rect.bars”).data(values);

D3 Transitions

14

slide-8
SLIDE 8

8

Any d3 selection can be used to drive animation.

// Select SVG rectangles and bind them to data values.

var bars = svg.selectAll(“rect.bars”).data(values);

// Static transition: update position and color of bars.

bars .attr(“x”, (d) => xScale(d.foo)) .attr(“y”, (d) => yScale(d.bar)) .style(“fill”, (d) => colorScale(d.baz));

D3 Transitions

15

Any d3 selection can be used to drive animation.

// Select SVG rectangles and bind them to data values.

var bars = svg.selectAll(“rect.bars”).data(values);

// Animated transition: interpolate to target values using default timing

bars.transition() .attr(“x”, (d) => xScale(d.foo)) .attr(“y”, (d) => yScale(d.bar)) .style(“fill”, (d) => colorScale(d.baz));

D3 Transitions

16

slide-9
SLIDE 9

9

Any d3 selection can be used to drive animation.

// Select SVG rectangles and bind them to data values.

var bars = svg.selectAll(“rect.bars”).data(values);

// Animated transition: interpolate to target values using default timing

bars.transition() .attr(“x”, (d) => xScale(d.foo)) .attr(“y”, (d) => yScale(d.bar)) .style(“fill”, (d) => colorScale(d.baz));

// Animation is implicitly queued to run!

D3 Transitions

17

bars.transition() .duration(500)

// animation duration in ms

.delay(0)

// onset delay in ms

.ease(d3.easeBounce) // set easing (or “pacing”) style .attr(“x”, (d) => xScale(d.foo)) …

D3 Transitions, Continued

18

slide-10
SLIDE 10

10

bars.transition() .duration(500)

// animation duration in ms

.delay(0)

// onset delay in ms

.ease(d3.easeBounce)

// set easing (or “pacing”) style

.attr(“x”, (d) => xScale(d.foo)) … bars.exit().transition()

// animate elements leaving display

.style(“opacity”, 0)

// fade out to fully transparent

.remove();

// remove from DOM upon completion

D3 Transitions, Continued

19 Goals: stylize animation, improve perception. Basic idea is to warp time: as duration goes from start (0%) to end (100%), dynamically adjust the interpolation fraction using an easing function.

Easing Functions

20

slide-11
SLIDE 11

11

Goals: stylize animation, improve perception. Basic idea is to warp time: as duration goes from start (0%) to end (100%), dynamically adjust the interpolation fraction using an easing function.

Easing Functions

elapsed time / duration frac 1 1 ease(x) = x (linear, no warp)

21 Goals: stylize animation, improve perception. Basic idea is to warp time: as duration goes from start (0%) to end (100%), dynamically adjust the interpolation fraction using an easing function.

Easing Functions

elapsed time / duration frac 1 1 ease(x) = x (linear, no warp) elapsed time / duration frac 1 1 ease(x) = s-curve(x) (slow-in, slow-out)

22

slide-12
SLIDE 12

12

http://easings.net/

23

Animation is a salient visual phenomenon Attention, object constancy, causality, timing Design with care: congruence & apprehension For processes, static images may be preferable For transitions, animation has some benefits, but consider task and timing

Summary

27

slide-13
SLIDE 13

13

Announcements

28

Final project

Data analysis/explainer or conduct research

I Data analysis: Analyze dataset in depth & make a visual explainer I Research: Pose problem, Implement creative solution

Deliverables

I Data analysis/explainer: Article with multiple interactive

visualizations

I Research: Implementation of solution and web-based demo if possible I Short video (2 min) demoing and explaining the project

Schedule

I Project proposal: Thu 10/29 I Design Review and Feedback: Tue 11/17 & Thu 11/19 I Final code and video: Sat 11/21 11:59pm

Grading

I Groups of up to 3 people, graded individually I Clearly report responsibilities of each member

29

slide-14
SLIDE 14

14

Network Layout

30 31

slide-15
SLIDE 15

15

Graphs and Trees

Graphs Model relations among data Nodes and edges Trees Graphs with hierarchical structure

Connected graph with N-1 edges

Nodes as parents and children

32

Spatial Layout

Primary concern – layout of nodes and edges Often (but not always) goal is to depict structure

I Connectivity, path-following I Network distance I Clustering I Ordering (e.g., hierarchy level)

33

slide-16
SLIDE 16

16

Topics

Tree Layout Node-Link Graph Layout

Sugiyama-Style Layout Force-Directed Layout

Alternatives to Node-Link Graph Layout

Matrix Diagrams Attribute-Drive Layout

35

Tree Layout

36

slide-17
SLIDE 17

17

Tree Visualization

Indentation

I Linear list, indentation encodes depth

Node-Link diagrams

I Nodes connected by lines/curves

Enclosure diagrams

I Represent hierarchy by enclosure

Layering

I Layering and alignment

Tree layout is fast: O(n) or O(n log n), enabling real-time layout for interaction

37

Indentation

Items along vertically spaced rows Indentation shows parent/child relationships Often used in interfaces Breadth/depth contend for space Often requires scrolling 38

slide-18
SLIDE 18

18

Single-Focus (Accordion) List

Separate breadth & depth in 2D Focus on single path at a time

39

Node-Link Diagrams

Nodes distributed in space, connected by lines Use 2D space to break apart breadth and depth Space used to communicate hierarchical orientation

Typically towards authority or generality 40

slide-19
SLIDE 19

19

Basic Recursive Approach

Repeatedly divide space for subtrees by leaf count

§

Breadth of tree along one dimension

§

Depth along the other dimension 42

Basic Recursive Approach

Repeatedly divide space for subtrees by leaf count

§

Breadth of tree along one dimension

§

Depth along the other dimension 43

slide-20
SLIDE 20

20

Basic Recursive Approach

Repeatedly divide space for subtrees by leaf count

§

Breadth of tree along one dimension

§

Depth along the other dimension Problem: Exponential growth of breadth 44

Reingold & Tilford’s Tidier Layout

Goal: maximize density and symmetry. Originally for binary trees, extended by Walker to cover general case. This extension was corrected by Buchheim et al. to achieve a linear time algorithm 45

slide-21
SLIDE 21

21

Reingold-Tilford Layout

Design concerns Clearly encode depth level No edge crossings Isomorphic subtrees drawn identically Ordering and symmetry preserved Compact layout (don’t waste space)

46

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

47

slide-22
SLIDE 22

22

Reingold-Tilford Algorithm

48

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

49

slide-23
SLIDE 23

23

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

50

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

51

slide-24
SLIDE 24

24

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

52

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

53

slide-25
SLIDE 25

25

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

54

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

55

slide-26
SLIDE 26

26

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

56

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

57

slide-27
SLIDE 27

27

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

58

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

59

slide-28
SLIDE 28

28

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

60

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

61

slide-29
SLIDE 29

29

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

62

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

63

slide-30
SLIDE 30

30

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

64

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

65

slide-31
SLIDE 31

31

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

66

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

67

slide-32
SLIDE 32

32

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

68

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

69

slide-33
SLIDE 33

33

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

70

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

71

slide-34
SLIDE 34

34

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

72

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

73

slide-35
SLIDE 35

35

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

74

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

75

slide-36
SLIDE 36

36

Reingold-Tilford Algorithm

Linear algorithm – starts with bottom-up (postorder) pass Set Y-coord by depth, arbitrary starting X-coord Merge left and right subtrees

I

Shift right as close as possible to left

I

Computed efficiently by maintaining subtree contours

I

“Shifts” in position saved for each node as visited

I

Parent nodes are centered above their children

Top-down (preorder) pass for assignment of final positions

I

Sum of initial layout and aggregated shifts

76

Radial Layout

Node-link diagram in polar coords Radius encodes depth root at center Angular sectors assigned to subtrees (recursive approach) Reingold-Tilford approach can also be applied here

79

slide-37
SLIDE 37

37

Problems with Node-Link Diagrams

Scale

Tree breadth often grows exponentially Even with tidier layout, quickly run out of space

Possible solutions

Filtering Focus+Context Scrolling or Panning Zooming Aggregation

82

Visualizing Large Hierarchies

… … … Indented Layout Reingold-Tilford Layout

83

slide-38
SLIDE 38

38

MC Escher, Circle Limit IV

84

Hyperbolic Layout

Layout in hyperbolic space, then project on to Euclidean plane Why? Like tree breadth, the hyperbolic plane expands exponentially Also computable in 3D, projected into a sphere

85

slide-39
SLIDE 39

39

Degree-of-Interest Trees [AVI 04]

Space-constrained, multi-focal tree layout

https://www.youtube.com/watch?v=RTQ0N4QY0yc https://observablehq.com/@d3/collapsible-tree

86

Degree-of-Interest Trees

Cull “un-interesting” nodes on a per block basis until all blocks on a level fit within bounds Center child blocks under parents

https://www.youtube.com/watch?v=RTQ0N4QY0yc https://observablehq.com/@d3/collapsible-tree

87

slide-40
SLIDE 40

40

Enclosure Diagrams

Encode structure using spatial enclosure Popularly known as TreeMaps Benefits Provides a single view of an entire tree Easier to spot large/small nodes Problems Difficult to accurately read depth

88

Circle Packing Layout

Nodes represented as sized circles Nesting to show parent-child relationships Problems:

89

slide-41
SLIDE 41

41

Circle Packing Layout

Nodes represented as sized circles Nesting to show parent-child relationships Problems: Inefficient use of space Parent size misleading

90

Treemaps

Hierarchy visualization that emphasizes values of nodes via area encoding Partition 2D space such that leaf nodes have sizes proportional to data values First layout algorithms proposed by Shneiderman et al. in 1990, with focus on showing file sizes on a hard drive

92

slide-42
SLIDE 42

42

Slice & Dice layout: Alternate horizontal / vertical partitions.

93

Wattenberg 1998

Squarifed layout: Try to produce square (1:1) aspect ratios

94

slide-43
SLIDE 43

43

Squarified Treemaps [Bruls 00]

Greedy optimization for objective of square rectangles Slice/dice within siblings; alternate whenever ratio worsens

https://vega.github.io/vega/examples/treemap/

95

Why Squares

Posited Benefits of 1:1 Aspect Ratios

  • 1. Minimize perimeter, reducing border ink.
  • 2. Easier to select with a mouse cursor.

Validated by empirical research & Fitt’s Law!

  • 3. Similar aspect ratios are easier to compare.

Seems intuitive, but is this true?

96

slide-44
SLIDE 44

44

Error vs. Aspect Ratio [Kong 10]

  • 1. Comparison of squares has higher error!
  • 2. Squarify works because it fails to meet its objective?

Squares

97

Treemaps vs. Bar Charts [Kong 10]

Height more perceptually effective than area What if element count is high? What about comparing groups of elements such as leaf values to internal node values?

99

slide-45
SLIDE 45

45

Treemaps vs. Bar Charts [Kong 10]

At low densities (< 4k elements), bar charts more accurate than treemaps for leaf-node comparisons. At higher density, treemaps led to faster judgments. Treemaps better for group-level comparisons.

100

Cushion Treemaps [van Wijk 99]

Use shading to emphasize hierarchical structure

101

slide-46
SLIDE 46

46

Cascaded Treemaps [Lü 08]

Use 2.5D effect emphasize hierarchical structure

102

Voronoi Treemaps [Balzer 05]

Treemaps with arbitrary polygonal shape and boundary Uses iterative, weighted Voronoi tessellations to achieve cells with value- proportional areas

103

slide-47
SLIDE 47

47

Signify tree structure using Layering Adjacency Alignment Involves recursive sub-division of space Can apply the same set of approaches as in node-link layout

Layered Diagrams

105

Icicle and Sunburst Trees

Higher-level nodes get a larger layer area, whether that is horizontal or angular extent Child levels are layered, constrained to parent’s extent 106

slide-48
SLIDE 48

48

Layered Tree Drawing

107

Node-Link Graph Layout

109

slide-49
SLIDE 49

49

Spanning Tree Layout

Many graphs are tree-like or have useful spanning trees

Websites, Social Networks

Use tree layout on spanning tree of graph

Trees created by BFS / DFS Min/max spanning trees

Fast tree layouts allow graph layouts to be recalculated at interactive rates Heuristics may further improve layout

111

Spanning tree layout may result in arbitrary parent node

112

slide-50
SLIDE 50

50

Sugiyama-style graph layout

Evolution of the UNIX

  • perating system

Hierarchical layering based on descent

113

Sugiyama-style graph layout

Reverse some edges to remove cycles Assign nodes to hierarchy layers à Longest path layering Create dummy nodes to “fill in” missing layers Arrange nodes within layer, minimize edge crossings Route edges – layout splines if needed

Layer 1 Layer 2 Layer 3 Layer 4

… …

114

slide-51
SLIDE 51

51

Produces hierarchical layout

Sugiyama-style layout emphasizes hierarchy

However, cycles in the graph may mislead. Long edges can impede perception of proximity. 115

Hierarchical Edge Bundles

117

slide-52
SLIDE 52

52

Trees with Adjacency Relations

118 119

slide-53
SLIDE 53

53

Use radial tree layout for inner circle Mirror to outside Replace inner tree with hierarchical edge bundles

120

Bundle Edges along Hierarchy

121

slide-54
SLIDE 54

54

Increasing Edge Tension

122

Configuring Edge Tension

123

slide-55
SLIDE 55

55

Flare Class Hierarchy & Dependency Graph

124

Force-Directed Layout

125

slide-56
SLIDE 56

56

Interactive Example: Configurable Force Layout

126 127

slide-57
SLIDE 57

57

Use the Force!

http://mbostock.github.io/d3/talk/20110921/

128

d3.force 7,922 nodes 11,881 edges

[Kai Chang]

129

slide-58
SLIDE 58

58

Force-Directed Layout

Nodes = charged particles

F = qi* qj / dij2

with air resistance

F = -b * vi

Edges = springs

F = k * (L - dij)

D3’s force layout uses velocity Verlet integration Assume uniform mass m and timestep Δt: F = ma → F = a → F = Δv / Δt → F = Δv Forces simplify to velocity offsets! Repeatedly calculate forces, update node positions

Naïve approach O(N2) Speed up to O(N log N) using quadtree or k-d tree Numerical integration of forces at each time step 130 131

slide-59
SLIDE 59

59

132

Naive calculation of forces at a point uses sum of forces from all other n-1 points.

133

slide-60
SLIDE 60

60

For fast approximate calculation, we build a spatial index (here, a quadtree) and use it to compare with distant groups of points instead.

134

The Barnes-Hut θ parameter controls when to compare with an aggregate center of charge. wquadnode / dij < θ ? θ = 0.5

135

slide-61
SLIDE 61

61

θ = 0.9 (default setting)

136

θ = 1.5

137

slide-62
SLIDE 62

62

θ = 2.0

138

Alternative Layouts

140

slide-63
SLIDE 63

63

Linear node layout, circular arcs show connections. Layout quality sensitive to node ordering!

141

The Shape of Song [Wattenberg ’01]

142

slide-64
SLIDE 64

64

Limitations of Node-Link Layout

Edge-crossings and occlusion

143 146

slide-65
SLIDE 65

65

Attribute-Driven Layout

Large node-link diagrams get messy! Is there additional structure we can exploit? Idea: Use data attributes to perform layout

I e.g., scatter plot based on node values

Dynamic queries and/or brushing can be used to explore connectivity

155

Attribute-Driven Layout

The “Skitter” Layout

  • Internet Connectivity
  • Radial Scatterplot

Angle = Longitude

  • Geography

Radius = Degree

  • # of connections
  • (a statistic of the nodes)

156

slide-66
SLIDE 66

66

Semantic Substrates [Shneiderman

06]

Semantic Substrates [Shneiderman 06]

157

Summary

Tree Layout

Indented / Node-Link / Enclosure / Layers How to address issues of scale?

I Filtering and Focus + Context techniques

Graph Layout

Tree layout over spanning tree Hierarchical “Sugiyama” Layout Optimization (Force-Directed Layout) Attribute-Driven Layout

164