Mind Your Nus and Qs: Design Visualization Software Using Category Theory
Graphical grammars express how to put visual elements together; we propose a methodology for defining those visual elements in a manner that guarantees that they are structure preserving. Fiber bundles provide a uniform interface for describing a variety of data - tables, images, networks, etc. - in a manner that independently encodes the mathematical structure of the continuity and fields of the dataset. Modeling the data containers that store the datasets as sheaves provides a framework for specifying visualization methods that are designed to work regardless of how the dataset is stored - whether on disk, distributed, or on demand. Specifying the visualization library components as natural transforms of sheaves means that the constraints that the component must satisfy to be structure preserving can be specified as the set of morphisms on the data and graphic sheaves, including the structure on the continuity and fields of the data. Formally expressing how visual elements are constructed using category theory means we can translate those constraints into pseudocode, which can be used to implement the words in the visual sentence in a way that ensures that the sentences generate images that are faithful translations of the data.