Abstract
Modern visualization tools aim to allow data analysts to easily create exploratory visualizations. When the input data layout conforms to the visualization design, users can easily specify visualizations by mapping data columns to visual channels of the design. However, when there is a mismatch between data layout and the design, users need to spend significant effort on data transformation. We propose Falx, a synthesis-powered visualization tool that allows users to specify visualizations in a similarly simple way but without needing to worry about data layout. In Falx, users specify visualizations using examples of how concrete values in the input are mapped to visual channels, and Falx automatically infers the visualization specification and transforms the data to match the design. In a study with 33 data analysts on four visualization tasks involving data transformation, we found that users can effectively adopt Falx to create visualizations they otherwise cannot implement.
Introduction: The Data-Design Mismatch
Modern visualization grammars like ggplot2 or Vega-Lite are powerful, but they come with a strict prerequisite: input data must be perfectly structured—usually in a "tidy" format—to match the intended design. In practice, data is often "wide" when it needs to be "long," or vice versa. For example, to create a bar chart showing a temperature range, a tool might expect separate columns for MinTemp and MaxTemp. If the raw data stores these in a single column with a "Type" label, the user must manually perform complex "pivot" or "aggregate" operations.
This "data-design mismatch" creates a high barrier for novices and a tedious workflow for experts. Falx aims to bridge this gap by letting users focus on the output (the visualization) rather than the plumbing (data transformation).
Methods: Synthesis-Powered Authoring
Falx utilizes a Programming-by-Example (PBE) framework to automate visualization creation. The system architecture consists of three main stages:
- Visualization Decompilation: Users provide a few example mappings (e.g., "Value 63.4 maps to the y-axis of a line labeled 'New York'"). Falx decompiles these into a generic visualization program and an "example table" representing the ideal data structure for that plot.
- Data Transformation Synthesis: This is the core engine. Falx searches through a space of possible programs composed of common data operators like
pivot_longer,filter,mutate, andgroup_by. To ensure real-time performance, it uses abstract interpretation to prune "dead-end" programs that cannot satisfy the user's example. - Program Generation & Exploration: Since examples can be ambiguous, Falx often finds multiple valid visualizations. It presents these candidates in an exploration panel, allowing the user to select the one that matches their intent. Once selected, the tool generates the full R or Vega-Lite code.
Evaluation and Key Results
The authors evaluated Falx through a user study with 33 participants, ranging from novices to experienced R users. The study involved four distinct tasks: mapping disaster impacts, creating faceted energy usage heat maps, generating complex waterfall charts for car sales, and building layered timelines for movie awards.
The results demonstrated significant advantages over manual coding in R (tidyverse + ggplot2):
- Higher Success Rates: For the most difficult task (Car Sales), 68.8% of Falx users succeeded, compared to only 29.4% of R users.
- Significant Speedups: Falx users were significantly faster in complex tasks. For the "Electric Usage" task, Falx users finished an average of 329 seconds faster than the R group.
- Accessibility: Even participants with zero prior experience were able to solve challenging tasks after a brief 20-minute tutorial.
Discussion: A Paradigm Shift in Visualization
Falx represents a shift from "How do I reshape my table?" to "What does this specific data point look like in my chart?" By prioritizing recognition over expression, it allows users to identify the correct visualization from a list of candidates rather than requiring them to express the exact sequence of commands to create it.
Limitations and Future Work
While powerful, Falx currently assumes input data is "clean" (free of typos) even if poorly structured. It does not yet handle traditional data cleaning. Additionally, while excellent for rapid prototyping, users requiring "pixel-perfect" aesthetic tweaks may still need to manually edit the generated code. Future work includes integrating Falx into interactive environments like Jupyter Notebooks to support a hybrid workflow of synthesis and manual refinement.
Summary updated