Visualization II: Design, Exploration, Techniques and Systems

Chapter 14: Visualization II

← All chapters

Chapter 14 of 14
Visualization II: Design, Exploration, Techniques and Systems

Design, complex information spaces, captions, space perception, visual analysis and interaction techniques, systems, and Labs 13 and 14.

This final chapter completes Unit V. It covers the principles of visual design, exploring complex information spaces, captions and the mapping from data objects to visual objects, space perception, explaining with images, narrative and gestures, visual data analysis and interaction techniques, visualization systems and applications, and the two visualization labs. Each topic has a worked example.

14.1 Design

Good visual design starts by knowing the audience and the question, and then choosing the representation that best supports that task. The chart type should match the purpose: bars for comparison, lines for trends over time, histograms or box plots for distributions, scatter plots for relationships, and stacked bars (or a pie only for two or three parts) for parts of a whole. Edward Tufte's principle of maximising the data–ink ratio — the share of ink that shows data — means removing chart junk such as heavy gridlines, 3-D effects, shadows and decorations. Pre-attentive features should be used for emphasis, but sparingly: one highlighted item stands out, five do not. Colour should be used carefully, with a few distinct hues for categories, sequential or diverging scales for numbers, and palettes that are safe for colour-blind readers. Scales must be honest: bars start at zero, and charts to be compared share the same scale. Labels should be clear: a title that states the finding, axes labelled with units, and direct labels instead of distant legends where possible. Finally, interactive designs should support overview, zoom, filter and details on demand.

Worked example – improving the data–ink ratio. A 3-D bar chart uses 1,000 units of ink, of which 400 draw the bars themselves.

  1. Data–ink ratio = 400 / 1,000 = 0.40.
  2. Removing the 3-D sides (250), the background fill (150) and half the gridlines (100) leaves 1,000 − 500 = 500 units, of which the bars still use 400.
  3. New ratio = 400 / 500 = 0.80. The chart now shows the same data with half the ink, and the bars are easier to compare because the 3-D perspective no longer distorts their heights.

14.2 Exploration of complex information space

Complex information spaces — large hierarchies, networks, document collections and multidimensional datasets — cannot be shown completely in one view, so tools provide ways to explore them. Overview + detail shows a small overview window beside a detailed main view, with a rectangle marking the visible region. Focus + context magnifies the area of interest while keeping its surroundings visible in compressed form, as in fisheye views and hyperbolic trees. Zooming may be geometric (simply enlarging) or semantic (showing more kinds of detail as the user zooms in). Dynamic queries use sliders and check-boxes that filter the display instantly. Brushing and linking highlights a selection in all coordinated views. Hierarchical aggregation lets the user drill down from summary to detail. Spatial layouts organise abstract data for exploration: treemaps for hierarchies, force-directed layouts for networks, and dimensionality reduction (PCA, t-SNE) for high-dimensional data.

Worked example – a fisheye view by degree of interest. Furnas's fisheye view shows a node only if its degree of interest DOI = API − D exceeds a threshold, where API is the node's a-priori importance (here, minus its depth in the tree) and D is its distance from the current focus.

Node Depth API = −depth Distance D from focus DOI = API − D Shown if DOI ≥ −4
Root 0 0 2 −2 Yes
Focus's parent 1 −1 1 −2 Yes
Focus 2 −2 0 −2 Yes
Sibling's child 3 −3 2 −5 No
Distant leaf 4 −4 5 −9 No

Nodes near the focus and important high-level nodes stay visible, while distant detail is hidden — so the user keeps both focus and context in a limited space.

14.3 Figure captions in visual interfaces; visual objects and data objects

Figure captions. A caption is text attached to a visual that tells the reader what to look at and what it means. Words and images complement each other: the image shows patterns and relationships at a glance, while the caption provides context, units, the data source and the key message. A good caption states the finding ("Sales doubled after the price cut") rather than only naming the topic ("Sales by month"), explains the encodings (what colour and size mean), and sits close to the figure so that the eye does not have to travel far. In interactive interfaces, captions take the form of titles, tooltips, annotations and legends, and they should update automatically as the view changes.

Visual objects and data objects. A data object is an entity in the data — a customer, a city or a transaction — described by its attributes. A visual object is the graphical mark that represents it — a dot, bar, node or region — with visual properties such as position, size, colour and shape. Visualization is the mapping from data objects to visual objects, and from data attributes to visual properties. A good mapping makes each visual object perceived as a single whole, and makes related data objects look related, by giving them the same colour, grouping them, or connecting them.

Data object attribute Visual object property
Category (e.g. product type) Colour hue, shape
Quantity (e.g. sales) Position, length, size
Order (e.g. rating) Lightness, size
Relationship (e.g. friendship) Connecting line, enclosure

Worked example – mapping cities to circles. Three data objects (cities) have populations of 4 million, 1 million and 0.25 million, and each is drawn as a circle whose area represents population.

  1. Area must be proportional to population, so the radius must be proportional to √population.
  2. With the largest radius set to 40 px: r = 40 × √(population / 4), giving 40 × √1 = 40 px, 40 × √0.25 = 20 px and 40 × √0.0625 = 10 px.
  3. Check: areas are proportional to r², i.e. 1,600 : 400 : 100 = 16 : 4 : 1 — exactly the population ratio 4 : 1 : 0.25.
  4. A common mistake is to make the radius proportional to population (40 : 10 : 2.5 px), which makes the largest city look 16 times bigger instead of 4 — a lie factor of 4.

14.4 Space perception and data in space

Humans perceive depth and three-dimensional space through depth cues. Occlusion tells us that a nearer object hides a farther one; linear perspective makes parallel lines converge in the distance; relative size makes distant objects look smaller; shading and shadows reveal shape; texture gradients become finer with distance; motion parallax makes nearer objects move faster across the view as we move; and stereoscopic vision uses the slightly different images from our two eyes. When data has a natural spatial position — maps, 3-D medical scans, molecules, buildings — placing it in space uses these powerful cues to good effect. For abstract data, however, 3-D usually harms accuracy: occlusion hides some marks, and perspective distorts lengths and areas, so exact comparison becomes harder. Two-dimensional layouts are therefore usually preferred for abstract data, with 3-D reserved for genuinely three-dimensional structures. In any layout, position is the strongest encoding, and proximity implies relationship (the Gestalt law of proximity).

Worked example – perspective distortion in a 3-D bar chart. In perspective, apparent size is inversely proportional to distance. Two bars of equal height, 10 cm, are drawn at depths of 1 m and 2 m in a 3-D chart.

  1. The farther bar appears 10 × (1 / 2) = 5 cm tall — half the height of the nearer bar.
  2. A reader sees one bar as twice the other, although the data values are equal: a lie factor of 2.
  3. In a 2-D bar chart both bars are drawn 10 cm tall and compared correctly.

14.5 Images, narrative and gestures for explanation

Visualization explains best when it is combined with other channels of communication. Images are best at showing structure, patterns and spatial relationships — the "what" and "where" — at a glance. Narrative, in spoken or written words, is best at explaining causes, sequences, conditions and abstract logic — the "why" and "so what". Narrative visualization (data storytelling) combines the two, guiding the reader through a story with annotated charts, slide sequences or scrolling articles (scrollytelling), typically moving from context, through the key finding, to its implication. Gestures — pointing and tracing in a live presentation, or animated highlights and cursors on screen — link the spoken words to the exact part of the image being discussed, directing attention where it is needed at that moment. The most effective explanations use images and words together, linked by gestures or annotations, so that each channel does what it does best.

Worked example – turning a chart into a three-step story using the sales data of section 1.8.

  1. Context (image + narration): show total sales for January–March with the sentence "Sales were steady at about ₹100 lakh a month."
  2. Finding (image + gesture): highlight the March point and point to it — "In March they fell 15%, to ₹85 lakh." Then split the line by region and trace the East line with a gesture or animation — "All of the fall came from the East, which halved from 30 to 15."
  3. Implication (narration + annotation): add an annotation at March East, "Competitor opened two stores", and conclude: "A targeted East-region response protects the 70% of sales that were unaffected."
  4. The audience sees the pattern in the image, understands the cause from the narrative, and knows where to look because of the gesture — three channels working together.

14.6 Visual data analysis techniques

Visual data analysis (visual data mining) brings the human into the data-exploration process: the data is shown in visual form so that the analyst can spot patterns, gain insight and form hypotheses directly, often before any algorithm is applied. Daniel Keim classified visual data analysis techniques along three dimensions — the type of data to be shown (one-dimensional, two-dimensional, multidimensional, text, hierarchies and graphs, algorithms and software), the visualization technique used, and the interaction and distortion techniques applied (section 14.7). The main families of visualization technique are as follows. Standard 2-D and 3-D displays are the familiar bar charts, line graphs, scatter plots and pie charts. Geometrically transformed displays find informative transformations of multidimensional data: the scatter-plot matrix shows every pair of variables, and parallel coordinates draw each variable as a vertical axis and each record as a line (a polyline) crossing all the axes, so that clusters and correlations appear as bundles and crossing patterns. Iconic (glyph) displays map each record's attributes to the features of a small icon — Chernoff faces (eyes, mouth, nose), star glyphs (spokes of different lengths) or stick figures — so that similar records look alike. Dense pixel displays map each data value to one coloured pixel and arrange the pixels in patterns (recursive patterns, circle segments), showing the largest amount of data in the available space. Stacked displays show hierarchical data or partition the data by nesting one coordinate system inside another — treemaps, which fill a rectangle with nested rectangles whose areas represent values, and dimensional stacking.

Technique family Examples Best for
Standard 2-D / 3-D Bar, line, scatter, pie Few variables
Geometrically transformed Scatter-plot matrix, parallel coordinates Multidimensional data, correlations, clusters
Iconic (glyphs) Chernoff faces, star glyphs Comparing records with many attributes
Dense pixel Recursive pattern, circle segments Very large datasets
Stacked Treemap, dimensional stacking Hierarchies, nested categories

Worked example 1 – placing a record on parallel coordinates. Three axes, each 300 px tall, are scaled by min–max over the dataset: mpg ranges 10–34, horsepower 50–335 and weight 1.5–5.4 tonnes. Car A has mpg 30, horsepower 100 and weight 2.2 t.

  1. mpg: (30 − 10) / (34 − 10) = 20 / 24 = 0.833 → 0.833 × 300 = 250 px from the bottom.
  2. Horsepower: (100 − 50) / (335 − 50) = 50 / 285 = 0.175 → 53 px.
  3. Weight: (2.2 − 1.5) / (5.4 − 1.5) = 0.7 / 3.9 = 0.179 → 54 px.
  4. Car A's polyline runs high on mpg and low on horsepower and weight. When many cars are drawn, lines that cross sharply between the mpg and weight axes reveal the strong negative correlation between the two (r ≈ −0.87 in mtcars, section 2.5).

Worked example 2 – a slice-and-dice treemap. Four departments have sales of ₹50, ₹25, ₹15 and ₹10 lakh (total ₹100 lakh), drawn in a 400 × 300 px rectangle (120,000 px²).

  1. Each department's area = its share × 120,000: 60,000, 30,000, 18,000 and 12,000 px².
  2. Slicing the rectangle vertically (height 300 px), the widths are area / 300 = 200, 100, 60 and 40 px.
  3. The largest department visibly fills half the space, and nested rectangles inside each slice can show its products in the same way, so the whole hierarchy fits in one view.

14.7 Interaction techniques

Interaction techniques let the analyst change the view directly and immediately, turning a static picture into a tool for exploration. Keim lists five main techniques. Dynamic projections change the projection of multidimensional data continuously, for example the grand tour, which animates through many 2-D projections so that the analyst can watch structure appear. Interactive filtering narrows the data shown, either by browsing (selecting items directly) or by querying (specifying conditions, often with dynamic-query sliders that update the display instantly). Interactive zooming shows more detail as the user zooms in — not only enlarging the picture but also changing its representation (semantic zoom). Interactive distortion magnifies a region of interest while keeping the rest visible in compressed form, as in fisheye views, perspective walls and hyperbolic trees. Interactive linking and brushing connects several views of the same data, so that items selected (brushed) in one view are highlighted in all the others. Yi and colleagues group user intents into seven categories: select (mark something as interesting), explore (show something else), reconfigure (show a different arrangement), encode (show a different representation), abstract/elaborate (show more or less detail), filter (show something conditionally) and connect (show related items).

Worked example 1 – dynamic queries. A housing dataset has 1,000 houses. The analyst moves two sliders:

  1. Price slider set to ₹30–60 lakh: the scatter plot redraws instantly to show, say, 380 houses.
  2. Bedrooms slider set to ≥ 3: 140 houses remain — 14% of the data — and the analyst sees at once that they cluster in two localities.
  3. Each slider movement triggers a new query and redraw; if the redraw takes under about 0.1 s (section 13.7), the analyst experiences it as direct manipulation rather than as a series of queries.

Worked example 2 – fisheye distortion. A common fisheye function (Sarkar and Brown) maps a normalised distance x from the focus (0 to 1) to a new distance g(x) = (d + 1)x / (dx + 1), where d is the distortion factor. With d = 3:

  1. x = 0.1 → g = (4 × 0.1) / (0.3 + 1) = 0.4 / 1.3 = 0.308: items near the focus are spread 3.1 times farther apart — magnified.
  2. x = 0.5 → g = 2.0 / 2.5 = 0.800.
  3. x = 0.9 → g = 3.6 / 3.7 = 0.973: items near the edge are squeezed together but remain visible.
  4. The focus gets more screen space while the context stays on screen — focus + context in one view.

Worked example 3 – brushing and linking. A dashboard shows a scatter plot of customer age against spending and a bar chart of customers by city. The analyst brushes the 120 customers aged 25–35 who spend more than ₹50,000. The linked bar chart instantly highlights how those 120 split by city — for example 70 in Lucknow, 30 in Kanpur and 20 elsewhere — revealing that the high-spending young segment is concentrated in one city.

14.8 Visualization systems and applications

Visualization systems range from point-and-click business tools to programming libraries and specialised scientific packages. Business intelligence and dashboard tools — Tableau, Microsoft Power BI, Qlik Sense and Looker — let users connect to data, build interactive dashboards by drag and drop, and share them. Programming libraries give full control and reproducibility: in R, ggplot2, plotly, leaflet and Shiny (for interactive web applications); in Python, matplotlib, seaborn, plotly and Bokeh; and on the web, D3.js. Open-source monitoring and exploration platforms such as Apache Superset, Grafana and Kibana (part of the Elastic stack) are widely used for live operational dashboards. Specialised systems serve particular data types: QGIS and ArcGIS for geographic data, Gephi and Cytoscape for networks, and ParaView and VTK for 3-D scientific data.

Visualization is applied in almost every field. In business, dashboards track sales, KPIs and customer behaviour. In finance, traders watch real-time price charts and heat maps of market movements. In healthcare and epidemiology, maps and time-series charts track disease spread and hospital capacity. Smart cities and transport use live maps of traffic and public transport. Cyber security and IT operations monitor network traffic and server metrics to spot attacks and failures. Science and engineering visualise simulations, medical scans and climate models. Journalism and social media use interactive graphics to explain stories, and education uses visual explanations to teach.

System Type Typical application
Tableau, Power BI, Qlik BI dashboard tool Business reporting, KPIs
ggplot2 + Shiny (R) Library + web apps Statistical graphics, interactive apps
matplotlib, seaborn, plotly (Python) Library Data science notebooks
D3.js Web library Custom interactive web graphics
Grafana, Kibana, Superset Open-source platform Live operational dashboards
QGIS, ArcGIS GIS Maps, spatial analysis
Gephi, Cytoscape Network tool Social and biological networks
ParaView, VTK Scientific 3-D simulation and medical data

Worked example – a conversion-funnel dashboard. An e-commerce dashboard visualises one day of the customer journey.

Stage Users Conversion from previous stage Drop-off
Visited site 10,000 — —
Added to cart 1,200 1,200 / 10,000 = 12.0% 88.0%
Started checkout 600 600 / 1,200 = 50.0% 50.0%
Purchased 450 450 / 600 = 75.0% 25.0%
  1. Overall conversion = 450 / 10,000 = 4.5%.
  2. The largest drop-off is from visit to cart (88%), so the dashboard directs attention to product pages rather than to the payment step.
  3. If a page redesign raises add-to-cart to 15% while later rates stay the same, purchases become 10,000 × 0.15 × 0.50 × 0.75 = 563 — an increase of 113 orders a day, which the same dashboard will show the next day.

14.9 Visualization labs (R)

Lab 13 (R) – Cartographic visualization: countries of the world; states and districts of India

Aim: draw choropleth maps that colour regions by a data value.

install.packages(c("sf", "ggplot2", "rnaturalearth", "rnaturalearthdata", "geodata", "dplyr"))
library(sf); library(ggplot2); library(rnaturalearth); library(geodata); library(dplyr)

# 1. World map: countries coloured by population
world <- ne_countries(scale = "medium", returnclass = "sf")
ggplot(world) +
  geom_sf(aes(fill = pop_est / 1e6), colour = "white", linewidth = 0.1) +
  scale_fill_viridis_c(name = "Population (millions)", trans = "log10") +
  labs(title = "World population by country") +
  theme_minimal()

# 2. India states (level 1) from GADM
india_states <- st_as_sf(gadm(country = "IND", level = 1, path = tempdir()))
# Your own data: a CSV with columns NAME_1 (state name) and value
# state_data <- read.csv("state_data.csv")
state_data <- data.frame(NAME_1 = india_states$NAME_1,
                         value  = round(runif(nrow(india_states), 50, 100), 1))  # demo values
india_states <- left_join(india_states, state_data, by = "NAME_1")
ggplot(india_states) +
  geom_sf(aes(fill = value), colour = "grey40", linewidth = 0.2) +
  scale_fill_distiller(palette = "YlGnBu", direction = 1, name = "Value") +
  labs(title = "Indian states by indicator value") +
  theme_void()

# 3. Districts of one state (level 2), e.g. Uttar Pradesh
india_dist <- st_as_sf(gadm(country = "IND", level = 2, path = tempdir()))
up <- filter(india_dist, NAME_1 == "Uttar Pradesh")
up$value <- round(runif(nrow(up), 0, 100))   # replace with real district data
ggplot(up) +
  geom_sf(aes(fill = value), colour = "white", linewidth = 0.1) +
  scale_fill_viridis_c(option = "magma", name = "Value") +
  labs(title = "Uttar Pradesh districts") +
  theme_void()

Notes: replace the demo values with real data (census, health or election figures) joined on the state or district name; check that spellings match the GADM names. GADM's India boundaries may differ from official Survey of India boundaries — mention the source in the caption.

Lab 14 (R) – Text mining and word cloud

Aim: find and visualise the most important words in a set of documents (see section 2.7 for the text-analytics pipeline and TF-IDF).

install.packages(c("tm", "SnowballC", "wordcloud", "RColorBrewer"))
library(tm); library(SnowballC); library(wordcloud); library(RColorBrewer)

# 1. Load documents: every .txt file in a folder
docs <- VCorpus(DirSource("documents/", pattern = "\\.txt$"))

# 2. Clean the text
docs <- tm_map(docs, content_transformer(tolower))
docs <- tm_map(docs, removeNumbers)
docs <- tm_map(docs, removePunctuation)
docs <- tm_map(docs, removeWords, stopwords("english"))
docs <- tm_map(docs, stripWhitespace)
docs <- tm_map(docs, stemDocument)          # optional: reduce words to roots

# 3. Term-document matrix and word frequencies
tdm  <- TermDocumentMatrix(docs)
freq <- sort(rowSums(as.matrix(tdm)), decreasing = TRUE)
word_freq <- data.frame(word = names(freq), freq = freq)
head(word_freq, 10)

# 4. Bar chart of the top 10 words
barplot(word_freq$freq[1:10], names.arg = word_freq$word[1:10],
        las = 2, col = "steelblue", main = "Top 10 words", ylab = "Frequency")

# 5. Word cloud
set.seed(123)
wordcloud(words = word_freq$word, freq = word_freq$freq, min.freq = 2,
          max.words = 100, random.order = FALSE, rot.per = 0.3,
          colors = brewer.pal(8, "Dark2"))

# 6. TF-IDF weighting highlights words important to individual documents
tdm_tfidf <- TermDocumentMatrix(docs, control = list(weighting = weightTfIdf))
sort(rowSums(as.matrix(tdm_tfidf)), decreasing = TRUE)[1:10]

Independent study notes written in my own words, for learning purposes. Not affiliated with any university or course provider. R, RStudio, Hadoop, Amazon S3, Tableau, Power BI and other product names are trademarks of their respective owners.