UNIT IV: ADVANCED TOPICS IN DATA VISUALIZATION
Detailed Notes with Examples & Visualizations
Based on Kieran Healy's "Data Visualization: A Practical Introduction"
Approach
4.1 INTERACTIVE VISUALIZATION
1. What is Interactive Visualization?
Interactive visualization transforms static charts into dynamic tools for exploration.
Instead of presenting a single "truth," it allows users to:
Drill down into details
Filter what they see
Change perspectives
Ask their own questions
Healy's Perspective: "Interactivity should serve a purpose, not just be decoration. It
helps when there's too much to show at once, or when different viewers care about
different slices of the data."
2. Key Interactive Techniques with Examples
A. Linked Views & Brushing
Concept: Selecting data in one chart highlights related data in another.
Real Example: A dashboard showing COVID-19 data:
Top chart: Line graph of cases over time
Bottom chart: Map of cases by state
Interaction: Click on "New York" in the map → the line graph highlights New
York's trend, dimming other states.
Visual Example:
Cases Over Time (Before Interaction)
| All states shown together |
| (spaghetti graph) |
| |
| NEW YORK: Bold red line |
| Other states: Light gray lines |
| Focus on one story
Why it matters: Helps identify correlations and outliers across different views.
B. Filtering & Dynamic Queries
Concept: Using controls to show/hide data subsets.
Real Example: An e-commerce sales dashboard:
Dropdown: Select product category (Electronics, Clothing, Books)
Slider: Select price range ($0-500)
Checkboxes: Show only products with 4+ star ratings
Healy's Principle: "Filters should feel immediate. If there's a lag, users lose the
thread of their thought."
C. Tooltips & Details-on-Demand
Concept: Hover reveals details without cluttering.
Example from Healy's Book: A scatter plot of countries by GDP vs Life
Expectancy:
Default view: Just dots
Hover over "Japan": Shows exact values (GDP: $40,000, Life Exp: 84.5)
Hover over "Nigeria": Shows different story
Design Tip: Tooltips should show contextual comparisons (e.g., "84.5 years, 3.2
years above world average").
D. Zooming & Panning
Essential for: Large time series, detailed maps, gene sequences.
Example: A genomic visualization:
Zoom level 1: Whole chromosome
Zoom level 2: Specific region with genes
Zoom level 3: Individual DNA base pairs
Healy's Warning: "Always show the zoom context—a mini-map or overview
window—so users don't get lost."
3. Tools Deep Dive
A. Bokeh (Python)
Best for: Real-time streaming data, scientific visualizations.
Example Code Concept:
python
# Creating an interactive sine wave that updates with slider
from [Link] import figure, show
from [Link] import Slider
from [Link] import column
# Slider controls frequency
frequency_slider = Slider(start=0.1, end=10, value=1, step=0.1)
# Plot updates when slider moves
plot = figure()
line = [Link](x, y) # y changes based on slider
layout = column(frequency_slider, plot)
Use Case: Monitoring server traffic where new data arrives every second.
B. Plotly (Python/R)
Best for: Quick interactive charts, dashboards, 3D visualizations.
Example: Interactive 3D brain scan:
python
import [Link] as px
# Creates interactive 3D scatter of neural activity
fig = px.scatter_3d(neural_data, x='x', y='y', z='z',
color='activity', size='intensity',
hover_data=['region', 'function'])
[Link]() # User can rotate, zoom, click points
Healy-Style Tip: "Plotly's strength is making complex interactions accessible. But
don't add 3D just because you can—only if depth actually means something."
4.2 GEOGRAPHIC DATA VISUALIZATION
1. The Mapmaker's Dilemma
Healy's Core Question: "Does your data need a map, or do you just have
geographic data?"
When to use maps:
✅ Location is central to the story ("Where are outbreaks happening?")
✅ Patterns depend on proximity ("How does pollution spread from factories?")
✅ The audience needs spatial orientation ("Where should we open new stores?")
When NOT to use maps:
❌ Just showing rankings (use bar chart)
❌ Comparing few regions (use table or bar chart)
❌ Data isn't normalized (leads to population-size bias)
2. Map Types with Real Examples
A. Choropleth Maps: The Most Misunderstood
Correct Use: COVID-19 rate per 100,000 people by county.
Incorrect Use: COVID-19 total cases by county (just shows where people live).
Healy's Fix: "Always normalize. Divide by area, population, or relevant
denominator."
Visual Example:
text
WRONG CHOROPLETH RIGHT CHOROPLETH
| California: DARK RED | California: LIGHT ORANGE
| Wyoming: LIGHT PINK | Wyoming: DARK RED
| |
| Conclusion: CA worse | Conclusion: WY worse (per capita)
Explanation: CA has more Explanation: Adjusted for population,
people, so more cases WY has higher infection rate
B. Proportional Symbol Maps
Use when: Showing values at specific points.
Example: Earthquake visualization:
Each epicenter gets a circle
Circle size = magnitude
Circle color = depth
Interaction: Click circle → shows details, aftershocks
Design Tip: Use transparency when symbols overlap.
C. Dot Density Maps
Perfect for: Showing raw distribution.
Healy's Example from Book: 2016 US Election results:
Each dot = 100 votes for Clinton (blue) or Trump (red)
Creates "texture" showing urban/rural divide
More honest than binary red/blue state maps
D. Cartograms: When Geography Distorts Truth
Concept: Stretch/shrink regions based on data.
Famous Example: World map resized by:
1. Population → India/China become huge, Canada/Russia shrink
2. GDP → USA/Europe expand, Africa shrinks
3. COVID deaths → USA/Europe bloat, New Zealand tiny
Healy's Warning: "Cartograms can be confusing. Always show the original map
alongside for reference."
3. The Projection Problem
Mercator Projection Issue: Makes Greenland look Africa-sized (it's actually 1/14th
the size).
Solution for Your Projects:
World maps: Use Equal Earth or Robinson projection
US maps: Use Albers Equal Area Conic
Always state your projection in captions
4. Tools in Action
A. Leaflet: The Web Builder
Example: Real-time bus tracking map:
javascript
// Each bus is a marker
var busMarker = [Link]([lat, lon],
{icon: busIcon}).addTo(map);
// Update position every 15 seconds
setInterval(function() {
[Link](newPosition);
// Draw line showing route history
[Link](newPosition);
}, 15000);
Best for: Custom web maps with thousands of moving points.
B. Mapbox: The Designer's Choice
Features:
Studio editor for custom basemaps
3D terrain visualization
Isochrones (show "30-minute travel radius")
Example: Coffee shop site selection:
Basemap: Light gray, streets faint
Overlay 1: Population density heatmap
Overlay 2: Existing competitors (red dots)
Overlay 3: 10-minute walk circles from potential sites
Result: See underserved areas visually
4.3 NETWORK VISUALIZATION
1. What Are We Really Visualizing?
Networks show relationships. The magic happens in the structure between
nodes.
Healy's Insight: "A network visualization should reveal the social structure—not
just who knows whom, but who bridges groups, who holds power, where clusters
form."
2. Network Types with Examples
A. Social Networks
Example: Twitter retweet network during elections:
Nodes: Twitter users
Edges: Retweets
Finding: Tight clusters around candidates, few bridges between them →
"echo chambers"
Visual Encoding:
text
Trump Cluster Biden Cluster
🔴───────────🟦 🔵───────────🔵
🔴\ /🟦 🔵\ /🔵
🔴\ /🟦 🔵\ /🔵
🔴 ❌─────🟦🟦 🔵 ❌─────🔵🔵
🔴 | Bridge! | 🔵 | Dense core |
🔴 🟦─────❌🟦 🔵 🔵─────❌🔵
🔴/ \🟦 🔵/ \🔵
🔴/ \🟦 🔵/ \🔵
🔴───────────🟦 🔵───────────🔵
Key: 🔴=Trump supporter, 🔵=Biden supporter
❌=Influential user who bridges groups
───=Retweet connection
B. Biological Networks
Example: Protein-protein interaction network:
Nodes: Proteins
Edges: Known interactions
Color nodes by which disease they're associated with
Size nodes by number of connections (degree centrality)
Finding: Some proteins connect multiple disease clusters → potential drug
targets
C. Transportation Networks
Example: Delhi Metro system as network:
Nodes: Stations
Edges: Tracks between stations
Color lines by metro line
Size nodes by passenger traffic
Layout: Force-directed to minimize edge crossings
Insight: See which stations are critical connectors (change of color = transfer
points)
3. The "Hairball" Problem & Solutions
Problem: Too many edges → unreadable spaghetti.
Healy's Solutions:
1. Filter aggressively: Show only top 50 most connected nodes
2. Aggregate: Group similar nodes (all "retweet bots" become one super-node)
3. Edge bundling: Route edges together like highway lanes
4. Interactive filtering: Let users decide what to see
4. Layout Algorithms Explained
Force-Directed Layout (Most Common)
Metaphor: Nodes repel like magnets, edges pull like springs.
python
# Pseudo-visual of algorithm steps
Step 1: Random positions Step 3: After iterations
••••••• 🔵──🔵 🔵
••••••• | /
••••••• 🔵──🔵──🔵
/ |
Step 2: Forces apply 🔵 🔵──🔵
🔵 🔵 🔵
| | | Clusters emerge naturally
🔵--🔵--🔵 Bridges become visible
| | |
🔵 🔵 🔵
Use when: Exploring unknown network structure.
Circular Layout
Example: Email network in a company:
CEO at center
Departments in rings around
Edge thickness = number of emails
Insight: Marketing talks to Sales a lot, Engineering talks mostly to itself
Hierarchical (Tree) Layout
Perfect for: Organization charts, phylogenetic trees, file systems.
Healy's Tip: "Use indented lists for deep hierarchies. Trees work best when depth ≤
5."
5. Metrics That Matter
A. Degree Centrality
"Popularity contest" - How many connections?
Example: In Facebook network, degree = friend count.
B. Betweenness Centrality
"Bridge score" - How many shortest paths go through you?
Real Example: In drug trafficking network, low-degree nodes with high betweenness
= critical smugglers.
C. Modularity
"Community detection" - How clustered is the network?
Visual Output:
text
High Modularity Low Modularity
[🔴🔴🔴] [🔵🔵🔵] 🔴🔵🔴🔵🔴🔵
[🔴🔴🔴] [🔵🔵🔵] 🔵🔴🔵🔴🔵🔴
Clear clusters Well-mixed
(Echo chambers) (Integrated network)
6. Tools Comparison
Gephi: The Analyst's Playground
Workflow:
1. Import emails (CSV of senders→receivers)
2. Run Force Atlas 2 layout
3. Color by modularity class (auto-detects teams)
4. Size by degree (who emails most people)
5. Filter to show only betweenness > 100 (key connectors)
6. Export as interactive web visualization
Best for: One-time analysis, beautiful static images.
Cytoscape: The Biologist's Lab
Special Features:
Import protein data from online databases
Overlay gene expression heatmaps on nodes
Run statistical tests on network properties
Plugin for heat diffusion (simulate information spread)
Example Discovery: "Proteins associated with Alzheimer's form a tight subnetwork
with 3 highly-connected hubs → potential multi-target therapy."
HEALY'S GOLDEN RULES FOR UNIT IV
1. Interactivity Rule: "Add interactivity when your data has multiple stories to
tell, or when different viewers have different questions."
2. Map Rule: "Never map counts without normalizing. A map of 'total trees' just
shows where land is, not where trees are dense."
3. Network Rule: "If you can't see structure in 10 seconds, filter more. Network
viz is about patterns, not plotting every connection."
4. Tool Choice Rule: "Bokeh for streaming, Plotly for sharing, Leaflet for web
maps, Gephi for analysis, Cytoscape for biology. Pick the tool that matches
your audience's needs, not your skills."
PROJECT IDEAS (Unit IV Focus)
1. Interactive: "COVID-19 Explorer" - Slider for time, dropdown for countries,
linked map+chart+table.
2. Geographic: "Food Desert Map" - Choropleth of income, points of
supermarkets, 1-mile walk circles.
3. Network: "Wikipedia Game Pathfinder" - Network of article links, find shortest
path between "Quantum Physics" and "Beyoncé".
Healy's Final Advice: "Advanced visualization isn't about using every feature. It's
about choosing the right one advanced technique that makes your data's story
clearer."
Visualization Examples Checklist for Your Notes:
Force-directed network with communities colored
Choropleth vs Cartogram comparison
Linked brushing between scatter plot and histogram
Map with proportional symbols + tooltips
Interactive timeline with play button
Edge-bundled network to reduce hairball
Small multiples of maps for comparison
3D surface plot with rotation control
Tree map with zoom levels
Sankey diagram of flow between categories
Based on principles from Kieran Healy's "Data Visualization: A Practical
Introduction," emphasizing clarity, purposeful design, and matching visualization
techniques to the data's inherent structure and the audience's needs.