SGL: A Structured Graphics Language
Jon Chapman
TL;DR
The paper addresses the absence of a graphics language tightly integrated with SQL-like query interfaces for exploratory analytics. It introduces SGL, a SQL-inspired graphics language derived from an adapted grammar of graphics, and enumerates its core clauses and constructs (From, Using, Visualize, Layer, Scale By, Facet By, etc.). It contrasts SGL's grammar with the layered grammar, explaining how column-level transformations, aggregations, and geom qualifiers map to SQL-like syntax, including collection semantics and single-scale enforcement. The work demonstrates how SGL enables concise, expressive statistical graphics within SQL workflows and discusses practical implications for data warehouses.
Abstract
This paper introduces SGL, a graphics language that is aesthetically similar to SQL. As a graphical counterpart to SQL, SGL enables specification of statistical graphics within SQL query interfaces. SGL is based on a grammar of graphics that has been customized to support a SQL aesthetic. This paper presents the fundamental components of the SGL language alongside examples, and describes SGL's underlying grammar of graphics via comparison to its closest predecessor, the layered grammar of graphics.
