@relation-graph/react 3.0.2 → 3.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.
Files changed (94) hide show
  1. package/package.json +1 -1
  2. package/relation-graph.js +5 -5
  3. package/relation-graph.mjs +1528 -1407
  4. package/relation-graph.umd.js +5 -5
  5. package/types/packages/platforms/react/src/index.d.ts +6 -1
  6. package/types/packages/platforms/vue2/src/core4vue/editing/RGConnectTarget.vue.d.ts +32 -2
  7. package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingLineController.vue.d.ts +7 -0
  8. package/types/packages/platforms/vue2/src/index.d.ts +38 -2
  9. package/types/packages/relation-graph-models/data/RGDataDefine.d.ts +2 -2
  10. package/types/packages/relation-graph-models/data/RGDataGetter.d.ts +3 -3
  11. package/types/packages/relation-graph-models/data/RGDataProvider.d.ts +3 -3
  12. package/types/packages/relation-graph-models/data/RGNodeDataUtils.d.ts +2 -2
  13. package/types/packages/relation-graph-models/layouts/RGForceLayout.d.ts +18 -13
  14. package/types/packages/relation-graph-models/layouts/analyzers/BasicNetworkAnalyzer.d.ts +1 -0
  15. package/types/packages/relation-graph-models/layouts/tmp/old.d.ts +1 -0
  16. package/types/packages/relation-graph-models/models/RelationGraphBase.d.ts +2 -2
  17. package/types/packages/relation-graph-models/models/RelationGraphWith2Data1Getter.d.ts +2 -1
  18. package/types/packages/relation-graph-models/models/RelationGraphWith2Data4ConnectTarget.d.ts +3 -3
  19. package/types/packages/relation-graph-models/models/RelationGraphWith4Line.d.ts +1 -0
  20. package/types/packages/relation-graph-models/models/RelationGraphWith6Layout.d.ts +5 -1
  21. package/types/packages/relation-graph-models/models/RelationGraphWith95Dom.d.ts +3 -0
  22. package/types/packages/types.ts +26 -25
  23. package/types/packages/platforms/react/src/relation-graph/RGPovider.d.ts +0 -7
  24. package/types/packages/platforms/react/src/relation-graph/src/core4react/RelationLinkerContent.d.ts +0 -4
  25. package/types/packages/platforms/react/src/relation-graph/src/core4react/RelationView.d.ts +0 -4
  26. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/NewCanvas.d.ts +0 -20
  27. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/NewCanvasV2.d.ts +0 -1
  28. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/NewCanvasV3.d.ts +0 -1
  29. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnSVGDefs.d.ts +0 -3
  30. package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnToolbar.d.ts +0 -3
  31. package/types/packages/platforms/react/src/relation-graph/src/core4react/store/reducers/StockStore.d.ts +0 -8
  32. package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphDebugPanel.d.ts +0 -3
  33. package/types/packages/platforms/react/src/types.d.ts +0 -1
  34. package/types/packages/platforms/react/vite.config.d.ts +0 -2
  35. package/types/packages/platforms/vue2/src/core4vue/RGLineText.vue.d.ts +0 -33
  36. package/types/packages/platforms/vue2/src/core4vue/widgets/GraphDebugPanel.vue.d.ts +0 -12
  37. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGCanvas.vue.d.ts +0 -34
  38. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGCanvasContent.vue.d.ts +0 -37
  39. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGEasyView.vue.d.ts +0 -2
  40. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGFakeNode.vue.d.ts +0 -32
  41. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGGraphDefs.vue.d.ts +0 -29
  42. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGLineContent.vue.d.ts +0 -12
  43. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGLinePath.vue.d.ts +0 -16
  44. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGLinePeel.vue.d.ts +0 -29
  45. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGLineText.vue.d.ts +0 -27
  46. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGNodeExpandHolder.vue.d.ts +0 -18
  47. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGNodePeel.vue.d.ts +0 -40
  48. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGProvider.vue.d.ts +0 -34
  49. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RelationGraph.vue.d.ts +0 -39
  50. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RelationLinker.vue.d.ts +0 -130
  51. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RelationLinkerCanvas.vue.d.ts +0 -23
  52. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RelationLinkerView.vue.d.ts +0 -24
  53. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGConnectSource.vue.d.ts +0 -45
  54. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGConnectTarget.vue.d.ts +0 -46
  55. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingConnectController.vue.d.ts +0 -23
  56. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingConnectPoints.vue.d.ts +0 -16
  57. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingLineController.vue.d.ts +0 -56
  58. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingNearNodeWidget.vue.d.ts +0 -30
  59. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingNodeController.vue.d.ts +0 -17
  60. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingReferenceLine.vue.d.ts +0 -15
  61. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingResize.vue.d.ts +0 -19
  62. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGMiniView.vue.d.ts +0 -17
  63. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/index.vue.d.ts +0 -143
  64. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphBackground.vue.d.ts +0 -49
  65. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphDebugPanel.vue.d.ts +0 -2
  66. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphLoading.vue.d.ts +0 -2
  67. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphMoveOperator.vue.d.ts +0 -2
  68. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphOperateStuff.vue.d.ts +0 -19
  69. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphToolBar.vue.d.ts +0 -31
  70. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphWatermark.vue.d.ts +0 -56
  71. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphXsToolBar.vue.d.ts +0 -31
  72. package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/RGIcons.vue.d.ts +0 -15
  73. package/types/packages/relation-graph-models/layouters/RGBaseLayouter.d.ts +0 -36
  74. package/types/packages/relation-graph-models/layouters/RGCenterLayouter.d.ts +0 -12
  75. package/types/packages/relation-graph-models/layouters/RGCircleLayouter.d.ts +0 -8
  76. package/types/packages/relation-graph-models/layouters/RGFixedLayouter.d.ts +0 -11
  77. package/types/packages/relation-graph-models/layouters/RGFolderLayouter.d.ts +0 -17
  78. package/types/packages/relation-graph-models/layouters/RGForceLayouter.d.ts +0 -71
  79. package/types/packages/relation-graph-models/layouters/RGForceLayouterV2.d.ts +0 -59
  80. package/types/packages/relation-graph-models/layouters/RGSmartTreeLayouter.d.ts +0 -16
  81. package/types/packages/relation-graph-models/layouters/RGTreeLayouter.d.ts +0 -18
  82. package/types/packages/relation-graph-models/models/RGLineDataUtils.d.ts +0 -9
  83. package/types/packages/relation-graph-models/models/RGNodeDataUtils.d.ts +0 -14
  84. package/types/packages/relation-graph-models/models/RGOptionsDataUtils.d.ts +0 -11
  85. package/types/packages/relation-graph-models/models/RelationGraphFinal.d.ts +0 -11
  86. package/types/packages/relation-graph-models/models/RelationGraphReact.d.ts +0 -5
  87. package/types/packages/relation-graph-models/models/RelationGraphWith1Dom.d.ts +0 -76
  88. package/types/packages/relation-graph-models/models/RelationGraphWith3Image.d.ts +0 -20
  89. package/types/packages/relation-graph-models/models/RelationGraphWith8Update.d.ts +0 -23
  90. package/types/packages/relation-graph-models/types.d.ts +0 -903
  91. package/types/react.d.ts +0 -201
  92. package/types/svelte.d.ts +0 -170
  93. package/types/vue2.d.ts +0 -862
  94. package/types/vue3.d.ts +0 -1246
@@ -215,5 +215,10 @@ export declare const useRelationGraph: typeof import('./relation-graph/src/hooks
215
215
  export declare const RGProvider: import('react').FC<import('react').PropsWithChildren<import('./types-react').RelationGraphWithWithCustomCore>>;
216
216
  export { RelationGraphStoreContext, RelationGraphStoreContext as RGInstanceContext, RGUpdateContext, RGUpdateSignalContext as RGUpdateSingalContext, RGUpdateSignalContext } from './relation-graph/src/core4react/store/reducers/RGStore';
217
217
  export type RelationGraphComponent = _RelationGraphComponent;
218
- export declare const RelationGraph: RelationGraphComponent;
218
+ export declare const RelationGraph: import('react').ForwardRefExoticComponent<import('../../../types').RGListeners & import('./types-react').RelationGraphWithSlots & {
219
+ options: import('../../../types').RGOptions;
220
+ initialData?: import('../../../types').RGJsonData;
221
+ } & import('./types-react').RelationGraphWithWithCustomCore & {
222
+ children?: import('react').ReactNode | undefined;
223
+ } & import('react').RefAttributes<import('../../../types').RelationGraphExpose>>;
219
224
  export default _RelationGraph;
@@ -1,3 +1,4 @@
1
+ import { RGInnerConnectTargetType, RGJunctionPoint } from '../../../../../types';
1
2
  declare const _default: import('vue').DefineComponent<{
2
3
  junctionPoint: {
3
4
  mustUseProp: boolean;
@@ -16,13 +17,28 @@ declare const _default: import('vue').DefineComponent<{
16
17
  mustUseProp: boolean;
17
18
  type: ObjectConstructor;
18
19
  };
20
+ lineTemplate: {
21
+ mustUseProp: boolean;
22
+ type: ObjectConstructor;
23
+ };
24
+ disableDrop: {
25
+ mustUseProp: boolean;
26
+ type: BooleanConstructor;
27
+ };
28
+ disableDrag: {
29
+ mustUseProp: boolean;
30
+ type: BooleanConstructor;
31
+ };
19
32
  }, {}, {}, {
33
+ RGInnerConnectTargetType(): typeof RGInnerConnectTargetType;
34
+ RGJunctionPoint(): typeof RGJunctionPoint;
20
35
  graphInstance(): any;
21
36
  options(): any;
22
37
  }, {
23
- onMouseDown(event: any): void;
38
+ onClick($event: any): void;
39
+ onMouseDown($event: any): void;
24
40
  onMouseUp(type: any, $event: any): void;
25
- }, import('vue/types/v3-component-options').ComponentOptionsMixin, import('vue/types/v3-component-options').ComponentOptionsMixin, {}, string, Readonly<import('vue').ExtractPropTypes<{
41
+ }, import('vue/types/v3-component-options').ComponentOptionsMixin, import('vue/types/v3-component-options').ComponentOptionsMixin, ("onLineVertexBeDropped" | "onDragConnectStart" | "onDragConnectEnd")[], string, Readonly<import('vue').ExtractPropTypes<{
26
42
  junctionPoint: {
27
43
  mustUseProp: boolean;
28
44
  default: string;
@@ -40,7 +56,21 @@ declare const _default: import('vue').DefineComponent<{
40
56
  mustUseProp: boolean;
41
57
  type: ObjectConstructor;
42
58
  };
59
+ lineTemplate: {
60
+ mustUseProp: boolean;
61
+ type: ObjectConstructor;
62
+ };
63
+ disableDrop: {
64
+ mustUseProp: boolean;
65
+ type: BooleanConstructor;
66
+ };
67
+ disableDrag: {
68
+ mustUseProp: boolean;
69
+ type: BooleanConstructor;
70
+ };
43
71
  }>>, {
72
+ disableDrag: boolean;
44
73
  junctionPoint: string;
74
+ disableDrop: boolean;
45
75
  }>;
46
76
  export default _default;
@@ -2,6 +2,9 @@ declare const _default: import('vue').DefineComponent<{
2
2
  textEditable: {
3
3
  default: boolean;
4
4
  };
5
+ pathEditable: {
6
+ default: boolean;
7
+ };
5
8
  }, {}, {
6
9
  lineText: string;
7
10
  editing: boolean;
@@ -30,7 +33,11 @@ declare const _default: import('vue').DefineComponent<{
30
33
  textEditable: {
31
34
  default: boolean;
32
35
  };
36
+ pathEditable: {
37
+ default: boolean;
38
+ };
33
39
  }>>, {
34
40
  textEditable: boolean;
41
+ pathEditable: boolean;
35
42
  }>;
36
43
  export default _default;
@@ -496,6 +496,9 @@ export declare const RGEditingLineController: import('vue').DefineComponent<{
496
496
  textEditable: {
497
497
  default: boolean;
498
498
  };
499
+ pathEditable: {
500
+ default: boolean;
501
+ };
499
502
  }, {}, {
500
503
  lineText: string;
501
504
  editing: boolean;
@@ -524,8 +527,12 @@ export declare const RGEditingLineController: import('vue').DefineComponent<{
524
527
  textEditable: {
525
528
  default: boolean;
526
529
  };
530
+ pathEditable: {
531
+ default: boolean;
532
+ };
527
533
  }>>, {
528
534
  textEditable: boolean;
535
+ pathEditable: boolean;
529
536
  }>;
530
537
  export declare const RGEditingConnectController: import('vue').DefineComponent<Readonly<{}>, {}, {}, {
531
538
  graphInstance(): any;
@@ -582,13 +589,28 @@ export declare const RGConnectTarget: import('vue').DefineComponent<{
582
589
  mustUseProp: boolean;
583
590
  type: ObjectConstructor;
584
591
  };
592
+ lineTemplate: {
593
+ mustUseProp: boolean;
594
+ type: ObjectConstructor;
595
+ };
596
+ disableDrop: {
597
+ mustUseProp: boolean;
598
+ type: BooleanConstructor;
599
+ };
600
+ disableDrag: {
601
+ mustUseProp: boolean;
602
+ type: BooleanConstructor;
603
+ };
585
604
  }, {}, {}, {
605
+ RGInnerConnectTargetType(): typeof import('../../../types').RGInnerConnectTargetType;
606
+ RGJunctionPoint(): typeof import('../../../types').RGJunctionPoint;
586
607
  graphInstance(): any;
587
608
  options(): any;
588
609
  }, {
589
- onMouseDown(event: any): void;
610
+ onClick($event: any): void;
611
+ onMouseDown($event: any): void;
590
612
  onMouseUp(type: any, $event: any): void;
591
- }, import('vue/types/v3-component-options').ComponentOptionsMixin, import('vue/types/v3-component-options').ComponentOptionsMixin, {}, string, Readonly<import('vue').ExtractPropTypes<{
613
+ }, import('vue/types/v3-component-options').ComponentOptionsMixin, import('vue/types/v3-component-options').ComponentOptionsMixin, ("onLineVertexBeDropped" | "onDragConnectStart" | "onDragConnectEnd")[], string, Readonly<import('vue').ExtractPropTypes<{
592
614
  junctionPoint: {
593
615
  mustUseProp: boolean;
594
616
  default: string;
@@ -606,8 +628,22 @@ export declare const RGConnectTarget: import('vue').DefineComponent<{
606
628
  mustUseProp: boolean;
607
629
  type: ObjectConstructor;
608
630
  };
631
+ lineTemplate: {
632
+ mustUseProp: boolean;
633
+ type: ObjectConstructor;
634
+ };
635
+ disableDrop: {
636
+ mustUseProp: boolean;
637
+ type: BooleanConstructor;
638
+ };
639
+ disableDrag: {
640
+ mustUseProp: boolean;
641
+ type: BooleanConstructor;
642
+ };
609
643
  }>>, {
644
+ disableDrag: boolean;
610
645
  junctionPoint: string;
646
+ disableDrop: boolean;
611
647
  }>;
612
648
  export declare const RGEditingConnectPoints: import('vue').DefineComponent<{
613
649
  mouseUpOnJunctionPoint: {
@@ -1,4 +1,4 @@
1
- import { RGGraphData, RGNode, RGLine, RGLink, RGOptionsFull, RGFakeLine, RGConnectTarget4NodePoint, RGLineTarget } from '../../types';
1
+ import { RGGraphData, RGNode, RGLine, RGLink, RGOptionsFull, RGFakeLine, RGConnectTargetData, RGLineTarget } from '../../types';
2
2
  /**
3
3
  * 数据提供者
4
4
  * 专门负责数据的增删改查,并自动触发视图更新
@@ -13,7 +13,7 @@ export declare class RGDataDefine {
13
13
  protected runtimeDATA4NodeMap: Map<string, RGNode>;
14
14
  protected runtimeDATA4Links: RGLink[];
15
15
  protected runtimeDATA4LinkMap: Map<string, RGLink>;
16
- protected runtimeDATA4ConnectTargets: RGConnectTarget4NodePoint[];
16
+ protected runtimeDATA4ConnectTargets: RGConnectTargetData[];
17
17
  protected runtimeDATA4ElLineTargets: RGLineTarget[];
18
18
  protected runtimeDATA4ShouldRenderItems: {
19
19
  nodes: RGNode[];
@@ -1,4 +1,4 @@
1
- import { RGNode, RGLine, RGFakeLine, RGConnectTarget4NodePoint, RGCoordinate } from '../../types';
1
+ import { RGNode, RGLine, RGFakeLine, RGConnectTargetData, RGCoordinate } from '../../types';
2
2
  import { RGDataDefine } from './RGDataDefine';
3
3
  /**
4
4
  * 数据提供者
@@ -25,8 +25,8 @@ export declare class RGDataGetter extends RGDataDefine {
25
25
  getShouldRenderFakeLines(): RGFakeLine[];
26
26
  isPerformanceMode(): boolean;
27
27
  getCanvasScale(): number;
28
- getConnectTargets(): RGConnectTarget4NodePoint[];
29
- getConnectTargetById(targetId: string): RGConnectTarget4NodePoint | undefined;
28
+ getConnectTargets(): RGConnectTargetData[];
29
+ getConnectTargetById(targetId: string): RGConnectTargetData | undefined;
30
30
  getElLineTargets(): import('../../types').RGLineTarget[];
31
31
  getElLineTargetById(elId: string): import('../../types').RGLineTarget | undefined;
32
32
  calcShouldRenderNodes(): RGNode[];
@@ -1,4 +1,4 @@
1
- import { RGNode, RGLine, RGOptionsFull, JsonLine, RGConnectTarget4NodePoint, RGLineTarget } from '../../types';
1
+ import { RGNode, RGLine, RGOptionsFull, JsonLine, RGConnectTargetData, RGLineTarget } from '../../types';
2
2
  import { RGDataGetter } from './RGDataGetter';
3
3
  export type DataCommits = {
4
4
  optionsChanged: boolean;
@@ -55,12 +55,12 @@ export declare class RGDataProvider extends RGDataGetter {
55
55
  updateLine(lineId: string, lineProperties: Partial<RGLine>): void;
56
56
  updateLineData(lineId: string, lineData: Record<string, any>): void;
57
57
  updateFakeLine(lineId: string, lineProperties: Partial<RGLine>): void;
58
- updateConnectTarget(connectTargetId: string, connectTargetProperties: Partial<RGConnectTarget4NodePoint>): void;
58
+ updateConnectTarget(connectTargetId: string, connectTargetProperties: Partial<RGConnectTargetData>): void;
59
59
  updateElLineTarget(elId: string, targetProperties: Partial<RGLineTarget>): void;
60
60
  updateNodesVisibleProperty(nodes?: RGNode[]): void;
61
61
  private calcLinkVisibility;
62
62
  updateShouldRenderGraphData(): void;
63
- addConnectTarget(newConnectTarget: RGConnectTarget4NodePoint): RGConnectTarget4NodePoint | undefined;
63
+ addConnectTarget(newConnectTarget: RGConnectTargetData): RGConnectTargetData | undefined;
64
64
  addElLineTarget(elementTarget: RGLineTarget): void;
65
65
  setRootNodeId(rootNodeId: string): void;
66
66
  }
@@ -5,13 +5,13 @@ export declare const newNodeTemplate: {
5
5
  y: number;
6
6
  text: string;
7
7
  };
8
- export declare const json2Node: (originData: JsonNode, graphOptions?: RGOptions, nodesSizeMap: Map<string, [
8
+ export declare const json2Node: (originData: JsonNode, graphOptions?: RGOptions, nodesSizeMap?: Map<string, [
9
9
  number,
10
10
  number
11
11
  ]>) => RGNode;
12
12
  export declare const transNodeToJson: (node: RGNode) => JsonNode | undefined;
13
13
  declare const _default: {
14
- json2Node: (originData: JsonNode, graphOptions?: Partial<import('../../types').RGOptionsInited> | undefined, nodesSizeMap: Map<string, [number, number]>) => RGNode;
14
+ json2Node: (originData: JsonNode, graphOptions?: Partial<import('../../types').RGOptionsInited> | undefined, nodesSizeMap?: Map<string, [number, number]> | undefined) => RGNode;
15
15
  transNodeToJson: (node: RGNode) => JsonNode | undefined;
16
16
  };
17
17
  export default _default;
@@ -12,26 +12,30 @@ type CalcNode4Force = CalcNode & {
12
12
  };
13
13
  export declare class RGForceLayout extends RGBaseLayout {
14
14
  layoutOptions: RGForceLayoutOptions;
15
- fastStart: boolean;
16
- skipInitLayout: boolean;
17
- maxLayoutTimes: number;
18
- byNode: boolean;
19
- byLine: boolean;
20
- lockX: boolean;
21
- lockY: boolean;
22
- force_node_repulsion: number;
23
- force_line_elastic: number;
24
- stopWhenBalanced: boolean;
15
+ private fastStart;
16
+ private skipInitLayout;
17
+ private maxLayoutTimes;
18
+ private byNode;
19
+ private byLine;
20
+ private lockX;
21
+ private lockY;
22
+ private force_node_repulsion;
23
+ private force_line_elastic;
24
+ private disableLiveChanges;
25
+ private force_x_coefficient;
26
+ private force_y_coefficient;
25
27
  instanceId: string;
26
28
  constructor(layoutOptions: RGForceLayoutOptions, graphOptions: RGOptionsFull, graphInstance: RelationGraphInstance);
29
+ updateOptions(layoutOptions: RGForceLayoutOptions): void;
27
30
  calcNodes: RGNode[];
28
31
  placeNodes(calcNodes: RGNode[], rootNode?: RGNode): void;
29
32
  protected getLevelR(levelDistanceArr: number[], level: number): number | undefined;
30
- protected placeRelativePosition(rootNode: RGNode, groupNodes: RGNode[], analyticResult: NodesAnalyticResult, distance_coefficient: any, levelDistanceArr: any): void;
33
+ protected placeRelativePosition(rootNode: RGNode, groupNodes: RGNode[], analyticResult: NodesAnalyticResult, distanceCoefficient: number, levelDistanceArr: number[]): void;
34
+ private calculateMinimumRadius;
31
35
  protected placeNodesInFanRegion(nodes: RGNode[], startDeg: number, endDeg: number, centerXy: {
32
36
  x: number;
33
37
  y: number;
34
- }, level: number, parentStrength: number, levelDistanceArr: number[], deep: number, distanceCoefficient?: number): void;
38
+ }, level: number, parentStrength: number, levelDistanceArr: number[], deep: number, distanceCoefficient: number, currentR: number): void;
35
39
  protected graphEventHandle(eventName: RGEventNames, ...args: any[]): void;
36
40
  protected _graphEventHandler: any;
37
41
  protected connectToGraphInstance(): void;
@@ -60,7 +64,8 @@ export declare class RGForceLayout extends RGBaseLayout {
60
64
  private animationFrameTimer;
61
65
  private prevNodeLevel1Index;
62
66
  private prevNodeLevel2Index;
63
- calcNodesPosition(): boolean;
67
+ syncNodePosition(nodeId: string, x: number, y: number): void;
68
+ calcNodesPosition(): false | undefined;
64
69
  private stoped;
65
70
  stop(): void;
66
71
  addElasticByLine(node1: CalcNode4Force, node2: CalcNode4Force, force_elastic?: number): void;
@@ -3,6 +3,7 @@ import { RelationGraphInstance, RGNode } from '../../../types';
3
3
  export declare class BasicNetworkAnalyzer implements RGNetworkAnalyzer {
4
4
  graphInstance: RelationGraphInstance;
5
5
  private initialized;
6
+ isFolderLayout: boolean;
6
7
  constructor(graphInstance: RelationGraphInstance);
7
8
  analyzeNetwork(nodes: RGNode[], rootNode: RGNode, bothWay?: boolean, deepBothWay?: boolean): {
8
9
  tree: {
@@ -60,7 +60,7 @@ export declare class RelationGraphBase {
60
60
  * @param eventName Name of the event
61
61
  * @param object Parameters passed to the event handler
62
62
  */
63
- protected emitEvent(eventName: RGEventNames, ...args: any[]): import('../../types').RGCoordinate | undefined;
63
+ protected emitEvent(eventName: RGEventNames, ...args: any[]): false | import('../../types').RGCoordinate | undefined;
64
64
  /**
65
65
  * Protected Method to trigger the default event handler, i.e., trigger the events set in jsx
66
66
  * @param eventName
@@ -68,7 +68,7 @@ export declare class RelationGraphBase {
68
68
  * @protected
69
69
  */
70
70
  protected defaultEventHandler(eventName: RGEventNames, ...args: any[]): {
71
- result: void | import('../../types').RGCoordinate;
71
+ result: false | void | import('../../types').RGCoordinate;
72
72
  handled: boolean;
73
73
  };
74
74
  /**
@@ -80,5 +80,6 @@ export declare class RelationGraphWith2Data1Getter extends RelationGraphWith2Dat
80
80
  * Get all connect targets
81
81
  * @return RGLineTarget[]
82
82
  */
83
- getConnectTargets(): import('../../types').RGConnectTarget4NodePoint[];
83
+ getConnectTargets(): import('../../types').RGConnectTargetData[];
84
+ getConnectTargetById(targetId: string): import('../../types').RGConnectTargetData | undefined;
84
85
  }
@@ -1,4 +1,4 @@
1
- import { RGConnectTarget4NodePoint, RGJunctionPoint } from '../../types';
1
+ import { RGConnectTargetData, RGJunctionPoint } from '../../types';
2
2
  import { RelationGraphWith2Data3Update } from './RelationGraphWith2Data3Update';
3
3
  /**
4
4
  * 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
@@ -35,7 +35,7 @@ export declare class RelationGraphWith2Data4ConnectTarget extends RelationGraphW
35
35
  /**
36
36
  * @inner
37
37
  */
38
- protected updateConnectTargetList(by: string, relativeNodeEl: Element, connectTargetList: RGConnectTarget4NodePoint[]): void;
38
+ protected updateConnectTargetList(by: string, relativeNodeEl: Element, connectTargetList: RGConnectTargetData[]): void;
39
39
  /**
40
40
  * @inner
41
41
  */
@@ -64,7 +64,7 @@ export declare class RelationGraphWith2Data4ConnectTarget extends RelationGraphW
64
64
  /**
65
65
  * @inner
66
66
  */
67
- registerConnectTarget(connectTargetEl: HTMLDivElement, targetId: string, targetType: string, junctionPoint: RGJunctionPoint, targetData?: Record<string, any>): RGConnectTarget4NodePoint | undefined;
67
+ registerConnectTarget(connectTargetEl: HTMLDivElement, targetId: string, targetType: string, junctionPoint: RGJunctionPoint, targetData?: Record<string, any>): RGConnectTargetData | undefined;
68
68
  /**
69
69
  * @inner
70
70
  */
@@ -26,6 +26,7 @@ export declare class RelationGraphWith4Line extends RelationGraphWith3Options2AP
26
26
  *
27
27
  */
28
28
  createLineDrawInfo(link: RGLink | RGElementLine, line: RGLine): RGLinePathInfo | undefined;
29
+ private _getLineDefaultOptions;
29
30
  /**
30
31
  * Generate line path data
31
32
  * - This method is generally used internally by components, but can also be called for external custom rendering of lines to obtain line drawing information.
@@ -13,6 +13,9 @@ export declare class RelationGraphWith6Layout extends RelationGraphWith6Effect {
13
13
  * @return Promise<void>
14
14
  */
15
15
  doLayout(customRootNode?: RGNode | string): Promise<void>;
16
+ private _layoutTimer;
17
+ private _layoutPromise;
18
+ private _layoutResolve;
16
19
  /**
17
20
  * @inner
18
21
  * @private
@@ -49,7 +52,7 @@ export declare class RelationGraphWith6Layout extends RelationGraphWith6Effect {
49
52
  * - Note: The center layout inherits the force layout and also supports auto layout functionality.
50
53
  */
51
54
  toggleAutoLayout(): void;
52
- private layoutor;
55
+ layoutor: RGLayout | undefined;
53
56
  /**
54
57
  * If the current layout is force, you can call this method to start the force-directed calculation
55
58
  * - Note: The center layout inherits the force layout and also supports auto layout functionality.
@@ -78,4 +81,5 @@ export declare class RelationGraphWith6Layout extends RelationGraphWith6Effect {
78
81
  *
79
82
  */
80
83
  createLayout<Layout extends RGLayout>(layoutOptions: RGLayoutOptions, isMainLayout?: boolean): Layout;
84
+ setLayoutor(layoutor: RGLayout, isMainLayout: boolean, supportAutoLayout?: boolean): void;
81
85
  }
@@ -1,3 +1,4 @@
1
+ import { RGRectTarget } from 'packages/platforms/vue2/dd/types/packages/types';
1
2
  import { RGNode } from '../../types';
2
3
  import { RelationGraphWith93Image } from './RelationGraphWith93Image';
3
4
  /**
@@ -28,6 +29,7 @@ export declare class RelationGraphWith95Dom extends RelationGraphWith93Image {
28
29
  * @private
29
30
  */
30
31
  protected initDom(): void;
32
+ updateCanvasConnectTargetsPosition(reson?: string): void;
31
33
  private mutationObserver4Nodes?;
32
34
  private mutationObserver4CanvasSlotBehind?;
33
35
  private mutationObserver4CanvasSlotAbove?;
@@ -105,4 +107,5 @@ export declare class RelationGraphWith95Dom extends RelationGraphWith93Image {
105
107
  * @protected
106
108
  */
107
109
  protected destroyResizeObserver(): void;
110
+ getCanvasSlotRectItems(): RGRectTarget[];
108
111
  }
@@ -69,7 +69,7 @@ export enum RGJunctionPoint {
69
69
  * Data type used internally by relation-graph to manage connection points
70
70
  * @inner This type is used internally by relation-graph and is not recommended for direct use by users
71
71
  */
72
- export type RGConnectTarget4NodePoint = {
72
+ export type RGConnectTargetData = {
73
73
  targetId: string;
74
74
  targetType: string;
75
75
  nodeId?: string;
@@ -247,6 +247,7 @@ export type RGNode = Omit<JsonNode, 'children'> & RGRectTarget & {
247
247
  x: number
248
248
  y: number
249
249
  nodeShape: RGNodeShape
250
+ data: Record<string, any>
250
251
  lot: {
251
252
  childs: RGNode[]
252
253
  parent?: RGNode | undefined
@@ -269,9 +270,9 @@ export type RGNode = Omit<JsonNode, 'children'> & RGRectTarget & {
269
270
  x?: number
270
271
  y?: number
271
272
  }
272
- rgChildrenSize?: number
273
- rgShouldRender?: boolean
274
- rgCalcedVisibility?: boolean
273
+ rgChildrenSize: number
274
+ rgShouldRender: boolean
275
+ rgCalcedVisibility: boolean
275
276
  }
276
277
  /**
277
278
  * JSON line type for relation-graph
@@ -314,7 +315,6 @@ export type JsonLine = {
314
315
  startMarkerId?: string
315
316
  endMarkerId?: string
316
317
  useTextOnPath?: boolean
317
- onPathStartOffset?: string
318
318
  placeText?: 'start'|'center'|'end'
319
319
  textAnchor?: string
320
320
  lineDirection?: string
@@ -323,8 +323,8 @@ export type JsonLine = {
323
323
  data?: Record<string, any>
324
324
  cssVars?: Record<string, any>
325
325
  force_elastic?: number
326
- textOffset_x?: number
327
- textOffset_y?: number
326
+ textOffsetX?: number
327
+ textOffsetY?: number
328
328
  animation?: number
329
329
  dashType?: number
330
330
  lineRadius?: number
@@ -332,10 +332,10 @@ export type JsonLine = {
332
332
  junctionOffset?: number
333
333
  fromJunctionPoint?: RGJunctionPoint
334
334
  toJunctionPoint?: RGJunctionPoint
335
- fromJuctionPointOffsetX?: number
336
- fromJuctionPointOffsetY?: number
337
- toJuctionPointOffsetX?: number
338
- toJuctionPointOffsetY?: number
335
+ fromJunctionPointOffsetX?: number
336
+ fromJunctionPointOffsetY?: number
337
+ toJunctionPointOffsetX?: number
338
+ toJunctionPointOffsetY?: number
339
339
  hidden?: boolean
340
340
  }
341
341
  /**
@@ -346,8 +346,8 @@ export type JsonLine = {
346
346
  */
347
347
  export type RGFakeLine = JsonLine & {
348
348
  id: string;
349
- fromType: RGInnerConnectTargetType | string;
350
- toType: RGInnerConnectTargetType | string;
349
+ fromType?: RGInnerConnectTargetType | string;
350
+ toType?: RGInnerConnectTargetType | string;
351
351
  }
352
352
  /**
353
353
  * Enhanced line type for runtime in relation-graph
@@ -503,13 +503,13 @@ export type RGForceLayoutOptions = RGLayoutOptionsCore & {
503
503
  };
504
504
  /**
505
505
  * Center layout options type
506
- * - distance_coefficient: Coefficient for calculating the ideal distance between nodes, default is 1. The larger this value, the greater the ideal distance between nodes, and the more dispersed the layout will be.
506
+ * - distanceCoefficient: Coefficient for calculating the ideal distance between nodes, default is 1. The larger this value, the greater the ideal distance between nodes, and the more dispersed the layout will be.
507
507
  * - disableAsForceLayout: CenterLayout extends ForceLayout. If you want to use CenterLayout as a pure center layout without force-directed layout capabilities, you can set this option to true to disable the force-directed layout features.
508
- * - levelDistance: Array of distances between levels, default is []. You can set the distance between different levels of nodes in the tree structure. For example, [100, 200, 300] means the distance between level 0 and level 1 is 100, the distance between level 1 and level 2 is 200, and the distance between level 2 and level 3 is 300. If the array length is less than the number of levels, the last value will be used for the remaining levels.
508
+ * - levelGaps: Array of distances between levels, default is []. You can set the distance between different levels of nodes in the tree structure. For example, [100, 200, 300] means the distance between level 0 and level 1 is 100, the distance between level 1 and level 2 is 200, and the distance between level 2 and level 3 is 300. If the array length is less than the number of levels, the last value will be used for the remaining levels.
509
509
  */
510
510
  export type RGCenterLayoutOptions = RGForceLayoutOptions & {
511
- distance_coefficient?: number
512
- levelDistance?: number[]
511
+ distanceCoefficient?: number
512
+ levelGaps?: number[]
513
513
  disableAsForceLayout?: boolean;
514
514
  };
515
515
  /**
@@ -525,7 +525,7 @@ export type RGCenterLayoutOptions = RGForceLayoutOptions & {
525
525
  * - alignParentItemsY: Alignment of parent nodes in the Y direction, 'start' means top-aligned, 'center' means center-aligned, and 'end' means bottom-aligned. Default is 'center'.
526
526
  */
527
527
  export type RGTreeLayoutOptions = RGLayoutOptionsCore & {
528
- from?: string
528
+ from?: 'left'|'top'|'right'|'bottom'
529
529
  treeNodeGapH?: number
530
530
  treeNodeGapV?: number
531
531
  levelGaps?: number[]
@@ -590,9 +590,9 @@ export type RGOptionsInited = {
590
590
  canvasMoveMode: boolean
591
591
  disableNodePointEvent: boolean
592
592
  disableLinePointEvent: boolean
593
- toolBarDirection: string
594
- toolBarPositionH: string
595
- toolBarPositionV: string
593
+ toolBarDirection: 'h'|'v'
594
+ toolBarPositionH: 'left'|'center'|'right'
595
+ toolBarPositionV: 'top'|'center'|'bottom'
596
596
  defaultExpandHolderPosition: 'hide' | 'left' | 'top' | 'right' | 'bottom'
597
597
  defaultNodeColor: string
598
598
  defaultNodeBorderColor: string,
@@ -602,8 +602,8 @@ export type RGOptionsInited = {
602
602
  defaultNodeWidth?: number
603
603
  defaultNodeHeight?: number
604
604
  checkedItemBackgroundColor?: string //
605
- defaultLineTextOffset_x?: number,
606
- defaultLineTextOffset_y?: number,
605
+ defaultLineTextOffsetX?: number,
606
+ defaultLineTextOffsetY?: number,
607
607
  defaultLineColor: string
608
608
  defaultLineWidth: number
609
609
  defaultLineShape?: RGLineShape
@@ -859,6 +859,7 @@ export interface RGWidgetProps {
859
859
  */
860
860
  export interface RGEditingLineControllerProps {
861
861
  textEditable?: boolean
862
+ pathEditable?: boolean
862
863
  onMoveLineVertexStart?: (type: RGLineEditPoint, line: RGLine) => void
863
864
  onMoveLineVertexEnd?: RGLineVertexBeDroppedEventHandler
864
865
  onLinePathChanged?: (line: RGLine, params: any) => void
@@ -886,7 +887,7 @@ export type CreatingLinePlotOptions = {
886
887
  onCreateLine: RGLineConnectEventHandler | undefined
887
888
  isReverse?: boolean,
888
889
  template?: JsonLineLike
889
- fromNode?: RGLineTarget
890
+ fromNode?: RGNode | RGLineTarget
890
891
  };
891
892
  /**
892
893
  * @inner
@@ -964,7 +965,7 @@ export interface RGConnectSourceProps {
964
965
  * ```
965
966
  */
966
967
  export interface RGConnectTargetProps {
967
- junctionPoint: RGJunctionPoint;
968
+ junctionPoint?: RGJunctionPoint;
968
969
  targetId: string;
969
970
  targetType?: string;
970
971
  targetData?: Record<string, any>;
@@ -1,7 +0,0 @@
1
- import { default as React } from 'react';
2
- import { RelationGraphInstance } from '../../../../relation-graph-models/types';
3
- declare const RGProvider: React.FC<{
4
- relationGraphCore?: any;
5
- onProviderReady?: (instance: RelationGraphInstance) => void;
6
- }>;
7
- export default RGProvider;
@@ -1,4 +0,0 @@
1
- import { default as React } from 'react';
2
- import { RelationLinkerCompJsxProps } from '../../../types-react';
3
- declare const RelationLinkerContent: React.FC<RelationLinkerCompJsxProps>;
4
- export default RelationLinkerContent;
@@ -1,4 +0,0 @@
1
- import { default as React } from 'react';
2
- import { RelationGraphCompJsxProps } from '../../../types-react';
3
- declare const RelationView: React.FC<RelationGraphCompJsxProps>;
4
- export default RelationView;
@@ -1,20 +0,0 @@
1
- /**
2
- * @description 用於標記工具區內容的容器。
3
- */
4
- export declare const ToolPanel: ({ children }: {
5
- children: any;
6
- }) => any;
7
- /**
8
- * @description 用於標記畫布內容的容器。
9
- */
10
- export declare const CanvasItems: ({ children }: {
11
- children: any;
12
- }) => any;
13
- /**
14
- * @description 關係圖主組件
15
- * - 負責接收所有子元素,並將它們分類到 "工具區" 或 "畫布區"。
16
- */
17
- export declare const RelationGraph: ({ children }: {
18
- children: any;
19
- }) => JSX.Element;
20
- export default function App(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function App(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function App(): JSX.Element;
@@ -1,3 +0,0 @@
1
- import { default as React } from 'react';
2
- declare const RGSlotOnSVGDefs: React.FC;
3
- export default RGSlotOnSVGDefs;
@@ -1,3 +0,0 @@
1
- import { default as React } from 'react';
2
- declare const RGSlotOnToolbar: React.FC;
3
- export default RGSlotOnToolbar;
@@ -1,8 +0,0 @@
1
- import { default as React } from 'react';
2
- import { RelationGraphInstance } from '../../../../../../../../relation-graph-models/types';
3
- export type RGUpdateAction = (rgInstance: RelationGraphInstance) => void;
4
- export type RelationGraphReducer = (state: RelationGraphInstance, action: RGUpdateAction) => RelationGraphInstance;
5
- export declare const relationGraphReducer: RelationGraphReducer;
6
- export declare const RelationGraphStoreContext: React.Context<RelationGraphInstance>;
7
- export declare const RGUpdateContext: React.Context<((v?: RelationGraphInstance) => void)>;
8
- export declare const RGUpdateSignalContext: React.Context<number>;
@@ -1,3 +0,0 @@
1
- import { default as React } from 'react';
2
- declare const GraphDebugPanel: React.FC;
3
- export default GraphDebugPanel;
@@ -1 +0,0 @@
1
- export * from '../../../relation-graph-models/types';
@@ -1,2 +0,0 @@
1
- declare const _default: import('vite').UserConfigExport;
2
- export default _default;