class

ContributorMural::Renderers::Spiral

Inherits ContributorMural::Renderer < Reference < Object

Phyllotaxis: the arrangement sunflower seeds use. Each avatar sits one golden angle further around than the last, at a radius growing with the square root of its rank, which spaces them evenly with no rings or rows. Rank also drives size, so the people carrying the project sit large in the middle and the wall thins out toward the edge.

Constants

CLIP_ID = "spiral-clip"
DENSITY = 0.62

Share of the disc the avatars may cover. A phyllotaxis packs tightly but its nearest neighbours are several indices apart, so the usable figure sits well below the theoretical circle-packing limit. This is the opening guess only — clear_of is what decides the radius actually used.

GOLDEN_ANGLE = Math::PI * (3 - (Math.sqrt(5.0)))

137.50776…°, the angle that keeps successive points from lining up.

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

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

Source