Reactive Visualization Widgets

Reactive widgets allow you to build your visualization application in a more modular way, facilitating reusability and replicability of experiments.

Think of them as interactive building blocks for your visualizations!

A Reactive Visualization widget displays data and allows users to directly interact with it (e.g., select a bar in a bar chart πŸ“Š). It then emits events based on these interactions (e.g., signaling which bars are selected).

Reactive widget specification

A reusable and reactive visualization widget should be:
  • A function that returns:
    • an 🧱 HTML Element
    • and the 🎯 user selection in the value attribute of the element.
  • Receives:
    • some πŸ—ƒοΈ input data (usually in tidy format)
    • an πŸŽ›οΈ options object
  • πŸ“£ Emits input events when there is an user interaction
  • and πŸ‘‚πŸΌ listens to input to the same event to reflect changes made on other widgets
Reactive Widgets Icon

TL;DR Usage

To create a Reactive Widget

import { ReactiveWidget } from "@john-guerra/reactive-widgets"

function MyWidget(
  data, { value = 0 } = {}
) {
  let widget;  
  const element = htl.html``; // βœ… Add here the code that 
  // creates your widget as an HTML element

  function showValue() {
    /* βœ… Add here the code that updates 
    the current selection */    
  }

  // 🧰 Then wrap your visualization (html element) with 
  // the reactive value and input events
  let widget = ReactiveWidget(element.node(), 
    { value, showValue }
  );
  
  // 🧰 Show the initial value
  showValue();
  
  // 🧰 Finally return the html element
  return widget;
}

The Paper

Towards Reusable and Reactive Widgets for Information Visualization Research and Dissemination

πŸ“„ IEEE VIS 2024 Short Paper

The information visualization research community commonly produces supporting software to demonstrate technical contributions to the field. However, developing this software tends to be an overwhelming task. The final product tends to be a research prototype without much thought for modularization and re-usability, which makes it harder to replicate and adopt. This paper presents a design pattern for facilitating the creation, dissemination, and re-utilization of visualization techniques using reactive widgets. The design pattern features basic concepts that leverage modern front-end development best practices and standards, which facilitate development and replication. The paper presents several usage examples of the pattern, templates for implementation, and even a wrapper for facilitating the conversion of any Vega specification into a reactive widget.

Presentation

https://www.youtube.com/live/QoKwx8sUMyg?si=sP6kxHNPltwK-fh0&t=3576

Fast forward presentation