🤖 AI Summary
Existing time visualization tools struggle to accurately represent complex temporal semantics and lack a general declarative framework supporting multi-granular, cross-time-zone, and irregular time series. To address this, we propose the Temporal Grammar of Graphics—a declarative syntax that intrinsically encodes linear, periodic, and quasi-periodic temporal semantics. It enables temporal abstraction across granularities, time-zone alignment, and standardization of irregular sequences through composable temporal graphical elements. The grammar ensures temporal semantic consistency and facilitates coordinated navigation between time and other variables. Based on this formalism, we implement ggtime, an open-source R package. Evaluation demonstrates that ggtime significantly improves expressive accuracy, reusability, and construction efficiency for visualizing complex temporal patterns—particularly those involving heterogeneous time structures, distributed time zones, or non-uniform sampling intervals—while maintaining compatibility with the broader grammar-of-graphics ecosystem.
📝 Abstract
Visualizing changes over time is fundamental to learning from the past and anticipating the future. However, temporal semantics can be complicated, and existing visualization tools often struggle to accurately represent these complexities. It is common to use bespoke plot helper functions designed to produce specific graphics, due to the absence of flexible general tools that respect temporal semantics. We address this problem by proposing a grammar of temporal graphics, and an associated software implementation, 'ggtime', that encodes temporal semantics into a declarative grammar for visualizing temporal data. The grammar introduces new composable elements that support visualization across linear, cyclical, quasi-cyclical, and other granularities; standardization of irregular durations; and alignment of time points across different granularities and time zones. It is designed for interoperability with other semantic variables, allowing navigation across the space of visualizations while preserving temporal semantics.