SciPy 2024

Supporting Greater Interactivity in the IPython Visualization Ecosystem
07-12, 13:55–14:25 (US/Pacific), Room 315

Interactive visualizations are invaluable tools for building intuition and supporting rapid exploration of datasets and models. Numerous libraries in Python support interactivity, and workflows that combine Jupyter and IPyWidgets in particular make it straightforward to build data analysis tools on the fly. However, the field is missing the ability to arbitrarily overlay widgets and plots on top of others to support more flexible details-on-demand techniques. This work discusses some limitations of the base IPyWidgets library, explains the benefits of IPyVuetify and how it addresses these limitations, and finally presents a new open-source solution that builds on IPyVuetify to provide easily integrated widget overlays in Jupyter.


Introduction

The ability to interact with and visualize data plays a crucial role in many data analysis workflows. Allowing users to manipulate and explore interactively enhances comprehension, improves user engagement, and often provides a faster route to gaining intuitive understanding of the data. Although much effort and progress has gone into this area, we believe a missing component still persists in the Python community, which our library aims to provide. To support the paradigm of “details on demand,” this project introduces a new set of components for data exploration by allowing users to effectively create custom pop-up widgets rendered over existing widgets and leverage customizable context menus to further specify which exhibit is needed for the current task. This design provides more creative control to the user and unbiases the workflow by removing the limitation of a standard template of visualizations.

Beyond Base IPyWidgets

This work will discuss IPyWidgets and Jupyter as a workflow for building interactive tools. One of IPyWidgets’ primary benefits is its automatic state synchronization between a Python backend and a JavaScript/HTML frontend, and its set of predefined controls. Together, these features make a developer-friendly experience for implementing interactivity solely from the Python side. IPyWidgets also supports the creation of custom components through a combined Node.js and Python library template project, which has resulted in a small ecosystem of integrations for well-known visualization libraries like Matplotlib and Plotly. However, the predefined controls and layout options are limited in terms of customization, and building a component from scratch adds a substantial learning curve and overly complex development environment to support the necessary JavaScript toolchains. Together, these issues make it challenging to add more in-depth types of interactivity into an analysis tool with just base IPyWidgets.

We will elaborate on these challenges and then present on IPyVuetify—an open-source library that provides a larger collection of more flexible, predefined, UI components and a simpler developer experience for creating new ad hoc widgets. IPyVuetify ports the extensive list of material design elements from Vuetify (a set of prebuilt Vue.js components) into IPyWidgets and allows users to specify a new widget with a single Python class and Vue file, bypassing the need for any explicit JavaScript toolchains in the project infrastructure.

IPyOverlay

The libraries in the IPyWidgets ecosystem support functionality ranging from building full dashboards, like Panel and Solara, to adding specific capabilities like IPyEvents. A concept that is missing in the Jupyter visualization community is the ability to easily add widgets on top of other widgets, which enables techniques like draggable overlay windows of subplots and more conventional UI concepts like right-click context menus to provide the user with a more diverse set of interactions with any plot. The authors are open-sourcing a library called IPyOverlay that provides these functionalities via a set of custom components built with IPyVuetify that can wrap any other IPyWidgets. This work will demonstrate the tool in use, providing an example plot of 2D-embedding clusters that can be clicked to open pop-up windows with more detailed plots for each clicked cluster. The library will be available at https://github.com/ORNL/ipyoverlay.

Nathan Martindale is a data scientist in the nuclear nonproliferation division at Oak Ridge National Laboratory. He completed both his B.S. (2018) and M.S. (2020) degrees in computer science at Tennessee Tech University, with his graduate studies focusing on machine learning. His research interests include natural language processing, interactive machine learning, visual analytics, and HCI.

Jacob Smith is a data scientist in the nuclear nonproliferation division at Oak Ridge National Laboratory. He completed his B.S. in computer science at Tennessee Technological University in 2018. His research interests include visual analytics, automated analysis, and machine learning.