The Grammar of Graphics (GoG) has become a popular format for specifying visualizations because it unifies different chart types into a consistent, modular, and customizable framework. But its benefits have not yet reached the broader class of data-driven graphic representations -- from annotated charts and hierarchical visualizations to molecular structure diagrams, Euclidean geometry, and mathematical formulae. These graphics are still developed using rigid typologies, monolithic tools, or specialized grammars that lack the customizability and generality of the GoG. In response, we present Bluefish, a relational grammar of graphics that extends the benefits of the GoG to this larger domain. Bluefish provides two key abstractions: user-extensible, domain-specific elements (e.g., mathematical expressions, chemical atoms, or program state stack frames); and perceptual groupings (also known as Gestalt relations) like proximity, nesting, and linking. Users compose these primitives within a Bluefish specification, which the language runtime compiles to a relational scenegraph: a formal representation of a graphic that, compared to traditional tree-based scenegraphs, better preserves semantic relationships between visual elements. To illustrate its flexibility, we show that Bluefish can represent data-driven graphic representations across a diverse range of domains while closely aligning with domain-specific vocabulary. Moreover, to demonstrate the affordances of Bluefish's relational scenegraph, we develop a prototype screen reader tool that allows blind and low-vision users to traverse a diagram without significant additional scaffolding.
翻译:图形语法(Grammar of Graphics, GoG)已成为一种流行的可视化规范格式,因为它将不同类型的图表统一到一个一致、模块化且可定制的框架中。然而,其优势尚未惠及更广泛的数据驱动图形表示——从带标注的图表、层级化可视化,到分子结构图、欧几里得几何和数学公式。这些图形仍然依赖于僵化的分类法、单一工具或专用语法,缺乏GoG的可定制性和通用性。为此,我们提出Bluefish,一种关系型图形语法,将GoG的优势扩展至这一更广阔的领域。Bluefish提供两个关键抽象:用户可扩展的领域特定元素(例如数学表达式、化学原子或程序状态栈帧);以及感知分组(即格式塔关系),如邻近性、嵌套和链接。用户在Bluefish规范中组合这些原语,语言运行时将其编译为关系型场景图:一种图形的形式化表示,与传统的基于树的场景图相比,能更好地保留视觉元素之间的语义关系。为展示其灵活性,我们证明Bluefish能够在跨多个领域的范围内表示数据驱动图形表示,同时与领域特定词汇紧密对齐。此外,为体现Bluefish关系型场景图的效用,我们开发了一个原型屏幕阅读器工具,使盲人和低视力用户无需额外大量辅助即可遍历图表。