ice-render 0.0.46 → 1.0.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.
@@ -1,6 +1,5 @@
1
1
  import ICEEvent from '../../event/ICEEvent';
2
2
  import ICEBoundingBox from '../../geometry/ICEBoundingBox';
3
- import ICEComponent from '../ICEComponent';
4
3
  import ICEDotPath from '../ICEDotPath';
5
4
  /**
6
5
  *
@@ -23,28 +22,19 @@ declare class ICEPolyLine extends ICEDotPath {
23
22
  * 仅供内部使用,业务代码不可依赖此属性
24
23
  */
25
24
  isLine: boolean;
26
- /**
27
- * 数据结构:
28
- * {
29
- * start:{componnet:ICEComponent,position:'T'},
30
- * end:{component:ICEComponent,position:'B'}
31
- * }
32
- * !注意:此结构与 state 上的 links 结构不同,state.links 只存 id,position 信息,而且会被序列化,此结构不会被序列化。
33
- */
34
- protected links: any;
35
25
  /**
36
26
  * @cfg
37
27
  * {
38
- * lineType: 'solid', //可能的取值:solid, dashed
39
- * arrow: 'none', //可能的取值:none, start, end ,both
40
- * arrowLength: 15, //箭头长度
41
- * arrowAngel: 30, //箭头角度
42
- * lineWidth:2, //线条宽度
43
- * closePath:false, //连线默认不闭合路径
44
- * points:[], //线条上所有点的坐标
45
- * links:{ //如果传递了连接关系参数,则在渲染器完成一轮渲染之后,会自动与指定的组件建立连接关系。
46
- * start:{id,position},
47
- * end:{id,position}
28
+ * lineType: 'solid', //可能的取值:solid, dashed
29
+ * arrow: 'none', //可能的取值:none, start, end ,both
30
+ * arrowLength: 15, //箭头长度
31
+ * arrowAngel: 30, //箭头角度
32
+ * lineWidth:2, //线条宽度
33
+ * closePath:false, //连线默认不闭合路径
34
+ * points:[], //线条上所有点的坐标
35
+ * links:{ //如果传递了连接关系参数,ICEPolyLine 会自动与指定的组件建立连接关系。
36
+ * start:{id:null,position:null},
37
+ * end:{id:null,position:null}
48
38
  * }
49
39
  * }
50
40
  *
@@ -65,9 +55,22 @@ declare class ICEPolyLine extends ICEDotPath {
65
55
  */
66
56
  protected initEvents(): void;
67
57
  protected afterAddHandler(evt?: ICEEvent): void;
68
- protected makeConnection(): void;
69
- setLink(terminal: string, component: ICEComponent, position: string): void;
70
- removeLink(terminal: string, component: ICEComponent, position: string): void;
58
+ /**
59
+ * @method syncConnections 同步连接关系
60
+ *
61
+ * - 根据 this.state.links 的数据结构,建立或者删除连接关系。
62
+ * - 此方法会在 setState() 中被调用,所以此方法内部不能调用 setState(),否则会死循环。如果需要修改 state ,直接赋值。
63
+ *
64
+ */
65
+ protected syncConnections(): void;
66
+ protected createLink(id: string, position: string): void;
67
+ /**
68
+ * @method removeLink 删除连接关系
69
+ * @param terminal 可以为 start 或者 end ,如果只提供了 terminal 参数,则删除此端点上的所有连接关系。
70
+ * @param id 连接终点的组件 id
71
+ * @param position 连接终点的组件的位置,可以为 TRBL
72
+ */
73
+ protected removeLink(terminal: string, id?: string, position?: string): void;
71
74
  /**
72
75
  * @method getLinkFromId
73
76
  * 获取起点组件 id ,如果没有建立连接,则返回 null
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "大漠穷秋",
3
3
  "name": "ice-render",
4
- "version": "0.0.46",
4
+ "version": "1.0.2",
5
5
  "description": "A canvas engine for interactive graphics.",
6
6
  "repository": "https://gitee.com/ice-render/ice-render",
7
7
  "module": "dist/index.js",