@medicine-wheel/graph-viz 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/interactive/DirectionQuadrant.d.ts +18 -0
- package/dist/interactive/DirectionQuadrant.d.ts.map +1 -0
- package/dist/interactive/DirectionQuadrant.js +23 -0
- package/dist/interactive/DirectionQuadrant.js.map +1 -0
- package/dist/interactive/MedicineWheelFlowGraph.d.ts +53 -0
- package/dist/interactive/MedicineWheelFlowGraph.d.ts.map +1 -0
- package/dist/interactive/MedicineWheelFlowGraph.js +124 -0
- package/dist/interactive/MedicineWheelFlowGraph.js.map +1 -0
- package/dist/interactive/MedicineWheelNode.d.ts +23 -0
- package/dist/interactive/MedicineWheelNode.d.ts.map +1 -0
- package/dist/interactive/MedicineWheelNode.js +87 -0
- package/dist/interactive/MedicineWheelNode.js.map +1 -0
- package/dist/interactive/index.d.ts +16 -0
- package/dist/interactive/index.d.ts.map +1 -0
- package/dist/interactive/index.js +22 -0
- package/dist/interactive/index.js.map +1 -0
- package/package.json +16 -3
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @medicine-wheel/graph-viz — Direction quadrant backdrop
|
|
3
|
+
*
|
|
4
|
+
* Draws the four medicine-wheel direction sectors (East/South/West/North)
|
|
5
|
+
* behind the nodes, in flow coordinates, so the backdrop pans and zooms
|
|
6
|
+
* with the canvas. Reuses `getQuadrantGeometries` + `quadrantArcPath`.
|
|
7
|
+
*
|
|
8
|
+
* The entire backdrop is `pointer-events: none` so it never steals drag /
|
|
9
|
+
* pan gestures from React Flow.
|
|
10
|
+
*/
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import type { WheelLayoutConfig } from '../types.js';
|
|
13
|
+
export interface DirectionQuadrantProps {
|
|
14
|
+
layout?: Partial<WheelLayoutConfig>;
|
|
15
|
+
showLabels?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function DirectionQuadrant({ layout, showLabels, }: DirectionQuadrantProps): React.JSX.Element;
|
|
18
|
+
//# sourceMappingURL=DirectionQuadrant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DirectionQuadrant.d.ts","sourceRoot":"","sources":["../../src/interactive/DirectionQuadrant.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,UAAiB,GAClB,EAAE,sBAAsB,qBA0ExB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DirectionQuadrant = DirectionQuadrant;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("@xyflow/react");
|
|
6
|
+
const layout_js_1 = require("../layout.js");
|
|
7
|
+
function DirectionQuadrant({ layout, showLabels = true, }) {
|
|
8
|
+
const cfg = { ...layout_js_1.DEFAULT_LAYOUT, ...layout };
|
|
9
|
+
const quadrants = (0, layout_js_1.getQuadrantGeometries)(cfg);
|
|
10
|
+
const { centerX, centerY, radius, innerRadius = 60 } = cfg;
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(react_1.ViewportPortal, { children: (0, jsx_runtime_1.jsx)("svg", { style: {
|
|
12
|
+
position: 'absolute',
|
|
13
|
+
left: 0,
|
|
14
|
+
top: 0,
|
|
15
|
+
overflow: 'visible',
|
|
16
|
+
pointerEvents: 'none',
|
|
17
|
+
}, children: (0, jsx_runtime_1.jsxs)("g", { pointerEvents: "none", children: [quadrants.map((q) => ((0, jsx_runtime_1.jsx)("path", { d: (0, layout_js_1.quadrantArcPath)(centerX, centerY, radius, innerRadius, q.startAngle, q.endAngle), fill: q.color, opacity: 0.08, stroke: q.color, strokeOpacity: 0.25, strokeWidth: 1, pointerEvents: "none" }, q.direction))), showLabels &&
|
|
18
|
+
quadrants.map((q) => {
|
|
19
|
+
const pos = (0, layout_js_1.directionLabelPosition)(centerX, centerY, radius, q.direction);
|
|
20
|
+
return ((0, jsx_runtime_1.jsxs)("text", { x: pos.x, y: pos.y, textAnchor: pos.anchor, fill: q.color, fontSize: 14, fontWeight: 700, opacity: 0.7, pointerEvents: "none", children: [q.label, (0, jsx_runtime_1.jsx)("tspan", { x: pos.x, dy: 16, fontSize: 11, fontWeight: 400, opacity: 0.8, children: q.ojibwe })] }, `label-${q.direction}`));
|
|
21
|
+
})] }) }) }));
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=DirectionQuadrant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DirectionQuadrant.js","sourceRoot":"","sources":["../../src/interactive/DirectionQuadrant.tsx"],"names":[],"mappings":";;AA2BA,8CA6EC;;AA5FD,yCAA+C;AAE/C,4CAKsB;AAQtB,SAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,UAAU,GAAG,IAAI,GACM;IACvB,MAAM,GAAG,GAAsB,EAAE,GAAG,0BAAc,EAAE,GAAG,MAAM,EAAE,CAAC;IAChE,MAAM,SAAS,GAAG,IAAA,iCAAqB,EAAC,GAAG,CAAC,CAAC;IAC7C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,GAAG,CAAC;IAE3D,OAAO,CACL,uBAAC,sBAAc,cACb,gCACE,KAAK,EAAE;gBACL,QAAQ,EAAE,UAAU;gBACpB,IAAI,EAAE,CAAC;gBACP,GAAG,EAAE,CAAC;gBACN,QAAQ,EAAE,SAAS;gBACnB,aAAa,EAAE,MAAM;a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el/graph-viz — Interactive React Flow renderer
|
|
3
|
+
*
|
|
4
|
+
* `<MedicineWheelFlowGraph>` is the interactive output strategy for the
|
|
5
|
+
* Medicine Wheel relational web. It reuses the renderer-agnostic
|
|
6
|
+
* `applyWheelLayout` to seed node positions, then hands control to React
|
|
7
|
+
* Flow for drag / pan / zoom / minimap while preserving the four-direction
|
|
8
|
+
* circular semantics (drawn by `<DirectionQuadrant>`).
|
|
9
|
+
*
|
|
10
|
+
* Ship behind the `./interactive` subpath export. `@xyflow/react` is an
|
|
11
|
+
* optional peer — static/server consumers importing from the package root
|
|
12
|
+
* never pull it.
|
|
13
|
+
*
|
|
14
|
+
* The consumer is responsible for importing the React Flow stylesheet once
|
|
15
|
+
* at the app level: `import '@xyflow/react/dist/style.css'`.
|
|
16
|
+
*/
|
|
17
|
+
import React from 'react';
|
|
18
|
+
import type { MWGraphData, MWGraphNode, WheelLayoutConfig } from '../types.js';
|
|
19
|
+
export interface MedicineWheelFlowGraphProps {
|
|
20
|
+
/** Graph data (nodes + links). Re-layout happens whenever this changes. */
|
|
21
|
+
data: MWGraphData;
|
|
22
|
+
/** Layout configuration passed to `applyWheelLayout`. */
|
|
23
|
+
layout?: Partial<WheelLayoutConfig>;
|
|
24
|
+
/** Canvas height (CSS). Width fills the container. Default: 600. */
|
|
25
|
+
height?: number | string;
|
|
26
|
+
/** Dark mode styling. Default: true. */
|
|
27
|
+
darkMode?: boolean;
|
|
28
|
+
/** Show node labels. Default: true. */
|
|
29
|
+
showNodeLabels?: boolean;
|
|
30
|
+
/** Show OCAP® indicators. Default: true. */
|
|
31
|
+
showOcapIndicators?: boolean;
|
|
32
|
+
/** Show Wilson alignment halos. Default: true. */
|
|
33
|
+
showWilsonHalos?: boolean;
|
|
34
|
+
/** Show the four direction-quadrant backdrop. Default: true. */
|
|
35
|
+
showQuadrants?: boolean;
|
|
36
|
+
/** Show direction labels (East/South/West/North + Ojibwe). Default: true. */
|
|
37
|
+
showDirectionLabels?: boolean;
|
|
38
|
+
/** Show the minimap. Default: true. */
|
|
39
|
+
showMiniMap?: boolean;
|
|
40
|
+
/** Show pan/zoom controls. Default: true. */
|
|
41
|
+
showControls?: boolean;
|
|
42
|
+
/** Custom CSS class on the wrapper. */
|
|
43
|
+
className?: string;
|
|
44
|
+
/** Fired when a node is clicked, with the original MWGraphNode. */
|
|
45
|
+
onNodeClick?: (node: MWGraphNode) => void;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Interactive Medicine Wheel graph. Self-contained: wraps its own
|
|
49
|
+
* `<ReactFlowProvider>` so it is safe to mount anywhere (including via
|
|
50
|
+
* `next/dynamic` with `ssr: false`).
|
|
51
|
+
*/
|
|
52
|
+
export declare function MedicineWheelFlowGraph(props: MedicineWheelFlowGraphProps): React.JSX.Element;
|
|
53
|
+
//# sourceMappingURL=MedicineWheelFlowGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MedicineWheelFlowGraph.d.ts","sourceRoot":"","sources":["../../src/interactive/MedicineWheelFlowGraph.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAA0C,MAAM,OAAO,CAAC;AAmB/D,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EAEX,iBAAiB,EAClB,MAAM,aAAa,CAAC;AASrB,MAAM,WAAW,2BAA2B;IAC1C,2EAA2E;IAC3E,IAAI,EAAE,WAAW,CAAC;IAClB,yDAAyD;IACzD,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpC,oEAAoE;IACpE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,4CAA4C;IAC5C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kDAAkD;IAClD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gEAAgE;IAChE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,6EAA6E;IAC7E,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,uCAAuC;IACvC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;CAC3C;AA2KD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,2BAA2B,qBAMxE"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MedicineWheelFlowGraph = MedicineWheelFlowGraph;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/**
|
|
6
|
+
* @medicine-wheel/graph-viz — Interactive React Flow renderer
|
|
7
|
+
*
|
|
8
|
+
* `<MedicineWheelFlowGraph>` is the interactive output strategy for the
|
|
9
|
+
* Medicine Wheel relational web. It reuses the renderer-agnostic
|
|
10
|
+
* `applyWheelLayout` to seed node positions, then hands control to React
|
|
11
|
+
* Flow for drag / pan / zoom / minimap while preserving the four-direction
|
|
12
|
+
* circular semantics (drawn by `<DirectionQuadrant>`).
|
|
13
|
+
*
|
|
14
|
+
* Ship behind the `./interactive` subpath export. `@xyflow/react` is an
|
|
15
|
+
* optional peer — static/server consumers importing from the package root
|
|
16
|
+
* never pull it.
|
|
17
|
+
*
|
|
18
|
+
* The consumer is responsible for importing the React Flow stylesheet once
|
|
19
|
+
* at the app level: `import '@xyflow/react/dist/style.css'`.
|
|
20
|
+
*/
|
|
21
|
+
const react_1 = require("react");
|
|
22
|
+
const react_2 = require("@xyflow/react");
|
|
23
|
+
const ontology_core_1 = require("@medicine-wheel/ontology-core");
|
|
24
|
+
const layout_js_1 = require("../layout.js");
|
|
25
|
+
const MedicineWheelNode_js_1 = require("./MedicineWheelNode.js");
|
|
26
|
+
const DirectionQuadrant_js_1 = require("./DirectionQuadrant.js");
|
|
27
|
+
const NODE_TYPES = { medicineWheel: MedicineWheelNode_js_1.MedicineWheelNode };
|
|
28
|
+
// ── Mappers ─────────────────────────────────────────────────────────────────
|
|
29
|
+
function toFlowNode(node, opts) {
|
|
30
|
+
return {
|
|
31
|
+
id: node.id,
|
|
32
|
+
type: 'medicineWheel',
|
|
33
|
+
position: { x: node.x ?? 0, y: node.y ?? 0 },
|
|
34
|
+
data: {
|
|
35
|
+
node,
|
|
36
|
+
showLabel: opts.showLabel,
|
|
37
|
+
showOcap: opts.showOcap,
|
|
38
|
+
showWilson: opts.showWilson,
|
|
39
|
+
darkMode: opts.darkMode,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function linkStrokeDash(style) {
|
|
44
|
+
switch (style) {
|
|
45
|
+
case 'dashed':
|
|
46
|
+
return '6,3';
|
|
47
|
+
case 'dotted':
|
|
48
|
+
return '2,2';
|
|
49
|
+
case 'ceremony':
|
|
50
|
+
return '8,3,2,3';
|
|
51
|
+
default:
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function toFlowEdge(link, index) {
|
|
56
|
+
const ceremony = link.ceremonyHonored === true;
|
|
57
|
+
const stroke = link.color ?? (ceremony ? '#FFD700' : '#777');
|
|
58
|
+
return {
|
|
59
|
+
// MWGraphLink has no id; synthesize a stable, collision-safe id so
|
|
60
|
+
// parallel edges between the same pair are preserved.
|
|
61
|
+
id: `${link.source}->${link.target}#${index}`,
|
|
62
|
+
source: link.source,
|
|
63
|
+
target: link.target,
|
|
64
|
+
label: link.label,
|
|
65
|
+
animated: ceremony,
|
|
66
|
+
style: {
|
|
67
|
+
stroke,
|
|
68
|
+
strokeWidth: link.width ?? 1 + (link.strength ?? 0.5) * 2,
|
|
69
|
+
strokeDasharray: linkStrokeDash(link.style),
|
|
70
|
+
opacity: 0.6,
|
|
71
|
+
},
|
|
72
|
+
labelStyle: { fill: '#aaa', fontSize: 10 },
|
|
73
|
+
labelBgStyle: { fill: 'transparent' },
|
|
74
|
+
data: { link },
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
// ── Inner (inside ReactFlowProvider) ─────────────────────────────────────────
|
|
78
|
+
function FlowGraphInner({ data, layout, height = 600, darkMode = true, showNodeLabels = true, showOcapIndicators = true, showWilsonHalos = true, showQuadrants = true, showDirectionLabels = true, showMiniMap = true, showControls = true, className, onNodeClick, }) {
|
|
79
|
+
const [nodes, setNodes, onNodesChange] = (0, react_2.useNodesState)([]);
|
|
80
|
+
const [edges, setEdges, onEdgesChange] = (0, react_2.useEdgesState)([]);
|
|
81
|
+
// Re-layout whenever data or display flags change. `applyWheelLayout`
|
|
82
|
+
// mutates node.x/node.y in place, so spread each node defensively to avoid
|
|
83
|
+
// mutating objects owned by the parent's React state.
|
|
84
|
+
(0, react_1.useEffect)(() => {
|
|
85
|
+
const laidOut = (0, layout_js_1.applyWheelLayout)({ nodes: data.nodes.map((n) => ({ ...n })), links: data.links }, layout);
|
|
86
|
+
setNodes(laidOut.nodes.map((n) => toFlowNode(n, {
|
|
87
|
+
showLabel: showNodeLabels,
|
|
88
|
+
showOcap: showOcapIndicators,
|
|
89
|
+
showWilson: showWilsonHalos,
|
|
90
|
+
darkMode,
|
|
91
|
+
})));
|
|
92
|
+
setEdges(data.links.map((l, i) => toFlowEdge(l, i)));
|
|
93
|
+
}, [
|
|
94
|
+
data,
|
|
95
|
+
layout,
|
|
96
|
+
showNodeLabels,
|
|
97
|
+
showOcapIndicators,
|
|
98
|
+
showWilsonHalos,
|
|
99
|
+
darkMode,
|
|
100
|
+
setNodes,
|
|
101
|
+
setEdges,
|
|
102
|
+
]);
|
|
103
|
+
const handleNodeClick = (0, react_1.useCallback)((_event, flowNode) => {
|
|
104
|
+
const original = flowNode.data?.node;
|
|
105
|
+
if (original && onNodeClick)
|
|
106
|
+
onNodeClick(original);
|
|
107
|
+
}, [onNodeClick]);
|
|
108
|
+
const minimapNodeColor = (0, react_1.useCallback)((flowNode) => {
|
|
109
|
+
const n = flowNode.data?.node;
|
|
110
|
+
return n?.color ?? (n ? ontology_core_1.NODE_TYPE_COLORS[n.type] : undefined) ?? '#888';
|
|
111
|
+
}, []);
|
|
112
|
+
const wrapperStyle = (0, react_1.useMemo)(() => ({ width: '100%', height }), [height]);
|
|
113
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: className, style: wrapperStyle, children: (0, jsx_runtime_1.jsxs)(react_2.ReactFlow, { nodes: nodes, edges: edges, nodeTypes: NODE_TYPES, onNodesChange: onNodesChange, onEdgesChange: onEdgesChange, onNodeClick: handleNodeClick, fitView: true, proOptions: { hideAttribution: true }, colorMode: darkMode ? 'dark' : 'light', minZoom: 0.2, maxZoom: 2.5, children: [showQuadrants && ((0, jsx_runtime_1.jsx)(DirectionQuadrant_js_1.DirectionQuadrant, { layout: layout, showLabels: showDirectionLabels })), (0, jsx_runtime_1.jsx)(react_2.Background, { variant: react_2.BackgroundVariant.Dots, gap: 24, size: 1 }), showControls && (0, jsx_runtime_1.jsx)(react_2.Controls, { showInteractive: false }), showMiniMap && ((0, jsx_runtime_1.jsx)(react_2.MiniMap, { pannable: true, zoomable: true, nodeColor: minimapNodeColor, maskColor: darkMode ? 'rgba(0,0,0,0.6)' : 'rgba(255,255,255,0.6)' }))] }) }));
|
|
114
|
+
}
|
|
115
|
+
// ── Public component ─────────────────────────────────────────────────────────
|
|
116
|
+
/**
|
|
117
|
+
* Interactive Medicine Wheel graph. Self-contained: wraps its own
|
|
118
|
+
* `<ReactFlowProvider>` so it is safe to mount anywhere (including via
|
|
119
|
+
* `next/dynamic` with `ssr: false`).
|
|
120
|
+
*/
|
|
121
|
+
function MedicineWheelFlowGraph(props) {
|
|
122
|
+
return ((0, jsx_runtime_1.jsx)(react_2.ReactFlowProvider, { children: (0, jsx_runtime_1.jsx)(FlowGraphInner, { ...props }) }));
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=MedicineWheelFlowGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MedicineWheelFlowGraph.js","sourceRoot":"","sources":["../../src/interactive/MedicineWheelFlowGraph.tsx"],"names":[],"mappings":";;AA6PA,wDAMC;;AAnQD;;;;;;;;;;;;;;;GAeG;AAEH,iCAA+D;AAC/D,yCAauB;AAEvB,iEAAiE;AAEjE,4CAAgE;AAOhE,iEAGgC;AAChC,iEAA2D;AAiC3D,MAAM,UAAU,GAAc,EAAE,aAAa,EAAE,wCAAiB,EAAE,CAAC;AAEnE,+EAA+E;AAE/E,SAAS,UAAU,CACjB,IAAiB,EACjB,IAKC;IAED,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE;QAC5C,IAAI,EAAE;YACJ,IAAI;YACJ,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB;KACF,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,KAA4B;IAClD,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC;QACf,KAAK,UAAU;YACb,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,IAAiB,EAAE,KAAa;IAClD,MAAM,QAAQ,GAAG,IAAI,CAAC,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CAAC,iBAAiB,CAAC,CAAC,CAAC,uBAAuB,GACjE,CACH,IACS,GACR,CACP,CAAC;AACJ,CAAC;AAED,gFAAgF;AAEhF;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,KAAkC;IACvE,OAAO,CACL,uBAAC,yBAAiB,cAChB,uBAAC,cAAc,OAAK,KAAK,GAAI,GACX,CACrB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @medicine-wheel/graph-viz — Interactive custom node
|
|
3
|
+
*
|
|
4
|
+
* Renders a single relational node inside the React Flow canvas:
|
|
5
|
+
* direction-colored circle, OCAP® badge, Wilson alignment halo,
|
|
6
|
+
* node-type icon, and label. Carries (hidden) handles so React Flow
|
|
7
|
+
* can route edges to/from the node center.
|
|
8
|
+
*/
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { type NodeProps } from '@xyflow/react';
|
|
11
|
+
import type { MWGraphNode } from '../types.js';
|
|
12
|
+
/** Data carried on each React Flow node. */
|
|
13
|
+
export interface MedicineWheelNodeData extends Record<string, unknown> {
|
|
14
|
+
node: MWGraphNode;
|
|
15
|
+
showLabel: boolean;
|
|
16
|
+
showOcap: boolean;
|
|
17
|
+
showWilson: boolean;
|
|
18
|
+
darkMode: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare function MedicineWheelNodeComponent({ data, selected }: NodeProps): React.JSX.Element;
|
|
21
|
+
export declare const MedicineWheelNode: React.MemoExoticComponent<typeof MedicineWheelNodeComponent>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=MedicineWheelNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MedicineWheelNode.d.ts","sourceRoot":"","sources":["../../src/interactive/MedicineWheelNode.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAOjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,4CAA4C;AAC5C,MAAM,WAAW,qBAAsB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACpE,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAQD,iBAAS,0BAA0B,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,SAAS,qBA0HhE;AAED,eAAO,MAAM,iBAAiB,8DAAmC,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MedicineWheelNode = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/**
|
|
6
|
+
* @medicine-wheel/graph-viz — Interactive custom node
|
|
7
|
+
*
|
|
8
|
+
* Renders a single relational node inside the React Flow canvas:
|
|
9
|
+
* direction-colored circle, OCAP® badge, Wilson alignment halo,
|
|
10
|
+
* node-type icon, and label. Carries (hidden) handles so React Flow
|
|
11
|
+
* can route edges to/from the node center.
|
|
12
|
+
*/
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const react_2 = require("@xyflow/react");
|
|
15
|
+
const ontology_core_1 = require("@medicine-wheel/ontology-core");
|
|
16
|
+
function wilsonColor(alignment) {
|
|
17
|
+
if (alignment > 0.7)
|
|
18
|
+
return '#4a9e5c';
|
|
19
|
+
if (alignment > 0.4)
|
|
20
|
+
return '#c9a23a';
|
|
21
|
+
return '#dc143c';
|
|
22
|
+
}
|
|
23
|
+
function MedicineWheelNodeComponent({ data, selected }) {
|
|
24
|
+
const { node, showLabel, showOcap, showWilson, darkMode } = data;
|
|
25
|
+
const size = (node.size ?? 8) * 1.6;
|
|
26
|
+
const diameter = size * 2;
|
|
27
|
+
const color = node.color ?? ontology_core_1.NODE_TYPE_COLORS[node.type] ?? '#888';
|
|
28
|
+
const opacity = node.opacity ?? 1;
|
|
29
|
+
const icon = ontology_core_1.CEREMONY_ICONS[node.type];
|
|
30
|
+
const ringColor = showWilson && node.wilsonAlignment !== undefined
|
|
31
|
+
? wilsonColor(node.wilsonAlignment)
|
|
32
|
+
: undefined;
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
34
|
+
position: 'relative',
|
|
35
|
+
width: diameter,
|
|
36
|
+
height: diameter,
|
|
37
|
+
display: 'flex',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
}, title: `${node.label} (${node.type}${node.direction ? ` · ${node.direction}` : ''})`, children: [(0, jsx_runtime_1.jsx)(react_2.Handle, { type: "target", position: react_2.Position.Left, style: { opacity: 0, left: '50%', top: '50%', border: 'none' }, isConnectable: false }), (0, jsx_runtime_1.jsx)(react_2.Handle, { type: "source", position: react_2.Position.Right, style: { opacity: 0, left: '50%', top: '50%', border: 'none' }, isConnectable: false }), ringColor && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
inset: -6,
|
|
43
|
+
borderRadius: '9999px',
|
|
44
|
+
border: `2px ${node.wilsonAlignment > 0.7 ? 'solid' : 'dashed'} ${ringColor}`,
|
|
45
|
+
opacity: 0.6,
|
|
46
|
+
} })), selected && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
inset: -9,
|
|
49
|
+
borderRadius: '9999px',
|
|
50
|
+
border: '2px solid #FFD700',
|
|
51
|
+
opacity: 0.9,
|
|
52
|
+
} })), (0, jsx_runtime_1.jsx)("span", { style: {
|
|
53
|
+
width: diameter,
|
|
54
|
+
height: diameter,
|
|
55
|
+
borderRadius: '9999px',
|
|
56
|
+
background: color,
|
|
57
|
+
opacity,
|
|
58
|
+
border: `1.5px solid ${darkMode ? '#222' : '#fff'}`,
|
|
59
|
+
display: 'flex',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
fontSize: Math.max(10, size * 0.9),
|
|
63
|
+
lineHeight: 1,
|
|
64
|
+
}, children: icon ?? '' }), showOcap && node.ocapCompliant !== undefined && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
65
|
+
position: 'absolute',
|
|
66
|
+
top: -2,
|
|
67
|
+
right: -2,
|
|
68
|
+
width: 8,
|
|
69
|
+
height: 8,
|
|
70
|
+
borderRadius: '9999px',
|
|
71
|
+
background: node.ocapCompliant ? '#4a9e5c' : '#dc143c',
|
|
72
|
+
border: `1px solid ${darkMode ? '#222' : '#fff'}`,
|
|
73
|
+
} })), showLabel && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
74
|
+
position: 'absolute',
|
|
75
|
+
top: diameter + 2,
|
|
76
|
+
left: '50%',
|
|
77
|
+
transform: 'translateX(-50%)',
|
|
78
|
+
whiteSpace: 'nowrap',
|
|
79
|
+
fontSize: 11,
|
|
80
|
+
fontFamily: 'system-ui, sans-serif',
|
|
81
|
+
color: darkMode ? '#ccc' : '#333',
|
|
82
|
+
pointerEvents: 'none',
|
|
83
|
+
}, children: node.label.length > 22 ? node.label.slice(0, 21) + '…' : node.label }))] }));
|
|
84
|
+
}
|
|
85
|
+
exports.MedicineWheelNode = (0, react_1.memo)(MedicineWheelNodeComponent);
|
|
86
|
+
exports.MedicineWheelNode.displayName = 'MedicineWheelNode';
|
|
87
|
+
//# sourceMappingURL=MedicineWheelNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MedicineWheelNode.js","sourceRoot":"","sources":["../../src/interactive/MedicineWheelNode.tsx"],"names":[],"mappings":";;;;AAAA;;;;;;;GAOG;AAEH,iCAAoC;AACpC,yCAAiE;AAEjE,iEAGuC;AAavC,SAAS,WAAW,CAAC,SAAiB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16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @medicine-wheel/graph-viz/interactive
|
|
3
|
+
*
|
|
4
|
+
* Interactive React Flow renderer for the Medicine Wheel relational web.
|
|
5
|
+
* Imported via the `./interactive` subpath export so that static/server
|
|
6
|
+
* consumers of the package root never pull `@xyflow/react`.
|
|
7
|
+
*
|
|
8
|
+
* Peer dependency: `@xyflow/react` (>=12). Consumers must also import the
|
|
9
|
+
* stylesheet once at the app level: `import '@xyflow/react/dist/style.css'`.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
export { MedicineWheelFlowGraph, type MedicineWheelFlowGraphProps, } from './MedicineWheelFlowGraph.js';
|
|
14
|
+
export { MedicineWheelNode, type MedicineWheelNodeData, } from './MedicineWheelNode.js';
|
|
15
|
+
export { DirectionQuadrant, type DirectionQuadrantProps, } from './DirectionQuadrant.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interactive/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,GACjC,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,GAC5B,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @medicine-wheel/graph-viz/interactive
|
|
4
|
+
*
|
|
5
|
+
* Interactive React Flow renderer for the Medicine Wheel relational web.
|
|
6
|
+
* Imported via the `./interactive` subpath export so that static/server
|
|
7
|
+
* consumers of the package root never pull `@xyflow/react`.
|
|
8
|
+
*
|
|
9
|
+
* Peer dependency: `@xyflow/react` (>=12). Consumers must also import the
|
|
10
|
+
* stylesheet once at the app level: `import '@xyflow/react/dist/style.css'`.
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.DirectionQuadrant = exports.MedicineWheelNode = exports.MedicineWheelFlowGraph = void 0;
|
|
16
|
+
var MedicineWheelFlowGraph_js_1 = require("./MedicineWheelFlowGraph.js");
|
|
17
|
+
Object.defineProperty(exports, "MedicineWheelFlowGraph", { enumerable: true, get: function () { return MedicineWheelFlowGraph_js_1.MedicineWheelFlowGraph; } });
|
|
18
|
+
var MedicineWheelNode_js_1 = require("./MedicineWheelNode.js");
|
|
19
|
+
Object.defineProperty(exports, "MedicineWheelNode", { enumerable: true, get: function () { return MedicineWheelNode_js_1.MedicineWheelNode; } });
|
|
20
|
+
var DirectionQuadrant_js_1 = require("./DirectionQuadrant.js");
|
|
21
|
+
Object.defineProperty(exports, "DirectionQuadrant", { enumerable: true, get: function () { return DirectionQuadrant_js_1.DirectionQuadrant; } });
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interactive/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,yEAGqC;AAFnC,mIAAA,sBAAsB,OAAA;AAIxB,+DAGgC;AAF9B,yHAAA,iBAAiB,OAAA;AAInB,+DAGgC;AAF9B,yHAAA,iBAAiB,OAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medicine-wheel/graph-viz",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Medicine Wheel graph visualization — circular layout with four-direction node positioning, ceremony-aware edges, and OCAP® indicators",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"require": "./dist/index.js",
|
|
12
12
|
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./interactive": {
|
|
15
|
+
"import": "./dist/interactive/index.js",
|
|
16
|
+
"types": "./dist/interactive/index.d.ts",
|
|
17
|
+
"require": "./dist/interactive/index.js",
|
|
18
|
+
"default": "./dist/interactive/index.js"
|
|
13
19
|
}
|
|
14
20
|
},
|
|
15
21
|
"sideEffects": false,
|
|
@@ -36,16 +42,23 @@
|
|
|
36
42
|
"author": "IAIP Collaborative - Shawinigan, QC",
|
|
37
43
|
"license": "MIT",
|
|
38
44
|
"dependencies": {
|
|
39
|
-
"@medicine-wheel/ontology-core": "^0.
|
|
45
|
+
"@medicine-wheel/ontology-core": "^0.4.1"
|
|
40
46
|
},
|
|
41
47
|
"peerDependencies": {
|
|
42
48
|
"react": ">=18.0.0",
|
|
43
|
-
"react-dom": ">=18.0.0"
|
|
49
|
+
"react-dom": ">=18.0.0",
|
|
50
|
+
"@xyflow/react": ">=12.0.0"
|
|
51
|
+
},
|
|
52
|
+
"peerDependenciesMeta": {
|
|
53
|
+
"@xyflow/react": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
44
56
|
},
|
|
45
57
|
"devDependencies": {
|
|
46
58
|
"@types/node": "^20.10.0",
|
|
47
59
|
"@types/react": "^19.0.0",
|
|
48
60
|
"@types/react-dom": "^19.0.0",
|
|
61
|
+
"@xyflow/react": "^12.3.0",
|
|
49
62
|
"react": "^19.0.0",
|
|
50
63
|
"react-dom": "^19.0.0",
|
|
51
64
|
"typescript": "^5.3.0"
|