Data Visualization

Tufte’s Principles and the Grammar of Graphics

Data Scientist at WIFO and Lecturer at WU

Tufte’s Principles

The Visual Display of Quantitative Information

  • Edward Tufte in 1983
    • history and development of information visualization
    • formulates principles of graphical integrity and principles of graphical excellence

The Visual Display of Quantitative Information

A Tool for Scientific Exploration

  • Broad Street cholera outbreak 1854
    • source of infection uknown
    • Dr John Snow draws map of cases
    • convinces authorities with map

Broad Street Cholera Outbreak

Broad Street Cholera Outbreak

Proportionality of Representation

The representation of numbers should be proportional to the numerical quantities represented.

Bad practice The Ugliest Chart

Radical makeover

Clear Labeling

Clear labeling should be used to defeat graphical distortion and ambiguity.

Show Data Variation

Show data variation, not design variation.

Quote in Context

Graphics must not quote data out of context.

No context

Time context

Time and country context

Interactive Contextualization

Let the user choose time context

Creating Ducks

It is all right to decorate construction but never construct decoration” — Pugin

Mobilization of Elements

Mobilize every graphical element, perhaps several times over, to show the data!

  • Legend is
    • color guide
    • histogram
    • range selection
    • unit selection
  • Scaling based on

Technological Phallacy

Occasionally designers seem to seek credit merely for possessing a new technology, rather than using it to make better designs

Bad practice The Ugliest Chart

Radical makeover

Graphical Excellency

…may well be the best statistical graphic ever drawn

Carte figurative des pertes successives en hommes de l’Armée Française dans la campagne de Russie 1812

Carte figurative des pertes successives en hommes de l’Armée Française dans la campagne de Russie 1812

Multivariate Representation

  • Six types of information in one chart:
    • number of troops
    • distance
    • temperature
    • latitude and longitude
    • direction of travel
    • location at spefic time

The Grammar of Graphics

The Grammar of Graphics

  • Leland Wilkinson in 1999
    • attempt to devise a structured logic for programming graphics
    • different implementations
  • Major concepts
    • aesthetics establish the relations of sensory attributes (color, shape, sound, etc.) to abstractions
    • attributes are represented by properties of geometries (e.g. circles, lines, …)
    • relations are determined by scales (e.g. logarithmic mapping of distances, color gradients, …)
    • composition of plots via layering, faceting and concatenating

The Grammar of Graphics

Plot of Plots

Comparison of different software packages for creating data visualization

Grammar of Graphics in Practice

  • Declarative specification
    • one template - almost any plot
    • specification of an object that renders into visualization
  • Data hygiene is key
    • long-formatted data or nested data
    • proper format of dates, numbers, strings
  • Number of visual dimensions should correspond to data dimensions
    • basics: x + y + color + size + shape + opacity
    • cheating: facets + inputs + annotations

Format Recommendations

  • Input formats:
    • small data: .csv, .json
    • large data: .parquet with duckDB
    • geodata: .topojson
  • Output formats:
    • online: .svg / .html
    • print: .svg or .png

Colors

  • Conflicts of interest
    • esthetical considerations
    • distinctiveness
    • inclusivity (color blindness)
  • Getting help

Interactive Elements

  • Reusage of elements for selection
    • clickable legends
    • cross selection over multiple views
  • Tooltips for labelling
  • Dynamic adaption of labels and text

Mobile view

More than 50 percent of global internet traffic is on mobile devices

  • Nice to have
    • fold of multiple views / facets
    • removing of elements
    • adaption of font sizes, element sizes, margins and paddings

Web Technologies

HTML

<h4>The resulting website: </h4>

<form method="GET">
  What is your name: 
  <input type="text" id="myname" />
  <button id="mybutton">Submit</button>
</form>

<div id="hellomessage"></div>

CSS

#mybutton {
  color: red;
  border-radius: 4px;
}

#hellomessage {
  font-weight: bold;
  font-family: "Century Gothic";
}

JavaScript

function ShowHelloMessage() {
  var name = document
    .getElementById("myname");
  document
    .getElementById("hellomessage")
    .innerHTML = "Hi, " + name.value;
}

document
  .getElementById("mybutton")
  .onclick = ShowHelloMessage;

The resulting website:

What is your name:

Geospatial Visualization

Would You Use this Projection?

Map Projections

Properties of Projections

  • Properties of projetions
    • equivalent (equal-area) — preserve size of area
    • conformal — preserve shape
    • equidistant — preserve distance
    • azimuthal — preserve direction
    • (gnomic — preserve shortest route)
  • Consider
    • No projection can preserve all the properties from above
    • Compromise projections try to keep distortion of all properties low
    • Graticule and Tissot’s indicatrix can help identify properties

Types of Projections

  • cylindrical
  • conic
  • azimuthal
  • polyhedral

Miscellaneous

Inspirations and Examples

Assignment (Seminar)

  • Radical makeover - your turn
    1. Find an ugly and disfunctional data visualization on the internet.
    2. Find the same or a similar dataset online.
    3. Make a better visualization!
    4. Reflect on why it is an improvement and how / if this connects to Tufte’s principles and the Grammar of Graphics
  • Due date: November 15th