Table of Contents
Fetching ...

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.

SGL: A Structured Graphics Language

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.

Paper Structure

This paper contains 15 sections, 27 figures.

Figures (27)

  • Figure 1: SQL statement and corresponding result set showing a sample of data from the cars table.
  • Figure 2: SQL statement and corresponding result set showing a sample of data from the trees table.
  • Figure 3: SGL statement with a from clause that designates the cars table as a data source.
  • Figure 4: SGL statement with a SQL subquery as the data source, resulting in a graphic similar to Figure \ref{['fig:from-table-source']}, except that only Japanese cars are included.
  • Figure 5: SGL statement with a non-positional aesthetic color, resulting in point geoms that are colored according to their origin.
  • ...and 22 more figures