@xpressai/xircuits-viewer-react 0.1.0
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/XircuitsGraph.d.ts +21 -0
- package/dist/XircuitsGraph.d.ts.map +1 -0
- package/dist/XircuitsGraph.js +76 -0
- package/dist/XircuitsGraph.js.map +1 -0
- package/dist/XircuitsGraphStatic.d.ts +17 -0
- package/dist/XircuitsGraphStatic.d.ts.map +1 -0
- package/dist/XircuitsGraphStatic.js +39 -0
- package/dist/XircuitsGraphStatic.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/package.json +29 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { XNode, XEdge } from '@xpressai/xircuits-viewer';
|
|
3
|
+
export interface XircuitsGraphProps {
|
|
4
|
+
/** URL or path to a .xircuits file. Fetched at mount time. */
|
|
5
|
+
src?: string;
|
|
6
|
+
/** Pre-loaded .xircuits JSON data. Takes precedence over src. */
|
|
7
|
+
data?: object;
|
|
8
|
+
theme?: 'dark' | 'light';
|
|
9
|
+
interactive?: boolean;
|
|
10
|
+
fitView?: boolean;
|
|
11
|
+
width?: number | string;
|
|
12
|
+
height?: number | string;
|
|
13
|
+
padding?: number;
|
|
14
|
+
className?: string;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
onNodeClick?: (node: XNode) => void;
|
|
17
|
+
onEdgeClick?: (edge: XEdge) => void;
|
|
18
|
+
onError?: (error: Error) => void;
|
|
19
|
+
}
|
|
20
|
+
export declare function XircuitsGraph({ src, data, theme, interactive, fitView, width, height, padding, className, style, onNodeClick, onEdgeClick, onError, }: XircuitsGraphProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=XircuitsGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XircuitsGraph.d.ts","sourceRoot":"","sources":["../src/XircuitsGraph.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,8DAA8D;IAC9D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,wBAAgB,aAAa,CAAC,EAC5B,GAAG,EACH,IAAI,EACJ,KAAc,EACd,WAAkB,EAClB,OAAc,EACd,KAAc,EACd,MAAY,EACZ,OAAO,EACP,SAAS,EACT,KAAK,EACL,WAAW,EACX,WAAW,EACX,OAAO,GACR,EAAE,kBAAkB,2CAuFpB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { parse, renderToElement } from '@xpressai/xircuits-viewer';
|
|
4
|
+
import { attachPanZoom } from '@xpressai/xircuits-viewer/interaction';
|
|
5
|
+
export function XircuitsGraph({ src, data, theme = 'dark', interactive = true, fitView = true, width = '100%', height = 400, padding, className, style, onNodeClick, onEdgeClick, onError, }) {
|
|
6
|
+
const containerRef = useRef(null);
|
|
7
|
+
const [fetchedData, setFetchedData] = useState(null);
|
|
8
|
+
const [error, setError] = useState(null);
|
|
9
|
+
// Fetch from src when no data is provided
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (data || !src)
|
|
12
|
+
return;
|
|
13
|
+
let cancelled = false;
|
|
14
|
+
fetch(src)
|
|
15
|
+
.then(res => {
|
|
16
|
+
if (!res.ok)
|
|
17
|
+
throw new Error(`Failed to load ${src}: ${res.status}`);
|
|
18
|
+
return res.json();
|
|
19
|
+
})
|
|
20
|
+
.then(json => { if (!cancelled)
|
|
21
|
+
setFetchedData(json); })
|
|
22
|
+
.catch(err => {
|
|
23
|
+
if (!cancelled) {
|
|
24
|
+
setError(err.message);
|
|
25
|
+
onError?.(err);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return () => { cancelled = true; };
|
|
29
|
+
}, [src, data]);
|
|
30
|
+
const resolvedData = data || fetchedData;
|
|
31
|
+
// Render SVG when data is available
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (!containerRef.current || !resolvedData)
|
|
34
|
+
return;
|
|
35
|
+
const graph = parse(resolvedData);
|
|
36
|
+
const svg = renderToElement(graph, { theme, fitView, padding });
|
|
37
|
+
containerRef.current.innerHTML = '';
|
|
38
|
+
containerRef.current.appendChild(svg);
|
|
39
|
+
let cleanup;
|
|
40
|
+
if (interactive) {
|
|
41
|
+
cleanup = attachPanZoom(svg).destroy;
|
|
42
|
+
}
|
|
43
|
+
const handleClick = (e) => {
|
|
44
|
+
const target = e.target;
|
|
45
|
+
if (onNodeClick) {
|
|
46
|
+
const nodeEl = target.closest('.xg-node');
|
|
47
|
+
if (nodeEl) {
|
|
48
|
+
const nodeId = nodeEl.getAttribute('data-node-id');
|
|
49
|
+
const node = graph.nodes.find(n => n.id === nodeId);
|
|
50
|
+
if (node)
|
|
51
|
+
onNodeClick(node);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (onEdgeClick) {
|
|
55
|
+
const edgeEl = target.closest('.xg-edge-group');
|
|
56
|
+
if (edgeEl) {
|
|
57
|
+
const edgeId = edgeEl.getAttribute('data-edge-id');
|
|
58
|
+
const edge = graph.edges.find(e => e.id === edgeId);
|
|
59
|
+
if (edge)
|
|
60
|
+
onEdgeClick(edge);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
svg.addEventListener('click', handleClick);
|
|
65
|
+
return () => {
|
|
66
|
+
cleanup?.();
|
|
67
|
+
svg.removeEventListener('click', handleClick);
|
|
68
|
+
};
|
|
69
|
+
}, [resolvedData, theme, interactive, fitView, padding]);
|
|
70
|
+
return (_jsxs("div", { ref: containerRef, className: className, style: {
|
|
71
|
+
width: typeof width === 'number' ? `${width}px` : width,
|
|
72
|
+
height: typeof height === 'number' ? `${height}px` : height,
|
|
73
|
+
...style,
|
|
74
|
+
}, children: [error && _jsx("div", { style: { color: 'red', padding: 8 }, children: error }), !resolvedData && !error && src && _jsx("div", { style: { color: '#888', padding: 8 }, children: "Loading..." })] }));
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=XircuitsGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XircuitsGraph.js","sourceRoot":"","sources":["../src/XircuitsGraph.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAqBtE,MAAM,UAAU,aAAa,CAAC,EAC5B,GAAG,EACH,IAAI,EACJ,KAAK,GAAG,MAAM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time. */
|
|
4
|
+
src?: string;
|
|
5
|
+
/** Pre-loaded .xircuits JSON data. Takes precedence over src. */
|
|
6
|
+
data?: object;
|
|
7
|
+
theme?: 'dark' | 'light';
|
|
8
|
+
fitView?: boolean;
|
|
9
|
+
width?: number | string;
|
|
10
|
+
height?: number | string;
|
|
11
|
+
padding?: number;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
onError?: (error: Error) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function XircuitsGraphStatic({ src, data, theme, fitView, width, height, padding, className, style, onError, }: XircuitsGraphStaticProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=XircuitsGraphStatic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XircuitsGraphStatic.d.ts","sourceRoot":"","sources":["../src/XircuitsGraphStatic.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,MAAM,WAAW,wBAAwB;IACvC,8DAA8D;IAC9D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,IAAI,EACJ,KAAc,EACd,OAAc,EACd,KAAc,EACd,MAAe,EACf,OAAO,EACP,SAAS,EACT,KAAK,EACL,OAAO,GACR,EAAE,wBAAwB,2CA8C1B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { parse, renderToString } from '@xpressai/xircuits-viewer';
|
|
4
|
+
export function XircuitsGraphStatic({ src, data, theme = 'dark', fitView = true, width = '100%', height = 'auto', padding, className, style, onError, }) {
|
|
5
|
+
const [fetchedData, setFetchedData] = useState(null);
|
|
6
|
+
const [error, setError] = useState(null);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (data || !src)
|
|
9
|
+
return;
|
|
10
|
+
let cancelled = false;
|
|
11
|
+
fetch(src)
|
|
12
|
+
.then(res => {
|
|
13
|
+
if (!res.ok)
|
|
14
|
+
throw new Error(`Failed to load ${src}: ${res.status}`);
|
|
15
|
+
return res.json();
|
|
16
|
+
})
|
|
17
|
+
.then(json => { if (!cancelled)
|
|
18
|
+
setFetchedData(json); })
|
|
19
|
+
.catch(err => {
|
|
20
|
+
if (!cancelled) {
|
|
21
|
+
setError(err.message);
|
|
22
|
+
onError?.(err);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return () => { cancelled = true; };
|
|
26
|
+
}, [src, data]);
|
|
27
|
+
const resolvedData = data || fetchedData;
|
|
28
|
+
let svgString = '';
|
|
29
|
+
if (resolvedData) {
|
|
30
|
+
const graph = parse(resolvedData);
|
|
31
|
+
svgString = renderToString(graph, { theme, fitView, padding });
|
|
32
|
+
}
|
|
33
|
+
return (_jsxs("div", { className: className, style: {
|
|
34
|
+
width: typeof width === 'number' ? `${width}px` : width,
|
|
35
|
+
height: typeof height === 'number' ? `${height}px` : height,
|
|
36
|
+
...style,
|
|
37
|
+
}, children: [error && _jsx("div", { style: { color: 'red', padding: 8 }, children: error }), !resolvedData && !error && src && _jsx("div", { style: { color: '#888', padding: 8 }, children: "Loading..." }), svgString && _jsx("div", { dangerouslySetInnerHTML: { __html: svgString } })] }));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=XircuitsGraphStatic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"XircuitsGraphStatic.js","sourceRoot":"","sources":["../src/XircuitsGraphStatic.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAiBlE,MAAM,UAAU,mBAAmB,CAAC,EAClC,GAAG,EACH,IAAI,EACJ,KAAK,GAAG,MAAM,EACd,OAAO,GAAG,IAAI,EACd,KAAK,GAAG,MAAM,EACd,MAAM,GAAG,MAAM,EACf,OAAO,EACP,SAAS,EACT,KAAK,EACL,OAAO,GACkB;IACzB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACpE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAExD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,IAAI,IAAI,CAAC,GAAG;YAAE,OAAO;QACzB,IAAI,SAAS,GAAG,KAAK,CAAC;QAEtB,KAAK,CAAC,GAAG,CAAC;aACP,IAAI,CAAC,GAAG,CAAC,EAAE;YACV,IAAI,CAAC,GAAG,CAAC,EAAE;gBAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,KAAK,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;YACrE,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS;YAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;aACvD,KAAK,CAAC,GAAG,CAAC,EAAE;YACX,IAAI,CAAC,SAAS,EAAE,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
1
|
+
export { XircuitsGraph } from './XircuitsGraph.js';
|
|
2
|
+
export type { XircuitsGraphProps } from './XircuitsGraph.js';
|
|
3
|
+
export { XircuitsGraphStatic } from './XircuitsGraphStatic.js';
|
|
4
|
+
export type { XircuitsGraphStaticProps } from './XircuitsGraphStatic.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,YAAY,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xpressai/xircuits-viewer-react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": ["dist"],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"dev": "tsc --watch"
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"react": ">=18"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@xpressai/xircuits-viewer": "^0.1.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"react": "^18.3.1",
|
|
26
|
+
"@types/react": "^18.3.12",
|
|
27
|
+
"typescript": "^5.8.3"
|
|
28
|
+
}
|
|
29
|
+
}
|