@visactor/vrender-components 0.19.6-alpha.2 → 0.19.6-alpha.3
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/cjs/axis/util.js +1 -2
- package/cjs/brush/type.js +2 -1
- package/cjs/empty-tip/empty-tip.d.ts +14 -0
- package/cjs/empty-tip/empty-tip.js +53 -0
- package/cjs/empty-tip/empty-tip.js.map +1 -0
- package/cjs/empty-tip/index.d.ts +2 -0
- package/cjs/empty-tip/index.js +21 -0
- package/cjs/empty-tip/index.js.map +1 -0
- package/cjs/empty-tip/register.d.ts +1 -0
- package/cjs/empty-tip/register.js +14 -0
- package/cjs/empty-tip/register.js.map +1 -0
- package/cjs/empty-tip/type.d.ts +10 -0
- package/cjs/empty-tip/type.js +6 -0
- package/cjs/empty-tip/type.js.map +1 -0
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +2 -2
- package/cjs/index.js.map +1 -1
- package/cjs/label/arc.js +1 -2
- package/cjs/label/index.js +2 -1
- package/cjs/label/rect.js +1 -1
- package/cjs/label/register.js +1 -1
- package/cjs/label/symbol.js +1 -1
- package/cjs/label/type.js +1 -1
- package/dist/index.es.js +58 -2
- package/es/axis/util.js +1 -2
- package/es/brush/type.js +2 -1
- package/es/empty-tip/empty-tip.d.ts +14 -0
- package/es/empty-tip/empty-tip.js +55 -0
- package/es/empty-tip/empty-tip.js.map +1 -0
- package/es/empty-tip/index.d.ts +2 -0
- package/es/empty-tip/index.js +4 -0
- package/es/empty-tip/index.js.map +1 -0
- package/es/empty-tip/register.d.ts +1 -0
- package/es/empty-tip/register.js +6 -0
- package/es/empty-tip/register.js.map +1 -0
- package/es/empty-tip/type.d.ts +10 -0
- package/es/empty-tip/type.js +2 -0
- package/es/empty-tip/type.js.map +1 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +3 -1
- package/es/index.js.map +1 -1
- package/es/label/arc.js +1 -2
- package/es/label/index.js +2 -1
- package/es/label/rect.js +1 -1
- package/es/label/register.js +1 -1
- package/es/label/symbol.js +1 -1
- package/es/label/type.js +1 -1
- package/package.json +5 -5
package/cjs/axis/util.js
CHANGED
|
@@ -70,5 +70,4 @@ function getPolarAngleLabelPosition(angle, center, radius, labelOffset, inside,
|
|
|
70
70
|
|
|
71
71
|
exports.clampRadian = clampRadian, exports.isInRange = isInRange, exports.getCircleLabelPosition = getCircleLabelPosition,
|
|
72
72
|
exports.getElMap = getElMap, exports.getVerticalCoord = getVerticalCoord, exports.getCircleVerticalVector = getCircleVerticalVector,
|
|
73
|
-
exports.angleLabelOrientAttribute = angleLabelOrientAttribute, exports.getPolarAngleLabelPosition = getPolarAngleLabelPosition;
|
|
74
|
-
//# sourceMappingURL=util.js.map
|
|
73
|
+
exports.angleLabelOrientAttribute = angleLabelOrientAttribute, exports.getPolarAngleLabelPosition = getPolarAngleLabelPosition;
|
package/cjs/brush/type.js
CHANGED
|
@@ -8,4 +8,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing",
|
|
9
9
|
IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd",
|
|
10
10
|
IOperateType.brushClear = "brushClear";
|
|
11
|
-
}(IOperateType = exports.IOperateType || (exports.IOperateType = {}));
|
|
11
|
+
}(IOperateType = exports.IOperateType || (exports.IOperateType = {}));
|
|
12
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AbstractComponent } from '../core/base';
|
|
2
|
+
import type { EmptyTipAttributes } from './type';
|
|
3
|
+
import { Image, Text } from '@visactor/vrender-core';
|
|
4
|
+
import type { ComponentOptions } from '../interface';
|
|
5
|
+
export declare class EmptyTip extends AbstractComponent<Required<EmptyTipAttributes>> {
|
|
6
|
+
static defaultAttributes: Partial<EmptyTipAttributes>;
|
|
7
|
+
_text: Text;
|
|
8
|
+
_emptyTipIcon: Image;
|
|
9
|
+
constructor(attributes: EmptyTipAttributes, options?: ComponentOptions);
|
|
10
|
+
render(): void;
|
|
11
|
+
renderIcon(): void;
|
|
12
|
+
renderText(): void;
|
|
13
|
+
layout(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.EmptyTip = void 0;
|
|
6
|
+
|
|
7
|
+
const vutils_1 = require("@visactor/vutils"), base_1 = require("../core/base"), vrender_core_1 = require("@visactor/vrender-core"), register_1 = require("./register"), emptyTipSvg = '<svg t="1716726614852" class="icon" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2621" width="200" height="200"><path d="M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z" fill="#8a8a8a" p-id="2622"></path></svg>';
|
|
8
|
+
|
|
9
|
+
(0, register_1.loadEmptyTipComponent)();
|
|
10
|
+
|
|
11
|
+
class EmptyTip extends base_1.AbstractComponent {
|
|
12
|
+
constructor(attributes, options) {
|
|
13
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : (0, vutils_1.merge)({}, EmptyTip.defaultAttributes, attributes));
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
this.removeAllChild(!0), this.renderIcon(), this.renderText(), this.layout();
|
|
17
|
+
}
|
|
18
|
+
renderIcon() {
|
|
19
|
+
this._emptyTipIcon = new vrender_core_1.Image((0, vutils_1.merge)({
|
|
20
|
+
image: this.attribute.icon.image
|
|
21
|
+
}, this.attribute.icon)), this.appendChild(this._emptyTipIcon);
|
|
22
|
+
}
|
|
23
|
+
renderText() {
|
|
24
|
+
this._text = new vrender_core_1.Text((0, vutils_1.merge)({
|
|
25
|
+
wrap: !0
|
|
26
|
+
}, this.attribute.text)), this.appendChild(this._text);
|
|
27
|
+
}
|
|
28
|
+
layout() {
|
|
29
|
+
const iconHeight = this.attribute.icon.height, textHeight = this._text.AABBBounds.height(), iconWidth = this.attribute.icon.width, {width: width, height: height, spaceBetweenTextAndIcon: spaceBetweenTextAndIcon} = this.attribute;
|
|
30
|
+
this._emptyTipIcon.setAttribute("x", width / 2 - iconWidth / 2), this._emptyTipIcon.setAttribute("y", height / 2 - iconHeight / 2 - textHeight / 2 - spaceBetweenTextAndIcon / 2),
|
|
31
|
+
this._text.setAttribute("x", width / 2), this._text.setAttribute("textAlign", "center"),
|
|
32
|
+
this._text.setAttribute("y", height / 2 + iconHeight / 2 + spaceBetweenTextAndIcon / 2),
|
|
33
|
+
this._text.setAttribute("textBaseline", "middle");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
exports.EmptyTip = EmptyTip, EmptyTip.defaultAttributes = {
|
|
38
|
+
spaceBetweenTextAndIcon: 20,
|
|
39
|
+
text: {
|
|
40
|
+
text: "no data",
|
|
41
|
+
fontSize: 14,
|
|
42
|
+
fill: "#000",
|
|
43
|
+
disableFill: "rgb(201,205,212)",
|
|
44
|
+
pickable: !1
|
|
45
|
+
},
|
|
46
|
+
icon: {
|
|
47
|
+
image: emptyTipSvg,
|
|
48
|
+
width: 100,
|
|
49
|
+
height: 100,
|
|
50
|
+
pickable: !1
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=empty-tip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/empty-tip/empty-tip.ts"],"names":[],"mappings":"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","file":"empty-tip.js","sourcesContent":["import { isValid, merge, normalizePadding } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { EmptyTipAttributes } from './type';\nimport { Image, Rect, Text, graphicCreator } from '@visactor/vrender-core';\nimport type { ComponentOptions } from '../interface';\nimport { loadEmptyTipComponent } from './register';\n\nconst emptyTipSvg =\n '<svg t=\"1716726614852\" class=\"icon\" viewBox=\"0 0 1194 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2621\" width=\"200\" height=\"200\"><path d=\"M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z\" fill=\"#8a8a8a\" p-id=\"2622\"></path></svg>';\n\nloadEmptyTipComponent();\nexport class EmptyTip extends AbstractComponent<Required<EmptyTipAttributes>> {\n static defaultAttributes: Partial<EmptyTipAttributes> = {\n spaceBetweenTextAndIcon: 20,\n text: {\n text: 'no data',\n fontSize: 14,\n fill: '#000',\n disableFill: 'rgb(201,205,212)',\n pickable: false\n },\n icon: {\n image: emptyTipSvg,\n width: 100,\n height: 100,\n pickable: false\n }\n };\n _text: Text;\n _emptyTipIcon: Image;\n constructor(attributes: EmptyTipAttributes, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, EmptyTip.defaultAttributes, attributes));\n }\n\n render() {\n this.removeAllChild(true);\n\n this.renderIcon();\n this.renderText();\n this.layout();\n }\n\n renderIcon() {\n this._emptyTipIcon = new Image(merge({ image: this.attribute.icon.image }, this.attribute.icon));\n this.appendChild(this._emptyTipIcon);\n }\n\n renderText() {\n this._text = new Text(merge({ wrap: true }, this.attribute.text));\n this.appendChild(this._text);\n }\n\n layout() {\n const iconHeight = this.attribute.icon.height;\n const textHeight = this._text.AABBBounds.height();\n\n const iconWidth = this.attribute.icon.width;\n\n const { width, height, spaceBetweenTextAndIcon } = this.attribute as EmptyTipAttributes;\n\n this._emptyTipIcon.setAttribute('x', width / 2 - iconWidth / 2);\n // this._emptyTipIcon.setAttribute('textAlign', 'center');\n\n this._emptyTipIcon.setAttribute('y', height / 2 - iconHeight / 2 - textHeight / 2 - spaceBetweenTextAndIcon / 2);\n // this._emptyTipIcon.setAttribute('textBaseline', 'middle');\n\n this._text.setAttribute('x', width / 2);\n this._text.setAttribute('textAlign', 'center');\n\n this._text.setAttribute('y', height / 2 + iconHeight / 2 + spaceBetweenTextAndIcon / 2);\n this._text.setAttribute('textBaseline', 'middle');\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
4
|
+
void 0 === k2 && (k2 = k);
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
desc && !("get" in desc ? !m.__esModule : desc.writable || desc.configurable) || (desc = {
|
|
7
|
+
enumerable: !0,
|
|
8
|
+
get: function() {
|
|
9
|
+
return m[k];
|
|
10
|
+
}
|
|
11
|
+
}), Object.defineProperty(o, k2, desc);
|
|
12
|
+
} : function(o, m, k, k2) {
|
|
13
|
+
void 0 === k2 && (k2 = k), o[k2] = m[k];
|
|
14
|
+
}), __exportStar = this && this.__exportStar || function(m, exports) {
|
|
15
|
+
for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(exports, p) || __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
Object.defineProperty(exports, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), __exportStar(require("./empty-tip"), exports), __exportStar(require("./type"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/empty-tip/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yCAAuB","file":"index.js","sourcesContent":["export * from './empty-tip';\nexport * from './type';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadEmptyTipComponent(): void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: !0
|
|
5
|
+
}), exports.loadEmptyTipComponent = void 0;
|
|
6
|
+
|
|
7
|
+
const vrender_kits_1 = require("@visactor/vrender-kits");
|
|
8
|
+
|
|
9
|
+
function loadEmptyTipComponent() {
|
|
10
|
+
(0, vrender_kits_1.registerGroup)(), (0, vrender_kits_1.registerText)(), (0, vrender_kits_1.registerImage)();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
exports.loadEmptyTipComponent = loadEmptyTipComponent;
|
|
14
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/empty-tip/register.ts"],"names":[],"mappings":";;;AAAA,yDAAkG;AAElG,SAAgB,qBAAqB;IACnC,IAAA,4BAAa,GAAE,CAAC;IAEhB,IAAA,2BAAY,GAAE,CAAC;IACf,IAAA,4BAAa,GAAE,CAAC;AAClB,CAAC;AALD,sDAKC","file":"register.js","sourcesContent":["import { registerGroup, registerImage, registerRect, registerText } from '@visactor/vrender-kits';\n\nexport function loadEmptyTipComponent() {\n registerGroup();\n // registerRect();\n registerText();\n registerImage();\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IColor, IGroupGraphicAttribute, IImageGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';
|
|
2
|
+
export type EmptyTipText = {
|
|
3
|
+
disableFill?: IColor;
|
|
4
|
+
} & ITextGraphicAttribute;
|
|
5
|
+
export type EmptyTipIcon = IImageGraphicAttribute;
|
|
6
|
+
export type EmptyTipAttributes = IGroupGraphicAttribute & {
|
|
7
|
+
text?: EmptyTipText;
|
|
8
|
+
icon?: EmptyTipIcon;
|
|
9
|
+
spaceBetweenTextAndIcon?: number;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/empty-tip/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n IColor,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nexport type EmptyTipText = {\n disableFill?: IColor;\n} & ITextGraphicAttribute;\n\nexport type EmptyTipIcon = IImageGraphicAttribute;\n\nexport type EmptyTipAttributes = IGroupGraphicAttribute & {\n text?: EmptyTipText;\n\n icon?: EmptyTipIcon;\n\n spaceBetweenTextAndIcon?: number;\n};\n"]}
|
package/cjs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const version = "0.19.6-alpha.
|
|
1
|
+
export declare const version = "0.19.6-alpha.3";
|
|
2
2
|
export * from './core/base';
|
|
3
3
|
export * from './core/type';
|
|
4
4
|
export * from './scrollbar';
|
|
@@ -24,4 +24,5 @@ export * from './interface';
|
|
|
24
24
|
export * from './jsx';
|
|
25
25
|
export * from './checkbox';
|
|
26
26
|
export * from './radio';
|
|
27
|
+
export * from './empty-tip';
|
|
27
28
|
export * from './util';
|
package/cjs/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __createBinding = this && this.__createBinding || (Object.create ? function(
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", {
|
|
19
19
|
value: !0
|
|
20
|
-
}), exports.version = void 0, exports.version = "0.19.6-alpha.
|
|
20
|
+
}), exports.version = void 0, exports.version = "0.19.6-alpha.3", __exportStar(require("./core/base"), exports),
|
|
21
21
|
__exportStar(require("./core/type"), exports), __exportStar(require("./scrollbar"), exports),
|
|
22
22
|
__exportStar(require("./tag"), exports), __exportStar(require("./poptip"), exports),
|
|
23
23
|
__exportStar(require("./crosshair"), exports), __exportStar(require("./label"), exports),
|
|
@@ -30,5 +30,5 @@ __exportStar(require("./link-path"), exports), __exportStar(require("./player"),
|
|
|
30
30
|
__exportStar(require("./brush"), exports), __exportStar(require("./tooltip"), exports),
|
|
31
31
|
__exportStar(require("./interface"), exports), __exportStar(require("./jsx"), exports),
|
|
32
32
|
__exportStar(require("./checkbox"), exports), __exportStar(require("./radio"), exports),
|
|
33
|
-
__exportStar(require("./util"), exports);
|
|
33
|
+
__exportStar(require("./empty-tip"), exports), __exportStar(require("./util"), exports);
|
|
34
34
|
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,yCAAuB","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.19.6-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACa,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAExC,8CAA4B;AAC5B,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,0CAAwB;AACxB,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,yCAAuB","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.19.6-alpha.3\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './util';\n"]}
|
package/cjs/label/arc.js
CHANGED
package/cjs/label/index.js
CHANGED
|
@@ -21,4 +21,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
21
21
|
__exportStar(require("./rect"), exports), __exportStar(require("./line"), exports),
|
|
22
22
|
__exportStar(require("./base"), exports), __exportStar(require("./arc"), exports),
|
|
23
23
|
__exportStar(require("./area"), exports), __exportStar(require("./line-data"), exports),
|
|
24
|
-
__exportStar(require("./dataLabel"), exports);
|
|
24
|
+
__exportStar(require("./dataLabel"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/label/rect.js
CHANGED
package/cjs/label/register.js
CHANGED
package/cjs/label/symbol.js
CHANGED
package/cjs/label/type.js
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -29352,6 +29352,62 @@ Radio.defaultAttributes = {
|
|
|
29352
29352
|
}
|
|
29353
29353
|
};
|
|
29354
29354
|
|
|
29355
|
-
|
|
29355
|
+
function loadEmptyTipComponent() {
|
|
29356
|
+
registerGroup();
|
|
29357
|
+
registerText();
|
|
29358
|
+
registerImage();
|
|
29359
|
+
}
|
|
29360
|
+
|
|
29361
|
+
const emptyTipSvg = '<svg t="1716726614852" class="icon" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2621" width="200" height="200"><path d="M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z" fill="#8a8a8a" p-id="2622"></path></svg>';
|
|
29362
|
+
loadEmptyTipComponent();
|
|
29363
|
+
class EmptyTip extends AbstractComponent {
|
|
29364
|
+
constructor(attributes, options) {
|
|
29365
|
+
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, EmptyTip.defaultAttributes, attributes));
|
|
29366
|
+
}
|
|
29367
|
+
render() {
|
|
29368
|
+
this.removeAllChild(true);
|
|
29369
|
+
this.renderIcon();
|
|
29370
|
+
this.renderText();
|
|
29371
|
+
this.layout();
|
|
29372
|
+
}
|
|
29373
|
+
renderIcon() {
|
|
29374
|
+
this._emptyTipIcon = new Image(merge({ image: this.attribute.icon.image }, this.attribute.icon));
|
|
29375
|
+
this.appendChild(this._emptyTipIcon);
|
|
29376
|
+
}
|
|
29377
|
+
renderText() {
|
|
29378
|
+
this._text = new Text(merge({ wrap: true }, this.attribute.text));
|
|
29379
|
+
this.appendChild(this._text);
|
|
29380
|
+
}
|
|
29381
|
+
layout() {
|
|
29382
|
+
const iconHeight = this.attribute.icon.height;
|
|
29383
|
+
const textHeight = this._text.AABBBounds.height();
|
|
29384
|
+
const iconWidth = this.attribute.icon.width;
|
|
29385
|
+
const { width, height, spaceBetweenTextAndIcon } = this.attribute;
|
|
29386
|
+
this._emptyTipIcon.setAttribute('x', width / 2 - iconWidth / 2);
|
|
29387
|
+
this._emptyTipIcon.setAttribute('y', height / 2 - iconHeight / 2 - textHeight / 2 - spaceBetweenTextAndIcon / 2);
|
|
29388
|
+
this._text.setAttribute('x', width / 2);
|
|
29389
|
+
this._text.setAttribute('textAlign', 'center');
|
|
29390
|
+
this._text.setAttribute('y', height / 2 + iconHeight / 2 + spaceBetweenTextAndIcon / 2);
|
|
29391
|
+
this._text.setAttribute('textBaseline', 'middle');
|
|
29392
|
+
}
|
|
29393
|
+
}
|
|
29394
|
+
EmptyTip.defaultAttributes = {
|
|
29395
|
+
spaceBetweenTextAndIcon: 20,
|
|
29396
|
+
text: {
|
|
29397
|
+
text: 'no data',
|
|
29398
|
+
fontSize: 14,
|
|
29399
|
+
fill: '#000',
|
|
29400
|
+
disableFill: 'rgb(201,205,212)',
|
|
29401
|
+
pickable: false
|
|
29402
|
+
},
|
|
29403
|
+
icon: {
|
|
29404
|
+
image: emptyTipSvg,
|
|
29405
|
+
width: 100,
|
|
29406
|
+
height: 100,
|
|
29407
|
+
pickable: false
|
|
29408
|
+
}
|
|
29409
|
+
};
|
|
29410
|
+
|
|
29411
|
+
const version = "0.19.6-alpha.3";
|
|
29356
29412
|
|
|
29357
|
-
export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AreaLabel, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, GroupFadeIn, GroupFadeOut, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineDataLabel, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, SymbolLabel, Tag, Title, Tooltip, VTag, angle, angleLabelOrientAttribute, angleTo, clampRadian, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, direction, getCircleLabelPosition, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getSizeHandlerPath, getTextType, getVerticalCoord, getVerticalPath, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxisCartes, isPostiveXAxisPolar, isRichText, isVisible, labelSmartInvert, length, loadPoptip, measureTextSize, normalize, reactAttributeTransform, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, removeRepeatPoint, richTextAttributeTransform, scale, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, ticks, traverseGroup, version };
|
|
29413
|
+
export { AXIS_ELEMENT_NAME, AbstractComponent, ArcInfo, ArcLabel, ArcSegment, AreaLabel, AxisStateValue, BasePlayer, Brush, CheckBox, CircleAxis, CircleAxisGrid, CircleCrosshair, ColorContinuousLegend, ContinuousPlayer, DEFAULT_ITEM_SPACE_COL, DEFAULT_ITEM_SPACE_ROW, DEFAULT_LABEL_SPACE, DEFAULT_PAGER_SPACE, DEFAULT_SHAPE_SIZE, DEFAULT_SHAPE_SPACE, DEFAULT_STATES$1 as DEFAULT_STATES, DEFAULT_TITLE_SPACE, DEFAULT_VALUE_SPACE, DataLabel, DataZoom, DataZoomActiveTag, DirectionEnum, DiscreteLegend, DiscretePlayer, EmptyTip, GroupFadeIn, GroupFadeOut, GroupTransition, IMarkAreaLabelPosition, IMarkCommonArcLabelPosition, IMarkLineLabelPosition, IMarkPointItemPosition, IOperateType, Indicator, LEGEND_ELEMENT_NAME, LabelBase, LegendEvent, LegendStateValue, LineAxis, LineAxisGrid, LineCrosshair, LineDataLabel, LineLabel, LinkPath, MarkArcArea, MarkArcLine, MarkArea, MarkLine, MarkPoint, Pager, PlayerEventEnum, PolygonCrosshair, PopTip, Radio, RectCrosshair, RectLabel, SLIDER_ELEMENT_NAME, ScrollBar, SectorCrosshair, Segment, SizeContinuousLegend, Slider, SymbolLabel, Tag, Title, Tooltip, VTag, angle, angleLabelOrientAttribute, angleTo, clampRadian, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, direction, getCircleLabelPosition, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getSizeHandlerPath, getTextType, getVerticalCoord, getVerticalPath, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxisCartes, isPostiveXAxisPolar, isRichText, isVisible, labelSmartInvert, length, loadPoptip, measureTextSize, normalize, reactAttributeTransform, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, removeRepeatPoint, richTextAttributeTransform, scale, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, ticks, traverseGroup, version };
|
package/es/axis/util.js
CHANGED
|
@@ -65,5 +65,4 @@ export function getPolarAngleLabelPosition(angle, center, radius, labelOffset, i
|
|
|
65
65
|
y: 0
|
|
66
66
|
}, radius, angle), labelPoint = getVerticalCoord(point, getCircleVerticalVector(labelOffset, point, center, inside));
|
|
67
67
|
return getCircleLabelPosition(labelPoint, getCircleVerticalVector(labelOffset || 1, labelPoint, center, inside), text, style);
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=util.js.map
|
|
68
|
+
}
|
package/es/brush/type.js
CHANGED
|
@@ -4,4 +4,5 @@ export var IOperateType;
|
|
|
4
4
|
IOperateType.drawStart = "drawStart", IOperateType.drawEnd = "drawEnd", IOperateType.drawing = "drawing",
|
|
5
5
|
IOperateType.moving = "moving", IOperateType.moveStart = "moveStart", IOperateType.moveEnd = "moveEnd",
|
|
6
6
|
IOperateType.brushClear = "brushClear";
|
|
7
|
-
}(IOperateType || (IOperateType = {}));
|
|
7
|
+
}(IOperateType || (IOperateType = {}));
|
|
8
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AbstractComponent } from '../core/base';
|
|
2
|
+
import type { EmptyTipAttributes } from './type';
|
|
3
|
+
import { Image, Text } from '@visactor/vrender-core';
|
|
4
|
+
import type { ComponentOptions } from '../interface';
|
|
5
|
+
export declare class EmptyTip extends AbstractComponent<Required<EmptyTipAttributes>> {
|
|
6
|
+
static defaultAttributes: Partial<EmptyTipAttributes>;
|
|
7
|
+
_text: Text;
|
|
8
|
+
_emptyTipIcon: Image;
|
|
9
|
+
constructor(attributes: EmptyTipAttributes, options?: ComponentOptions);
|
|
10
|
+
render(): void;
|
|
11
|
+
renderIcon(): void;
|
|
12
|
+
renderText(): void;
|
|
13
|
+
layout(): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { merge } from "@visactor/vutils";
|
|
2
|
+
|
|
3
|
+
import { AbstractComponent } from "../core/base";
|
|
4
|
+
|
|
5
|
+
import { Image, Text } from "@visactor/vrender-core";
|
|
6
|
+
|
|
7
|
+
import { loadEmptyTipComponent } from "./register";
|
|
8
|
+
|
|
9
|
+
const emptyTipSvg = '<svg t="1716726614852" class="icon" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2621" width="200" height="200"><path d="M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z" fill="#8a8a8a" p-id="2622"></path></svg>';
|
|
10
|
+
|
|
11
|
+
loadEmptyTipComponent();
|
|
12
|
+
|
|
13
|
+
export class EmptyTip extends AbstractComponent {
|
|
14
|
+
constructor(attributes, options) {
|
|
15
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, EmptyTip.defaultAttributes, attributes));
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
this.removeAllChild(!0), this.renderIcon(), this.renderText(), this.layout();
|
|
19
|
+
}
|
|
20
|
+
renderIcon() {
|
|
21
|
+
this._emptyTipIcon = new Image(merge({
|
|
22
|
+
image: this.attribute.icon.image
|
|
23
|
+
}, this.attribute.icon)), this.appendChild(this._emptyTipIcon);
|
|
24
|
+
}
|
|
25
|
+
renderText() {
|
|
26
|
+
this._text = new Text(merge({
|
|
27
|
+
wrap: !0
|
|
28
|
+
}, this.attribute.text)), this.appendChild(this._text);
|
|
29
|
+
}
|
|
30
|
+
layout() {
|
|
31
|
+
const iconHeight = this.attribute.icon.height, textHeight = this._text.AABBBounds.height(), iconWidth = this.attribute.icon.width, {width: width, height: height, spaceBetweenTextAndIcon: spaceBetweenTextAndIcon} = this.attribute;
|
|
32
|
+
this._emptyTipIcon.setAttribute("x", width / 2 - iconWidth / 2), this._emptyTipIcon.setAttribute("y", height / 2 - iconHeight / 2 - textHeight / 2 - spaceBetweenTextAndIcon / 2),
|
|
33
|
+
this._text.setAttribute("x", width / 2), this._text.setAttribute("textAlign", "center"),
|
|
34
|
+
this._text.setAttribute("y", height / 2 + iconHeight / 2 + spaceBetweenTextAndIcon / 2),
|
|
35
|
+
this._text.setAttribute("textBaseline", "middle");
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
EmptyTip.defaultAttributes = {
|
|
40
|
+
spaceBetweenTextAndIcon: 20,
|
|
41
|
+
text: {
|
|
42
|
+
text: "no data",
|
|
43
|
+
fontSize: 14,
|
|
44
|
+
fill: "#000",
|
|
45
|
+
disableFill: "rgb(201,205,212)",
|
|
46
|
+
pickable: !1
|
|
47
|
+
},
|
|
48
|
+
icon: {
|
|
49
|
+
image: emptyTipSvg,
|
|
50
|
+
width: 100,
|
|
51
|
+
height: 100,
|
|
52
|
+
pickable: !1
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=empty-tip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/empty-tip/empty-tip.ts"],"names":[],"mappings":"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","file":"empty-tip.js","sourcesContent":["import { isValid, merge, normalizePadding } from '@visactor/vutils';\nimport { AbstractComponent } from '../core/base';\nimport type { EmptyTipAttributes } from './type';\nimport { Image, Rect, Text, graphicCreator } from '@visactor/vrender-core';\nimport type { ComponentOptions } from '../interface';\nimport { loadEmptyTipComponent } from './register';\n\nconst emptyTipSvg =\n '<svg t=\"1716726614852\" class=\"icon\" viewBox=\"0 0 1194 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2621\" width=\"200\" height=\"200\"><path d=\"M1038.694079 367.237067c13.265507 23.342857-16.633865-40.004445-63.05621-40.004446H219.018794c-26.558738 0-46.46393 13.334815-63.05621 40.004446S0.006238 607.277601 0.006238 650.608819V940.647979a82.351494 82.351494 0 0 0 82.961402 83.349526H1111.702885a82.337632 82.337632 0 0 0 82.975264-83.349526V650.608819c0-43.331218-155.970208-283.371753-155.970208-283.371752zM730.066575 667.284269a136.328386 136.328386 0 0 1-132.738243 133.33429 133.417459 133.417459 0 0 1-132.738243-133.33429v-6.681269a40.6698 40.6698 0 0 0-36.497473-26.66963H73.015044l119.458874-220.02445s23.231965-40.004445 53.103614-40.004446h713.481918c26.544876 0 29.871649 10.008042 46.436207 40.004446L1128.33675 633.947231H769.904682c-26.184476 0-39.838107 7.623855-39.838107 33.337038zM338.505391 210.559919l-89.601086-86.69016a22.178487 22.178487 0 0 1 0-33.26773 21.984425 21.984425 0 0 1 33.170699 0l89.601087 86.676299a22.317102 22.317102 0 0 1 0 33.26773 24.950798 24.950798 0 0 1-33.1707 0z m252.197118-40.059891a25.532983 25.532983 0 0 1-6.639685-16.633865l-3.326773-126.694606A28.263709 28.263709 0 0 1 603.995739 0.515788c13.251646-3.326773 23.204242 10.021904 26.544877 23.342858V153.866163a28.249847 28.249847 0 0 1-23.259688 26.66963c-6.611961-3.312911-13.279369-3.312911-16.578419-10.035765z m235.646421 33.337038a22.372548 22.372548 0 0 1 0-33.337038l86.288175-90.030795a22.039871 22.039871 0 0 1 33.170699 0 22.289379 22.289379 0 0 1 0 33.364761l-82.961401 90.003072a25.962691 25.962691 0 0 1-36.483611 0z\" fill=\"#8a8a8a\" p-id=\"2622\"></path></svg>';\n\nloadEmptyTipComponent();\nexport class EmptyTip extends AbstractComponent<Required<EmptyTipAttributes>> {\n static defaultAttributes: Partial<EmptyTipAttributes> = {\n spaceBetweenTextAndIcon: 20,\n text: {\n text: 'no data',\n fontSize: 14,\n fill: '#000',\n disableFill: 'rgb(201,205,212)',\n pickable: false\n },\n icon: {\n image: emptyTipSvg,\n width: 100,\n height: 100,\n pickable: false\n }\n };\n _text: Text;\n _emptyTipIcon: Image;\n constructor(attributes: EmptyTipAttributes, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, EmptyTip.defaultAttributes, attributes));\n }\n\n render() {\n this.removeAllChild(true);\n\n this.renderIcon();\n this.renderText();\n this.layout();\n }\n\n renderIcon() {\n this._emptyTipIcon = new Image(merge({ image: this.attribute.icon.image }, this.attribute.icon));\n this.appendChild(this._emptyTipIcon);\n }\n\n renderText() {\n this._text = new Text(merge({ wrap: true }, this.attribute.text));\n this.appendChild(this._text);\n }\n\n layout() {\n const iconHeight = this.attribute.icon.height;\n const textHeight = this._text.AABBBounds.height();\n\n const iconWidth = this.attribute.icon.width;\n\n const { width, height, spaceBetweenTextAndIcon } = this.attribute as EmptyTipAttributes;\n\n this._emptyTipIcon.setAttribute('x', width / 2 - iconWidth / 2);\n // this._emptyTipIcon.setAttribute('textAlign', 'center');\n\n this._emptyTipIcon.setAttribute('y', height / 2 - iconHeight / 2 - textHeight / 2 - spaceBetweenTextAndIcon / 2);\n // this._emptyTipIcon.setAttribute('textBaseline', 'middle');\n\n this._text.setAttribute('x', width / 2);\n this._text.setAttribute('textAlign', 'center');\n\n this._text.setAttribute('y', height / 2 + iconHeight / 2 + spaceBetweenTextAndIcon / 2);\n this._text.setAttribute('textBaseline', 'middle');\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/empty-tip/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["export * from './empty-tip';\nexport * from './type';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadEmptyTipComponent(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/empty-tip/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAgB,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAElG,MAAM,UAAU,qBAAqB;IACnC,aAAa,EAAE,CAAC;IAEhB,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,CAAC;AAClB,CAAC","file":"register.js","sourcesContent":["import { registerGroup, registerImage, registerRect, registerText } from '@visactor/vrender-kits';\n\nexport function loadEmptyTipComponent() {\n registerGroup();\n // registerRect();\n registerText();\n registerImage();\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IColor, IGroupGraphicAttribute, IImageGraphicAttribute, ITextGraphicAttribute } from '@visactor/vrender-core';
|
|
2
|
+
export type EmptyTipText = {
|
|
3
|
+
disableFill?: IColor;
|
|
4
|
+
} & ITextGraphicAttribute;
|
|
5
|
+
export type EmptyTipIcon = IImageGraphicAttribute;
|
|
6
|
+
export type EmptyTipAttributes = IGroupGraphicAttribute & {
|
|
7
|
+
text?: EmptyTipText;
|
|
8
|
+
icon?: EmptyTipIcon;
|
|
9
|
+
spaceBetweenTextAndIcon?: number;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/empty-tip/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n IColor,\n IGroupGraphicAttribute,\n IImageGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nexport type EmptyTipText = {\n disableFill?: IColor;\n} & ITextGraphicAttribute;\n\nexport type EmptyTipIcon = IImageGraphicAttribute;\n\nexport type EmptyTipAttributes = IGroupGraphicAttribute & {\n text?: EmptyTipText;\n\n icon?: EmptyTipIcon;\n\n spaceBetweenTextAndIcon?: number;\n};\n"]}
|
package/es/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const version = "0.19.6-alpha.
|
|
1
|
+
export declare const version = "0.19.6-alpha.3";
|
|
2
2
|
export * from './core/base';
|
|
3
3
|
export * from './core/type';
|
|
4
4
|
export * from './scrollbar';
|
|
@@ -24,4 +24,5 @@ export * from './interface';
|
|
|
24
24
|
export * from './jsx';
|
|
25
25
|
export * from './checkbox';
|
|
26
26
|
export * from './radio';
|
|
27
|
+
export * from './empty-tip';
|
|
27
28
|
export * from './util';
|
package/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const version = "0.19.6-alpha.
|
|
1
|
+
export const version = "0.19.6-alpha.3";
|
|
2
2
|
|
|
3
3
|
export * from "./core/base";
|
|
4
4
|
|
|
@@ -50,5 +50,7 @@ export * from "./checkbox";
|
|
|
50
50
|
|
|
51
51
|
export * from "./radio";
|
|
52
52
|
|
|
53
|
+
export * from "./empty-tip";
|
|
54
|
+
|
|
53
55
|
export * from "./util";
|
|
54
56
|
//# sourceMappingURL=index.js.map
|
package/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.19.6-alpha.
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAExC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["// 导出版本号\nexport const version = \"0.19.6-alpha.3\";\n\nexport * from './core/base';\nexport * from './core/type';\nexport * from './scrollbar';\nexport * from './tag';\nexport * from './poptip';\nexport * from './crosshair';\nexport * from './label';\nexport * from './axis';\nexport * from './axis/grid';\nexport * from './segment';\nexport * from './data-zoom';\nexport * from './marker';\nexport * from './pager';\nexport * from './legend';\nexport * from './title';\nexport * from './indicator';\nexport * from './slider';\nexport * from './link-path';\nexport * from './player';\nexport * from './brush';\nexport * from './tooltip';\nexport * from './interface';\nexport * from './jsx';\nexport * from './checkbox';\nexport * from './radio';\nexport * from './empty-tip';\nexport * from './util';\n"]}
|
package/es/label/arc.js
CHANGED
package/es/label/index.js
CHANGED
package/es/label/rect.js
CHANGED
package/es/label/register.js
CHANGED
|
@@ -3,4 +3,4 @@ import { registerGroup, registerLine, registerRichtext, registerText } from "@vi
|
|
|
3
3
|
export function loadLabelComponent() {
|
|
4
4
|
registerGroup(), registerText(), registerRichtext(), registerLine();
|
|
5
5
|
}
|
|
6
|
-
//# sourceMappingURL=register.js.map
|
|
6
|
+
//# sourceMappingURL=register.js.map
|
package/es/label/symbol.js
CHANGED
package/es/label/type.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { };
|
|
2
|
-
//# sourceMappingURL=type.js.map
|
|
2
|
+
//# sourceMappingURL=type.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visactor/vrender-components",
|
|
3
|
-
"version": "0.19.6-alpha.
|
|
3
|
+
"version": "0.19.6-alpha.3",
|
|
4
4
|
"description": "components library for dp visualization",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "cjs/index.js",
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@visactor/vrender-core": "0.19.6-alpha.
|
|
16
|
-
"@visactor/vrender-kits": "0.19.6-alpha.
|
|
15
|
+
"@visactor/vrender-core": "0.19.6-alpha.3",
|
|
16
|
+
"@visactor/vrender-kits": "0.19.6-alpha.3",
|
|
17
17
|
"@visactor/vutils": "~0.18.9",
|
|
18
18
|
"@visactor/vscale": "~0.18.9"
|
|
19
19
|
},
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"vite": "3.2.6",
|
|
30
30
|
"typescript": "4.9.5",
|
|
31
31
|
"@internal/bundler": "0.0.1",
|
|
32
|
-
"@internal/
|
|
33
|
-
"@internal/
|
|
32
|
+
"@internal/eslint-config": "0.0.1",
|
|
33
|
+
"@internal/ts-config": "0.0.1"
|
|
34
34
|
},
|
|
35
35
|
"keywords": [
|
|
36
36
|
"VisActor",
|