medicine-wheel

medicine-wheel-graph-viz

Medicine Wheel graph visualization — circular layout with four-direction node positioning, ceremony-aware edges, and OCAP® indicators.

Features

Installation

npm install medicine-wheel-graph-viz medicine-wheel-ontology-core

Usage

import { MedicineWheelGraph, buildGraphData } from 'medicine-wheel-graph-viz';

// From ontology-core data
const graphData = buildGraphData(relationalNodes, relationalEdges);

<MedicineWheelGraph
  data={graphData}
  width={600}
  height={600}
  showDirectionLabels
  showQuadrants
  showNodeLabels
  darkMode
  onNodeClick={(node) => console.log('Clicked:', node.label)}
/>

Manual data

const data = {
  nodes: [
    { id: 'n1', label: 'Ceremony', type: 'spirit', direction: 'east' },
    { id: 'n2', label: 'Elder', type: 'human', direction: 'north' },
  ],
  links: [
    { source: 'n1', target: 'n2', label: 'guides', ceremonyHonored: true },
  ],
};

<MedicineWheelGraph data={data} />

API

<MedicineWheelGraph> Props

Prop Type Default Description
data MWGraphData required Nodes and links
width number 600 SVG width
height number 600 SVG height
layout Partial<WheelLayoutConfig> auto Layout configuration
showDirectionLabels boolean true Show direction labels
showQuadrants boolean true Show quadrant backgrounds
showNodeLabels boolean true Show node labels
showLinkLabels boolean false Show link labels
showOcapIndicators boolean false Show OCAP® compliance dots
showWilsonHalos boolean false Show Wilson alignment halos
darkMode boolean true Dark background
onNodeClick (node) => void - Node click handler
onNodeHover (node\|null) => void - Node hover handler
onLinkClick (link) => void - Link click handler

Layout Engine (headless)

import { applyWheelLayout, getQuadrantGeometries } from 'medicine-wheel-graph-viz';

const positioned = applyWheelLayout(data, { radius: 300, centerX: 400, centerY: 400 });

Data Converters

import { buildGraphData, nodesToGraphNodes, edgesToGraphLinks } from 'medicine-wheel-graph-viz';

License

MIT — IAIP Collaborative, Shawinigan, QC