fix(tooling): star map 16:9 ratio, circular fade, trimmed margins
Canvas now 16:9 with circle filling height. Radial fade gradient uses userSpaceOnUse for true circular shape. Hop 15+ folded into final ring. Margins trimmed to fit content. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.5 MiB |
File diff suppressed because it is too large
Load Diff
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
@@ -62,10 +62,6 @@ if folded_nodes:
|
||||
max_display_hop = FOLD_HOP
|
||||
|
||||
# --- Layout parameters ---
|
||||
width, height = 3200, 3200
|
||||
cx, cy = width / 2, height / 2
|
||||
|
||||
# Ring radii — hop 15+ gets a wider band
|
||||
RING_STEP = 55
|
||||
RING_BASE = 50
|
||||
ring_radius = {}
|
||||
@@ -80,6 +76,12 @@ NORMAL_BAND = 27
|
||||
FOLD_BAND = NORMAL_BAND # same width as normal rings
|
||||
FADE_BAND = NORMAL_BAND * 4 # empty fade zone beyond the last ring
|
||||
|
||||
# Canvas: 16:9, circle fills the height
|
||||
_max_r = RING_STEP * FOLD_HOP + RING_BASE + NORMAL_BAND + FADE_BAND + 60
|
||||
height = int(_max_r * 2 + 120)
|
||||
width = int(height * 16 / 9)
|
||||
cx, cy = width / 2, height / 2
|
||||
|
||||
# 90-degree wedges, no gaps, centered on cardinals
|
||||
sector_wedge_center = {
|
||||
'north_reach': -math.pi / 2,
|
||||
@@ -227,12 +229,15 @@ svg = []
|
||||
svg.append(f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {width} {height}" width="{width}" height="{height}">')
|
||||
|
||||
# Defs for the fade gradient beyond the last ring
|
||||
# Use userSpaceOnUse so the gradient is a true circle regardless of canvas aspect ratio
|
||||
svg.append('<defs>')
|
||||
fade_start = ring_radius[FOLD_HOP] + FOLD_BAND # outer edge of last ring
|
||||
fade_end = fade_start + FADE_BAND # end of fade zone
|
||||
start_pct = fade_start / (width / 2) * 100
|
||||
end_pct = min(fade_end / (width / 2) * 100, 100)
|
||||
svg.append(f'<radialGradient id="fadeEdge" cx="50%" cy="50%" r="50%">')
|
||||
fade_start = ring_radius[FOLD_HOP] + FOLD_BAND
|
||||
fade_end = fade_start + FADE_BAND
|
||||
# Gradient radius must cover corners of canvas
|
||||
grad_r = max(width, height)
|
||||
start_pct = fade_start / grad_r * 100
|
||||
end_pct = fade_end / grad_r * 100
|
||||
svg.append(f'<radialGradient id="fadeEdge" cx="{cx}" cy="{cy}" r="{grad_r}" gradientUnits="userSpaceOnUse">')
|
||||
svg.append(f' <stop offset="0%" stop-color="#0a0a1a" stop-opacity="0"/>')
|
||||
svg.append(f' <stop offset="{start_pct:.1f}%" stop-color="#0a0a1a" stop-opacity="0"/>')
|
||||
svg.append(f' <stop offset="{end_pct:.1f}%" stop-color="#0a0a1a" stop-opacity="1"/>')
|
||||
|
||||
Reference in New Issue
Block a user