class

ContributorMural::Renderers::Metro

Inherits ContributorMural::Renderer < Reference < Object

A transit map: contributors are stations on a coloured route that snakes across the wall — left to right, a rounded 180° turn, back again — in the flat-colour idiom of the classic network diagrams. Each section is its own line in its own colour, its title reading as the line's name, and the two ends of a line carry the heavier ring of a terminus. With role_lines, a section splits further: one line per role, named after it — and weave interleaves those lines' rows so the routes genuinely cross one another, the way a real network does.

Constants

CLIP_ID = "metro-clip"
LABEL_BLOCK = 18.0

Vertical room reserved under each row for station names.

LINE_COLORS = ["#e5484d", "#3b82f6", "#30a46c", "#f76b15", "#8e4ec6", "#12a594", "#d6409f", "#ad7f58"] of ::String

Mid-lightness route colours that hold up on white and on GitHub's dark background alike, so one palette serves every theme and every stroke is a plain attribute — nothing for CSS or the rasterizer to miss. A ninth line wraps around to the first colour.

LINE_GAP = 18.0
LINE_TITLE = 20.0

The band a role-named line's title takes, and the air between lines.

TERMINUS = 1.6

Terminus ring stroke, as a multiple of the line's width. The ring's inner edge stays flush with the avatar either way; a terminus is only heavier on the outside.

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
prepare(users : Array(ResolvedUser)) : Nil

Half the widest station name in the whole document, measured once so every section shares one margin and the columns stay in true.

Source