@relation-graph/react 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/package.json +65 -0
- package/relation-graph.js +56 -0
- package/relation-graph.mjs +7433 -0
- package/relation-graph.umd.js +56 -0
- package/types/components.d.ts +5 -0
- package/types/packages/platforms/react/src/constants.d.ts +1 -0
- package/types/packages/platforms/react/src/index.d.ts +182 -0
- package/types/packages/platforms/react/src/relation-graph/RGPovider.d.ts +7 -0
- package/types/packages/platforms/react/src/relation-graph/RelationGraph.d.ts +5 -0
- package/types/packages/platforms/react/src/relation-graph/RelationLinker.d.ts +5 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGCanvas.d.ts +13 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGCanvasContent.d.ts +11 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGEasyView.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGFakeNode.d.ts +6 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGGraphRefs.d.ts +6 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLineContent.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLinePath.d.ts +6 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLinePeel.d.ts +7 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGLineText.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGNodeExpandHolder.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RGNodePeel.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RelationLinkerCanvas.d.ts +8 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RelationLinkerContent.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/RelationView.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGConnectSource.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGConnectTarget.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingConnectController.d.ts +3 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingConnectPoints.d.ts +7 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingLineController.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingNearNodeWidget.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingNodeController.d.ts +3 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingReferenceLine.d.ts +6 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGEditingResize.d.ts +7 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/editing/RGMiniView.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/NewCanvas.d.ts +20 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/NewCanvasV2.d.ts +1 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/NewCanvasV3.d.ts +1 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnCanvas.d.ts +3 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnCanvasAbove.d.ts +3 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnLine.d.ts +6 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnLineText.d.ts +6 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnNode.d.ts +6 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnNodeExpandHandle.d.ts +3 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnSVGDefs.d.ts +3 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnToolbar.d.ts +3 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/slots/RGSlotOnView.d.ts +3 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/store/index.d.ts +3 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/store/reducers/StockStore.d.ts +8 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphBackground.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphDebugPanel.d.ts +3 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphLoading.d.ts +3 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphMoveOperator.d.ts +3 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphOperateStuff.d.ts +7 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphToolBar.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphWatermark.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/GraphXsToolBar.d.ts +4 -0
- package/types/packages/platforms/react/src/relation-graph/src/core4react/widgets/RGIcons.d.ts +6 -0
- package/types/packages/platforms/react/src/relation-graph/src/hooks/RGHooks.d.ts +7 -0
- package/types/packages/platforms/react/src/relation-graph/src/hooks/useFakeNodesState.d.ts +8 -0
- package/types/packages/platforms/react/src/relation-graph/src/hooks/useGraphInstance.d.ts +13 -0
- package/types/packages/platforms/react/src/types-react.d.ts +35 -0
- package/types/packages/platforms/react/src/types.d.ts +1 -0
- package/types/packages/platforms/react/vite.config.d.ts +2 -0
- package/types/packages/platforms/vue2/src/core4vue/RGCanvas.vue.d.ts +13 -0
- package/types/packages/platforms/vue2/src/core4vue/RGCanvasContent.vue.d.ts +10 -0
- package/types/packages/platforms/vue2/src/core4vue/RGEasyView.vue.d.ts +6 -0
- package/types/packages/platforms/vue2/src/core4vue/RGFakeNode.vue.d.ts +18 -0
- package/types/packages/platforms/vue2/src/core4vue/RGGraphDefs.vue.d.ts +18 -0
- package/types/packages/platforms/vue2/src/core4vue/RGLineContent.vue.d.ts +22 -0
- package/types/packages/platforms/vue2/src/core4vue/RGLinePath.vue.d.ts +39 -0
- package/types/packages/platforms/vue2/src/core4vue/RGLinePeel.vue.d.ts +20 -0
- package/types/packages/platforms/vue2/src/core4vue/RGLineText.vue.d.ts +33 -0
- package/types/packages/platforms/vue2/src/core4vue/RGNodeExpandHolder.vue.d.ts +36 -0
- package/types/packages/platforms/vue2/src/core4vue/RGNodePeel.vue.d.ts +32 -0
- package/types/packages/platforms/vue2/src/core4vue/RelationGraph.vue.d.ts +820 -0
- package/types/packages/platforms/vue2/src/core4vue/RelationLinker.vue.d.ts +62 -0
- package/types/packages/platforms/vue2/src/core4vue/RelationLinkerCanvas.vue.d.ts +11 -0
- package/types/packages/platforms/vue2/src/core4vue/editing/RGConnectSource.vue.d.ts +29 -0
- package/types/packages/platforms/vue2/src/core4vue/editing/RGConnectTarget.vue.d.ts +45 -0
- package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingConnectController.vue.d.ts +8 -0
- package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingConnectPoints.vue.d.ts +24 -0
- package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingLineController.vue.d.ts +26 -0
- package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingNearNodeWidget.vue.d.ts +20 -0
- package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingNodeController.vue.d.ts +4 -0
- package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingReferenceLine.vue.d.ts +29 -0
- package/types/packages/platforms/vue2/src/core4vue/editing/RGEditingResize.vue.d.ts +31 -0
- package/types/packages/platforms/vue2/src/core4vue/editing/RGMiniView.vue.d.ts +38 -0
- package/types/packages/platforms/vue2/src/core4vue/widgets/GraphBackground.vue.d.ts +32 -0
- package/types/packages/platforms/vue2/src/core4vue/widgets/GraphDebugPanel.vue.d.ts +12 -0
- package/types/packages/platforms/vue2/src/core4vue/widgets/GraphLoading.vue.d.ts +4 -0
- package/types/packages/platforms/vue2/src/core4vue/widgets/GraphMoveOperator.vue.d.ts +8 -0
- package/types/packages/platforms/vue2/src/core4vue/widgets/GraphOperateStuff.vue.d.ts +4 -0
- package/types/packages/platforms/vue2/src/core4vue/widgets/GraphToolBar.vue.d.ts +46 -0
- package/types/packages/platforms/vue2/src/core4vue/widgets/GraphWatermark.vue.d.ts +57 -0
- package/types/packages/platforms/vue2/src/core4vue/widgets/GraphXsToolBar.vue.d.ts +46 -0
- package/types/packages/platforms/vue2/src/index.d.ts +2454 -0
- package/types/packages/platforms/vue2/src/types-vue2.d.ts +0 -0
- package/types/packages/platforms/vue2/vite.config.d.ts +2 -0
- package/types/packages/platforms/vue3/src/constants.d.ts +4 -0
- package/types/packages/platforms/vue3/src/index.d.ts +1495 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGCanvas.vue.d.ts +34 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGCanvasContent.vue.d.ts +37 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGEasyView.vue.d.ts +2 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGFakeNode.vue.d.ts +32 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGGraphDefs.vue.d.ts +29 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGLineContent.vue.d.ts +12 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGLinePath.vue.d.ts +16 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGLinePeel.vue.d.ts +29 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGLineText.vue.d.ts +27 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGNodeExpandHolder.vue.d.ts +18 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGNodePeel.vue.d.ts +40 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RGProvider.vue.d.ts +34 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RelationGraph.vue.d.ts +39 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RelationLinker.vue.d.ts +130 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RelationLinkerCanvas.vue.d.ts +23 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/RelationLinkerView.vue.d.ts +24 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGConnectSource.vue.d.ts +45 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGConnectTarget.vue.d.ts +46 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingConnectController.vue.d.ts +23 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingConnectPoints.vue.d.ts +16 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingLineController.vue.d.ts +56 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingNearNodeWidget.vue.d.ts +30 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingNodeController.vue.d.ts +17 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingReferenceLine.vue.d.ts +15 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGEditingResize.vue.d.ts +19 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/editing/RGMiniView.vue.d.ts +17 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/index.vue.d.ts +143 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphBackground.vue.d.ts +49 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphDebugPanel.vue.d.ts +2 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphLoading.vue.d.ts +2 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphMoveOperator.vue.d.ts +2 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphOperateStuff.vue.d.ts +19 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphToolBar.vue.d.ts +31 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphWatermark.vue.d.ts +56 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/GraphXsToolBar.vue.d.ts +31 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/core4vue3/widgets/RGIcons.vue.d.ts +15 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/hooks/RGHooks.d.ts +7 -0
- package/types/packages/platforms/vue3/src/relation-graph/src/hooks/useGraphInstance.d.ts +13 -0
- package/types/packages/platforms/vue3/src/types-vue3.d.ts +22 -0
- package/types/packages/platforms/vue3/src/types.d.ts +1 -0
- package/types/packages/platforms/vue3/vite.config.d.ts +2 -0
- package/types/packages/relation-graph-models/RGObjectsForExport.d.ts +132 -0
- package/types/packages/relation-graph-models/constants.d.ts +1 -0
- package/types/packages/relation-graph-models/layouters/RGBaseLayouter.d.ts +36 -0
- package/types/packages/relation-graph-models/layouters/RGCenterLayouter.d.ts +12 -0
- package/types/packages/relation-graph-models/layouters/RGCircleLayouter.d.ts +8 -0
- package/types/packages/relation-graph-models/layouters/RGFixedLayouter.d.ts +11 -0
- package/types/packages/relation-graph-models/layouters/RGFolderLayouter.d.ts +17 -0
- package/types/packages/relation-graph-models/layouters/RGForceLayouter.d.ts +71 -0
- package/types/packages/relation-graph-models/layouters/RGForceLayouterV2.d.ts +59 -0
- package/types/packages/relation-graph-models/layouters/RGSmartTreeLayouter.d.ts +16 -0
- package/types/packages/relation-graph-models/layouters/RGTreeLayouter.d.ts +18 -0
- package/types/packages/relation-graph-models/models/RGLineDataUtils.d.ts +9 -0
- package/types/packages/relation-graph-models/models/RGNodeDataUtils.d.ts +14 -0
- package/types/packages/relation-graph-models/models/RGOptionsDataUtils.d.ts +11 -0
- package/types/packages/relation-graph-models/models/RelationGraphBase.d.ts +67 -0
- package/types/packages/relation-graph-models/models/RelationGraphFinal.d.ts +11 -0
- package/types/packages/relation-graph-models/models/RelationGraphReact.d.ts +5 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith1Dom.d.ts +76 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith2Data.d.ts +398 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith3Image.d.ts +20 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith4Line.d.ts +48 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith5Zoom.d.ts +31 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith6Effect.d.ts +18 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith6Layout.d.ts +33 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith7Event.d.ts +74 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith8Update.d.ts +23 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith91Editing.d.ts +59 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith92MiniView.d.ts +50 -0
- package/types/packages/relation-graph-models/models/RelationGraphWith9EasyView.d.ts +28 -0
- package/types/packages/relation-graph-models/types.d.ts +903 -0
- package/types/packages/relation-graph-models/utils/RGCanvasImpl2D.d.ts +59 -0
- package/types/packages/relation-graph-models/utils/RGCanvasImplWebGL.d.ts +47 -0
- package/types/packages/relation-graph-models/utils/RGCommon.d.ts +26 -0
- package/types/packages/relation-graph-models/utils/RGDragUtils.d.ts +17 -0
- package/types/packages/relation-graph-models/utils/RGFullscreenUtils.d.ts +3 -0
- package/types/packages/relation-graph-models/utils/RGGraphMath.d.ts +104 -0
- package/types/packages/relation-graph-models/utils/RGIconsData.d.ts +41 -0
- package/types/packages/relation-graph-models/utils/RGIntergration.d.ts +47 -0
- package/types/packages/relation-graph-models/utils/RGNodesAnalytic.d.ts +38 -0
- package/types/packages/relation-graph-models/utils/line/RGLinePath.d.ts +90 -0
- package/types/packages/relation-graph-models/utils/line/RGLinePathUtils.d.ts +54 -0
- package/types/packages/relation-graph-models/utils/line/RGPathGeneratorFor1.d.ts +2 -0
- package/types/packages/relation-graph-models/utils/line/RGPathGeneratorFor4.d.ts +2 -0
- package/types/packages/relation-graph-models/utils/line/RGPathGeneratorFor44.d.ts +2 -0
- package/types/packages/relation-graph-models/utils/line/RGPathGeneratorFor49.d.ts +2 -0
- package/types/packages/relation-graph-models/utils/line/RGPathGeneratorFor6.d.ts +6 -0
- package/types/packages/relation-graph-models/utils/line/RGPathGeneratorForCurve.d.ts +2 -0
- package/types/react.d.ts +201 -0
- package/types/svelte.d.ts +170 -0
- package/types/vue2.d.ts +862 -0
- package/types/vue3.d.ts +1246 -0
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import { JsonLine, JsonNode, RGConnectTarget4NodePoint, RGFakeLine, RGFakeLineTargetRender, RGGenerateLineConfig, RGGraphData, RGGraphReactiveData, RGJsonData, RGJunctionPoint, RGLine, RGLineTarget, RGLink, RGListeners, RGNode, RGRectTarget, RGOptions, RGPosition } from '../types';
|
|
2
|
+
import { RelationGraphWith1Dom } from './RelationGraphWith1Dom';
|
|
3
|
+
export declare class RelationGraphWith2Data extends RelationGraphWith1Dom {
|
|
4
|
+
/**
|
|
5
|
+
* All data managed in RelationGraph, including all nodes RGNode, all relationships RGLink, the current root node, and all element lines elementLines
|
|
6
|
+
*/
|
|
7
|
+
graphData: RGGraphData;
|
|
8
|
+
runtimeDATA4Links: RGLink[];
|
|
9
|
+
runtimeDATA4NodeMap: Record<string, RGNode>;
|
|
10
|
+
runtimeDATA4ConnectTargets: RGConnectTarget4NodePoint[];
|
|
11
|
+
/**
|
|
12
|
+
* [Used internally by relation-graph] The reactive data object of the current RelationGraph component
|
|
13
|
+
*/
|
|
14
|
+
reactiveData: RGGraphReactiveData;
|
|
15
|
+
constructor(options: RGOptions, listeners: RGListeners);
|
|
16
|
+
/**
|
|
17
|
+
* [Used internally by relation-graph] Set reactive data objects
|
|
18
|
+
* @param graphData
|
|
19
|
+
* @param reactiveData
|
|
20
|
+
*/
|
|
21
|
+
setReactiveData4Vue2(graphData: RGGraphData, reactiveData: RGGraphReactiveData, runtimeData: any): void;
|
|
22
|
+
runtimeDATA4ShouldRenderGraphData: {
|
|
23
|
+
nodes: RGLineTarget[];
|
|
24
|
+
lines: RGLine[];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* [Used internally by relation-graph] Set reactive data objects
|
|
28
|
+
* @param graphData
|
|
29
|
+
* @param reactiveData
|
|
30
|
+
*/
|
|
31
|
+
setReactiveData4Vue3(graphData: RGGraphData, reactiveData: RGGraphReactiveData, runtimeData: any): void;
|
|
32
|
+
protected _setOptions(options: RGOptions): void;
|
|
33
|
+
protected _setJsonData(jsonData: RGJsonData, resetViewSize?: boolean): void;
|
|
34
|
+
/**
|
|
35
|
+
* Clear all data in RelationGraph, including nodes, lines, element lines, and the root node
|
|
36
|
+
*/
|
|
37
|
+
clearGraph(): void;
|
|
38
|
+
clearFakeLines(): void;
|
|
39
|
+
clearElementLines(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Generate a unique Node id relative to the current existing nodes
|
|
42
|
+
* @param idLength The minimum length of the id, default is 5
|
|
43
|
+
*/
|
|
44
|
+
generateNewNodeId(idLength?: number): string;
|
|
45
|
+
/**
|
|
46
|
+
* Generate a highly likely unique id, the probability of non-duplication depends on the parameter idLength (the length of the id)
|
|
47
|
+
* @param idLength The length of the id, default is 5
|
|
48
|
+
*/
|
|
49
|
+
generateNewUUID(idLength?: number): string;
|
|
50
|
+
protected prevAddNodeTimestamp: number;
|
|
51
|
+
/**
|
|
52
|
+
* Convert JsonNode to RGNode object and add it to the graph
|
|
53
|
+
* @param _nodes
|
|
54
|
+
* @protected
|
|
55
|
+
*/
|
|
56
|
+
protected loadNodes(_nodes: JsonNode[]): void;
|
|
57
|
+
/**
|
|
58
|
+
* Convert JsonLine to RGLine object and add it to the graph
|
|
59
|
+
* @param _lines
|
|
60
|
+
* @protected
|
|
61
|
+
*/
|
|
62
|
+
protected loadLines(_lines: JsonLine[]): void;
|
|
63
|
+
private updateLinks;
|
|
64
|
+
/**
|
|
65
|
+
* Expand tree-structured data into flattened data
|
|
66
|
+
* @param orign_nodes Tree-structured data, e.g., [{id:'a',children:[{id:'a-1'},{id:'a-1', children: [{id:'a-1-1'}]}]}]
|
|
67
|
+
* @param parentNode Please pass null
|
|
68
|
+
* @param nodes_collect All expanded nodes will be stored here
|
|
69
|
+
* @param lines_collect All expanded lines will be stored here
|
|
70
|
+
*/
|
|
71
|
+
flatNodeData(orign_nodes: JsonNode[], parentNode: JsonNode | null, nodes_collect: JsonNode[], lines_collect: JsonLine[]): void;
|
|
72
|
+
protected loadGraphJsonData(jsonData: RGJsonData): void;
|
|
73
|
+
protected getLineArrow(_color: string | undefined, isStartArrow?: boolean, checked?: boolean): string;
|
|
74
|
+
/**
|
|
75
|
+
* Get all node objects
|
|
76
|
+
*/
|
|
77
|
+
getNodes(): RGNode[];
|
|
78
|
+
getShouldRenderNodes(): RGNode[] | RGLineTarget[];
|
|
79
|
+
protected calcShouldRenderNodes(): RGNode[];
|
|
80
|
+
getShouldRenderLines(): RGLine[];
|
|
81
|
+
protected calcShouldRenderLines(): RGLine[];
|
|
82
|
+
private mutationObserver4Nodes?;
|
|
83
|
+
private mutationObserver4CanvasSlotBehind?;
|
|
84
|
+
private mutationObserver4CanvasSlotAbove?;
|
|
85
|
+
private canvasConnectTargetsMap;
|
|
86
|
+
private reinitMutationObservers;
|
|
87
|
+
protected destroyMutationObserver(): void;
|
|
88
|
+
private updateConnectTargetsOnCanvas;
|
|
89
|
+
/**
|
|
90
|
+
* 供外部调用,更新指定节点的连接点位置,不适用于高频次调用
|
|
91
|
+
* @param nodeId
|
|
92
|
+
*/
|
|
93
|
+
updateConnectTargetsByNodeId(nodeId: string): void;
|
|
94
|
+
private updateConnectTargetsOnNode;
|
|
95
|
+
private updateConnectTargetList;
|
|
96
|
+
private updateConnectTargetOffset;
|
|
97
|
+
private _onConnectTargetMounted;
|
|
98
|
+
private nodeConnectTargetsMap;
|
|
99
|
+
private getNodeElByNodeId;
|
|
100
|
+
private getNodeElByChildrenTarget;
|
|
101
|
+
getConnectTargetById(targetId: string): RGConnectTarget4NodePoint | undefined;
|
|
102
|
+
registerConnectTarget(connectTargetEl: HTMLDivElement, targetId: string, targetType: string, junctionPoint: RGJunctionPoint, targetData?: {}): RGConnectTarget4NodePoint | undefined;
|
|
103
|
+
unregisterConnectTarget(targetId: string): void;
|
|
104
|
+
private fakeLineTargetRender;
|
|
105
|
+
setFakeLineTargetRender(fakeLineTargetRender: RGFakeLineTargetRender): void;
|
|
106
|
+
generateCreatingLineConfig(): RGGenerateLineConfig;
|
|
107
|
+
private getFakeLineTargetNode;
|
|
108
|
+
private runtimeDATA4ElLineTargets;
|
|
109
|
+
getFakeLineTarget(targetType: string, targetId: string, fakeLine: RGFakeLine): RGLineTarget | undefined;
|
|
110
|
+
generateLineConfig(line: RGLine): RGGenerateLineConfig | false;
|
|
111
|
+
generateFakeLineConfig(fakeLine: RGFakeLine): RGGenerateLineConfig | false;
|
|
112
|
+
getShouldRenderFakeLines(): RGFakeLine[];
|
|
113
|
+
/**
|
|
114
|
+
* Get all relationship objects, note that here Link is not a line.
|
|
115
|
+
* Line: The lines refer to the connections between nodes, and the graph will generate lines based on these lines.
|
|
116
|
+
* Relationship (Link): The graph will also generate a Link to summarize the associations between nodes based on the lines (there is only one Link between two directly related nodes, and all relationship lines (Line[]) between nodes will be placed in link.relations).
|
|
117
|
+
* You can traverse and get all lines like this:
|
|
118
|
+
* const allLines: RGLine[] = [];
|
|
119
|
+
* for (const link of graphInstance.getLinks()) {
|
|
120
|
+
* allLines.push(link.line);
|
|
121
|
+
* }
|
|
122
|
+
* // The Line object has all the properties of JsonLine, you can change these properties. For example, change the color of all lines to red:
|
|
123
|
+
* for (const line of allLines) {
|
|
124
|
+
* line.color = 'red';
|
|
125
|
+
* }
|
|
126
|
+
*/
|
|
127
|
+
getLinks(): RGLink[];
|
|
128
|
+
getRelatedLinesByNode(node: RGNode): RGLine[];
|
|
129
|
+
getLinesBetweenNodes(nodes: RGNode[]): RGLine[];
|
|
130
|
+
/**
|
|
131
|
+
* Convert an RGNode object to a JSON-serializable object
|
|
132
|
+
* @param nodeJson: JsonNode
|
|
133
|
+
*/
|
|
134
|
+
transRGNodeToJsonObject(node: RGNode): JsonNode;
|
|
135
|
+
/**
|
|
136
|
+
* Convert an RGLink object to a JSON-serializable object
|
|
137
|
+
* @param lines: JsonLine[]
|
|
138
|
+
*/
|
|
139
|
+
transRGLinkToJsonObject(link: RGLink): JsonLine[];
|
|
140
|
+
/**
|
|
141
|
+
* Convert an RGLine object to a JSON-serializable object
|
|
142
|
+
* @param lineJson: JsonLine
|
|
143
|
+
*/
|
|
144
|
+
transRGLineToJsonObject(line: RGLine): JsonLine;
|
|
145
|
+
/**
|
|
146
|
+
* Get all nodes and lines data in the current graph.
|
|
147
|
+
* @param graphJsonData: RGJsonData
|
|
148
|
+
*/
|
|
149
|
+
getGraphJsonData(): RGJsonData;
|
|
150
|
+
/**
|
|
151
|
+
* Get the configuration information of the current graph
|
|
152
|
+
*/
|
|
153
|
+
getGraphJsonOptions(): {};
|
|
154
|
+
/**
|
|
155
|
+
* Print the current graph configuration and JSON data to the console
|
|
156
|
+
*/
|
|
157
|
+
printGraphJsonData(): void;
|
|
158
|
+
/**
|
|
159
|
+
* Get the node object by node id
|
|
160
|
+
* @param nodeId: RGNode
|
|
161
|
+
*/
|
|
162
|
+
getNodeById(nodeId: string): RGNode | undefined;
|
|
163
|
+
/**
|
|
164
|
+
* Add node
|
|
165
|
+
* @param node: JsonNode
|
|
166
|
+
*/
|
|
167
|
+
addNode(node: JsonNode): void;
|
|
168
|
+
/**
|
|
169
|
+
* Add multiple nodes
|
|
170
|
+
* @param nodes: JsonNode[]
|
|
171
|
+
*/
|
|
172
|
+
addNodes(nodes: JsonNode[]): void;
|
|
173
|
+
/**
|
|
174
|
+
* Get the RGLink object by relationship id
|
|
175
|
+
* @param linkId: string
|
|
176
|
+
*/
|
|
177
|
+
getLinkById(linkId: string): RGLink | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Get the RGLink object by line id
|
|
180
|
+
* @param line: RGLine
|
|
181
|
+
*/
|
|
182
|
+
getLinkByLineId(lineId: string): RGLink | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* Get the RGLink object by line
|
|
185
|
+
* @param line: RGLine
|
|
186
|
+
*/
|
|
187
|
+
getLinkByLine(line: RGLine): RGLink | undefined;
|
|
188
|
+
/**
|
|
189
|
+
* Get the RGLine object by line id
|
|
190
|
+
* @param line: RGLine
|
|
191
|
+
*/
|
|
192
|
+
getLineById(lineId: string): RGLine | undefined;
|
|
193
|
+
getLines(): RGLine[];
|
|
194
|
+
/**
|
|
195
|
+
* Add line
|
|
196
|
+
* @param line: JsonLine
|
|
197
|
+
*/
|
|
198
|
+
addLine(line: JsonLine): void;
|
|
199
|
+
/**
|
|
200
|
+
* Add multiple lines
|
|
201
|
+
* @param lines: JsonLine[]
|
|
202
|
+
*/
|
|
203
|
+
addLines(lines: JsonLine[]): void;
|
|
204
|
+
/**
|
|
205
|
+
* Remove the specified RGLine object
|
|
206
|
+
* @param line
|
|
207
|
+
*/
|
|
208
|
+
removeLine(line: RGLine): void;
|
|
209
|
+
/**
|
|
210
|
+
* Remove the specified RGLine object by line id
|
|
211
|
+
* @param lineId
|
|
212
|
+
*/
|
|
213
|
+
removeLineById(lineId: string): void;
|
|
214
|
+
/**
|
|
215
|
+
* Remove the RGLink object from the graph
|
|
216
|
+
* @param link
|
|
217
|
+
*/
|
|
218
|
+
removeLink(link: RGLink): void;
|
|
219
|
+
/**
|
|
220
|
+
* Delete the Link object by its id, usually used to delete all lines and data relationships between two nodes
|
|
221
|
+
* @param linkId
|
|
222
|
+
*/
|
|
223
|
+
removeLinkById(linkId: string): void;
|
|
224
|
+
getFakeLines(): RGFakeLine[];
|
|
225
|
+
/**
|
|
226
|
+
* Add multiple lines
|
|
227
|
+
* @param lines: JsonLine[]
|
|
228
|
+
*/
|
|
229
|
+
addFakeLines(lines: RGFakeLine[]): void;
|
|
230
|
+
/**
|
|
231
|
+
* Remove the specified RGLine object
|
|
232
|
+
* @param line
|
|
233
|
+
*/
|
|
234
|
+
removeFakeLine(line: RGFakeLine): void;
|
|
235
|
+
getFakeLineById(lineId: string): RGFakeLine | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* Remove the specified RGLine object by line id
|
|
238
|
+
* @param lineId
|
|
239
|
+
*/
|
|
240
|
+
removeFakeLineById(lineId: string): void;
|
|
241
|
+
/**
|
|
242
|
+
* Add multiple element lines
|
|
243
|
+
* @param lines: JsonLine[]
|
|
244
|
+
*/
|
|
245
|
+
addElementLines(lines: JsonLine[]): void;
|
|
246
|
+
/**
|
|
247
|
+
* 根据元素连线id获取元素连线
|
|
248
|
+
* @param elLink: RGLink
|
|
249
|
+
*/
|
|
250
|
+
getElementLineById(elLineId: string): RGFakeLine | undefined;
|
|
251
|
+
/**
|
|
252
|
+
* Get all element lines
|
|
253
|
+
*/
|
|
254
|
+
getElementLines(): RGLine[];
|
|
255
|
+
/**
|
|
256
|
+
* Delete element line by element line id
|
|
257
|
+
* @param elementLineId: string Element line id
|
|
258
|
+
*/
|
|
259
|
+
removeELementLineById(elementLineId: string): void;
|
|
260
|
+
private elLineUpdating;
|
|
261
|
+
/**
|
|
262
|
+
* Update the position information of all element lines
|
|
263
|
+
*/
|
|
264
|
+
updateElementLines(): void;
|
|
265
|
+
private _updateElementLines;
|
|
266
|
+
private updateCanvasBoxInfo;
|
|
267
|
+
private updateElementTarget;
|
|
268
|
+
private _canvasBoxXY;
|
|
269
|
+
private _updateElementLinePosition;
|
|
270
|
+
getElementPosition(elementId: string): {
|
|
271
|
+
x: number;
|
|
272
|
+
y: number;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* Remove a node from the graph
|
|
276
|
+
* @param nodeId
|
|
277
|
+
*/
|
|
278
|
+
removeNodeById(nodeId: string): void;
|
|
279
|
+
/**
|
|
280
|
+
* Remove a node from the graph
|
|
281
|
+
* @param node
|
|
282
|
+
*/
|
|
283
|
+
removeNode(node: RGNode): void;
|
|
284
|
+
getNodeRelatedNodes(node: RGNode): RGNode[];
|
|
285
|
+
getNodeRelatedNodes4From(node: RGNode): RGNode[];
|
|
286
|
+
getNodeRelatedNodes4To(node: RGNode): RGNode[];
|
|
287
|
+
private beforeNodeBeRemove;
|
|
288
|
+
/**
|
|
289
|
+
* Set the coordinates of a node. Generally, you do not need to call this method; you can directly modify the x and y properties of the node.
|
|
290
|
+
* @param node
|
|
291
|
+
* @param x
|
|
292
|
+
* @param y
|
|
293
|
+
*/
|
|
294
|
+
setNodePosition(node: RGNode, x: number, y: number): void;
|
|
295
|
+
getGraphOffet(): {
|
|
296
|
+
offset_x: number;
|
|
297
|
+
offset_y: number;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* Display the specified canvas coordinates in the center of the visible area
|
|
301
|
+
* @param x
|
|
302
|
+
* @param y
|
|
303
|
+
*/
|
|
304
|
+
setCanvasCenter(x: number, y: number): void;
|
|
305
|
+
private canvasDragging;
|
|
306
|
+
/**
|
|
307
|
+
* Set the canvas offset, used when dragging the canvas
|
|
308
|
+
* @param x
|
|
309
|
+
* @param y
|
|
310
|
+
*/
|
|
311
|
+
setCanvasOffset(x: number, y: number): void;
|
|
312
|
+
/**
|
|
313
|
+
* Oh my, this seems to be a duplicate method, it seems to have the same effect as the getGroupNodesByNode method
|
|
314
|
+
* @param node
|
|
315
|
+
* @param groupNodes
|
|
316
|
+
*/
|
|
317
|
+
findGroupNodes(node: RGNode, groupNodes?: RGNode[]): RGNode[];
|
|
318
|
+
/**
|
|
319
|
+
* Get all nodes that have a direct or indirect relationship with a given node
|
|
320
|
+
* @param node
|
|
321
|
+
* @param groupNodes Used to collect the found nodes
|
|
322
|
+
* @return All nodes that have a direct or indirect relationship with the node, including the node itself
|
|
323
|
+
*/
|
|
324
|
+
getGroupNodesByNode(node: RGNode, groupNodes?: RGNode[]): RGNode[];
|
|
325
|
+
getNetworkNodesByNode(node: RGNode, networkNodes?: RGNode[]): RGNode[];
|
|
326
|
+
getDescendantNodes(node: RGNode): RGNode[];
|
|
327
|
+
/**
|
|
328
|
+
* When the size of the parent element of the relation-graph component changes, you can call this method to recalculate the view size
|
|
329
|
+
* @param zoomTo100
|
|
330
|
+
* @protected
|
|
331
|
+
*/
|
|
332
|
+
resetViewSize(zoomTo100?: boolean): void;
|
|
333
|
+
/**
|
|
334
|
+
* This is an internal method, generally not needed to be called
|
|
335
|
+
*/
|
|
336
|
+
updateViewBoxInfo(): void;
|
|
337
|
+
/**
|
|
338
|
+
* Calculate the plane space information occupied by all nodes
|
|
339
|
+
* @param nodes Optional, if not specified, it will be calculated based on all nodes
|
|
340
|
+
*/
|
|
341
|
+
protected getStuffSize(nodes?: (RGNode | RGRectTarget)[]): {
|
|
342
|
+
width: number;
|
|
343
|
+
height: number;
|
|
344
|
+
minX: number;
|
|
345
|
+
minY: number;
|
|
346
|
+
maxX: number;
|
|
347
|
+
maxY: number;
|
|
348
|
+
};
|
|
349
|
+
getNodesViewInfo(nodes?: (RGNode | RGRectTarget)[]): {
|
|
350
|
+
width: number;
|
|
351
|
+
height: number;
|
|
352
|
+
minX: number;
|
|
353
|
+
minY: number;
|
|
354
|
+
maxX: number;
|
|
355
|
+
maxY: number;
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* Get the center coordinates of the plane space occupied by the node collection
|
|
359
|
+
* @param nodes Optional, if not specified, it will be calculated based on all nodes
|
|
360
|
+
*/
|
|
361
|
+
getNodesCenter(nodes?: (RGNode | RGRectTarget)[]): {
|
|
362
|
+
x: number;
|
|
363
|
+
y: number;
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* Print the current graph configuration information to the console
|
|
367
|
+
*/
|
|
368
|
+
printOptions(): void;
|
|
369
|
+
/**
|
|
370
|
+
* Print all data of the current graph to the console
|
|
371
|
+
*/
|
|
372
|
+
printData(): void;
|
|
373
|
+
/**
|
|
374
|
+
* Lock the graph component screen and display a piece of text
|
|
375
|
+
* @param graphLoadingText The text to display
|
|
376
|
+
*/
|
|
377
|
+
loading(graphLoadingText?: string): void;
|
|
378
|
+
/**
|
|
379
|
+
* Clear the lock on the graph component screen
|
|
380
|
+
*/
|
|
381
|
+
clearLoading(): void;
|
|
382
|
+
/**
|
|
383
|
+
* Recalculate all visible nodes
|
|
384
|
+
* @param force
|
|
385
|
+
*/
|
|
386
|
+
updateShouldRenderGraphData(force?: boolean): void;
|
|
387
|
+
protected _updateShouldRenderGraphData(): void;
|
|
388
|
+
updateNodesVisibleProperty(): void;
|
|
389
|
+
setCanvasMoveMode(newValue: boolean): void;
|
|
390
|
+
defaultLineConnectEndHandler(from: RGNode | RGLineTarget, to: RGNode | RGLineTarget | RGPosition, newLine?: JsonLine): void;
|
|
391
|
+
/**
|
|
392
|
+
* 在线条的起点或者终点发生变化后,重新修正 isReverse,因为在开始拖动线条端点时,有可能会修改这个属性。这一步完成后才会触发 onLineBeCreated事件,在onLineBeCreated事件中可以无需考虑 isReverse属性,直接添加线条
|
|
393
|
+
* @param from
|
|
394
|
+
* @param to
|
|
395
|
+
* @param newLine
|
|
396
|
+
*/
|
|
397
|
+
defaultLineVertexBeChangedHandler(from: RGNode, to: RGNode | RGPosition, newLine?: JsonLine): void;
|
|
398
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RelationGraphWith3Image } from './RelationGraphWith3Image';
|
|
2
|
+
import { RGJunctionPoint, RGElementLine, RGGenerateLineConfig, RGGenerateLinePrams, RGLine, RGLinePathInfo, RGLineTextPosition, RGLink, RGListeners, RGOptions, RGUserEvent } from '../types';
|
|
3
|
+
import { RGLineVertexBeDroppedEventHandler } from '../../../types/types/relation-graph-models/types';
|
|
4
|
+
export declare class RelationGraphWith4Line extends RelationGraphWith3Image {
|
|
5
|
+
constructor(options: RGOptions, listeners: RGListeners);
|
|
6
|
+
private _getJunctionPoint;
|
|
7
|
+
createLinePath(link: RGLink | RGElementLine, line: RGLine, ri: number): void;
|
|
8
|
+
createLineDrawInfo(link: RGLink | RGElementLine, line: RGLine): RGLinePathInfo | undefined;
|
|
9
|
+
generateLinePath(generateConfig: RGGenerateLineConfig): RGLinePathInfo;
|
|
10
|
+
throwLineError(errorCode: string, x: number, y: number): {
|
|
11
|
+
rgError: boolean;
|
|
12
|
+
errorCode: string;
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
createErrorLineValue(errorCode: string, x: number, y: number): RGLinePathInfo;
|
|
17
|
+
/**
|
|
18
|
+
this.options.layout.layoutDirection || 'h';
|
|
19
|
+
this.options.multiLineDistance
|
|
20
|
+
this.options.defaultJunctionPoint
|
|
21
|
+
lineRadius: this.options.defaultPolyLineRadius
|
|
22
|
+
**/
|
|
23
|
+
withLineJunctionPoints({ line, from, to, totalLinesBetweenNodes, currentLineIndex, defaultOptions }: RGGenerateLineConfig): RGGenerateLinePrams;
|
|
24
|
+
createLinePathData(linePathGenerateParmas: RGGenerateLinePrams): RGLinePathInfo;
|
|
25
|
+
getArrowMarkerId(line: RGLine, isStartArrow?: boolean): string | undefined;
|
|
26
|
+
getTextTransform(line: RGLine, textPosition: RGLineTextPosition): string;
|
|
27
|
+
generateLineTextStyle(lineConfig: RGGenerateLineConfig, linePathInfo: RGLinePathInfo): {
|
|
28
|
+
cssStyles: {
|
|
29
|
+
transform: string;
|
|
30
|
+
transformOrigin: string;
|
|
31
|
+
};
|
|
32
|
+
text?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
text: string;
|
|
35
|
+
cssStyles: {
|
|
36
|
+
transform: string;
|
|
37
|
+
transformOrigin: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
generateLineTextStyle4TextPath(lineConfig: RGGenerateLineConfig): {
|
|
41
|
+
text: string;
|
|
42
|
+
textOffset: string;
|
|
43
|
+
textAnchor: string;
|
|
44
|
+
onPathStartOffset: string;
|
|
45
|
+
textRotate: number;
|
|
46
|
+
} | null;
|
|
47
|
+
onLineVertexBeDroppedOnConnectController(junctionPoint: RGJunctionPoint, $event: RGUserEvent, connectBoxDom?: HTMLElement, lineVertexBeDroppedEventHandler?: RGLineVertexBeDroppedEventHandler): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { RGListeners, RGOptions } from '../types';
|
|
2
|
+
import { RelationGraphWith4Line } from './RelationGraphWith4Line';
|
|
3
|
+
export type RGCoordinate = {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
};
|
|
7
|
+
export type RGClientXy = RGCoordinate;
|
|
8
|
+
export type RGCViewXy = RGCoordinate;
|
|
9
|
+
export type RGCanvasXy = RGCoordinate;
|
|
10
|
+
export declare class RelationGraphWith5Zoom extends RelationGraphWith4Line {
|
|
11
|
+
constructor(options: RGOptions, listeners: RGListeners);
|
|
12
|
+
private _zooming;
|
|
13
|
+
zoom(buff: number, userZoomCenter?: RGClientXy, e?: WheelEvent): Promise<void>;
|
|
14
|
+
protected _zoomEnd(oldZoomValue: number, newZoomValue: number): boolean;
|
|
15
|
+
setZoom(finalZoom: number, userZoomCenter?: RGClientXy): void;
|
|
16
|
+
/**
|
|
17
|
+
* Get the coordinates mapped on the "relation-graph Component viewport" from the canvas coordinates
|
|
18
|
+
* @param clientXY = {x: e.clientX, y: e.clientY}
|
|
19
|
+
*/
|
|
20
|
+
getCanvasXyByClientXy(clientXY: RGCoordinate): RGCoordinate;
|
|
21
|
+
/**
|
|
22
|
+
* Get the coordinates mapped on the "relation-graph Component viewport" from the canvas coordinates
|
|
23
|
+
* @param viewXy = {x: e.clientX - relationGraphViewBox.left, y: e.clientY - relationGraphViewBox.top}
|
|
24
|
+
*/
|
|
25
|
+
getCanvasXyByViewXy(viewXy: RGCoordinate): RGCoordinate;
|
|
26
|
+
/**
|
|
27
|
+
* Get the coordinates mapped on the canvas from the "relation-graph Component viewport" coordinates
|
|
28
|
+
* @param canvasCoordinate = {x: node.x, y: node.y}
|
|
29
|
+
*/
|
|
30
|
+
getViewXyByCanvasXy(canvasCoordinate: RGCoordinate): RGCoordinate;
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RGListeners, RGNode, RGRectTarget, RGOptions } from '../types';
|
|
2
|
+
import { RelationGraphWith5Zoom } from './RelationGraphWith5Zoom';
|
|
3
|
+
export declare class RelationGraphWith6Effect extends RelationGraphWith5Zoom {
|
|
4
|
+
constructor(options: RGOptions, listeners: RGListeners);
|
|
5
|
+
/**
|
|
6
|
+
* Move the center of the canvas to the center of the viewport. Note: The center of the canvas refers to the center calculated based on the distribution of nodes, not the center point of the canvas.
|
|
7
|
+
*/
|
|
8
|
+
moveToCenter(nodes?: (RGNode | RGRectTarget)[]): void;
|
|
9
|
+
/**
|
|
10
|
+
* Zoom to fit the appropriate size, which means making the specified nodes visible in the view and occupying the view as much as possible.
|
|
11
|
+
* @param nodes Optional, defaults to all nodes in the graph
|
|
12
|
+
*/
|
|
13
|
+
zoomToFit(nodes?: (RGNode | RGRectTarget)[]): void;
|
|
14
|
+
enableNodeXYAnimation(): void;
|
|
15
|
+
disableNodeXYAnimation(): void;
|
|
16
|
+
enableCanvasAnimation(): void;
|
|
17
|
+
disableCanvasAnimation(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RGLayouter, RGLayoutOptions, RGListeners, RGNode, RGOptions } from '../types';
|
|
2
|
+
import { RelationGraphWith6Effect } from './RelationGraphWith6Effect';
|
|
3
|
+
export declare class RelationGraphWith6Layout extends RelationGraphWith6Effect {
|
|
4
|
+
constructor(options: RGOptions, listeners: RGListeners);
|
|
5
|
+
/**
|
|
6
|
+
* Assign positions to the nodes in the current graph based on the layout configuration set in the options
|
|
7
|
+
*/
|
|
8
|
+
doLayout(customRootNode?: RGNode | string): Promise<void>;
|
|
9
|
+
private _doLayout;
|
|
10
|
+
refresh(doLayout?: boolean): void;
|
|
11
|
+
private _mainGroupNodes;
|
|
12
|
+
placeOtherNodes(): void;
|
|
13
|
+
placeSingleNodes(singleNodes: RGNode[]): void;
|
|
14
|
+
placeOtherGroup(notPlacedNodes: RGNode[], placedNodes: RGNode[]): void;
|
|
15
|
+
/**
|
|
16
|
+
* If the current layout is force, you can call this method to start or stop the real-time force-directed calculation
|
|
17
|
+
*/
|
|
18
|
+
toggleAutoLayout(): void;
|
|
19
|
+
private layouter;
|
|
20
|
+
/**
|
|
21
|
+
* If the current layout is force, you can call this method to start the force-directed calculation
|
|
22
|
+
*/
|
|
23
|
+
startAutoLayout(): void;
|
|
24
|
+
/**
|
|
25
|
+
* If the current layout is force, you can call this method to stop the force-directed calculation
|
|
26
|
+
*/
|
|
27
|
+
stopAutoLayout(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Create a layouter
|
|
30
|
+
* @param layoutOptions
|
|
31
|
+
*/
|
|
32
|
+
createLayout(layoutOptions: RGLayoutOptions, isMainLayout?: boolean): RGLayouter;
|
|
33
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { CreatingLinePlotOptions, CreatingNodePlotOptions, RGLine, RGLineConnectEventHandler, RGLineTarget, RGLink, RGListeners, RGNode, RGOptions, RGPosition, RGSelectionView, RGUserEvent } from '../types';
|
|
2
|
+
import { RelationGraphWith6Layout } from './RelationGraphWith6Layout';
|
|
3
|
+
export declare class RelationGraphWith7Event extends RelationGraphWith6Layout {
|
|
4
|
+
constructor(options: RGOptions, listeners: RGListeners);
|
|
5
|
+
setCheckedNode(nodeId: string): void;
|
|
6
|
+
setCheckedLinkAndLine(link: RGLink, line: RGLine): void;
|
|
7
|
+
setCheckedLine(line: RGLine): void;
|
|
8
|
+
clearChecked(): void;
|
|
9
|
+
clearSelected(): void;
|
|
10
|
+
updateNodeOffsetSize(nodeId: string, width: number, height: number): void;
|
|
11
|
+
prevClickTime: number;
|
|
12
|
+
onNodeClick(node: RGNode, e: RGUserEvent): void;
|
|
13
|
+
protected nodeXYBeforeDrag: {
|
|
14
|
+
[nodeId: string]: {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
onNodeDragStart(willMoveNode: RGNode, e: RGUserEvent): void;
|
|
20
|
+
onNodeDraged(node: RGNode, x_buff: number, y_buff: number, e: RGUserEvent): void;
|
|
21
|
+
onNodeDragEnd(node: RGNode, e: RGUserEvent, x_buff: number, y_buff: number): void;
|
|
22
|
+
onLineClick(line: RGLine, link: RGLink, e: RGUserEvent): void;
|
|
23
|
+
expandOrCollapseNode(node: RGNode, e: RGUserEvent): void;
|
|
24
|
+
expandNode(node: RGNode, e?: RGUserEvent): void;
|
|
25
|
+
collapseNode(node: RGNode, e?: RGUserEvent): void;
|
|
26
|
+
private doLayoutWhenExpandedOrCollapsed;
|
|
27
|
+
onCanvasDragEnd(e: RGUserEvent): void;
|
|
28
|
+
onCanvasClick(e: RGUserEvent): void;
|
|
29
|
+
onCanvasSelectionEnd(selectionView: RGSelectionView, e: RGUserEvent): void;
|
|
30
|
+
startCreatingNodePlot(e: RGUserEvent, setting: CreatingNodePlotOptions): void;
|
|
31
|
+
startCreatingLinePlot(e: RGUserEvent, setting: CreatingLinePlotOptions): void;
|
|
32
|
+
movingListener: any;
|
|
33
|
+
stopCreatingLinePlot(): void;
|
|
34
|
+
_currentMovingLineTarget: RGLineTarget | null;
|
|
35
|
+
onMovingWhenCreatingLinePlot($event: MouseEvent): void;
|
|
36
|
+
onCanvasClickWhenCreatingLinePlot($event: RGUserEvent): void;
|
|
37
|
+
step1EventTime: number;
|
|
38
|
+
onNodeClickWhenCreatingLinePlot(node: RGNode): void;
|
|
39
|
+
onCreateLineCallback: RGLineConnectEventHandler | undefined;
|
|
40
|
+
onCreateLine(from: RGNode, to: RGNode | RGPosition): boolean | import('../types').RGCoordinate | undefined;
|
|
41
|
+
isNode(el: HTMLElement): RGNode | undefined;
|
|
42
|
+
isLine(el: HTMLElement): RGLink | undefined;
|
|
43
|
+
isLink(el: HTMLElement): RGLink | undefined;
|
|
44
|
+
onContextmenu(e: RGUserEvent): void;
|
|
45
|
+
fullscreen(newValue?: boolean): Promise<void>;
|
|
46
|
+
focusNodeById(nodeId: string): void;
|
|
47
|
+
focusRootNode(): void;
|
|
48
|
+
handleSelect(thisNode: RGNode): void;
|
|
49
|
+
private _wheelAction;
|
|
50
|
+
private _wheelBuff;
|
|
51
|
+
onMouseWheel(e: WheelEvent): true | undefined;
|
|
52
|
+
private _onMouseWheel;
|
|
53
|
+
/**
|
|
54
|
+
* Scroll the canvas
|
|
55
|
+
* @param buffX - The amount to scroll
|
|
56
|
+
* @param buffY - The amount to scroll
|
|
57
|
+
*/
|
|
58
|
+
scrollView(buffX: number, buffY: number): void;
|
|
59
|
+
onLineDragStart(line: RGLine, e: RGUserEvent): void;
|
|
60
|
+
onLineDragEnd(x_buff: number, y_buff: number, e: RGUserEvent): void;
|
|
61
|
+
onCanvasDragStart(e: RGUserEvent): void;
|
|
62
|
+
startMoveCanvas(e: RGUserEvent, forceStartMove?: boolean): void;
|
|
63
|
+
protected onCanvasDragging(newX: number, newY: number, buffX: number, buffY: number): void;
|
|
64
|
+
onCanvasDragStop(x_buff: number, y_buff: number, e: RGUserEvent): void;
|
|
65
|
+
startCreateSelection(e: RGUserEvent): void;
|
|
66
|
+
private _fullscreenchangeHandler;
|
|
67
|
+
addFullscreenListener(): void;
|
|
68
|
+
removeFullscreenListener(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Sleep for a specified amount of time
|
|
71
|
+
* @param time - The time to sleep in milliseconds
|
|
72
|
+
*/
|
|
73
|
+
sleep(time: number): Promise<void>;
|
|
74
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
}
|