Visualization
Visualization
Visualization
Grupo de Bioingeniería
y Telemedicina
Principles of Visualization
Poor Visualizations
Reference: Dong E, Du H, Gardner L. An interactive web-based dashboard to track COVID-19 in real time. Lancet Infect Dis; published onli
Feb 19. https://doi.org/10.1016/S1473-3099(20)30120-1
https://www.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6
https://nssac.bii.virginia.edu/covid-19/dashboard/
Open data about cancer
http://gco.iarc.fr/
Definition – Visual analytics
Visualization of Big Data helps to the comprehension and communication of the data
Better decision making
Interactive plots help to explain ideas and relationships in the data
*Thomas, J., Cook, K.: Illuminating the Path: Research and Development Agenda for Visual Analytics. IEEE-Press (2005)
**D. Keim, G. Andrienko, et al. “Visual Analytics: Definition, Process, and Challenges”. A. Kerren et al. (Eds.): Information Visualization,
LNCS 4950, pp. 154–175, 2008. Springer-Verlag Berlin Heidelberg 2008
Introduction– Visual analytics (II)
Emerged as a response to the ‘information overload’ problem
Decision makers are bombarded with irrelevant information or inappropriate
data
Allows the exploration of data:
Visualization and theoretical models to generate new knowledge
Result:
Interactive Graphical interfaces
Trends of data
Changes in data over time
Use:
To communicate the message to non-expert users
Introduction– Visual analytics (III)
Visual analytics focuses on:
Analytical techniques allowing comprehensive insights and support in decision
making
Interactive techniques and visual representations
Techniques used for production, presentation and communication of the
analytical reasoning in a specific context for a targeted audience
Transformations and representations of data to support analysis and
visualization
Quantitative visualization (E.g. perform measurements directly on the visualization of
data)
Different views of the data where different representations of the same data
can uncover different patterns
Collaborative aspects
Visual Analytics Process
Thomas, J., Cook, K.: Illuminating the Path: Research and Development Agenda for Visual Analytics. IEEE-Press (2005)
Principles of Visualization
Framework to design visualization and evaluation
Domain of application
Characterize the problem and the available data. What? Who are the target users?
Map Data and Tasks into abstract operations
Translate from specifics of domain to vocabulary of visualization
Data Abstraction: What data needs to be shown?
It could be necessary to transform the data
Task Abstraction: Why is the user looking at it?
Interaction and Visual encoding: How is it shown?
Interaction: how to manipulate the data? Domain
Visual encoding idiom: how to draw? Data/ Task Abstraction
Data types:
Attributes, Items, Links, positions, grids
Dataset types:
Spatial Data
Tables Networks Fields Geometry Clusters,
and Trees (Continuous) Lists
Attributes Grids
Attributes Items Items
(columns)
Positions
Items Items
Positions
(Rows) (nodes)
Links Attributes
Dataset availability:
Static vs Dynamic
Data Abstractions (II)
Attribute types
Categorical: ▲ ♥ ♦ ♠ ♣
No explicit order, it could imply a hierarchy
Ordered:
Ordinal S, M, L, XL
Quantitative
Ordering direction:
Sequential
Diverging
Cyclic
Domain
Data/ Task Abstraction
Task Abstractions – Interaction and visual encoding
Algorithm
Why analyze data?
Associated Actions: Why is the user looking at it?
Analyze:
High-level choices
Discover, present, derive,…
Search information
Find a known/unknown item
Query:
Find out about characteristics of an item
Identify, compare, summarize
Domain
Data/ Task Abstraction
Task Abstractions – Interaction and visual encoding
Algorithm
Why analyze data?
Targets: Aspects of interest for the users
What data is being used?
All the dataset:
Trends, outliers, features
Some attributes:
Correlation, similarity, dependency,…
https://www.paho.org/data/index.php/en/mnu-topics/indicadores-
dengue-en/dengue-nacional-en/252-dengue-pais-ano-en.html?start=2
Domain
Data/ Task Abstraction
Methods to design visualizations – Interaction and visual encoding
Algorithm
How is data shown?
How to build graphical representations to allow manipulation of
data:
Encode
Arrange or order data, Map channels (color, hue…)
Manipulate
Change, Select, Navigate
Facets
Juxtapose, partition, superimpose
Reduce
Filter, aggregate, embed
Domain
Data/ Task Abstraction
Encode Interaction and visual encoding
Algorithm
Separate
Order
Align
Scatterplot
Express values
Quantitative attributes
Data
2 quantitative attributes
Mark:
Point
Channels
Horizontal + Vertical position
Tasks
Find trends, outliers,
distribution, correlation,
clusters
Scalability
Hundreds of items A layered grammar of graphics. Wickham. Journ. Computational and Graphical Statistics 19:1 (2010), 3–28
Categorical Regions
Geometry
Geographical data
Other geometries derived from the data
Spatial Fields
Scalar fields
One value per cell
https://blog.rtwilson.com/john-snows-famous-cholera-analysis-data-in-modern-gis-formats/
Geographical data
Choropleth Maps
Coloring scheme (different colors or
a graduated color scale) inside defined
areas on a map
Aim: understand spatial relationships
Data
Geographic geometry
Table with 1 quantitative attribute per
region
Encoding
Use given geometry for area mark
boundaries
Sequential segmented color map
Geographical data
Choropleth Maps
Pros:
Used to report area values at any scale, from global to local
Helpful for finding intriguing hot spots, detecting relationships between the encoded
variable and geographic location (and the many variables entangled with location), or
letting people know how their area compares with others
Cons:
The viewer can not gain detailed information on any area’s internal conditions
It can be solved by making the map interactive
The areas are not uniform:
Show the visual importance of each county with its geographic area rather than with the
number of people living in there, giving sparsely populated areas great visual emphasis
Arrange networks and trees
Node-link diagrams:
Trees and networks
Adjacency matrix:
Trees and networks
Enclosure:
Trees
Node-Link Diagrams:
Radial node-link tree
Encoding
Link connection marks
Point node marks
Radial axis orientation
Angular proximity: siblings
Distance from center: depth in
tree
Tasks
Understanding topology,
following paths
Scalability
1K - 10K nodes
Implements the Reingold-Tilford algorithm for efficient, tidy arrangement
of layered nodes. The depth of nodes is computed by distance from the
root, leading to a ragged appearance
http://mbostock.github.com/d3/ex/tree.html
Example radial
node-link tree
Phylogenetic tree of the bacterial
domain
Identify evolutionary relationships
among organisms or groups of
organisms
Based on a concatenated alignment
of 31 broadly conserved protein-
coding genes
46
Node-Link Diagrams: Force-directed
placement
Use of lines to represent links and to connect items
Visual encoding
Link: connection marks, Node: point marks
Spatial position: no meaning directly encoded
Free to minimize crossings
Proximity semantics?
Sometimes meaningful
Sometimes arbitrary
Tension with length
Long edges more visually salient than short http://mbostock.github.com/d3/ex/force.html
https://commons.wikimedia.org/wiki/File:The_protein_interaction_net
work_of_Treponema_pallidum.png
Adjacency matrix
Data
Network Henry, Fekete, and McGuffin. IEEE TVCG (Proc.
InfoVis) 13(6):1302-1309, 2007
Transform into same data/encoding as NodeTrix: a Hybrid Visualization of Social Networks.
heatmap
Derived data: table from network
1 quantitative attribute
Weighted edge between nodes
2 categorical attributes: node list x 2
Visual encoding
Cell shows presence/absence of edge
Use of triangular matrix with links with no
direction
Scalability
Points of view: Networks. Gehlenborg and Wong. Nature Methods 9:115
1K nodes, 1M edges
Example
Protein – protein
interaction network
in hepatoma cells
A: Network
B,C: Curated host-
host protein
interactions from
the CORUM
database
https://www.researchgate.net/figure/A-Complete-HCV-Host-Protein-Protein-Interaction-Network-in-Hepatoma-Cells-A-
Network_fig2_271220492
"Elderly population in Europe ".
- Coloured rectangles represent the ratio of elderly
Enclosure: Treemaps people ("age group 65 and above") population
- The size of each rectangle in the Treemap
represents the "Total Population"
Encoding
Area containment
marks for hierarchical
structure
Rectilinear orientation
Size encodes
quantitative attributes
Scalability
1 M leaf nodes
Example:
Analyze statistical data
per country
http://ncva.itn.liu.se/education-geovisual-analytics/treemap?l=en
http://mitweb.itn.liu.se/GAV/dashboard/#story=data/nuts-regions-ageing-
population-in-europe-2010.xml&layout=[map,treemap]
Example: Treemap
Fertility rates
according to the total
population of each
country
https://ncva.itn.liu.se/education-geovisual-analytics/treemap?l=enhttp://mitweb.itn.liu.se/GAV/dashboard/#story=data/nuts-regions-ageing-population-in-europe-
2010.xml&layout=[map,treemap]
Color: Luminance, Saturation, Hue
Hue
Color in categorical vs ordered data
Algorithm
Algorithm
Filter
Advantages: straightforward and intuitive to understand and compute
Disadvantages: out of sight, out of mind
Aggregation
Advantages: inform about whole set
Disadvantages: difficult to avoid losing signal
Visual information seeking: Tight coupling of dynamic query filters with starfield displays. Ahlberg and Shneiderman. Proc. ACM Conf. on Human
Factors in Computing Systems (CHI), pp. 313–317, 1994
Example Facets
Titanic survival
Poor visualizations
Poor visualizations
#1 #2
In #1, which one has bigger
percentage, C or D?
103
References
Brehmer and Munzner “A Multi-Level Typology of Abstract Visualization Tasks”. IEEE Trans.
Visualization and Computer Graphics (Proc. InfoVis) 19:12 (2013), 2376–2385.
T. Munzner. “Visualization Analysis and Design”. AK Peters Visualization Series, CRC Press, 2014
Ware. “Information Visualization: Perception for Design”, 3rd edition. Morgan Kaufmann
/Academic Press, 2004
Amar, Eagan, and Stasko. Low-Level Components of Analytic Activity in Information Visualization.
Proc. IEEE InfoVis 2005, p 111–117.
Heer and Shneiderman. “A taxonomy of tools that support the fluent and flexible use of
visualizations”. Communications of the ACM 55:4 (2012), 45–54.
Munzner. “A Nested Model of Visualization Design and Validation”. IEEE TVCG 15(6):921-928, 2009
(Proc. InfoVis 2009)
Cookbook for R. Graphs with ggplot2. http://www.cookbook-r.com/Graphs/
Aigner, Miksch, Schumann, and Tominski. “Visualization of Time-Oriented Data”. Springer, 2011
Daniel Keim, Gennady Andrienko, Jean-Daniel Fekete, Carsten Görg, Jörn Kohlhammer, and
Guy Melançon. “Visual Analytics: Definition, Process, and Challenges”. A. Kerren et al. (Eds.):
Information Visualization, LNCS 4950, pp. 154–175, 2008. Springer-Verlag Berlin Heidelberg 2008
Practising with Rstudio &
Notebooks
Configure the working directory
https://www.rgonzo.us/shiny/apps/textanalysis/
Shiny
Environment to allow creating interactive applications in R
Allows online publishing of visualization tools (Web server)
Used with the RStudio software
> install.packages("shiny")
library(shiny)
ui <- fluidPage(
…
)
server <- function(input, output, session) {
…
}
shinyApp(ui, server)
ui.R scripts
The function fluidPage() creates a display that automatically adjusts to the dimensions of the
user’s browser window
The interface is laid out by by placing elements in the fluidPage() function
Simple user-interface with a title panel and a sidebar layout, which includes a sidebar panel
and a main panel:
ui <- fluidPage(
titlePanel("title panel"),
Other options available:
sidebarLayout(
Format text: h1(“Title”)
sidebarPanel( "sidebar panel"),
Add widgets
mainPanel("main panel") Add Tab panels
) Add navigation bars
)
Adding reactivity
server.R
Contains the code to generate output results answering to the user’s interaction in the
User Interfaces
Reactive output automatically responds when the user interacts with a widget
Different types of functions are available:
Ui.R Output functions Server.R Render Functions
htmlOutput -> rawHTML renderUI a Shiny tag object or HTML
imageOutput -> image renderImage images (saved as a link to a source file)
plotOutput -> plot renderPlot plots
tableOutput -> table renderTable dataframe, matrix, other table like structures
textOutput -> text renderPrint any printed output
uiOutput -> rawHTML renderText character strings
Example basic Shiny app (I)
shiny::runExample("01_hello")
Other examples:
http://Shiny.rstudio.com/gallery/
https://shiny.rstudio.com/tutorial/
https://shiny.rstudio.com/gallery/hospital-data-antimicrobial.html