Draco 2: An Extensible Platform to Model Visualization Design

Junran Yang, Péter Ferenc Gyarmati, Zehua Zeng, Dominik Moritz

TL;DR

Draco 2 is an updated, constraint-based framework that formalizes visualization design guidelines into actionable logical rules. By decoupling from specific visualization grammars and providing a robust Python-based ecosystem, it allows researchers to build, debug, and share automated visualization recommendation systems more easily than ever before.

What Problem Does This Paper Address?

Creating a "good" data visualization isn't just about aesthetics; it involves following complex design principles derived from graphical perception studies (e.g., "don't use a rainbow color map for quantitative data"). The original Draco (Draco 1) attempted to formalize these principles using Answer Set Programming (ASP), allowing a computer to "reason" about chart design.

However, Draco 1 had significant hurdles:

  1. Rigidity: It was tightly coupled with the Vega-Lite grammar, making it hard to use for other visualization types.
  2. Complexity: It required a messy mix of Python and JavaScript, making it difficult to install and integrate.
  3. Lack of Tooling: There was minimal documentation and no easy way to debug why the system recommended one chart over another.
  4. Limited Scope: It struggled with multi-view or layered visualizations.

Methods

The authors introduce Draco 2, which moves the framework from a single tool to a comprehensive research platform. Key technical shifts include:

  • Generalized Specification Format: Instead of mimicking Vega-Lite, Draco 2 uses a nested "Entity-Attribute" structure. This makes it "renderer-agnostic"—it can describe a chart's logic regardless of whether you eventually render it in D3, Matplotlib, or Vega.
  • Pure Python Implementation: The system now runs entirely in Python, simplifying the stack. It also offers a REST API and a WebAssembly version (via Pyodide) for running directly in web browsers.
  • Scales as First-Class Citizens: Draco 2 treats scales (the mapping of data to visual properties) as independent entities. This allows the system to reason about "shared scales" across multiple charts, a key requirement for complex dashboards.
  • The Debugger Module: A new DracoDebug module allows users to see exactly which "soft constraints" (preferences) were violated for a given chart, visualized through heatmaps and bar charts.

Datasets

The paper evaluates Draco 2 using:

  • Kim and Heer (2018) Dataset: A collection of 100 visualization pairs from a graphical perception study. This was used to compare how well Draco 2’s rankings align with human preferences.
  • Seattle Weather Dataset: Used as a case study to demonstrate how the system can take a raw dataset and "complete" a partial user request into a full, recommended visualization.

Key Insights and Ideas

  • Decoupling is Key: By separating the logic of design from the syntax of the renderer, Draco 2 becomes a foundation for future visualization research rather than just a plugin for one specific library.
  • Constraint-Based Design: The core "aha" moment is treating visualization as an optimization problem. Hard constraints define what is "legal" (e.g., you can't use a shape channel for a continuous variable), while soft constraints (with weights) define what is "good."
  • Human-in-the-loop Debugging: The authors recognize that design rules are often subjective. By providing tools to visualize constraint violations, they allow researchers to "tune" the weights of the system to match specific design philosophies or new empirical findings.

Key Results

  • Behavioral Consistency: When tested against Draco 1, Draco 2 agreed on chart rankings 86% of the time.
  • Improved Accuracy: In the instances where the two versions disagreed, Draco 2’s rankings were found to align better with the human perception results from the Kim and Heer study.
  • Extensibility: The authors demonstrated that Draco 2 could successfully handle multi-view and faceted charts that were impossible to model in the previous version.
  • Engineering Rigor: The new system boasts 100% unit test coverage, a significant leap in reliability for a research tool.

Limitations and Future Work

  • Constraint Overlap: The authors noted that out of 147 defined soft constraints, only a small subset (18) actually impacted the recommendations in their case study due to overlapping rules. This suggests the "knowledge base" needs further refinement.
  • Weight Tuning: While Draco-Learn can learn weights from data, many weights are still hand-tuned. Finding the "perfect" set of weights for all visualization tasks remains an open challenge.
  • LLM Integration: The authors suggest that Large Language Models (LLMs) could be used to generate the "partial specifications" (the user's intent), which Draco 2 could then "complete" into a mathematically sound, perceptually optimized visualization.
  • Interactivity: Currently, the framework focuses on static charts; extending these logical rules to interactive elements (zooming, filtering) is a major next step.

Summary updated

BibTeX
@inproceedings{yang2023draco,
  author = {Junran Yang and Péter Ferenc Gyarmati and Zehua Zeng and Dominik Moritz},
  title = {{Draco 2: An Extensible Platform to Model Visualization Design}},
  booktitle = {IEEE vis (short Papers)},
  year = {2023},
  doi = {10.1109/vis54172.2023.00042},
}
Figure