Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-07-10 22:41:28 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-07-10 22:41:28 -0700
commitccb1cb2c7573364732a277f0c7c770de611aeca3 (patch)
treeebbb28f5902a71bbd3028a259ce002988d3b579c /src/radial.js
parent9c200873d6f013fa1e8eb9f00441404cca9acc1a (diff)
Allow generic maps to be still generated
Diffstat (limited to 'src/radial.js')
-rw-r--r--src/radial.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/radial.js b/src/radial.js
index f2ed5fb..c0fbdd6 100644
--- a/src/radial.js
+++ b/src/radial.js
@@ -646,3 +646,16 @@ function addGroup(container, className) {
container.appendChild(g);
return g;
}
+
+const { left, right, top, bottom } = document.currentScript.dataset;
+
+if (left && right && top && bottom) {
+ const map = generateRadialCoords(
+ new Map(),
+ { q: 0, r: 0, s: 0 },
+ { left: +left, top: +top, right: +right, bottom: +bottom },
+ 'both'
+ );
+
+ drawHexes(addGroup(grid, 'elevation-0'), map);
+}