@visactor/vrender-components 0.19.21 → 0.19.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +5 -4
- package/cjs/index.js.map +1 -1
- package/cjs/indicator/indicator.d.ts +3 -1
- package/cjs/indicator/indicator.js +19 -41
- package/cjs/indicator/indicator.js.map +1 -1
- package/cjs/indicator/type.d.ts +1 -0
- package/cjs/indicator/type.js.map +1 -1
- package/cjs/timeline/index.d.ts +2 -0
- package/cjs/timeline/index.js +21 -0
- package/cjs/timeline/index.js.map +1 -0
- package/cjs/timeline/register.d.ts +1 -0
- package/cjs/timeline/register.js +15 -0
- package/cjs/timeline/register.js.map +1 -0
- package/cjs/timeline/timeline.d.ts +30 -0
- package/cjs/timeline/timeline.js +178 -0
- package/cjs/timeline/timeline.js.map +1 -0
- package/cjs/timeline/type.d.ts +18 -0
- package/cjs/timeline/type.js +6 -0
- package/cjs/timeline/type.js.map +1 -0
- package/dist/index.es.js +381 -172
- package/es/index.d.ts +2 -1
- package/es/index.js +3 -1
- package/es/index.js.map +1 -1
- package/es/indicator/indicator.d.ts +3 -1
- package/es/indicator/indicator.js +19 -40
- package/es/indicator/indicator.js.map +1 -1
- package/es/indicator/type.d.ts +1 -0
- package/es/indicator/type.js.map +1 -1
- package/es/timeline/index.d.ts +2 -0
- package/es/timeline/index.js +4 -0
- package/es/timeline/index.js.map +1 -0
- package/es/timeline/register.d.ts +1 -0
- package/es/timeline/register.js +6 -0
- package/es/timeline/register.js.map +1 -0
- package/es/timeline/timeline.d.ts +30 -0
- package/es/timeline/timeline.js +175 -0
- package/es/timeline/timeline.js.map +1 -0
- package/es/timeline/type.d.ts +18 -0
- package/es/timeline/type.js +2 -0
- package/es/timeline/type.js.map +1 -0
- package/package.json +3 -3
package/dist/index.es.js
CHANGED
|
@@ -3716,13 +3716,23 @@ class FederatedEvent {
|
|
|
3716
3716
|
}
|
|
3717
3717
|
}
|
|
3718
3718
|
preventDefault() {
|
|
3719
|
-
|
|
3719
|
+
try {
|
|
3720
|
+
this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.preventDefault();
|
|
3721
|
+
} catch (err) {
|
|
3722
|
+
this.nativeEvent.preventDefault && isFunction(this.nativeEvent.preventDefault) && this.nativeEvent.preventDefault();
|
|
3723
|
+
}
|
|
3724
|
+
this.defaultPrevented = !0;
|
|
3720
3725
|
}
|
|
3721
3726
|
stopImmediatePropagation() {
|
|
3722
3727
|
this.propagationImmediatelyStopped = !0;
|
|
3723
3728
|
}
|
|
3724
3729
|
stopPropagation() {
|
|
3725
|
-
|
|
3730
|
+
try {
|
|
3731
|
+
this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.stopPropagation();
|
|
3732
|
+
} catch (err) {
|
|
3733
|
+
this.nativeEvent.stopPropagation && isFunction(this.nativeEvent.stopPropagation) && this.nativeEvent.stopPropagation();
|
|
3734
|
+
}
|
|
3735
|
+
this.propagationStopped = !0;
|
|
3726
3736
|
}
|
|
3727
3737
|
initEvent() {}
|
|
3728
3738
|
initUIEvent() {}
|
|
@@ -12075,6 +12085,100 @@ var __decorate$A = undefined && undefined.__decorate || function (decorators, ta
|
|
|
12075
12085
|
decorator(target, key, paramIndex);
|
|
12076
12086
|
};
|
|
12077
12087
|
};
|
|
12088
|
+
let DefaultCanvasGroupRender = class {
|
|
12089
|
+
constructor(groupRenderContribitions) {
|
|
12090
|
+
this.groupRenderContribitions = groupRenderContribitions, this.numberType = GROUP_NUMBER_TYPE;
|
|
12091
|
+
}
|
|
12092
|
+
drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
12093
|
+
const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
|
|
12094
|
+
{
|
|
12095
|
+
fill = groupAttribute.fill,
|
|
12096
|
+
background: background,
|
|
12097
|
+
stroke = groupAttribute.stroke,
|
|
12098
|
+
opacity = groupAttribute.opacity,
|
|
12099
|
+
width = groupAttribute.width,
|
|
12100
|
+
height = groupAttribute.height,
|
|
12101
|
+
clip = groupAttribute.clip,
|
|
12102
|
+
fillOpacity = groupAttribute.fillOpacity,
|
|
12103
|
+
strokeOpacity = groupAttribute.strokeOpacity,
|
|
12104
|
+
cornerRadius = groupAttribute.cornerRadius,
|
|
12105
|
+
path = groupAttribute.path,
|
|
12106
|
+
lineWidth = groupAttribute.lineWidth,
|
|
12107
|
+
visible = groupAttribute.visible
|
|
12108
|
+
} = group.attribute,
|
|
12109
|
+
fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
|
|
12110
|
+
sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
|
|
12111
|
+
doFill = runFill(fill, background),
|
|
12112
|
+
doStroke = runStroke(stroke, lineWidth);
|
|
12113
|
+
if (!group.valid || !visible) return;
|
|
12114
|
+
if (!clip) {
|
|
12115
|
+
if (!doFill && !doStroke) return;
|
|
12116
|
+
if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
|
|
12117
|
+
}
|
|
12118
|
+
if (path && path.length && drawContext.drawContribution) {
|
|
12119
|
+
const disableFill = context.disableFill,
|
|
12120
|
+
disableStroke = context.disableStroke,
|
|
12121
|
+
disableBeginPath = context.disableBeginPath;
|
|
12122
|
+
context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
|
|
12123
|
+
drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
|
|
12124
|
+
}), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
|
|
12125
|
+
} else 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
|
|
12126
|
+
this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
|
|
12127
|
+
const doFillOrStroke = {
|
|
12128
|
+
doFill: doFill,
|
|
12129
|
+
doStroke: doStroke
|
|
12130
|
+
};
|
|
12131
|
+
this._groupRenderContribitions.forEach(c => {
|
|
12132
|
+
c.time === BaseRenderContributionTime.beforeFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
|
|
12133
|
+
}), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute), doFillOrStroke.doFill && (fillCb ? fillCb(context, group.attribute, groupAttribute) : fVisible && (context.setCommonStyle(group, group.attribute, x, y, groupAttribute), context.fill())), doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, group.attribute, groupAttribute) : sVisible && (context.setStrokeStyle(group, group.attribute, x, y, groupAttribute), context.stroke())), this._groupRenderContribitions.forEach(c => {
|
|
12134
|
+
c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb);
|
|
12135
|
+
});
|
|
12136
|
+
}
|
|
12137
|
+
draw(group, renderService, drawContext, params) {
|
|
12138
|
+
const {
|
|
12139
|
+
context: context
|
|
12140
|
+
} = drawContext;
|
|
12141
|
+
if (!context) return;
|
|
12142
|
+
const {
|
|
12143
|
+
clip: clip,
|
|
12144
|
+
baseOpacity = 1
|
|
12145
|
+
} = group.attribute;
|
|
12146
|
+
clip ? context.save() : context.highPerformanceSave(), context.baseGlobalAlpha *= baseOpacity;
|
|
12147
|
+
const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
|
|
12148
|
+
lastModelMatrix = context.modelMatrix;
|
|
12149
|
+
if (context.camera) {
|
|
12150
|
+
const nextModelMatrix = mat4Allocate.allocate(),
|
|
12151
|
+
modelMatrix = mat4Allocate.allocate();
|
|
12152
|
+
getModelMatrix(modelMatrix, group, groupAttribute), multiplyMat4Mat4(nextModelMatrix, lastModelMatrix || nextModelMatrix, modelMatrix), context.modelMatrix = nextModelMatrix, mat4Allocate.free(modelMatrix), context.setTransform(1, 0, 0, 1, 0, 0, !0);
|
|
12153
|
+
} else context.transformFromMatrix(group.transMatrix, !0);
|
|
12154
|
+
context.beginPath(), params.skipDraw ? this.drawShape(group, context, 0, 0, drawContext, params, () => !1, () => !1) : this.drawShape(group, context, 0, 0, drawContext);
|
|
12155
|
+
const {
|
|
12156
|
+
scrollX = groupAttribute.scrollX,
|
|
12157
|
+
scrollY = groupAttribute.scrollY
|
|
12158
|
+
} = group.attribute;
|
|
12159
|
+
let p;
|
|
12160
|
+
(scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha /= baseOpacity, p && p.then ? p.then(() => {
|
|
12161
|
+
clip ? context.restore() : context.highPerformanceRestore();
|
|
12162
|
+
}) : clip ? context.restore() : context.highPerformanceRestore();
|
|
12163
|
+
}
|
|
12164
|
+
};
|
|
12165
|
+
DefaultCanvasGroupRender = __decorate$A([injectable(), __param$n(0, inject(ContributionProvider)), __param$n(0, named(GroupRenderContribution)), __metadata$s("design:paramtypes", [Object])], DefaultCanvasGroupRender);
|
|
12166
|
+
|
|
12167
|
+
var __decorate$z = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12168
|
+
var d,
|
|
12169
|
+
c = arguments.length,
|
|
12170
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12171
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
12172
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12173
|
+
},
|
|
12174
|
+
__metadata$r = undefined && undefined.__metadata || function (k, v) {
|
|
12175
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12176
|
+
},
|
|
12177
|
+
__param$m = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
12178
|
+
return function (target, key) {
|
|
12179
|
+
decorator(target, key, paramIndex);
|
|
12180
|
+
};
|
|
12181
|
+
};
|
|
12078
12182
|
const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
|
|
12079
12183
|
let DefaultCanvasImageRender = class extends BaseRender {
|
|
12080
12184
|
constructor(imageRenderContribitions) {
|
|
@@ -12131,7 +12235,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
|
|
|
12131
12235
|
this._draw(image, imageAttribute, !1, drawContext);
|
|
12132
12236
|
}
|
|
12133
12237
|
};
|
|
12134
|
-
DefaultCanvasImageRender = __decorate$
|
|
12238
|
+
DefaultCanvasImageRender = __decorate$z([injectable(), __param$m(0, inject(ContributionProvider)), __param$m(0, named(ImageRenderContribution)), __metadata$r("design:paramtypes", [Object])], DefaultCanvasImageRender);
|
|
12135
12239
|
|
|
12136
12240
|
const IncrementalDrawContribution = Symbol.for("IncrementalDrawContribution");
|
|
12137
12241
|
const ArcRender = Symbol.for("ArcRender");
|
|
@@ -12149,14 +12253,14 @@ const RichTextRender = Symbol.for("RichTextRender");
|
|
|
12149
12253
|
const ImageRender = Symbol.for("ImageRender");
|
|
12150
12254
|
const DrawContribution = Symbol.for("DrawContribution");
|
|
12151
12255
|
|
|
12152
|
-
var __decorate$
|
|
12256
|
+
var __decorate$y = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12153
12257
|
var d,
|
|
12154
12258
|
c = arguments.length,
|
|
12155
12259
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12156
12260
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
12157
12261
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12158
12262
|
},
|
|
12159
|
-
__metadata$
|
|
12263
|
+
__metadata$q = undefined && undefined.__metadata || function (k, v) {
|
|
12160
12264
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12161
12265
|
};
|
|
12162
12266
|
const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
|
|
@@ -12216,7 +12320,7 @@ let CommonDrawItemInterceptorContribution = class {
|
|
|
12216
12320
|
return !1;
|
|
12217
12321
|
}
|
|
12218
12322
|
};
|
|
12219
|
-
CommonDrawItemInterceptorContribution = __decorate$
|
|
12323
|
+
CommonDrawItemInterceptorContribution = __decorate$y([injectable(), __metadata$q("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
|
|
12220
12324
|
class InteractiveDrawItemInterceptorContribution {
|
|
12221
12325
|
constructor() {
|
|
12222
12326
|
this.order = 1;
|
|
@@ -12348,17 +12452,17 @@ class Canvas3DDrawItemInterceptor {
|
|
|
12348
12452
|
}
|
|
12349
12453
|
}
|
|
12350
12454
|
|
|
12351
|
-
var __decorate$
|
|
12455
|
+
var __decorate$x = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12352
12456
|
var d,
|
|
12353
12457
|
c = arguments.length,
|
|
12354
12458
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12355
12459
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
12356
12460
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12357
12461
|
},
|
|
12358
|
-
__metadata$
|
|
12462
|
+
__metadata$p = undefined && undefined.__metadata || function (k, v) {
|
|
12359
12463
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12360
12464
|
},
|
|
12361
|
-
__param$
|
|
12465
|
+
__param$l = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
12362
12466
|
return function (target, key) {
|
|
12363
12467
|
decorator(target, key, paramIndex);
|
|
12364
12468
|
};
|
|
@@ -12395,7 +12499,7 @@ let DefaultRenderService = class {
|
|
|
12395
12499
|
this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params), this.drawParams = null;
|
|
12396
12500
|
}
|
|
12397
12501
|
};
|
|
12398
|
-
DefaultRenderService = __decorate$
|
|
12502
|
+
DefaultRenderService = __decorate$x([injectable(), __param$l(0, inject(DrawContribution)), __metadata$p("design:paramtypes", [Object])], DefaultRenderService);
|
|
12399
12503
|
|
|
12400
12504
|
var renderModule$1 = new ContainerModule(bind => {
|
|
12401
12505
|
bind(RenderService).to(DefaultRenderService);
|
|
@@ -12404,7 +12508,7 @@ var renderModule$1 = new ContainerModule(bind => {
|
|
|
12404
12508
|
const PickerService = Symbol.for("PickerService");
|
|
12405
12509
|
const GlobalPickerService = Symbol.for("GlobalPickerService");
|
|
12406
12510
|
|
|
12407
|
-
var __decorate$
|
|
12511
|
+
var __decorate$w = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12408
12512
|
var d,
|
|
12409
12513
|
c = arguments.length,
|
|
12410
12514
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
@@ -12434,10 +12538,10 @@ let ShadowRootPickItemInterceptorContribution = class {
|
|
|
12434
12538
|
currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix),
|
|
12435
12539
|
newPoint = new Point(currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e, currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f),
|
|
12436
12540
|
result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);
|
|
12437
|
-
return context.highPerformanceRestore(), result;
|
|
12541
|
+
return context.highPerformanceRestore(), !result.graphic && result.group && (result.graphic = result.group), result;
|
|
12438
12542
|
}
|
|
12439
12543
|
};
|
|
12440
|
-
ShadowRootPickItemInterceptorContribution = __decorate$
|
|
12544
|
+
ShadowRootPickItemInterceptorContribution = __decorate$w([injectable()], ShadowRootPickItemInterceptorContribution);
|
|
12441
12545
|
let InteractivePickItemInterceptorContribution = class {
|
|
12442
12546
|
constructor() {
|
|
12443
12547
|
this.order = 1;
|
|
@@ -12456,7 +12560,7 @@ let InteractivePickItemInterceptorContribution = class {
|
|
|
12456
12560
|
return null;
|
|
12457
12561
|
}
|
|
12458
12562
|
};
|
|
12459
|
-
InteractivePickItemInterceptorContribution = __decorate$
|
|
12563
|
+
InteractivePickItemInterceptorContribution = __decorate$w([injectable()], InteractivePickItemInterceptorContribution);
|
|
12460
12564
|
let Canvas3DPickItemInterceptor = class {
|
|
12461
12565
|
constructor() {
|
|
12462
12566
|
this.order = 1;
|
|
@@ -12516,7 +12620,7 @@ let Canvas3DPickItemInterceptor = class {
|
|
|
12516
12620
|
context.setTransformForCurrent();
|
|
12517
12621
|
}
|
|
12518
12622
|
};
|
|
12519
|
-
Canvas3DPickItemInterceptor = __decorate$
|
|
12623
|
+
Canvas3DPickItemInterceptor = __decorate$w([injectable()], Canvas3DPickItemInterceptor);
|
|
12520
12624
|
|
|
12521
12625
|
var pickModule = new ContainerModule((bind, unbind, isBound) => {
|
|
12522
12626
|
isBound(PickerService) || (bind(GlobalPickerService).toSelf(), bind(PickerService).toService(GlobalPickerService)), bind(Canvas3DPickItemInterceptor).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(Canvas3DPickItemInterceptor), bind(ShadowRootPickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(ShadowRootPickItemInterceptorContribution), bind(InteractivePickItemInterceptorContribution).toSelf().inSingletonScope(), bind(PickItemInterceptor).toService(InteractivePickItemInterceptorContribution), bindContributionProvider(bind, PickItemInterceptor);
|
|
@@ -12529,17 +12633,17 @@ var graphicModule = new ContainerModule(bind => {
|
|
|
12529
12633
|
const AutoEnablePlugins = Symbol.for("AutoEnablePlugins");
|
|
12530
12634
|
const PluginService = Symbol.for("PluginService");
|
|
12531
12635
|
|
|
12532
|
-
var __decorate$
|
|
12636
|
+
var __decorate$v = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12533
12637
|
var d,
|
|
12534
12638
|
c = arguments.length,
|
|
12535
12639
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12536
12640
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
12537
12641
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12538
12642
|
},
|
|
12539
|
-
__metadata$
|
|
12643
|
+
__metadata$o = undefined && undefined.__metadata || function (k, v) {
|
|
12540
12644
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12541
12645
|
},
|
|
12542
|
-
__param$
|
|
12646
|
+
__param$k = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
12543
12647
|
return function (target, key) {
|
|
12544
12648
|
decorator(target, key, paramIndex);
|
|
12545
12649
|
};
|
|
@@ -12579,7 +12683,7 @@ let DefaultPluginService = class {
|
|
|
12579
12683
|
}), this.onRegisterPlugin = [];
|
|
12580
12684
|
}
|
|
12581
12685
|
};
|
|
12582
|
-
DefaultPluginService = __decorate$
|
|
12686
|
+
DefaultPluginService = __decorate$v([injectable(), __param$k(0, inject(ContributionProvider)), __param$k(0, named(AutoEnablePlugins)), __metadata$o("design:paramtypes", [Object])], DefaultPluginService);
|
|
12583
12687
|
|
|
12584
12688
|
var pluginModule = new ContainerModule(bind => {
|
|
12585
12689
|
bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
|
|
@@ -12593,14 +12697,14 @@ var textMeasureModules = new ContainerModule(bind => {
|
|
|
12593
12697
|
bind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
|
|
12594
12698
|
});
|
|
12595
12699
|
|
|
12596
|
-
var __decorate$
|
|
12700
|
+
var __decorate$u = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12597
12701
|
var d,
|
|
12598
12702
|
c = arguments.length,
|
|
12599
12703
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12600
12704
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
12601
12705
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12602
12706
|
},
|
|
12603
|
-
__metadata$
|
|
12707
|
+
__metadata$n = undefined && undefined.__metadata || function (k, v) {
|
|
12604
12708
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12605
12709
|
};
|
|
12606
12710
|
let CanvasLayerHandlerContribution = class {
|
|
@@ -12670,16 +12774,16 @@ let CanvasLayerHandlerContribution = class {
|
|
|
12670
12774
|
this.canvas.release();
|
|
12671
12775
|
}
|
|
12672
12776
|
};
|
|
12673
|
-
CanvasLayerHandlerContribution = __decorate$
|
|
12777
|
+
CanvasLayerHandlerContribution = __decorate$u([injectable(), __metadata$n("design:paramtypes", [])], CanvasLayerHandlerContribution);
|
|
12674
12778
|
|
|
12675
|
-
var __decorate$
|
|
12779
|
+
var __decorate$t = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12676
12780
|
var d,
|
|
12677
12781
|
c = arguments.length,
|
|
12678
12782
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12679
12783
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
12680
12784
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12681
12785
|
},
|
|
12682
|
-
__metadata$
|
|
12786
|
+
__metadata$m = undefined && undefined.__metadata || function (k, v) {
|
|
12683
12787
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12684
12788
|
};
|
|
12685
12789
|
let EmptyLayerHandlerContribution = class {
|
|
@@ -12714,16 +12818,16 @@ let EmptyLayerHandlerContribution = class {
|
|
|
12714
12818
|
}
|
|
12715
12819
|
release() {}
|
|
12716
12820
|
};
|
|
12717
|
-
EmptyLayerHandlerContribution = __decorate$
|
|
12821
|
+
EmptyLayerHandlerContribution = __decorate$t([injectable(), __metadata$m("design:paramtypes", [])], EmptyLayerHandlerContribution);
|
|
12718
12822
|
|
|
12719
|
-
var __decorate$
|
|
12823
|
+
var __decorate$s = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12720
12824
|
var d,
|
|
12721
12825
|
c = arguments.length,
|
|
12722
12826
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12723
12827
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
12724
12828
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12725
12829
|
},
|
|
12726
|
-
__metadata$
|
|
12830
|
+
__metadata$l = undefined && undefined.__metadata || function (k, v) {
|
|
12727
12831
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12728
12832
|
};
|
|
12729
12833
|
let OffscreenLayerHandlerContribution = class {
|
|
@@ -12786,7 +12890,7 @@ let OffscreenLayerHandlerContribution = class {
|
|
|
12786
12890
|
}
|
|
12787
12891
|
merge(layerHandlers) {}
|
|
12788
12892
|
};
|
|
12789
|
-
OffscreenLayerHandlerContribution = __decorate$
|
|
12893
|
+
OffscreenLayerHandlerContribution = __decorate$s([injectable(), __metadata$l("design:paramtypes", [])], OffscreenLayerHandlerContribution);
|
|
12790
12894
|
|
|
12791
12895
|
var layerHandlerModules = new ContainerModule(bind => {
|
|
12792
12896
|
bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
|
|
@@ -12902,17 +13006,17 @@ function findNextGraphic(graphic, id, defaultZIndex) {
|
|
|
12902
13006
|
return result;
|
|
12903
13007
|
}
|
|
12904
13008
|
|
|
12905
|
-
var __decorate$
|
|
13009
|
+
var __decorate$r = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12906
13010
|
var d,
|
|
12907
13011
|
c = arguments.length,
|
|
12908
13012
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12909
13013
|
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
12910
13014
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12911
13015
|
},
|
|
12912
|
-
__metadata$
|
|
13016
|
+
__metadata$k = undefined && undefined.__metadata || function (k, v) {
|
|
12913
13017
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12914
13018
|
},
|
|
12915
|
-
__param$
|
|
13019
|
+
__param$j = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
12916
13020
|
return function (target, key) {
|
|
12917
13021
|
decorator(target, key, paramIndex);
|
|
12918
13022
|
};
|
|
@@ -13099,101 +13203,7 @@ let DefaultDrawContribution = class {
|
|
|
13099
13203
|
}
|
|
13100
13204
|
afterDraw(renderService, drawParams) {}
|
|
13101
13205
|
};
|
|
13102
|
-
DefaultDrawContribution = __decorate$
|
|
13103
|
-
|
|
13104
|
-
var __decorate$r = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
13105
|
-
var d,
|
|
13106
|
-
c = arguments.length,
|
|
13107
|
-
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
13108
|
-
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
|
|
13109
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13110
|
-
},
|
|
13111
|
-
__metadata$k = undefined && undefined.__metadata || function (k, v) {
|
|
13112
|
-
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
13113
|
-
},
|
|
13114
|
-
__param$j = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
13115
|
-
return function (target, key) {
|
|
13116
|
-
decorator(target, key, paramIndex);
|
|
13117
|
-
};
|
|
13118
|
-
};
|
|
13119
|
-
let DefaultCanvasGroupRender = class {
|
|
13120
|
-
constructor(groupRenderContribitions) {
|
|
13121
|
-
this.groupRenderContribitions = groupRenderContribitions, this.numberType = GROUP_NUMBER_TYPE;
|
|
13122
|
-
}
|
|
13123
|
-
drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
13124
|
-
const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
|
|
13125
|
-
{
|
|
13126
|
-
fill = groupAttribute.fill,
|
|
13127
|
-
background: background,
|
|
13128
|
-
stroke = groupAttribute.stroke,
|
|
13129
|
-
opacity = groupAttribute.opacity,
|
|
13130
|
-
width = groupAttribute.width,
|
|
13131
|
-
height = groupAttribute.height,
|
|
13132
|
-
clip = groupAttribute.clip,
|
|
13133
|
-
fillOpacity = groupAttribute.fillOpacity,
|
|
13134
|
-
strokeOpacity = groupAttribute.strokeOpacity,
|
|
13135
|
-
cornerRadius = groupAttribute.cornerRadius,
|
|
13136
|
-
path = groupAttribute.path,
|
|
13137
|
-
lineWidth = groupAttribute.lineWidth,
|
|
13138
|
-
visible = groupAttribute.visible
|
|
13139
|
-
} = group.attribute,
|
|
13140
|
-
fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
|
|
13141
|
-
sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
|
|
13142
|
-
doFill = runFill(fill, background),
|
|
13143
|
-
doStroke = runStroke(stroke, lineWidth);
|
|
13144
|
-
if (!group.valid || !visible) return;
|
|
13145
|
-
if (!clip) {
|
|
13146
|
-
if (!doFill && !doStroke) return;
|
|
13147
|
-
if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
|
|
13148
|
-
}
|
|
13149
|
-
if (path && path.length && drawContext.drawContribution) {
|
|
13150
|
-
const disableFill = context.disableFill,
|
|
13151
|
-
disableStroke = context.disableStroke,
|
|
13152
|
-
disableBeginPath = context.disableBeginPath;
|
|
13153
|
-
context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
|
|
13154
|
-
drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
|
|
13155
|
-
}), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
|
|
13156
|
-
} else 0 === cornerRadius || isArray(cornerRadius) && cornerRadius.every(num => 0 === num) ? (context.beginPath(), context.rect(x, y, width, height)) : (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius));
|
|
13157
|
-
this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
|
|
13158
|
-
const doFillOrStroke = {
|
|
13159
|
-
doFill: doFill,
|
|
13160
|
-
doStroke: doStroke
|
|
13161
|
-
};
|
|
13162
|
-
this._groupRenderContribitions.forEach(c => {
|
|
13163
|
-
c.time === BaseRenderContributionTime.beforeFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
|
|
13164
|
-
}), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute), doFillOrStroke.doFill && (fillCb ? fillCb(context, group.attribute, groupAttribute) : fVisible && (context.setCommonStyle(group, group.attribute, x, y, groupAttribute), context.fill())), doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, group.attribute, groupAttribute) : sVisible && (context.setStrokeStyle(group, group.attribute, x, y, groupAttribute), context.stroke())), this._groupRenderContribitions.forEach(c => {
|
|
13165
|
-
c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb);
|
|
13166
|
-
});
|
|
13167
|
-
}
|
|
13168
|
-
draw(group, renderService, drawContext, params) {
|
|
13169
|
-
const {
|
|
13170
|
-
context: context
|
|
13171
|
-
} = drawContext;
|
|
13172
|
-
if (!context) return;
|
|
13173
|
-
const {
|
|
13174
|
-
clip: clip,
|
|
13175
|
-
baseOpacity = 1
|
|
13176
|
-
} = group.attribute;
|
|
13177
|
-
clip ? context.save() : context.highPerformanceSave(), context.baseGlobalAlpha *= baseOpacity;
|
|
13178
|
-
const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
|
|
13179
|
-
lastModelMatrix = context.modelMatrix;
|
|
13180
|
-
if (context.camera) {
|
|
13181
|
-
const nextModelMatrix = mat4Allocate.allocate(),
|
|
13182
|
-
modelMatrix = mat4Allocate.allocate();
|
|
13183
|
-
getModelMatrix(modelMatrix, group, groupAttribute), multiplyMat4Mat4(nextModelMatrix, lastModelMatrix || nextModelMatrix, modelMatrix), context.modelMatrix = nextModelMatrix, mat4Allocate.free(modelMatrix), context.setTransform(1, 0, 0, 1, 0, 0, !0);
|
|
13184
|
-
} else context.transformFromMatrix(group.transMatrix, !0);
|
|
13185
|
-
context.beginPath(), params.skipDraw ? this.drawShape(group, context, 0, 0, drawContext, params, () => !1, () => !1) : this.drawShape(group, context, 0, 0, drawContext);
|
|
13186
|
-
const {
|
|
13187
|
-
scrollX = groupAttribute.scrollX,
|
|
13188
|
-
scrollY = groupAttribute.scrollY
|
|
13189
|
-
} = group.attribute;
|
|
13190
|
-
let p;
|
|
13191
|
-
(scrollX || scrollY) && context.translate(scrollX, scrollY), params && params.drawingCb && (p = params.drawingCb()), context.modelMatrix !== lastModelMatrix && mat4Allocate.free(context.modelMatrix), context.modelMatrix = lastModelMatrix, context.baseGlobalAlpha /= baseOpacity, p && p.then ? p.then(() => {
|
|
13192
|
-
clip ? context.restore() : context.highPerformanceRestore();
|
|
13193
|
-
}) : clip ? context.restore() : context.highPerformanceRestore();
|
|
13194
|
-
}
|
|
13195
|
-
};
|
|
13196
|
-
DefaultCanvasGroupRender = __decorate$r([injectable(), __param$j(0, inject(ContributionProvider)), __param$j(0, named(GroupRenderContribution)), __metadata$k("design:paramtypes", [Object])], DefaultCanvasGroupRender);
|
|
13206
|
+
DefaultDrawContribution = __decorate$r([injectable(), __param$j(0, multiInject(GraphicRender)), __param$j(1, inject(ContributionProvider)), __param$j(1, named(DrawItemInterceptor)), __metadata$k("design:paramtypes", [Array, Object])], DefaultDrawContribution);
|
|
13197
13207
|
|
|
13198
13208
|
var __decorate$q = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
13199
13209
|
var d,
|
|
@@ -27142,61 +27152,47 @@ class Indicator extends AbstractComponent {
|
|
|
27142
27152
|
super(...arguments);
|
|
27143
27153
|
this.name = 'indicator';
|
|
27144
27154
|
}
|
|
27155
|
+
_renderText(group, title, limit, limitRatio, themePath, graphicName) {
|
|
27156
|
+
if (title.visible !== false) {
|
|
27157
|
+
const titleStyle = merge({}, get(DEFAULT_INDICATOR_THEME, themePath), title.style, {
|
|
27158
|
+
visible: title.visible
|
|
27159
|
+
});
|
|
27160
|
+
titleStyle.lineHeight = isValid(titleStyle.lineHeight) ? titleStyle.lineHeight : titleStyle.fontSize;
|
|
27161
|
+
if (title.formatMethod) {
|
|
27162
|
+
titleStyle._originText = titleStyle.text;
|
|
27163
|
+
titleStyle.text = title.formatMethod(titleStyle.text, titleStyle);
|
|
27164
|
+
}
|
|
27165
|
+
const textGraphic = createTextGraphicByType(titleStyle);
|
|
27166
|
+
textGraphic.name = graphicName;
|
|
27167
|
+
group.appendChild(textGraphic);
|
|
27168
|
+
if (title.autoFit && isValidNumber(limit)) {
|
|
27169
|
+
this._setLocalAutoFit(limit, textGraphic, title);
|
|
27170
|
+
}
|
|
27171
|
+
if (title.autoLimit && isValidNumber(limitRatio)) {
|
|
27172
|
+
textGraphic.setAttribute('maxLineWidth', limit);
|
|
27173
|
+
}
|
|
27174
|
+
return textGraphic;
|
|
27175
|
+
}
|
|
27176
|
+
return undefined;
|
|
27177
|
+
}
|
|
27145
27178
|
render() {
|
|
27146
27179
|
var _a;
|
|
27147
|
-
|
|
27148
|
-
|
|
27149
|
-
const group = this.createOrUpdateChild('indicator-container', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
27150
|
-
if (visible !== true) {
|
|
27151
|
-
group && group.hideAll();
|
|
27180
|
+
this.removeAllChild(true);
|
|
27181
|
+
if (this.attribute.visible !== true) {
|
|
27152
27182
|
return;
|
|
27153
27183
|
}
|
|
27184
|
+
const { title = {}, content, size, limitRatio = Infinity } = this.attribute;
|
|
27185
|
+
const limit = Math.min(size.width, size.height) * limitRatio;
|
|
27186
|
+
const group = this.createOrUpdateChild('indicator-container', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
27154
27187
|
if (isValid(title)) {
|
|
27155
|
-
|
|
27156
|
-
const titleStyle = merge({}, get(DEFAULT_INDICATOR_THEME, 'title.style'), title.style);
|
|
27157
|
-
if (isRichText(titleStyle)) {
|
|
27158
|
-
this._title = group.createOrUpdateChild('indicator-title', Object.assign(Object.assign({}, richTextAttributeTransform(titleStyle)), { visible: title.visible, x: 0, y: 0 }), 'richtext');
|
|
27159
|
-
}
|
|
27160
|
-
else {
|
|
27161
|
-
this._title = group.createOrUpdateChild('indicator-title', Object.assign(Object.assign({}, titleStyle), { lineHeight: isValid(titleStyle.lineHeight) ? titleStyle.lineHeight : titleStyle.fontSize, visible: title.visible, x: 0, y: 0 }), 'text');
|
|
27162
|
-
}
|
|
27163
|
-
if (title.autoFit && isValidNumber(limit)) {
|
|
27164
|
-
this._setLocalAutoFit(limit, this._title, title);
|
|
27165
|
-
}
|
|
27166
|
-
if (title.autoLimit && isValidNumber(limitRatio)) {
|
|
27167
|
-
this._title.setAttribute('maxLineWidth', limit);
|
|
27168
|
-
}
|
|
27169
|
-
}
|
|
27170
|
-
else {
|
|
27171
|
-
const titleNode = group.find(node => node.name === 'indicator-title', false);
|
|
27172
|
-
titleNode && group.removeChild(titleNode);
|
|
27173
|
-
this._title = undefined;
|
|
27174
|
-
}
|
|
27188
|
+
this._title = this._renderText(group, title, limit, limitRatio, 'title.style', 'indicator-title');
|
|
27175
27189
|
}
|
|
27176
27190
|
if (isValid(content)) {
|
|
27177
27191
|
const contents = array(content);
|
|
27178
27192
|
const contentComponents = [];
|
|
27179
27193
|
contents.forEach((contentItem, i) => {
|
|
27180
27194
|
if (contentItem.visible !== false) {
|
|
27181
|
-
|
|
27182
|
-
let contentComponent;
|
|
27183
|
-
if (isRichText(contentStyle)) {
|
|
27184
|
-
contentComponent = group.createOrUpdateChild('indicator-content-' + i, Object.assign(Object.assign({}, richTextAttributeTransform(contentStyle)), { visible: title.visible, x: 0, y: 0 }), 'richtext');
|
|
27185
|
-
}
|
|
27186
|
-
else {
|
|
27187
|
-
contentComponent = group.createOrUpdateChild('indicator-content-' + i, Object.assign(Object.assign({}, contentStyle), { lineHeight: isValid(contentStyle.lineHeight) ? contentStyle.lineHeight : contentStyle.fontSize, visible: contentItem.visible, x: 0, y: 0 }), 'text');
|
|
27188
|
-
}
|
|
27189
|
-
if (contentItem.autoFit && isValidNumber(limit)) {
|
|
27190
|
-
this._setLocalAutoFit(limit, contentComponent, contentItem);
|
|
27191
|
-
}
|
|
27192
|
-
if (contentItem.autoLimit && isValidNumber(limitRatio)) {
|
|
27193
|
-
contentComponent.setAttribute('maxLineWidth', limit);
|
|
27194
|
-
}
|
|
27195
|
-
contentComponents.push(contentComponent);
|
|
27196
|
-
}
|
|
27197
|
-
else {
|
|
27198
|
-
const contentItemNode = group.find(node => node.name === 'indicator-content-' + i, false);
|
|
27199
|
-
contentItemNode && group.removeChild(contentItemNode);
|
|
27195
|
+
contentComponents.push(this._renderText(group, contentItem, limit, limitRatio, 'content.style', 'indicator-content-' + i));
|
|
27200
27196
|
}
|
|
27201
27197
|
});
|
|
27202
27198
|
this._content = contentComponents;
|
|
@@ -29019,6 +29015,219 @@ class Tooltip extends AbstractComponent {
|
|
|
29019
29015
|
}
|
|
29020
29016
|
Tooltip.defaultAttributes = defaultAttributes;
|
|
29021
29017
|
|
|
29018
|
+
function loadTimelineComponent() {
|
|
29019
|
+
registerGroup();
|
|
29020
|
+
registerText();
|
|
29021
|
+
registerSymbol();
|
|
29022
|
+
registerLine();
|
|
29023
|
+
}
|
|
29024
|
+
|
|
29025
|
+
loadTimelineComponent();
|
|
29026
|
+
class Timeline extends AbstractComponent {
|
|
29027
|
+
constructor(attributes, options) {
|
|
29028
|
+
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, Timeline.defaultAttributes, attributes));
|
|
29029
|
+
this.name = 'timeline';
|
|
29030
|
+
}
|
|
29031
|
+
render() {
|
|
29032
|
+
const { width, lineStyle, activeLineStyle, symbolStyle, activeSymbolStyle, labelStyle, activeLabelStyle, times, pointLayoutMode, labelSpace, clipRange, animation } = this.attribute;
|
|
29033
|
+
if (!(times && times.length)) {
|
|
29034
|
+
return;
|
|
29035
|
+
}
|
|
29036
|
+
const symbolHeight = (isArray(symbolStyle.size) ? symbolStyle.size[1] : symbolStyle.size) || 0;
|
|
29037
|
+
const activeSymbolHeight = (isArray(activeSymbolStyle.size) ? activeSymbolStyle.size[1] : activeSymbolStyle.size) || 0;
|
|
29038
|
+
const lineSymbolHeight = Math.max(lineStyle.lineWidth || 0, activeLineStyle.lineWidth || 0, symbolHeight, activeSymbolHeight);
|
|
29039
|
+
const lineY = lineSymbolHeight / 2;
|
|
29040
|
+
const lineAttr = {
|
|
29041
|
+
y: lineY,
|
|
29042
|
+
points: [
|
|
29043
|
+
{ x: 0, y: 0 },
|
|
29044
|
+
{ x: width, y: 0 }
|
|
29045
|
+
]
|
|
29046
|
+
};
|
|
29047
|
+
this._line = this.createOrUpdateChild('line-axes', Object.assign(Object.assign({}, lineStyle), lineAttr), 'line');
|
|
29048
|
+
this._activeLine = this.createOrUpdateChild('active-line-axes', Object.assign(Object.assign(Object.assign({}, activeLineStyle), lineAttr), { clipRange }), 'line');
|
|
29049
|
+
const activeWidth = width * clipRange;
|
|
29050
|
+
const symbolGroup = this.createOrUpdateChild('symbol-group', {
|
|
29051
|
+
y: lineY
|
|
29052
|
+
}, 'group');
|
|
29053
|
+
const symbolSpace = times.length === 1
|
|
29054
|
+
? width
|
|
29055
|
+
: pointLayoutMode === 'space-between'
|
|
29056
|
+
? width / (times.length - 1)
|
|
29057
|
+
: width / times.length;
|
|
29058
|
+
const symbolStartX = pointLayoutMode === 'space-between' ? 0 : symbolSpace / 2;
|
|
29059
|
+
this._timesPercent = times.map((_, i) => (symbolStartX + symbolSpace * i) / width);
|
|
29060
|
+
times.forEach((item, i) => {
|
|
29061
|
+
const x = this._timesPercent[i] * width;
|
|
29062
|
+
symbolGroup.createOrUpdateChild(item.label, Object.assign(Object.assign({}, symbolStyle), { x }), 'symbol');
|
|
29063
|
+
});
|
|
29064
|
+
this._symbolGroup = symbolGroup;
|
|
29065
|
+
const labelY = lineSymbolHeight + labelSpace;
|
|
29066
|
+
const labelGroup = this.createOrUpdateChild('label-group', {
|
|
29067
|
+
y: labelY
|
|
29068
|
+
}, 'group');
|
|
29069
|
+
times.forEach((item, i) => {
|
|
29070
|
+
const x = this._timesPercent[i] * width;
|
|
29071
|
+
labelGroup.createOrUpdateChild(item.label, Object.assign(Object.assign({}, labelStyle), { x, text: item.label }), 'text');
|
|
29072
|
+
});
|
|
29073
|
+
this._labelGroup = labelGroup;
|
|
29074
|
+
const setActive = (group, activeStyle) => {
|
|
29075
|
+
group.forEachChildren((label) => {
|
|
29076
|
+
if (label.currentStates) {
|
|
29077
|
+
const currentStates = label.currentStates;
|
|
29078
|
+
label.clearStates();
|
|
29079
|
+
label.useStates(currentStates, false);
|
|
29080
|
+
}
|
|
29081
|
+
label.states = {
|
|
29082
|
+
active: activeStyle
|
|
29083
|
+
};
|
|
29084
|
+
if (label.attribute.x <= activeWidth) {
|
|
29085
|
+
label.useStates(['active'], animation);
|
|
29086
|
+
}
|
|
29087
|
+
});
|
|
29088
|
+
};
|
|
29089
|
+
setActive(labelGroup, activeLabelStyle);
|
|
29090
|
+
setActive(symbolGroup, activeSymbolStyle);
|
|
29091
|
+
}
|
|
29092
|
+
appearAnimate(animateConfig) {
|
|
29093
|
+
const { duration = 1000, easing = 'quadOut' } = animateConfig;
|
|
29094
|
+
const { activeLabelStyle, activeSymbolStyle } = this.attribute;
|
|
29095
|
+
const percent = duration / 1000;
|
|
29096
|
+
const lineDuration = percent * 500;
|
|
29097
|
+
const activeLineDuration = percent * 200;
|
|
29098
|
+
const perSymbolDuration = percent * 100;
|
|
29099
|
+
const perSymbolNormalDuration = percent * 90;
|
|
29100
|
+
const symbolDelay = percent * 100;
|
|
29101
|
+
const symbolNormalDelay = percent * 600;
|
|
29102
|
+
if (this._line) {
|
|
29103
|
+
this._line.setAttributes({ clipRange: 0 });
|
|
29104
|
+
this._line.animate().to({ clipRange: 1 }, lineDuration, easing);
|
|
29105
|
+
}
|
|
29106
|
+
if (this._activeLine) {
|
|
29107
|
+
this._activeLine.setAttributes({ opacity: 0 });
|
|
29108
|
+
this._activeLine
|
|
29109
|
+
.animate()
|
|
29110
|
+
.wait(500)
|
|
29111
|
+
.to({ opacity: 1 }, activeLineDuration, easing);
|
|
29112
|
+
}
|
|
29113
|
+
if (this._symbolGroup) {
|
|
29114
|
+
const size = this._symbolGroup.count - 1;
|
|
29115
|
+
const delay = percent * (size === 1 ? 0 : (500 - 100) / (size - 1));
|
|
29116
|
+
const delayNormal = percent * (size === 1 ? 0 : (400 - 160) / (size - 1));
|
|
29117
|
+
this._symbolGroup.forEachChildren((symbol, i) => {
|
|
29118
|
+
const originAttrs = Object.assign({}, symbol.attribute);
|
|
29119
|
+
symbol.setAttributes({ opacity: 0 });
|
|
29120
|
+
symbol
|
|
29121
|
+
.animate()
|
|
29122
|
+
.wait(symbolDelay + delay * i)
|
|
29123
|
+
.to({ opacity: 1 }, perSymbolDuration, easing);
|
|
29124
|
+
symbol
|
|
29125
|
+
.animate()
|
|
29126
|
+
.wait(symbolNormalDelay + delayNormal * i)
|
|
29127
|
+
.to(Object.assign({ scaleX: 1.8, scaleY: 1.8 }, activeSymbolStyle), perSymbolNormalDuration, easing)
|
|
29128
|
+
.to(Object.assign({ scaleX: 1, scaleY: 1 }, originAttrs), perSymbolNormalDuration, easing);
|
|
29129
|
+
});
|
|
29130
|
+
}
|
|
29131
|
+
if (this._labelGroup) {
|
|
29132
|
+
const size = this._labelGroup.count - 1;
|
|
29133
|
+
const delay = percent * (size === 1 ? 0 : (500 - 100) / (size - 1));
|
|
29134
|
+
const delayNormal = percent * (size === 1 ? 0 : (400 - 160) / (size - 1));
|
|
29135
|
+
this._labelGroup.forEachChildren((label, i) => {
|
|
29136
|
+
const originAttrs = Object.assign({}, label.attribute);
|
|
29137
|
+
label.setAttributes({ opacity: 0 });
|
|
29138
|
+
label
|
|
29139
|
+
.animate()
|
|
29140
|
+
.wait(symbolDelay + delay * i)
|
|
29141
|
+
.to({ opacity: 1 }, perSymbolDuration, easing);
|
|
29142
|
+
label
|
|
29143
|
+
.animate()
|
|
29144
|
+
.wait(symbolNormalDelay + delayNormal * i)
|
|
29145
|
+
.to(Object.assign({ dy: 10 }, activeLabelStyle), perSymbolNormalDuration, easing)
|
|
29146
|
+
.to(Object.assign({ dy: 0 }, originAttrs), perSymbolNormalDuration, easing);
|
|
29147
|
+
});
|
|
29148
|
+
}
|
|
29149
|
+
}
|
|
29150
|
+
goto(flag, animateConfig) {
|
|
29151
|
+
var _a;
|
|
29152
|
+
let { clipRange } = this.attribute;
|
|
29153
|
+
const { animation } = this.attribute;
|
|
29154
|
+
if (flag > 0) {
|
|
29155
|
+
if (clipRange >= 1) {
|
|
29156
|
+
return;
|
|
29157
|
+
}
|
|
29158
|
+
else if (clipRange < 0) {
|
|
29159
|
+
clipRange = 0;
|
|
29160
|
+
}
|
|
29161
|
+
}
|
|
29162
|
+
else {
|
|
29163
|
+
if (clipRange <= 0) {
|
|
29164
|
+
return;
|
|
29165
|
+
}
|
|
29166
|
+
else if (clipRange > 1) {
|
|
29167
|
+
clipRange = 1;
|
|
29168
|
+
}
|
|
29169
|
+
}
|
|
29170
|
+
if (clipRange !== this.attribute.clipRange) {
|
|
29171
|
+
this.setAttributes({ clipRange });
|
|
29172
|
+
}
|
|
29173
|
+
let i = 0;
|
|
29174
|
+
for (; i < this._timesPercent.length; i++) {
|
|
29175
|
+
if (clipRange < this._timesPercent[i]) {
|
|
29176
|
+
break;
|
|
29177
|
+
}
|
|
29178
|
+
}
|
|
29179
|
+
const nextClipRange = flag > 0 ? this._timesPercent[i] : this._timesPercent[i - 1] || 0;
|
|
29180
|
+
if (animation) {
|
|
29181
|
+
const { duration = 1000, easing = 'quadOut' } = animateConfig;
|
|
29182
|
+
const actDuration = (Math.abs(nextClipRange - clipRange) / (this._timesPercent[i] - ((_a = this._timesPercent[i - 1]) !== null && _a !== void 0 ? _a : 0))) * duration;
|
|
29183
|
+
this.animate().to({ clipRange: nextClipRange }, actDuration, easing);
|
|
29184
|
+
}
|
|
29185
|
+
else {
|
|
29186
|
+
this.setAttributes({ clipRange: nextClipRange });
|
|
29187
|
+
}
|
|
29188
|
+
}
|
|
29189
|
+
forward(animateConfig) {
|
|
29190
|
+
this.goto(1, animateConfig);
|
|
29191
|
+
}
|
|
29192
|
+
backward(animateConfig) {
|
|
29193
|
+
this.goto(-1, animateConfig);
|
|
29194
|
+
}
|
|
29195
|
+
}
|
|
29196
|
+
Timeline.defaultAttributes = {
|
|
29197
|
+
labelSpace: 10,
|
|
29198
|
+
pointLayoutMode: 'space-around',
|
|
29199
|
+
animation: true,
|
|
29200
|
+
symbolStyle: {
|
|
29201
|
+
fill: 'black',
|
|
29202
|
+
size: 12,
|
|
29203
|
+
symbolType: 'circle'
|
|
29204
|
+
},
|
|
29205
|
+
activeSymbolStyle: {
|
|
29206
|
+
fill: 'orange'
|
|
29207
|
+
},
|
|
29208
|
+
lineStyle: {
|
|
29209
|
+
lineDash: [2, 2],
|
|
29210
|
+
lineCap: 'butt',
|
|
29211
|
+
stroke: 'black',
|
|
29212
|
+
lineWidth: 2
|
|
29213
|
+
},
|
|
29214
|
+
activeLineStyle: {
|
|
29215
|
+
stroke: 'orange',
|
|
29216
|
+
lineWidth: 4
|
|
29217
|
+
},
|
|
29218
|
+
labelStyle: {
|
|
29219
|
+
fontSize: 12,
|
|
29220
|
+
fill: 'black',
|
|
29221
|
+
textAlign: 'center',
|
|
29222
|
+
textBaseline: 'top'
|
|
29223
|
+
},
|
|
29224
|
+
activeLabelStyle: {
|
|
29225
|
+
fontSize: 14,
|
|
29226
|
+
fill: 'orange'
|
|
29227
|
+
},
|
|
29228
|
+
clipRange: 0
|
|
29229
|
+
};
|
|
29230
|
+
|
|
29022
29231
|
function VTag(params) {
|
|
29023
29232
|
return new Tag(params ? params.attribute : {});
|
|
29024
29233
|
}
|
|
@@ -29374,6 +29583,6 @@ EmptyTip.defaultAttributes = {
|
|
|
29374
29583
|
}
|
|
29375
29584
|
};
|
|
29376
29585
|
|
|
29377
|
-
const version = "0.19.
|
|
29586
|
+
const version = "0.19.22";
|
|
29378
29587
|
|
|
29379
|
-
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, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, clampRadian, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, direction, fuzzyEqualNumber, getCircleLabelPosition, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, loadPoptip, measureTextSize, normalize, reactAttributeTransform, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, removeRepeatPoint, richTextAttributeTransform, scale, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, ticks, traverseGroup, version };
|
|
29588
|
+
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, Timeline, Title, Tooltip, VTag, alignTextInLine, angle, angleLabelOrientAttribute, angleTo, clampRadian, contrastAccessibilityChecker, convertDomainToTickData, createTextGraphicByType, deltaXYToAngle, direction, fuzzyEqualNumber, getCircleLabelPosition, getCircleVerticalVector, getElMap, getHorizontalPath, getMarksByName, getNoneGroupMarksByName, getPolarAngleLabelPosition, getSizeHandlerPath, getTextAlignAttrOfVerticalDir, getTextType, getVerticalCoord, getVerticalPath, htmlAttributeTransform, initTextMeasure, isInRange, isPostiveXAxis, isRichText, isVisible, labelSmartInvert, length, loadPoptip, measureTextSize, normalize, reactAttributeTransform, registerMarkArcAreaAnimate, registerMarkArcLineAnimate, registerMarkAreaAnimate, registerMarkLineAnimate, registerMarkPointAnimate, removeRepeatPoint, richTextAttributeTransform, scale, setPoptipTheme, smartInvertStrategy, tan2AngleToAngle, ticks, traverseGroup, version };
|