@relation-graph/vue3 3.0.12 → 3.0.13
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-zh.md +9 -9
- package/README.md +9 -9
- package/package.json +4 -4
- package/relation-graph.js +10 -79
- package/relation-graph.mjs +5489 -4227
- package/relation-graph.ssr.mjs +5489 -4227
- package/relation-graph.umd.js +10 -79
- package/style.css +1 -1
- package/types/packages/platforms/react/src/index.d.ts +1 -1
- package/types/packages/platforms/react/src/index.shared.d.ts +33 -22
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGFakeNode.d.ts +3 -3
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLinePath.d.ts +3 -4
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLineText.d.ts +2 -4
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGConnectSource.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGConnectTarget.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingConnectController.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingLineController.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingNearNodeWidget.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingNodeController.d.ts +4 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnCanvas.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnCanvasAbove.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnLineText.d.ts +3 -3
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnNodeExpandHandle.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnView.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphBackground.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphToolBar.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphWatermark.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphXsToolBar.d.ts +2 -2
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/RGDebugView.d.ts +2 -2
- package/types/packages/platforms/svelte/src/hooks/useGraphInstance.d.ts +2 -2
- package/types/packages/platforms/svelte/src/index.d.ts +1 -1
- package/types/packages/platforms/vue2/src/core4vue/RGCanvas.vue.d.ts +1 -0
- package/types/packages/platforms/vue2/src/core4vue/RelationGraphUI.vue.d.ts +0 -1
- package/types/packages/platforms/vue2/src/core4vue/RelationLinker.vue.d.ts +1 -1
- package/types/packages/platforms/vue2/src/core4vue/editing/RGConnectTarget.vue.d.ts +33 -2
- package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingNodeController.vue.d.ts +14 -2
- package/types/packages/platforms/vue2/src/core4vue/widgets/GraphWatermark.vue.d.ts +1 -1
- package/types/packages/platforms/vue2/src/index.d.ts +49 -6
- package/types/packages/platforms/vue3/src/index.d.ts +1 -1
- package/types/packages/relation-graph-models/data/RGLineDataUtils.d.ts +140 -4
- package/types/packages/relation-graph-models/data/RGNodeDataUtils.d.ts +7 -2
- package/types/packages/relation-graph-models/models/RelationGraphBase.d.ts +8 -1
- package/types/packages/relation-graph-models/models/RelationGraphWith1View.d.ts +9 -6
- package/types/packages/relation-graph-models/models/RelationGraphWith2Data4ConnectTarget.d.ts +73 -5
- package/types/packages/relation-graph-models/models/RelationGraphWith2Data5LineConfig.d.ts +20 -2
- package/types/packages/relation-graph-models/models/RelationGraphWith6Layout.d.ts +7 -3
- package/types/packages/relation-graph-models/models/RelationGraphWith7Event.d.ts +3 -2
- package/types/packages/relation-graph-models/models/RelationGraphWith95Dom.d.ts +24 -4
- package/types/packages/relation-graph-models/models/RelationGraphWith99API.d.ts +5 -3
- package/types/packages/relation-graph-models/models/RelationGraphWith9EasyView.d.ts +1 -0
- package/types/packages/relation-graph-models/utils/RGClassAndRender.d.ts +111 -0
- package/types/packages/types.ts +25 -1
|
@@ -15,6 +15,7 @@ export declare class RelationGraphWith9EasyView extends RelationGraphWith7Event
|
|
|
15
15
|
* @private
|
|
16
16
|
*/
|
|
17
17
|
setEasyViewCanvas(canvas: HTMLCanvasElement): void;
|
|
18
|
+
protected updateMiniView(): void;
|
|
18
19
|
/**
|
|
19
20
|
* relation-graph internal call, please do not use externally
|
|
20
21
|
* @inner
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { JsonLine, JsonNode, RGFakeLine, RGLine, RGLink, RGNode, RGOptions } from '../../types';
|
|
2
|
+
export type RGAnalyzeRenderedGraphOptions = {
|
|
3
|
+
waitForStable?: boolean;
|
|
4
|
+
timeoutMs?: number;
|
|
5
|
+
stableFrames?: number;
|
|
6
|
+
includeNormalizedHtml?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type RGRenderDescriptorNode = {
|
|
9
|
+
kind: 'element';
|
|
10
|
+
tag: string;
|
|
11
|
+
classes: string[];
|
|
12
|
+
attrs: Record<string, string>;
|
|
13
|
+
children: RGRenderDescriptorNode[];
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'text';
|
|
16
|
+
text: string;
|
|
17
|
+
};
|
|
18
|
+
export type RGNodeStyleClass = {
|
|
19
|
+
id: string;
|
|
20
|
+
signature: string;
|
|
21
|
+
style: Record<string, string>;
|
|
22
|
+
nodeIds: string[];
|
|
23
|
+
};
|
|
24
|
+
export type RGNodeRenderClass = {
|
|
25
|
+
id: string;
|
|
26
|
+
signature: string;
|
|
27
|
+
renderDescriptor: RGRenderDescriptorNode;
|
|
28
|
+
renderStyleRules: RGRenderStyleRule[];
|
|
29
|
+
renderKeyframes: RGRenderKeyframes[];
|
|
30
|
+
normalizedHtml?: string;
|
|
31
|
+
nodeIds: string[];
|
|
32
|
+
};
|
|
33
|
+
export type RGRenderStylePseudo = 'self' | 'before' | 'after';
|
|
34
|
+
export type RGRenderStyleRule = {
|
|
35
|
+
path: string;
|
|
36
|
+
pseudo: RGRenderStylePseudo;
|
|
37
|
+
style: Record<string, string>;
|
|
38
|
+
};
|
|
39
|
+
export type RGRenderKeyframes = {
|
|
40
|
+
name: string;
|
|
41
|
+
cssText: string;
|
|
42
|
+
};
|
|
43
|
+
export type RGLinePathStyle = {
|
|
44
|
+
stroke: string;
|
|
45
|
+
strokeWidth: string;
|
|
46
|
+
strokeDasharray: string;
|
|
47
|
+
strokeDashoffset: string;
|
|
48
|
+
opacity: string;
|
|
49
|
+
};
|
|
50
|
+
export type RGLineTextStyle = {
|
|
51
|
+
mode: 'html-label' | 'svg-text-path' | 'none';
|
|
52
|
+
backgroundColor: string;
|
|
53
|
+
fontSize: string;
|
|
54
|
+
color: string;
|
|
55
|
+
};
|
|
56
|
+
export type RGLineStyleClass = {
|
|
57
|
+
id: string;
|
|
58
|
+
signature: string;
|
|
59
|
+
pathStyle: RGLinePathStyle;
|
|
60
|
+
textStyle: RGLineTextStyle;
|
|
61
|
+
lineIds: string[];
|
|
62
|
+
};
|
|
63
|
+
export type RGClassifiedNodeItem = JsonNode & {
|
|
64
|
+
nodeId: string;
|
|
65
|
+
styleClassId: string;
|
|
66
|
+
renderClassId: string;
|
|
67
|
+
};
|
|
68
|
+
export type RGClassifiedLineItem = JsonLine & {
|
|
69
|
+
lineId: string;
|
|
70
|
+
styleClassId: string;
|
|
71
|
+
isFakeLine: boolean;
|
|
72
|
+
textMode: 'html-label' | 'svg-text-path' | 'none';
|
|
73
|
+
};
|
|
74
|
+
export type RGRenderedGraphAnalysisMeta = {
|
|
75
|
+
degraded: boolean;
|
|
76
|
+
reason?: string;
|
|
77
|
+
warnings: string[];
|
|
78
|
+
renderedAt: number;
|
|
79
|
+
};
|
|
80
|
+
export type RGAnalyzeRenderedGraphResult = {
|
|
81
|
+
meta: RGRenderedGraphAnalysisMeta;
|
|
82
|
+
nodeStyleClasses: RGNodeStyleClass[];
|
|
83
|
+
nodeRenderClasses: RGNodeRenderClass[];
|
|
84
|
+
lineStyleClasses: RGLineStyleClass[];
|
|
85
|
+
nodes: RGClassifiedNodeItem[];
|
|
86
|
+
lines: RGClassifiedLineItem[];
|
|
87
|
+
};
|
|
88
|
+
export type RGRenderedGraphAnalysisContext = {
|
|
89
|
+
dom?: HTMLDivElement;
|
|
90
|
+
canvasDom?: HTMLDivElement;
|
|
91
|
+
instanceId: string;
|
|
92
|
+
graphOptions: RGOptions;
|
|
93
|
+
performanceMode: boolean;
|
|
94
|
+
showEasyView: boolean;
|
|
95
|
+
sleep: (time: number) => Promise<void>;
|
|
96
|
+
getNodeById: (id: string) => RGNode | undefined;
|
|
97
|
+
getLineById: (id: string) => RGLine | undefined;
|
|
98
|
+
getLinkByLineId: (id: string) => RGLink | undefined;
|
|
99
|
+
getFakeLineById: (id: string) => RGFakeLine | undefined;
|
|
100
|
+
};
|
|
101
|
+
/** @deprecated Use RGAnalyzeRenderedGraphOptions instead. */
|
|
102
|
+
export type RGGetClassAndRenderOptions = RGAnalyzeRenderedGraphOptions;
|
|
103
|
+
/** @deprecated Use RGRenderedGraphAnalysisMeta instead. */
|
|
104
|
+
export type RGClassAndRenderMeta = RGRenderedGraphAnalysisMeta;
|
|
105
|
+
/** @deprecated Use RGAnalyzeRenderedGraphResult instead. */
|
|
106
|
+
export type RGClassAndRenderResult = RGAnalyzeRenderedGraphResult;
|
|
107
|
+
/** @deprecated Use RGRenderedGraphAnalysisContext instead. */
|
|
108
|
+
export type RGClassAndRenderContext = RGRenderedGraphAnalysisContext;
|
|
109
|
+
export declare function analyzeRenderedGraphByDom(context: RGRenderedGraphAnalysisContext, options?: RGAnalyzeRenderedGraphOptions): Promise<RGAnalyzeRenderedGraphResult>;
|
|
110
|
+
/** @deprecated Use analyzeRenderedGraphByDom instead. */
|
|
111
|
+
export declare const collectClassAndRenderResult: typeof analyzeRenderedGraphByDom;
|
package/types/packages/types.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* relation-graph
|
|
3
3
|
* Website: http://www.relation-graph.com/
|
|
4
|
-
* Github: https://github.com/
|
|
4
|
+
* Github: https://github.com/relation-graph/relation-graph
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -82,6 +82,26 @@ export type RGConnectTargetData = {
|
|
|
82
82
|
offsetPercentY: number;
|
|
83
83
|
targetData: Record<string, any>;
|
|
84
84
|
};
|
|
85
|
+
/**
|
|
86
|
+
* DOM rendering mode for <RGConnectTarget />
|
|
87
|
+
*/
|
|
88
|
+
export type RGConnectTargetDomMode = 'wrap' | 'contents';
|
|
89
|
+
/**
|
|
90
|
+
* Registration options used internally by relation-graph to manage connect targets
|
|
91
|
+
* @inner
|
|
92
|
+
*/
|
|
93
|
+
export type RGRegisterConnectTargetOptions = {
|
|
94
|
+
hostEl: Element;
|
|
95
|
+
targetId: string;
|
|
96
|
+
targetType: string;
|
|
97
|
+
junctionPoint?: RGJunctionPoint;
|
|
98
|
+
targetData?: Record<string, any>;
|
|
99
|
+
triggerEl?: Element;
|
|
100
|
+
measureEl?: Element;
|
|
101
|
+
domMode?: RGConnectTargetDomMode;
|
|
102
|
+
measureSelector?: string;
|
|
103
|
+
strictMeasureTarget?: boolean;
|
|
104
|
+
};
|
|
85
105
|
/**
|
|
86
106
|
* Resize handle positions for relation-graph
|
|
87
107
|
* @inner
|
|
@@ -179,6 +199,7 @@ export type RGLineTarget = RGRectTarget & {
|
|
|
179
199
|
id?: string // Like node.text
|
|
180
200
|
text?: string; // Like node.text
|
|
181
201
|
targetType: RGInnerConnectTargetType | string
|
|
202
|
+
junctionPoint?: RGJunctionPoint
|
|
182
203
|
targetData?: Record<string, any>
|
|
183
204
|
hidden?: boolean
|
|
184
205
|
};
|
|
@@ -979,6 +1000,9 @@ export interface RGConnectTargetProps {
|
|
|
979
1000
|
className?: string;
|
|
980
1001
|
forSvg?: boolean;
|
|
981
1002
|
style?: Record<string, string | number | undefined>,
|
|
1003
|
+
domMode?: RGConnectTargetDomMode;
|
|
1004
|
+
measureSelector?: string;
|
|
1005
|
+
strictMeasureTarget?: boolean;
|
|
982
1006
|
}
|
|
983
1007
|
|
|
984
1008
|
/**
|