@logicflow/core 1.1.0-alpha.0 → 1.1.0-alpha.4
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/dist/logic-flow.js +2 -2
- package/package.json +1 -1
- package/types/LogicFlow.d.ts +26 -0
- package/types/constant/constant.d.ts +2 -1
- package/types/model/BaseModel.d.ts +1 -0
- package/types/model/GraphModel.d.ts +20 -2
- package/types/model/edge/BaseEdgeModel.d.ts +1 -0
- package/types/model/node/BaseNodeModel.d.ts +4 -2
package/package.json
CHANGED
package/types/LogicFlow.d.ts
CHANGED
|
@@ -147,6 +147,16 @@ export default class LogicFlow {
|
|
|
147
147
|
* @param id 元素id
|
|
148
148
|
*/
|
|
149
149
|
deleteElement(id: any): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* 获取节点或边对象
|
|
152
|
+
* @param id id
|
|
153
|
+
*/
|
|
154
|
+
getModelById(id: string): _Model.BaseNodeModel | _Model.BaseEdgeModel;
|
|
155
|
+
/**
|
|
156
|
+
* 获取节点或边的数据
|
|
157
|
+
* @param id id
|
|
158
|
+
*/
|
|
159
|
+
getDataById(id: string): NodeConfig | EdgeConfig;
|
|
150
160
|
/**
|
|
151
161
|
* 修改指定节点类型
|
|
152
162
|
* @param id 节点id
|
|
@@ -261,6 +271,22 @@ export default class LogicFlow {
|
|
|
261
271
|
* @returns EdgeData
|
|
262
272
|
*/
|
|
263
273
|
getEdgeDataById(edgeId: string): EdgeData;
|
|
274
|
+
/**
|
|
275
|
+
* 获取所有以此节点为终点的边
|
|
276
|
+
*/
|
|
277
|
+
getNodeIncomingEdge(nodeId: any): any[];
|
|
278
|
+
/**
|
|
279
|
+
* 获取所有以此节点为起点的边
|
|
280
|
+
*/
|
|
281
|
+
getNodeOutgoingEdge(nodeId: any): any[];
|
|
282
|
+
/**
|
|
283
|
+
* 获取节点连接到的所有起始节点
|
|
284
|
+
*/
|
|
285
|
+
getNodeIncomingNode(nodeId: any): any[];
|
|
286
|
+
/**
|
|
287
|
+
* 获取节点连接到的所有目标节点
|
|
288
|
+
*/
|
|
289
|
+
getNodeOutgoingNode(nodeId: any): any[];
|
|
264
290
|
/**
|
|
265
291
|
* 显示节点、连线文本编辑框
|
|
266
292
|
* @param id 元素id
|
|
@@ -74,7 +74,8 @@ export declare enum EventType {
|
|
|
74
74
|
CONNECTION_NOT_ALLOWED = "connection:not-allowed",
|
|
75
75
|
HISTORY_CHANGE = "history:change",
|
|
76
76
|
TEXT_UPDATE = "text:update",
|
|
77
|
-
GRAPH_TRANSFORM = "graph:transform"
|
|
77
|
+
GRAPH_TRANSFORM = "graph:transform",
|
|
78
|
+
GRAPH_RENDERED = "graph:rendered"
|
|
78
79
|
}
|
|
79
80
|
export declare enum SegmentDirection {
|
|
80
81
|
HORIZONTAL = "horizontal",
|
|
@@ -2,7 +2,6 @@ import BaseNodeModel from './node/BaseNodeModel';
|
|
|
2
2
|
import BaseEdgeModel from './edge/BaseEdgeModel';
|
|
3
3
|
import EditConfigModel from './EditConfigModel';
|
|
4
4
|
import TransfromModel from './TransformModel';
|
|
5
|
-
import { IBaseModel } from './BaseModel';
|
|
6
5
|
import { OverlapMode } from '../constant/constant';
|
|
7
6
|
import { AdditionData, Point, NodeConfig, EdgeConfig, PointTuple, NodeMoveRule, GraphConfigData } from '../type';
|
|
8
7
|
import EventEmitter from '../event/eventEmitter';
|
|
@@ -115,6 +114,9 @@ declare class GraphModel {
|
|
|
115
114
|
model: BaseEdgeModel;
|
|
116
115
|
};
|
|
117
116
|
};
|
|
117
|
+
get modelsMap(): {
|
|
118
|
+
[key: string]: BaseNodeModel | BaseEdgeModel;
|
|
119
|
+
};
|
|
118
120
|
/**
|
|
119
121
|
* 基于zIndex对元素进行排序。
|
|
120
122
|
* todo: 性能优化
|
|
@@ -183,7 +185,7 @@ declare class GraphModel {
|
|
|
183
185
|
/**
|
|
184
186
|
* 获取节点或者边的model
|
|
185
187
|
*/
|
|
186
|
-
getElement(id: string):
|
|
188
|
+
getElement(id: string): BaseNodeModel | BaseEdgeModel | undefined;
|
|
187
189
|
/**
|
|
188
190
|
* 所有节点上所有边的model
|
|
189
191
|
*/
|
|
@@ -379,6 +381,22 @@ declare class GraphModel {
|
|
|
379
381
|
* @param type 边类型
|
|
380
382
|
*/
|
|
381
383
|
changeEdgeType(id: any, type: any): void;
|
|
384
|
+
/**
|
|
385
|
+
* 获取所有以此节点为终点的边
|
|
386
|
+
*/
|
|
387
|
+
getNodeIncomingEdge(nodeId: any): any[];
|
|
388
|
+
/**
|
|
389
|
+
* 获取所有以此节点为起点的边
|
|
390
|
+
*/
|
|
391
|
+
getNodeOutgoingEdge(nodeId: any): any[];
|
|
392
|
+
/**
|
|
393
|
+
* 获取节点连接到的所有起始节点
|
|
394
|
+
*/
|
|
395
|
+
getNodeIncomingNode(nodeId: any): any[];
|
|
396
|
+
/**
|
|
397
|
+
* 获取节点连接到的所有目标节点
|
|
398
|
+
*/
|
|
399
|
+
getNodeOutgoingNode(nodeId: any): any[];
|
|
382
400
|
/**
|
|
383
401
|
* 设置主题
|
|
384
402
|
* todo docs link
|
|
@@ -43,9 +43,11 @@ export default class BaseNodeModel implements IBaseNodeModel {
|
|
|
43
43
|
isDragging: boolean;
|
|
44
44
|
isHitable: boolean;
|
|
45
45
|
draggable: boolean;
|
|
46
|
+
visible: boolean;
|
|
46
47
|
graphModel: GraphModel;
|
|
47
48
|
zIndex: number;
|
|
48
49
|
state: number;
|
|
50
|
+
autoToFront: boolean;
|
|
49
51
|
readonly BaseType = ElementType.NODE;
|
|
50
52
|
modelType: ModelType;
|
|
51
53
|
additionStateData: AdditionData;
|
|
@@ -161,8 +163,8 @@ export default class BaseNodeModel implements IBaseNodeModel {
|
|
|
161
163
|
getBounds(): Bounds;
|
|
162
164
|
get anchors(): PointAnchor[];
|
|
163
165
|
addNodeMoveRules(fn: NodeMoveRule): void;
|
|
164
|
-
move(deltaX: any, deltaY: any, isignoreRule?: boolean):
|
|
165
|
-
moveTo(x: any, y: any, isignoreRule?: boolean):
|
|
166
|
+
move(deltaX: any, deltaY: any, isignoreRule?: boolean): boolean;
|
|
167
|
+
moveTo(x: any, y: any, isignoreRule?: boolean): boolean;
|
|
166
168
|
moveText(deltaX: any, deltaY: any): void;
|
|
167
169
|
updateText(value: string): void;
|
|
168
170
|
setSelected(flag?: boolean): void;
|