nodalix 0.1.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/README.md +726 -0
- package/dist/index.d.ts +184 -0
- package/dist/index.js +3905 -0
- package/dist/index.mjs +3840 -0
- package/package.json +60 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
export type LanguageCode = "fa" | "en";
|
|
4
|
+
export type NodeTypeValue = "main" | "sub";
|
|
5
|
+
export type EdgeLabelFieldValue = "value" | "subText" | "subValue" | "time";
|
|
6
|
+
export type EdgeLineStyleValue = "solid" | "dashed" | "dotted";
|
|
7
|
+
|
|
8
|
+
export interface EdgeRef {
|
|
9
|
+
id: string;
|
|
10
|
+
value?: number | null;
|
|
11
|
+
subText?: string | null;
|
|
12
|
+
subValue?: number | null;
|
|
13
|
+
time?: number | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface GraphEntity {
|
|
17
|
+
name?: string | null;
|
|
18
|
+
image?: string | null;
|
|
19
|
+
metadata?: {
|
|
20
|
+
image?: string | null;
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
} | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface GraphNode {
|
|
26
|
+
id: string;
|
|
27
|
+
type: NodeTypeValue;
|
|
28
|
+
text?: string | null;
|
|
29
|
+
label?: string | null;
|
|
30
|
+
subText?: string | null;
|
|
31
|
+
entity?: GraphEntity | null;
|
|
32
|
+
rate?: number | null;
|
|
33
|
+
main?: boolean;
|
|
34
|
+
metadata?: string | null;
|
|
35
|
+
x?: number;
|
|
36
|
+
y?: number;
|
|
37
|
+
width?: number;
|
|
38
|
+
image?: string | null;
|
|
39
|
+
inputs?: EdgeRef[];
|
|
40
|
+
outputs?: EdgeRef[];
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface RateColorRange {
|
|
45
|
+
min: number;
|
|
46
|
+
max: number;
|
|
47
|
+
color: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface GraphEngineProps {
|
|
51
|
+
NewData?: GraphNode[];
|
|
52
|
+
onNodeClick?: (node: GraphNode | null) => void;
|
|
53
|
+
edgeLabelFields?: EdgeLabelFieldValue[];
|
|
54
|
+
rateColorRanges?: RateColorRange[];
|
|
55
|
+
showEdgeHoverInfo?: boolean;
|
|
56
|
+
showHelpButton?: boolean;
|
|
57
|
+
gridUserConfigurable?: boolean;
|
|
58
|
+
showGrid?: boolean;
|
|
59
|
+
nodesDraggableUserConfigurable?: boolean;
|
|
60
|
+
nodesDraggable?: boolean;
|
|
61
|
+
edgeInfoNodesUserConfigurable?: boolean;
|
|
62
|
+
showEdgeInfoNodes?: boolean;
|
|
63
|
+
languageUserConfigurable?: boolean;
|
|
64
|
+
language?: LanguageCode;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const Graph_Engine: React.ComponentType<GraphEngineProps>;
|
|
68
|
+
export default Graph_Engine;
|
|
69
|
+
|
|
70
|
+
export const NODE_TYPE: {
|
|
71
|
+
MAIN: "main";
|
|
72
|
+
SUB: "sub";
|
|
73
|
+
};
|
|
74
|
+
export const EDGE_LABEL_FIELDS: {
|
|
75
|
+
VALUE: "value";
|
|
76
|
+
SUB_TEXT: "subText";
|
|
77
|
+
SUB_VALUE: "subValue";
|
|
78
|
+
TIME: "time";
|
|
79
|
+
};
|
|
80
|
+
export const EDGE_LINE_STYLE: {
|
|
81
|
+
SOLID: "solid";
|
|
82
|
+
DASHED: "dashed";
|
|
83
|
+
DOTTED: "dotted";
|
|
84
|
+
};
|
|
85
|
+
export const GRAPH_LANGUAGE: {
|
|
86
|
+
FA: "fa";
|
|
87
|
+
EN: "en";
|
|
88
|
+
};
|
|
89
|
+
export const DEFAULT_EDGE_LABEL_FIELDS: EdgeLabelFieldValue[];
|
|
90
|
+
export const DEFAULT_RATE_COLOR_RANGES: RateColorRange[];
|
|
91
|
+
export const DEFAULT_NODE_IMAGE: string;
|
|
92
|
+
|
|
93
|
+
export const NODALIX_EDITION: string;
|
|
94
|
+
export const NODALIX_MAX_NODES: number;
|
|
95
|
+
export function isBasicEdition(): boolean;
|
|
96
|
+
export function isFullEdition(): boolean;
|
|
97
|
+
export function hasNodeLimit(): boolean;
|
|
98
|
+
|
|
99
|
+
export function normalizeEdgeLabelFields(
|
|
100
|
+
fields?: EdgeLabelFieldValue[]
|
|
101
|
+
): EdgeLabelFieldValue[];
|
|
102
|
+
export function normalizeRateColorRanges(
|
|
103
|
+
ranges?: RateColorRange[]
|
|
104
|
+
): RateColorRange[];
|
|
105
|
+
export function normalizeGraphLanguage(value?: string): LanguageCode;
|
|
106
|
+
export function normalizeEdgeLineStyle(
|
|
107
|
+
style?: string | null
|
|
108
|
+
): EdgeLineStyleValue;
|
|
109
|
+
|
|
110
|
+
export function getRateBorderColor(
|
|
111
|
+
rate: unknown,
|
|
112
|
+
ranges: RateColorRange[],
|
|
113
|
+
defaultColor: string
|
|
114
|
+
): string;
|
|
115
|
+
export function buildEdgeInfoLabel(
|
|
116
|
+
edgeData: EdgeRef,
|
|
117
|
+
fields?: EdgeLabelFieldValue[]
|
|
118
|
+
): string;
|
|
119
|
+
export function getNodeDisplayLabel(item: GraphNode): string;
|
|
120
|
+
export function getNodeEntityImage(item: GraphNode): string;
|
|
121
|
+
export function getGraphGuide(language?: LanguageCode): {
|
|
122
|
+
title: string;
|
|
123
|
+
close: string;
|
|
124
|
+
sections: Array<{ title: string; items: string[] }>;
|
|
125
|
+
};
|
|
126
|
+
export function resolveEdgeVisStyle(options?: {
|
|
127
|
+
isDark?: boolean;
|
|
128
|
+
paintedColor?: string | null;
|
|
129
|
+
paintedLineStyle?: EdgeLineStyleValue | null;
|
|
130
|
+
}): {
|
|
131
|
+
width: number;
|
|
132
|
+
dashes: false | number[];
|
|
133
|
+
smooth: {
|
|
134
|
+
type: "cubicBezier";
|
|
135
|
+
forceDirection: "horizontal";
|
|
136
|
+
roundness: number;
|
|
137
|
+
};
|
|
138
|
+
arrows: { to: { enabled: true; scaleFactor: number } };
|
|
139
|
+
color: {
|
|
140
|
+
color: string;
|
|
141
|
+
highlight: string;
|
|
142
|
+
hover: string;
|
|
143
|
+
inherit: false;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export function mirrorEdgeRef(
|
|
148
|
+
edge: EdgeRef,
|
|
149
|
+
overrides?: Partial<EdgeRef>
|
|
150
|
+
): EdgeRef;
|
|
151
|
+
|
|
152
|
+
export function countGraphNodes(nodes: GraphNode[]): number;
|
|
153
|
+
export function canAddGraphNode(nodes: GraphNode[], maxNodes: number): boolean;
|
|
154
|
+
export function enforceNodeLimit(nodes: GraphNode[], maxNodes: number): GraphNode[];
|
|
155
|
+
export function isHelperNodeId(id: string): boolean;
|
|
156
|
+
export function getSafeNodePosition(params?: {
|
|
157
|
+
node?: GraphNode;
|
|
158
|
+
nodes?: GraphNode[];
|
|
159
|
+
inputAnchorIds?: string[];
|
|
160
|
+
outputAnchorIds?: string[];
|
|
161
|
+
minGapX?: number;
|
|
162
|
+
minGapY?: number;
|
|
163
|
+
minGap?: number;
|
|
164
|
+
yStep?: number;
|
|
165
|
+
}): { x: number; y: number; width: number };
|
|
166
|
+
|
|
167
|
+
export function GetSelectedNode(): GraphNode | null;
|
|
168
|
+
export function SetSelectedNode(
|
|
169
|
+
node: GraphNode | null
|
|
170
|
+
): { success: boolean; node?: GraphNode | null; error?: string };
|
|
171
|
+
export function OnNodeClick(
|
|
172
|
+
handler: ((node: GraphNode | null) => void) | null
|
|
173
|
+
): { success: boolean; error?: string };
|
|
174
|
+
export function AddNewNode(
|
|
175
|
+
rawNode: GraphNode,
|
|
176
|
+
options?: {
|
|
177
|
+
minGapX?: number;
|
|
178
|
+
minGapY?: number;
|
|
179
|
+
minGap?: number;
|
|
180
|
+
yStep?: number;
|
|
181
|
+
}
|
|
182
|
+
):
|
|
183
|
+
| { success: true; node: GraphNode; data: GraphNode[]; length: number }
|
|
184
|
+
| { success: false; error: string };
|