@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.
Files changed (52) hide show
  1. package/README-zh.md +9 -9
  2. package/README.md +9 -9
  3. package/package.json +4 -4
  4. package/relation-graph.js +10 -79
  5. package/relation-graph.mjs +5489 -4227
  6. package/relation-graph.ssr.mjs +5489 -4227
  7. package/relation-graph.umd.js +10 -79
  8. package/style.css +1 -1
  9. package/types/packages/platforms/react/src/index.d.ts +1 -1
  10. package/types/packages/platforms/react/src/index.shared.d.ts +33 -22
  11. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGFakeNode.d.ts +3 -3
  12. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLinePath.d.ts +3 -4
  13. package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLineText.d.ts +2 -4
  14. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGConnectSource.d.ts +2 -2
  15. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGConnectTarget.d.ts +2 -2
  16. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingConnectController.d.ts +2 -2
  17. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingLineController.d.ts +2 -2
  18. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingNearNodeWidget.d.ts +2 -2
  19. package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingNodeController.d.ts +4 -2
  20. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnCanvas.d.ts +2 -2
  21. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnCanvasAbove.d.ts +2 -2
  22. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnLineText.d.ts +3 -3
  23. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnNodeExpandHandle.d.ts +2 -2
  24. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnView.d.ts +2 -2
  25. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphBackground.d.ts +2 -2
  26. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphToolBar.d.ts +2 -2
  27. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphWatermark.d.ts +2 -2
  28. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphXsToolBar.d.ts +2 -2
  29. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/RGDebugView.d.ts +2 -2
  30. package/types/packages/platforms/svelte/src/hooks/useGraphInstance.d.ts +2 -2
  31. package/types/packages/platforms/svelte/src/index.d.ts +1 -1
  32. package/types/packages/platforms/vue2/src/core4vue/RGCanvas.vue.d.ts +1 -0
  33. package/types/packages/platforms/vue2/src/core4vue/RelationGraphUI.vue.d.ts +0 -1
  34. package/types/packages/platforms/vue2/src/core4vue/RelationLinker.vue.d.ts +1 -1
  35. package/types/packages/platforms/vue2/src/core4vue/editing/RGConnectTarget.vue.d.ts +33 -2
  36. package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingNodeController.vue.d.ts +14 -2
  37. package/types/packages/platforms/vue2/src/core4vue/widgets/GraphWatermark.vue.d.ts +1 -1
  38. package/types/packages/platforms/vue2/src/index.d.ts +49 -6
  39. package/types/packages/platforms/vue3/src/index.d.ts +1 -1
  40. package/types/packages/relation-graph-models/data/RGLineDataUtils.d.ts +140 -4
  41. package/types/packages/relation-graph-models/data/RGNodeDataUtils.d.ts +7 -2
  42. package/types/packages/relation-graph-models/models/RelationGraphBase.d.ts +8 -1
  43. package/types/packages/relation-graph-models/models/RelationGraphWith1View.d.ts +9 -6
  44. package/types/packages/relation-graph-models/models/RelationGraphWith2Data4ConnectTarget.d.ts +73 -5
  45. package/types/packages/relation-graph-models/models/RelationGraphWith2Data5LineConfig.d.ts +20 -2
  46. package/types/packages/relation-graph-models/models/RelationGraphWith6Layout.d.ts +7 -3
  47. package/types/packages/relation-graph-models/models/RelationGraphWith7Event.d.ts +3 -2
  48. package/types/packages/relation-graph-models/models/RelationGraphWith95Dom.d.ts +24 -4
  49. package/types/packages/relation-graph-models/models/RelationGraphWith99API.d.ts +5 -3
  50. package/types/packages/relation-graph-models/models/RelationGraphWith9EasyView.d.ts +1 -0
  51. package/types/packages/relation-graph-models/utils/RGClassAndRender.d.ts +111 -0
  52. package/types/packages/types.ts +25 -1
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * relation-graph
3
3
  * Website: http://www.relation-graph.com/
4
- * Github: https://github.com/seeksdream/relation-graph
4
+ * Github: https://github.com/relation-graph/relation-graph
5
5
  *
6
6
  */
7
7
  import { RelationGraphCore as _RelationGraphCore } from '../../../relation-graph-models/models/RelationGraphCore';
@@ -433,14 +433,26 @@ export declare const RGWatermark: import('vue').DefineComponent<{
433
433
  type: StringConstructor;
434
434
  };
435
435
  }>>, {
436
+ position: string;
436
437
  forImage: boolean;
437
438
  forDisplay: boolean;
438
- position: string;
439
439
  }>;
440
- export declare const RGEditingNodeController: import('vue').DefineComponent<{}, unknown, {}, {
440
+ export declare const RGEditingNodeController: import('vue').DefineComponent<{
441
+ hideBorderForSingleNode: {
442
+ type: BooleanConstructor;
443
+ default: boolean;
444
+ };
445
+ }, {}, {}, {
441
446
  graphInstance(): any;
442
447
  options(): any;
443
- }, {}, import('vue/types/v3-component-options').ComponentOptionsMixin, import('vue/types/v3-component-options').ComponentOptionsMixin, {}, string, Readonly<import('vue').ExtractPropTypes<{}>>, {}>;
448
+ }, {}, import('vue/types/v3-component-options').ComponentOptionsMixin, import('vue/types/v3-component-options').ComponentOptionsMixin, {}, string, Readonly<import('vue').ExtractPropTypes<{
449
+ hideBorderForSingleNode: {
450
+ type: BooleanConstructor;
451
+ default: boolean;
452
+ };
453
+ }>>, {
454
+ hideBorderForSingleNode: boolean;
455
+ }>;
444
456
  export declare const RGEditingResize: import('vue').DefineComponent<{
445
457
  disableResizeWidth: {
446
458
  type: BooleanConstructor;
@@ -605,12 +617,30 @@ export declare const RGConnectTarget: import('vue').DefineComponent<{
605
617
  mustUseProp: boolean;
606
618
  type: BooleanConstructor;
607
619
  };
620
+ domMode: {
621
+ mustUseProp: boolean;
622
+ type: () => import('../../../types').RGConnectTargetDomMode;
623
+ };
624
+ measureSelector: {
625
+ mustUseProp: boolean;
626
+ type: StringConstructor;
627
+ };
628
+ strictMeasureTarget: {
629
+ mustUseProp: boolean;
630
+ type: BooleanConstructor;
631
+ };
608
632
  }, {}, {}, {
609
633
  RGInnerConnectTargetType(): typeof import('../../../types').RGInnerConnectTargetType;
610
634
  RGJunctionPoint(): typeof import('../../../types').RGJunctionPoint;
611
635
  graphInstance(): any;
612
636
  options(): any;
637
+ actualJunctionPoint(): string;
638
+ normalizedDomMode(): import('../../../types').RGConnectTargetDomMode;
639
+ resolvedHostStyle(): string | (string | {
640
+ display: string;
641
+ })[];
613
642
  }, {
643
+ registerCurrentTarget(): void;
614
644
  onClick($event: any): void;
615
645
  onMouseDown($event: any): void;
616
646
  onMouseUp(type: any, $event: any): void;
@@ -648,11 +678,24 @@ export declare const RGConnectTarget: import('vue').DefineComponent<{
648
678
  mustUseProp: boolean;
649
679
  type: BooleanConstructor;
650
680
  };
681
+ domMode: {
682
+ mustUseProp: boolean;
683
+ type: () => import('../../../types').RGConnectTargetDomMode;
684
+ };
685
+ measureSelector: {
686
+ mustUseProp: boolean;
687
+ type: StringConstructor;
688
+ };
689
+ strictMeasureTarget: {
690
+ mustUseProp: boolean;
691
+ type: BooleanConstructor;
692
+ };
651
693
  }>>, {
652
694
  disableDrag: boolean;
653
695
  junctionPoint: string;
654
- disableDrop: boolean;
696
+ strictMeasureTarget: boolean;
655
697
  forSvg: boolean;
698
+ disableDrop: boolean;
656
699
  }>;
657
700
  export declare const RGEditingConnectPoints: import('vue').DefineComponent<{
658
701
  mouseUpOnJunctionPoint: {
@@ -748,9 +791,9 @@ export declare const RelationLinker: import('vue').DefineComponent<{
748
791
  type: FunctionConstructor;
749
792
  };
750
793
  }>>, {
794
+ lines: unknown[];
751
795
  options: Record<string, any>;
752
796
  relationGraphCore: Function;
753
- lines: unknown[];
754
797
  }>;
755
798
  export declare const RelationGraph: import('vue').DefineComponent<{
756
799
  options: {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * relation-graph
3
3
  * Website: http://www.relation-graph.com/
4
- * Github: https://github.com/seeksdream/relation-graph
4
+ * Github: https://github.com/relation-graph/relation-graph
5
5
  *
6
6
  */
7
7
  export * from './index.shared';
@@ -1,9 +1,145 @@
1
- import { JsonLine, RGLine, RGLink, RGOptions } from '../../types';
1
+ import { JsonLine, RGFakeLine, RGJunctionPoint, RGLine, RGLink, RGOptions } from '../../types';
2
+ export type RGTransLineToJsonOptions = {
3
+ mode?: 'compact' | 'effective';
4
+ graphOptions?: RGOptions;
5
+ };
2
6
  export declare const json2Line: (originData: JsonLine, options: RGOptions) => RGLine;
3
- export declare const transLineToJson: (line: RGLine) => JsonLine | undefined;
4
- export declare const transLinkToJson: (link: RGLink) => JsonLine | undefined;
7
+ export declare const transLineToJson: (line: RGLine | RGFakeLine, options?: RGTransLineToJsonOptions) => JsonLine | {
8
+ id: string;
9
+ from: string;
10
+ to: string;
11
+ text: string;
12
+ type: string;
13
+ isFakeLine: boolean;
14
+ fromType: string;
15
+ toType: string;
16
+ color: string | undefined;
17
+ lineWidth: number | undefined;
18
+ opacity: number;
19
+ lineShape: number;
20
+ showStartArrow: boolean;
21
+ showEndArrow: boolean;
22
+ startMarkerId: string;
23
+ endMarkerId: string;
24
+ useTextOnPath: boolean;
25
+ textOffsetX: number;
26
+ textOffsetY: number;
27
+ disablePointEvent: boolean | undefined;
28
+ data: Record<string, any>;
29
+ animation: number;
30
+ dashType: number;
31
+ lineRadius: number | undefined;
32
+ forDisplayOnly: boolean;
33
+ junctionOffset: number;
34
+ fromJunctionPoint: RGJunctionPoint;
35
+ toJunctionPoint: RGJunctionPoint;
36
+ fromJunctionPointOffsetX: number;
37
+ fromJunctionPointOffsetY: number;
38
+ toJunctionPointOffsetX: number;
39
+ toJunctionPointOffsetY: number;
40
+ hidden: boolean;
41
+ selected?: boolean | undefined;
42
+ fontColor?: string | undefined;
43
+ fontSize?: number | undefined;
44
+ className?: string | undefined;
45
+ placeText?: "start" | "center" | "end" | undefined;
46
+ textAnchor?: string | undefined;
47
+ lineDirection?: string | undefined;
48
+ polyLineStartDistance?: number | undefined;
49
+ cssVars?: Record<string, any> | undefined;
50
+ force_elastic?: number | undefined;
51
+ } | undefined;
52
+ export declare const transLinkToJson: (link: RGLink, options?: RGTransLineToJsonOptions) => JsonLine | {
53
+ id: string;
54
+ from: string;
55
+ to: string;
56
+ text: string;
57
+ type: string;
58
+ isFakeLine: boolean;
59
+ fromType: string;
60
+ toType: string;
61
+ color: string | undefined;
62
+ lineWidth: number | undefined;
63
+ opacity: number;
64
+ lineShape: number;
65
+ showStartArrow: boolean;
66
+ showEndArrow: boolean;
67
+ startMarkerId: string;
68
+ endMarkerId: string;
69
+ useTextOnPath: boolean;
70
+ textOffsetX: number;
71
+ textOffsetY: number;
72
+ disablePointEvent: boolean | undefined;
73
+ data: Record<string, any>;
74
+ animation: number;
75
+ dashType: number;
76
+ lineRadius: number | undefined;
77
+ forDisplayOnly: boolean;
78
+ junctionOffset: number;
79
+ fromJunctionPoint: RGJunctionPoint;
80
+ toJunctionPoint: RGJunctionPoint;
81
+ fromJunctionPointOffsetX: number;
82
+ fromJunctionPointOffsetY: number;
83
+ toJunctionPointOffsetX: number;
84
+ toJunctionPointOffsetY: number;
85
+ hidden: boolean;
86
+ selected?: boolean | undefined;
87
+ fontColor?: string | undefined;
88
+ fontSize?: number | undefined;
89
+ className?: string | undefined;
90
+ placeText?: "start" | "center" | "end" | undefined;
91
+ textAnchor?: string | undefined;
92
+ lineDirection?: string | undefined;
93
+ polyLineStartDistance?: number | undefined;
94
+ cssVars?: Record<string, any> | undefined;
95
+ force_elastic?: number | undefined;
96
+ } | undefined;
5
97
  declare const _default: {
6
98
  json2Line: (originData: JsonLine, options: Partial<import('../../types').RGOptionsInited>) => RGLine;
7
- transLinkToJson: (link: RGLink) => JsonLine | undefined;
99
+ transLinkToJson: (link: RGLink, options?: RGTransLineToJsonOptions) => JsonLine | {
100
+ id: string;
101
+ from: string;
102
+ to: string;
103
+ text: string;
104
+ type: string;
105
+ isFakeLine: boolean;
106
+ fromType: string;
107
+ toType: string;
108
+ color: string | undefined;
109
+ lineWidth: number | undefined;
110
+ opacity: number;
111
+ lineShape: number;
112
+ showStartArrow: boolean;
113
+ showEndArrow: boolean;
114
+ startMarkerId: string;
115
+ endMarkerId: string;
116
+ useTextOnPath: boolean;
117
+ textOffsetX: number;
118
+ textOffsetY: number;
119
+ disablePointEvent: boolean | undefined;
120
+ data: Record<string, any>;
121
+ animation: number;
122
+ dashType: number;
123
+ lineRadius: number | undefined;
124
+ forDisplayOnly: boolean;
125
+ junctionOffset: number;
126
+ fromJunctionPoint: RGJunctionPoint;
127
+ toJunctionPoint: RGJunctionPoint;
128
+ fromJunctionPointOffsetX: number;
129
+ fromJunctionPointOffsetY: number;
130
+ toJunctionPointOffsetX: number;
131
+ toJunctionPointOffsetY: number;
132
+ hidden: boolean;
133
+ selected?: boolean | undefined;
134
+ fontColor?: string | undefined;
135
+ fontSize?: number | undefined;
136
+ className?: string | undefined;
137
+ placeText?: "start" | "center" | "end" | undefined;
138
+ textAnchor?: string | undefined;
139
+ lineDirection?: string | undefined;
140
+ polyLineStartDistance?: number | undefined;
141
+ cssVars?: Record<string, any> | undefined;
142
+ force_elastic?: number | undefined;
143
+ } | undefined;
8
144
  };
9
145
  export default _default;
@@ -1,4 +1,9 @@
1
1
  import { JsonNode, RGNode, RGOptions } from '../../types';
2
+ export type RGTransNodeToJsonOptions = {
3
+ mode?: 'compact' | 'effective';
4
+ graphOptions?: RGOptions;
5
+ effectiveSizeMode?: 'resolved' | 'node';
6
+ };
2
7
  export declare const newNodeTemplate: {
3
8
  id: string;
4
9
  x: number;
@@ -9,9 +14,9 @@ export declare const json2Node: (originData: JsonNode, graphOptions?: RGOptions,
9
14
  number,
10
15
  number
11
16
  ]>) => RGNode;
12
- export declare const transNodeToJson: (node: RGNode) => JsonNode | undefined;
17
+ export declare const transNodeToJson: (node: RGNode, options?: RGTransNodeToJsonOptions) => JsonNode | undefined;
13
18
  declare const _default: {
14
19
  json2Node: (originData: JsonNode, graphOptions?: Partial<import('../../types').RGOptionsInited> | undefined, nodesSizeMap?: Map<string, [number, number]> | undefined) => RGNode;
15
- transNodeToJson: (node: RGNode) => JsonNode | undefined;
20
+ transNodeToJson: (node: RGNode, options?: RGTransNodeToJsonOptions) => JsonNode | undefined;
16
21
  };
17
22
  export default _default;
@@ -5,10 +5,11 @@ import { RGDataProvider } from '../data/RGDataProvider';
5
5
  */
6
6
  export declare class RelationGraphBase {
7
7
  listeners: RGListeners;
8
- private useReactiveDataToAutoUpdateView;
8
+ protected useReactiveDataToAutoUpdateView: boolean;
9
9
  protected instanceId: string;
10
10
  dataProvider: RGDataProvider;
11
11
  options: RGOptionsFull;
12
+ protected _previousUpdateTime: number;
12
13
  constructor();
13
14
  /**
14
15
  * Generate a highly likely unique id, the probability of non-duplication depends on the parameter idLength (the length of the id)
@@ -26,6 +27,12 @@ export declare class RelationGraphBase {
26
27
  * @protected
27
28
  */
28
29
  protected _dataUpdated(): void;
30
+ protected _beforeViewDataUpdated(): void;
31
+ protected _updateEditingControllerView(): void;
32
+ protected _updateEditingConnectControllerView(): void;
33
+ protected updateShouldRenderGraphData(_force?: boolean): void;
34
+ protected updateEasyView(): void;
35
+ protected updateMiniView(): void;
29
36
  private _dataUpdatedRequested;
30
37
  /**
31
38
  * @inner
@@ -1,4 +1,4 @@
1
- import { RGLine, RGUserEvent, RGCoordinate, RGNode, RGLink } from '../../types';
1
+ import { RGLine, RGUserEvent, RGCoordinate, RGNode, RGLink, RGRectTarget } from '../../types';
2
2
  import { RelationGraphBase } from './RelationGraphBase';
3
3
  /**
4
4
  * Relation-graph component view related class
@@ -6,6 +6,7 @@ import { RelationGraphBase } from './RelationGraphBase';
6
6
  export declare class RelationGraphWith1View extends RelationGraphBase {
7
7
  $dom: HTMLDivElement;
8
8
  $canvasDom: HTMLDivElement;
9
+ protected dataStores: Record<string, any>;
9
10
  /**
10
11
  * @inner
11
12
  */
@@ -13,15 +14,15 @@ export declare class RelationGraphWith1View extends RelationGraphBase {
13
14
  /**
14
15
  * @inner
15
16
  */
16
- private $lineTextContainer4NormalLine;
17
+ protected $lineTextContainer4NormalLine: HTMLDivElement;
17
18
  /**
18
19
  * @inner
19
20
  */
20
- private $lineTextContainer4FakeLine;
21
+ protected $lineTextContainer4FakeLine: HTMLDivElement;
21
22
  /**
22
23
  * @inner
23
24
  */
24
- getLineTextContainer(line: RGLine): HTMLDivElement | undefined;
25
+ getLineTextContainer(line?: Pick<RGLine, 'isFakeLine'> | null): HTMLDivElement | undefined;
25
26
  private viewBoundingClientRect;
26
27
  /**
27
28
  * Get the RelationGraph component DOM
@@ -32,6 +33,7 @@ export declare class RelationGraphWith1View extends RelationGraphBase {
32
33
  * @deprecated Please use getViewBoundingClientRect instead of getBoundingClientRect, this method is compatible with older api versions.
33
34
  */
34
35
  getBoundingClientRect(): DOMRect | null;
36
+ getCanvasSlotRectItems(): RGRectTarget[];
35
37
  /**
36
38
  * Compatible with older api versions
37
39
  * @param e
@@ -74,20 +76,21 @@ export declare class RelationGraphWith1View extends RelationGraphBase {
74
76
  * @param clientXY
75
77
  */
76
78
  getCanvasCoordinateByClientCoordinate(clientXY: RGCoordinate): RGCoordinate;
79
+ protected getEventTargetElement(e: RGUserEvent): Element | null;
77
80
  /**
78
81
  * Check if el is a node element, if so, return the corresponding node object
79
82
  * - You can use this method to determine if the element currently under the mouse is a node element, and get the corresponding node object
80
83
  * @param el
81
84
  * @return RGNode | undefined
82
85
  */
83
- isNode(el: HTMLElement): RGNode | undefined;
86
+ isNode(el: Element | null): RGNode | undefined;
84
87
  /**
85
88
  * Check if el is a line element, if so, return the corresponding line object
86
89
  * - You can use this method to determine if the element currently under the mouse is a line element, and get the corresponding line object
87
90
  * @param el
88
91
  * @return RGLine | undefined
89
92
  */
90
- isLine(el: HTMLElement): RGLine | undefined;
93
+ isLine(el: Element | null): RGLine | undefined;
91
94
  /**
92
95
  * @deprecated Please use isLine instead of isLink, this method is compatible with older api versions.
93
96
  * @param el
@@ -1,5 +1,20 @@
1
- import { RGConnectTargetData, RGJunctionPoint } from '../../types';
1
+ import { RGConnectTargetData, RGConnectTargetDomMode, RGJunctionPoint, RGRegisterConnectTargetOptions } from '../../types';
2
2
  import { RelationGraphWith2Data3Update } from './RelationGraphWith2Data3Update';
3
+ type RGRegisteredConnectTargetRuntime = {
4
+ targetId: string;
5
+ hostEl: Element;
6
+ measureEl: Element;
7
+ triggerEl: Element;
8
+ domMode: RGConnectTargetDomMode;
9
+ measureSelector?: string;
10
+ strictMeasureTarget?: boolean;
11
+ };
12
+ type RGRegisteredConnectTargetLookup = {
13
+ connectTargetEl: Element;
14
+ matchedEl: Element;
15
+ connectTarget: RGConnectTargetData;
16
+ runtime: RGRegisteredConnectTargetRuntime;
17
+ };
3
18
  /**
4
19
  * The class related to connection point management in the relation-graph component, where the connection point refers to the connection point registered through the <RGConnectTarget> component
5
20
  */
@@ -7,7 +22,12 @@ export declare class RelationGraphWith2Data4ConnectTarget extends RelationGraphW
7
22
  constructor();
8
23
  private canvasConnectTargetsMap;
9
24
  private nodeConnectTargetsMap;
10
- private connectTargetElementMap;
25
+ private connectTargetRuntimeMap;
26
+ private connectTargetIdByHostElement;
27
+ private connectTargetIdByMeasureElement;
28
+ private connectTargetIdByTriggerElement;
29
+ protected _observeConnectTargetElement(_targetId: string, _runtime: RGRegisteredConnectTargetRuntime): void;
30
+ protected _unobserveConnectTargetElement(_targetId: string, _runtime: RGRegisteredConnectTargetRuntime): void;
11
31
  /**
12
32
  * In general, relation-graph will automatically update the position of the connection points.
13
33
  * - This method is only used for manual calls in some special scenarios.
@@ -31,11 +51,28 @@ export declare class RelationGraphWith2Data4ConnectTarget extends RelationGraphW
31
51
  /**
32
52
  * @inner
33
53
  */
34
- protected updateConnectTargetsOnNode(by: string, nodeId: string, nodeEl: HTMLDivElement): void;
54
+ protected getConnectTargetRuntimeById(targetId: string): RGRegisteredConnectTargetRuntime | undefined;
55
+ /**
56
+ * @inner
57
+ */
58
+ protected getConnectTargetElementById(targetId: string): Element | undefined;
59
+ /**
60
+ * @inner
61
+ */
62
+ protected getConnectTargetHostElementById(targetId: string): Element | undefined;
63
+ /**
64
+ * @inner
65
+ */
66
+ protected updateConnectTargetsOnNode(by: string, nodeId: string, nodeEl: Element): void;
35
67
  /**
36
68
  * @inner
37
69
  */
38
70
  protected updateConnectTargetList(by: string, relativeNodeEl: Element, connectTargetList: RGConnectTargetData[]): void;
71
+ protected getRegisteredConnectTargetByElement(connectTargetEl: Element): RGRegisteredConnectTargetLookup | undefined;
72
+ protected getConnectTargetByElement(connectTargetEl: Element): RGConnectTargetData | undefined;
73
+ protected refreshConnectTargetRuntimeById(by: string, targetId: string, explicitMeasureEl?: Element): void;
74
+ protected updateConnectTargetById(by: string, targetId: string, connectTargetEl?: Element): void;
75
+ private removeConnectTargetFromOwnerMaps;
39
76
  /**
40
77
  * @inner
41
78
  */
@@ -53,6 +90,30 @@ export declare class RelationGraphWith2Data4ConnectTarget extends RelationGraphW
53
90
  * @inner
54
91
  */
55
92
  private _updateConnectTargetOffset;
93
+ protected getConnectTargetRelativeElement(connectTarget: RGConnectTargetData, connectTargetEl?: Element): Element | null;
94
+ protected measureConnectTargetGeometry(connectTarget: RGConnectTargetData, connectTargetEl?: Element, relativeEl?: Element): {
95
+ offsetX: number;
96
+ offsetY: number;
97
+ width: number;
98
+ height: number;
99
+ } | undefined;
100
+ protected createLineTargetFromConnectTarget(connectTarget: RGConnectTargetData, geometry?: {
101
+ offsetX: number;
102
+ offsetY: number;
103
+ width: number;
104
+ height: number;
105
+ }): {
106
+ x: number;
107
+ y: number;
108
+ targetType: string;
109
+ targetData: Record<string, any>;
110
+ junctionPoint: RGJunctionPoint;
111
+ nodeShape: number;
112
+ id: string;
113
+ el_W: number;
114
+ el_H: number;
115
+ hidden: boolean;
116
+ } | undefined;
56
117
  /**
57
118
  * @inner
58
119
  */
@@ -60,11 +121,17 @@ export declare class RelationGraphWith2Data4ConnectTarget extends RelationGraphW
60
121
  /**
61
122
  * @inner
62
123
  */
63
- private getNodeElByChildrenTarget;
124
+ protected getNodeElByChildrenTarget(connectTargetEl: Node | Element): HTMLDivElement | null;
125
+ protected normalizeConnectTargetDomMode(hostEl: Element, domMode?: RGConnectTargetDomMode): RGConnectTargetDomMode;
126
+ protected resolveConnectTargetMeasureElement(options: RGRegisterConnectTargetOptions): Element | undefined;
127
+ private removeRuntimeElementMappings;
128
+ private addRuntimeElementMappings;
129
+ private isSameRuntime;
130
+ private applyConnectTargetRuntime;
64
131
  /**
65
132
  * @inner
66
133
  */
67
- registerConnectTarget(connectTargetEl: HTMLDivElement, targetId: string, targetType: string, junctionPoint: RGJunctionPoint, targetData?: Record<string, any>): RGConnectTargetData | undefined;
134
+ registerConnectTarget(connectTargetElOrOptions: Element | RGRegisterConnectTargetOptions, targetId?: string, targetType?: string, junctionPoint?: RGJunctionPoint, targetData?: Record<string, any>): RGConnectTargetData | undefined;
68
135
  /**
69
136
  * @inner
70
137
  */
@@ -83,3 +150,4 @@ export declare class RelationGraphWith2Data4ConnectTarget extends RelationGraphW
83
150
  */
84
151
  private reuseConnectTarget;
85
152
  }
153
+ export {};
@@ -1,10 +1,26 @@
1
- import { RGFakeLine, RGFakeLineTargetRender, RGGenerateLineConfig, RGLine, RGLineTarget, RGOptionsFull } from '../../types';
1
+ import { RGJunctionPoint, JsonLineLike, RGFakeLine, RGFakeLineTargetRender, RGGenerateLineConfig, RGLine, RGLineTarget, RGOptionsFull } from '../../types';
2
2
  import { RelationGraphWith2Data4ConnectTarget } from './RelationGraphWith2Data4ConnectTarget';
3
+ type ResolveTargetRectOptions = {
4
+ preferLiveTarget?: boolean;
5
+ connectTargetEl?: Element;
6
+ };
7
+ type ResolvedConnectTargetDescriptor = {
8
+ targetId: string;
9
+ targetType: string;
10
+ junctionPoint: RGJunctionPoint;
11
+ connectTargetEl: Element;
12
+ hostEl: Element;
13
+ measureEl: Element;
14
+ triggerEl: Element;
15
+ };
3
16
  /**
4
17
  * API class for generating line configuration and line connection point information in relation-graph component, providing data support for drawing lines
5
18
  */
6
19
  export declare class RelationGraphWith2Data5LineConfig extends RelationGraphWith2Data4ConnectTarget {
7
20
  constructor();
21
+ private resolvedTargetCache;
22
+ protected _beforeViewDataUpdated(): void;
23
+ protected resolveTargetDescriptorByElement(targetEl: Element): ResolvedConnectTargetDescriptor | undefined;
8
24
  /**
9
25
  * @inner
10
26
  */
@@ -31,5 +47,7 @@ export declare class RelationGraphWith2Data5LineConfig extends RelationGraphWith
31
47
  * @param targetId
32
48
  * @param fakeLine
33
49
  */
34
- getFakeLineTarget(targetType: string, targetId: string, fakeLine: RGFakeLine): RGLineTarget | undefined;
50
+ protected resolveTargetRect(targetType: string, targetId: string, lineContext: JsonLineLike, options?: ResolveTargetRectOptions): RGLineTarget | undefined;
51
+ getFakeLineTarget(targetType: string, targetId: string, lineContext: JsonLineLike, options?: ResolveTargetRectOptions): RGLineTarget | undefined;
35
52
  }
53
+ export {};
@@ -16,11 +16,15 @@ export declare class RelationGraphWith6Layout extends RelationGraphWith6Effect {
16
16
  private _layoutTimer;
17
17
  private _layoutPromise;
18
18
  private _layoutResolve;
19
+ private _layoutReject;
19
20
  /**
20
- * @inner
21
- * @private
21
+ * Immediately assign positions to the nodes in the current graph based on the layout configuration set in the options
22
+ * - By default, the first node in the graph is used as the root node for layout. You can also specify a custom root node by passing a node object or node id as a parameter.
23
+ * - Unlike doLayout, this method directly performs the layout logic without the outer scheduling, merge, or delay handling.
24
+ * @param customRootNode Optional, specify a custom root node for layout, can be a node object or node id
25
+ * @return Promise<void>
22
26
  */
23
- private _doLayout;
27
+ _doLayout(customRootNode?: RGNode | string): Promise<void>;
24
28
  /**
25
29
  * @inner
26
30
  * @protected
@@ -9,6 +9,7 @@ import { RelationGraphWith6Layout } from './RelationGraphWith6Layout';
9
9
  */
10
10
  export declare class RelationGraphWith7Event extends RelationGraphWith6Layout {
11
11
  constructor();
12
+ protected draggingSelectedNodes(_draggedNode: RGNode, _newX: number, _newY: number, _buff_x: number, _buff_y: number): void;
12
13
  private _prevClickNodeTime;
13
14
  /**
14
15
  * Triggered when the user clicks on a node
@@ -81,7 +82,7 @@ export declare class RelationGraphWith7Event extends RelationGraphWith6Layout {
81
82
  * @inner
82
83
  * @private
83
84
  */
84
- private onCanvasDragEnd;
85
+ protected onCanvasDragEnd(e: RGUserEvent): void;
85
86
  /**
86
87
  * User clicks on the canvas
87
88
  * @param e
@@ -146,7 +147,7 @@ export declare class RelationGraphWith7Event extends RelationGraphWith6Layout {
146
147
  * @returns Return true to prevent the line from being created.
147
148
  * @protected
148
149
  */
149
- protected onReadyToCreateLine(from: RGNode, to: RGNode | RGPosition): false | RGCoordinate | undefined;
150
+ protected onReadyToCreateLine(from: RGNode | RGLineTarget | RGPosition, to: RGNode | RGLineTarget | RGPosition): false | RGCoordinate | undefined;
150
151
  /**
151
152
  * User right-click context menu event
152
153
  * - Finally, you can get this event through the onContextmenu event, and you can get the position where the user right-clicked and the type of object clicked (canvas | line | node) and the object through this event.
@@ -1,5 +1,5 @@
1
- import { RGRectTarget } from 'packages/platforms/vue2/dd/types/packages/types';
2
- import { RGNode } from '../../types';
1
+ import { RGNode, RGRectTarget } from '../../types';
2
+ import { RGAnalyzeRenderedGraphOptions, RGAnalyzeRenderedGraphResult } from '../utils/RGClassAndRender';
3
3
  import { RelationGraphWith93Image } from './RelationGraphWith93Image';
4
4
  /**
5
5
  * Enhancement class for relation-graph component to interact with DOM, monitor changes in the view and elements within the view, and respond accordingly
@@ -8,6 +8,7 @@ export declare class RelationGraphWith95Dom extends RelationGraphWith93Image {
8
8
  protected resizeObserver: ResizeObserver;
9
9
  protected resizeListenerMap: WeakMap<object, any>;
10
10
  protected domToNodeIdMap: WeakMap<Element, string>;
11
+ protected connectTargetHostMutationObserverMap: Map<Element, MutationObserver>;
11
12
  private _trackpadGestureActive;
12
13
  private _trackpadGestureStartZoom;
13
14
  private _trackpadGestureAnchorView;
@@ -28,6 +29,17 @@ export declare class RelationGraphWith95Dom extends RelationGraphWith93Image {
28
29
  * @param relationGraphDom:HTMLDivElement canvas DOM
29
30
  */
30
31
  setCanvasDom(canvasDom: HTMLDivElement): void;
32
+ /**
33
+ * Analyze the currently rendered graph DOM and classify node styles, node render methods, and line styles.
34
+ * - This method only relies on the final DOM/CSS result, so it can capture styles from both data-driven configuration and external CSS overrides.
35
+ * - The returned nodes/lines also include merged JsonNode/JsonLine effective values based on the current graph options.
36
+ * - It is only valid when the graph is rendered with real DOM nodes/lines. In performance mode or easy-view mode it will return a degraded result.
37
+ */
38
+ analyzeRenderedGraph(options?: RGAnalyzeRenderedGraphOptions): Promise<RGAnalyzeRenderedGraphResult>;
39
+ /**
40
+ * @deprecated Use analyzeRenderedGraph instead.
41
+ */
42
+ getClassAndRender(options?: RGAnalyzeRenderedGraphOptions): Promise<RGAnalyzeRenderedGraphResult>;
31
43
  /**
32
44
  * @inner
33
45
  * @private
@@ -75,7 +87,15 @@ export declare class RelationGraphWith95Dom extends RelationGraphWith93Image {
75
87
  * @param callback
76
88
  * @protected
77
89
  */
78
- protected addResizeListener(dom: HTMLElement, callback: (width: number, height: number) => void): void;
90
+ protected addResizeListener(dom: Element, callback: (width: number, height: number) => void): void;
91
+ protected _observeConnectTargetElement(targetId: string, runtime: {
92
+ hostEl: Element;
93
+ measureEl: Element;
94
+ }): void;
95
+ protected _unobserveConnectTargetElement(_targetId: string, runtime: {
96
+ hostEl: Element;
97
+ measureEl: Element;
98
+ }): void;
79
99
  /**
80
100
  * Node DOM resize event handler
81
101
  * @inner
@@ -113,7 +133,7 @@ export declare class RelationGraphWith95Dom extends RelationGraphWith93Image {
113
133
  * @param dom
114
134
  * @protected
115
135
  */
116
- protected removeResizeListener(dom: HTMLElement): void;
136
+ protected removeResizeListener(dom: Element): void;
117
137
  /**
118
138
  * @inner
119
139
  * @protected
@@ -1,5 +1,7 @@
1
1
  import { JsonLine, JsonNode, RGJsonData, RGLine, RGLink, RGNode, RGOptions, RGRectTarget } from '../../types';
2
2
  import { RelationGraphWith95Dom } from './RelationGraphWith95Dom';
3
+ import { RGTransNodeToJsonOptions } from '../data/RGNodeDataUtils';
4
+ import { RGTransLineToJsonOptions } from '../data/RGLineDataUtils';
3
5
  /**
4
6
  * Additional API methods provided by the relation-graph component
5
7
  */
@@ -84,17 +86,17 @@ export declare class RelationGraphWith99API extends RelationGraphWith95Dom {
84
86
  * Convert an RGNode object to a JSON-serializable object
85
87
  * @param nodeJson: JsonNode
86
88
  */
87
- transRGNodeToJsonObject(node: RGNode): JsonNode;
89
+ transRGNodeToJsonObject(node: RGNode, options?: RGTransNodeToJsonOptions): JsonNode;
88
90
  /**
89
91
  * Convert an RGLink object to a JSON-serializable object
90
92
  * @param lines: JsonLine
91
93
  */
92
- transRGLinkToJsonObject(link: RGLink): JsonLine;
94
+ transRGLinkToJsonObject(link: RGLink, options?: RGTransLineToJsonOptions): JsonLine;
93
95
  /**
94
96
  * Convert an RGLine object to a JSON-serializable object
95
97
  * @param lineJson: JsonLine
96
98
  */
97
- transRGLineToJsonObject(line: RGLine): JsonLine;
99
+ transRGLineToJsonObject(line: RGLine, options?: RGTransLineToJsonOptions): JsonLine;
98
100
  /**
99
101
  * Get the configuration information of the current graph
100
102
  */