fix(graph): stop corpus-graph labels overlapping #118

Merged
chaim merged 1 commits from worktree-corpus-graph-labels into main 2026-06-07 20:07:57 +00:00
Owner

תיקון לדף /graph (PR #113) — התוויות נערמו אחת על השנייה (במיוחד בתצוגת השכנים).

שני שורשים, שניהם ב‑graph-canvas.tsx:

  1. הגופן גדל בהתרחקות (zoom out) — חולק ב‑sqrt(globalScale) עם רצפה +6, כך שבתצוגה כללית התוויות הפכו ענקיות והתנגשו. עכשיו גודל הגופן קבוע בפיקסלי‑מסך (fontPx / globalScale).
  2. כל הנקודות צוירו עם תווית בו‑זמנית. עכשיו תוויות מגודרות לפי זום: בתצוגה כללית רק הנקודה הפעילה + 3 נקודות‑התחום + הפסיקות המצוטטות ביותר (size≥4); נקודות‑נושא מ‑zoom 1.05, השאר מ‑1.5 — כשכבר יש מקום בין הנקודות.

בנוסף: הילה לבנה (strokeText) מאחורי כל תווית לקריאוּת, ו‑d3 forces חזקים יותר (charge −220, link distance 60) כדי לפזר את הנקודות.

build עובר; /graph בטבלת ה‑routes.

🤖 Generated with Claude Code

תיקון לדף `/graph` (PR #113) — התוויות נערמו אחת על השנייה (במיוחד בתצוגת השכנים). **שני שורשים, שניהם ב‑`graph-canvas.tsx`:** 1. **הגופן גדל בהתרחקות (zoom out)** — חולק ב‑`sqrt(globalScale)` עם רצפה `+6`, כך שבתצוגה כללית התוויות הפכו ענקיות והתנגשו. עכשיו גודל הגופן **קבוע בפיקסלי‑מסך** (`fontPx / globalScale`). 2. **כל הנקודות צוירו עם תווית בו‑זמנית.** עכשיו תוויות **מגודרות לפי זום**: בתצוגה כללית רק הנקודה הפעילה + 3 נקודות‑התחום + הפסיקות המצוטטות ביותר (size≥4); נקודות‑נושא מ‑zoom 1.05, השאר מ‑1.5 — כשכבר יש מקום בין הנקודות. **בנוסף:** הילה לבנה (`strokeText`) מאחורי כל תווית לקריאוּת, ו‑d3 forces חזקים יותר (charge −220, link distance 60) כדי לפזר את הנקודות. build עובר; `/graph` בטבלת ה‑routes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chaim added 1 commit 2026-06-07 20:07:51 +00:00
Labels piled on top of each other (esp. in the neighborhood view) for two
reasons, both fixed in graph-canvas.tsx:

1. Font grew as you zoomed OUT (size was divided by sqrt(globalScale) and had
   a +6 floor), so at overview zoom labels became huge and collided. Now the
   label font is a ~constant SCREEN size (fontPx / globalScale).

2. Every node drew its label at once. Now labels are zoom-gated: at overview
   zoom only the active node, the 3 practice-area hubs, and the most-cited
   precedents (size>=4) are labeled; topic hubs appear at >=1.05 and the rest
   at >=1.5 — by which point there is pixel room between nodes.

Also: a white halo (strokeText) behind each label for legibility over edges
and nearby nodes, and stronger d3 forces (charge -220, link distance 60) so
nodes spread out and labels have more room.

web-ui build passes; /graph in the route table.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chaim merged commit 879bb6c074 into main 2026-06-07 20:07:57 +00:00
chaim deleted branch worktree-corpus-graph-labels 2026-06-07 20:07:58 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ezer-mishpati/legal-ai#118