Task Abstraction for Visualization Design
DS 2023 | Communicating with Data
Overview¶
Before choosing a chart type or writing any code, a visualization designer should answer the fundamental question: what is the user trying to accomplish?
Task abstraction is the practice of describing user intentions and goals at multiple levels of specificity — from a broad analytic purpose down to the precise data manipulations that purpose requires.
Task abstrction helps you design better visualizations, both static and interactive.
A chart, dashboard, or infographic built around clearly stated questions is easier to design, build, and evaluate than one built by intuition.
Visual Analytic Activity¶
The heart of task abstraction is the idea that user behavior can be conceptualized as a hierarchy of actions that go from abstract ideation and intent to concrete activity with a specific tool.
It describes in formal terms how we move from ideas to artifacts.
The Task Hierarchy¶
One conceptualization of this hierarchy comes from Gotz and Zhou (2008).
They de visual analytic activity in four tiers, from most abstract to most concrete.
| Tier | What it describes |
|---|---|
| Task | A high-level analytic goal, stated in domain terms |
| Sub-task | A specific analytical question that contributes to the task |
| Action | A concrete analytic move — a data or visualization operation |
| Event | A single software interaction that carries out the action |
Tasks¶
A task-level question describes what a user wants to accomplish in the data.
A well-formed task-level question is:
Independent of any specific chart or interaction. Do not name a chart type, a widget, or a gesture.
Meaningful to a domain expert. A public-health researcher should recognize it as a real question without knowing what a scatter plot is.
Open-ended enough to allow more than one design. If only one chart obviously answers it, the question is probably a sub-task in disguise.
Nouns and verbs can be mapped onto available data and known operations. This means avoid vague terms like “relate” or “most” and instead consider translating these into concepts like correlation or relative frequency. The language here will depend on the familiarity of the domain expert with statistical and scientific methods.
For example¶
Avoid: “Can the user select a country from a dropdown to see a bar chart of spending over time?”
This question names a widget (dropdown) and a chart type (bar chart). It skips past the analytic goal and lands directly on a design decision.
Aim for: “How has healthcare spending changed across countries over the past two decades?”
This describes the analytic goal without committing to any design. It could be answered with a line chart, a heat map, a choropleth, or a small-multiples display.
Sub-Tasks¶
A sub-task breaks a high-level question into a specific analytical components that need to be accomplished to answer the question.
This is because most tasks are compound.
Each sub-task is a concrete analytical question — such as, “what is the distribution of variable A?”. It focuses on a single facet or angle of the task that a single chart or computation could address.
Each sub-task must focus on it’s own angle.
Components may or may not have an obsvious sequence, but they should be doable in steps. They often feed into each other or get combined in later steps.
Again, as with tasks, a sub-task should be stated in plain language, without naming any chart type or widget.
Writing a Good Sub-Task¶
A good sub-task is specific enough that a single chart or computation could answer it, but abstract enough that it names no chart type or widget.
If it names a bar chart, a dropdown, or a filter button, it has slipped into design. Push it back up.
Worked Example¶
Task: How does a country’s healthcare spending relate to its citizens’ life expectancy?
| Sub-task question | |
|---|---|
| Sub-task 1 | Which countries achieve high life expectancy despite low spending? |
| Sub-task 2 | Does the relationship plateau above a certain spending threshold? |
Both sub-tasks address the same task from different angles. The first focuses on exceptions; the second on the shape of the overall relationship.
Actions¶
Actions, also called operations, are the specific data questions that serve a sub-task.
Each operation may be expressed as an Action–Target pair, since every action is directed toward something, called a target.
The Action itself is drawn from a vocubulary, such as Amar et al.'s ten analytic primitives (see table below).
The Target is the variable or data feature the action is applied to.
Note the two operations for the same task must use different primitives.
Action vocabularies¶
A well-known vocabulary for action verbs is from Amar, et al, 2005. These are called “analytic primitives”, where primitive means primary and irreducible.
| Action | The question it answers |
|---|---|
| Retrieve Value | What is the exact value of this item? |
| Filter | Which items satisfy a condition? |
| Compute Derived Value | What is an aggregate — a sum, average, or ratio? |
| Find Extremum | What is the maximum or minimum? |
| Sort | In what order do these items rank? |
| Determine Range | What are the minimum and maximum values overall? |
| Characterize Distribution | What is the overall shape of these values? |
| Find Anomalies | What is unusual or unexpected? |
| Cluster | Which items are most similar to one another? |
| Correlate | Do two variables move together? |
These are based on observed user interactions with data visualization tools.
Gotz and Zhou 2008 propose something more granular, based on grouping actions by intent.
| Data | Visual | |
|---|---|---|
| Exploration | Filter, Inspect, Query, Restore | Brush, Change-Metaphor, Change-Range (Zoom, Pan), Merge, Sort, Split |
| Insight | Create, Modify, Remove | Annotate, Bookmark |
Meta Actions (apply across the grid): Delete, Edit, Redo, Revisit, Undo
Targets¶
The Target names the data feature the action is applied to. Common targets:
| Target | What it refers to |
|---|---|
| Outliers | Values far from the norm |
| Trends | Patterns of change over time or across a dimension |
| Distributions | The spread and shape of a set of values |
| Clusters | Groups of similar items |
| Extrema | The maximum or minimum of a set |
| Correlations | Relationships between two or more variables |
Events¶
Finally, events are the hardware and software levers we pull to produce concrete results.
| Specific Action | Python (Pandas + Matplotlib) |
|---|---|
| Select | df[['x','y']] |
| Filter | df.query() |
| Sort | df.sort_values() |
| Split | unstack(), subplots=True |
| Change-Metaphor | plot.bar → plot.line |
| Zoom | set_xlim() |
| Annotate | annotate(), text(), axvline(), axhline() |
| Bookmark | savefig() |
A worked example¶
Task: How does healthcare spending relate to life expectancy?
| Sub-task | Operation question | Action | Target |
|---|---|---|---|
| Which countries achieve high life expectancy despite low spending? | Which countries spend less than $1,500 per capita on healthcare? | Filter | Spending |
| Does the relationship plateau above a certain threshold? | What is the average life expectancy at each spending level? | Compute Derived Value | Life Expectancy |
The two operations use different Amar primitives. Filter selects a subset of items; Compute Derived Value produces an aggregate across groups.
The Full Picture¶
Here is a complete hierarchy for one example.
Subtasks are coded as and actions as .
| Level | Question | Form |
|---|---|---|
| Task | How does healthcare spending relate to life expectancy? | Plain domain question |
| Which countries achieve high life expectancy despite low spending? | Specific analytical question | |
| Which countries spend less than $1,500 per capita? | Filter + Spending | |
| Does the relationship plateau above a certain spending threshold? | Specific analytical question | |
| What is the average life expectancy at each spending level? | Compute Derived Value + Life Expectancy |
Each level is more specific than the one above it.
The two sub-tasks approach the task from different angles.
The two operations use different Amar primitives.
Summary¶
A task is a high-level analytic goal, stated independently of any chart or interface.
A sub-task is a specific analytical question — one concrete angle on the task.
An action is an operation that can be expressed as an Action–Target pair, where the Action is an Amar et al. analytic primitive and the Target is the data feature it is applied to.
The two sub-tasks for the same task must approach it from different angles.
The two operations for the same task must use different Amar primitives.