@xyo-network/react-node-renderer 2.47.35

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.
Files changed (83) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +13 -0
  3. package/dist/cjs/components/RelationalGraph.js +24 -0
  4. package/dist/cjs/components/RelationalGraph.js.map +1 -0
  5. package/dist/cjs/components/index.js +5 -0
  6. package/dist/cjs/components/index.js.map +1 -0
  7. package/dist/cjs/components/story/TestData.js +48 -0
  8. package/dist/cjs/components/story/TestData.js.map +1 -0
  9. package/dist/cjs/components/story/index.js +5 -0
  10. package/dist/cjs/components/story/index.js.map +1 -0
  11. package/dist/cjs/hooks/index.js +6 -0
  12. package/dist/cjs/hooks/index.js.map +1 -0
  13. package/dist/cjs/hooks/useCytoscapeElements.js +68 -0
  14. package/dist/cjs/hooks/useCytoscapeElements.js.map +1 -0
  15. package/dist/cjs/hooks/useCytoscapeOptions.js +54 -0
  16. package/dist/cjs/hooks/useCytoscapeOptions.js.map +1 -0
  17. package/dist/cjs/hooks/useIcons.js +33 -0
  18. package/dist/cjs/hooks/useIcons.js.map +1 -0
  19. package/dist/cjs/index.js +6 -0
  20. package/dist/cjs/index.js.map +1 -0
  21. package/dist/cjs/lib/index.js +5 -0
  22. package/dist/cjs/lib/index.js.map +1 -0
  23. package/dist/cjs/lib/utils.js +41 -0
  24. package/dist/cjs/lib/utils.js.map +1 -0
  25. package/dist/docs.json +18746 -0
  26. package/dist/esm/components/RelationalGraph.js +22 -0
  27. package/dist/esm/components/RelationalGraph.js.map +1 -0
  28. package/dist/esm/components/index.js +2 -0
  29. package/dist/esm/components/index.js.map +1 -0
  30. package/dist/esm/components/story/TestData.js +45 -0
  31. package/dist/esm/components/story/TestData.js.map +1 -0
  32. package/dist/esm/components/story/index.js +2 -0
  33. package/dist/esm/components/story/index.js.map +1 -0
  34. package/dist/esm/hooks/index.js +3 -0
  35. package/dist/esm/hooks/index.js.map +1 -0
  36. package/dist/esm/hooks/useCytoscapeElements.js +61 -0
  37. package/dist/esm/hooks/useCytoscapeElements.js.map +1 -0
  38. package/dist/esm/hooks/useCytoscapeOptions.js +50 -0
  39. package/dist/esm/hooks/useCytoscapeOptions.js.map +1 -0
  40. package/dist/esm/hooks/useIcons.js +28 -0
  41. package/dist/esm/hooks/useIcons.js.map +1 -0
  42. package/dist/esm/index.js +3 -0
  43. package/dist/esm/index.js.map +1 -0
  44. package/dist/esm/lib/index.js +2 -0
  45. package/dist/esm/lib/index.js.map +1 -0
  46. package/dist/esm/lib/utils.js +36 -0
  47. package/dist/esm/lib/utils.js.map +1 -0
  48. package/dist/types/components/RelationalGraph.d.ts +9 -0
  49. package/dist/types/components/RelationalGraph.d.ts.map +1 -0
  50. package/dist/types/components/index.d.ts +2 -0
  51. package/dist/types/components/index.d.ts.map +1 -0
  52. package/dist/types/components/story/TestData.d.ts +3 -0
  53. package/dist/types/components/story/TestData.d.ts.map +1 -0
  54. package/dist/types/components/story/index.d.ts +2 -0
  55. package/dist/types/components/story/index.d.ts.map +1 -0
  56. package/dist/types/hooks/index.d.ts +3 -0
  57. package/dist/types/hooks/index.d.ts.map +1 -0
  58. package/dist/types/hooks/useCytoscapeElements.d.ts +6 -0
  59. package/dist/types/hooks/useCytoscapeElements.d.ts.map +1 -0
  60. package/dist/types/hooks/useCytoscapeOptions.d.ts +3 -0
  61. package/dist/types/hooks/useCytoscapeOptions.d.ts.map +1 -0
  62. package/dist/types/hooks/useIcons.d.ts +3 -0
  63. package/dist/types/hooks/useIcons.d.ts.map +1 -0
  64. package/dist/types/index.d.ts +3 -0
  65. package/dist/types/index.d.ts.map +1 -0
  66. package/dist/types/lib/index.d.ts +2 -0
  67. package/dist/types/lib/index.d.ts.map +1 -0
  68. package/dist/types/lib/utils.d.ts +4 -0
  69. package/dist/types/lib/utils.d.ts.map +1 -0
  70. package/package.json +91 -0
  71. package/src/components/RelationalGraph.stories.tsx +86 -0
  72. package/src/components/RelationalGraph.tsx +35 -0
  73. package/src/components/index.ts +1 -0
  74. package/src/components/story/TestData.tsx +49 -0
  75. package/src/components/story/index.ts +1 -0
  76. package/src/hooks/index.ts +2 -0
  77. package/src/hooks/useCytoscapeElements.ts +67 -0
  78. package/src/hooks/useCytoscapeOptions.ts +57 -0
  79. package/src/hooks/useIcons.tsx +33 -0
  80. package/src/index.ts +2 -0
  81. package/src/lib/index.ts +1 -0
  82. package/src/lib/utils.ts +41 -0
  83. package/src/types/images.d.ts +5 -0
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { FlexCol } from '@xylabs/react-flexbox';
3
+ import { useShareForwardedRef } from '@xyo-network/react-shared';
4
+ import cytoscape from 'cytoscape';
5
+ import { forwardRef, useEffect, useState } from 'react';
6
+ export const NodeRelationalGraph = forwardRef(({ children, options, ...props }, ref) => {
7
+ const sharedRef = useShareForwardedRef(ref);
8
+ // TODO - likely a value to stick in context
9
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
+ const [cy, setCy] = useState();
11
+ useEffect(() => {
12
+ if (sharedRef) {
13
+ setCy(cytoscape({
14
+ container: sharedRef.current,
15
+ ...options,
16
+ }));
17
+ }
18
+ }, [options, sharedRef]);
19
+ return (_jsx(FlexCol, { ref: sharedRef, ...props, children: children }));
20
+ });
21
+ NodeRelationalGraph.displayName = 'NodeRelationalGraph';
22
+ //# sourceMappingURL=RelationalGraph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelationalGraph.js","sourceRoot":"","sources":["../../../src/components/RelationalGraph.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAgB,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,SAAqC,MAAM,WAAW,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAMvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAsC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC1H,MAAM,SAAS,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAA;IAC3C,4CAA4C;IAC5C,6DAA6D;IAC7D,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,QAAQ,EAAQ,CAAA;IAEpC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,EAAE;YACb,KAAK,CACH,SAAS,CAAC;gBACR,SAAS,EAAE,SAAS,CAAC,OAAO;gBAC5B,GAAG,OAAO;aACX,CAAC,CACH,CAAA;SACF;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAA;IAExB,OAAO,CACL,KAAC,OAAO,IAAC,GAAG,EAAE,SAAS,KAAM,KAAK,YAC/B,QAAQ,GACD,CACX,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './RelationalGraph';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
@@ -0,0 +1,45 @@
1
+ const elements = [
2
+ {
3
+ // node a
4
+ data: { id: 'a', name: 'element a' },
5
+ },
6
+ {
7
+ // node b
8
+ data: { id: 'b', name: 'element b' },
9
+ },
10
+ {
11
+ // node c
12
+ data: { id: 'c', name: 'element c' },
13
+ },
14
+ {
15
+ // edge ab
16
+ data: { id: 'ab', source: 'a', target: 'b' },
17
+ },
18
+ {
19
+ // edge ac
20
+ data: { id: 'ac', source: 'a', target: 'c' },
21
+ },
22
+ ];
23
+ const style = [
24
+ {
25
+ selector: 'node',
26
+ style: {
27
+ label: 'data(id)',
28
+ },
29
+ },
30
+ {
31
+ selector: 'edge',
32
+ style: {
33
+ 'curve-style': 'bezier',
34
+ 'line-color': '#ccc',
35
+ 'target-arrow-color': '#ccc',
36
+ 'target-arrow-shape': 'triangle',
37
+ width: 3,
38
+ },
39
+ },
40
+ ];
41
+ export const options = {
42
+ elements,
43
+ style,
44
+ };
45
+ //# sourceMappingURL=TestData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestData.js","sourceRoot":"","sources":["../../../../src/components/story/TestData.tsx"],"names":[],"mappings":"AAEA,MAAM,QAAQ,GAAiC;IAC7C;QACE,SAAS;QACT,IAAI,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE;KACrC;IACD;QACE,SAAS;QACT,IAAI,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE;KACrC;IACD;QACE,SAAS;QACT,IAAI,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE;KACrC;IACD;QACE,UAAU;QACV,IAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;KAC7C;IACD;QACE,UAAU;QACV,IAAI,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE;KAC7C;CACF,CAAA;AAED,MAAM,KAAK,GAA8B;IACvC;QACE,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE;YACL,KAAK,EAAE,UAAU;SAClB;KACF;IAED;QACE,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE;YACL,aAAa,EAAE,QAAQ;YACvB,YAAY,EAAE,MAAM;YACpB,oBAAoB,EAAE,MAAM;YAC5B,oBAAoB,EAAE,UAAU;YAChC,KAAK,EAAE,CAAC;SACT;KACF;CACF,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAqB;IACvC,QAAQ;IACR,KAAK;CACN,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './TestData';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/story/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './useCytoscapeElements';
2
+ export * from './useCytoscapeOptions';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,61 @@
1
+ import { useAsyncEffect } from '@xylabs/react-shared';
2
+ import { ModuleWrapper } from '@xyo-network/module';
3
+ import { NodeWrapper } from '@xyo-network/node';
4
+ import { useProvidedWrappedNode } from '@xyo-network/react-node';
5
+ import { useState } from 'react';
6
+ import { parseModuleType } from '../lib';
7
+ /**
8
+ * Note: Relies on describe but could eventually be converted to a discover call
9
+ * Logic would be similar to what the bridge does
10
+ */
11
+ export const useCytoscapeElements = () => {
12
+ const [node] = useProvidedWrappedNode();
13
+ const [elements, setElements] = useState();
14
+ useAsyncEffect(
15
+ // eslint-disable-next-line react-hooks/exhaustive-deps
16
+ async () => {
17
+ if (node) {
18
+ try {
19
+ const newElements = [];
20
+ const wrapper = NodeWrapper.wrap(node);
21
+ const description = await wrapper?.describe();
22
+ const rootNodeId = description.name ?? description.address.substring(0, 6);
23
+ newElements.push({
24
+ data: { id: rootNodeId, type: parseModuleType(description.queries) },
25
+ });
26
+ const children = description.children;
27
+ await Promise.all((children ?? [])?.map(async (address) => {
28
+ const [result] = await wrapper.resolveWrapped(ModuleWrapper, { address: [address] });
29
+ try {
30
+ const description = await result.describe();
31
+ const newNodeId = description.name ?? description.address.substring(0, 6);
32
+ const newNode = {
33
+ data: {
34
+ id: newNodeId,
35
+ type: parseModuleType(description.queries),
36
+ },
37
+ };
38
+ newElements.push(newNode);
39
+ const newEdge = {
40
+ data: {
41
+ id: `${rootNodeId}/${newNodeId}`,
42
+ source: rootNodeId,
43
+ target: newNodeId,
44
+ },
45
+ };
46
+ newElements.push(newEdge);
47
+ }
48
+ catch (e) {
49
+ console.error(e, result);
50
+ }
51
+ }));
52
+ setElements(newElements);
53
+ }
54
+ catch (e) {
55
+ console.error(e);
56
+ }
57
+ }
58
+ }, [node]);
59
+ return elements;
60
+ };
61
+ //# sourceMappingURL=useCytoscapeElements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCytoscapeElements.js","sourceRoot":"","sources":["../../../src/hooks/useCytoscapeElements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAExC;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,MAAM,CAAC,IAAI,CAAC,GAAG,sBAAsB,EAAE,CAAA;IACvC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,EAAgC,CAAA;IAExE,cAAc;IACZ,uDAAuD;IACvD,KAAK,IAAI,EAAE;QACT,IAAI,IAAI,EAAE;YACR,IAAI;gBACF,MAAM,WAAW,GAAG,EAAE,CAAA;gBACtB,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;gBACtC,MAAM,WAAW,GAAG,MAAM,OAAO,EAAE,QAAQ,EAAE,CAAA;gBAC7C,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,OAAO,CAA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,CAAC,WAAW,CAAC,CAAA;aACzB;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;aACjB;SACF;IACH,CAAC,EACD,CAAC,IAAI,CAAC,CACP,CAAA;IAED,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA"}
@@ -0,0 +1,50 @@
1
+ import { useTheme } from '@mui/material';
2
+ import { useMemo } from 'react';
3
+ import { useIcons } from './useIcons';
4
+ export const useCytoscapeOptions = (elements) => {
5
+ const theme = useTheme();
6
+ const icons = useIcons();
7
+ const options = useMemo(() => ({
8
+ elements,
9
+ layout: {
10
+ minNodeSpacing: 75,
11
+ name: 'concentric',
12
+ },
13
+ style: [
14
+ {
15
+ selector: 'node[id]',
16
+ style: {
17
+ color: theme.palette.text.primary,
18
+ 'font-family': 'Lexend Deca, Helvetica, sans-serif',
19
+ 'font-size': 14,
20
+ 'text-margin-y': -5,
21
+ },
22
+ },
23
+ {
24
+ selector: 'node',
25
+ style: {
26
+ 'background-color': theme.palette.primary.main,
27
+ 'background-height': '75%',
28
+ // TODO - make dynamic
29
+ 'background-image': (elem) => icons[elem.data('type')],
30
+ 'background-image-smoothing': 'yes',
31
+ 'background-width': '75%',
32
+ label: 'data(id)',
33
+ },
34
+ },
35
+ {
36
+ selector: 'edge',
37
+ style: {
38
+ 'curve-style': 'bezier',
39
+ 'line-color': theme.palette.divider,
40
+ 'line-opacity': 0.1,
41
+ 'target-arrow-color': theme.palette.divider,
42
+ 'target-arrow-shape': 'triangle',
43
+ width: 3,
44
+ },
45
+ },
46
+ ],
47
+ }), [elements, icons, theme.palette.divider, theme.palette.primary.main, theme.palette.text.primary]);
48
+ return options;
49
+ };
50
+ //# sourceMappingURL=useCytoscapeOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCytoscapeOptions.js","sourceRoot":"","sources":["../../../src/hooks/useCytoscapeOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,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EAAE,CAAC;iBACT;aACF;SACF;KACF,CAAC,EACF,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CACjG,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
@@ -0,0 +1,28 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import GridViewRoundedIcon from '@mui/icons-material/GridViewRounded';
3
+ import HubIcon from '@mui/icons-material/Hub';
4
+ import QuestionMarkRoundedIcon from '@mui/icons-material/QuestionMarkRounded';
5
+ import VisibilityRoundedIcon from '@mui/icons-material/VisibilityRounded';
6
+ import { useTheme } from '@mui/material';
7
+ import { useMemo } from 'react';
8
+ import { encodeSvg } from '../lib';
9
+ // eslint-disable-next-line @typescript-eslint/ban-types
10
+ const CyIconSet = {
11
+ archivist: GridViewRoundedIcon,
12
+ diviner: VisibilityRoundedIcon,
13
+ module: QuestionMarkRoundedIcon,
14
+ node: HubIcon,
15
+ };
16
+ export const useIcons = () => {
17
+ const theme = useTheme();
18
+ const icons = useMemo(() => {
19
+ const iconMap = { archivist: '', diviner: '', module: '', node: '' };
20
+ return Object.entries(CyIconSet).reduce((acc, [name, IconComponent]) => {
21
+ const icon = _jsx(IconComponent, { fontSize: "small" });
22
+ acc[name] = encodeSvg(icon, theme.palette.getContrastText(theme.palette.text.primary));
23
+ return acc;
24
+ }, iconMap);
25
+ }, [theme.palette]);
26
+ return icons;
27
+ };
28
+ //# sourceMappingURL=useIcons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIcons.js","sourceRoot":"","sources":["../../../src/hooks/useIcons.tsx"],"names":[],"mappings":";AAAA,OAAO,mBAAmB,MAAM,qCAAqC,CAAA;AACrE,OAAO,OAAO,MAAM,yBAAyB,CAAA;AAC7C,OAAO,uBAAuB,MAAM,yCA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@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './utils';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
@@ -0,0 +1,36 @@
1
+ // eslint-disable-next-line import/no-internal-modules
2
+ import { renderToStaticMarkup } from 'react-dom/server';
3
+ const dataUri = 'data:image/svg+xml,';
4
+ export const encodeSvg = (reactElement, color) => {
5
+ const svgString = renderToStaticMarkup(reactElement);
6
+ const doc = new DOMParser().parseFromString(svgString, 'text/html');
7
+ const svgElement = doc.getElementsByTagName('svg')[0];
8
+ if (svgElement) {
9
+ svgElement.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
10
+ svgElement.setAttribute('height', '100');
11
+ svgElement.style.fill = color ?? 'black';
12
+ }
13
+ return `${dataUri}${window.encodeURIComponent(svgElement.outerHTML)}`;
14
+ };
15
+ export const parseModuleType = (queries) => {
16
+ let type;
17
+ if (queries) {
18
+ for (let i = 0; i < queries.length; i++) {
19
+ if (queries[i].includes('archivist')) {
20
+ type = 'archivist';
21
+ break;
22
+ }
23
+ if (queries[i].includes('diviner')) {
24
+ type = 'diviner';
25
+ break;
26
+ }
27
+ if (queries[i].includes('node')) {
28
+ type = 'node';
29
+ break;
30
+ }
31
+ type = 'module';
32
+ }
33
+ return type;
34
+ }
35
+ };
36
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AACA,sDAAsD;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAEvD,MAAM,OAAO,GAAG,qBAAqB,CAAA;AAErC,M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B;QACD,OAAO,IAAI,CAAA;KACZ;AACH,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { FlexBoxProps } from '@xylabs/react-flexbox';
3
+ import { WithChildren } from '@xylabs/react-shared';
4
+ import { CytoscapeOptions } from 'cytoscape';
5
+ export interface NodeRelationalGraph extends WithChildren<FlexBoxProps> {
6
+ options?: CytoscapeOptions;
7
+ }
8
+ export declare const NodeRelationalGraph: import("react").ForwardRefExoticComponent<NodeRelationalGraph & import("react").RefAttributes<HTMLDivElement>>;
9
+ //# sourceMappingURL=RelationalGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RelationalGraph.d.ts","sourceRoot":"","sources":["../../../src/components/RelationalGraph.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAW,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,OAAkB,EAAQ,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAG7D,MAAM,WAAW,mBAAoB,SAAQ,YAAY,CAAC,YAAY,CAAC;IACrE,OAAO,CAAC,EAAE,gBAAgB,CAAA;CAC3B;AAED,eAAO,MAAM,mBAAmB,gHAsB9B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './RelationalGraph';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { CytoscapeOptions } from 'cytoscape';
2
+ export declare const options: CytoscapeOptions;
3
+ //# sourceMappingURL=TestData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestData.d.ts","sourceRoot":"","sources":["../../../../src/components/story/TestData.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AA6C5C,eAAO,MAAM,OAAO,EAAE,gBAGrB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './TestData';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/story/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './useCytoscapeElements';
2
+ export * from './useCytoscapeOptions';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Note: Relies on describe but could eventually be converted to a discover call
3
+ * Logic would be similar to what the bridge does
4
+ */
5
+ export declare const useCytoscapeElements: () => import("cytoscape").ElementsDefinition | import("cytoscape").ElementDefinition[] | Promise<import("cytoscape").ElementsDefinition> | Promise<import("cytoscape").ElementDefinition[]> | undefined;
6
+ //# sourceMappingURL=useCytoscapeElements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCytoscapeElements.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCytoscapeElements.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,eAAO,MAAM,oBAAoB,yMAqDhC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { CytoscapeOptions } from 'cytoscape';
2
+ export declare const useCytoscapeOptions: (elements: CytoscapeOptions['elements']) => CytoscapeOptions;
3
+ //# sourceMappingURL=useCytoscapeOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCytoscapeOptions.d.ts","sourceRoot":"","sources":["../../../src/hooks/useCytoscapeOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAK5C,eAAO,MAAM,mBAAmB,aAAc,gBAAgB,CAAC,UAAU,CAAC,qBAkDzE,CAAA"}
@@ -0,0 +1,3 @@
1
+ export type CyNodeIcons = 'node' | 'archivist' | 'diviner' | 'module';
2
+ export declare const useIcons: () => Record<CyNodeIcons, string>;
3
+ //# sourceMappingURL=useIcons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIcons.d.ts","sourceRoot":"","sources":["../../../src/hooks/useIcons.tsx"],"names":[],"mappings":"AAUA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAA;AAUrE,eAAO,MAAM,QAAQ,mCAYpB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './components';
2
+ export * from './hooks';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './utils';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { ReactElement } from 'react';
2
+ export declare const encodeSvg: (reactElement: ReactElement, color?: string) => string;
3
+ export declare const parseModuleType: (queries?: string[]) => string | undefined;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAMpC,eAAO,MAAM,SAAS,iBAAkB,YAAY,UAAU,MAAM,WAYnE,CAAA;AAED,eAAO,MAAM,eAAe,aAAc,MAAM,EAAE,uBAoBjD,CAAA"}
package/package.json ADDED
@@ -0,0 +1,91 @@
1
+ {
2
+ "name": "@xyo-network/react-node-renderer",
3
+ "author": {
4
+ "email": "support@xyo.network",
5
+ "name": "XYO Development Team",
6
+ "url": "https://xyo.network"
7
+ },
8
+ "bugs": {
9
+ "email": "support@xyo.network",
10
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
11
+ },
12
+ "dependencies": {
13
+ "@xylabs/react-flexbox": "^2.16.14",
14
+ "@xylabs/react-shared": "^2.16.14",
15
+ "@xyo-network/module": "^2.53.36",
16
+ "@xyo-network/node": "^2.53.36",
17
+ "@xyo-network/react-node": "^2.47.35",
18
+ "@xyo-network/react-shared": "^2.47.35",
19
+ "cytoscape": "^3.23.0"
20
+ },
21
+ "peerDependencies": {
22
+ "@mui/icons-material": "^5",
23
+ "@mui/material": "^5",
24
+ "@mui/styles": "^5",
25
+ "axios": "^1",
26
+ "react": "^18",
27
+ "react-dom": "^18",
28
+ "react-router-dom": "^6"
29
+ },
30
+ "devDependencies": {
31
+ "@storybook/react": "^6.5.16",
32
+ "@types/cytoscape": "^3.19.9",
33
+ "@types/react-dom": "^18.0.11",
34
+ "@xylabs/ts-scripts-yarn3": "^2.16.1",
35
+ "@xylabs/tsconfig-react": "^2.16.1",
36
+ "@xyo-network/account": "^2.53.34",
37
+ "@xyo-network/archivist": "^2.53.34",
38
+ "@xyo-network/bridge": "^2.53.34",
39
+ "@xyo-network/module": "^2.53.34",
40
+ "@xyo-network/node": "^2.53.34",
41
+ "@xyo-network/react-node": "^2.47.35",
42
+ "@xyo-network/react-storybook": "^2.47.35",
43
+ "@xyo-network/react-wallet": "^2.47.35",
44
+ "require-from-string": "^2.0.2",
45
+ "typescript": "^4.9.5"
46
+ },
47
+ "description": "Common React library for all XYO projects that use React",
48
+ "browser": "dist/esm/index.js",
49
+ "docs": "dist/docs.json",
50
+ "exports": {
51
+ ".": {
52
+ "node": {
53
+ "import": "./dist/esm/index.js",
54
+ "require": "./dist/cjs/index.js"
55
+ },
56
+ "browser": {
57
+ "import": "./dist/esm/index.js",
58
+ "require": "./dist/cjs/index.js"
59
+ },
60
+ "default": "./dist/esm/index.js"
61
+ },
62
+ "./dist/docs.json": {
63
+ "default": "./dist/docs.json"
64
+ },
65
+ "./package.json": "./package.json"
66
+ },
67
+ "main": "dist/cjs/index.js",
68
+ "module": "dist/esm/index.js",
69
+ "homepage": "https://xyo.network",
70
+ "keywords": [
71
+ "xyo",
72
+ "utility",
73
+ "typescript",
74
+ "react"
75
+ ],
76
+ "license": "LGPL-3.0",
77
+ "publishConfig": {
78
+ "access": "public"
79
+ },
80
+ "repository": {
81
+ "type": "git",
82
+ "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js.git"
83
+ },
84
+ "scripts": {
85
+ "lint-pkg": "npmPkgJsonLint .",
86
+ "license": "yarn license-checker --exclude \"MIT, ISC, Apache-2.0, BSD, BSD-2-Clause, CC-BY-4.0, Unlicense, CC-BY-3.0, CC0-1.0\""
87
+ },
88
+ "sideEffects": false,
89
+ "types": "dist/types/index.d.ts",
90
+ "version": "2.47.35"
91
+ }
@@ -0,0 +1,86 @@
1
+ import { ComponentStory, DecoratorFn, Meta } from '@storybook/react'
2
+ import { useAsyncEffect } from '@xylabs/react-shared'
3
+ import { HDWallet } from '@xyo-network/account'
4
+ import { ArchivistConfigSchema, MemoryArchivist } from '@xyo-network/archivist'
5
+ import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/bridge'
6
+ import { MemoryNode, NodeConfigSchema } from '@xyo-network/node'
7
+ import { NodeProvider } from '@xyo-network/react-node'
8
+ import { DefaultSeedPhrase } from '@xyo-network/react-storybook'
9
+ import { WalletProvider } from '@xyo-network/react-wallet'
10
+ import { useState } from 'react'
11
+
12
+ import { useCytoscapeElements, useCytoscapeOptions } from '../hooks'
13
+ import { NodeRelationalGraph } from './RelationalGraph'
14
+ import { options } from './story'
15
+
16
+ const nodeUrl = 'http://localhost:8080/node'
17
+ const randomWallet = HDWallet.fromMnemonic(DefaultSeedPhrase)
18
+
19
+ export const MemoryNodeDecorator: DecoratorFn = (Story, args) => {
20
+ const [node, setNode] = useState<MemoryNode>()
21
+
22
+ useAsyncEffect(
23
+ // eslint-disable-next-line react-hooks/exhaustive-deps
24
+ async () => {
25
+ const node = await MemoryNode.create({ config: { name: 'GlobalNode', schema: NodeConfigSchema } })
26
+ const node1 = await MemoryNode.create({ config: { name: 'ChildNode', schema: NodeConfigSchema } })
27
+ const bridge = await HttpBridge.create({
28
+ config: { name: 'Bridge', nodeUrl, schema: HttpBridgeConfigSchema, security: { allowAnonymous: true } },
29
+ })
30
+ await node.register(bridge)
31
+ await node.attach(bridge.address, true)
32
+
33
+ const archivist = await MemoryArchivist.create({ config: { name: 'RootStorageArchivist', schema: ArchivistConfigSchema } })
34
+ await node.register(archivist)
35
+ await node.attach(archivist.address, true)
36
+
37
+ const archivist1 = await MemoryArchivist.create({ config: { name: 'RootStorageArchivist1', schema: ArchivistConfigSchema } })
38
+ await node1.register(archivist1)
39
+ await node1.attach(archivist1.address, true)
40
+
41
+ await node.register(node1)
42
+ await node.attach(node1.address, true)
43
+
44
+ setNode(node)
45
+ },
46
+ [],
47
+ )
48
+
49
+ return (
50
+ <WalletProvider defaultWallet={randomWallet}>
51
+ <NodeProvider node={node}>
52
+ <Story {...args} />
53
+ </NodeProvider>
54
+ </WalletProvider>
55
+ )
56
+ }
57
+
58
+ // eslint-disable-next-line import/no-default-export
59
+ export default {
60
+ component: NodeRelationalGraph,
61
+ title: 'node/renderer/NodeRelationalGraph',
62
+ } as Meta
63
+
64
+ const Template: ComponentStory<typeof NodeRelationalGraph> = (props) => <NodeRelationalGraph {...props} />
65
+ const TemplateDescribe: ComponentStory<typeof NodeRelationalGraph> = (props) => {
66
+ const elements = useCytoscapeElements()
67
+ const options = useCytoscapeOptions(elements)
68
+ return <NodeRelationalGraph options={options} {...props} />
69
+ }
70
+
71
+ const defaultProps = {
72
+ height: 'calc(100vh - 20px)',
73
+ width: '100%',
74
+ }
75
+
76
+ const Default = Template.bind({})
77
+ Default.args = {}
78
+
79
+ const WithData = Template.bind({})
80
+ WithData.args = { options, ...defaultProps }
81
+
82
+ const WithDescribe = TemplateDescribe.bind({})
83
+ WithDescribe.args = { ...defaultProps }
84
+ WithDescribe.decorators = [MemoryNodeDecorator]
85
+
86
+ export { Default, WithData, WithDescribe }