From 21c1d33d867306b4bacf9fb8fff04c00fd0f8ffa Mon Sep 17 00:00:00 2001 From: vidit choudhary <153429790+vidit-16@users.noreply.github.com> Date: Thu, 8 Oct 2026 01:14:28 +0530 Subject: [PATCH] README map: small place names clear of paths and other blocks Chem/Phy, MBA, Society, the gates, Nandini, the xerox shops and the puff shop had names sitting on a path or on the next block. Each now has a spot in free space, and every name has a halo in the background colour. --- docs/campus_map.svg | 58 +++++++++++++++++++++---------------------- tools/build_campus.py | 18 ++++++++++++-- 2 files changed, 45 insertions(+), 31 deletions(-) diff --git a/docs/campus_map.svg b/docs/campus_map.svg index 9acf4b2..ace1743 100644 --- a/docs/campus_map.svg +++ b/docs/campus_map.svg @@ -63,34 +63,34 @@ -KIMS A gate -KIMS OPD -KIMS Hospital -KIMS Parking -Kalakshetra -VS gate -Main Block -P1 -Mech Parking -Chem/Phy -Mech Blocks -Society -Mech xerox -BIT Main Gate -Law / Physio -Canteen -Xerox -Puff shop -Dental College -Nandini -P2 -KIN / VCS -VCS gate -KIN gate -MBA -Workshops -BIT Tree -ATM -KIMS Canteen +KIMS A gate +KIMS OPD +KIMS Hospital +KIMS Parking +Kalakshetra +VS gate +Main Block +P1 +Mech Parking +Chem/Phy +Mech Blocks +Society +Mech xerox +BIT Main Gate +Law / Physio +Canteen +Xerox +Puff shop +Dental College +Nandini +P2 +KIN / VCS +VCS gate +KIN gate +MBA +Workshops +BIT Tree +ATM +KIMS Canteen Security desk diff --git a/tools/build_campus.py b/tools/build_campus.py index a7b4b97..bbf293d 100644 --- a/tools/build_campus.py +++ b/tools/build_campus.py @@ -335,6 +335,16 @@ def main(): "small": ("#e8eae6", "#a9b0a8"), "gate": ("#f2d48d", "#b8923b")} +# Where the README map puts the names of small places, so none sits on a path +# or another block: (x, y, text-anchor) in map coordinates. +LABEL_AT = { + "vs-gate": (128, 522, "middle"), "p1": (190, 652, "middle"), "chem-phy": (780, 458, "middle"), + "society": (730, 637, "middle"), "mba": (780, 709, "middle"), "xerox-mech": (724, 768, "middle"), + "main-gate": (128, 745, "middle"), "xerox-canteen": (601, 878, "middle"), "puff-shop": (605, 950, "middle"), + "nandini": (140, 924, "end"), "vcs-gate": (84, 1012, "middle"), +} + + def draw_map(data): """docs/campus_map.svg for the README: the same places and paths the app draws, labelled.""" w, h = data["viewBox"][2], data["viewBox"][3] @@ -354,10 +364,14 @@ def draw_map(data): xs = [x for x, _ in place["outline"]] ys = [y for _, y in place["outline"]] cx, cy, width = (min(xs) + max(xs)) / 2, (min(ys) + max(ys)) / 2, max(xs) - min(xs) - size, anchor = (14, "middle") if width >= 60 else (11, "start") + size, anchor, ty = (14, "middle", cy + 5) if width >= 60 else (11, "start", cy + 5) if width < 60: cx = max(xs) + 6 - out.append(f'{place["short"]}') x, y = data["desk"]["point"] out.append(f''