elseware-ui 2.19.1 → 2.20.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/build/components/data-display/graphs/Graph.d.ts +10 -0
- package/build/components/data-display/graphs/GraphEdge.d.ts +8 -0
- package/build/components/data-display/graphs/GraphNode.d.ts +8 -0
- package/build/components/data-display/graphs/GraphRenderer.d.ts +11 -0
- package/build/components/data-display/graphs/index.d.ts +6 -0
- package/build/components/data-display/graphs/layouts/forceLayout.d.ts +3 -0
- package/build/components/data-display/graphs/layouts/gridLayout.d.ts +1 -0
- package/build/components/data-display/graphs/layouts/index.d.ts +3 -0
- package/build/components/data-display/graphs/layouts/treeLayout.d.ts +1 -0
- package/build/components/data-display/graphs/types.d.ts +27 -0
- package/build/components/data-display/index.d.ts +1 -0
- package/build/index.es.js +23651 -22493
- package/build/index.js +23654 -22492
- package/package.json +5 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { GraphData } from "./types";
|
|
3
|
+
export interface GraphProps {
|
|
4
|
+
data: GraphData;
|
|
5
|
+
layout?: "force" | "grid" | "tree";
|
|
6
|
+
nodeRenderer?: (node: any) => React.ReactNode;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const Graph: ({ data, layout, nodeRenderer, width, height, }: GraphProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { GraphData, GraphNodeType } from "./types";
|
|
3
|
+
interface Props {
|
|
4
|
+
data: GraphData;
|
|
5
|
+
layout?: "force" | "grid" | "tree";
|
|
6
|
+
nodeRenderer?: (node: GraphNodeType) => React.ReactNode;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
}
|
|
10
|
+
declare const GraphRenderer: React.FC<Props>;
|
|
11
|
+
export default GraphRenderer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createGridLayout(nodes: any[], width: number, height: number): any[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createTreeLayout(nodes: any[], edges: any[], width: number, height: number): any[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type GraphLayoutType = "force" | "grid" | "tree";
|
|
2
|
+
export interface GraphData {
|
|
3
|
+
nodes: GraphNodeType[];
|
|
4
|
+
edges: GraphEdgeType[];
|
|
5
|
+
}
|
|
6
|
+
export interface GraphNodeType {
|
|
7
|
+
id: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
type?: "default" | "avatar" | "custom";
|
|
10
|
+
data?: any;
|
|
11
|
+
x?: number;
|
|
12
|
+
y?: number;
|
|
13
|
+
vx?: number;
|
|
14
|
+
vy?: number;
|
|
15
|
+
fx?: number | null;
|
|
16
|
+
fy?: number | null;
|
|
17
|
+
size?: number;
|
|
18
|
+
color?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GraphEdgeType {
|
|
21
|
+
id?: string;
|
|
22
|
+
source: string | GraphNodeType;
|
|
23
|
+
target: string | GraphNodeType;
|
|
24
|
+
label?: string;
|
|
25
|
+
color?: string;
|
|
26
|
+
width?: number;
|
|
27
|
+
}
|