5.4 Software Infrastructure

We have implemented the above design as an open source R package called liminal (S. Lee and Cook 2020). The package allows analysts to construct concatenated visualisations, drawn with the Vega-Lite grammar of interactive graphics via the vegawidget package (Satyanarayan et al. 2017; Lyttle and Vega/Vega-Lite Developers 2020). It provides an interface for constructing linked and stand alone interfaces for manipulating tour paths via the shiny and tourr packages (Chang et al. 2020; Wickham et al. 2011).

5.4.1 Tours as a streaming data problem

The process of generating successive bases and interpolating between them to
construct intermediary frames, means the tour is a dynamic visualisation technique. Generally, the user would set \(d=2\) and the tour is visualised as an animated scatter plot. This process of constructing bases and intermediate frames and visualising the resulting projection is akin to making a “flip book” animation. Like with a flip book, an interface to the tour requires the ability to interact and modify it in real time. The user interface generated in liminal allows a user to play, pause, and reset the tour animation, panning and zooming to modify the scales of the plot to provide context and click events to highlight groups of points if a labelling variable has been placed on the legend.

These interactions are enabled by treating the basis generation as a reactive stream. Instead of realising the entire sequence, which limits the animation to have a discrete number of frames, new bases and their intermediate frames are generated dynamically via pushing the current projection to the visualisation interface. The interface listens to events like pressing a button or mouse-dragging and reacts by pausing the stream. This process allows the user to manipulate the tour in real time rather than having to fix the number of bases ahead of time. Additionally, once the user has identified an interesting projection or is done with the tour, the interface will return the current basis for use downstream.

5.4.2 Linking and highlighting views via interactions

The embedding and tour views are linked together via rectangular brushes; when a brush is active, points will be highlighted in the adjacent view. Because the tour is dynamic, brush events that become active will pause the animation, so that a user can interrogate the current view. By default, brushing on the embedding view will produce a one-to-one linking with the tour view. For interpreting specific combinations of clusters, the multiple guides on the legend can be selected in order to see their relative orientations. The interface is constructed as a shiny gadget specifically designed for interactive data analysis. Selections such as brushing regions and the current tour path are returned after the user clicks done on the interface and become available for further investigation.