User-Driven Support for Visualization Prototyping in D3

Hannah K. Bako, Alisha Varma, Anuoluwapo Faboro, Mahreen Haider, Favour Nerrise, Bissaka Kenah, John P. Dickerson, Leilani Battle

TL;DR

This paper introduces Mirny, a system that helps users prototype interactive D3 visualizations more efficiently. By combining intelligent interaction recommendations with automated code generation, Mirny significantly reduces the time and effort required for users to transform their design ideas into functional visualizations, even when deviating from standard template structures.

What Problem Does This Paper Address?

Creating compelling data visualizations often involves an iterative process of designing and programming. While complex visualization libraries like D3 offer immense power, they present a steep learning curve, especially for implementing interactive features. Existing template-based approaches often treat templates as rigid structures, hindering user creativity when they want to deviate from predefined parameters. This creates a gap between the desire for dynamic, interactive visualizations and the practical challenges of programming them, particularly for users who are not D3 experts. The paper aims to bridge this gap by providing dynamic support that respects user creativity while streamlining the prototyping process.

Methods

The core of Mirny's approach lies in two key automated features:

  • Recommendation Engine: This system uses a Markov Decision Process (MDP) model to predict and recommend complementary interactions for a user's current D3 visualization. The MDP is trained on observed patterns of interaction usage in a large corpus of D3 examples, allowing it to adapt to user feedback and evolving preferences over time.
  • Code Augmentation: When a user accepts a recommended interaction, Mirny automatically inserts the corresponding D3 code snippet into the user's live code. This process involves parsing the user's code into an Abstract Syntax Tree (AST), identifying appropriate insertion points (anchor points), and merging the pre-generated interaction template. This feature is designed to work even when users have modified the original template code.

Mirny itself is a design-focused prototyping environment with a user interface that includes a template panel, an editor, a visualization output panel, and the recommendation panel.

Datasets

The paper mentions a preliminary study where they qualitatively analyzed 2500 D3 examples shared on GitHub, Bl.ocks.org, and Observable. This analysis informed the identification of common visualization types and interaction patterns. For training the recommendation engine, the paper states that states and transition probabilities were derived from these observations. No new benchmark datasets were introduced.

Key Insights and Ideas

  • Templates as a Starting Point, Not an End: The study revealed that users don't just use templates as-is; they actively modify them to fit their stylistic preferences, transform data, and introduce new visual encodings. This highlights the need for tools that support flexible template modification.
  • Interactions are Key, but Hard: Implementing interactions in D3 is a significant challenge, even for experienced users. Mirny's ability to suggest and automatically implement these interactions is a major value proposition.
  • User Agency is Crucial: While automation is beneficial, users still want control. Mirny's approach of recommending and augmenting code, rather than dictating it, respects user agency and allows for creative exploration.
  • Unexpected Template Uses: Some participants used initial templates for exploratory data analysis before selecting a different template for the final presentation, suggesting a more fluid workflow than initially anticipated.

Key Results

  • Reduced Prototyping Time and Iterations: In a user study with 20 D3 users, participants using Mirny (with recommendations and code augmentation) were able to prototype design ideas with significantly fewer programming iterations and in less time compared to using templates alone. Specifically, participants implemented interactions 3.2x faster.
  • Increased Interactions: Participants using Mirny with recommendations and code augmentation implemented 1.9 more interactions per visualization on average compared to those using templates only.
  • High User Agreement: Participants found the recommendations useful and instrumental in gaining new interaction ideas. They also agreed that templates were useful and that Mirny streamlined the authoring process.
  • Common Visualization Types: The analysis of online D3 examples showed that a small subset of visualization types (Bar charts, Geomaps, Line charts, Scatterplots, and Force Directed Graphs) account for 80% of implementations.
  • Common Interaction Types: Hover, Click, Brush, Drag, Visualize, and Zoom were identified as common interaction widget types, with Hover being the most frequent.

Limitations and Future Work

  • Template Limitations: The current system focuses on a limited set of popular D3 visualization types and interaction patterns. Future work could explore supporting more complex template transformations, such as dynamically changing chart types or structures based on data transformations.
  • Recommendation Transparency: Participants requested more insight into why certain recommendations were made. Future work could provide explanations for the recommendations.
  • Modularization: Users expressed interest in more modular templates for individual components (e.g., axes, legends) to facilitate further customization.
  • Co-design: The authors suggest exploring how users and recommenders can co-design visualizations to balance automation with user agency.
  • Scalability: The manual curation of templates limits scalability. Future work could explore ensemble strategies that combine Mirny's domain-specific knowledge with broader code generation tools like GitHub Copilot.
  • Debugging: Participants found the live updates to be a hindrance during debugging, suggesting the need for a "run" button for manual updates.

Summary updated

BibTeX
@inproceedings{bako2023user,
  author = {Hannah K. Bako and Alisha Varma and Anuoluwapo Faboro and Mahreen Haider and Favour Nerrise and Bissaka Kenah and John P. Dickerson and Leilani Battle},
  title = {{User-Driven Support for Visualization Prototyping in D3}},
  booktitle = {IUI},
  year = {2023},
  doi = {10.1145/3581641.3584041},
}
Figure