@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
@@ -1,31 +0,0 @@
1
- type __VLS_Props = {
2
- direction?: 'v' | 'h';
3
- positionH?: 'left' | 'center' | 'right';
4
- positionV?: 'top' | 'center' | 'bottom';
5
- };
6
- declare function __VLS_template(): {
7
- attrs: Partial<{}>;
8
- slots: {
9
- default?(_: {}): any;
10
- };
11
- refs: {};
12
- rootEl: HTMLDivElement;
13
- };
14
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
- declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
16
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
17
- export default _default;
18
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
19
- type __VLS_TypePropsToOption<T> = {
20
- [K in keyof T]-?: {} extends Pick<T, K> ? {
21
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
22
- } : {
23
- type: import('vue').PropType<T[K]>;
24
- required: true;
25
- };
26
- };
27
- type __VLS_WithTemplateSlots<T, S> = T & {
28
- new (): {
29
- $slots: S;
30
- };
31
- };
@@ -1,15 +0,0 @@
1
- type __VLS_Props = {
2
- iconName: string;
3
- className?: string;
4
- };
5
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
6
- export default _default;
7
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
- type __VLS_TypePropsToOption<T> = {
9
- [K in keyof T]-?: {} extends Pick<T, K> ? {
10
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
- } : {
12
- type: import('vue').PropType<T[K]>;
13
- required: true;
14
- };
15
- };
@@ -1,36 +0,0 @@
1
- import { CalcNode, RelationGraphInstance, RGLayouter, RGLayoutOptions, RGLink, RGNode, RGOptionsFull } from '../types';
2
- import { NodesAnalyticResult } from '../utils/RGNodesAnalytic';
3
- export declare class RGBaseLayouter implements RGLayouter {
4
- graphOptions: RGOptionsFull;
5
- layoutOptions: RGLayoutOptions;
6
- graphInstance: RelationGraphInstance;
7
- allNodes: RGNode[];
8
- isMainLayouer: boolean;
9
- requireLinks: boolean;
10
- allLinks: RGLink[];
11
- constructor(layoutOptions: RGLayoutOptions, graphOptions: RGOptionsFull, graphInstance: RelationGraphInstance);
12
- rootNode: RGNode | undefined;
13
- setLinks(links: RGLink[]): void;
14
- placeNodes(allNodes: RGNode[], rootNode?: RGNode): void;
15
- doLayout(allNodes: RGNode[], rootNode?: RGNode): void;
16
- analysisNodes(eachedNodes: RGNode[], thisLevelNodes: RGNode[], thisDeep: number, analyticResult: NodesAnalyticResult): void;
17
- generateCalcNodes<CustomCalcNode extends CalcNode>(groupNodes: RGNode[]): {
18
- calcNodes: CustomCalcNode[];
19
- calcNodeMap: Map<string, CustomCalcNode>;
20
- };
21
- generateLevels(groupNodes: RGNode[]): {
22
- levels: number[];
23
- levelNodesMap: Map<number, RGNode[]>;
24
- };
25
- /**
26
- * 修正一排/一列重叠的节点坐标, 并保持固定间距
27
- * * @param levelNodes 要处理的节点数组。
28
- * 函数假定此数组的 *顺序* 已经是您期望的布局顺序。
29
- * @param direction 布局方向 (left, right, top, bottom)
30
- * @param gap 节点之间的间距
31
- * @returns 返回一个 *新的* 数组, 包含修正了坐标的节点
32
- */
33
- adjustNodePositions(levelNodes: CalcNode[], direction: 'left' | 'right' | 'top' | 'bottom', gap: number): CalcNode[];
34
- getReverseAlignItems(alignItems: 'start' | 'center' | 'end'): string;
35
- }
36
- export default RGBaseLayouter;
@@ -1,12 +0,0 @@
1
- import { default as RGForceLayouter } from './RGForceLayouter';
2
- import { NodesAnalyticResult } from '../utils/RGNodesAnalytic';
3
- import { RelationGraphInstance, RGCenterLayoutOptions, RGLayoutOptions, RGNode, RGOptionsFull } from '../types';
4
- export declare class RGCenterLayouter extends RGForceLayouter {
5
- layoutOptions: RGCenterLayoutOptions;
6
- constructor(layoutOptions: RGLayoutOptions, graphOptions: RGOptionsFull, graphInstance: RelationGraphInstance);
7
- placeNodes(allNodes: RGNode[], rootNode?: RGNode): void;
8
- private getLevelDistanceArr;
9
- getLevelR(levelDistanceArr: number[], level: number): number | undefined;
10
- placeRelativePosition(rootNode: RGNode, groupNodes: RGNode[], analyticResult: NodesAnalyticResult): void;
11
- }
12
- export default RGCenterLayouter;
@@ -1,8 +0,0 @@
1
- import { default as RGForceLayouter } from './RGForceLayouter';
2
- import { RelationGraphInstance, RGLayoutOptions, RGNode, RGOptionsFull } from '../types';
3
- export declare class RGCircleLayouter extends RGForceLayouter {
4
- constructor(layoutOptions: RGLayoutOptions, graphOptions: RGOptionsFull, graphInstance: RelationGraphInstance);
5
- refresh(): void;
6
- placeNodes(allNodes: RGNode[], rootNode?: RGNode): void;
7
- }
8
- export default RGCircleLayouter;
@@ -1,11 +0,0 @@
1
- import { default as RGBaseLayouter } from './RGBaseLayouter';
2
- import { RelationGraphInstance, RGLayoutOptions, RGNode, RGOptionsFull } from '../types';
3
- export declare class RGFixedLayouter extends RGBaseLayouter {
4
- constructor(layoutOptions: RGLayoutOptions, graphOptions: RGOptionsFull, graphInstance: RelationGraphInstance);
5
- graphOptions: RGOptionsFull;
6
- layoutOptions: RGLayoutOptions;
7
- allNodes: never[];
8
- __origin_nodes: RGNode[];
9
- placeNodes(allNodes: RGNode[], rootNode?: RGNode): void;
10
- }
11
- export default RGFixedLayouter;
@@ -1,17 +0,0 @@
1
- import { NodesAnalyticResult, RGLevelDirection } from '../utils/RGNodesAnalytic';
2
- import { default as RGBaseLayouter } from './RGBaseLayouter';
3
- import { RelationGraphInstance, RGNode, RGOptionsFull, RGTreeLayoutOptions } from '../types';
4
- export declare class RGFolderLayouter extends RGBaseLayouter {
5
- constructor(layoutOptions: RGTreeLayoutOptions, graphOptions: RGOptionsFull, graphInstance: RelationGraphInstance);
6
- enableGatherNodes: boolean;
7
- layoutOptions: RGTreeLayoutOptions;
8
- analysisNodes4Didirectional(willLayoutNodes: RGNode[], thisLevelNodes: RGNode[], thisDeep: number, analyticResult: NodesAnalyticResult, levelDirect: RGLevelDirection): void;
9
- placeNodes(allNodes: RGNode[], rootNode?: RGNode): void;
10
- placeRelativePosition(rootNode: RGNode, groupNodes: RGNode[], analyticResult: NodesAnalyticResult): void;
11
- gatherNodes(groupNodes: RGNode[], hv: 'h' | 'v', perSize: number): void;
12
- getBloomingNearByParent(node: RGNode, parentNode: RGNode, levelNodes: RGNode[], hv: 'h' | 'v'): RGNode | undefined;
13
- getLevelDistance(level: number, levelMaxWidthMap: Map<number, number>, defaultGap: number): number;
14
- private getLevelGap;
15
- analysisNodesForFolder(eachedNodes: RGNode[], thisLevelNodes: RGNode[], thisDeep: number, analyticResult: NodesAnalyticResult): void;
16
- }
17
- export default RGFolderLayouter;
@@ -1,71 +0,0 @@
1
- import { NodesAnalyticResult, RGLevelDirection } from '../utils/RGNodesAnalytic';
2
- import { default as RGBaseLayouter } from './RGBaseLayouter';
3
- import { CalcNode, RelationGraphInstance, RGEventNames, RGForceLayoutOptions, RGLayoutOptions, RGNode, RGOptionsFull } from '../types';
4
- type CalcNode4Force = CalcNode & {
5
- Fx: number;
6
- Fy: number;
7
- dragging: boolean;
8
- force_weight: number;
9
- forceCenterOffset_X: number;
10
- forceCenterOffset_Y: number;
11
- fixed: boolean;
12
- };
13
- export declare class RGForceLayouter extends RGBaseLayouter {
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;
25
- constructor(layoutOptions: RGLayoutOptions, graphOptions: RGOptionsFull, graphInstance: RelationGraphInstance);
26
- calcNodes: RGNode[];
27
- placeNodes(calcNodes: RGNode[], rootNode?: RGNode): void;
28
- easyAnalysisNodes(rootNode: RGNode): RGNode[];
29
- easyPlaceRelativePosition(rootNode: RGNode, groupNodes: RGNode[]): void;
30
- protected graphEventHandle(eventName: RGEventNames, ...args: any[]): void;
31
- protected _graphEventHandler: any;
32
- protected connectToGraphInstance(): void;
33
- protected disConnectToGraphInstance(): void;
34
- layoutTimes: number;
35
- prev10: number[];
36
- visibleNodes: RGNode[];
37
- updateVisibleNodes(allNode?: RGNode[]): void;
38
- viewUpdate(): void;
39
- autoLayout(forceLayout?: boolean): void;
40
- protected _onFinishCallback: () => void;
41
- onFinish(onFinishCallback: () => void): void;
42
- _onTickCallback: () => void;
43
- onTick(_onTickCallback: () => void): void;
44
- applyFBuffToNodes(): void;
45
- applyPositionToNodes(): void;
46
- protected layoutFinished(): void;
47
- protected resetCalcNodes(): void;
48
- protected calcNodeMap: WeakMap<RGNode, CalcNode4Force>;
49
- protected forCalcNodes: CalcNode4Force[];
50
- protected recentGraphVelocity: number[];
51
- protected graphVelocityBalancedValue: number;
52
- start(): void;
53
- doForceLayout(useTime: number): void;
54
- private animationFrameTimer;
55
- private prevNodeLevel1Index;
56
- private prevNodeLevel2Index;
57
- calcNodesPosition(): boolean;
58
- stop(): void;
59
- addElasticByLine(node1: CalcNode4Force, node2: CalcNode4Force, force_elastic?: number): void;
60
- maxVaildLineLength: number;
61
- minVaildLineLength: number;
62
- zeroEffectNodeDistance: number;
63
- minNodeDistance: number;
64
- maxMoveSpeed: number;
65
- n2nMaxForce: number;
66
- addGravityByNode(node1: CalcNode4Force, node2: CalcNode4Force, coefficient?: number): void;
67
- addFtoNode(node: CalcNode4Force, x: number, y: number): void;
68
- applyToNodePosition(node: CalcNode4Force): 0 | undefined;
69
- analysisNodes4Didirectional(willLayoutNodes: RGNode[], thisLevelNodes: RGNode[], thisDeep: number, analyticResult: NodesAnalyticResult, levelDirect: RGLevelDirection): void;
70
- }
71
- export default RGForceLayouter;
@@ -1,59 +0,0 @@
1
- import { default as RGBaseLayouter } from './RGBaseLayouter';
2
- import { RGForceLayoutOptions, RGLayoutOptions, RGNode, RelationGraphInstance, RGOptionsFull } from '../types';
3
- type CalcNode = {
4
- rgNode: RGNode;
5
- Fx: number;
6
- Fy: number;
7
- x: number;
8
- y: number;
9
- ignoreForce: boolean;
10
- force_weight: number;
11
- fixed: boolean;
12
- };
13
- export declare class RGForceLayouterV2 extends RGBaseLayouter {
14
- layoutOptions: RGForceLayoutOptions;
15
- fastStart: boolean;
16
- maxLayoutTimes: number;
17
- byNode: boolean;
18
- byLine: boolean;
19
- lockX: boolean;
20
- lockY: boolean;
21
- force_node_repulsion: number;
22
- force_line_elastic: number;
23
- justLayoutSingleNode: boolean;
24
- stopWhenBalanced: boolean;
25
- barnesHutTheta: number;
26
- constructor(layoutOptions: RGLayoutOptions, graphOptions: RGOptionsFull, graphInstance: RelationGraphInstance);
27
- placeNodes(allNodes: RGNode[], rootNode?: RGNode): void;
28
- layoutTimes: number;
29
- prev10: number[];
30
- visibleNodes: RGNode[];
31
- updateVisibleNodes(allNodesInput?: RGNode[]): void;
32
- viewUpdate(): void;
33
- autoLayout(forceLayout?: boolean): void;
34
- protected _onFinishCallback?: () => void;
35
- onFinish(onFinishCallback: () => void): void;
36
- applyFBuffToNodes(): void;
37
- applyPositionToNodes(): void;
38
- _onTickCallback: () => void;
39
- onTick(_onRTickCallback: () => void): void;
40
- protected layoutFinished(): void;
41
- protected resetCalcNodes(): void;
42
- protected calcNodeMap: WeakMap<RGNode, CalcNode>;
43
- protected forCalcNodes: CalcNode[];
44
- doForceLayout(time: number): void;
45
- calcNodesPosition(): void;
46
- private calculateRepulsionForceRecursive;
47
- private applyOriginalRepulsion;
48
- private applyRepulsionFromSuperNode;
49
- stop(): void;
50
- addElasticByLine(node1: CalcNode, node2: CalcNode, force_elastic_coefficient?: number): void;
51
- maxVaildLineLength: number;
52
- minVaildLineLength: number;
53
- zeroEffectNodeDistance: number;
54
- minNodeDistance: number;
55
- maxMoveSpeed: number;
56
- addFtoNode(node: CalcNode, x: number, y: number): void;
57
- applyToNodePosition(node: CalcNode): void;
58
- }
59
- export default RGForceLayouterV2;
@@ -1,16 +0,0 @@
1
- import { NodesAnalyticResult } from '../utils/RGNodesAnalytic';
2
- import { default as RGBaseLayouter } from './RGBaseLayouter';
3
- import { RelationGraphInstance, RGNode, RGOptionsFull, RGTreeLayoutOptions } from '../types';
4
- export declare class RGSmartTreeLayouter extends RGBaseLayouter {
5
- constructor(layoutOptions: RGTreeLayoutOptions, graphOptions: RGOptionsFull, graphInstance: RelationGraphInstance);
6
- graphInstance: RelationGraphInstance;
7
- layoutOptions: RGTreeLayoutOptions;
8
- levelDistanceArr: number[];
9
- analysisNodes4Didirectional(willLayoutNodes: RGNode[], thisLevelNodes: RGNode[], thisDeep: number, analyticResult: NodesAnalyticResult): void;
10
- analysisBothWay(willLayoutNodes: RGNode[], thisLevelNodes: RGNode[], thisDeep: number, analyticResult: NodesAnalyticResult): void;
11
- placeNodes(allNodes: RGNode[], rootNode?: RGNode): void;
12
- placeNodesPosition(rootNode: RGNode, groupNodes: RGNode[], analyticResult: NodesAnalyticResult): void;
13
- placeRelativePosition(rootNode: RGNode, groupNodes: RGNode[], analyticResult: NodesAnalyticResult): void;
14
- getLevelDistance(node: RGNode, level: number, perSize: number): number;
15
- }
16
- export default RGSmartTreeLayouter;
@@ -1,18 +0,0 @@
1
- import { NodesAnalyticResult, RGLevelDirection } from '../utils/RGNodesAnalytic';
2
- import { default as RGBaseLayouter } from './RGBaseLayouter';
3
- import { RelationGraphInstance, RGNode, RGOptionsFull, RGTreeLayoutOptions } from '../types';
4
- export declare class RGTreeLayouter extends RGBaseLayouter {
5
- constructor(layoutOptions: RGTreeLayoutOptions, graphOptions: RGOptionsFull, graphInstance: RelationGraphInstance);
6
- enableGatherNodes: boolean;
7
- layoutOptions: RGTreeLayoutOptions;
8
- analysisNodes4Didirectional(willLayoutNodes: RGNode[], thisLevelNodes: RGNode[], thisDeep: number, analyticResult: NodesAnalyticResult, deepFindDirect: RGLevelDirection): void;
9
- placeNodes(allNodes: RGNode[], rootNode?: RGNode): void;
10
- placeNodesPosition(rootNode: RGNode, groupNodes: RGNode[], analyticResult: NodesAnalyticResult): void;
11
- placeRelativePosition(rootNode: RGNode, groupNodes: RGNode[], analyticResult: NodesAnalyticResult): void;
12
- getLevelDistance(level: number, levelMaxSizeMap: Map<number, number>, defaultGap: number): number;
13
- private getLevelGap;
14
- applyNodesGap(groupNodes: RGNode[], hv: 'h' | 'v'): void;
15
- gatherNodes(groupNodes: RGNode[], hv: 'h' | 'v', perSize: number): void;
16
- getBloomingNearByParent(node: RGNode, parentNode: RGNode, levelNodes: RGNode[], hv: 'h' | 'v'): RGNode | undefined;
17
- }
18
- export default RGTreeLayouter;
@@ -1,9 +0,0 @@
1
- import { JsonLine, RGLine, RGLink } from '../types';
2
- export declare const json2Line: (originData: JsonLine) => RGLine;
3
- export declare const transLineToJson: (line: RGLine) => JsonLine | undefined;
4
- export declare const transLinkToJson: (link: RGLink, lineJsonArray: JsonLine[]) => void;
5
- declare const _default: {
6
- json2Line: (originData: JsonLine) => RGLine;
7
- transLinkToJson: (link: RGLink, lineJsonArray: JsonLine[]) => void;
8
- };
9
- export default _default;
@@ -1,14 +0,0 @@
1
- import { JsonNode, RGNode, RGOptions } from '../types';
2
- export declare const newNodeTemplate: {
3
- id: string;
4
- x: number;
5
- y: number;
6
- text: string;
7
- };
8
- export declare const json2Node: (originData: JsonNode, graphOptions?: RGOptions) => RGNode;
9
- export declare const transNodeToJson: (node: RGNode) => JsonNode | undefined;
10
- declare const _default: {
11
- json2Node: (originData: JsonNode, graphOptions?: RGOptions) => RGNode;
12
- transNodeToJson: (node: RGNode) => JsonNode | undefined;
13
- };
14
- export default _default;
@@ -1,11 +0,0 @@
1
- import { RGLayoutOptions, RGOptions, RGOptionsFull } from '../types';
2
- export declare const createDefaultConfig: (userOptions: RGOptions) => RGOptionsFull;
3
- export declare const applyDefaultOptionsByLayout: (thisLayout: RGLayoutOptions, _options: RGOptionsFull) => void;
4
- export declare const appendDefaultOptions4Layout: (layoutOptions: RGLayoutOptions) => void;
5
- export declare const newInstanceOptions: (options: RGOptions) => RGOptionsFull;
6
- declare const _default: {
7
- newInstanceOptions: (options: RGOptions) => RGOptionsFull;
8
- createDefaultConfig: (userOptions: RGOptions) => RGOptionsFull;
9
- applyDefaultOptionsByLayout: (thisLayout: RGLayoutOptions, _options: RGOptionsFull) => void;
10
- };
11
- export default _default;
@@ -1,11 +0,0 @@
1
- import { RGListeners, RGOptions } from '../types';
2
- import { RelationGraphWith92MiniView } from './RelationGraphWith92MiniView';
3
- export declare class RelationGraphFinal extends RelationGraphWith92MiniView {
4
- constructor(options: RGOptions, listeners: RGListeners);
5
- setListeners(listeners: RGListeners): void;
6
- /**
7
- * [Used internally by relation-graph], this method will be called to initialize some configurations based on options (such as creating a layouter based on the options.layout configuration), and to obtain information such as viewport size.
8
- */
9
- ready(): void;
10
- beforeUnmount(): void;
11
- }
@@ -1,5 +0,0 @@
1
- import { RGListeners, RGOptions } from '../types';
2
- import { RelationGraphFinal } from './RelationGraphFinal';
3
- export declare class RelationGraphReact extends RelationGraphFinal {
4
- constructor(options: RGOptions, listeners: RGListeners);
5
- }
@@ -1,76 +0,0 @@
1
- import { RelationGraphBase } from './RelationGraphBase';
2
- import { RGLine, RGListeners, RGNode, RGOptions } from '../types';
3
- export declare class RelationGraphWith1Dom extends RelationGraphBase {
4
- $dom: HTMLDivElement;
5
- $canvasDom: HTMLDivElement;
6
- protected resizeObserver: ResizeObserver;
7
- protected resizeListenerMap: WeakMap<object, any>;
8
- protected domToNodeIdMap: WeakMap<Element, string>;
9
- constructor(options: RGOptions, listeners: RGListeners);
10
- protected initDom(): void;
11
- _rgAsConnectArea: boolean;
12
- /**
13
- * [Used internally by relation-graph] This method will be called after the RelationGraph component is mounted, to facilitate DOM operations in the JS instance object (this will only obtain visual information of the DOM and monitor changes in size and position).
14
- * @param relationGraphDom:HTMLDivElement RelationGraph container DOM
15
- */
16
- setDom(relationGraphDom: HTMLDivElement): void;
17
- private onKeyDownHanlder;
18
- private onKeyUpHanlder;
19
- protected addKeyboardListener(): void;
20
- protected removeKeyboardListener(): void;
21
- /**
22
- * [Used internally by relation-graph] This method will be called after the RelationGraph component's canvas element is mounted, to facilitate DOM operations in the JS instance object (this will only obtain visual information of the DOM and monitor changes in size and position).
23
- * @param relationGraphDom:HTMLDivElement canvas DOM
24
- */
25
- setCanvasDom(canvasDom: HTMLDivElement): void;
26
- $lineTextContainer4NormalLine: HTMLDivElement;
27
- $lineTextContainer4FakeLine: HTMLDivElement;
28
- getLineTextContainer(line: RGLine): HTMLDivElement | undefined;
29
- /**
30
- * Get the RelationGraph component DOM
31
- * @return relationGraphDom:HTMLDivElement RelationGraph container DOM
32
- */
33
- getBoundingClientRect(): DOMRect;
34
- /**
35
- * Monitor the size changes of a DOM element using ResizeObserver
36
- * @param dom
37
- * @param callback
38
- * @protected
39
- */
40
- protected addResizeListener(dom: HTMLElement, callback: (width: number, height: number) => void): void;
41
- /**
42
- * Node DOM resize event handler
43
- * @param dom
44
- * @param width
45
- * @param height
46
- * @private
47
- */
48
- private _onNodeDomResize;
49
- /**
50
- * Node DOM resize event handler
51
- * @param dom
52
- * @param node
53
- * @param width
54
- * @param height
55
- * @private
56
- */
57
- private _onNodeResize;
58
- /**
59
- * [Used internally by relation-graph] This method is called when the Node component is mounted to monitor changes in the size of the Node's DOM element.
60
- * @param dom The DOM element corresponding to the Node component
61
- * @param node The JS data object of the Node
62
- */
63
- addNodeResizeListener(dom: HTMLElement, node: RGNode): void;
64
- /**
65
- * [Used internally by relation-graph] This method is called when the Node component is destroyed to remove monitoring of the corresponding DOM element of the Node.
66
- * @param dom The DOM element corresponding to the Node component
67
- */
68
- removeNodeResizeListener(dom: HTMLElement): void;
69
- /**
70
- * Remove size change monitoring for the DOM element
71
- * @param dom
72
- * @protected
73
- */
74
- protected removeResizeListener(dom: HTMLElement): void;
75
- protected destroyResizeObserver(): void;
76
- }
@@ -1,20 +0,0 @@
1
- import { RGListeners, RGOptions } from '../types';
2
- import { RelationGraphWith2Data } from './RelationGraphWith2Data';
3
- export declare class RelationGraphWith3Image extends RelationGraphWith2Data {
4
- constructor(options: RGOptions, listeners: RGListeners);
5
- private $watermarkDom;
6
- private $watermarkPosition;
7
- private $backgroundDom;
8
- setWatermarkDom(watermarkDom: HTMLDivElement | null, forImage?: boolean, forDisplay?: boolean, position?: string): void;
9
- setBackgroundDom(backgroundDom: HTMLDivElement | null, forImage?: boolean, forDisplay?: boolean): void;
10
- dataURLToBlob(dataurl: string): Blob | undefined;
11
- createGraphCanvas(format?: string): Promise<HTMLCanvasElement>;
12
- private mergeCanvas;
13
- private createGraphBackgroundCanvas;
14
- private createGraphWatermarkCanvas;
15
- private createGraphMainCanvas;
16
- createImage(exportDom: HTMLDivElement, opts: any, format: string, fileName: string): Promise<any>;
17
- getImageBase64(format?: string): Promise<void>;
18
- downloadAsImage(format?: string, fileName?: string): Promise<void>;
19
- downloadImageAsFile(canvas: HTMLCanvasElement, format: string, fileName: string): Promise<void>;
20
- }
@@ -1,23 +0,0 @@
1
- import { RGJsonData, RGListeners, RGOptions } from '../types';
2
- import { RelationGraphWith7Event } from './RelationGraphWith7Event';
3
- export declare class RelationGraphWith8Update extends RelationGraphWith7Event {
4
- constructor(options: RGOptions, listeners: RGListeners);
5
- dataUpdated(): void;
6
- setOptions(options: RGOptions): void;
7
- setRootNodeId(rootNodeId: string): void;
8
- getRootNode(): import('../types').RGNode | undefined;
9
- setCheckedNode(nodeId: string): void;
10
- getCheckedNode(): import('../types').RGNode | undefined;
11
- getCheckedLine(): import('../types').RGFakeLine | undefined;
12
- getSelectedNodes(): import('../types').RGNode[];
13
- getEditingNodes(): import('../types').RGNode[];
14
- setJsonData(jsonData: RGJsonData): Promise<void>;
15
- /**
16
- * Append data to the graph
17
- * @param jsonData
18
- * @param isRelayout Whether to re-layout after appending data
19
- */
20
- appendJsonData(jsonData: RGJsonData, isRelayout?: boolean): Promise<void>;
21
- applyInitialData(initialData: RGJsonData): Promise<void>;
22
- fitContentHeight(padding?: number): void;
23
- }