I built a declarative layout engine for SVG, Canvas, WebGL
Details
- External ID
- 48770501
- Source
- HN
- Company
- —
- Product
- I built a declarative layout engine for SVG, Canvas, WebGL
- Website domain
- github.com
- Launched
- July 3, 2026
- Cohort
- —
- Upvotes
- 5
- Upvotes percentile
- 0.1081242532855436
- Tags
- —
- Fetched at
- Sept. 7, 2026, 9:26 p.m.
- Updated at
- Sept. 7, 2026, 9:26 p.m.
Description
Hey HN,I built a tiny zero DOM layout engine for vector graphics and custom renderers to resolves nested rows/cols/grids into exact `{x, y, w, h}` boxes, with text measurement, overflow signals, and collision separation.This is to help make SVG, PDF, Canvas responsive.Feedback welcome from anyone building canvas/SVG diagrams, dashboards, node editors, or diagram tools.
Enrichment
- Theme
- creative coding and visual experiments
- Vertical
- Horizontal
- Function
- Dev tools
- Audience
- Developer
- AI stance
- Not AI
- Project type
- Hobby / open-source project
- Normalized one-liner
- declarative layout engine for svg, canvas, webgl
- Manually corrected
- False
Could you build this?
No Writing a custom layout engine from scratch requires deep understanding of layout algorithms, text shaping/measurement, collision resolution, and box-model mathematics without standard DOM abstractions. Prompting an AI cannot reliably produce a mathematically sound, performant, and bug-free layout solver without specialized engineering.
What it would actually take: A production-grade layout engine typically uses Rust, C++, or low-overhead TypeScript (similar to Yoga or Taffy). It requires implementing constraint solving algorithms (Cassowary or flexbox/grid layout passes), integrating HarfBuzz or Canvas text-metric probes for precise glyph sizing, and designing cache-aware bounding-box collision detection routines.
Discussion
No comments on this launch.
Competitors
Other products that read as similar to this one — 216 launches clear the similarity bar, closest 8 shown.
Attention rank: #188 of 217 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).
Launched 241 days after the earliest competitor.
- I built a zero-browser, pure-JS typesetting engine for bit-perfect PDFs · hn · 2026-03-01 · 78 upvotes · similarity 0.50
- Minimalist library to generate SVG views of scientific data · hn · 2026-03-23 · 47 upvotes · similarity 0.50
- A CSS 3D Engine (no WebGL) · hn · 2026-06-01 · 80 upvotes · similarity 0.49
- Ripl · hn · 2026-03-19 · 17 upvotes · similarity 0.47
- zero-js · github · 2026-09-24 · 57 upvotes · similarity 0.46
- I built a small browser engine from scratch in C++ · hn · 2026-01-28 · 146 upvotes · similarity 0.46
- A browser-based vector animation engine rendering animated objects · hn · 2026-07-27 · 9 upvotes · similarity 0.44
- Pixels.style · hn · 2026-01-02 · 5 upvotes · similarity 0.44
Other launches for this product
- No other launches for this product.
Same idea, different domain
Nobody's really built a dev tools tool for Sales yet.