Settings

Theme

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

2 points by r2b2 2 years ago · 2 comments · 1 min read


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!

acemarke 2 years ago

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

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

surprisetalk 2 years ago

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

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection