Bladeren bron

roman numerals for houses

Lukas Goldschmidt 1 maand geleden
bovenliggende
commit
bc9549df38
3 gewijzigde bestanden met toevoegingen van 17 en 5 verwijderingen
  1. 1 1
      src/astro_mcp/chart_font.py
  2. 14 2
      src/astro_mcp/chart_renderer.py
  3. 2 2
      src/astro_mcp/chart_styles.py

+ 1 - 1
src/astro_mcp/chart_font.py

@@ -50,7 +50,7 @@ NODES = {
     "lilith":     "z",
 }
 
-# ── Houses & Angles ───────────────────────────────────────────────────
+# ── Houses & Angles ───────────────────────────────────────────────────
 # Houses 1-12 use digits 0-9 and : ;
 # House 1 = '0', House 2 = '1', ..., House 10 = '9', House 11 = ':', House 12 = ';'
 HOUSES = {str(i): str(i - 1) for i in range(1, 10)}  # 1-9 → '0'-'8'

+ 14 - 2
src/astro_mcp/chart_renderer.py

@@ -131,6 +131,16 @@ def _format_degree(deg_float: float) -> str:
     return f"{d}\u00b0{m:02d}\u2019"
 
 
+def _to_roman(num: int) -> str:
+    """Convert an integer (1-12) to a Roman numeral string."""
+    roman_map = {
+        1: "I", 2: "II", 3: "III", 4: "IV", 5: "V",
+        6: "VI", 7: "VII", 8: "VIII", 9: "IX", 10: "X",
+        11: "XI", 12: "XII",
+    }
+    return roman_map.get(num, str(num))
+
+
 # ── Main natal wheel renderer ─────────────────────────────────────────
 
 def render_natal_wheel(
@@ -314,10 +324,12 @@ def render_natal_wheel(
         diff = (c1 - c2) % 360.0   # CCW distance from c1 to c2
         mid_c = (c1 - diff / 2.0) % 360.0
         hx, hy = _polar_to_cartesian(wheel_cx, wheel_cy, r_hnum, mid_c)
+        house_num = house.get("house", i + 1)
         dwg.add(dwg.text(
-            str(house.get("house", i + 1)), insert=(hx, hy),
+            _to_roman(house_num), insert=(hx, hy),
             text_anchor="middle", dominant_baseline="central",
-            class_="lbl", font_size="11px", fill=theme["degree_text"],
+            class_="lbl", font_size="10px", font_style="italic",
+            fill=theme["degree_text"],
         ))
 
     # ── Angle axis lines (ASC-DSC and MC-IC) ─────────────────────────

+ 2 - 2
src/astro_mcp/chart_styles.py

@@ -187,7 +187,7 @@ ANGULAR_HOUSES = {1, 4, 7, 10}
 #   _R_ZODIAC_GLYPH (0.855) — center of zodiac band (sign glyph position)
 #   _R_ZODIAC_INNER (0.770) — inner zodiac band edge
 #   _R_CONNECTOR (0.760) — connector tick inner end (near inner zodiac edge)
-#   _R_HOUSE_NUM (0.700) — house number label position
+#   _R_HOUSE_NUM (0.400) — house number label position (near inner circle)
 #   _R_PLANET (0.595) — planet glyph centre
 #   _R_PLANET_DEG (0.490) — planet degree label position
 #   _R_CUSP_INNER (0.350) — house cusp lines inner end (= center circle radius)
@@ -204,7 +204,7 @@ _R_TICK_INNER_1 = 0.967   # 1° tick inner end  (not drawn at this res)
 _R_ZODIAC_OUTER = 0.940   # outer zodiac band edge (stroke circle)
 _R_ZODIAC_GLYPH = 0.855   # center of zodiac band ((0.940+0.770)/2)
 _R_ZODIAC_INNER = 0.770   # inner zodiac band edge (stroke circle)
-_R_HOUSE_NUM    = 0.700   # house number label position
+_R_HOUSE_NUM    = 0.400   # house number label position (near inner circle)
 _R_CUSP_INNER   = 0.350   # house cusp lines extend inward to here
 _R_PLANET       = 0.595   # planet glyph centre
 _R_PLANET_DEG   = 0.490   # planet degree label (inside glyph)