class

ContributorMural::Renderer

Inherits Reference < Object

Turns embedded users into an SVG document. Styles implement defs (shared clip paths, emitted once), block_size, and draw_block (one section of users at a vertical offset); the base class stacks sections with optional group titles and handles theming. In auto mode text and background get CSS classes plus a prefers-color-scheme media query so the SVG follows the viewer's theme (GitHub included); static modes inline the fills, which keeps rasterizers happy. PNG output builds on the static path.

Constants

SECTION_GAP = 12.0
TITLE_HEIGHT = 30.0

Constructors

for(style : Style, config : Config, mode : ThemeMode | Nil = nil) : Renderer
Source
new(config : Config, mode : ThemeMode | Nil = nil)
Source

Class methods

honors_scale?(style : Style) : Bool

Styles that can honour a per-user scale: the ones that already derive a size per user, where an override is exact. The fixed lattices (grid, honeycomb, stencil, metro) have nowhere to put an avatar larger than its cell without overlapping a neighbour or leaving a hole, and voronoi sizes cells by cutting the block up rather than by placing a shape — those ignore scale rather than approximate it. Skyline honours it in the one dimension it is free in: the emphasised tower grows taller, not wider. Pebble sizes its disc before anything is placed and the pack pushes the neighbours aside, so the multiplier lands exactly.

Source

Instance methods

fetch_size(user : ResolvedUser) : Int32

Pixel size at which to fetch this user's avatar (2x render size for crisp display on high-DPI screens).

Source
last_size

Document size of the most recent render, so a caller can report the dimensions it just wrote without parsing the SVG back.

Source
mode
Source
prepare(users : Array(ResolvedUser)) : Nil

Called with the full user list before avatars are fetched, so renderers with relative sizing (mosaic tiers) can precompute per-user sizes.

Source
render(groups : Array(Tuple(String | Nil, Array(EmbeddedUser)))) : String
Source
render(users : Array(EmbeddedUser)) : String

Single-section convenience (specs, simple callers).

Source