@visactor/vrender-components 0.21.2-vstory.3 → 0.21.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.
- package/cjs/brush/brush.js +2 -1
- package/cjs/brush/type.js +1 -2
- package/cjs/core/base.d.ts +0 -1
- package/cjs/core/base.js +3 -3
- package/cjs/core/base.js.map +1 -1
- package/cjs/index.d.ts +1 -3
- package/cjs/index.js +2 -3
- package/cjs/index.js.map +1 -1
- package/cjs/interface.d.ts +1 -2
- package/cjs/interface.js.map +1 -1
- package/cjs/poptip/poptip.d.ts +2 -14
- package/cjs/poptip/poptip.js +51 -137
- package/cjs/poptip/poptip.js.map +1 -1
- package/cjs/poptip/type.d.ts +0 -6
- package/cjs/poptip/type.js.map +1 -1
- package/dist/index.es.js +4982 -5777
- package/es/brush/brush.js +2 -1
- package/es/brush/type.js +1 -2
- package/es/core/base.d.ts +0 -1
- package/es/core/base.js +3 -4
- package/es/core/base.js.map +1 -1
- package/es/index.d.ts +1 -3
- package/es/index.js +1 -5
- package/es/index.js.map +1 -1
- package/es/interface.d.ts +1 -2
- package/es/interface.js.map +1 -1
- package/es/poptip/poptip.d.ts +2 -14
- package/es/poptip/poptip.js +49 -136
- package/es/poptip/poptip.js.map +1 -1
- package/es/poptip/type.d.ts +0 -6
- package/es/poptip/type.js.map +1 -1
- package/package.json +4 -4
- package/cjs/label-item/index.d.ts +0 -2
- package/cjs/label-item/index.js +0 -21
- package/cjs/label-item/index.js.map +0 -1
- package/cjs/label-item/label-item.d.ts +0 -29
- package/cjs/label-item/label-item.js +0 -265
- package/cjs/label-item/label-item.js.map +0 -1
- package/cjs/label-item/register.d.ts +0 -1
- package/cjs/label-item/register.js +0 -15
- package/cjs/label-item/register.js.map +0 -1
- package/cjs/label-item/type.d.ts +0 -31
- package/cjs/label-item/type.js +0 -6
- package/cjs/label-item/type.js.map +0 -1
- package/cjs/weather/index.d.ts +0 -1
- package/cjs/weather/index.js +0 -21
- package/cjs/weather/index.js.map +0 -1
- package/cjs/weather/register.d.ts +0 -1
- package/cjs/weather/register.js +0 -14
- package/cjs/weather/register.js.map +0 -1
- package/cjs/weather/type.d.ts +0 -24
- package/cjs/weather/type.js +0 -6
- package/cjs/weather/type.js.map +0 -1
- package/cjs/weather/weather-box.d.ts +0 -13
- package/cjs/weather/weather-box.js +0 -129
- package/cjs/weather/weather-box.js.map +0 -1
- package/es/label-item/index.d.ts +0 -2
- package/es/label-item/index.js +0 -4
- package/es/label-item/index.js.map +0 -1
- package/es/label-item/label-item.d.ts +0 -29
- package/es/label-item/label-item.js +0 -263
- package/es/label-item/label-item.js.map +0 -1
- package/es/label-item/register.d.ts +0 -1
- package/es/label-item/register.js +0 -6
- package/es/label-item/register.js.map +0 -1
- package/es/label-item/type.d.ts +0 -31
- package/es/label-item/type.js +0 -2
- package/es/label-item/type.js.map +0 -1
- package/es/weather/index.d.ts +0 -1
- package/es/weather/index.js +0 -2
- package/es/weather/index.js.map +0 -1
- package/es/weather/register.d.ts +0 -1
- package/es/weather/register.js +0 -6
- package/es/weather/register.js.map +0 -1
- package/es/weather/type.d.ts +0 -24
- package/es/weather/type.js +0 -2
- package/es/weather/type.js.map +0 -1
- package/es/weather/weather-box.d.ts +0 -13
- package/es/weather/weather-box.js +0 -127
- package/es/weather/weather-box.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/label-item/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type {\n IGroupGraphicAttribute,\n ILineGraphicAttribute,\n IRectGraphicAttribute,\n ISymbolGraphicAttribute,\n ITextGraphicAttribute\n} from '@visactor/vrender-core';\nimport { ILineAttribute, ISymbolAttribute } from '@visactor/vrender-core';\n\nexport interface IStoryLabelItemAttrs extends IGroupGraphicAttribute {\n // 内容在X上的偏移量\n contentOffsetX: number;\n // 内容在Y上的偏移量\n contentOffsetY: number;\n lineStyle?: ILineGraphicAttribute;\n // 线段开始端点的样式\n symbolStartStyle?: ISymbolGraphicAttribute;\n // 线段结束端点的样式\n symbolEndStyle?: ISymbolGraphicAttribute;\n // 线段开始端点外面包裹symbol的样式\n symbolStartOuterStyle?: ISymbolGraphicAttribute;\n // 默认和简约两套主题\n theme?: 'default' | 'simple';\n // 顶部文字内容\n titleTop?: string | string[];\n // 底部文字内容\n titleBottom?: string | string[];\n // 顶部文字样式\n titleTopStyle?: ITextGraphicAttribute;\n // 底部文字样式\n titleBottomStyle?: ITextGraphicAttribute;\n // 水平和垂直方向的边距\n titleSpace?: [number, number];\n // 顶部的panel\n titleTopPanelStyle?: IRectGraphicAttribute & {\n padding: { left: number; right: number; top: number; bottom: number };\n };\n // 底部的panel\n titleBottomPanelStyle?: IRectGraphicAttribute & {\n padding: { left: number; right: number; top: number; bottom: number };\n };\n}\n"]}
|
package/cjs/weather/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './weather-box';
|
package/cjs/weather/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
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("./weather-box"), exports);
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/cjs/weather/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/weather/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B","file":"index.js","sourcesContent":["export * from './weather-box';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function loadWeatherComponent(): void;
|
package/cjs/weather/register.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.loadWeatherComponent = void 0;
|
|
6
|
-
|
|
7
|
-
const vrender_kits_1 = require("@visactor/vrender-kits");
|
|
8
|
-
|
|
9
|
-
function loadWeatherComponent() {
|
|
10
|
-
(0, vrender_kits_1.registerGroup)(), (0, vrender_kits_1.registerSymbol)();
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
exports.loadWeatherComponent = loadWeatherComponent;
|
|
14
|
-
//# sourceMappingURL=register.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/weather/register.ts"],"names":[],"mappings":";;;AAAA,yDAAuE;AAEvE,SAAgB,oBAAoB;IAClC,IAAA,4BAAa,GAAE,CAAC;IAChB,IAAA,6BAAc,GAAE,CAAC;AACnB,CAAC;AAHD,oDAGC","file":"register.js","sourcesContent":["import { registerGroup, registerSymbol } from '@visactor/vrender-kits';\n\nexport function loadWeatherComponent() {\n registerGroup();\n registerSymbol();\n}\n"]}
|
package/cjs/weather/type.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { IGroupGraphicAttribute, ISymbolGraphicAttribute } from '@visactor/vrender-core';
|
|
2
|
-
export interface IWeatherBoxAttrs extends IGroupGraphicAttribute {
|
|
3
|
-
rainIconPath?: string;
|
|
4
|
-
snowIconPath?: string;
|
|
5
|
-
windIconPath?: string;
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
rainSizeRange?: [number, number];
|
|
9
|
-
snowSizeRange?: [number, number];
|
|
10
|
-
windSize?: number;
|
|
11
|
-
rainSpeed?: number;
|
|
12
|
-
snowSpeed?: number;
|
|
13
|
-
windSpeed?: number;
|
|
14
|
-
snowRainBottomPadding?: number;
|
|
15
|
-
rainRatio?: number;
|
|
16
|
-
rainCountThreshold?: number;
|
|
17
|
-
snowRatio?: number;
|
|
18
|
-
snowCountThreshold?: number;
|
|
19
|
-
windRatio?: number;
|
|
20
|
-
windAnimateEffect?: 'fade' | 'clipRange';
|
|
21
|
-
rainStyle?: ISymbolGraphicAttribute;
|
|
22
|
-
snowStyle?: ISymbolGraphicAttribute;
|
|
23
|
-
windStyle?: ISymbolGraphicAttribute;
|
|
24
|
-
}
|
package/cjs/weather/type.js
DELETED
package/cjs/weather/type.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/weather/type.ts"],"names":[],"mappings":"","file":"type.js","sourcesContent":["import type { IGroupGraphicAttribute, IRectGraphicAttribute, ISymbolGraphicAttribute } from '@visactor/vrender-core';\n\nexport interface IWeatherBoxAttrs extends IGroupGraphicAttribute {\n rainIconPath?: string;\n snowIconPath?: string;\n windIconPath?: string;\n width: number;\n height: number;\n rainSizeRange?: [number, number];\n snowSizeRange?: [number, number];\n windSize?: number;\n rainSpeed?: number;\n snowSpeed?: number;\n windSpeed?: number;\n\n snowRainBottomPadding?: number;\n\n rainRatio?: number;\n rainCountThreshold?: number;\n snowRatio?: number;\n snowCountThreshold?: number;\n windRatio?: number;\n\n windAnimateEffect?: 'fade' | 'clipRange';\n\n rainStyle?: ISymbolGraphicAttribute;\n snowStyle?: ISymbolGraphicAttribute;\n windStyle?: ISymbolGraphicAttribute;\n}\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AbstractComponent } from '../core/base';
|
|
2
|
-
import type { IWeatherBoxAttrs } from './type';
|
|
3
|
-
import type { ComponentOptions } from '../interface';
|
|
4
|
-
import { type IGroup, type ITimeline } from '@visactor/vrender-core';
|
|
5
|
-
export declare class WeatherBox extends AbstractComponent<Required<IWeatherBoxAttrs>> {
|
|
6
|
-
name: string;
|
|
7
|
-
static defaultAttributes: Partial<IWeatherBoxAttrs>;
|
|
8
|
-
timeline: ITimeline;
|
|
9
|
-
constructor(attributes: IWeatherBoxAttrs, options?: ComponentOptions);
|
|
10
|
-
protected render(): void;
|
|
11
|
-
protected generateWind(windRatio: number, windIconPath: string, group: IGroup, size: number, speed: number): void;
|
|
12
|
-
protected generateRainOrSnow(type: string, ratio: number, threshold: number, windRatio: number, group: IGroup, path: string, windAngle: number, sizeRange: [number, number], speed: number): void;
|
|
13
|
-
}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: !0
|
|
5
|
-
}), exports.WeatherBox = void 0;
|
|
6
|
-
|
|
7
|
-
const base_1 = require("../core/base"), vutils_1 = require("@visactor/vutils"), vrender_core_1 = require("@visactor/vrender-core");
|
|
8
|
-
|
|
9
|
-
function random() {
|
|
10
|
-
return Math.random();
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function createUniformRandom(count) {
|
|
14
|
-
const result = [], step = 1 / count;
|
|
15
|
-
for (let i = 0; i < count; i++) result.push((random() - .5) * step / 2 + step * i);
|
|
16
|
-
result.sort((() => Math.random() - .5));
|
|
17
|
-
let idx = 0;
|
|
18
|
-
return function(i) {
|
|
19
|
-
return idx > count - 1 && (idx = 0), void 0 === i && (i = idx, idx++), result[i];
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
class WeatherBox extends base_1.AbstractComponent {
|
|
24
|
-
constructor(attributes, options) {
|
|
25
|
-
var _a;
|
|
26
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : (0, vutils_1.merge)({}, WeatherBox.defaultAttributes, attributes)),
|
|
27
|
-
this.name = "weatherBox", this.timeline = null !== (_a = null == options ? void 0 : options.timeline) && void 0 !== _a ? _a : new vrender_core_1.DefaultTimeline;
|
|
28
|
-
}
|
|
29
|
-
render() {
|
|
30
|
-
const {rainRatio: rainRatio, rainIconPath: rainIconPath, snowRatio: snowRatio, snowIconPath: snowIconPath, rainCountThreshold: rainCountThreshold, snowCountThreshold: snowCountThreshold, windRatio: windRatio, rainSizeRange: rainSizeRange, snowSizeRange: snowSizeRange, rainSpeed: rainSpeed, snowSpeed: snowSpeed, width: width, height: height, windIconPath: windIconPath, windSize: windSize, windSpeed: windSpeed} = this.attribute;
|
|
31
|
-
this.attribute.clip = !0;
|
|
32
|
-
const windAngle = -windRatio * Math.PI / 4, rainGroup = this.createOrUpdateChild("rain-container", {
|
|
33
|
-
zIndex: 1,
|
|
34
|
-
width: width,
|
|
35
|
-
height: height
|
|
36
|
-
}, "group");
|
|
37
|
-
rainRatio > 0 && this.generateRainOrSnow("rain", rainRatio, rainCountThreshold, windRatio, rainGroup, rainIconPath, windAngle, rainSizeRange, rainSpeed);
|
|
38
|
-
const snowGroup = this.createOrUpdateChild("snow-container", {
|
|
39
|
-
zIndex: 1,
|
|
40
|
-
width: width,
|
|
41
|
-
height: height
|
|
42
|
-
}, "group");
|
|
43
|
-
snowRatio > 0 && this.generateRainOrSnow("snow", snowRatio, snowCountThreshold, windRatio, snowGroup, snowIconPath, windAngle, snowSizeRange, snowSpeed);
|
|
44
|
-
const windGroup = this.createOrUpdateChild("wind-container", {
|
|
45
|
-
zIndex: 0,
|
|
46
|
-
width: width,
|
|
47
|
-
height: height
|
|
48
|
-
}, "group");
|
|
49
|
-
windRatio > 0 && this.generateWind(windRatio, windIconPath, windGroup, windSize, windSpeed);
|
|
50
|
-
}
|
|
51
|
-
generateWind(windRatio, windIconPath, group, size, speed) {
|
|
52
|
-
const {width: width, height: height} = group.attribute, {windAnimateEffect: windAnimateEffect, windStyle: windStyle = {}} = this.attribute;
|
|
53
|
-
let fromAttribute = {
|
|
54
|
-
opacity: 0,
|
|
55
|
-
clipRange: 1
|
|
56
|
-
}, toAttribute = {
|
|
57
|
-
opacity: 1,
|
|
58
|
-
clipRange: 1
|
|
59
|
-
};
|
|
60
|
-
"clipRange" === windAnimateEffect && (fromAttribute = {
|
|
61
|
-
clipRange: 0,
|
|
62
|
-
opacity: 1
|
|
63
|
-
}, toAttribute = {
|
|
64
|
-
clipRange: 1,
|
|
65
|
-
opacity: 1
|
|
66
|
-
});
|
|
67
|
-
const wind = group.createOrUpdateChild("wind", Object.assign(Object.assign({
|
|
68
|
-
x: (width - size) / 2,
|
|
69
|
-
y: (height - size) / 2,
|
|
70
|
-
symbolType: windIconPath,
|
|
71
|
-
size: size,
|
|
72
|
-
stroke: "white",
|
|
73
|
-
lineWidth: 2,
|
|
74
|
-
dx: -size / 2,
|
|
75
|
-
dy: -size / 2
|
|
76
|
-
}, windStyle), fromAttribute), "symbol"), duration = speed / 4 * 1e3;
|
|
77
|
-
new vrender_core_1.Animate(void 0, this.timeline).bind(wind).to(fromAttribute, duration, "linear").to(toAttribute, duration, "linear").wait(duration / 2).loop(1 / 0);
|
|
78
|
-
}
|
|
79
|
-
generateRainOrSnow(type, ratio, threshold, windRatio, group, path, windAngle, sizeRange, speed) {
|
|
80
|
-
let {width: width} = group.attribute;
|
|
81
|
-
const {height: height} = group.attribute, {snowRainBottomPadding: snowRainBottomPadding, rainStyle: rainStyle = {}, snowStyle: snowStyle = {}} = this.attribute;
|
|
82
|
-
let maxCount = Math.round(ratio * threshold);
|
|
83
|
-
windRatio > 0 && (maxCount *= Math.round(1 + windRatio)), width *= Math.round(1 + windRatio);
|
|
84
|
-
const uniformRandomX = createUniformRandom(maxCount), uniformRandomY = createUniformRandom(maxCount);
|
|
85
|
-
for (let i = 0; i < maxCount; i++) {
|
|
86
|
-
const x = uniformRandomX(), y = uniformRandomY(), size = sizeRange[0] + random() * (sizeRange[1] - sizeRange[0]), startX = x * width - (windAngle ? height * Math.tan(Math.abs(windAngle)) : 0), startY = -y * height, particle = group.createOrUpdateChild(`${type}-${i}`, Object.assign({
|
|
87
|
-
x: startX,
|
|
88
|
-
y: startY,
|
|
89
|
-
symbolType: path,
|
|
90
|
-
size: size,
|
|
91
|
-
fill: "white",
|
|
92
|
-
angle: windAngle
|
|
93
|
-
}, "rain" === type ? rainStyle : snowStyle), "symbol"), duration = 1 / speed / 2 * (1 + y) * 1e3;
|
|
94
|
-
let endX = x * width;
|
|
95
|
-
"rain" === type && windAngle && (endX = startX + (1 + y) * height * Math.tan(Math.abs(windAngle))),
|
|
96
|
-
new vrender_core_1.Animate(void 0, this.timeline).bind(particle).to({
|
|
97
|
-
x: endX,
|
|
98
|
-
y: height - snowRainBottomPadding
|
|
99
|
-
}, duration, "linear").loop(1 / 0), new vrender_core_1.Animate(void 0, this.timeline).bind(particle).to({
|
|
100
|
-
opacity: 0
|
|
101
|
-
}, duration, "quintIn").loop(1 / 0);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
exports.WeatherBox = WeatherBox, WeatherBox.defaultAttributes = {
|
|
107
|
-
snowIconPath: "M512 64c24.7 0 44.8 20.1 44.8 44.8v43.1l29.3-15.5c21.9-11.6 49-3.2 60.5 18.7s3.2 49-18.7 60.5l-71.2 37.6v85.2c32 8.2 60.6 25.1 83.1 48l73.8-42.6-3-80.4c-0.9-24.7 18.4-45.5 43.1-46.4 24.7-0.9 45.5 18.4 46.4 43.1l1.2 33.1 37.3-21.5c21.4-12.4 48.8-5 61.2 16.4 12.4 21.4 5 48.8-16.4 61.2l-37.3 21.5 28.1 17.6c21 13.2 27.3 40.8 14.1 61.8-13.2 20.9-40.8 27.3-61.8 14.1l-68.2-42.8-73.6 42.5c4.2 15.3 6.5 31.4 6.5 48s-2.3 32.7-6.5 48l73.8 42.6 68.2-42.8c20.9-13.2 48.6-6.8 61.8 14.1 13.2 21 6.8 48.6-14.1 61.8l-28.1 17.6 37.3 21.5c21.4 12.4 28.8 39.8 16.4 61.2-12.4 21.4-39.8 28.8-61.2 16.4l-37.3-21.5-1.2 33.1c-0.9 24.7-21.7 44-46.4 43.1-24.7-0.9-44-21.7-43.1-46.4l3-80.4-73.8-42.6c-22.5 22.9-51 39.8-83.1 48v85.2l71.2 37.6c21.9 11.6 30.2 38.7 18.7 60.5-11.6 21.9-38.7 30.2-60.5 18.7L557 872.2v43.1c0 24.7-20.1 44.8-44.8 44.8-24.7 0-44.8-20.1-44.8-44.8v-43.1l-29.3 15.5c-21.9 11.6-49 3.2-60.5-18.7-11.6-21.9-3.2-49 18.7-60.5l71.2-37.6v-85.2c-32-8.2-60.6-25.1-83.1-48l-73.8 42.6 3 80.4c0.9 24.7-18.4 45.5-43.1 46.4-24.7 0.9-45.5-18.4-46.4-43.1l-1.2-33.1-37.3 21.5c-21.4 12.4-48.8 5-61.2-16.4s-5-48.8 16.4-61.2l37.3-21.5-28.1-17.6c-21-13.2-27.3-40.8-14.1-61.8 13.2-20.9 40.8-27.3 61.8-14.1l68.2 42.8 73.8-42.6c-4.2-15.3-6.5-31.4-6.5-48s2.3-32.7 6.5-48l-73.8-42.6-68.2 42.8c-21 13.2-48.6 6.8-61.8-14.1-13.2-21-6.8-48.6 14.1-61.8l28.1-17.6-37.3-21.5C119 336.8 111.7 309.4 124 288c12.4-21.4 39.8-28.8 61.2-16.4l37.3 21.5 1.2-33.1c0.9-24.7 21.7-44 46.4-43.1 24.7 0.9 44 21.7 43.1 46.4l-3 80.4 73.8 42.6c22.5-22.9 51-39.8 83.1-48v-85.2L396 215.6c-21.9-11.6-30.2-38.7-18.7-60.5 11.6-21.9 38.7-30.2 60.5-18.7l29.3 15.5v-43.1C467.2 84.1 487.3 64 512 64z m0 537.6c49.5 0 89.6-40.1 89.6-89.6s-40.1-89.6-89.6-89.6-89.6 40.1-89.6 89.6 40.1 89.6 89.6 89.6z",
|
|
108
|
-
rainIconPath: "M802.94208 583.04c19.328 38.016 29.056 78.336 29.056 120.96a313.216 313.216 0 0 1-44.032 161.536 324.48 324.48 0 0 1-114.56 114.944c-23.552 13.696-49.024 24.32-76.416 32-27.264 7.68-55.68 11.52-84.992 11.52-29.44 0-57.6-3.84-84.992-11.52a331.136 331.136 0 0 1-76.544-32 337.536 337.536 0 0 1-65.024-49.92 337.536 337.536 0 0 1-49.92-65.024 331.136 331.136 0 0 1-32-76.544A313.216 313.216 0 0 1 191.99808 704c0-42.24 9.344-82.56 28.032-120.448L509.43808 0l293.504 583.04z",
|
|
109
|
-
windIconPath: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M 4.0003 14.0002 L 12.0003 14.0008 M 12.0003 14.0008 C 13.1049 14.0009 14.0003 14.8964 14.0002 16.001 C 14.0001 17.1055 13.1046 18.0009 12 18.0008 L 10.5 18.0007" stroke-linecap="round" stroke-linejoin="round"/>\n <path d="M 7 10.0002 L 14.5 10.0008 C 15.6046 10.0009 16.5001 9.1055 16.5002 8.001 C 16.5003 6.8964 15.6049 6.0009 14.5003 6.0008 L 13.0003 6.0007" stroke-linecap="round" stroke-linejoin="round"/>\n </svg>',
|
|
110
|
-
windRatio: 0,
|
|
111
|
-
rainRatio: 0,
|
|
112
|
-
snowRatio: 0,
|
|
113
|
-
rainCountThreshold: 10,
|
|
114
|
-
snowCountThreshold: 10,
|
|
115
|
-
rainSizeRange: [ 5, 10 ],
|
|
116
|
-
snowSizeRange: [ 5, 13 ],
|
|
117
|
-
windSize: 30,
|
|
118
|
-
rainSpeed: 1,
|
|
119
|
-
snowSpeed: .5,
|
|
120
|
-
windSpeed: 1,
|
|
121
|
-
windAnimateEffect: "fade",
|
|
122
|
-
rainStyle: {},
|
|
123
|
-
snowStyle: {},
|
|
124
|
-
windStyle: {
|
|
125
|
-
opacity: .8
|
|
126
|
-
},
|
|
127
|
-
snowRainBottomPadding: 0
|
|
128
|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AC,CAAC,CAAC;aAClE;YACD,IAAI,sBAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC;iBAC/B,IAAI,CAAC,QAAQ,CAAC;iBACd,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,GAAG,qBAAqB,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC;iBACtE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAClB,IAAI,sBAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SAC1G;IACH,CAAC;;AA9LH,gCA+LC;AA5LQ,4BAAiB,GAA8B;IACpD,YAAY,EACV,wsDAAwsD;IAC1sD,YAAY,EACV,wdAAwd;IAC1d,YAAY,EAAE;;;WAGP;IACP,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,CAAC;IACZ,kBAAkB,EAAE,EAAE;IACtB,kBAAkB,EAAE,EAAE;IACtB,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IACtB,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;IACtB,QAAQ,EAAE,EAAE;IACZ,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,GAAG;IACd,SAAS,EAAE,CAAC;IACZ,iBAAiB,EAAE,MAAM;IACzB,SAAS,EAAE,EAAE;IACb,SAAS,EAAE,EAAE;IACb,SAAS,EAAE;QACT,OAAO,EAAE,GAAG;KACb;IACD,qBAAqB,EAAE,CAAC;CACzB,CAAC","file":"weather-box.js","sourcesContent":["import { AbstractComponent } from '../core/base';\nimport type { IWeatherBoxAttrs } from './type';\nimport type { ComponentOptions } from '../interface';\nimport { merge } from '@visactor/vutils';\nimport { Animate, DefaultTimeline, type IGroup, type ISymbol, type ITimeline } from '@visactor/vrender-core';\n\n// todo 后续可能做成有随机数种子的伪随机,这样可以保证每次都生成一样的随机数\nfunction random() {\n return Math.random();\n}\n\nfunction createUniformRandom(count: number) {\n const result: number[] = [];\n const step = 1 / count;\n for (let i = 0; i < count; i++) {\n result.push(((random() - 0.5) * step) / 2 + step * i);\n }\n result.sort(() => Math.random() - 0.5);\n let idx = 0;\n return function (i?: number) {\n if (idx > count - 1) {\n idx = 0;\n }\n if (i === void 0) {\n i = idx;\n idx++;\n }\n return result[i];\n };\n}\n\nexport class WeatherBox extends AbstractComponent<Required<IWeatherBoxAttrs>> {\n name: string = 'weatherBox';\n\n static defaultAttributes: Partial<IWeatherBoxAttrs> = {\n snowIconPath:\n 'M512 64c24.7 0 44.8 20.1 44.8 44.8v43.1l29.3-15.5c21.9-11.6 49-3.2 60.5 18.7s3.2 49-18.7 60.5l-71.2 37.6v85.2c32 8.2 60.6 25.1 83.1 48l73.8-42.6-3-80.4c-0.9-24.7 18.4-45.5 43.1-46.4 24.7-0.9 45.5 18.4 46.4 43.1l1.2 33.1 37.3-21.5c21.4-12.4 48.8-5 61.2 16.4 12.4 21.4 5 48.8-16.4 61.2l-37.3 21.5 28.1 17.6c21 13.2 27.3 40.8 14.1 61.8-13.2 20.9-40.8 27.3-61.8 14.1l-68.2-42.8-73.6 42.5c4.2 15.3 6.5 31.4 6.5 48s-2.3 32.7-6.5 48l73.8 42.6 68.2-42.8c20.9-13.2 48.6-6.8 61.8 14.1 13.2 21 6.8 48.6-14.1 61.8l-28.1 17.6 37.3 21.5c21.4 12.4 28.8 39.8 16.4 61.2-12.4 21.4-39.8 28.8-61.2 16.4l-37.3-21.5-1.2 33.1c-0.9 24.7-21.7 44-46.4 43.1-24.7-0.9-44-21.7-43.1-46.4l3-80.4-73.8-42.6c-22.5 22.9-51 39.8-83.1 48v85.2l71.2 37.6c21.9 11.6 30.2 38.7 18.7 60.5-11.6 21.9-38.7 30.2-60.5 18.7L557 872.2v43.1c0 24.7-20.1 44.8-44.8 44.8-24.7 0-44.8-20.1-44.8-44.8v-43.1l-29.3 15.5c-21.9 11.6-49 3.2-60.5-18.7-11.6-21.9-3.2-49 18.7-60.5l71.2-37.6v-85.2c-32-8.2-60.6-25.1-83.1-48l-73.8 42.6 3 80.4c0.9 24.7-18.4 45.5-43.1 46.4-24.7 0.9-45.5-18.4-46.4-43.1l-1.2-33.1-37.3 21.5c-21.4 12.4-48.8 5-61.2-16.4s-5-48.8 16.4-61.2l37.3-21.5-28.1-17.6c-21-13.2-27.3-40.8-14.1-61.8 13.2-20.9 40.8-27.3 61.8-14.1l68.2 42.8 73.8-42.6c-4.2-15.3-6.5-31.4-6.5-48s2.3-32.7 6.5-48l-73.8-42.6-68.2 42.8c-21 13.2-48.6 6.8-61.8-14.1-13.2-21-6.8-48.6 14.1-61.8l28.1-17.6-37.3-21.5C119 336.8 111.7 309.4 124 288c12.4-21.4 39.8-28.8 61.2-16.4l37.3 21.5 1.2-33.1c0.9-24.7 21.7-44 46.4-43.1 24.7 0.9 44 21.7 43.1 46.4l-3 80.4 73.8 42.6c22.5-22.9 51-39.8 83.1-48v-85.2L396 215.6c-21.9-11.6-30.2-38.7-18.7-60.5 11.6-21.9 38.7-30.2 60.5-18.7l29.3 15.5v-43.1C467.2 84.1 487.3 64 512 64z m0 537.6c49.5 0 89.6-40.1 89.6-89.6s-40.1-89.6-89.6-89.6-89.6 40.1-89.6 89.6 40.1 89.6 89.6 89.6z',\n rainIconPath:\n 'M802.94208 583.04c19.328 38.016 29.056 78.336 29.056 120.96a313.216 313.216 0 0 1-44.032 161.536 324.48 324.48 0 0 1-114.56 114.944c-23.552 13.696-49.024 24.32-76.416 32-27.264 7.68-55.68 11.52-84.992 11.52-29.44 0-57.6-3.84-84.992-11.52a331.136 331.136 0 0 1-76.544-32 337.536 337.536 0 0 1-65.024-49.92 337.536 337.536 0 0 1-49.92-65.024 331.136 331.136 0 0 1-32-76.544A313.216 313.216 0 0 1 191.99808 704c0-42.24 9.344-82.56 28.032-120.448L509.43808 0l293.504 583.04z',\n windIconPath: `<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M 4.0003 14.0002 L 12.0003 14.0008 M 12.0003 14.0008 C 13.1049 14.0009 14.0003 14.8964 14.0002 16.001 C 14.0001 17.1055 13.1046 18.0009 12 18.0008 L 10.5 18.0007\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M 7 10.0002 L 14.5 10.0008 C 15.6046 10.0009 16.5001 9.1055 16.5002 8.001 C 16.5003 6.8964 15.6049 6.0009 14.5003 6.0008 L 13.0003 6.0007\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n </svg>`,\n windRatio: 0,\n rainRatio: 0,\n snowRatio: 0,\n rainCountThreshold: 10,\n snowCountThreshold: 10,\n rainSizeRange: [5, 10],\n snowSizeRange: [5, 13],\n windSize: 30,\n rainSpeed: 1,\n snowSpeed: 0.5,\n windSpeed: 1,\n windAnimateEffect: 'fade',\n rainStyle: {},\n snowStyle: {},\n windStyle: {\n opacity: 0.8\n },\n snowRainBottomPadding: 0\n };\n\n timeline: ITimeline;\n\n constructor(attributes: IWeatherBoxAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, WeatherBox.defaultAttributes, attributes));\n this.timeline = options?.timeline ?? new DefaultTimeline();\n }\n\n protected render(): void {\n const {\n rainRatio,\n rainIconPath,\n snowRatio,\n snowIconPath,\n rainCountThreshold,\n snowCountThreshold,\n windRatio,\n rainSizeRange,\n snowSizeRange,\n rainSpeed,\n snowSpeed,\n width,\n height,\n windIconPath,\n windSize,\n windSpeed\n } = this.attribute as IWeatherBoxAttrs;\n\n this.attribute.clip = true;\n\n // 计算风速导致的偏转角度\n const windAngle = (-windRatio * Math.PI) / 4;\n\n const rainGroup = this.createOrUpdateChild('rain-container', { zIndex: 1, width, height }, 'group') as IGroup;\n if (rainRatio > 0) {\n this.generateRainOrSnow(\n 'rain',\n rainRatio,\n rainCountThreshold,\n windRatio,\n rainGroup,\n rainIconPath,\n windAngle,\n rainSizeRange,\n rainSpeed\n );\n }\n const snowGroup = this.createOrUpdateChild('snow-container', { zIndex: 1, width, height }, 'group') as IGroup;\n if (snowRatio > 0) {\n this.generateRainOrSnow(\n 'snow',\n snowRatio,\n snowCountThreshold,\n windRatio,\n snowGroup,\n snowIconPath,\n windAngle,\n snowSizeRange,\n snowSpeed\n );\n }\n\n const windGroup = this.createOrUpdateChild('wind-container', { zIndex: 0, width, height }, 'group') as IGroup;\n if (windRatio > 0) {\n this.generateWind(windRatio, windIconPath, windGroup, windSize, windSpeed);\n }\n }\n\n protected generateWind(windRatio: number, windIconPath: string, group: IGroup, size: number, speed: number) {\n const { width, height } = group.attribute;\n const { windAnimateEffect, windStyle = {} } = this.attribute;\n\n let fromAttribute = { opacity: 0, clipRange: 1 };\n let toAttribute = { opacity: 1, clipRange: 1 };\n if (windAnimateEffect === 'clipRange') {\n fromAttribute = { clipRange: 0, opacity: 1 };\n toAttribute = { clipRange: 1, opacity: 1 };\n }\n const wind = group.createOrUpdateChild(\n `wind`,\n {\n x: (width - size) / 2,\n y: (height - size) / 2,\n symbolType: windIconPath,\n size,\n stroke: 'white',\n lineWidth: 2,\n dx: -size / 2,\n dy: -size / 2,\n ...windStyle,\n ...fromAttribute\n },\n 'symbol'\n ) as ISymbol;\n\n const duration = (speed / 4) * 1000;\n\n new Animate(void 0, this.timeline)\n .bind(wind)\n .to(fromAttribute, duration, 'linear')\n .to(toAttribute, duration, 'linear')\n .wait(duration / 2)\n .loop(Infinity);\n }\n\n protected generateRainOrSnow(\n type: string,\n ratio: number,\n threshold: number,\n windRatio: number,\n group: IGroup,\n path: string,\n windAngle: number,\n sizeRange: [number, number],\n speed: number\n ) {\n let { width } = group.attribute;\n const { height } = group.attribute;\n const { snowRainBottomPadding, rainStyle = {}, snowStyle = {} } = this.attribute;\n let maxCount = Math.round(ratio * threshold);\n // 由于风速,雨雪粒子会偏转,所以需要增加粒子数量\n if (windRatio > 0) {\n maxCount = maxCount * Math.round(1 + windRatio);\n }\n width = width * Math.round(1 + windRatio);\n const uniformRandomX = createUniformRandom(maxCount);\n const uniformRandomY = createUniformRandom(maxCount);\n for (let i = 0; i < maxCount; i++) {\n const x = uniformRandomX();\n const y = uniformRandomY();\n const size = sizeRange[0] + random() * (sizeRange[1] - sizeRange[0]);\n\n const deltaX = windAngle ? height * Math.tan(Math.abs(windAngle)) : 0;\n const startX = x * width - deltaX;\n const startY = -y * height;\n const particle = group.createOrUpdateChild(\n `${type}-${i}`,\n {\n x: startX,\n y: startY,\n symbolType: path,\n size,\n fill: 'white',\n angle: windAngle,\n ...(type === 'rain' ? rainStyle : snowStyle)\n },\n 'symbol'\n ) as ISymbol;\n const duration = (1 / speed / 2) * (1 + y) * 1000;\n let endX = x * width;\n if (type === 'rain' && windAngle) {\n endX = startX + (1 + y) * height * Math.tan(Math.abs(windAngle));\n }\n new Animate(void 0, this.timeline)\n .bind(particle)\n .to({ x: endX, y: height - snowRainBottomPadding }, duration, 'linear')\n .loop(Infinity);\n new Animate(void 0, this.timeline).bind(particle).to({ opacity: 0 }, duration, 'quintIn').loop(Infinity);\n }\n }\n}\n"]}
|
package/es/label-item/index.d.ts
DELETED
package/es/label-item/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/label-item/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC","file":"index.js","sourcesContent":["export * from './label-item';\nexport * from './type';\n"]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { AbstractComponent } from '../core/base';
|
|
2
|
-
import type { IStoryLabelItemAttrs } from './type';
|
|
3
|
-
import type { ComponentOptions } from '../interface';
|
|
4
|
-
export declare class StoryLabelItem extends AbstractComponent<Required<IStoryLabelItemAttrs>> {
|
|
5
|
-
name: 'labelItem';
|
|
6
|
-
private _line?;
|
|
7
|
-
private _symbolStart;
|
|
8
|
-
private _symbolEnd;
|
|
9
|
-
private _symbolStartOuter;
|
|
10
|
-
private _titleTop;
|
|
11
|
-
private _titleBottom;
|
|
12
|
-
private _titleTopPanel;
|
|
13
|
-
private _titleBottomPanel;
|
|
14
|
-
static defaultAttributes: Partial<IStoryLabelItemAttrs>;
|
|
15
|
-
constructor(attributes: IStoryLabelItemAttrs, options?: ComponentOptions);
|
|
16
|
-
protected render(): void;
|
|
17
|
-
appearAnimate(animateConfig: {
|
|
18
|
-
duration?: number;
|
|
19
|
-
easing?: string;
|
|
20
|
-
symbolStartOuterType?: 'scale' | 'clipRange';
|
|
21
|
-
titleType?: 'typewriter' | 'move';
|
|
22
|
-
titlePanelType?: 'scale' | 'stroke';
|
|
23
|
-
}): void;
|
|
24
|
-
disappearAnimate(animateConfig: {
|
|
25
|
-
duration?: number;
|
|
26
|
-
easing?: string;
|
|
27
|
-
mode?: 'scale' | 'default';
|
|
28
|
-
}): void;
|
|
29
|
-
}
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import { InputText } from "@visactor/vrender-core";
|
|
2
|
-
|
|
3
|
-
import { AbstractComponent } from "../core/base";
|
|
4
|
-
|
|
5
|
-
import { merge } from "@visactor/vutils";
|
|
6
|
-
|
|
7
|
-
export class StoryLabelItem extends AbstractComponent {
|
|
8
|
-
constructor(attributes, options) {
|
|
9
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge({}, StoryLabelItem.defaultAttributes, attributes));
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
const {contentOffsetX: contentOffsetX, contentOffsetY: contentOffsetY, lineStyle: lineStyle, symbolStartStyle: symbolStartStyle, symbolEndStyle: symbolEndStyle, symbolStartOuterStyle: symbolStartOuterStyle, titleTop: titleTopText, titleBottom: titleBottomText, titleTopStyle: titleTopStyle, titleBottomStyle: titleBottomStyle, titleSpace: titleSpace, titleTopPanelStyle: titleTopPanelStyle, titleBottomPanelStyle: titleBottomPanelStyle, theme: theme} = this.attribute, group = this.createOrUpdateChild("label-item-container", {
|
|
13
|
-
x: 0,
|
|
14
|
-
y: 0,
|
|
15
|
-
zIndex: 1
|
|
16
|
-
}, "group"), symbolStart = group.createOrUpdateChild("label-item-symbol-start", Object.assign({
|
|
17
|
-
x: 0,
|
|
18
|
-
y: 0
|
|
19
|
-
}, symbolStartStyle), "symbol"), symbolEnd = group.createOrUpdateChild("label-item-symbol-end", Object.assign({
|
|
20
|
-
x: contentOffsetX,
|
|
21
|
-
y: contentOffsetY
|
|
22
|
-
}, symbolEndStyle), "symbol"), symbolStartOut = group.createOrUpdateChild("label-item-symbol-start-out", Object.assign({
|
|
23
|
-
x: 0,
|
|
24
|
-
y: 0
|
|
25
|
-
}, symbolStartOuterStyle), "symbol"), spaceW = titleSpace[0], spaceH = titleSpace[1], titleTopGroup = group.createOrUpdateChild("label-item-title-top-group", {
|
|
26
|
-
x: contentOffsetX,
|
|
27
|
-
y: contentOffsetY,
|
|
28
|
-
clip: !0
|
|
29
|
-
}, "group"), titleTop = titleTopGroup.createOrUpdateChild("label-item-title-top", Object.assign(Object.assign({
|
|
30
|
-
x: spaceW,
|
|
31
|
-
y: -spaceH,
|
|
32
|
-
text: titleTopText
|
|
33
|
-
}, titleTopStyle), {
|
|
34
|
-
textBaseline: "bottom",
|
|
35
|
-
textAlign: "left",
|
|
36
|
-
zIndex: 10
|
|
37
|
-
}), "text"), titleTopBounds = titleTop.AABBBounds;
|
|
38
|
-
contentOffsetX > 0 && titleTopGroup.setAttributes({
|
|
39
|
-
x: contentOffsetX - titleTopBounds.width() - 2 * spaceW
|
|
40
|
-
}), titleTopGroup.setAttributes({
|
|
41
|
-
width: titleTopBounds.width() + 2 * spaceW,
|
|
42
|
-
height: -titleTopBounds.height() - 2 * spaceH
|
|
43
|
-
});
|
|
44
|
-
const titleTopPanel = titleTopGroup.createOrUpdateChild("label-item-title-top-panel", Object.assign(Object.assign({}, titleTopPanelStyle), {
|
|
45
|
-
x: titleTopPanelStyle.padding.left,
|
|
46
|
-
y: (titleTopGroup.attribute.height > 0 ? 0 : titleTopGroup.attribute.height) + titleTopPanelStyle.padding.top,
|
|
47
|
-
width: titleTopGroup.attribute.width - titleTopPanelStyle.padding.left - titleTopPanelStyle.padding.right,
|
|
48
|
-
height: (titleTopGroup.attribute.height > 0 ? 1 : -1) * titleTopGroup.attribute.height - titleTopPanelStyle.padding.bottom - titleTopPanelStyle.padding.top,
|
|
49
|
-
scaleCenter: [ titleTopGroup.attribute.width / 2, titleTopGroup.attribute.height / 2 ]
|
|
50
|
-
}), "rect");
|
|
51
|
-
this._titleTopPanel = titleTopPanel;
|
|
52
|
-
const titleBottomGroup = group.createOrUpdateChild("label-item-title-bottom-group", {
|
|
53
|
-
x: contentOffsetX,
|
|
54
|
-
y: contentOffsetY,
|
|
55
|
-
clip: !0
|
|
56
|
-
}, "group"), titleBottom = titleBottomGroup.createOrUpdateChild("label-item-title-bottom", Object.assign(Object.assign({
|
|
57
|
-
x: spaceW,
|
|
58
|
-
y: spaceH,
|
|
59
|
-
text: titleBottomText
|
|
60
|
-
}, titleBottomStyle), {
|
|
61
|
-
textBaseline: "top",
|
|
62
|
-
textAlign: "left",
|
|
63
|
-
zIndex: 10
|
|
64
|
-
}), "text"), titleBottomBounds = titleBottom.AABBBounds;
|
|
65
|
-
contentOffsetX > 0 && titleBottomGroup.setAttributes({
|
|
66
|
-
x: contentOffsetX - titleBottomBounds.width() - 2 * spaceW
|
|
67
|
-
}), titleBottomGroup.setAttributes({
|
|
68
|
-
width: titleBottomBounds.width() + 2 * spaceW,
|
|
69
|
-
height: titleTopBounds.height() + 2 * spaceH
|
|
70
|
-
});
|
|
71
|
-
const titleBottomPanel = titleBottomGroup.createOrUpdateChild("label-item-title-bottom-panel", Object.assign(Object.assign({}, titleBottomPanelStyle), {
|
|
72
|
-
x: titleBottomPanelStyle.padding.left,
|
|
73
|
-
y: (titleBottomGroup.attribute.height > 0 ? 0 : titleBottomGroup.attribute.height) + titleBottomPanelStyle.padding.top,
|
|
74
|
-
width: titleBottomGroup.attribute.width - titleBottomPanelStyle.padding.left - titleBottomPanelStyle.padding.right,
|
|
75
|
-
height: (titleBottomGroup.attribute.height > 0 ? 1 : -1) * titleBottomGroup.attribute.height - titleBottomPanelStyle.padding.bottom - titleBottomPanelStyle.padding.top,
|
|
76
|
-
scaleCenter: [ titleBottomGroup.attribute.width / 2, titleBottomGroup.attribute.height / 2 ]
|
|
77
|
-
}), "rect");
|
|
78
|
-
this._titleBottomPanel = titleBottomPanel;
|
|
79
|
-
const maxTextWidth = Math.max(titleTop.AABBBounds.width(), titleBottom.AABBBounds.width()) + 2 * spaceW, points = [ {
|
|
80
|
-
x: 0,
|
|
81
|
-
y: 0
|
|
82
|
-
}, contentOffsetX > 0 ? {
|
|
83
|
-
x: contentOffsetX - maxTextWidth,
|
|
84
|
-
y: contentOffsetY
|
|
85
|
-
} : {
|
|
86
|
-
x: contentOffsetX + maxTextWidth,
|
|
87
|
-
y: contentOffsetY
|
|
88
|
-
}, {
|
|
89
|
-
x: contentOffsetX,
|
|
90
|
-
y: contentOffsetY
|
|
91
|
-
} ];
|
|
92
|
-
if ("simple" === theme) {
|
|
93
|
-
points.pop();
|
|
94
|
-
const p = points[1];
|
|
95
|
-
symbolEnd.setAttributes(p);
|
|
96
|
-
}
|
|
97
|
-
const line = group.createOrUpdateChild("label-item-line", Object.assign(Object.assign({
|
|
98
|
-
x: 0,
|
|
99
|
-
y: 0
|
|
100
|
-
}, lineStyle), {
|
|
101
|
-
points: points
|
|
102
|
-
}), "line");
|
|
103
|
-
this._symbolEnd = symbolEnd, this._symbolStart = symbolStart, this._symbolStartOuter = symbolStartOut,
|
|
104
|
-
this._titleTop = titleTop, this._titleBottom = titleBottom, this._line = line;
|
|
105
|
-
}
|
|
106
|
-
appearAnimate(animateConfig) {
|
|
107
|
-
const {duration: duration = 1e3, easing: easing = "quadOut", symbolStartOuterType: symbolStartOuterType = "scale", titleType: titleType = "typewriter", titlePanelType: titlePanelType = "scale"} = animateConfig, symbolTime = duration / 10;
|
|
108
|
-
let symbolStartOuterFrom, symbolStartOuterTo;
|
|
109
|
-
if (this._symbolStart.setAttributes({
|
|
110
|
-
scaleX: 0,
|
|
111
|
-
scaleY: 0
|
|
112
|
-
}), this._symbolStart.animate().to({
|
|
113
|
-
scaleX: 1,
|
|
114
|
-
scaleY: 1
|
|
115
|
-
}, 5 * symbolTime, easing), "scale" === symbolStartOuterType ? (symbolStartOuterFrom = {
|
|
116
|
-
scaleX: 0,
|
|
117
|
-
scaleY: 0
|
|
118
|
-
}, symbolStartOuterTo = {
|
|
119
|
-
scaleX: 1,
|
|
120
|
-
scaleY: 1
|
|
121
|
-
}) : (symbolStartOuterFrom = {
|
|
122
|
-
clipRange: 0
|
|
123
|
-
}, symbolStartOuterTo = {
|
|
124
|
-
clipRange: 1
|
|
125
|
-
}), this._symbolStartOuter.setAttributes(symbolStartOuterFrom), this._symbolStartOuter.animate().to(symbolStartOuterTo, 5 * symbolTime, easing),
|
|
126
|
-
this._symbolEnd.setAttributes({
|
|
127
|
-
scaleX: 0,
|
|
128
|
-
scaleY: 0
|
|
129
|
-
}), this._symbolEnd.animate().wait(8 * symbolTime).to({
|
|
130
|
-
scaleX: 1,
|
|
131
|
-
scaleY: 1
|
|
132
|
-
}, 2 * symbolTime, easing), this._line.setAttributes({
|
|
133
|
-
clipRange: 0
|
|
134
|
-
}), this._line.animate().to({
|
|
135
|
-
clipRange: 1
|
|
136
|
-
}, 9 * symbolTime, easing), "typewriter" === titleType) {
|
|
137
|
-
const titleTopText = this._titleTop.attribute.text;
|
|
138
|
-
this._titleTop.setAttributes({
|
|
139
|
-
text: ""
|
|
140
|
-
}), this._titleTop.animate().wait(5 * symbolTime).play(new InputText({
|
|
141
|
-
text: ""
|
|
142
|
-
}, {
|
|
143
|
-
text: titleTopText
|
|
144
|
-
}, 4 * symbolTime, "linear"));
|
|
145
|
-
const titleBottomText = this._titleBottom.attribute.text;
|
|
146
|
-
this._titleBottom.setAttributes({
|
|
147
|
-
text: ""
|
|
148
|
-
}), this._titleBottom.animate().wait(5 * symbolTime).play(new InputText({
|
|
149
|
-
text: ""
|
|
150
|
-
}, {
|
|
151
|
-
text: titleBottomText
|
|
152
|
-
}, 4 * symbolTime, "linear"));
|
|
153
|
-
} else this._titleTop.setAttributes({
|
|
154
|
-
dy: this._titleTop.AABBBounds.height() + 10
|
|
155
|
-
}), this._titleTop.animate().wait(5 * symbolTime).to({
|
|
156
|
-
dy: 0
|
|
157
|
-
}, 4 * symbolTime, "linear"), this._titleBottom.setAttributes({
|
|
158
|
-
dy: -(10 + this._titleBottom.AABBBounds.height())
|
|
159
|
-
}), this._titleBottom.animate().wait(5 * symbolTime).to({
|
|
160
|
-
dy: 0
|
|
161
|
-
}, 4 * symbolTime, "linear");
|
|
162
|
-
"scale" === titlePanelType ? [ this._titleTopPanel, this._titleBottomPanel ].forEach((panel => {
|
|
163
|
-
const scaleX = panel.attribute.scaleX;
|
|
164
|
-
panel.setAttributes({
|
|
165
|
-
scaleX: 0
|
|
166
|
-
}), panel.animate().to({
|
|
167
|
-
scaleX: scaleX
|
|
168
|
-
}, duration, "circInOut");
|
|
169
|
-
})) : "stroke" === titlePanelType && [ this._titleTopPanel, this._titleBottomPanel ].forEach((panel => {
|
|
170
|
-
const b = panel.AABBBounds, totalLen = 2 * (b.width() + b.height());
|
|
171
|
-
panel.setAttributes({
|
|
172
|
-
lineDash: [ 0, 10 * totalLen ]
|
|
173
|
-
}), panel.animate().to({
|
|
174
|
-
lineDash: [ totalLen, 10 * totalLen ]
|
|
175
|
-
}, duration, "quadOut");
|
|
176
|
-
}));
|
|
177
|
-
}
|
|
178
|
-
disappearAnimate(animateConfig) {
|
|
179
|
-
if ("scale" === animateConfig.mode) {
|
|
180
|
-
const {duration: duration = 1e3, easing: easing = "quadOut"} = animateConfig;
|
|
181
|
-
this.animate().to({
|
|
182
|
-
scaleX: 0,
|
|
183
|
-
scaleY: 0
|
|
184
|
-
}, duration, easing);
|
|
185
|
-
} else {
|
|
186
|
-
const {duration: duration = 1e3, easing: easing = "quadOut"} = animateConfig;
|
|
187
|
-
this._line.animate().to({
|
|
188
|
-
clipRange: 0
|
|
189
|
-
}, duration, easing), this._symbolStart.animate().wait(duration / 2).to({
|
|
190
|
-
scaleX: 0,
|
|
191
|
-
scaleY: 0
|
|
192
|
-
}, duration / 2, easing), this._symbolEnd.animate().to({
|
|
193
|
-
scaleX: 0,
|
|
194
|
-
scaleY: 0
|
|
195
|
-
}, duration, easing), this._titleTop.animate().to({
|
|
196
|
-
dy: this._titleTop.AABBBounds.height() + 10
|
|
197
|
-
}, duration / 2, easing), this._titleBottom.animate().to({
|
|
198
|
-
dy: -(10 + this._titleBottom.AABBBounds.height())
|
|
199
|
-
}, duration / 2, easing), this._symbolStartOuter.animate().wait(duration / 2).to({
|
|
200
|
-
clipRange: 0
|
|
201
|
-
}, duration / 2, easing), this._titleTopPanel.animate().to({
|
|
202
|
-
scaleX: 0
|
|
203
|
-
}, duration, "circInOut"), this._titleBottomPanel.animate().to({
|
|
204
|
-
scaleX: 0
|
|
205
|
-
}, duration, "circInOut");
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
StoryLabelItem.defaultAttributes = {
|
|
211
|
-
contentOffsetX: 100,
|
|
212
|
-
contentOffsetY: -60,
|
|
213
|
-
titleTopStyle: {
|
|
214
|
-
fontSize: 12,
|
|
215
|
-
fill: "white"
|
|
216
|
-
},
|
|
217
|
-
titleBottomStyle: {
|
|
218
|
-
fontSize: 12,
|
|
219
|
-
fill: "white"
|
|
220
|
-
},
|
|
221
|
-
lineStyle: {
|
|
222
|
-
stroke: "white",
|
|
223
|
-
lineWidth: 1
|
|
224
|
-
},
|
|
225
|
-
symbolStartStyle: {
|
|
226
|
-
symbolType: "circle",
|
|
227
|
-
size: 3,
|
|
228
|
-
fill: "white"
|
|
229
|
-
},
|
|
230
|
-
symbolEndStyle: {
|
|
231
|
-
symbolType: "circle",
|
|
232
|
-
size: 3,
|
|
233
|
-
fill: "white"
|
|
234
|
-
},
|
|
235
|
-
symbolStartOuterStyle: {
|
|
236
|
-
symbolType: "M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0",
|
|
237
|
-
size: 8,
|
|
238
|
-
stroke: "white"
|
|
239
|
-
},
|
|
240
|
-
titleSpace: [ 2, 2 ],
|
|
241
|
-
titleTopPanelStyle: {
|
|
242
|
-
visible: !1,
|
|
243
|
-
padding: {
|
|
244
|
-
left: 0,
|
|
245
|
-
right: 0,
|
|
246
|
-
bottom: 2,
|
|
247
|
-
top: 2
|
|
248
|
-
},
|
|
249
|
-
cornerRadius: 3
|
|
250
|
-
},
|
|
251
|
-
titleBottomPanelStyle: {
|
|
252
|
-
visible: !1,
|
|
253
|
-
padding: {
|
|
254
|
-
left: 0,
|
|
255
|
-
right: 0,
|
|
256
|
-
bottom: 2,
|
|
257
|
-
top: 2
|
|
258
|
-
},
|
|
259
|
-
cornerRadius: 3
|
|
260
|
-
},
|
|
261
|
-
theme: "default"
|
|
262
|
-
};
|
|
263
|
-
//# sourceMappingURL=label-item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/label-item/label-item.ts"],"names":[],"mappings":"AASA,OAAO,EAAkB,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,OAAO,cAAe,SAAQ,iBAAiD;IA6DnF,YAAY,UAAgC,EAAE,OAA0B;QACtE,KAAK,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,EAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,cAAc,CAAC,iBAAiB,E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QACd,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE;QACjD,YAAY,EAAE,CAAC;KAChB;IAED,KAAK,EAAE,SAAS;CACjB,CAAC","file":"label-item.js","sourcesContent":["import type {\n IGroup,\n ILine,\n ILineGraphicAttribute,\n IRect,\n ISymbol,\n ISymbolGraphicAttribute,\n IText\n} from '@visactor/vrender-core';\nimport { ILineAttribute, InputText, ISymbolAttribute } from '@visactor/vrender-core';\nimport { AbstractComponent } from '../core/base';\nimport type { IStoryLabelItemAttrs } from './type';\nimport type { ComponentOptions } from '../interface';\nimport { max, merge } from '@visactor/vutils';\n\nexport class StoryLabelItem extends AbstractComponent<Required<IStoryLabelItemAttrs>> {\n name: 'labelItem';\n private _line?: ILine;\n private _symbolStart: ISymbol;\n private _symbolEnd: ISymbol;\n private _symbolStartOuter: ISymbol;\n private _titleTop: IText;\n private _titleBottom: IText;\n private _titleTopPanel: IRect;\n private _titleBottomPanel: IRect;\n\n static defaultAttributes: Partial<IStoryLabelItemAttrs> = {\n // 内容在X上的偏移量\n contentOffsetX: 100,\n // 内容在Y上的偏移量\n contentOffsetY: -60,\n titleTopStyle: {\n fontSize: 12,\n fill: 'white'\n },\n titleBottomStyle: {\n fontSize: 12,\n fill: 'white'\n },\n lineStyle: {\n stroke: 'white',\n lineWidth: 1\n } as ILineGraphicAttribute,\n // 线段开始端点的样式\n symbolStartStyle: {\n symbolType: 'circle',\n size: 3,\n fill: 'white'\n } as Partial<ISymbolGraphicAttribute>,\n // 线段结束端点的样式\n symbolEndStyle: {\n symbolType: 'circle',\n size: 3,\n fill: 'white'\n } as Partial<ISymbolGraphicAttribute>,\n // 线段开始端点外面包裹symbol的样式\n symbolStartOuterStyle: {\n symbolType: 'M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0',\n size: 8,\n stroke: 'white'\n } as Partial<ISymbolGraphicAttribute>,\n titleSpace: [2, 2],\n titleTopPanelStyle: {\n visible: false,\n padding: { left: 0, right: 0, bottom: 2, top: 2 },\n cornerRadius: 3\n },\n titleBottomPanelStyle: {\n visible: false,\n padding: { left: 0, right: 0, bottom: 2, top: 2 },\n cornerRadius: 3\n },\n // 默认和简约两套主题\n theme: 'default'\n };\n\n constructor(attributes: IStoryLabelItemAttrs, options?: ComponentOptions) {\n super(options?.skipDefault ? attributes : merge({}, StoryLabelItem.defaultAttributes, attributes));\n }\n\n protected render(): void {\n const {\n contentOffsetX,\n contentOffsetY,\n lineStyle,\n symbolStartStyle,\n symbolEndStyle,\n symbolStartOuterStyle,\n titleTop: titleTopText,\n titleBottom: titleBottomText,\n titleTopStyle,\n titleBottomStyle,\n titleSpace,\n titleTopPanelStyle,\n titleBottomPanelStyle,\n theme\n } = this.attribute;\n\n const group = this.createOrUpdateChild('label-item-container', { x: 0, y: 0, zIndex: 1 }, 'group') as IGroup;\n\n const symbolStart = group.createOrUpdateChild(\n 'label-item-symbol-start',\n { x: 0, y: 0, ...symbolStartStyle },\n 'symbol'\n ) as ISymbol;\n const symbolEnd = group.createOrUpdateChild(\n 'label-item-symbol-end',\n { x: contentOffsetX, y: contentOffsetY, ...symbolEndStyle },\n 'symbol'\n ) as ISymbol;\n const symbolStartOut = group.createOrUpdateChild(\n 'label-item-symbol-start-out',\n { x: 0, y: 0, ...symbolStartOuterStyle },\n 'symbol'\n ) as ISymbol;\n\n const spaceW = titleSpace[0];\n const spaceH = titleSpace[1];\n // 逻辑:group占满,title在group内做偏移\n const titleTopGroup = group.createOrUpdateChild(\n 'label-item-title-top-group',\n { x: contentOffsetX, y: contentOffsetY, clip: true },\n 'group'\n ) as IGroup;\n const titleTop = titleTopGroup.createOrUpdateChild(\n 'label-item-title-top',\n {\n x: spaceW,\n y: -spaceH,\n text: titleTopText,\n ...titleTopStyle,\n textBaseline: 'bottom',\n textAlign: 'left',\n zIndex: 10\n },\n 'text'\n ) as IText;\n const titleTopBounds = titleTop.AABBBounds;\n if (contentOffsetX > 0) {\n titleTopGroup.setAttributes({ x: contentOffsetX - titleTopBounds.width() - spaceW * 2 });\n }\n titleTopGroup.setAttributes({\n width: titleTopBounds.width() + spaceW * 2,\n height: -titleTopBounds.height() - spaceH * 2\n });\n // 添加panel\n const titleTopPanel = titleTopGroup.createOrUpdateChild(\n 'label-item-title-top-panel',\n {\n ...titleTopPanelStyle,\n x: titleTopPanelStyle.padding.left,\n y: (titleTopGroup.attribute.height > 0 ? 0 : titleTopGroup.attribute.height) + titleTopPanelStyle.padding.top,\n width: titleTopGroup.attribute.width - titleTopPanelStyle.padding.left - titleTopPanelStyle.padding.right,\n height:\n (titleTopGroup.attribute.height > 0 ? 1 : -1) * titleTopGroup.attribute.height -\n titleTopPanelStyle.padding.bottom -\n titleTopPanelStyle.padding.top,\n scaleCenter: [titleTopGroup.attribute.width / 2, titleTopGroup.attribute.height / 2]\n },\n 'rect'\n ) as IRect;\n this._titleTopPanel = titleTopPanel;\n\n const titleBottomGroup = group.createOrUpdateChild(\n 'label-item-title-bottom-group',\n { x: contentOffsetX, y: contentOffsetY, clip: true },\n 'group'\n ) as IGroup;\n const titleBottom = titleBottomGroup.createOrUpdateChild(\n 'label-item-title-bottom',\n {\n x: spaceW,\n y: spaceH,\n text: titleBottomText,\n ...titleBottomStyle,\n textBaseline: 'top',\n textAlign: 'left',\n zIndex: 10\n },\n 'text'\n ) as IText;\n const titleBottomBounds = titleBottom.AABBBounds;\n if (contentOffsetX > 0) {\n titleBottomGroup.setAttributes({ x: contentOffsetX - titleBottomBounds.width() - spaceW * 2 });\n }\n titleBottomGroup.setAttributes({\n width: titleBottomBounds.width() + spaceW * 2,\n height: titleTopBounds.height() + spaceH * 2\n });\n // 添加panel\n const titleBottomPanel = titleBottomGroup.createOrUpdateChild(\n 'label-item-title-bottom-panel',\n {\n ...titleBottomPanelStyle,\n x: titleBottomPanelStyle.padding.left,\n y:\n (titleBottomGroup.attribute.height > 0 ? 0 : titleBottomGroup.attribute.height) +\n titleBottomPanelStyle.padding.top,\n width:\n titleBottomGroup.attribute.width - titleBottomPanelStyle.padding.left - titleBottomPanelStyle.padding.right,\n height:\n (titleBottomGroup.attribute.height > 0 ? 1 : -1) * titleBottomGroup.attribute.height -\n titleBottomPanelStyle.padding.bottom -\n titleBottomPanelStyle.padding.top,\n scaleCenter: [titleBottomGroup.attribute.width / 2, titleBottomGroup.attribute.height / 2]\n },\n 'rect'\n ) as IRect;\n this._titleBottomPanel = titleBottomPanel;\n\n const maxTextWidth = Math.max(titleTop.AABBBounds.width(), titleBottom.AABBBounds.width()) + spaceW * 2;\n const points = [\n { x: 0, y: 0 },\n contentOffsetX > 0\n ? { x: contentOffsetX - maxTextWidth, y: contentOffsetY }\n : { x: contentOffsetX + maxTextWidth, y: contentOffsetY },\n { x: contentOffsetX, y: contentOffsetY }\n ];\n // simple风格,不绘制终点,同时文字也要居中\n if (theme === 'simple') {\n points.pop();\n const p = points[1];\n symbolEnd.setAttributes(p);\n }\n const line = group.createOrUpdateChild('label-item-line', { x: 0, y: 0, ...lineStyle, points }, 'line') as ILine;\n\n this._symbolEnd = symbolEnd;\n this._symbolStart = symbolStart;\n this._symbolStartOuter = symbolStartOut;\n this._titleTop = titleTop;\n this._titleBottom = titleBottom;\n this._line = line;\n }\n\n appearAnimate(animateConfig: {\n duration?: number;\n easing?: string;\n symbolStartOuterType?: 'scale' | 'clipRange';\n titleType?: 'typewriter' | 'move';\n titlePanelType?: 'scale' | 'stroke';\n }) {\n const {\n duration = 1000,\n easing = 'quadOut',\n symbolStartOuterType = 'scale',\n titleType = 'typewriter',\n titlePanelType = 'scale'\n } = animateConfig;\n const symbolTime = duration / 10;\n this._symbolStart.setAttributes({ scaleX: 0, scaleY: 0 });\n this._symbolStart.animate().to({ scaleX: 1, scaleY: 1 }, symbolTime * 5, easing as any);\n\n let symbolStartOuterFrom: ISymbolGraphicAttribute;\n let symbolStartOuterTo: ISymbolGraphicAttribute;\n if (symbolStartOuterType === 'scale') {\n symbolStartOuterFrom = { scaleX: 0, scaleY: 0 };\n symbolStartOuterTo = { scaleX: 1, scaleY: 1 };\n } else {\n symbolStartOuterFrom = { clipRange: 0 };\n symbolStartOuterTo = { clipRange: 1 };\n }\n this._symbolStartOuter.setAttributes(symbolStartOuterFrom);\n this._symbolStartOuter.animate().to(symbolStartOuterTo, symbolTime * 5, easing as any);\n\n this._symbolEnd.setAttributes({ scaleX: 0, scaleY: 0 });\n this._symbolEnd\n .animate()\n .wait(symbolTime * 8)\n .to({ scaleX: 1, scaleY: 1 }, symbolTime * 2, easing as any);\n\n this._line.setAttributes({ clipRange: 0 });\n this._line.animate().to({ clipRange: 1 }, symbolTime * 9, easing as any);\n\n if (titleType === 'typewriter') {\n const titleTopText = this._titleTop.attribute.text as string;\n this._titleTop.setAttributes({ text: '' });\n this._titleTop\n .animate()\n .wait(symbolTime * 5)\n .play(new InputText({ text: '' }, { text: titleTopText }, symbolTime * 4, 'linear'));\n\n const titleBottomText = this._titleBottom.attribute.text as string;\n this._titleBottom.setAttributes({ text: '' });\n this._titleBottom\n .animate()\n .wait(symbolTime * 5)\n .play(new InputText({ text: '' }, { text: titleBottomText }, symbolTime * 4, 'linear'));\n } else {\n this._titleTop.setAttributes({ dy: this._titleTop.AABBBounds.height() + 10 });\n this._titleTop\n .animate()\n .wait(symbolTime * 5)\n .to({ dy: 0 }, symbolTime * 4, 'linear');\n\n this._titleBottom.setAttributes({ dy: -(10 + this._titleBottom.AABBBounds.height()) });\n this._titleBottom\n .animate()\n .wait(symbolTime * 5)\n .to({ dy: 0 }, symbolTime * 4, 'linear');\n }\n\n if (titlePanelType === 'scale') {\n [this._titleTopPanel, this._titleBottomPanel].forEach(panel => {\n const scaleX = panel.attribute.scaleX;\n panel.setAttributes({ scaleX: 0 });\n panel.animate().to({ scaleX }, duration, 'circInOut');\n });\n } else if (titlePanelType === 'stroke') {\n [this._titleTopPanel, this._titleBottomPanel].forEach(panel => {\n const b = panel.AABBBounds;\n const totalLen = (b.width() + b.height()) * 2;\n panel.setAttributes({ lineDash: [0, totalLen * 10] });\n panel.animate().to({ lineDash: [totalLen, totalLen * 10] }, duration, 'quadOut');\n });\n }\n }\n\n disappearAnimate(animateConfig: { duration?: number; easing?: string; mode?: 'scale' | 'default' }) {\n if (animateConfig.mode === 'scale') {\n const { duration = 1000, easing = 'quadOut' } = animateConfig;\n this.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing as any);\n } else {\n const { duration = 1000, easing = 'quadOut' } = animateConfig;\n this._line.animate().to({ clipRange: 0 }, duration, easing as any);\n this._symbolStart\n .animate()\n .wait(duration / 2)\n .to({ scaleX: 0, scaleY: 0 }, duration / 2, easing as any);\n this._symbolEnd.animate().to({ scaleX: 0, scaleY: 0 }, duration, easing as any);\n this._titleTop.animate().to({ dy: this._titleTop.AABBBounds.height() + 10 }, duration / 2, easing as any);\n this._titleBottom\n .animate()\n .to({ dy: -(10 + this._titleBottom.AABBBounds.height()) }, duration / 2, easing as any);\n this._symbolStartOuter\n .animate()\n .wait(duration / 2)\n .to({ clipRange: 0 }, duration / 2, easing as any);\n this._titleTopPanel.animate().to({ scaleX: 0 }, duration, 'circInOut');\n this._titleBottomPanel.animate().to({ scaleX: 0 }, duration, 'circInOut');\n }\n }\n}\n"]}
|