@super-linear/supertopo 0.0.2 → 0.0.3
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/index.js +4 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +23 -0
- package/dist/types.d.ts +23 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { NodeSingular, EdgeDataDefinition, ElementDefinition, NodeDataDefinition, Position } from 'cytoscape';
|
|
2
3
|
|
|
3
4
|
type NodeData = NodeDataDefinition;
|
|
@@ -57,4 +58,26 @@ interface NodeDataForFilter {
|
|
|
57
58
|
size: number;
|
|
58
59
|
}
|
|
59
60
|
|
|
61
|
+
type EventListeners = Record<string, // 格式: "click" 或 "click:node" 或 "click:node[type='server']"
|
|
62
|
+
(event: cytoscape.EventObject) => void>;
|
|
63
|
+
interface SuperTopoProps {
|
|
64
|
+
data: GraphData;
|
|
65
|
+
layout?: string;
|
|
66
|
+
height?: string | number;
|
|
67
|
+
width?: string | number;
|
|
68
|
+
className?: string;
|
|
69
|
+
style?: React.CSSProperties;
|
|
70
|
+
layoutOptions?: Record<string, unknown>;
|
|
71
|
+
fitView?: boolean;
|
|
72
|
+
events?: EventListeners;
|
|
73
|
+
/** 节点属性,key 是节点 id,value 是属性字典,会合并到节点的 data 中 */
|
|
74
|
+
nodeAttributes?: Record<string, Record<string, unknown>>;
|
|
75
|
+
/** 边属性,key 是边 id,value 是属性字典,会合并到边的 data 中 */
|
|
76
|
+
edgeAttributes?: Record<string, Record<string, unknown>>;
|
|
77
|
+
/** 自定义样式,key 是 Cytoscape selector,value 是样式属性 */
|
|
78
|
+
renderFunction?: Record<string, Record<string, unknown>>;
|
|
79
|
+
}
|
|
80
|
+
declare function SuperTopo({ data: initialData, layout, height, width, className, style, layoutOptions, fitView, events, nodeAttributes, edgeAttributes, renderFunction, }: SuperTopoProps): react_jsx_runtime.JSX.Element;
|
|
81
|
+
|
|
82
|
+
export { SuperTopo };
|
|
60
83
|
export type { CytoNode, EdgeData, EventCallback, Events, GraphData, NodeData, NodeDataForFilter, SUScope, TopoEdge, TopoNode };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
1
2
|
import { NodeSingular, EdgeDataDefinition, ElementDefinition, NodeDataDefinition, Position } from 'cytoscape';
|
|
2
3
|
|
|
3
4
|
type NodeData = NodeDataDefinition;
|
|
@@ -57,4 +58,26 @@ interface NodeDataForFilter {
|
|
|
57
58
|
size: number;
|
|
58
59
|
}
|
|
59
60
|
|
|
61
|
+
type EventListeners = Record<string, // 格式: "click" 或 "click:node" 或 "click:node[type='server']"
|
|
62
|
+
(event: cytoscape.EventObject) => void>;
|
|
63
|
+
interface SuperTopoProps {
|
|
64
|
+
data: GraphData;
|
|
65
|
+
layout?: string;
|
|
66
|
+
height?: string | number;
|
|
67
|
+
width?: string | number;
|
|
68
|
+
className?: string;
|
|
69
|
+
style?: React.CSSProperties;
|
|
70
|
+
layoutOptions?: Record<string, unknown>;
|
|
71
|
+
fitView?: boolean;
|
|
72
|
+
events?: EventListeners;
|
|
73
|
+
/** 节点属性,key 是节点 id,value 是属性字典,会合并到节点的 data 中 */
|
|
74
|
+
nodeAttributes?: Record<string, Record<string, unknown>>;
|
|
75
|
+
/** 边属性,key 是边 id,value 是属性字典,会合并到边的 data 中 */
|
|
76
|
+
edgeAttributes?: Record<string, Record<string, unknown>>;
|
|
77
|
+
/** 自定义样式,key 是 Cytoscape selector,value 是样式属性 */
|
|
78
|
+
renderFunction?: Record<string, Record<string, unknown>>;
|
|
79
|
+
}
|
|
80
|
+
declare function SuperTopo({ data: initialData, layout, height, width, className, style, layoutOptions, fitView, events, nodeAttributes, edgeAttributes, renderFunction, }: SuperTopoProps): react_jsx_runtime.JSX.Element;
|
|
81
|
+
|
|
82
|
+
export { SuperTopo };
|
|
60
83
|
export type { CytoNode, EdgeData, EventCallback, Events, GraphData, NodeData, NodeDataForFilter, SUScope, TopoEdge, TopoNode };
|