Skip to content

Ask HN: How would you build an interactive hex-grid for web?

2 pointsr2b22 comments
On HN

I'm working on a board game and would like to build dynamic board builder/generator for the web.

Do you know of any JavaScript OSS libraries for working with clickable hexagon grids in HTML?

Or would go straight to something more custom like D3 / SVG?

Thanks!

Comments

Start with the canonical resource for how to draw hexes in code:

https://www.redblobgames.com/grids/hexagons/

I made an online hexagonal chess game a few months ago. You can see how I did it with plain HTML/CSS/JS:

https://github.com/surprisetalk/chexs

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.