ronds-metadata 1.3.1 → 1.3.2
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.
@@ -79,4 +79,4 @@ declare class DPGraph extends GraphCore<BaseNode, BaseEdge> {
|
|
79
79
|
export declare let gDPGraph: DPGraph;
|
80
80
|
export default DPGraph;
|
81
81
|
export declare const useDPGraph: (graphData?: NDPGraph.GraphData) => DPGraph;
|
82
|
-
export declare const useUnmountDPGraph: () => void;
|
82
|
+
export declare const useUnmountDPGraph: (dispose: boolean) => void;
|
@@ -13,7 +13,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
13
13
|
/*
|
14
14
|
* @Author: wangxian
|
15
15
|
* @Date: 2022-05-24 14:31:01
|
16
|
-
* @LastEditTime: 2023-08-
|
16
|
+
* @LastEditTime: 2023-08-28 17:02:15
|
17
17
|
*/
|
18
18
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
19
19
|
import produce from 'immer';
|
@@ -797,10 +797,12 @@ export var useDPGraph = function useDPGraph(graphData) {
|
|
797
797
|
gDPGraph = new DPGraph(graphData);
|
798
798
|
return gDPGraph;
|
799
799
|
};
|
800
|
-
export var useUnmountDPGraph = function useUnmountDPGraph() {
|
800
|
+
export var useUnmountDPGraph = function useUnmountDPGraph(dispose) {
|
801
801
|
React.useEffect(function () {
|
802
802
|
return function () {
|
803
|
-
|
803
|
+
if (dispose) {
|
804
|
+
gDPGraph.dispose();
|
805
|
+
}
|
804
806
|
};
|
805
|
-
}, []);
|
807
|
+
}, [dispose]);
|
806
808
|
};
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
3
|
/*
|
4
4
|
* @Author: wangxian
|
5
5
|
* @Date: 2022-05-16 18:53:31
|
6
|
-
* @LastEditTime: 2023-08-
|
6
|
+
* @LastEditTime: 2023-08-28 17:02:54
|
7
7
|
*/
|
8
8
|
import React from 'react';
|
9
9
|
import { filter } from 'rxjs';
|
@@ -18,6 +18,8 @@ import ContextMenu from './comps/ContextMenu';
|
|
18
18
|
import { GraphHandler } from './comps/GraphHandler';
|
19
19
|
var DynamicPorts = function DynamicPorts(props) {
|
20
20
|
var defaultValue = props.defaultValue,
|
21
|
+
_props$dispose = props.dispose,
|
22
|
+
dispose = _props$dispose === void 0 ? true : _props$dispose,
|
21
23
|
onChange = props.onChange,
|
22
24
|
onNodeSelect = props.onNodeSelect,
|
23
25
|
onStatusClick = props.onStatusClick,
|
@@ -31,7 +33,7 @@ var DynamicPorts = function DynamicPorts(props) {
|
|
31
33
|
var dpGraphRef = React.useRef();
|
32
34
|
var firstLoadRef = React.useRef(true);
|
33
35
|
// 处理画布卸载
|
34
|
-
useUnmountDPGraph();
|
36
|
+
useUnmountDPGraph(dispose);
|
35
37
|
var resizeSensorRef = React.useRef(null);
|
36
38
|
var onResizeStrategy = function onResizeStrategy() {
|
37
39
|
var _dpGraphRef$current, _dpGraphRef$current2;
|