Understand the Gribouille Pipeline abstractions
mainThe Gribouille plotting pipeline is composed of several core abstractions that define how data is transformed and rendered:
spec(Plot Specification): The primary dictionary built by the user and consumed byrender-plotto define the entire visualization.layer: An entry withinspec.layers. Each layer contains aname(the geom), amapping(aesthetic connections),data, andparams(layer-specific settings).geom(Geometric Layer): The visual representation of data (e.g., points, lines). Every geom must export adraw(layer, ctx)function.aes(Aesthetic Mapping): Created via theaes()constructor to map data columns to visual channels (e.g.,aes(x: "col", y: "col", colour: "col")). This results in a flattenedmappingdictionary.stat(Statistical Transform): A transformation applied to data (e.g., calculating means or counts) via thestat_*namespace.pos(Position Adjustment): Adjustments to how geoms are placed, such asstack,dodge,fill, orjitter.coord(Coordinate System): Defines the coordinate space, such ascartesian,fixed,radial, ortransform.ctx(Per-draw Context): A dictionary passed to every geom'sdrawmethod. It contains environment information liketrainedscales,palette,theme, and canvas dimensions (canvas-w/canvas-h).scales: A dictionary fed toplot()that binds aesthetics to specific scales. A later entry for an aesthetic will override previous ones.