|
| 1 | +# Graph Semantic Map Implementation Plan |
| 2 | + |
| 3 | +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. |
| 4 | +
|
| 5 | +**Goal:** Replace the current graph framing with a true semantic map stage that uses stable x/y semantics, Nobel reference beacons, and stage-only pan/zoom. |
| 6 | + |
| 7 | +**Architecture:** Keep `GraphPage` and the existing drawer/detail UI, but move graph positioning into a semantic projection layer. Render the dense node/edge layer on canvas, while using an SVG overlay for axes, domain bands, Nobel beacons, and stage framing. Derive node positions from public-domain anchors and execution-maturity bands instead of raw force-layout coordinates. |
| 8 | + |
| 9 | +**Tech Stack:** React, TypeScript, canvas 2D, SVG overlay, existing theme tokens, existing public-domain mapping |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +### Task 1: Add Semantic Layout Utilities |
| 14 | + |
| 15 | +**Files:** |
| 16 | +- Create: `src/utils/graphSemanticLayout.ts` |
| 17 | +- Create: `scripts/graph-semantic-layout-check.ts` |
| 18 | + |
| 19 | +- [ ] Define public x-axis anchors for the 9 public domains and four y-axis maturity bands in `src/utils/graphSemanticLayout.ts`. |
| 20 | +- [ ] Add deterministic jitter helpers seeded by node id so the semantic map feels organic but remains stable across reloads. |
| 21 | +- [ ] Export a `projectSemanticNode(node)` function that returns semantic `x`, `y`, public-domain label, and maturity band. |
| 22 | +- [ ] Write `scripts/graph-semantic-layout-check.ts` first with assertions that: |
| 23 | + - `pretraining` projects into `Information Science` |
| 24 | + - `physics` projects into the `Physics` x-band |
| 25 | + - `status: "hypothesis"` projects into the top maturity band |
| 26 | + - execution-bearing nodes project into lower bands |
| 27 | +- [ ] Run a TypeScript compile check on the script and confirm it fails before the helper exists or before exports line up. |
| 28 | +- [ ] Implement the helper minimally until the check script compiles and passes. |
| 29 | + |
| 30 | +### Task 2: Add Nobel Reference Data |
| 31 | + |
| 32 | +**Files:** |
| 33 | +- Create: `src/utils/nobelReferences.ts` |
| 34 | +- Reference: `../ScivBook/frontend/src/data/nobelPrizes.json` |
| 35 | + |
| 36 | +- [ ] Copy the Nobel records needed for the semantic map into a local `nobelReferences.ts` dataset so SeevoMap does not depend on the ScivBook project at runtime. |
| 37 | +- [ ] Normalize each Nobel entry into: |
| 38 | + - `id` |
| 39 | + - `year` |
| 40 | + - `field` |
| 41 | + - `contribution` |
| 42 | + - `publicDomain` |
| 43 | + - `xBand` |
| 44 | + - `yBand` |
| 45 | +- [ ] Keep the first implementation lightweight: beacons may be static reference marks and do not need full detail panels. |
| 46 | + |
| 47 | +### Task 3: Refactor GraphVisualization Into a Semantic Stage |
| 48 | + |
| 49 | +**Files:** |
| 50 | +- Modify: `src/components/GraphVisualization.tsx` |
| 51 | + |
| 52 | +- [ ] Replace the current "entire full-screen canvas is pannable" interaction with a bounded semantic stage. |
| 53 | +- [ ] Restrict pan/zoom to pointer interactions that start inside the semantic stage. |
| 54 | +- [ ] Render the stage boundary and axis frame in SVG so it remains crisp and synchronized with camera movement. |
| 55 | +- [ ] Replace the current semantic overlay with: |
| 56 | + - x-axis macro/micro guide |
| 57 | + - y-axis execution-maturity guide |
| 58 | + - 9 public-domain labels along the x-axis |
| 59 | + - 4 maturity labels along the y-axis |
| 60 | +- [ ] Use `projectSemanticNode()` for node positions instead of raw `node.x/node.y` when drawing the semantic map. |
| 61 | +- [ ] Continue to use the existing hover and click behavior, but translate hit testing to semantic positions. |
| 62 | +- [ ] Reduce edge density or edge prominence so the result reads as a map, not a wire cloud. |
| 63 | + |
| 64 | +### Task 4: Nobel Beacon Overlay |
| 65 | + |
| 66 | +**Files:** |
| 67 | +- Modify: `src/components/GraphVisualization.tsx` |
| 68 | +- Reference: `src/utils/nobelReferences.ts` |
| 69 | + |
| 70 | +- [ ] Render Nobel beacons above the stage background and below the selected-node UI. |
| 71 | +- [ ] Give beacons lighter visual weight than SeevoMap nodes so they guide reading without overpowering the map. |
| 72 | +- [ ] Reuse the ScivBook-style reference idea: |
| 73 | + - beacons are semantic anchors |
| 74 | + - they are not part of graph filtering |
| 75 | + - they help users orient by field and maturity |
| 76 | +- [ ] Spread Nobel beacons across the full semantic field using the scale-map coordinates as the primary signal, instead of collapsing them into tight domain-local stacks. |
| 77 | +- [ ] Add a lightweight legend and hover introduction so users understand that the beacons are Nobel reference landmarks rather than regular graph nodes. |
| 78 | + |
| 79 | +### Task 5: Verification |
| 80 | + |
| 81 | +**Files:** |
| 82 | +- Modify: none |
| 83 | + |
| 84 | +- [ ] Run `npm run build`. |
| 85 | +- [ ] Restart `npm run dev:local`. |
| 86 | +- [ ] Verify locally on `/#/graph`: |
| 87 | + - only the stage area is draggable |
| 88 | + - the graph fills the stage more tightly |
| 89 | + - the x-axis shows both macro/micro direction and 9 public domains |
| 90 | + - the y-axis shows the 4 execution-maturity bands |
| 91 | + - Nobel beacons render as reference markers |
| 92 | + - drawer filtering, hover, and selected-node detail still work |
0 commit comments