Extract the “Relational Web” UI from app/relations/page.tsx into a reusable package at src/relational-web/ to enable its use in other Medicine Wheel applications.
The Relational Web page is a monolithic Next.js page combining:
Create @medicine-wheel/relational-web package with modular components:
| Component | Purpose |
|---|---|
RelationalWebGraph |
SVG graph with draggable nodes, edge rendering |
AddNodeForm |
Form for creating new RelationalNode |
RelationalHealthPanel |
Stats display (node count, edge count, health metrics) |
NodeDetailSidebar |
Inspector panel for selected node |
@medicine-wheel/ontology-core — types (RelationalNode, RelationalEdge)@medicine-wheel/ui-components — shared UI primitivessrc/relational-web/
├── package.json
├── src/
│ ├── index.ts
│ ├── RelationalWebGraph.tsx
│ ├── AddNodeForm.tsx
│ ├── RelationalHealthPanel.tsx
│ ├── NodeDetailSidebar.tsx
│ └── hooks/
│ └── useRelationalData.ts
└── tsconfig.json
// Consumer usage
import {
RelationalWebGraph,
AddNodeForm,
RelationalHealthPanel,
useRelationalData
} from '@medicine-wheel/relational-web';