feat: three new styles — constellation, skyline, and metro - #22
Merged
Conversation
constellation draws a night sky: rank sets each star's size and glow, near neighbours join into constellations over a pruned spanning tree, and two depths of hash-scattered dust fill the dark between them. skyline draws a city: weight sets each building's height through a dense rank over distinct weights, the avatar rides the roofline, and each building draws its roof silhouette, wall width, and glazing from a deterministic lottery. metro draws a transit map: stations on a route that snakes across the wall, one line per section — or one per role with `role_lines`, and `weave` interleaves those lines' rows so the routes cross one another like a real network, with every rail landing midway between station columns so no crossing touches a ring. constellation and skyline honour per-user `scale` (skyline in height); metro is a fixed lattice and ignores it. The shared hash-noise mixers now live once in the base renderer instead of per style. Review fixes folded in: a sparse constellation no longer scatters stars past its own document, metro sizes its document for role titles and the weave legend, the turn margin funds the stroke it draws, the station pitch funds a terminus ring on both sides, woven rails clear station labels, and the weave stagger no longer repeats verbatim every third line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three new renderers join the seven existing styles:
constellation— a night sky. Rank sets each star's size and glow (spiral's power taper), stars sit on a hash-jittered lattice with shuffled cell assignment (provably ≥gapapart for any config/scale), near neighbours join into constellations via a pruned Prim spanning tree, and two depths of deterministic dust fill the dark. Glow is a shared radial gradient — no SVG filters, so the PNG path is safe.skyline— a city. Building height comes from a dense rank over distinct weights (outlier-proof), pinned tomax_heightat the top and hash-spread when everyone is equal. Each building draws one of six roof silhouettes, a wall inset, and a glazing (square/ribbon, hash-lit panes) from a position-seeded lottery — random to the eye, exact to the golden files. The section's tallest tower gets the antenna.metro— a transit map. Stations on a route that snakes across the wall with rounded 180° turns; each section is a line in its own colour (8-colour cycle that holds contrast on light and dark), with heavier terminus rings at both ends.role_lines: truesplits a section into one line per role, named after it — andweave: trueinterleaves those lines' rows so the routes genuinely cross, with every vertical rail landing midway between station columns so a crossing can never touch a ring (validated:gap ≥ 2.5 × line_width).constellationandskylinehonour per-userscale(skyline in height only — the lattice stays true);metroignores it like the other fixed lattices.Review fixes folded in
A 10-finding adversarial review ran against this diff; nine are fixed here:
gapthe ring clearance it is documented to be(mosaic, spiral, orbit)scale comment in the config schemaRenderer2 * PADinstead of a bare12The tenth (O(n²) MST at ~5000+ stars) is deferred: the pipeline embeds every avatar as base64, so walls that size are bounded by fetch and file size long before this term shows up.
Docs / tests
examples/{constellation,skyline,metro}.svg)just checkclean, 297 examples pass under--order=random