Trees and Geo
Information Visualization
John Alexis Guerra Gómez
| john.guerra[at]gmail.com
| @duto_guerra
https://johnguerra.co/lectures/information_visualization_fall2024/09_Trees_and_Geo/
Partially based on
slides from Tamara Munzner
and
previous adaptations
with
Andy Reagan
What We Are Going to Learn
What are trees
How to build them
How to visualize Trees
Node-Link representations
Containment representations
Tree comparison
How to visualize spatial
Geo
Spatial
Trees
Tree Definition
Set of nodes and links that express the parent-to-child relationship, where each node:
Is uniquely labeled in the tree
Contains one or more numeric variables with values over time
Contains one or more categorical attributes that may have more than one value
Types of Trees
How Trees Are Stored
JSON file
GraphML file
Table
Multiple attributes define hierarchy (e.g. state, city, neighborhood)
One attribute defines hierarchy with a separator (e.g. California/San Francisco/Presidio)
One attribute defines parent ID
Treemap from Table
Treemap from table
Convert tables to trees
SQL Query visualizer
Trees: Node-link
Idiom: Radial Node-Link Tree
Data:
Tree
Encoding:
Link connection marks
Point node marks
Radial axis orientation
Angular proximity: siblings
Distance from center: depth in tree
Task:
Understanding topology, following paths
Scalability:
1,000 to 10,000 nodes
https://observablehq.com/@d3/radial-tidy-tree
Cluster Dendograms Radial
Data: trees
Tasks: summarize common connections
Considerations:
Harder to read
Better space usage
https://observablehq.com/@d3/radial-dendrogram
Phylogenetic Trees
Data: tree of life
Tasks: summarize common connections; identify clusters
Considerations:
Harder to read
Also works with other clusters' data
https://observablehq.com/@mbostock/tree-of-life
Cluster Dendograms Cartesian
Force-Directed Tree
Collapsible Tree
Data: tree/network
Tasks: navigate connections; locate nodes
Considerations:
Great for larger datasets
Credit:
Collapsible tree by D3
Dendogram with Values
Data: tree/network
Tasks: summarize topology and distribution of a value
Spacetree
Spacetree: Tree Animation
Spacetree (cont.)
SpaceTree: a novel node-link tree browser
Spacetree My implementation
Trees as Reactive widgets
https://johnguerra.co/viz/USBudgetHistory/
Degree of Interest Tree
DOITrees Revisited: Scalable, Space-Constrained Visualization of Hierarchical Data
Trees: Containment
Idiom: Treemap
Data:
Tree
One quantitative attribute at leaf nodes
Encoding:
Area containment marks for hierarchical structure
Rectilinear orientation
Area encodes quantitative attribute
Tasks:
Query attribute at leaf nodes
Scalability:
One million leaf nodes
Cascaded Treemap
Readable inner labels
Less Precise
Better at showing hierarchy
Treemap extended
Add a color channel
e.g. To show the change in the stock prices
FinViz Stock Market Price changes
Icicle Tree
Data: tree
Tasks: summarize values/hierarchy; navigate links
Considerations:
Uses more space than the treemap
Better for labels
https://observablehq.com/@d3/zoomable-icicle
Zoomable Icicle Tree with values
Data: tree
Tasks:
summarize values/hierarchy
navigate links
compare values in leaves
Considerations:
Careful with small edges
Sunburst Tree
Data: tree
Tasks: summarize values/hierarchy; navigate links
Considerations:
Radial values are confusing
Fancy yet difficult animation
https://observablehq.com/@d3/zoomable-sunburst
Radial Treemap
https://observablehq.com/@d3/circle-packing
Kickstarter Projects
http://bl.ocks.org/john-guerra/38b1c32154905828f019f35a026b7526/21c8c72f9b8f2009f448d979509948ea27a7c614
Tree Drawing Idioms Comparison
Data shown:
Link relationships
Tree depth
Sibling order
Design choices:
Connection vs. containment link marks
Rectilinear vs. radial layout
Spatial position channels
Considerations:
Redundant? Arbitrary?
Information density?
Avoid wasting space
[Quantifying the Space-Efficiency of 2D Graphical Representations of Trees. McGuffin and Robert. Information Visualization 9:2 (2010), 115–140.]
D3 Tree playground
Tree Comparison
TreeVersity v2
https://treeversity.cattlab.umd.edu
Visualizing Spatial Data
Geo
Idiom: Choropleth Map
Use given spatial data:
When central task is understanding spatial relationships
Data:
Geographic geometry
Table with one quantitative attribute per region
Encoding:
Use given geometry for area mark boundaries
Sequential segmented colormap
Essentially, geographic heat map
Choropleth Map
Familiar
Areas encode... state area
Bivariate Choropleth Map
Idiom: Dot Map
Good for population density
Might require opengl
Task summarize
Idiom: Bubble Map
Alternative for choropleth
Be careful with occlusion
Idiom: Spike Map
Another alternative for choropleth
Also be careful with occlusion
Idiom: Vega-Lite Spike Map
Another alternative for choropleth
Also be careful with occlusion
U.S. Grid Map
Population Maps Trickiness
Beware!
Absolute vs. relative again
Population density vs. per capita
Investigate with
Ben Jones Tableau Public demo
Are maps of financial variables just population maps?
Yes, unless you look at per capita (relative) numbers
Idiom: Bayesian Surprise Maps
Use models of expectations to highlight surprising values
Confounds (population) and variance (sparsity)
Bayesian Surprise Map
Surprise! Bayesian Weighting for De-Biasing Thematic Maps
Idiom: Topographic Map
Data:
Geographic geometry
Scalar spatial field:
One quantitative attribute per grid cell
Derived data:
Isoline geometry
Isocontours computed for specific levels of scalar values
Idiom: Cartogram
Data:
Geographic geometry
Continuous value at each geometry
Derived data:
New geographic geometry: many algorithm choices
Then encoded as choropleth
Cartogram 1
Cartogram 2
Diffusion-based method for producing density-equalizing maps
Spatial Data
Idioms: Isosurfaces, Direct Volume Rendering
Data:
Scalar spatial field
One quantitative attribute per grid cell
Task:
Shape understanding, spatial relationships
Isosurface:
Derived data: isocontours computed for specific levels of scalar values
Direct volume rendering:
Transfer function maps scalar values to color, opacity
No derived geometry
Isosurfaces Example
Two-dimensional dynamics of elasto-inertial turbulence and its role in polymer drag reduction
Vector and Tensor Fields
Data:
Many attributes per cell
Idiom families:
Flow glyphs:
Purely local
Geometric flow:
Derived data from tracing particle trajectories
Sparse set of seed points
Texture flow:
Derived data, dense seeds
Feature flow:
Global computation to detect features
Encoded with one of methods above
Vector Fields
Empirical study tasks:
Finding critical points, identifying their types
Identifying what type of critical point is at a specific location
Predicting where a particle starting at a specified point will end up (advection)
Vector Field Example
Name That Dynamical System
Idiom: Similarity-Clustered Streamlines
Data:
3D vector field
Derived data (from field):
Streamlines: trajectory particle will follow
Derived data (per streamline):
Curvature, torsion, tortuosity
Signature: complex weighted combination
Compute cluster hierarchy across all signatures
Encode: color and opacity by cluster
Task:
Find features, query shape
Scalability:
Millions of samples, hundreds of streamlines
Streamlines
Original inspiration
Map Libraries
Mapbox
Leaflet
DataMaps
d3-carto-map
Mapbox and Tableau
Maps in Tableau
Mapbox + Tableau examples
Votos Fajardo
votosFajardo2
Votos Concejo
votosConcejo
Mapbox and d3
Reusable Mapbox + D3 library
Even supports forces
https://observablehq.com/@john-guerra/mapbox-d3
Maps with d3
Map Projections
Map Projections
Mike's Maps Tutorial
Command-Line Cartography, Part 1
Vega-Lite Maps
Vega-Lite API
What We Learned
What are trees
How to build them
How to visualize Trees
Node-Link representations
Containment representations
Tree comparison
How to visualize spatial
Geo
Spatial