@xyo-network/react-node-renderer 4.4.10 → 5.0.0-rc.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/browser/index.mjs +5 -5
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/Cytoscape/CytoscapeElements.d.ts +29 -0
- package/dist/types/Cytoscape/CytoscapeElements.d.ts.map +1 -0
- package/dist/types/Cytoscape/CytoscapeIcons.d.ts +4 -0
- package/dist/types/Cytoscape/CytoscapeIcons.d.ts.map +1 -0
- package/dist/types/Cytoscape/CytoscapeStyles.d.ts +7 -0
- package/dist/types/Cytoscape/CytoscapeStyles.d.ts.map +1 -0
- package/dist/types/Cytoscape/index.d.ts +5 -0
- package/dist/types/Cytoscape/index.d.ts.map +1 -0
- package/dist/types/Cytoscape/lib/CyNodeModuleTypes.d.ts +2 -0
- package/dist/types/Cytoscape/lib/CyNodeModuleTypes.d.ts.map +1 -0
- package/dist/types/Cytoscape/lib/encodeSvg.d.ts +3 -0
- package/dist/types/Cytoscape/lib/encodeSvg.d.ts.map +1 -0
- package/dist/types/Cytoscape/lib/iconMap.d.ts +3 -0
- package/dist/types/Cytoscape/lib/iconMap.d.ts.map +1 -0
- package/dist/types/Cytoscape/lib/index.d.ts +6 -0
- package/dist/types/Cytoscape/lib/index.d.ts.map +1 -0
- package/dist/types/Cytoscape/lib/layout/ColaLayout.d.ts +6 -0
- package/dist/types/Cytoscape/lib/layout/ColaLayout.d.ts.map +1 -0
- package/dist/types/Cytoscape/lib/layout/ConcentricLayout.d.ts +3 -0
- package/dist/types/Cytoscape/lib/layout/ConcentricLayout.d.ts.map +1 -0
- package/dist/types/Cytoscape/lib/layout/index.d.ts +3 -0
- package/dist/types/Cytoscape/lib/layout/index.d.ts.map +1 -0
- package/dist/types/Cytoscape/lib/parseModuleType.d.ts +4 -0
- package/dist/types/Cytoscape/lib/parseModuleType.d.ts.map +1 -0
- package/dist/types/components/cytoscape-extensions/WithExtensions.d.ts +4 -0
- package/dist/types/components/cytoscape-extensions/WithExtensions.d.ts.map +1 -0
- package/dist/types/components/cytoscape-extensions/index.d.ts +2 -0
- package/dist/types/components/cytoscape-extensions/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/components/lib/RelationalGraphProps.d.ts +16 -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/dist/types/components/module/CardParser.d.ts +7 -0
- package/dist/types/components/module/CardParser.d.ts.map +1 -0
- package/dist/types/components/module/graph/DetailsFlexbox.d.ts +7 -0
- package/dist/types/components/module/graph/DetailsFlexbox.d.ts.map +1 -0
- package/dist/types/components/module/graph/GraphFlexBox.d.ts +13 -0
- package/dist/types/components/module/graph/GraphFlexBox.d.ts.map +1 -0
- package/dist/types/components/module/graph/Popper.d.ts +13 -0
- package/dist/types/components/module/graph/Popper.d.ts.map +1 -0
- package/dist/types/components/module/graph/index.d.ts +2 -0
- package/dist/types/components/module/graph/index.d.ts.map +1 -0
- package/dist/types/components/module/graph/node/Hover.d.ts +10 -0
- package/dist/types/components/module/graph/node/Hover.d.ts.map +1 -0
- package/dist/types/components/module/graph/node/hooks/index.d.ts +2 -0
- package/dist/types/components/module/graph/node/hooks/index.d.ts.map +1 -0
- package/dist/types/components/module/graph/node/hooks/useNodeElement.d.ts +7 -0
- package/dist/types/components/module/graph/node/hooks/useNodeElement.d.ts.map +1 -0
- package/dist/types/components/module/graph/node/index.d.ts +2 -0
- package/dist/types/components/module/graph/node/index.d.ts.map +1 -0
- package/dist/types/components/module/index.d.ts +3 -0
- package/dist/types/components/module/index.d.ts.map +1 -0
- package/dist/types/components/relational/graph/Graph.d.ts +16 -0
- package/dist/types/components/relational/graph/Graph.d.ts.map +1 -0
- package/dist/types/components/relational/graph/ProvidedNodeRenderer.d.ts +12 -0
- package/dist/types/components/relational/graph/ProvidedNodeRenderer.d.ts.map +1 -0
- package/dist/types/components/relational/graph/index.d.ts +3 -0
- package/dist/types/components/relational/graph/index.d.ts.map +1 -0
- package/dist/types/components/relational/graph/story/TestData.d.ts +3 -0
- package/dist/types/components/relational/graph/story/TestData.d.ts.map +1 -0
- package/dist/types/components/relational/graph/story/index.d.ts +2 -0
- package/dist/types/components/relational/graph/story/index.d.ts.map +1 -0
- package/dist/types/components/relational/index.d.ts +2 -0
- package/dist/types/components/relational/index.d.ts.map +1 -0
- package/dist/types/contexts/CytoscapeInstance/Context.d.ts +3 -0
- package/dist/types/contexts/CytoscapeInstance/Context.d.ts.map +1 -0
- package/dist/types/contexts/CytoscapeInstance/Provider.d.ts +8 -0
- package/dist/types/contexts/CytoscapeInstance/Provider.d.ts.map +1 -0
- package/dist/types/contexts/CytoscapeInstance/State.d.ts +8 -0
- package/dist/types/contexts/CytoscapeInstance/State.d.ts.map +1 -0
- package/dist/types/contexts/CytoscapeInstance/index.d.ts +5 -0
- package/dist/types/contexts/CytoscapeInstance/index.d.ts.map +1 -0
- package/dist/types/contexts/CytoscapeInstance/use.d.ts +2 -0
- package/dist/types/contexts/CytoscapeInstance/use.d.ts.map +1 -0
- package/dist/types/contexts/index.d.ts +2 -0
- package/dist/types/contexts/index.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/elements/index.d.ts +3 -0
- package/dist/types/hooks/cytoscape/elements/index.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/elements/useCytoscapeElements.d.ts +4 -0
- package/dist/types/hooks/cytoscape/elements/useCytoscapeElements.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/elements/useElements.d.ts +6 -0
- package/dist/types/hooks/cytoscape/elements/useElements.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/elements/useHoveredNode.d.ts +4 -0
- package/dist/types/hooks/cytoscape/elements/useHoveredNode.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/elements/useNewElements.d.ts +3 -0
- package/dist/types/hooks/cytoscape/elements/useNewElements.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/elements/useRenderNewElements.d.ts +3 -0
- package/dist/types/hooks/cytoscape/elements/useRenderNewElements.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/elements/useSelectedElement.d.ts +6 -0
- package/dist/types/hooks/cytoscape/elements/useSelectedElement.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/index.d.ts +5 -0
- package/dist/types/hooks/cytoscape/index.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/useCytoscapeOptions.d.ts +3 -0
- package/dist/types/hooks/cytoscape/useCytoscapeOptions.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/useCytoscapeStyle.d.ts +2 -0
- package/dist/types/hooks/cytoscape/useCytoscapeStyle.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/useIcons.d.ts +3 -0
- package/dist/types/hooks/cytoscape/useIcons.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/useModuleDetails.d.ts +16 -0
- package/dist/types/hooks/cytoscape/useModuleDetails.d.ts.map +1 -0
- package/dist/types/hooks/cytoscape/useRelationalGraphOptions.d.ts +7 -0
- package/dist/types/hooks/cytoscape/useRelationalGraphOptions.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +46 -44
- package/src/components/relational/graph/Graph.tsx +102 -104
- package/src/contexts/CytoscapeInstance/Provider.tsx +2 -2
- package/dist/browser/index.d.ts +0 -148
|
@@ -16,7 +16,7 @@ import coseBilkentLayout from 'cytoscape-cose-bilkent'
|
|
|
16
16
|
import dagre from 'cytoscape-dagre'
|
|
17
17
|
import eulerLayout from 'cytoscape-euler'
|
|
18
18
|
import React, {
|
|
19
|
-
|
|
19
|
+
useEffect, useRef, useState,
|
|
20
20
|
} from 'react'
|
|
21
21
|
|
|
22
22
|
import type { NodeRelationalGraphProps } from '../../lib/index.ts'
|
|
@@ -72,120 +72,118 @@ const ModuleHoverDetails: React.FC<ModuleHoverDetailsProps> = ({
|
|
|
72
72
|
)
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
export const NodeRelationalGraphFlexBox =
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const [hoverAddress, setHoverAddress] = useState<Address>()
|
|
75
|
+
export const NodeRelationalGraphFlexBox = ({
|
|
76
|
+
ref, actions, children, node, layout, layoutOptions, showDetails, detail, options, onHover, ...props
|
|
77
|
+
}: NodeRelationalGraphProps & { ref?: React.RefObject<HTMLDivElement | null> }) => {
|
|
78
|
+
const theme = useTheme()
|
|
79
|
+
const [cy, setCy] = useState<Core>()
|
|
80
|
+
const cytoscapeRef = useRef<HTMLDivElement>(null)
|
|
81
|
+
const [hoverPosition, setHoverBoundingBox] = useState<{ x1: number; x2: number; y1: number; y2: number }>()
|
|
82
|
+
const [hoverAddress, setHoverAddress] = useState<Address>()
|
|
84
83
|
|
|
85
|
-
|
|
84
|
+
const [moduleInstance] = useWeakModuleFromNode(hoverAddress, { node })
|
|
86
85
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
86
|
+
useEffect(() => {
|
|
87
|
+
cy?.on('mouseover tap', ({ target }) => {
|
|
88
|
+
const cyNode = target as NodeSingular
|
|
89
|
+
const bb = cyNode?.renderedBoundingBox?.()
|
|
90
|
+
setHoverBoundingBox(bb)
|
|
91
|
+
const id = cyNode.id?.()
|
|
92
|
+
if (id) {
|
|
93
|
+
if (id.includes('/')) {
|
|
94
|
+
setHoverAddress(undefined)
|
|
95
|
+
onHover?.()
|
|
96
|
+
} else {
|
|
97
|
+
setHoverAddress(asAddress(id))
|
|
98
|
+
onHover?.(asAddress(id))
|
|
101
99
|
}
|
|
100
|
+
}
|
|
101
|
+
})
|
|
102
|
+
}, [onHover, cy])
|
|
103
|
+
|
|
104
|
+
const handleReset = () => {
|
|
105
|
+
cy?.reset()
|
|
106
|
+
applyLayout(cy, layout ?? 'euler', layoutOptions)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
let newCy: Core | undefined
|
|
111
|
+
const container = cytoscapeRef.current
|
|
112
|
+
if (container) {
|
|
113
|
+
newCy = cytoscape({
|
|
114
|
+
container,
|
|
115
|
+
...options,
|
|
102
116
|
})
|
|
103
|
-
|
|
117
|
+
// eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect
|
|
118
|
+
setCy(newCy)
|
|
119
|
+
} else {
|
|
120
|
+
newCy?.destroy()
|
|
121
|
+
// eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect
|
|
122
|
+
setCy(undefined)
|
|
123
|
+
}
|
|
124
|
+
return () => {
|
|
125
|
+
newCy?.destroy()
|
|
126
|
+
setCy(undefined)
|
|
127
|
+
}
|
|
128
|
+
}, [options, cytoscapeRef, layoutOptions])
|
|
104
129
|
|
|
105
|
-
|
|
106
|
-
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
if (cy) {
|
|
132
|
+
loadLayout(layout)
|
|
107
133
|
applyLayout(cy, layout ?? 'euler', layoutOptions)
|
|
108
134
|
}
|
|
135
|
+
}, [cy, layoutOptions, layout])
|
|
109
136
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
newCy?.destroy()
|
|
127
|
-
setCy(undefined)
|
|
128
|
-
}
|
|
129
|
-
}, [options, cytoscapeRef, layoutOptions])
|
|
130
|
-
|
|
131
|
-
useEffect(() => {
|
|
132
|
-
if (cy) {
|
|
133
|
-
loadLayout(layout)
|
|
134
|
-
applyLayout(cy, layout ?? 'euler', layoutOptions)
|
|
135
|
-
}
|
|
136
|
-
}, [cy, layoutOptions, layout])
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
<FlexCol id="relational-graph-wrapper" ref={ref} {...props}>
|
|
140
|
-
{hoverAddress && hoverPosition
|
|
141
|
-
? (
|
|
142
|
-
<Box position="absolute" top={hoverPosition.y1} left={hoverPosition.x1} zIndex={100}>
|
|
143
|
-
<ModuleHoverDetails address={hoverAddress} name={moduleInstance?.deref()?.id ?? 'Unknown'} />
|
|
144
|
-
</Box>
|
|
145
|
-
)
|
|
146
|
-
: null}
|
|
147
|
-
<FlexRow justifyContent="start" width="100%">
|
|
148
|
-
{actions === null
|
|
149
|
-
? null
|
|
150
|
-
: actions
|
|
151
|
-
? (
|
|
152
|
-
<ButtonGroup>
|
|
153
|
-
{actions}
|
|
154
|
-
<Button size="small" variant="contained" onClick={handleReset}>
|
|
155
|
-
Reset View
|
|
156
|
-
</Button>
|
|
157
|
-
</ButtonGroup>
|
|
158
|
-
)
|
|
159
|
-
: (
|
|
137
|
+
return (
|
|
138
|
+
<FlexCol id="relational-graph-wrapper" ref={ref} {...props}>
|
|
139
|
+
{hoverAddress && hoverPosition
|
|
140
|
+
? (
|
|
141
|
+
<Box position="absolute" top={hoverPosition.y1} left={hoverPosition.x1} zIndex={100}>
|
|
142
|
+
<ModuleHoverDetails address={hoverAddress} name={moduleInstance?.deref()?.id ?? 'Unknown'} />
|
|
143
|
+
</Box>
|
|
144
|
+
)
|
|
145
|
+
: null}
|
|
146
|
+
<FlexRow justifyContent="start" width="100%">
|
|
147
|
+
{actions === null
|
|
148
|
+
? null
|
|
149
|
+
: actions
|
|
150
|
+
? (
|
|
151
|
+
<ButtonGroup>
|
|
152
|
+
{actions}
|
|
160
153
|
<Button size="small" variant="contained" onClick={handleReset}>
|
|
161
|
-
Reset
|
|
154
|
+
Reset View
|
|
162
155
|
</Button>
|
|
163
|
-
|
|
164
|
-
</FlexRow>
|
|
165
|
-
<FlexGrowRow width="100%" alignItems="start">
|
|
166
|
-
{showDetails
|
|
167
|
-
? (
|
|
168
|
-
<FlexCol height="100%" width="85%">
|
|
169
|
-
{detail}
|
|
170
|
-
</FlexCol>
|
|
156
|
+
</ButtonGroup>
|
|
171
157
|
)
|
|
172
|
-
:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
158
|
+
: (
|
|
159
|
+
<Button size="small" variant="contained" onClick={handleReset}>
|
|
160
|
+
Reset
|
|
161
|
+
</Button>
|
|
162
|
+
)}
|
|
163
|
+
</FlexRow>
|
|
164
|
+
<FlexGrowRow width="100%" alignItems="start">
|
|
165
|
+
{showDetails
|
|
166
|
+
? (
|
|
167
|
+
<FlexCol height="100%" width="85%">
|
|
168
|
+
{detail}
|
|
169
|
+
</FlexCol>
|
|
170
|
+
)
|
|
171
|
+
: null}
|
|
172
|
+
<FlexCol
|
|
173
|
+
justifyContent="start"
|
|
174
|
+
classes="cytoscape-wrap"
|
|
175
|
+
width={showDetails ? '15%' : '100%'}
|
|
176
|
+
height={showDetails ? '50%' : '100%'}
|
|
177
|
+
border={showDetails ? `1px solid ${theme.palette.divider}` : undefined}
|
|
178
|
+
>
|
|
179
|
+
{/* Cytoscape Element */}
|
|
180
|
+
<FlexCol alignItems="stretch" position="absolute" width="100%" height="100%" ref={cytoscapeRef} />
|
|
181
|
+
{children}
|
|
182
|
+
</FlexCol>
|
|
183
|
+
</FlexGrowRow>
|
|
184
|
+
</FlexCol>
|
|
185
|
+
)
|
|
186
|
+
}
|
|
189
187
|
|
|
190
188
|
NodeRelationalGraphFlexBox.displayName = 'NodeRelationalGraph'
|
|
191
189
|
|
|
@@ -16,8 +16,8 @@ export const CytoscapeInstanceProvider: React.FC<CytoscapeInstanceProviderProps>
|
|
|
16
16
|
}), [cy, setCy])
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
|
-
<CytoscapeInstanceContext
|
|
19
|
+
<CytoscapeInstanceContext value={value}>
|
|
20
20
|
{children}
|
|
21
|
-
</CytoscapeInstanceContext
|
|
21
|
+
</CytoscapeInstanceContext>
|
|
22
22
|
)
|
|
23
23
|
}
|
package/dist/browser/index.d.ts
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { Address } from '@xylabs/hex';
|
|
2
|
-
import { FlexBoxProps } from '@xylabs/react-flexbox';
|
|
3
|
-
import { NodeInstance } from '@xyo-network/node-model';
|
|
4
|
-
import * as cytoscape from 'cytoscape';
|
|
5
|
-
import { CytoscapeOptions, Core, ElementDefinition, LayoutOptions, StylesheetCSS } from 'cytoscape';
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import React__default, { PropsWithChildren, ReactNode, Dispatch, SetStateAction, ReactElement } from 'react';
|
|
8
|
-
import * as _xyo_network_module_model from '@xyo-network/module-model';
|
|
9
|
-
import { ModuleInstance } from '@xyo-network/module-model';
|
|
10
|
-
import * as _xyo_network_account_model from '@xyo-network/account-model';
|
|
11
|
-
import { AccountInstance } from '@xyo-network/account-model';
|
|
12
|
-
import * as _xyo_network_react_shared from '@xyo-network/react-shared';
|
|
13
|
-
import { ContextExState } from '@xyo-network/react-shared';
|
|
14
|
-
import { SvgIconComponent } from '@mui/icons-material';
|
|
15
|
-
import * as _xylabs_object from '@xylabs/object';
|
|
16
|
-
|
|
17
|
-
interface NodeRelationalGraphProps extends PropsWithChildren<FlexBoxProps> {
|
|
18
|
-
actions?: ReactNode;
|
|
19
|
-
detail?: ReactNode;
|
|
20
|
-
layout?: 'dagre' | 'euler' | 'cose-bilkent' | 'cola';
|
|
21
|
-
layoutOptions?: object;
|
|
22
|
-
node?: WeakRef<NodeInstance>;
|
|
23
|
-
onHover?: (address?: Address) => void;
|
|
24
|
-
options?: CytoscapeOptions;
|
|
25
|
-
showDetails?: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface ModuleCardParserProps {
|
|
29
|
-
mod?: ModuleInstance;
|
|
30
|
-
}
|
|
31
|
-
declare const ModuleCardParser: React__default.FC<ModuleCardParserProps>;
|
|
32
|
-
|
|
33
|
-
interface ModuleGraphFlexBoxProps extends FlexBoxProps {
|
|
34
|
-
disableModuleDetails?: boolean;
|
|
35
|
-
hideActions?: boolean;
|
|
36
|
-
layout?: 'dagre' | 'euler' | 'cose-bilkent' | 'cola';
|
|
37
|
-
layoutOptions?: object;
|
|
38
|
-
rootModule?: WeakRef<ModuleInstance> | null;
|
|
39
|
-
}
|
|
40
|
-
declare const ModuleGraphFlexBox: React__default.FC<ModuleGraphFlexBoxProps>;
|
|
41
|
-
declare const ModuleGraphFlexBoxWithProvider: React__default.FC<ModuleGraphFlexBoxProps>;
|
|
42
|
-
|
|
43
|
-
declare const NodeRelationalGraphFlexBox: React__default.ForwardRefExoticComponent<NodeRelationalGraphProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
44
|
-
declare const NodeRelationalGraph: React__default.ForwardRefExoticComponent<NodeRelationalGraphProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
45
|
-
|
|
46
|
-
interface ProvidedNodeRendererProps extends NodeRelationalGraphProps {
|
|
47
|
-
account?: AccountInstance;
|
|
48
|
-
layout?: 'dagre' | 'euler' | 'cose-bilkent' | 'cola';
|
|
49
|
-
layoutOptions?: object;
|
|
50
|
-
node?: WeakRef<NodeInstance>;
|
|
51
|
-
}
|
|
52
|
-
declare const ProvidedNodeRenderer: React__default.FC<ProvidedNodeRendererProps>;
|
|
53
|
-
|
|
54
|
-
interface CytoscapeInstanceState extends ContextExState {
|
|
55
|
-
cy?: WeakRef<Core>;
|
|
56
|
-
setCy?: Dispatch<SetStateAction<WeakRef<Core> | undefined>>;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
declare const CytoscapeInstanceContext: React.Context<CytoscapeInstanceState & _xyo_network_react_shared.ContextExState>;
|
|
60
|
-
|
|
61
|
-
interface CytoscapeInstanceProviderProps extends PropsWithChildren {
|
|
62
|
-
defaultInstance?: WeakRef<Core>;
|
|
63
|
-
}
|
|
64
|
-
declare const CytoscapeInstanceProvider: React__default.FC<CytoscapeInstanceProviderProps>;
|
|
65
|
-
|
|
66
|
-
declare const useCytoscapeInstance: (required?: boolean) => Omit<CytoscapeInstanceState & _xyo_network_react_shared.ContextExState, "provided">;
|
|
67
|
-
|
|
68
|
-
interface ModuleInfo {
|
|
69
|
-
children: ModuleInfo[];
|
|
70
|
-
depth: number;
|
|
71
|
-
mod: ModuleInstance;
|
|
72
|
-
}
|
|
73
|
-
declare const CytoscapeElements: {
|
|
74
|
-
MaxNameLength: number;
|
|
75
|
-
buildEdge(rootNode: ElementDefinition, newNode: ElementDefinition, properties?: {
|
|
76
|
-
[key: string]: unknown;
|
|
77
|
-
}): {
|
|
78
|
-
data: {
|
|
79
|
-
id: string;
|
|
80
|
-
source: string | undefined;
|
|
81
|
-
target: string | undefined;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
buildElements(mod: ModuleInstance): Promise<ElementDefinition[]>;
|
|
85
|
-
buildElementsFromInfo(info: ModuleInfo, root?: ElementDefinition, classes?: string[]): Promise<ElementDefinition[]>;
|
|
86
|
-
buildNode(mod: ModuleInstance, properties?: {
|
|
87
|
-
[key: string]: unknown;
|
|
88
|
-
}, classes?: string[]): ElementDefinition;
|
|
89
|
-
buildRootNode: (mod: ModuleInstance) => ElementDefinition;
|
|
90
|
-
normalizeName(name?: string): string | undefined;
|
|
91
|
-
recurseNodes(root: ModuleInstance, maxDepth?: number, depth?: number): Promise<ModuleInfo>;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
type CyNodeModuleTypes = 'archivist' | 'bridge' | 'diviner' | 'module' | 'node' | 'witness' | 'sentinel';
|
|
95
|
-
|
|
96
|
-
declare const encodeSvg: (reactElement: ReactElement, color?: string) => string;
|
|
97
|
-
|
|
98
|
-
declare const generateIconMap: () => Record<CyNodeModuleTypes, string>;
|
|
99
|
-
|
|
100
|
-
declare const ColaLayout: {
|
|
101
|
-
centerGraph: boolean;
|
|
102
|
-
convergenceThreshold: number;
|
|
103
|
-
name: string;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
declare const ConcentricLayout: LayoutOptions;
|
|
107
|
-
|
|
108
|
-
declare const parseModuleType: (mod?: ModuleInstance) => CyNodeModuleTypes;
|
|
109
|
-
|
|
110
|
-
declare const CyIconSet: Record<CyNodeModuleTypes, SvgIconComponent>;
|
|
111
|
-
|
|
112
|
-
declare const NodeWithName: (color?: string, outlineColor?: string) => StylesheetCSS;
|
|
113
|
-
declare const Node: (icons: Record<CyNodeModuleTypes, string>, bgColor?: string, hideLabels?: boolean) => StylesheetCSS;
|
|
114
|
-
declare const NodeAsRoot: (bgColor?: string) => StylesheetCSS;
|
|
115
|
-
declare const EdgeStyled: (lineColor?: string, targetArrowColor?: string) => StylesheetCSS;
|
|
116
|
-
|
|
117
|
-
declare const useCytoscapeElements: (mod?: WeakRef<ModuleInstance> | null) => ElementDefinition[];
|
|
118
|
-
|
|
119
|
-
declare const useElements: (hideLabels: boolean) => {
|
|
120
|
-
hoveredNode: cytoscape.NodeSingular | undefined;
|
|
121
|
-
setHoveredNode: React.Dispatch<React.SetStateAction<cytoscape.NodeSingular | undefined>>;
|
|
122
|
-
toggleSelectedElement: (address?: string) => void;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
declare const useCytoscapeOptions: (elements: CytoscapeOptions["elements"], style?: CytoscapeOptions["style"], layout?: CytoscapeOptions["layout"]) => CytoscapeOptions | undefined;
|
|
126
|
-
|
|
127
|
-
declare const useModuleDetails: (rootModule?: WeakRef<ModuleInstance> | null, onFoundModule?: () => void) => {
|
|
128
|
-
mod: ModuleInstance<_xylabs_object.BaseParamsFields & {
|
|
129
|
-
account?: _xyo_network_account_model.AccountInstance | "random";
|
|
130
|
-
addToResolvers?: boolean;
|
|
131
|
-
additionalSigners?: _xyo_network_account_model.AccountInstance[];
|
|
132
|
-
allowNameResolution?: boolean;
|
|
133
|
-
config: _xyo_network_module_model.AnyConfigSchema<_xyo_network_module_model.ModuleConfig<void, void>>;
|
|
134
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
135
|
-
moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
|
|
136
|
-
privateChildren?: ModuleInstance[];
|
|
137
|
-
publicChildren?: ModuleInstance[];
|
|
138
|
-
}, _xyo_network_module_model.ModuleEventData<object>> | null | undefined;
|
|
139
|
-
onModuleDetails: (address?: string | null) => void;
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
declare const useRelationalGraphOptions: (mod?: WeakRef<ModuleInstance>) => {
|
|
143
|
-
handleToggleLabels: () => void;
|
|
144
|
-
hideLabels: boolean;
|
|
145
|
-
options: cytoscape.CytoscapeOptions | undefined;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
export { ColaLayout, ConcentricLayout, CyIconSet, type CyNodeModuleTypes, CytoscapeElements, CytoscapeInstanceContext, CytoscapeInstanceProvider, type CytoscapeInstanceProviderProps, type CytoscapeInstanceState, EdgeStyled, ModuleCardParser, type ModuleCardParserProps, ModuleGraphFlexBox, type ModuleGraphFlexBoxProps, ModuleGraphFlexBoxWithProvider, Node, NodeAsRoot, NodeRelationalGraph, NodeRelationalGraphFlexBox, type NodeRelationalGraphProps, NodeWithName, ProvidedNodeRenderer, type ProvidedNodeRendererProps, encodeSvg, generateIconMap, parseModuleType, useCytoscapeElements, useCytoscapeInstance, useCytoscapeOptions, useElements, useModuleDetails, useRelationalGraphOptions };
|