medicine-wheel

Relational Web Package Extraction

Intent

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.

Current State

The Relational Web page is a monolithic Next.js page combining:

Target State

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

Dependencies

Package Structure

src/relational-web/
├── package.json
├── src/
│   ├── index.ts
│   ├── RelationalWebGraph.tsx
│   ├── AddNodeForm.tsx
│   ├── RelationalHealthPanel.tsx
│   ├── NodeDetailSidebar.tsx
│   └── hooks/
│       └── useRelationalData.ts
└── tsconfig.json

API Surface

// Consumer usage
import { 
  RelationalWebGraph, 
  AddNodeForm, 
  RelationalHealthPanel,
  useRelationalData 
} from '@medicine-wheel/relational-web';

Notes