@antv/component 0.8.18 → 0.8.22
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/CHANGELOG.md +30 -0
- package/esm/abstract/component.js +1 -1
- package/esm/abstract/component.js.map +1 -1
- package/esm/abstract/html-component.d.ts +2 -40
- package/esm/abstract/html-component.js +0 -1
- package/esm/abstract/html-component.js.map +1 -1
- package/esm/annotation/html.d.ts +0 -35
- package/esm/axis/circle.d.ts +3 -3
- package/esm/axis/circle.js +22 -21
- package/esm/axis/circle.js.map +1 -1
- package/esm/crosshair/html.d.ts +0 -67
- package/esm/legend/category.d.ts +7 -0
- package/esm/legend/category.js +69 -19
- package/esm/legend/category.js.map +1 -1
- package/esm/tooltip/html.d.ts +0 -228
- package/esm/types.d.ts +17 -0
- package/esm/util/theme.js +1 -1
- package/esm/util/theme.js.map +1 -1
- package/lib/abstract/component.js +1 -1
- package/lib/abstract/component.js.map +1 -1
- package/lib/abstract/html-component.d.ts +2 -40
- package/lib/abstract/html-component.js +0 -1
- package/lib/abstract/html-component.js.map +1 -1
- package/lib/annotation/html.d.ts +0 -35
- package/lib/axis/circle.d.ts +3 -3
- package/lib/axis/circle.js +22 -21
- package/lib/axis/circle.js.map +1 -1
- package/lib/crosshair/html.d.ts +0 -67
- package/lib/legend/category.d.ts +7 -0
- package/lib/legend/category.js +69 -19
- package/lib/legend/category.js.map +1 -1
- package/lib/tooltip/html.d.ts +0 -228
- package/lib/types.d.ts +17 -0
- package/lib/util/theme.js +1 -1
- package/lib/util/theme.js.map +1 -1
- package/package.json +3 -3
- package/src/abstract/component.ts +1 -1
- package/src/abstract/html-component.ts +0 -1
- package/src/axis/circle.ts +27 -26
- package/src/legend/category.ts +101 -27
- package/src/types.ts +25 -7
- package/src/util/theme.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
#### 0.8.22 (2022-01-14)
|
|
2
|
+
|
|
3
|
+
##### Chores
|
|
4
|
+
|
|
5
|
+
- update g-base version ([#258](https://github.com/antvis/component/pull/258)) ([7d27acfe](https://github.com/antvis/component/commit/7d27acfe0e3a0d4fd0b19f9b018fd86c600bc6d2))
|
|
6
|
+
|
|
7
|
+
##### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **component:** set default value for defaultCfg ([#253](https://github.com/antvis/component/pull/253)) ([5372709d](https://github.com/antvis/component/commit/5372709daf740b17d711654a027e5d0dceeaf1c0))
|
|
10
|
+
- **legend:** 修复图例分页数量超过 100 后文字被遮挡 ([#254](https://github.com/antvis/component/pull/254)) ([bbaae5c0](https://github.com/antvis/component/commit/bbaae5c0f050171ceab358025da3453a546de93e))
|
|
11
|
+
|
|
12
|
+
#### 0.8.21 (2021-12-29)
|
|
13
|
+
|
|
14
|
+
##### New Features
|
|
15
|
+
|
|
16
|
+
- **legend:** 添加正反选按钮 ([#259](https://github.com/antvis/component/pull/259)) ([2e8c7563](https://github.com/antvis/component/commit/2e8c7563b5b3e7360613d15c064a0387a23f6ccf))
|
|
17
|
+
|
|
18
|
+
#### 0.8.20 (2021-11-03)
|
|
19
|
+
|
|
20
|
+
##### Bug Fixes
|
|
21
|
+
|
|
22
|
+
- 修复依赖 ([d2970f99](https://github.com/antvis/component/commit/d2970f991f18bca0db6ae7dd54903fd87e2b2809))
|
|
23
|
+
- unreachable code after return statement ([#244](https://github.com/antvis/component/pull/244)) ([b6f7bfef](https://github.com/antvis/component/commit/b6f7bfef3ffeb02dfd93f4926307bd0474ea738f))
|
|
24
|
+
|
|
25
|
+
#### 0.8.19 (2021-10-08)
|
|
26
|
+
|
|
27
|
+
##### Bug Fixes
|
|
28
|
+
|
|
29
|
+
- **axis:** 修复 circle axis 处理 vertical limit 不当 ([#250](https://github.com/antvis/component/pull/250)) ([dd5ecb81](https://github.com/antvis/component/commit/dd5ecb815cef72010b2cba2da6bab2ab58ed1bc8))
|
|
30
|
+
|
|
1
31
|
#### 0.8.18 (2021-10-07)
|
|
2
32
|
|
|
3
33
|
##### New Features
|
|
@@ -64,7 +64,7 @@ var Component = /** @class */ (function (_super) {
|
|
|
64
64
|
*/
|
|
65
65
|
Component.prototype.update = function (cfg) {
|
|
66
66
|
var _this = this;
|
|
67
|
-
var defaultCfg = this.get('defaultCfg');
|
|
67
|
+
var defaultCfg = this.get('defaultCfg') || {};
|
|
68
68
|
each(cfg, function (value, name) {
|
|
69
69
|
var originCfg = _this.get(name);
|
|
70
70
|
var newCfg = value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/abstract/component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG7D,IAAM,kBAAkB,GAAG;IACzB,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;IACjB,MAAM,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC;IACxB,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC;CACvD,CAAC;AAEF;IAAwE,6BAAI;IAC1E,mBAAY,GAAM;QAAlB,YACE,kBAAM,GAAG,CAAC,SAEX;QADC,KAAI,CAAC,OAAO,EAAE,CAAC;;IACjB,CAAC;IACD;;;;OAIG;IACI,iCAAa,GAApB;QACE,OAAO;YACL,EAAE,EAAE,EAAE;YACN,IAAI,EAAE,EAAE;YACR,IAAI,EAAE,EAAE;YACR,YAAY,EAAE,MAAM;YACpB,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,IAAI;YACb,gBAAgB,EAAE,KAAK;YACvB,aAAa,EAAE;gBACb,MAAM,EAAE,IAAI;gBACZ,MAAM,EA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C;QAC9C,IAAM,MAAM,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;QAChD,IAAI,CAAC,MAAM,EAAE,UAAC,KAAK;YACjB,QAAQ,CAAC,KAAK,CAAC,GAAG,KAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,0BAAM,GAAb;QACE,OAAO,KAAK,CAAC;IACf,CAAC;IAEM,4BAAQ,GAAf;QACE,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;OAGG;IACI,wBAAI,GAAX,cAAe,CAAC;IAmBhB,uBAAuB;IACf,2BAAO,GAAf;QAAA,iBASC;QARC,IAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1C,IAAI,CAAC,UAAU,EAAE,UAAC,KAAK,EAAE,IAAI;YAC3B,IAAM,GAAG,GAAG,KAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC3B,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE;gBACjB,IAAM,MAAM,GAAG,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;gBACvC,KAAI,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;aACxB;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACH,gBAAC;AAAD,CAAC,AA9KD,CAAwE,IAAI,GA8K3E;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -2,39 +2,6 @@ import { BBox, ComponentCfg, HtmlComponentCfg } from '../types';
|
|
|
2
2
|
import Component from './component';
|
|
3
3
|
declare abstract class HtmlComponent<T extends ComponentCfg = HtmlComponentCfg> extends Component<T> {
|
|
4
4
|
getDefaultCfg(): {
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
type: string;
|
|
8
|
-
locationType: string;
|
|
9
|
-
offsetX: number;
|
|
10
|
-
offsetY: number;
|
|
11
|
-
animate: boolean;
|
|
12
|
-
capture: boolean;
|
|
13
|
-
updateAutoRender: boolean;
|
|
14
|
-
animateOption: {
|
|
15
|
-
appear: any; /**
|
|
16
|
-
* 隐藏组件
|
|
17
|
-
*/
|
|
18
|
-
update: {
|
|
19
|
-
duration: number;
|
|
20
|
-
easing: string;
|
|
21
|
-
};
|
|
22
|
-
enter: {
|
|
23
|
-
duration: number; /**
|
|
24
|
-
* 是否允许捕捉事件
|
|
25
|
-
* @param capture 事件捕捉
|
|
26
|
-
*/
|
|
27
|
-
easing: string;
|
|
28
|
-
};
|
|
29
|
-
leave: {
|
|
30
|
-
duration: number;
|
|
31
|
-
easing: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
events: any;
|
|
35
|
-
defaultCfg: {};
|
|
36
|
-
visible: boolean;
|
|
37
|
-
} | {
|
|
38
5
|
container: any;
|
|
39
6
|
containerTpl: string;
|
|
40
7
|
updateAutoRender: boolean;
|
|
@@ -49,18 +16,13 @@ declare abstract class HtmlComponent<T extends ComponentCfg = HtmlComponentCfg>
|
|
|
49
16
|
animate: boolean;
|
|
50
17
|
capture: boolean;
|
|
51
18
|
animateOption: {
|
|
52
|
-
appear: any;
|
|
53
|
-
* 隐藏组件
|
|
54
|
-
*/
|
|
19
|
+
appear: any;
|
|
55
20
|
update: {
|
|
56
21
|
duration: number;
|
|
57
22
|
easing: string;
|
|
58
23
|
};
|
|
59
24
|
enter: {
|
|
60
|
-
duration: number;
|
|
61
|
-
* 是否允许捕捉事件
|
|
62
|
-
* @param capture 事件捕捉
|
|
63
|
-
*/
|
|
25
|
+
duration: number;
|
|
64
26
|
easing: string;
|
|
65
27
|
};
|
|
66
28
|
leave: {
|
|
@@ -11,7 +11,6 @@ var HtmlComponent = /** @class */ (function (_super) {
|
|
|
11
11
|
HtmlComponent.prototype.getDefaultCfg = function () {
|
|
12
12
|
var cfg = _super.prototype.getDefaultCfg.call(this);
|
|
13
13
|
return __assign(__assign({}, cfg), { container: null, containerTpl: '<div></div>', updateAutoRender: true, containerClassName: '', parent: null });
|
|
14
|
-
return cfg;
|
|
15
14
|
};
|
|
16
15
|
HtmlComponent.prototype.getContainer = function () {
|
|
17
16
|
return this.get('container');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html-component.js","sourceRoot":"","sources":["../../src/abstract/html-component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAC7D,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC;IAAgF,iCAAY;IAA5F;;
|
|
1
|
+
{"version":3,"file":"html-component.js","sourceRoot":"","sources":["../../src/abstract/html-component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAC7D,OAAO,SAAS,MAAM,aAAa,CAAC;AAEpC;IAAgF,iCAAY;IAA5F;;IAiMA,CAAC;IAhMQ,qCAAa,GAApB;QACE,IAAM,GAAG,GAAG,iBAAM,aAAa,WAAE,CAAC;QAClC,6BACK,GAAG,KACN,SAAS,EAAE,IAAI,EACf,YAAY,EAAE,aAAa,EAC3B,gBAAgB,EAAE,IAAI,EACtB,kBAAkB,EAAE,EAAE,EACtB,MAAM,EAAE,IAAI,IACZ;IACJ,CAAC;IAEM,oCAAY,GAAnB;QACE,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,CAA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;QACP,IAAI,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,EAAE;YAC5B,IAAI,CAAC,WAAW,EAAE,CAAC;YACnB,IAAI,CAAC,WAAW,EAAE,CAAC;SACpB;QACD,mBAAmB;QACnB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IACS,qCAAa,GAAvB,cAA2B,CAAC;IAAA,CAAC;IAC/B,oBAAC;AAAD,CAAC,AAjMD,CAAgF,SAAS,GAiMxF;AAED,eAAe,aAAa,CAAC"}
|
package/esm/annotation/html.d.ts
CHANGED
|
@@ -3,41 +3,6 @@ import { ILocation } from '../interfaces';
|
|
|
3
3
|
import { HtmlAnnotationCfg, PointLocationCfg } from '../types';
|
|
4
4
|
export default class HtmlAnnotation extends HtmlComponent<HtmlAnnotationCfg> implements ILocation<PointLocationCfg> {
|
|
5
5
|
getDefaultCfg(): {
|
|
6
|
-
name: string;
|
|
7
|
-
type: string;
|
|
8
|
-
locationType: string;
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
containerTpl: string;
|
|
12
|
-
alignX: string;
|
|
13
|
-
alignY: string;
|
|
14
|
-
html: string;
|
|
15
|
-
zIndex: number;
|
|
16
|
-
id: string;
|
|
17
|
-
offsetX: number;
|
|
18
|
-
offsetY: number;
|
|
19
|
-
animate: boolean;
|
|
20
|
-
capture: boolean;
|
|
21
|
-
updateAutoRender: boolean;
|
|
22
|
-
animateOption: {
|
|
23
|
-
appear: any;
|
|
24
|
-
update: {
|
|
25
|
-
duration: number;
|
|
26
|
-
easing: string;
|
|
27
|
-
};
|
|
28
|
-
enter: {
|
|
29
|
-
duration: number;
|
|
30
|
-
easing: string;
|
|
31
|
-
};
|
|
32
|
-
leave: {
|
|
33
|
-
duration: number;
|
|
34
|
-
easing: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
events: any;
|
|
38
|
-
defaultCfg: {};
|
|
39
|
-
visible: boolean;
|
|
40
|
-
} | {
|
|
41
6
|
name: string;
|
|
42
7
|
type: string;
|
|
43
8
|
locationType: string;
|
package/esm/axis/circle.d.ts
CHANGED
|
@@ -127,9 +127,9 @@ declare class Circle extends AxisBase<CircleAxisCfg> {
|
|
|
127
127
|
protected getAxisVector(point: Point): [number, number];
|
|
128
128
|
private getCirclePoint;
|
|
129
129
|
/**
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
* 是否可以执行某一 overlap
|
|
131
|
+
* @param name
|
|
132
|
+
*/
|
|
133
133
|
private canProcessOverlap;
|
|
134
134
|
protected processOverlap(labelGroup: any): void;
|
|
135
135
|
private autoProcessOverlap;
|
package/esm/axis/circle.js
CHANGED
|
@@ -69,9 +69,9 @@ var Circle = /** @class */ (function (_super) {
|
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
/**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
* 是否可以执行某一 overlap
|
|
73
|
+
* @param name
|
|
74
|
+
*/
|
|
75
75
|
Circle.prototype.canProcessOverlap = function (name) {
|
|
76
76
|
var labelCfg = this.get('label');
|
|
77
77
|
// 对 autoRotate,如果配置了旋转角度,直接进行固定角度旋转
|
|
@@ -116,25 +116,26 @@ var Circle = /** @class */ (function (_super) {
|
|
|
116
116
|
var _this = this;
|
|
117
117
|
var hasAdjusted = false;
|
|
118
118
|
var util = OverlapUtil[name];
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
119
|
+
if (limitLength > 0) {
|
|
120
|
+
if (value === true) {
|
|
121
|
+
// true 形式的配置:使用 overlap 默认的的处理方法进行处理
|
|
122
|
+
hasAdjusted = util.getDefault()(false, labelGroup, limitLength);
|
|
123
|
+
}
|
|
124
|
+
else if (isFunction(value)) {
|
|
125
|
+
// 回调函数形式的配置: 用户可以传入回调函数
|
|
126
|
+
hasAdjusted = value(false, labelGroup, limitLength);
|
|
127
|
+
}
|
|
128
|
+
else if (isObject(value)) {
|
|
129
|
+
// object 形式的配置方式:包括 处理方法 type, 和可选参数配置 cfg
|
|
130
|
+
var overlapCfg = value;
|
|
131
|
+
if (util[overlapCfg.type]) {
|
|
132
|
+
hasAdjusted = util[overlapCfg.type](false, labelGroup, limitLength, overlapCfg.cfg);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else if (util[value]) {
|
|
136
|
+
// 字符串类型的配置:按照名称执行 overlap 处理方法
|
|
137
|
+
hasAdjusted = util[value](false, labelGroup, limitLength);
|
|
133
138
|
}
|
|
134
|
-
}
|
|
135
|
-
else if (util[value]) {
|
|
136
|
-
// 字符串类型的配置:按照名称执行 overlap 处理方法
|
|
137
|
-
hasAdjusted = util[value](false, labelGroup, limitLength);
|
|
138
139
|
}
|
|
139
140
|
if (name === 'autoRotate') {
|
|
140
141
|
// 文本旋转后,文本的对齐方式可能就不合适了
|
package/esm/axis/circle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circle.js","sourceRoot":"","sources":["../../src/axis/circle.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,QAAQ,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,WAAW,MAAM,WAAW,CAAC;AAIzC;IAAqB,0BAAuB;IAA5C;;
|
|
1
|
+
{"version":3,"file":"circle.js","sourceRoot":"","sources":["../../src/axis/circle.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,O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}
|
package/esm/crosshair/html.d.ts
CHANGED
|
@@ -2,73 +2,6 @@ import HtmlComponent from '../abstract/html-component';
|
|
|
2
2
|
import { HtmlCrossHairCfg } from '../types';
|
|
3
3
|
declare class HtmlCrosshair<T extends HtmlCrossHairCfg = HtmlCrossHairCfg> extends HtmlComponent {
|
|
4
4
|
getDefaultCfg(): {
|
|
5
|
-
name: string;
|
|
6
|
-
type: string;
|
|
7
|
-
locationType: string;
|
|
8
|
-
start: {
|
|
9
|
-
x: number;
|
|
10
|
-
y: number;
|
|
11
|
-
};
|
|
12
|
-
end: {
|
|
13
|
-
x: number;
|
|
14
|
-
y: number;
|
|
15
|
-
};
|
|
16
|
-
capture: boolean;
|
|
17
|
-
text: any;
|
|
18
|
-
containerTpl: string;
|
|
19
|
-
crosshairTpl: string;
|
|
20
|
-
textTpl: string;
|
|
21
|
-
domStyles: any;
|
|
22
|
-
containerClassName: string;
|
|
23
|
-
defaultStyles: {
|
|
24
|
-
[x: string]: {
|
|
25
|
-
position: string;
|
|
26
|
-
backgroundColor?: undefined;
|
|
27
|
-
color?: undefined;
|
|
28
|
-
fontFamily?: undefined;
|
|
29
|
-
} | {
|
|
30
|
-
position: string;
|
|
31
|
-
backgroundColor: string;
|
|
32
|
-
color?: undefined;
|
|
33
|
-
fontFamily?: undefined;
|
|
34
|
-
} | {
|
|
35
|
-
position: string;
|
|
36
|
-
color: string;
|
|
37
|
-
fontFamily: string;
|
|
38
|
-
backgroundColor?: undefined;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
defaultCfg: {
|
|
42
|
-
text: {
|
|
43
|
-
position: string;
|
|
44
|
-
content: any;
|
|
45
|
-
align: string;
|
|
46
|
-
offset: number;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
id: string;
|
|
50
|
-
offsetX: number;
|
|
51
|
-
offsetY: number;
|
|
52
|
-
animate: boolean;
|
|
53
|
-
updateAutoRender: boolean;
|
|
54
|
-
animateOption: {
|
|
55
|
-
appear: any;
|
|
56
|
-
update: {
|
|
57
|
-
duration: number;
|
|
58
|
-
easing: string;
|
|
59
|
-
};
|
|
60
|
-
enter: {
|
|
61
|
-
duration: number;
|
|
62
|
-
easing: string;
|
|
63
|
-
};
|
|
64
|
-
leave: {
|
|
65
|
-
duration: number;
|
|
66
|
-
easing: string;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
events: any;
|
|
70
|
-
visible: boolean;
|
|
71
|
-
} | {
|
|
72
5
|
name: string;
|
|
73
6
|
type: string;
|
|
74
7
|
locationType: string;
|
package/esm/legend/category.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ declare class Category extends LegendBase<CategoryLegendCfg> implements IList {
|
|
|
21
21
|
maxWidth: any;
|
|
22
22
|
maxHeight: any;
|
|
23
23
|
marker: {};
|
|
24
|
+
radio: any;
|
|
24
25
|
items: any[];
|
|
25
26
|
itemStates: {};
|
|
26
27
|
itemBackground: {};
|
|
@@ -95,6 +96,7 @@ declare class Category extends LegendBase<CategoryLegendCfg> implements IList {
|
|
|
95
96
|
fontWeight: string;
|
|
96
97
|
lineHeight: number;
|
|
97
98
|
};
|
|
99
|
+
spacing: number;
|
|
98
100
|
};
|
|
99
101
|
itemStates: {
|
|
100
102
|
active: {
|
|
@@ -209,6 +211,7 @@ declare class Category extends LegendBase<CategoryLegendCfg> implements IList {
|
|
|
209
211
|
private getItemHeight;
|
|
210
212
|
private drawMarker;
|
|
211
213
|
private drawItemText;
|
|
214
|
+
private drawRadio;
|
|
212
215
|
private drawItem;
|
|
213
216
|
private adjustNavigation;
|
|
214
217
|
/**
|
|
@@ -217,6 +220,10 @@ declare class Category extends LegendBase<CategoryLegendCfg> implements IList {
|
|
|
217
220
|
private drawNavigation;
|
|
218
221
|
private updateNavigation;
|
|
219
222
|
private drawArrow;
|
|
223
|
+
/**
|
|
224
|
+
* 更新分页器 arrow 组件
|
|
225
|
+
*/
|
|
226
|
+
private updateArrowPath;
|
|
220
227
|
private getCurrentNavigationMatrix;
|
|
221
228
|
private onNavigationBack;
|
|
222
229
|
private onNavigationAfter;
|
package/esm/legend/category.js
CHANGED
|
@@ -32,9 +32,17 @@ var textStyle = {
|
|
|
32
32
|
textAlign: 'start',
|
|
33
33
|
textBaseline: 'middle',
|
|
34
34
|
fontFamily: Theme.fontFamily,
|
|
35
|
-
fontWeight:
|
|
35
|
+
fontWeight: 'normal',
|
|
36
36
|
lineHeight: 12,
|
|
37
37
|
};
|
|
38
|
+
var RIGHT_ARROW_NAME = 'navigation-arrow-right';
|
|
39
|
+
var LEFT_ARROW_NAME = 'navigation-arrow-left';
|
|
40
|
+
var ROTATE_MAP = {
|
|
41
|
+
right: (90 * Math.PI) / 180,
|
|
42
|
+
left: ((360 - 90) * Math.PI) / 180,
|
|
43
|
+
up: 0,
|
|
44
|
+
down: (180 * Math.PI) / 180,
|
|
45
|
+
};
|
|
38
46
|
var Category = /** @class */ (function (_super) {
|
|
39
47
|
__extends(Category, _super);
|
|
40
48
|
function Category() {
|
|
@@ -81,7 +89,7 @@ var Category = /** @class */ (function (_super) {
|
|
|
81
89
|
}
|
|
82
90
|
Category.prototype.getDefaultCfg = function () {
|
|
83
91
|
var cfg = _super.prototype.getDefaultCfg.call(this);
|
|
84
|
-
return __assign(__assign({}, cfg), { name: 'legend', type: 'category', itemSpacing: 24, itemMarginBottom: 8, maxItemWidth: null, itemWidth: null, itemHeight: null, itemName: {}, itemValue: null, maxWidth: null, maxHeight: null, marker: {}, items: [], itemStates: {}, itemBackground: {}, pageNavigator: {}, defaultCfg: {
|
|
92
|
+
return __assign(__assign({}, cfg), { name: 'legend', type: 'category', itemSpacing: 24, itemMarginBottom: 8, maxItemWidth: null, itemWidth: null, itemHeight: null, itemName: {}, itemValue: null, maxWidth: null, maxHeight: null, marker: {}, radio: null, items: [], itemStates: {}, itemBackground: {}, pageNavigator: {}, defaultCfg: {
|
|
85
93
|
title: {
|
|
86
94
|
spacing: 5,
|
|
87
95
|
style: {
|
|
@@ -119,6 +127,7 @@ var Category = /** @class */ (function (_super) {
|
|
|
119
127
|
alignRight: false,
|
|
120
128
|
formatter: null,
|
|
121
129
|
style: textStyle,
|
|
130
|
+
spacing: 6,
|
|
122
131
|
},
|
|
123
132
|
itemStates: {
|
|
124
133
|
active: {
|
|
@@ -375,6 +384,35 @@ var Category = /** @class */ (function (_super) {
|
|
|
375
384
|
attrs: attrs,
|
|
376
385
|
});
|
|
377
386
|
};
|
|
387
|
+
Category.prototype.drawRadio = function (container, style, item, itemHeight, x) {
|
|
388
|
+
var r = itemHeight / 2;
|
|
389
|
+
var lineWidth = (r * 3.6) / 8;
|
|
390
|
+
var _a = [x + r, itemHeight / 2 - r], x0 = _a[0], y0 = _a[1];
|
|
391
|
+
var _b = [x0 + r, y0 + r], x1 = _b[0], y1 = _b[1];
|
|
392
|
+
var _c = [x0, y1 + r], x2 = _c[0], y2 = _c[1];
|
|
393
|
+
var _d = [x, y0 + r], x3 = _d[0], y3 = _d[1];
|
|
394
|
+
var showRadio = item.showRadio;
|
|
395
|
+
var attrs = __assign(__assign({ path: [
|
|
396
|
+
['M', x0, y0],
|
|
397
|
+
['A', r, r, 0, 0, 1, x1, y1],
|
|
398
|
+
['L', x1 - lineWidth, y1],
|
|
399
|
+
['L', x1, y1],
|
|
400
|
+
['A', r, r, 0, 0, 1, x2, y2],
|
|
401
|
+
['L', x2, y2 - lineWidth],
|
|
402
|
+
['L', x2, y2],
|
|
403
|
+
['A', r, r, 0, 0, 1, x3, y3],
|
|
404
|
+
['L', x3 + lineWidth, y3],
|
|
405
|
+
['L', x3, y3],
|
|
406
|
+
['A', r, r, 0, 0, 1, x0, y0],
|
|
407
|
+
['L', x0, y0 + lineWidth],
|
|
408
|
+
], stroke: '#000000', fill: '#ffffff' }, style), { opacity: showRadio ? 0.45 : 0 });
|
|
409
|
+
return this.addShape(container, {
|
|
410
|
+
type: 'path',
|
|
411
|
+
id: this.getElementId("item-" + item.id + "-radio"),
|
|
412
|
+
name: 'legend-item-radio',
|
|
413
|
+
attrs: attrs,
|
|
414
|
+
});
|
|
415
|
+
};
|
|
378
416
|
// 绘制图例项
|
|
379
417
|
Category.prototype.drawItem = function (item, index, itemHeight, itemGroup) {
|
|
380
418
|
var groupId = "item-" + item.id;
|
|
@@ -399,6 +437,7 @@ var Category = /** @class */ (function (_super) {
|
|
|
399
437
|
var itemName = this.get('itemName');
|
|
400
438
|
var itemValue = this.get('itemValue');
|
|
401
439
|
var itemBackground = this.get('itemBackground');
|
|
440
|
+
var radio = this.get('radio');
|
|
402
441
|
var itemWidth = this.getLimitItemWidth();
|
|
403
442
|
var curX = 0; // 记录当前 x 的位置
|
|
404
443
|
if (marker) {
|
|
@@ -433,6 +472,10 @@ var Category = /** @class */ (function (_super) {
|
|
|
433
472
|
ellipsisLabel(true, valueShape, clamp(itemWidth - curX, 0, itemWidth));
|
|
434
473
|
}
|
|
435
474
|
}
|
|
475
|
+
curX = valueShape.getBBox().maxX + itemValue.spacing;
|
|
476
|
+
}
|
|
477
|
+
if (radio) {
|
|
478
|
+
this.drawRadio(subGroup, radio, item, itemHeight, curX);
|
|
436
479
|
}
|
|
437
480
|
// 添加透明的背景,便于拾取和包围盒计算
|
|
438
481
|
if (itemBackground) {
|
|
@@ -580,7 +623,7 @@ var Category = /** @class */ (function (_super) {
|
|
|
580
623
|
name: 'legend-navigation',
|
|
581
624
|
});
|
|
582
625
|
var _a = get(styleCfg.marker, 'style', {}), _b = _a.size, size = _b === void 0 ? 12 : _b, arrowStyle = __rest(_a, ["size"]);
|
|
583
|
-
var leftArrow = this.drawArrow(subGroup, currentPoint,
|
|
626
|
+
var leftArrow = this.drawArrow(subGroup, currentPoint, LEFT_ARROW_NAME, layout === 'horizontal' ? 'up' : 'left', size, arrowStyle);
|
|
584
627
|
leftArrow.on('click', this.onNavigationBack);
|
|
585
628
|
var leftArrowBBox = leftArrow.getBBox();
|
|
586
629
|
currentPoint.x += leftArrowBBox.width + 2;
|
|
@@ -592,7 +635,7 @@ var Category = /** @class */ (function (_super) {
|
|
|
592
635
|
});
|
|
593
636
|
var textBBox = textShape.getBBox();
|
|
594
637
|
currentPoint.x += textBBox.width + 2;
|
|
595
|
-
var rightArrow = this.drawArrow(subGroup, currentPoint,
|
|
638
|
+
var rightArrow = this.drawArrow(subGroup, currentPoint, RIGHT_ARROW_NAME, layout === 'horizontal' ? 'down' : 'right', size, arrowStyle);
|
|
596
639
|
rightArrow.on('click', this.onNavigationAfter);
|
|
597
640
|
return subGroup;
|
|
598
641
|
};
|
|
@@ -602,15 +645,12 @@ var Category = /** @class */ (function (_super) {
|
|
|
602
645
|
var text = this.currentPageIndex + "/" + this.totalPagesCnt;
|
|
603
646
|
var textShape = navigation ? navigation.getChildren()[1] : this.getElementByLocalId('navigation-text');
|
|
604
647
|
var leftArrow = navigation
|
|
605
|
-
? navigation.findById(this.getElementId(
|
|
606
|
-
: this.getElementByLocalId(
|
|
648
|
+
? navigation.findById(this.getElementId(LEFT_ARROW_NAME))
|
|
649
|
+
: this.getElementByLocalId(LEFT_ARROW_NAME);
|
|
607
650
|
var rightArrow = navigation
|
|
608
|
-
? navigation.findById(this.getElementId(
|
|
609
|
-
: this.getElementByLocalId(
|
|
610
|
-
var origBBox = textShape.getBBox();
|
|
651
|
+
? navigation.findById(this.getElementId(RIGHT_ARROW_NAME))
|
|
652
|
+
: this.getElementByLocalId(RIGHT_ARROW_NAME);
|
|
611
653
|
textShape.attr('text', text);
|
|
612
|
-
var newBBox = textShape.getBBox();
|
|
613
|
-
textShape.attr('x', textShape.attr('x') - (newBBox.width - origBBox.width) / 2);
|
|
614
654
|
// 更新 left-arrow marker
|
|
615
655
|
leftArrow.attr('opacity', this.currentPageIndex === 1 ? inactiveOpacity : opacity);
|
|
616
656
|
leftArrow.attr('fill', this.currentPageIndex === 1 ? inactiveFill : fill);
|
|
@@ -619,24 +659,34 @@ var Category = /** @class */ (function (_super) {
|
|
|
619
659
|
rightArrow.attr('opacity', this.currentPageIndex === this.totalPagesCnt ? inactiveOpacity : opacity);
|
|
620
660
|
rightArrow.attr('fill', this.currentPageIndex === this.totalPagesCnt ? inactiveFill : fill);
|
|
621
661
|
rightArrow.attr('cursor', this.currentPageIndex === this.totalPagesCnt ? 'not-allowed' : 'pointer');
|
|
662
|
+
// 更新位置
|
|
663
|
+
var cursorX = leftArrow.getBBox().maxX + 2;
|
|
664
|
+
textShape.attr('x', cursorX);
|
|
665
|
+
cursorX += textShape.getBBox().width + 2;
|
|
666
|
+
this.updateArrowPath(rightArrow, { x: cursorX, y: 0 });
|
|
622
667
|
};
|
|
623
668
|
Category.prototype.drawArrow = function (group, currentPoint, name, direction, size, style) {
|
|
624
669
|
var x = currentPoint.x, y = currentPoint.y;
|
|
625
|
-
var rotateMap = {
|
|
626
|
-
right: (90 * Math.PI) / 180,
|
|
627
|
-
left: ((360 - 90) * Math.PI) / 180,
|
|
628
|
-
up: 0,
|
|
629
|
-
down: (180 * Math.PI) / 180,
|
|
630
|
-
};
|
|
631
670
|
var shape = this.addShape(group, {
|
|
632
671
|
type: 'path',
|
|
633
672
|
id: this.getElementId(name),
|
|
634
673
|
name: name,
|
|
635
|
-
attrs: __assign({
|
|
674
|
+
attrs: __assign({ size: size,
|
|
675
|
+
direction: direction, path: [['M', x + size / 2, y], ['L', x, y + size], ['L', x + size, y + size], ['Z']], cursor: 'pointer' }, style),
|
|
636
676
|
});
|
|
637
|
-
shape.attr('matrix', getMatrixByAngle({ x: x + size / 2, y: y + size / 2 },
|
|
677
|
+
shape.attr('matrix', getMatrixByAngle({ x: x + size / 2, y: y + size / 2 }, ROTATE_MAP[direction]));
|
|
638
678
|
return shape;
|
|
639
679
|
};
|
|
680
|
+
/**
|
|
681
|
+
* 更新分页器 arrow 组件
|
|
682
|
+
*/
|
|
683
|
+
Category.prototype.updateArrowPath = function (arrow, point) {
|
|
684
|
+
var x = point.x, y = point.y;
|
|
685
|
+
var _a = arrow.attr(), size = _a.size, direction = _a.direction;
|
|
686
|
+
var matrix = getMatrixByAngle({ x: x + size / 2, y: y + size / 2 }, ROTATE_MAP[direction]);
|
|
687
|
+
arrow.attr('path', [['M', x + size / 2, y], ['L', x, y + size], ['L', x + size, y + size], ['Z']]);
|
|
688
|
+
arrow.attr('matrix', matrix);
|
|
689
|
+
};
|
|
640
690
|
Category.prototype.getCurrentNavigationMatrix = function () {
|
|
641
691
|
var _a = this, currentPageIndex = _a.currentPageIndex, pageWidth = _a.pageWidth, pageHeight = _a.pageHeight;
|
|
642
692
|
var layout = this.get('layout');
|