treeloom-matrix
Grid/matrix geometry helpers - points, lines, bounds, lookup - used by Cloakfall's boards. Formerly Matrix DOM.
Open source (MPL-2.0), and proven out in Cloakfall, which uses it
for the game board. Try its geometry below, or open the browser console to use treeloomMatrix directly.
Try it
Draw lines, check neighbours, place a fleet. The same sandbox is on the projects page.