Skip to content

feat: /examples section (World globe + Flat Map) + landing lighting + render perf#6

Merged
apresmoi merged 3 commits into
mainfrom
feat/examples-section
May 26, 2026
Merged

feat: /examples section (World globe + Flat Map) + landing lighting + render perf#6
apresmoi merged 3 commits into
mainfrom
feat/examples-section

Conversation

@apresmoi
Copy link
Copy Markdown
Owner

What

Adds an /examples section to the website and folds in the landing-globe lighting work and a couple of render-path improvements that came out of building it.

/examples section

  • New left sidebar (World / Flat Map) with active-state highlighting.
  • /examples → redirects to /examples/world.
  • /examples/world — the ASCII Earth globe (former local /map), drag to orbit, scroll to zoom.
  • /examples/flatmap — the iso pan/zoom Web-Mercator terrain map (former local /flatmap) with the control dock + country labels.
  • Examples link added to the top nav.

Landing

  • Dropped realSunLight on the hero (the real-time terminator left the visible face mostly on the night side → dark/"weirdly contrasted").
  • New per-demo light override prop on GlyphDemo ({ direction, intensity, ambient }) so the hero gets a bright, even fixed key without changing the global default for docs demos.

Render (@glyphcss/core rasterizer / scene)

  • Cache lit colors per render + memoize hex→rgb parsing (the color path was ~doubling rasterize time at high poly counts).
  • Measure cell height from a multi-line probe instead of a single glyph — fixes the scene visually shrinking at line-height < ~0.8.

Data weight

The example pages fetch pre-baked tile JSON at runtime. The full pyramids were 276 MB, so they're capped to what these demos actually need:

  • Globe: z0–z1 (~11 MB) — decorative orbit view, deep zoom isn't worth the weight.
  • Flat map: z0–z3 (~16 MB) — the interactive demo keeps good zoom depth.
  • Total committed: ~27 MB, largest single file 2.3 MB.

LOD selection + max-zoom are capped in code so the pages never request a dropped level (verified: aggressive zoom → zero /data/ 404s). Deeper levels remain regenerable from etopo/gadm via the bake scripts.

CI / build notes

  • pnpm test (294) and pnpm build both pass; /examples/* routes generate.
  • Build never touches etopo/gadm — those are local-only bake inputs, not build inputs.
  • gdal-async is intentionally not a package.json dependency (only the manual bake-labels.mjs uses it); the transient-install command is documented in the script header.

Notes

  • No public package API change → no React/Vue mirror needed (the light prop is on the website's GlyphDemo, not the published packages).

@apresmoi apresmoi merged commit 5f5e924 into main May 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant