@xyo-network/react-node-renderer 2.49.2 → 2.49.4
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/cjs/components/ProvidedNodeRenderer.js +17 -0
- package/dist/cjs/components/ProvidedNodeRenderer.js.map +1 -0
- package/dist/cjs/components/RelationalGraph.js.map +1 -1
- package/dist/cjs/components/index.js +1 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/lib/RelationalGraphProps.js +3 -0
- package/dist/cjs/components/lib/RelationalGraphProps.js.map +1 -0
- package/dist/cjs/components/lib/index.js +5 -0
- package/dist/cjs/components/lib/index.js.map +1 -0
- package/dist/docs.json +951 -849
- package/dist/esm/components/ProvidedNodeRenderer.js +11 -0
- package/dist/esm/components/ProvidedNodeRenderer.js.map +1 -0
- package/dist/esm/components/RelationalGraph.js.map +1 -1
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/lib/RelationalGraphProps.js +2 -0
- package/dist/esm/components/lib/RelationalGraphProps.js.map +1 -0
- package/dist/esm/components/lib/index.js +2 -0
- package/dist/esm/components/lib/index.js.map +1 -0
- package/dist/types/components/ProvidedNodeRenderer.d.ts +8 -0
- package/dist/types/components/ProvidedNodeRenderer.d.ts.map +1 -0
- package/dist/types/components/RelationalGraph.d.ts +3 -8
- package/dist/types/components/RelationalGraph.d.ts.map +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/components/lib/RelationalGraphProps.d.ts +8 -0
- package/dist/types/components/lib/RelationalGraphProps.d.ts.map +1 -0
- package/dist/types/components/lib/index.d.ts +2 -0
- package/dist/types/components/lib/index.d.ts.map +1 -0
- package/package.json +17 -16
- package/src/components/ProvidedNodeRenderer.tsx +18 -0
- package/src/components/RelationalGraph.stories.tsx +11 -4
- package/src/components/RelationalGraph.tsx +5 -9
- package/src/components/index.ts +1 -0
- package/src/components/lib/RelationalGraphProps.ts +8 -0
- package/src/components/lib/index.ts +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useProvidedWrappedNode } from '@xyo-network/react-node';
|
|
3
|
+
import { useCytoscapeElements, useCytoscapeOptions } from '../hooks';
|
|
4
|
+
import { NodeRelationalGraph } from './RelationalGraph';
|
|
5
|
+
export const ProvidedNodeRenderer = ({ node, ...props }) => {
|
|
6
|
+
const [providedNode] = useProvidedWrappedNode();
|
|
7
|
+
const elements = useCytoscapeElements(node ?? providedNode);
|
|
8
|
+
const options = useCytoscapeOptions(elements);
|
|
9
|
+
return _jsx(NodeRelationalGraph, { alignItems: "stretch", flexGrow: 1, height: "100%", options: options, ...props });
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=ProvidedNodeRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProvidedNodeRenderer.js","sourceRoot":"","sources":["../../../src/components/ProvidedNodeRenderer.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAEhE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAMvD,MAAM,CAAC,MAAM,oBAAoB,GAAwC,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAC9F,MAAM,CAAC,YAAY,CAAC,GAAG,sBAAsB,EAAE,CAAA;IAC/C,MAAM,QAAQ,GAAG,oBAAoB,CAAC,IAAI,IAAI,YAAY,CAAC,CAAA;IAC3D,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAA;IAE7C,OAAO,KAAC,mBAAmB,IAAC,UAAU,EAAC,SAAS,EAAC,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,KAAM,KAAK,GAAI,CAAA;AAC7G,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationalGraph.js","sourceRoot":"","sources":["../../../src/components/RelationalGraph.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"RelationalGraph.js","sourceRoot":"","sources":["../../../src/components/RelationalGraph.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,SAAmB,MAAM,WAAW,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAGlD,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAA2C,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC9H,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,GAAG,QAAQ,EAAQ,CAAA;IACpC,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,oBAAoB,EAAE,CAAA;IACtD,MAAM,SAAS,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAA;IAE3C,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,EAAE,EAAE,KAAK,EAAE,CAAA;QACX,EAAE,EAAE,GAAG,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IACxB,CAAC,CAAA;IAED,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,SAAS,EAAE;YACb,MAAM,KAAK,GAAG,SAAS,CAAC;gBACtB,SAAS,EAAE,SAAS,CAAC,OAAO;gBAC5B,GAAG,OAAO;aACX,CAAC,CAAA;YACF,KAAK,CAAC,KAAK,CAAC,CAAA;SACb;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAA;IAExB,SAAS,CAAC,GAAG,EAAE;QACb,YAAY,EAAE,CAAC,EAAE,CAAC,CAAA;IACpB,CAAC,EAAE,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,CAAA;IAEtB,OAAO,CACL,MAAC,OAAO,OAAK,KAAK,aAChB,MAAC,gBAAgB,eACd,OAAO,EACR,KAAC,MAAM,IAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,sBAExD,IACQ,EACnB,KAAC,OAAO,IAAC,UAAU,EAAC,SAAS,EAAC,MAAM,EAAC,MAAM,EAAC,QAAQ,EAAC,UAAU,EAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAC,MAAM,GAAW,IAC/F,CACX,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAA;AAEvD,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5E,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,MAAM;IACb,GAAG,EAAE,MAAM;IACX,MAAM,EAAE,CAAC;CACV,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelationalGraphProps.js","sourceRoot":"","sources":["../../../../src/components/lib/RelationalGraphProps.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NodeWrapper } from '@xyo-network/node';
|
|
3
|
+
import { NodeRelationalGraphProps } from './lib';
|
|
4
|
+
export interface ProvidedNodeRendererProps extends NodeRelationalGraphProps {
|
|
5
|
+
node?: NodeWrapper;
|
|
6
|
+
}
|
|
7
|
+
export declare const ProvidedNodeRenderer: React.FC<ProvidedNodeRendererProps>;
|
|
8
|
+
//# sourceMappingURL=ProvidedNodeRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProvidedNodeRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/ProvidedNodeRenderer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAI/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAA;AAGhD,MAAM,WAAW,yBAA0B,SAAQ,wBAAwB;IACzE,IAAI,CAAC,EAAE,WAAW,CAAA;CACnB;AAED,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAMpE,CAAA"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export interface NodeRelationalGraph extends FlexBoxProps {
|
|
5
|
-
actions?: ReactNode;
|
|
6
|
-
options?: CytoscapeOptions;
|
|
7
|
-
}
|
|
8
|
-
export declare const NodeRelationalGraph: import("react").ForwardRefExoticComponent<NodeRelationalGraph & import("react").RefAttributes<HTMLDivElement>>;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { NodeRelationalGraphProps } from './lib';
|
|
3
|
+
export declare const NodeRelationalGraph: import("react").ForwardRefExoticComponent<NodeRelationalGraphProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
4
|
//# sourceMappingURL=RelationalGraph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationalGraph.d.ts","sourceRoot":"","sources":["../../../src/components/RelationalGraph.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RelationalGraph.d.ts","sourceRoot":"","sources":["../../../src/components/RelationalGraph.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAA;AAEhD,eAAO,MAAM,mBAAmB,qHAmC9B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
2
|
+
import { CytoscapeOptions } from 'cytoscape';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export interface NodeRelationalGraphProps extends FlexBoxProps {
|
|
5
|
+
actions?: ReactNode;
|
|
6
|
+
options?: CytoscapeOptions;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=RelationalGraphProps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RelationalGraphProps.d.ts","sourceRoot":"","sources":["../../../../src/components/lib/RelationalGraphProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,OAAO,CAAC,EAAE,gBAAgB,CAAA;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA"}
|
package/package.json
CHANGED
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
"@xylabs/react-async-effect": "^2.17.2",
|
|
14
14
|
"@xylabs/react-flexbox": "^2.17.2",
|
|
15
15
|
"@xylabs/react-shared": "^2.17.2",
|
|
16
|
-
"@xyo-network/module": "^2.56.
|
|
17
|
-
"@xyo-network/node": "^2.56.
|
|
18
|
-
"@xyo-network/react-
|
|
16
|
+
"@xyo-network/module": "^2.56.2",
|
|
17
|
+
"@xyo-network/node": "^2.56.2",
|
|
18
|
+
"@xyo-network/react-node": "^2.49.4",
|
|
19
|
+
"@xyo-network/react-shared": "^2.49.4",
|
|
19
20
|
"cytoscape": "^3.24.0"
|
|
20
21
|
},
|
|
21
22
|
"peerDependencies": {
|
|
@@ -28,21 +29,21 @@
|
|
|
28
29
|
"react-router-dom": "^6"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"@storybook/react": "^7.0.
|
|
32
|
+
"@storybook/react": "^7.0.8",
|
|
32
33
|
"@types/cytoscape": "^3.19.9",
|
|
33
|
-
"@types/react-dom": "^18.2.
|
|
34
|
+
"@types/react-dom": "^18.2.3",
|
|
34
35
|
"@xylabs/ts-scripts-yarn3": "^2.17.6",
|
|
35
36
|
"@xylabs/tsconfig-react": "^2.17.5",
|
|
36
|
-
"@xyo-network/account": "^2.56.
|
|
37
|
-
"@xyo-network/archivist": "^2.56.
|
|
38
|
-
"@xyo-network/bridge": "^2.56.
|
|
39
|
-
"@xyo-network/id-plugin": "^2.56.
|
|
40
|
-
"@xyo-network/module": "^2.56.
|
|
41
|
-
"@xyo-network/node": "^2.56.
|
|
42
|
-
"@xyo-network/react-node": "^2.49.
|
|
43
|
-
"@xyo-network/react-storybook": "^2.49.
|
|
44
|
-
"@xyo-network/react-wallet": "^2.49.
|
|
45
|
-
"@xyo-network/sentinel": "^2.56.
|
|
37
|
+
"@xyo-network/account": "^2.56.2",
|
|
38
|
+
"@xyo-network/archivist": "^2.56.2",
|
|
39
|
+
"@xyo-network/bridge": "^2.56.2",
|
|
40
|
+
"@xyo-network/id-plugin": "^2.56.2",
|
|
41
|
+
"@xyo-network/module": "^2.56.2",
|
|
42
|
+
"@xyo-network/node": "^2.56.2",
|
|
43
|
+
"@xyo-network/react-node": "^2.49.4",
|
|
44
|
+
"@xyo-network/react-storybook": "^2.49.4",
|
|
45
|
+
"@xyo-network/react-wallet": "^2.49.4",
|
|
46
|
+
"@xyo-network/sentinel": "^2.56.2",
|
|
46
47
|
"typescript": "^5.0.4"
|
|
47
48
|
},
|
|
48
49
|
"description": "Common React library for all XYO projects that use React",
|
|
@@ -88,5 +89,5 @@
|
|
|
88
89
|
},
|
|
89
90
|
"sideEffects": false,
|
|
90
91
|
"types": "dist/types/index.d.ts",
|
|
91
|
-
"version": "2.49.
|
|
92
|
+
"version": "2.49.4"
|
|
92
93
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NodeWrapper } from '@xyo-network/node'
|
|
2
|
+
import { useProvidedWrappedNode } from '@xyo-network/react-node'
|
|
3
|
+
|
|
4
|
+
import { useCytoscapeElements, useCytoscapeOptions } from '../hooks'
|
|
5
|
+
import { NodeRelationalGraphProps } from './lib'
|
|
6
|
+
import { NodeRelationalGraph } from './RelationalGraph'
|
|
7
|
+
|
|
8
|
+
export interface ProvidedNodeRendererProps extends NodeRelationalGraphProps {
|
|
9
|
+
node?: NodeWrapper
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const ProvidedNodeRenderer: React.FC<ProvidedNodeRendererProps> = ({ node, ...props }) => {
|
|
13
|
+
const [providedNode] = useProvidedWrappedNode()
|
|
14
|
+
const elements = useCytoscapeElements(node ?? providedNode)
|
|
15
|
+
const options = useCytoscapeOptions(elements)
|
|
16
|
+
|
|
17
|
+
return <NodeRelationalGraph alignItems="stretch" flexGrow={1} height="100%" options={options} {...props} />
|
|
18
|
+
}
|
|
@@ -2,7 +2,7 @@ import { Button, ButtonGroup } from '@mui/material'
|
|
|
2
2
|
import { Decorator, Meta, StoryFn } from '@storybook/react'
|
|
3
3
|
import { useAsyncEffect } from '@xylabs/react-async-effect'
|
|
4
4
|
import { HDWallet } from '@xyo-network/account'
|
|
5
|
-
import {
|
|
5
|
+
import { MemoryArchivist, MemoryArchivistConfigSchema } from '@xyo-network/archivist'
|
|
6
6
|
import { HttpBridge, HttpBridgeConfigSchema } from '@xyo-network/bridge'
|
|
7
7
|
import { IdWitness, IdWitnessConfigSchema } from '@xyo-network/id-plugin'
|
|
8
8
|
import { MemoryNode, NodeConfigSchema, NodeWrapper } from '@xyo-network/node'
|
|
@@ -13,6 +13,7 @@ import { MemorySentinel, SentinelConfigSchema } from '@xyo-network/sentinel'
|
|
|
13
13
|
import { useMemo, useState } from 'react'
|
|
14
14
|
|
|
15
15
|
import { useCytoscapeElements, useCytoscapeOptions } from '../hooks'
|
|
16
|
+
import { ProvidedNodeRenderer } from './ProvidedNodeRenderer'
|
|
16
17
|
import { NodeRelationalGraph } from './RelationalGraph'
|
|
17
18
|
import { options } from './story'
|
|
18
19
|
|
|
@@ -34,7 +35,7 @@ export const MemoryNodeDecorator: Decorator = (Story, args) => {
|
|
|
34
35
|
await node.register(bridge)
|
|
35
36
|
await node.attach(bridge.address, true)
|
|
36
37
|
|
|
37
|
-
const archivist = await MemoryArchivist.create({ config: { name: 'RootStorageArchivist', schema:
|
|
38
|
+
const archivist = await MemoryArchivist.create({ config: { name: 'RootStorageArchivist', schema: MemoryArchivistConfigSchema } })
|
|
38
39
|
await node.register(archivist)
|
|
39
40
|
await node.attach(archivist.address, true)
|
|
40
41
|
|
|
@@ -42,7 +43,7 @@ export const MemoryNodeDecorator: Decorator = (Story, args) => {
|
|
|
42
43
|
await node.register(sentinel)
|
|
43
44
|
await node.attach(sentinel.address, true)
|
|
44
45
|
|
|
45
|
-
const archivist1 = await MemoryArchivist.create({ config: { name: 'RootStorageArchivist1', schema:
|
|
46
|
+
const archivist1 = await MemoryArchivist.create({ config: { name: 'RootStorageArchivist1', schema: MemoryArchivistConfigSchema } })
|
|
46
47
|
await node1.register(archivist1)
|
|
47
48
|
await node1.attach(archivist1.address, true)
|
|
48
49
|
|
|
@@ -89,6 +90,8 @@ const TemplateCustomAddress: StoryFn<typeof NodeRelationalGraph> = (props) => {
|
|
|
89
90
|
return <NodeRelationalGraph options={options} {...props} />
|
|
90
91
|
}
|
|
91
92
|
|
|
93
|
+
const TemplateProvidedNodeRenderer: StoryFn<typeof ProvidedNodeRenderer> = (props) => <ProvidedNodeRenderer {...props} />
|
|
94
|
+
|
|
92
95
|
const TemplateAttachDetach: StoryFn<typeof NodeRelationalGraph> = (props) => {
|
|
93
96
|
const [node] = useModule('ChildNode')
|
|
94
97
|
const wrappedNode = useMemo(() => (node ? NodeWrapper.wrap(node) : undefined), [node])
|
|
@@ -156,4 +159,8 @@ const WithAttachDetach = TemplateAttachDetach.bind({})
|
|
|
156
159
|
WithAttachDetach.args = { ...defaultProps }
|
|
157
160
|
WithAttachDetach.decorators = [MemoryNodeDecorator]
|
|
158
161
|
|
|
159
|
-
|
|
162
|
+
const WithProvidedNodeRenderer = TemplateProvidedNodeRenderer.bind({})
|
|
163
|
+
WithProvidedNodeRenderer.args = { ...defaultProps }
|
|
164
|
+
WithProvidedNodeRenderer.decorators = [MemoryNodeDecorator]
|
|
165
|
+
|
|
166
|
+
export { Default, WithAttachDetach, WithCustomAddress, WithData, WithDescribe, WithProvidedNodeRenderer }
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { Button, styled } from '@mui/material'
|
|
2
|
-
import {
|
|
2
|
+
import { FlexCol, FlexRow } from '@xylabs/react-flexbox'
|
|
3
3
|
import { useShareForwardedRef } from '@xyo-network/react-shared'
|
|
4
|
-
import cytoscape, { Core
|
|
5
|
-
import { forwardRef,
|
|
4
|
+
import cytoscape, { Core } from 'cytoscape'
|
|
5
|
+
import { forwardRef, useEffect, useState } from 'react'
|
|
6
6
|
|
|
7
7
|
import { useCytoscapeInstance } from '../contexts'
|
|
8
|
+
import { NodeRelationalGraphProps } from './lib'
|
|
8
9
|
|
|
9
|
-
export
|
|
10
|
-
actions?: ReactNode
|
|
11
|
-
options?: CytoscapeOptions
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const NodeRelationalGraph = forwardRef<HTMLDivElement, NodeRelationalGraph>(({ actions, options, ...props }, ref) => {
|
|
10
|
+
export const NodeRelationalGraph = forwardRef<HTMLDivElement, NodeRelationalGraphProps>(({ actions, options, ...props }, ref) => {
|
|
15
11
|
const [cy, setCy] = useState<Core>()
|
|
16
12
|
const { setCy: setCyContext } = useCytoscapeInstance()
|
|
17
13
|
const sharedRef = useShareForwardedRef(ref)
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RelationalGraphProps'
|