summaryrefslogtreecommitdiff
path: root/tools/makelayout.js
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2024-10-21 16:09:57 -0400
committerJoël Simoneau <simoneaujoel@gmail.com>2024-10-21 16:09:57 -0400
commit29affe09b459127422544474986a69d83b2fe5ac (patch)
tree8c4fab3dd23615f1c37e6f1d75a5c703ca19a70b /tools/makelayout.js
parent27a606cfe34b324f625b45944c999da245994072 (diff)
downloadvijayanagara-29affe09b459127422544474986a69d83b2fe5ac.tar.gz
Data package.
Diffstat (limited to 'tools/makelayout.js')
-rw-r--r--tools/makelayout.js59
1 files changed, 59 insertions, 0 deletions
diff --git a/tools/makelayout.js b/tools/makelayout.js
new file mode 100644
index 0000000..c187254
--- /dev/null
+++ b/tools/makelayout.js
@@ -0,0 +1,59 @@
+const PROVINCES = [
+ "Andhra",
+ "Bengal",
+ "Gondwana",
+ "Gujarat",
+ "Jaunpur",
+ "Karnataka",
+ "Madhyadesh",
+ "Maharashtra",
+ "Malwa",
+ "Orissa",
+ "Rajput Kingdoms",
+ "Sindh",
+ "Tamilakam",
+ "Delhi",
+ "Mountain Passes",
+ "Punjab",
+]
+
+const print = console.log
+
+print('<?xml version="1.0" encoding="UTF-8"?>')
+print('<svg')
+print('\txmlns="http://www.w3.org/2000/svg"')
+print('\txmlns:xlink="http://www.w3.org/1999/xlink"')
+print('\txmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"')
+print('\txmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"')
+print('\twidth="1275" height="1650">')
+print('<image xlink:href="map75.jpg" x="0" y="0" width="1275" height="1650" image-rendering="pixelated" sodipodi:insensitive="true" />')
+
+const COLORS = {
+ DS: "black",
+ BK: "cyan",
+ VE: "yellow",
+ mongols: "red",
+}
+
+let x = -700, y = 100
+
+function advancex() {
+ x += 150
+}
+
+function advancey() {
+ x -= 150 * 4
+ y += 100
+}
+
+for (let s of PROVINCES) {
+ // faction holdings - 100x80 ellipse
+ print(`<text x="${x-100}" y="${y}" text-anchor="end" font-size="40">${s}</text>`)
+ for (let f of [ "DS", "BK", "VE", "mongols" ]) {
+ print(`<ellipse inkscape:label="${s} ${f}" cx="${x}" cy="${y}" rx="40" ry="30" fill="${COLORS[f]}" fill-opacity="0.5" />`)
+ advancex()
+ }
+ advancey()
+}
+
+print('</svg>')