@logicflow/core 2.0.11 → 2.0.13

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/es/LogicFlow.d.ts CHANGED
@@ -263,6 +263,11 @@ export declare class LogicFlow {
263
263
  * @param toFront 是否将选中的元素置顶,默认为true
264
264
  */
265
265
  selectElementById(id: string, multiple?: boolean, toFront?: boolean): void;
266
+ /**
267
+ * 移除选中的元素
268
+ * @param id 元素ID
269
+ */
270
+ deselectElementById(id: string): void;
266
271
  /**
267
272
  * 获取选中的元素数据
268
273
  * @param isIgnoreCheck 是否包括sourceNode和targetNode没有被选中的边,默认包括。
package/es/LogicFlow.js CHANGED
@@ -640,6 +640,13 @@ var LogicFlow = /** @class */ (function () {
640
640
  this.graphModel.toFront(id);
641
641
  }
642
642
  };
643
+ /**
644
+ * 移除选中的元素
645
+ * @param id 元素ID
646
+ */
647
+ LogicFlow.prototype.deselectElementById = function (id) {
648
+ this.graphModel.deselectElementById(id);
649
+ };
643
650
  /**
644
651
  * 获取选中的元素数据
645
652
  * @param isIgnoreCheck 是否包括sourceNode和targetNode没有被选中的边,默认包括。
@@ -64,6 +64,8 @@ export declare enum EventType {
64
64
  EDGE_CONTEXTMENU = "edge:contextmenu",
65
65
  EDGE_ADJUST = "edge:adjust",
66
66
  EDGE_EXCHANGE_NODE = "edge:exchange-node",
67
+ ANCHOR_CLICK = "anchor:click",
68
+ ANCHOR_MOUSEDOWN = "anchor:mousedown",
67
69
  ANCHOR_DRAGSTART = "anchor:dragstart",
68
70
  ANCHOR_DRAG = "anchor:drag",
69
71
  ANCHOR_DROP = "anchor:drop",
@@ -72,6 +72,8 @@ export var EventType;
72
72
  EventType["EDGE_ADJUST"] = "edge:adjust";
73
73
  EventType["EDGE_EXCHANGE_NODE"] = "edge:exchange-node";
74
74
  // Anchor events
75
+ EventType["ANCHOR_CLICK"] = "anchor:click";
76
+ EventType["ANCHOR_MOUSEDOWN"] = "anchor:mousedown";
75
77
  EventType["ANCHOR_DRAGSTART"] = "anchor:dragstart";
76
78
  EventType["ANCHOR_DRAG"] = "anchor:drag";
77
79
  EventType["ANCHOR_DROP"] = "anchor:drop";
@@ -382,6 +382,14 @@ type AnchorEventArgsPick<T extends 'data' | 'e' | 'nodeModel' | 'edgeModel'> = P
382
382
  * 锚点事件
383
383
  */
384
384
  interface AnchorEventArgs {
385
+ /**
386
+ * anchor 锚点 click
387
+ */
388
+ 'anchor:click': AnchorEventArgsPick<'data' | 'e' | 'nodeModel'>;
389
+ /**
390
+ * anchor 锚点 mousedown
391
+ */
392
+ 'anchor:mousedown': AnchorEventArgsPick<'data' | 'e' | 'nodeModel'>;
385
393
  /**
386
394
  * 开始拖拽锚点
387
395
  */
@@ -322,6 +322,7 @@ export declare class GraphModel {
322
322
  * @param multiple 是否允许多选,如果为true,不会将上一个选中的元素重置
323
323
  */
324
324
  selectElementById(id: string, multiple?: boolean): void;
325
+ deselectElementById(id: string): void;
325
326
  /**
326
327
  * 将所有选中的元素设置为非选中
327
328
  */
@@ -1054,6 +1054,12 @@ var GraphModel = /** @class */ (function () {
1054
1054
  var selectElement = this.getElement(id);
1055
1055
  selectElement === null || selectElement === void 0 ? void 0 : selectElement.setSelected(true);
1056
1056
  };
1057
+ GraphModel.prototype.deselectElementById = function (id) {
1058
+ var element = this.getElement(id);
1059
+ if (element) {
1060
+ element.setSelected(false);
1061
+ }
1062
+ };
1057
1063
  /**
1058
1064
  * 将所有选中的元素设置为非选中
1059
1065
  */
@@ -1464,6 +1470,9 @@ var GraphModel = /** @class */ (function () {
1464
1470
  __decorate([
1465
1471
  observable
1466
1472
  ], GraphModel.prototype, "height", void 0);
1473
+ __decorate([
1474
+ observable
1475
+ ], GraphModel.prototype, "theme", void 0);
1467
1476
  __decorate([
1468
1477
  observable
1469
1478
  ], GraphModel.prototype, "grid", void 0);
@@ -1587,6 +1596,9 @@ var GraphModel = /** @class */ (function () {
1587
1596
  __decorate([
1588
1597
  action
1589
1598
  ], GraphModel.prototype, "selectElementById", null);
1599
+ __decorate([
1600
+ action
1601
+ ], GraphModel.prototype, "deselectElementById", null);
1590
1602
  __decorate([
1591
1603
  action
1592
1604
  ], GraphModel.prototype, "clearSelectElements", null);
@@ -208,6 +208,9 @@ var BezierEdgeModel = /** @class */ (function (_super) {
208
208
  this.pointsList = [startPoint, sNext, ePre, endPoint];
209
209
  this.initPoints();
210
210
  };
211
+ __decorate([
212
+ observable
213
+ ], BezierEdgeModel.prototype, "offset", void 0);
211
214
  __decorate([
212
215
  observable
213
216
  ], BezierEdgeModel.prototype, "path", void 0);
@@ -553,6 +553,9 @@ var PolylineEdgeModel = /** @class */ (function (_super) {
553
553
  }, sourceNode, targetNode, this.offset || 0);
554
554
  this.initPoints();
555
555
  };
556
+ __decorate([
557
+ observable
558
+ ], PolylineEdgeModel.prototype, "offset", void 0);
556
559
  __decorate([
557
560
  observable
558
561
  ], PolylineEdgeModel.prototype, "dbClickPosition", void 0);
package/es/view/Anchor.js CHANGED
@@ -294,10 +294,23 @@ var Anchor = /** @class */ (function (_super) {
294
294
  Anchor.prototype.render = function () {
295
295
  var _this = this;
296
296
  var _a = this.state, startX = _a.startX, startY = _a.startY, endX = _a.endX, endY = _a.endY;
297
- var _b = this.props, edgeAddable = _b.anchorData.edgeAddable, edgeStyle = _b.edgeStyle;
297
+ var _b = this.props, anchorData = _b.anchorData, edgeStyle = _b.edgeStyle, nodeModel = _b.nodeModel, graphModel = _b.graphModel;
298
+ var edgeAddable = anchorData.edgeAddable;
298
299
  return (
299
300
  // className="lf-anchor" 作为下载时,需要将锚点删除的依据,不要修改类名
300
- _jsxs("g", { className: "lf-anchor", children: [_jsx("g", { onMouseDown: function (ev) {
301
+ _jsxs("g", { className: "lf-anchor", children: [_jsx("g", { onClick: function (ev) {
302
+ ev.stopPropagation();
303
+ graphModel.eventCenter.emit(EventType.ANCHOR_CLICK, {
304
+ data: anchorData,
305
+ e: ev,
306
+ nodeModel: nodeModel,
307
+ });
308
+ }, onMouseDown: function (ev) {
309
+ graphModel.eventCenter.emit(EventType.ANCHOR_MOUSEDOWN, {
310
+ data: anchorData,
311
+ e: ev,
312
+ nodeModel: nodeModel,
313
+ });
301
314
  if (edgeAddable !== false) {
302
315
  _this.dragHandler.handleMouseDown(ev);
303
316
  }
@@ -43,6 +43,7 @@ export declare class ResizeControl extends Component<IResizeControlProps, IResiz
43
43
  */
44
44
  recalcResizeInfo: (index: ResizeControlIndex, resizeInfo: ResizeInfo, pct?: number, freezeWidth?: boolean, freezeHeight?: boolean) => ResizeInfo;
45
45
  resizeNode: ({ deltaX, deltaY }: VectorData) => void;
46
+ onDragStart: () => void;
46
47
  onDragging: ({ deltaX, deltaY }: IDragParams) => void;
47
48
  onDragEnd: () => void;
48
49
  render(): h.JSX.Element;
@@ -280,6 +280,9 @@ var ResizeControl = /** @class */ (function (_super) {
280
280
  // // 触发 resize 事件
281
281
  // this.triggerResizeEvent(preNodeData, curNodeData, deltaX, deltaY, this.index, this.nodeModel)
282
282
  };
283
+ _this.onDragStart = function () {
284
+ _this.graphModel.selectNodeById(_this.nodeModel.id);
285
+ };
283
286
  _this.onDragging = function (_a) {
284
287
  var deltaX = _a.deltaX, deltaY = _a.deltaY;
285
288
  var transformModel = _this.graphModel.transformModel;
@@ -309,6 +312,7 @@ var ResizeControl = /** @class */ (function (_super) {
309
312
  _this.graphModel = graphModel;
310
313
  // 初始化拖拽工具
311
314
  _this.dragHandler = new StepDrag({
315
+ onDragStart: _this.onDragStart,
312
316
  onDragging: _this.onDragging,
313
317
  onDragEnd: _this.onDragEnd,
314
318
  step: graphModel.gridSize,
@@ -263,6 +263,11 @@ export declare class LogicFlow {
263
263
  * @param toFront 是否将选中的元素置顶,默认为true
264
264
  */
265
265
  selectElementById(id: string, multiple?: boolean, toFront?: boolean): void;
266
+ /**
267
+ * 移除选中的元素
268
+ * @param id 元素ID
269
+ */
270
+ deselectElementById(id: string): void;
266
271
  /**
267
272
  * 获取选中的元素数据
268
273
  * @param isIgnoreCheck 是否包括sourceNode和targetNode没有被选中的边,默认包括。
package/lib/LogicFlow.js CHANGED
@@ -669,6 +669,13 @@ var LogicFlow = /** @class */ (function () {
669
669
  this.graphModel.toFront(id);
670
670
  }
671
671
  };
672
+ /**
673
+ * 移除选中的元素
674
+ * @param id 元素ID
675
+ */
676
+ LogicFlow.prototype.deselectElementById = function (id) {
677
+ this.graphModel.deselectElementById(id);
678
+ };
672
679
  /**
673
680
  * 获取选中的元素数据
674
681
  * @param isIgnoreCheck 是否包括sourceNode和targetNode没有被选中的边,默认包括。
@@ -64,6 +64,8 @@ export declare enum EventType {
64
64
  EDGE_CONTEXTMENU = "edge:contextmenu",
65
65
  EDGE_ADJUST = "edge:adjust",
66
66
  EDGE_EXCHANGE_NODE = "edge:exchange-node",
67
+ ANCHOR_CLICK = "anchor:click",
68
+ ANCHOR_MOUSEDOWN = "anchor:mousedown",
67
69
  ANCHOR_DRAGSTART = "anchor:dragstart",
68
70
  ANCHOR_DRAG = "anchor:drag",
69
71
  ANCHOR_DROP = "anchor:drop",
@@ -75,6 +75,8 @@ var EventType;
75
75
  EventType["EDGE_ADJUST"] = "edge:adjust";
76
76
  EventType["EDGE_EXCHANGE_NODE"] = "edge:exchange-node";
77
77
  // Anchor events
78
+ EventType["ANCHOR_CLICK"] = "anchor:click";
79
+ EventType["ANCHOR_MOUSEDOWN"] = "anchor:mousedown";
78
80
  EventType["ANCHOR_DRAGSTART"] = "anchor:dragstart";
79
81
  EventType["ANCHOR_DRAG"] = "anchor:drag";
80
82
  EventType["ANCHOR_DROP"] = "anchor:drop";
@@ -382,6 +382,14 @@ type AnchorEventArgsPick<T extends 'data' | 'e' | 'nodeModel' | 'edgeModel'> = P
382
382
  * 锚点事件
383
383
  */
384
384
  interface AnchorEventArgs {
385
+ /**
386
+ * anchor 锚点 click
387
+ */
388
+ 'anchor:click': AnchorEventArgsPick<'data' | 'e' | 'nodeModel'>;
389
+ /**
390
+ * anchor 锚点 mousedown
391
+ */
392
+ 'anchor:mousedown': AnchorEventArgsPick<'data' | 'e' | 'nodeModel'>;
385
393
  /**
386
394
  * 开始拖拽锚点
387
395
  */
@@ -322,6 +322,7 @@ export declare class GraphModel {
322
322
  * @param multiple 是否允许多选,如果为true,不会将上一个选中的元素重置
323
323
  */
324
324
  selectElementById(id: string, multiple?: boolean): void;
325
+ deselectElementById(id: string): void;
325
326
  /**
326
327
  * 将所有选中的元素设置为非选中
327
328
  */
@@ -1060,6 +1060,12 @@ var GraphModel = /** @class */ (function () {
1060
1060
  var selectElement = this.getElement(id);
1061
1061
  selectElement === null || selectElement === void 0 ? void 0 : selectElement.setSelected(true);
1062
1062
  };
1063
+ GraphModel.prototype.deselectElementById = function (id) {
1064
+ var element = this.getElement(id);
1065
+ if (element) {
1066
+ element.setSelected(false);
1067
+ }
1068
+ };
1063
1069
  /**
1064
1070
  * 将所有选中的元素设置为非选中
1065
1071
  */
@@ -1470,6 +1476,9 @@ var GraphModel = /** @class */ (function () {
1470
1476
  __decorate([
1471
1477
  mobx_1.observable
1472
1478
  ], GraphModel.prototype, "height", void 0);
1479
+ __decorate([
1480
+ mobx_1.observable
1481
+ ], GraphModel.prototype, "theme", void 0);
1473
1482
  __decorate([
1474
1483
  mobx_1.observable
1475
1484
  ], GraphModel.prototype, "grid", void 0);
@@ -1593,6 +1602,9 @@ var GraphModel = /** @class */ (function () {
1593
1602
  __decorate([
1594
1603
  mobx_1.action
1595
1604
  ], GraphModel.prototype, "selectElementById", null);
1605
+ __decorate([
1606
+ mobx_1.action
1607
+ ], GraphModel.prototype, "deselectElementById", null);
1596
1608
  __decorate([
1597
1609
  mobx_1.action
1598
1610
  ], GraphModel.prototype, "clearSelectElements", null);
@@ -214,6 +214,9 @@ var BezierEdgeModel = /** @class */ (function (_super) {
214
214
  this.pointsList = [startPoint, sNext, ePre, endPoint];
215
215
  this.initPoints();
216
216
  };
217
+ __decorate([
218
+ mobx_1.observable
219
+ ], BezierEdgeModel.prototype, "offset", void 0);
217
220
  __decorate([
218
221
  mobx_1.observable
219
222
  ], BezierEdgeModel.prototype, "path", void 0);
@@ -556,6 +556,9 @@ var PolylineEdgeModel = /** @class */ (function (_super) {
556
556
  }, sourceNode, targetNode, this.offset || 0);
557
557
  this.initPoints();
558
558
  };
559
+ __decorate([
560
+ mobx_1.observable
561
+ ], PolylineEdgeModel.prototype, "offset", void 0);
559
562
  __decorate([
560
563
  mobx_1.observable
561
564
  ], PolylineEdgeModel.prototype, "dbClickPosition", void 0);
@@ -296,10 +296,23 @@ var Anchor = /** @class */ (function (_super) {
296
296
  Anchor.prototype.render = function () {
297
297
  var _this = this;
298
298
  var _a = this.state, startX = _a.startX, startY = _a.startY, endX = _a.endX, endY = _a.endY;
299
- var _b = this.props, edgeAddable = _b.anchorData.edgeAddable, edgeStyle = _b.edgeStyle;
299
+ var _b = this.props, anchorData = _b.anchorData, edgeStyle = _b.edgeStyle, nodeModel = _b.nodeModel, graphModel = _b.graphModel;
300
+ var edgeAddable = anchorData.edgeAddable;
300
301
  return (
301
302
  // className="lf-anchor" 作为下载时,需要将锚点删除的依据,不要修改类名
302
- (0, jsx_runtime_1.jsxs)("g", { className: "lf-anchor", children: [(0, jsx_runtime_1.jsx)("g", { onMouseDown: function (ev) {
303
+ (0, jsx_runtime_1.jsxs)("g", { className: "lf-anchor", children: [(0, jsx_runtime_1.jsx)("g", { onClick: function (ev) {
304
+ ev.stopPropagation();
305
+ graphModel.eventCenter.emit(constant_1.EventType.ANCHOR_CLICK, {
306
+ data: anchorData,
307
+ e: ev,
308
+ nodeModel: nodeModel,
309
+ });
310
+ }, onMouseDown: function (ev) {
311
+ graphModel.eventCenter.emit(constant_1.EventType.ANCHOR_MOUSEDOWN, {
312
+ data: anchorData,
313
+ e: ev,
314
+ nodeModel: nodeModel,
315
+ });
303
316
  if (edgeAddable !== false) {
304
317
  _this.dragHandler.handleMouseDown(ev);
305
318
  }
@@ -43,6 +43,7 @@ export declare class ResizeControl extends Component<IResizeControlProps, IResiz
43
43
  */
44
44
  recalcResizeInfo: (index: ResizeControlIndex, resizeInfo: ResizeInfo, pct?: number, freezeWidth?: boolean, freezeHeight?: boolean) => ResizeInfo;
45
45
  resizeNode: ({ deltaX, deltaY }: VectorData) => void;
46
+ onDragStart: () => void;
46
47
  onDragging: ({ deltaX, deltaY }: IDragParams) => void;
47
48
  onDragEnd: () => void;
48
49
  render(): h.JSX.Element;
@@ -283,6 +283,9 @@ var ResizeControl = /** @class */ (function (_super) {
283
283
  // // 触发 resize 事件
284
284
  // this.triggerResizeEvent(preNodeData, curNodeData, deltaX, deltaY, this.index, this.nodeModel)
285
285
  };
286
+ _this.onDragStart = function () {
287
+ _this.graphModel.selectNodeById(_this.nodeModel.id);
288
+ };
286
289
  _this.onDragging = function (_a) {
287
290
  var deltaX = _a.deltaX, deltaY = _a.deltaY;
288
291
  var transformModel = _this.graphModel.transformModel;
@@ -312,6 +315,7 @@ var ResizeControl = /** @class */ (function (_super) {
312
315
  _this.graphModel = graphModel;
313
316
  // 初始化拖拽工具
314
317
  _this.dragHandler = new util_1.StepDrag({
318
+ onDragStart: _this.onDragStart,
315
319
  onDragging: _this.onDragging,
316
320
  onDragEnd: _this.onDragEnd,
317
321
  step: graphModel.gridSize,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logicflow/core",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "LogicFlow, help you quickly create flowcharts",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
package/src/LogicFlow.tsx CHANGED
@@ -733,6 +733,14 @@ export class LogicFlow {
733
733
  }
734
734
  }
735
735
 
736
+ /**
737
+ * 移除选中的元素
738
+ * @param id 元素ID
739
+ */
740
+ deselectElementById(id: string) {
741
+ this.graphModel.deselectElementById(id)
742
+ }
743
+
736
744
  /**
737
745
  * 获取选中的元素数据
738
746
  * @param isIgnoreCheck 是否包括sourceNode和targetNode没有被选中的边,默认包括。
@@ -1817,7 +1825,7 @@ export namespace LogicFlow {
1817
1825
  * 基础图形线相关主题
1818
1826
  */
1819
1827
  line: EdgeTheme // 直线样式
1820
- polyline: EdgePolylineTheme // 折现样式
1828
+ polyline: EdgePolylineTheme // 折线样式
1821
1829
  bezier: EdgeBezierTheme // 贝塞尔曲线样式
1822
1830
  anchorLine: AnchorLineTheme // 从锚点拉出的边的样式
1823
1831
 
@@ -79,6 +79,8 @@ export enum EventType {
79
79
  EDGE_EXCHANGE_NODE = 'edge:exchange-node',
80
80
 
81
81
  // Anchor events
82
+ ANCHOR_CLICK = 'anchor:click',
83
+ ANCHOR_MOUSEDOWN = 'anchor:mousedown',
82
84
  ANCHOR_DRAGSTART = 'anchor:dragstart',
83
85
  ANCHOR_DRAG = 'anchor:drag',
84
86
  ANCHOR_DROP = 'anchor:drop',
@@ -469,6 +469,14 @@ type AnchorEventArgsPick<T extends 'data' | 'e' | 'nodeModel' | 'edgeModel'> =
469
469
  * 锚点事件
470
470
  */
471
471
  interface AnchorEventArgs {
472
+ /**
473
+ * anchor 锚点 click
474
+ */
475
+ 'anchor:click': AnchorEventArgsPick<'data' | 'e' | 'nodeModel'>
476
+ /**
477
+ * anchor 锚点 mousedown
478
+ */
479
+ 'anchor:mousedown': AnchorEventArgsPick<'data' | 'e' | 'nodeModel'>
472
480
  /**
473
481
  * 开始拖拽锚点
474
482
  */
@@ -63,7 +63,7 @@ export class GraphModel {
63
63
  @observable height: number // 画布高度
64
64
 
65
65
  // 流程图主题配置
66
- theme: LogicFlow.Theme
66
+ @observable theme: LogicFlow.Theme
67
67
  // 网格配置
68
68
  @observable grid: Grid.GridOptions
69
69
  // 事件中心
@@ -1197,6 +1197,14 @@ export class GraphModel {
1197
1197
  selectElement?.setSelected(true)
1198
1198
  }
1199
1199
 
1200
+ @action
1201
+ deselectElementById(id: string) {
1202
+ const element = this.getElement(id)
1203
+ if (element) {
1204
+ element.setSelected(false)
1205
+ }
1206
+ }
1207
+
1200
1208
  /**
1201
1209
  * 将所有选中的元素设置为非选中
1202
1210
  */
@@ -13,7 +13,7 @@ import EdgeConfig = LogicFlow.EdgeConfig
13
13
  export class BezierEdgeModel extends BaseEdgeModel {
14
14
  modelType = ModelType.BEZIER_EDGE
15
15
 
16
- offset!: number
16
+ @observable offset!: number
17
17
  @observable path = ''
18
18
  constructor(data: EdgeConfig, graphModel: GraphModel) {
19
19
  super(data, graphModel)
@@ -30,7 +30,7 @@ import AnchorConfig = Model.AnchorConfig
30
30
  export class PolylineEdgeModel extends BaseEdgeModel {
31
31
  modelType = ModelType.POLYLINE_EDGE
32
32
  draggingPointList: Point[] = []
33
- offset?: number
33
+ @observable offset?: number
34
34
  @observable dbClickPosition?: Point
35
35
 
36
36
  initEdgeData(data: LogicFlow.EdgeConfig): void {
@@ -361,15 +361,26 @@ class Anchor extends Component<IProps, IState> {
361
361
 
362
362
  render() {
363
363
  const { startX, startY, endX, endY } = this.state
364
- const {
365
- anchorData: { edgeAddable },
366
- edgeStyle,
367
- } = this.props
364
+ const { anchorData, edgeStyle, nodeModel, graphModel } = this.props
365
+ const { edgeAddable } = anchorData
368
366
  return (
369
367
  // className="lf-anchor" 作为下载时,需要将锚点删除的依据,不要修改类名
370
368
  <g className="lf-anchor">
371
369
  <g
370
+ onClick={(ev) => {
371
+ ev.stopPropagation()
372
+ graphModel.eventCenter.emit(EventType.ANCHOR_CLICK, {
373
+ data: anchorData,
374
+ e: ev!,
375
+ nodeModel,
376
+ })
377
+ }}
372
378
  onMouseDown={(ev) => {
379
+ graphModel.eventCenter.emit(EventType.ANCHOR_MOUSEDOWN, {
380
+ data: anchorData,
381
+ e: ev!,
382
+ nodeModel,
383
+ })
373
384
  if (edgeAddable !== false) {
374
385
  this.dragHandler.handleMouseDown(ev)
375
386
  }
@@ -50,6 +50,7 @@ export class ResizeControl extends Component<
50
50
 
51
51
  // 初始化拖拽工具
52
52
  this.dragHandler = new StepDrag({
53
+ onDragStart: this.onDragStart,
53
54
  onDragging: this.onDragging,
54
55
  onDragEnd: this.onDragEnd,
55
56
  step: graphModel.gridSize,
@@ -317,6 +318,10 @@ export class ResizeControl extends Component<
317
318
  // this.triggerResizeEvent(preNodeData, curNodeData, deltaX, deltaY, this.index, this.nodeModel)
318
319
  }
319
320
 
321
+ onDragStart = () => {
322
+ this.graphModel.selectNodeById(this.nodeModel.id)
323
+ }
324
+
320
325
  onDragging = ({ deltaX, deltaY }: IDragParams) => {
321
326
  const { transformModel } = this.graphModel
322
327
  const [dx, dy] = transformModel.fixDeltaXY(deltaX, deltaY)