ice-render 0.0.25 → 0.0.28

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.
@@ -4,17 +4,15 @@ import ICEComponent from '../ICEComponent';
4
4
  import ICEDotPath from '../ICEDotPath';
5
5
  /**
6
6
  *
7
- * @class ICEPolyLine
8
- *
9
- * 折线
7
+ * @class ICEPolyLine 折线
10
8
  *
11
9
  * 基本特征:
12
10
  *
13
- * - ICEPolyLine 由多个点构成,如果折线上的所有点共线,则折线在外观上退化成直线。
14
- * - ICEPolyLine 上至少存在 2 个点,否则无法画线。如果点数恰好为 2 ,折线退化成一条直线。
15
- * - ICEPolyLine 以及所有子类不能进行 transform 操作。
16
- * - ICEPolyLine 以及所有子类的 left/top 总是被设置为 startPoint
17
- * - ICEPolyLine 以及所有子类的原点都在 startPoint 上,而不在几何中心点。
11
+ * - ICEPolyLine 上至少存在 2 个点,否则 ICEPolyLine 自动填充。
12
+ * - ICEPolyLine 由多个点构成,如果折线上的所有点共线,则折线在外观上退化成直线。如果点数恰好为 2 ,折线退化成一条直线。
13
+ * - ICEPolyLine 以及所有子类不能进行 transform 操作,在 ICE 中,对线条进行矩阵变换是没有意义的。
14
+ * - ICEPolyLine 以及所有子类的 left/top 总是被设置为第 0 个点。
15
+ * - ICEPolyLine 以及所有子类的原点都在第 0 个点上,而不在几何中心点,这一特性与普通的 Component 不同。
18
16
  *
19
17
  * @author 大漠穷秋<damoqiongqiu@126.com>
20
18
  */
@@ -30,14 +28,17 @@ declare class ICEPolyLine extends ICEDotPath {
30
28
  /**
31
29
  * @cfg
32
30
  * {
33
- * lineType: 'solid', //solid, dashed
34
- * lineWidth:2,
35
- * arrowPosition: 'none', //none, start, end ,both
31
+ * lineType: 'solid', //可能的取值:solid, dashed
32
+ * arrowPosition: 'none', //可能的取值:none, start, end ,both
36
33
  * arrowLength: 15, //箭头长度
37
34
  * arrowAngel: 30, //箭头角度
35
+ * lineWidth:2, //线条宽度
38
36
  * closePath:false, //连线默认不闭合路径
39
- * points:[], //点的坐标
40
- * links:{start:{id,position},end:{id,position}} //如果传递了连接关系参数,则在渲染器完成一轮渲染之后,自动建立连接关系。
37
+ * points:[], //线条上所有点的坐标
38
+ * links:{ //如果传递了连接关系参数,则在渲染器完成一轮渲染之后,会自动与指定的组件建立连接关系。
39
+ * start:{id,position},
40
+ * end:{id,position}
41
+ * }
41
42
  * }
42
43
  *
43
44
  * @param props
@@ -113,7 +114,7 @@ declare class ICEPolyLine extends ICEDotPath {
113
114
  * @overwrite
114
115
  * @returns {ComponentParams}
115
116
  */
116
- calcComponentParams(): {
117
+ protected calcComponentParams(): {
117
118
  width: any;
118
119
  height: any;
119
120
  };
@@ -1,4 +1,4 @@
1
- import ICEPolyLine from '../line/ICEPolyLine';
1
+ import ICEPolyLine from './ICEPolyLine';
2
2
  /**
3
3
  * ! FIXME: 删掉对 GeoPoint/GeoLine/GeoUtil 的依赖
4
4
  * @class ICEVisioLink
@@ -33,7 +33,7 @@ declare class ICEIsogon extends ICEDotPath {
33
33
  * 在计算组件的原始尺寸时还没有确定原点坐标,所以只能基于组件本地坐标系的左上角 (0,0) 点进行计算。
34
34
  * @returns
35
35
  */
36
- calcComponentParams(): {
36
+ protected calcComponentParams(): {
37
37
  width: any;
38
38
  height: any;
39
39
  };
@@ -20,7 +20,7 @@ declare class ICERose extends ICEDotPath {
20
20
  * 在计算组件的原始尺寸时还没有确定原点坐标,所以只能基于组件本地坐标系的左上角 (0,0) 点进行计算。
21
21
  * @returns
22
22
  */
23
- calcComponentParams(): {
23
+ protected calcComponentParams(): {
24
24
  width: any;
25
25
  height: any;
26
26
  };
@@ -27,7 +27,7 @@ declare class ICEStar extends ICEDotPath {
27
27
  * 在计算组件的原始尺寸时还没有确定原点坐标,所以只能基于组件本地坐标系的左上角 (0,0) 点进行计算。
28
28
  * @returns
29
29
  */
30
- calcComponentParams(): {
30
+ protected calcComponentParams(): {
31
31
  width: any;
32
32
  height: any;
33
33
  };
@@ -19,7 +19,17 @@ declare class ICEText extends ICEComponent {
19
19
  * @param props
20
20
  */
21
21
  constructor(props?: any);
22
- protected initEvents(): void;
22
+ /**
23
+ * @overwrite
24
+ * 计算原始的宽高、位置,此时没有经过任何变换,也没有移动坐标原点。
25
+ * 此方法不能依赖原点位置和 transform 矩阵。
26
+ * 在计算组件的原始尺寸时还没有确定原点坐标,所以只能基于组件本地坐标系的左上角 (0,0) 点进行计算。
27
+ * @returns
28
+ */
29
+ protected calcComponentParams(): {
30
+ width: any;
31
+ height: any;
32
+ };
23
33
  /**
24
34
  * @method measureText
25
35
  *
@@ -27,7 +37,7 @@ declare class ICEText extends ICEComponent {
27
37
  * - 计算原始的宽高、位置,此时没有经过任何变换,也没有移动坐标原点。
28
38
  * - 在计算组件的原始尺寸时还没有确定原点坐标,所以只能基于组件本地坐标系的左上角 (0,0) 点进行计算。
29
39
  *
30
- * FIXME:这里有性能瓶颈
40
+ * FIXME:这里有性能瓶颈,需要进一步优化
31
41
  * FIXME:某些运行时环境可能不支持动态插入 HTML 标签,以上测量文本宽高的方法可能存在兼容性问题。
32
42
  * FIXME:对文本位置的控制需要更精细的计算方法。
33
43
  */
@@ -24,8 +24,8 @@ export { default as ICEComponent } from './graphic/ICEComponent';
24
24
  export { default as ICEDotPath } from './graphic/ICEDotPath';
25
25
  export { default as ICEImage } from './graphic/ICEImage';
26
26
  export { default as ICEPath } from './graphic/ICEPath';
27
- export { default as ICEBezier } from './graphic/line/ICEBezier';
28
- export { default as ICEPolyLine } from './graphic/line/ICEPolyLine';
27
+ export { default as ICEBezier } from './graphic/link/ICEBezier';
28
+ export { default as ICEPolyLine } from './graphic/link/ICEPolyLine';
29
29
  export { default as ICELinkHook } from './graphic/link/ICELinkHook';
30
30
  export { default as ICELinkSlot } from './graphic/link/ICELinkSlot';
31
31
  export { default as ICEVisioLink } from './graphic/link/ICEVisioLink';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "大漠穷秋",
3
3
  "name": "ice-render",
4
- "version": "0.0.25",
4
+ "version": "0.0.28",
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",