@visactor/vrender-components 0.19.21 → 0.19.23
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/label/arc.js +2 -1
- package/cjs/label/base.js +1 -1
- package/cjs/label/dataLabel.js +1 -1
- package/cjs/label/index.js +1 -1
- package/cjs/label/line-data.js +1 -1
- package/cjs/label/line.js +1 -1
- package/cjs/label/polygon.js +1 -1
- package/cjs/legend/base.js +1 -2
- package/cjs/legend/constant.js +1 -1
- package/cjs/legend/index.js +1 -1
- package/cjs/legend/register.js +1 -1
- package/cjs/legend/type.js +1 -1
- package/cjs/legend/util.js +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 +389 -174
- 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/label/arc.js +2 -1
- package/es/label/base.js +1 -1
- package/es/label/dataLabel.js +1 -1
- package/es/label/index.js +1 -1
- package/es/label/line-data.js +1 -1
- package/es/label/line.js +1 -1
- package/es/label/polygon.js +1 -1
- package/es/legend/base.js +1 -2
- package/es/legend/constant.js +1 -1
- package/es/legend/index.js +1 -1
- package/es/legend/register.js +1 -1
- package/es/legend/type.js +1 -1
- package/es/legend/util.js +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
|
@@ -2283,7 +2283,8 @@ const DefaultAttribute = Object.assign(Object.assign(Object.assign({
|
|
|
2283
2283
|
shadowRootIdx: 1,
|
|
2284
2284
|
globalZIndex: 1,
|
|
2285
2285
|
globalCompositeOperation: "",
|
|
2286
|
-
overflow: "hidden"
|
|
2286
|
+
overflow: "hidden",
|
|
2287
|
+
shadowPickMode: "graphic"
|
|
2287
2288
|
}, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
|
|
2288
2289
|
const DefaultArcAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
2289
2290
|
startAngle: 0,
|
|
@@ -3716,13 +3717,23 @@ class FederatedEvent {
|
|
|
3716
3717
|
}
|
|
3717
3718
|
}
|
|
3718
3719
|
preventDefault() {
|
|
3719
|
-
|
|
3720
|
+
try {
|
|
3721
|
+
this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.preventDefault();
|
|
3722
|
+
} catch (err) {
|
|
3723
|
+
this.nativeEvent.preventDefault && isFunction(this.nativeEvent.preventDefault) && this.nativeEvent.preventDefault();
|
|
3724
|
+
}
|
|
3725
|
+
this.defaultPrevented = !0;
|
|
3720
3726
|
}
|
|
3721
3727
|
stopImmediatePropagation() {
|
|
3722
3728
|
this.propagationImmediatelyStopped = !0;
|
|
3723
3729
|
}
|
|
3724
3730
|
stopPropagation() {
|
|
3725
|
-
|
|
3731
|
+
try {
|
|
3732
|
+
this.nativeEvent instanceof Event && this.nativeEvent.cancelable && this.nativeEvent.stopPropagation();
|
|
3733
|
+
} catch (err) {
|
|
3734
|
+
this.nativeEvent.stopPropagation && isFunction(this.nativeEvent.stopPropagation) && this.nativeEvent.stopPropagation();
|
|
3735
|
+
}
|
|
3736
|
+
this.propagationStopped = !0;
|
|
3726
3737
|
}
|
|
3727
3738
|
initEvent() {}
|
|
3728
3739
|
initUIEvent() {}
|
|
@@ -12075,6 +12086,100 @@ var __decorate$A = undefined && undefined.__decorate || function (decorators, ta
|
|
|
12075
12086
|
decorator(target, key, paramIndex);
|
|
12076
12087
|
};
|
|
12077
12088
|
};
|
|
12089
|
+
let DefaultCanvasGroupRender = class {
|
|
12090
|
+
constructor(groupRenderContribitions) {
|
|
12091
|
+
this.groupRenderContribitions = groupRenderContribitions, this.numberType = GROUP_NUMBER_TYPE;
|
|
12092
|
+
}
|
|
12093
|
+
drawShape(group, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
12094
|
+
const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
|
|
12095
|
+
{
|
|
12096
|
+
fill = groupAttribute.fill,
|
|
12097
|
+
background: background,
|
|
12098
|
+
stroke = groupAttribute.stroke,
|
|
12099
|
+
opacity = groupAttribute.opacity,
|
|
12100
|
+
width = groupAttribute.width,
|
|
12101
|
+
height = groupAttribute.height,
|
|
12102
|
+
clip = groupAttribute.clip,
|
|
12103
|
+
fillOpacity = groupAttribute.fillOpacity,
|
|
12104
|
+
strokeOpacity = groupAttribute.strokeOpacity,
|
|
12105
|
+
cornerRadius = groupAttribute.cornerRadius,
|
|
12106
|
+
path = groupAttribute.path,
|
|
12107
|
+
lineWidth = groupAttribute.lineWidth,
|
|
12108
|
+
visible = groupAttribute.visible
|
|
12109
|
+
} = group.attribute,
|
|
12110
|
+
fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
|
|
12111
|
+
sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
|
|
12112
|
+
doFill = runFill(fill, background),
|
|
12113
|
+
doStroke = runStroke(stroke, lineWidth);
|
|
12114
|
+
if (!group.valid || !visible) return;
|
|
12115
|
+
if (!clip) {
|
|
12116
|
+
if (!doFill && !doStroke) return;
|
|
12117
|
+
if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
|
|
12118
|
+
}
|
|
12119
|
+
if (path && path.length && drawContext.drawContribution) {
|
|
12120
|
+
const disableFill = context.disableFill,
|
|
12121
|
+
disableStroke = context.disableStroke,
|
|
12122
|
+
disableBeginPath = context.disableBeginPath;
|
|
12123
|
+
context.disableFill = !0, context.disableStroke = !0, context.disableBeginPath = !0, path.forEach(g => {
|
|
12124
|
+
drawContext.drawContribution.getRenderContribution(g).draw(g, drawContext.renderService, drawContext, params);
|
|
12125
|
+
}), context.disableFill = disableFill, context.disableStroke = disableStroke, context.disableBeginPath = disableBeginPath;
|
|
12126
|
+
} 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));
|
|
12127
|
+
this._groupRenderContribitions || (this._groupRenderContribitions = this.groupRenderContribitions.getContributions() || [], this._groupRenderContribitions.push(defaultGroupBackgroundRenderContribution));
|
|
12128
|
+
const doFillOrStroke = {
|
|
12129
|
+
doFill: doFill,
|
|
12130
|
+
doStroke: doStroke
|
|
12131
|
+
};
|
|
12132
|
+
this._groupRenderContribitions.forEach(c => {
|
|
12133
|
+
c.time === BaseRenderContributionTime.beforeFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
|
|
12134
|
+
}), 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 => {
|
|
12135
|
+
c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb);
|
|
12136
|
+
});
|
|
12137
|
+
}
|
|
12138
|
+
draw(group, renderService, drawContext, params) {
|
|
12139
|
+
const {
|
|
12140
|
+
context: context
|
|
12141
|
+
} = drawContext;
|
|
12142
|
+
if (!context) return;
|
|
12143
|
+
const {
|
|
12144
|
+
clip: clip,
|
|
12145
|
+
baseOpacity = 1
|
|
12146
|
+
} = group.attribute;
|
|
12147
|
+
clip ? context.save() : context.highPerformanceSave(), context.baseGlobalAlpha *= baseOpacity;
|
|
12148
|
+
const groupAttribute = getTheme(group, null == params ? void 0 : params.theme).group,
|
|
12149
|
+
lastModelMatrix = context.modelMatrix;
|
|
12150
|
+
if (context.camera) {
|
|
12151
|
+
const nextModelMatrix = mat4Allocate.allocate(),
|
|
12152
|
+
modelMatrix = mat4Allocate.allocate();
|
|
12153
|
+
getModelMatrix(modelMatrix, group, groupAttribute), multiplyMat4Mat4(nextModelMatrix, lastModelMatrix || nextModelMatrix, modelMatrix), context.modelMatrix = nextModelMatrix, mat4Allocate.free(modelMatrix), context.setTransform(1, 0, 0, 1, 0, 0, !0);
|
|
12154
|
+
} else context.transformFromMatrix(group.transMatrix, !0);
|
|
12155
|
+
context.beginPath(), params.skipDraw ? this.drawShape(group, context, 0, 0, drawContext, params, () => !1, () => !1) : this.drawShape(group, context, 0, 0, drawContext);
|
|
12156
|
+
const {
|
|
12157
|
+
scrollX = groupAttribute.scrollX,
|
|
12158
|
+
scrollY = groupAttribute.scrollY
|
|
12159
|
+
} = group.attribute;
|
|
12160
|
+
let p;
|
|
12161
|
+
(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(() => {
|
|
12162
|
+
clip ? context.restore() : context.highPerformanceRestore();
|
|
12163
|
+
}) : clip ? context.restore() : context.highPerformanceRestore();
|
|
12164
|
+
}
|
|
12165
|
+
};
|
|
12166
|
+
DefaultCanvasGroupRender = __decorate$A([injectable(), __param$n(0, inject(ContributionProvider)), __param$n(0, named(GroupRenderContribution)), __metadata$s("design:paramtypes", [Object])], DefaultCanvasGroupRender);
|
|
12167
|
+
|
|
12168
|
+
var __decorate$z = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12169
|
+
var d,
|
|
12170
|
+
c = arguments.length,
|
|
12171
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12172
|
+
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);
|
|
12173
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12174
|
+
},
|
|
12175
|
+
__metadata$r = undefined && undefined.__metadata || function (k, v) {
|
|
12176
|
+
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12177
|
+
},
|
|
12178
|
+
__param$m = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
12179
|
+
return function (target, key) {
|
|
12180
|
+
decorator(target, key, paramIndex);
|
|
12181
|
+
};
|
|
12182
|
+
};
|
|
12078
12183
|
const repeatStr = ["", "repeat-x", "repeat-y", "repeat"];
|
|
12079
12184
|
let DefaultCanvasImageRender = class extends BaseRender {
|
|
12080
12185
|
constructor(imageRenderContribitions) {
|
|
@@ -12131,7 +12236,7 @@ let DefaultCanvasImageRender = class extends BaseRender {
|
|
|
12131
12236
|
this._draw(image, imageAttribute, !1, drawContext);
|
|
12132
12237
|
}
|
|
12133
12238
|
};
|
|
12134
|
-
DefaultCanvasImageRender = __decorate$
|
|
12239
|
+
DefaultCanvasImageRender = __decorate$z([injectable(), __param$m(0, inject(ContributionProvider)), __param$m(0, named(ImageRenderContribution)), __metadata$r("design:paramtypes", [Object])], DefaultCanvasImageRender);
|
|
12135
12240
|
|
|
12136
12241
|
const IncrementalDrawContribution = Symbol.for("IncrementalDrawContribution");
|
|
12137
12242
|
const ArcRender = Symbol.for("ArcRender");
|
|
@@ -12149,14 +12254,14 @@ const RichTextRender = Symbol.for("RichTextRender");
|
|
|
12149
12254
|
const ImageRender = Symbol.for("ImageRender");
|
|
12150
12255
|
const DrawContribution = Symbol.for("DrawContribution");
|
|
12151
12256
|
|
|
12152
|
-
var __decorate$
|
|
12257
|
+
var __decorate$y = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12153
12258
|
var d,
|
|
12154
12259
|
c = arguments.length,
|
|
12155
12260
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12156
12261
|
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
12262
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12158
12263
|
},
|
|
12159
|
-
__metadata$
|
|
12264
|
+
__metadata$q = undefined && undefined.__metadata || function (k, v) {
|
|
12160
12265
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12161
12266
|
};
|
|
12162
12267
|
const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
|
|
@@ -12216,7 +12321,7 @@ let CommonDrawItemInterceptorContribution = class {
|
|
|
12216
12321
|
return !1;
|
|
12217
12322
|
}
|
|
12218
12323
|
};
|
|
12219
|
-
CommonDrawItemInterceptorContribution = __decorate$
|
|
12324
|
+
CommonDrawItemInterceptorContribution = __decorate$y([injectable(), __metadata$q("design:paramtypes", [])], CommonDrawItemInterceptorContribution);
|
|
12220
12325
|
class InteractiveDrawItemInterceptorContribution {
|
|
12221
12326
|
constructor() {
|
|
12222
12327
|
this.order = 1;
|
|
@@ -12348,17 +12453,17 @@ class Canvas3DDrawItemInterceptor {
|
|
|
12348
12453
|
}
|
|
12349
12454
|
}
|
|
12350
12455
|
|
|
12351
|
-
var __decorate$
|
|
12456
|
+
var __decorate$x = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12352
12457
|
var d,
|
|
12353
12458
|
c = arguments.length,
|
|
12354
12459
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12355
12460
|
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
12461
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12357
12462
|
},
|
|
12358
|
-
__metadata$
|
|
12463
|
+
__metadata$p = undefined && undefined.__metadata || function (k, v) {
|
|
12359
12464
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12360
12465
|
},
|
|
12361
|
-
__param$
|
|
12466
|
+
__param$l = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
12362
12467
|
return function (target, key) {
|
|
12363
12468
|
decorator(target, key, paramIndex);
|
|
12364
12469
|
};
|
|
@@ -12395,7 +12500,7 @@ let DefaultRenderService = class {
|
|
|
12395
12500
|
this.prepare(updateBounds), this.prepareRenderList(), this.beforeDraw(params), this.draw(params), this.afterDraw(params), this.drawParams = null;
|
|
12396
12501
|
}
|
|
12397
12502
|
};
|
|
12398
|
-
DefaultRenderService = __decorate$
|
|
12503
|
+
DefaultRenderService = __decorate$x([injectable(), __param$l(0, inject(DrawContribution)), __metadata$p("design:paramtypes", [Object])], DefaultRenderService);
|
|
12399
12504
|
|
|
12400
12505
|
var renderModule$1 = new ContainerModule(bind => {
|
|
12401
12506
|
bind(RenderService).to(DefaultRenderService);
|
|
@@ -12404,7 +12509,7 @@ var renderModule$1 = new ContainerModule(bind => {
|
|
|
12404
12509
|
const PickerService = Symbol.for("PickerService");
|
|
12405
12510
|
const GlobalPickerService = Symbol.for("GlobalPickerService");
|
|
12406
12511
|
|
|
12407
|
-
var __decorate$
|
|
12512
|
+
var __decorate$w = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12408
12513
|
var d,
|
|
12409
12514
|
c = arguments.length,
|
|
12410
12515
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
@@ -12423,6 +12528,7 @@ let ShadowRootPickItemInterceptorContribution = class {
|
|
|
12423
12528
|
return graphic.attribute.shadowRootIdx < 0 ? this._pickItem(graphic, pickerService, point, pickParams, params) : null;
|
|
12424
12529
|
}
|
|
12425
12530
|
_pickItem(graphic, pickerService, point, pickParams, params) {
|
|
12531
|
+
var _a;
|
|
12426
12532
|
if (!graphic.shadowRoot) return null;
|
|
12427
12533
|
const {
|
|
12428
12534
|
parentMatrix: parentMatrix
|
|
@@ -12430,14 +12536,18 @@ let ShadowRootPickItemInterceptorContribution = class {
|
|
|
12430
12536
|
if (!parentMatrix) return null;
|
|
12431
12537
|
const context = pickerService.pickContext;
|
|
12432
12538
|
context.highPerformanceSave();
|
|
12433
|
-
const
|
|
12539
|
+
const theme = null === (_a = getTheme(graphic)) || void 0 === _a ? void 0 : _a[graphic.type],
|
|
12540
|
+
{
|
|
12541
|
+
shadowPickMode = null == theme ? void 0 : theme.shadowPickMode
|
|
12542
|
+
} = graphic.attribute,
|
|
12543
|
+
g = graphic.shadowRoot,
|
|
12434
12544
|
currentGroupMatrix = matrixAllocate.allocateByObj(parentMatrix),
|
|
12435
12545
|
newPoint = new Point(currentGroupMatrix.a * point.x + currentGroupMatrix.c * point.y + currentGroupMatrix.e, currentGroupMatrix.b * point.x + currentGroupMatrix.d * point.y + currentGroupMatrix.f),
|
|
12436
12546
|
result = pickerService.pickGroup(g, newPoint, currentGroupMatrix, pickParams);
|
|
12437
|
-
return context.highPerformanceRestore(), result;
|
|
12547
|
+
return context.highPerformanceRestore(), !result.graphic && result.group && "full" === shadowPickMode && (result.graphic = result.group), result;
|
|
12438
12548
|
}
|
|
12439
12549
|
};
|
|
12440
|
-
ShadowRootPickItemInterceptorContribution = __decorate$
|
|
12550
|
+
ShadowRootPickItemInterceptorContribution = __decorate$w([injectable()], ShadowRootPickItemInterceptorContribution);
|
|
12441
12551
|
let InteractivePickItemInterceptorContribution = class {
|
|
12442
12552
|
constructor() {
|
|
12443
12553
|
this.order = 1;
|
|
@@ -12456,7 +12566,7 @@ let InteractivePickItemInterceptorContribution = class {
|
|
|
12456
12566
|
return null;
|
|
12457
12567
|
}
|
|
12458
12568
|
};
|
|
12459
|
-
InteractivePickItemInterceptorContribution = __decorate$
|
|
12569
|
+
InteractivePickItemInterceptorContribution = __decorate$w([injectable()], InteractivePickItemInterceptorContribution);
|
|
12460
12570
|
let Canvas3DPickItemInterceptor = class {
|
|
12461
12571
|
constructor() {
|
|
12462
12572
|
this.order = 1;
|
|
@@ -12516,7 +12626,7 @@ let Canvas3DPickItemInterceptor = class {
|
|
|
12516
12626
|
context.setTransformForCurrent();
|
|
12517
12627
|
}
|
|
12518
12628
|
};
|
|
12519
|
-
Canvas3DPickItemInterceptor = __decorate$
|
|
12629
|
+
Canvas3DPickItemInterceptor = __decorate$w([injectable()], Canvas3DPickItemInterceptor);
|
|
12520
12630
|
|
|
12521
12631
|
var pickModule = new ContainerModule((bind, unbind, isBound) => {
|
|
12522
12632
|
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 +12639,17 @@ var graphicModule = new ContainerModule(bind => {
|
|
|
12529
12639
|
const AutoEnablePlugins = Symbol.for("AutoEnablePlugins");
|
|
12530
12640
|
const PluginService = Symbol.for("PluginService");
|
|
12531
12641
|
|
|
12532
|
-
var __decorate$
|
|
12642
|
+
var __decorate$v = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12533
12643
|
var d,
|
|
12534
12644
|
c = arguments.length,
|
|
12535
12645
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12536
12646
|
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
12647
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12538
12648
|
},
|
|
12539
|
-
__metadata$
|
|
12649
|
+
__metadata$o = undefined && undefined.__metadata || function (k, v) {
|
|
12540
12650
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12541
12651
|
},
|
|
12542
|
-
__param$
|
|
12652
|
+
__param$k = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
12543
12653
|
return function (target, key) {
|
|
12544
12654
|
decorator(target, key, paramIndex);
|
|
12545
12655
|
};
|
|
@@ -12579,7 +12689,7 @@ let DefaultPluginService = class {
|
|
|
12579
12689
|
}), this.onRegisterPlugin = [];
|
|
12580
12690
|
}
|
|
12581
12691
|
};
|
|
12582
|
-
DefaultPluginService = __decorate$
|
|
12692
|
+
DefaultPluginService = __decorate$v([injectable(), __param$k(0, inject(ContributionProvider)), __param$k(0, named(AutoEnablePlugins)), __metadata$o("design:paramtypes", [Object])], DefaultPluginService);
|
|
12583
12693
|
|
|
12584
12694
|
var pluginModule = new ContainerModule(bind => {
|
|
12585
12695
|
bind(PluginService).to(DefaultPluginService), bindContributionProviderNoSingletonScope(bind, AutoEnablePlugins);
|
|
@@ -12593,14 +12703,14 @@ var textMeasureModules = new ContainerModule(bind => {
|
|
|
12593
12703
|
bind(TextMeasureContribution).to(DefaultTextMeasureContribution).inSingletonScope(), bindContributionProvider(bind, TextMeasureContribution);
|
|
12594
12704
|
});
|
|
12595
12705
|
|
|
12596
|
-
var __decorate$
|
|
12706
|
+
var __decorate$u = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12597
12707
|
var d,
|
|
12598
12708
|
c = arguments.length,
|
|
12599
12709
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12600
12710
|
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
12711
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12602
12712
|
},
|
|
12603
|
-
__metadata$
|
|
12713
|
+
__metadata$n = undefined && undefined.__metadata || function (k, v) {
|
|
12604
12714
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12605
12715
|
};
|
|
12606
12716
|
let CanvasLayerHandlerContribution = class {
|
|
@@ -12670,16 +12780,16 @@ let CanvasLayerHandlerContribution = class {
|
|
|
12670
12780
|
this.canvas.release();
|
|
12671
12781
|
}
|
|
12672
12782
|
};
|
|
12673
|
-
CanvasLayerHandlerContribution = __decorate$
|
|
12783
|
+
CanvasLayerHandlerContribution = __decorate$u([injectable(), __metadata$n("design:paramtypes", [])], CanvasLayerHandlerContribution);
|
|
12674
12784
|
|
|
12675
|
-
var __decorate$
|
|
12785
|
+
var __decorate$t = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12676
12786
|
var d,
|
|
12677
12787
|
c = arguments.length,
|
|
12678
12788
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12679
12789
|
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
12790
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12681
12791
|
},
|
|
12682
|
-
__metadata$
|
|
12792
|
+
__metadata$m = undefined && undefined.__metadata || function (k, v) {
|
|
12683
12793
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12684
12794
|
};
|
|
12685
12795
|
let EmptyLayerHandlerContribution = class {
|
|
@@ -12714,16 +12824,16 @@ let EmptyLayerHandlerContribution = class {
|
|
|
12714
12824
|
}
|
|
12715
12825
|
release() {}
|
|
12716
12826
|
};
|
|
12717
|
-
EmptyLayerHandlerContribution = __decorate$
|
|
12827
|
+
EmptyLayerHandlerContribution = __decorate$t([injectable(), __metadata$m("design:paramtypes", [])], EmptyLayerHandlerContribution);
|
|
12718
12828
|
|
|
12719
|
-
var __decorate$
|
|
12829
|
+
var __decorate$s = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12720
12830
|
var d,
|
|
12721
12831
|
c = arguments.length,
|
|
12722
12832
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12723
12833
|
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
12834
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12725
12835
|
},
|
|
12726
|
-
__metadata$
|
|
12836
|
+
__metadata$l = undefined && undefined.__metadata || function (k, v) {
|
|
12727
12837
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12728
12838
|
};
|
|
12729
12839
|
let OffscreenLayerHandlerContribution = class {
|
|
@@ -12786,7 +12896,7 @@ let OffscreenLayerHandlerContribution = class {
|
|
|
12786
12896
|
}
|
|
12787
12897
|
merge(layerHandlers) {}
|
|
12788
12898
|
};
|
|
12789
|
-
OffscreenLayerHandlerContribution = __decorate$
|
|
12899
|
+
OffscreenLayerHandlerContribution = __decorate$s([injectable(), __metadata$l("design:paramtypes", [])], OffscreenLayerHandlerContribution);
|
|
12790
12900
|
|
|
12791
12901
|
var layerHandlerModules = new ContainerModule(bind => {
|
|
12792
12902
|
bind(CanvasLayerHandlerContribution).toSelf(), bind(OffscreenLayerHandlerContribution).toSelf(), bind(EmptyLayerHandlerContribution).toSelf(), bind(StaticLayerHandlerContribution).toService(CanvasLayerHandlerContribution), bind(DynamicLayerHandlerContribution).toService(OffscreenLayerHandlerContribution), bind(VirtualLayerHandlerContribution).toService(EmptyLayerHandlerContribution);
|
|
@@ -12902,17 +13012,17 @@ function findNextGraphic(graphic, id, defaultZIndex) {
|
|
|
12902
13012
|
return result;
|
|
12903
13013
|
}
|
|
12904
13014
|
|
|
12905
|
-
var __decorate$
|
|
13015
|
+
var __decorate$r = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
12906
13016
|
var d,
|
|
12907
13017
|
c = arguments.length,
|
|
12908
13018
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
12909
13019
|
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
13020
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12911
13021
|
},
|
|
12912
|
-
__metadata$
|
|
13022
|
+
__metadata$k = undefined && undefined.__metadata || function (k, v) {
|
|
12913
13023
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
12914
13024
|
},
|
|
12915
|
-
__param$
|
|
13025
|
+
__param$j = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
12916
13026
|
return function (target, key) {
|
|
12917
13027
|
decorator(target, key, paramIndex);
|
|
12918
13028
|
};
|
|
@@ -13099,101 +13209,7 @@ let DefaultDrawContribution = class {
|
|
|
13099
13209
|
}
|
|
13100
13210
|
afterDraw(renderService, drawParams) {}
|
|
13101
13211
|
};
|
|
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);
|
|
13212
|
+
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
13213
|
|
|
13198
13214
|
var __decorate$q = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
13199
13215
|
var d,
|
|
@@ -27142,61 +27158,47 @@ class Indicator extends AbstractComponent {
|
|
|
27142
27158
|
super(...arguments);
|
|
27143
27159
|
this.name = 'indicator';
|
|
27144
27160
|
}
|
|
27161
|
+
_renderText(group, title, limit, limitRatio, themePath, graphicName) {
|
|
27162
|
+
if (title.visible !== false) {
|
|
27163
|
+
const titleStyle = merge({}, get(DEFAULT_INDICATOR_THEME, themePath), title.style, {
|
|
27164
|
+
visible: title.visible
|
|
27165
|
+
});
|
|
27166
|
+
titleStyle.lineHeight = isValid(titleStyle.lineHeight) ? titleStyle.lineHeight : titleStyle.fontSize;
|
|
27167
|
+
if (title.formatMethod) {
|
|
27168
|
+
titleStyle._originText = titleStyle.text;
|
|
27169
|
+
titleStyle.text = title.formatMethod(titleStyle.text, titleStyle);
|
|
27170
|
+
}
|
|
27171
|
+
const textGraphic = createTextGraphicByType(titleStyle);
|
|
27172
|
+
textGraphic.name = graphicName;
|
|
27173
|
+
group.appendChild(textGraphic);
|
|
27174
|
+
if (title.autoFit && isValidNumber(limit)) {
|
|
27175
|
+
this._setLocalAutoFit(limit, textGraphic, title);
|
|
27176
|
+
}
|
|
27177
|
+
if (title.autoLimit && isValidNumber(limitRatio)) {
|
|
27178
|
+
textGraphic.setAttribute('maxLineWidth', limit);
|
|
27179
|
+
}
|
|
27180
|
+
return textGraphic;
|
|
27181
|
+
}
|
|
27182
|
+
return undefined;
|
|
27183
|
+
}
|
|
27145
27184
|
render() {
|
|
27146
27185
|
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();
|
|
27186
|
+
this.removeAllChild(true);
|
|
27187
|
+
if (this.attribute.visible !== true) {
|
|
27152
27188
|
return;
|
|
27153
27189
|
}
|
|
27190
|
+
const { title = {}, content, size, limitRatio = Infinity } = this.attribute;
|
|
27191
|
+
const limit = Math.min(size.width, size.height) * limitRatio;
|
|
27192
|
+
const group = this.createOrUpdateChild('indicator-container', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
27154
27193
|
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
|
-
}
|
|
27194
|
+
this._title = this._renderText(group, title, limit, limitRatio, 'title.style', 'indicator-title');
|
|
27175
27195
|
}
|
|
27176
27196
|
if (isValid(content)) {
|
|
27177
27197
|
const contents = array(content);
|
|
27178
27198
|
const contentComponents = [];
|
|
27179
27199
|
contents.forEach((contentItem, i) => {
|
|
27180
27200
|
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);
|
|
27201
|
+
contentComponents.push(this._renderText(group, contentItem, limit, limitRatio, 'content.style', 'indicator-content-' + i));
|
|
27200
27202
|
}
|
|
27201
27203
|
});
|
|
27202
27204
|
this._content = contentComponents;
|
|
@@ -29019,6 +29021,219 @@ class Tooltip extends AbstractComponent {
|
|
|
29019
29021
|
}
|
|
29020
29022
|
Tooltip.defaultAttributes = defaultAttributes;
|
|
29021
29023
|
|
|
29024
|
+
function loadTimelineComponent() {
|
|
29025
|
+
registerGroup();
|
|
29026
|
+
registerText();
|
|
29027
|
+
registerSymbol();
|
|
29028
|
+
registerLine();
|
|
29029
|
+
}
|
|
29030
|
+
|
|
29031
|
+
loadTimelineComponent();
|
|
29032
|
+
class Timeline extends AbstractComponent {
|
|
29033
|
+
constructor(attributes, options) {
|
|
29034
|
+
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : merge({}, Timeline.defaultAttributes, attributes));
|
|
29035
|
+
this.name = 'timeline';
|
|
29036
|
+
}
|
|
29037
|
+
render() {
|
|
29038
|
+
const { width, lineStyle, activeLineStyle, symbolStyle, activeSymbolStyle, labelStyle, activeLabelStyle, times, pointLayoutMode, labelSpace, clipRange, animation } = this.attribute;
|
|
29039
|
+
if (!(times && times.length)) {
|
|
29040
|
+
return;
|
|
29041
|
+
}
|
|
29042
|
+
const symbolHeight = (isArray(symbolStyle.size) ? symbolStyle.size[1] : symbolStyle.size) || 0;
|
|
29043
|
+
const activeSymbolHeight = (isArray(activeSymbolStyle.size) ? activeSymbolStyle.size[1] : activeSymbolStyle.size) || 0;
|
|
29044
|
+
const lineSymbolHeight = Math.max(lineStyle.lineWidth || 0, activeLineStyle.lineWidth || 0, symbolHeight, activeSymbolHeight);
|
|
29045
|
+
const lineY = lineSymbolHeight / 2;
|
|
29046
|
+
const lineAttr = {
|
|
29047
|
+
y: lineY,
|
|
29048
|
+
points: [
|
|
29049
|
+
{ x: 0, y: 0 },
|
|
29050
|
+
{ x: width, y: 0 }
|
|
29051
|
+
]
|
|
29052
|
+
};
|
|
29053
|
+
this._line = this.createOrUpdateChild('line-axes', Object.assign(Object.assign({}, lineStyle), lineAttr), 'line');
|
|
29054
|
+
this._activeLine = this.createOrUpdateChild('active-line-axes', Object.assign(Object.assign(Object.assign({}, activeLineStyle), lineAttr), { clipRange }), 'line');
|
|
29055
|
+
const activeWidth = width * clipRange;
|
|
29056
|
+
const symbolGroup = this.createOrUpdateChild('symbol-group', {
|
|
29057
|
+
y: lineY
|
|
29058
|
+
}, 'group');
|
|
29059
|
+
const symbolSpace = times.length === 1
|
|
29060
|
+
? width
|
|
29061
|
+
: pointLayoutMode === 'space-between'
|
|
29062
|
+
? width / (times.length - 1)
|
|
29063
|
+
: width / times.length;
|
|
29064
|
+
const symbolStartX = pointLayoutMode === 'space-between' ? 0 : symbolSpace / 2;
|
|
29065
|
+
this._timesPercent = times.map((_, i) => (symbolStartX + symbolSpace * i) / width);
|
|
29066
|
+
times.forEach((item, i) => {
|
|
29067
|
+
const x = this._timesPercent[i] * width;
|
|
29068
|
+
symbolGroup.createOrUpdateChild(item.label, Object.assign(Object.assign({}, symbolStyle), { x }), 'symbol');
|
|
29069
|
+
});
|
|
29070
|
+
this._symbolGroup = symbolGroup;
|
|
29071
|
+
const labelY = lineSymbolHeight + labelSpace;
|
|
29072
|
+
const labelGroup = this.createOrUpdateChild('label-group', {
|
|
29073
|
+
y: labelY
|
|
29074
|
+
}, 'group');
|
|
29075
|
+
times.forEach((item, i) => {
|
|
29076
|
+
const x = this._timesPercent[i] * width;
|
|
29077
|
+
labelGroup.createOrUpdateChild(item.label, Object.assign(Object.assign({}, labelStyle), { x, text: item.label }), 'text');
|
|
29078
|
+
});
|
|
29079
|
+
this._labelGroup = labelGroup;
|
|
29080
|
+
const setActive = (group, activeStyle) => {
|
|
29081
|
+
group.forEachChildren((label) => {
|
|
29082
|
+
if (label.currentStates) {
|
|
29083
|
+
const currentStates = label.currentStates;
|
|
29084
|
+
label.clearStates();
|
|
29085
|
+
label.useStates(currentStates, false);
|
|
29086
|
+
}
|
|
29087
|
+
label.states = {
|
|
29088
|
+
active: activeStyle
|
|
29089
|
+
};
|
|
29090
|
+
if (label.attribute.x <= activeWidth) {
|
|
29091
|
+
label.useStates(['active'], animation);
|
|
29092
|
+
}
|
|
29093
|
+
});
|
|
29094
|
+
};
|
|
29095
|
+
setActive(labelGroup, activeLabelStyle);
|
|
29096
|
+
setActive(symbolGroup, activeSymbolStyle);
|
|
29097
|
+
}
|
|
29098
|
+
appearAnimate(animateConfig) {
|
|
29099
|
+
const { duration = 1000, easing = 'quadOut' } = animateConfig;
|
|
29100
|
+
const { activeLabelStyle, activeSymbolStyle } = this.attribute;
|
|
29101
|
+
const percent = duration / 1000;
|
|
29102
|
+
const lineDuration = percent * 500;
|
|
29103
|
+
const activeLineDuration = percent * 200;
|
|
29104
|
+
const perSymbolDuration = percent * 100;
|
|
29105
|
+
const perSymbolNormalDuration = percent * 90;
|
|
29106
|
+
const symbolDelay = percent * 100;
|
|
29107
|
+
const symbolNormalDelay = percent * 600;
|
|
29108
|
+
if (this._line) {
|
|
29109
|
+
this._line.setAttributes({ clipRange: 0 });
|
|
29110
|
+
this._line.animate().to({ clipRange: 1 }, lineDuration, easing);
|
|
29111
|
+
}
|
|
29112
|
+
if (this._activeLine) {
|
|
29113
|
+
this._activeLine.setAttributes({ opacity: 0 });
|
|
29114
|
+
this._activeLine
|
|
29115
|
+
.animate()
|
|
29116
|
+
.wait(500)
|
|
29117
|
+
.to({ opacity: 1 }, activeLineDuration, easing);
|
|
29118
|
+
}
|
|
29119
|
+
if (this._symbolGroup) {
|
|
29120
|
+
const size = this._symbolGroup.count - 1;
|
|
29121
|
+
const delay = percent * (size === 1 ? 0 : (500 - 100) / (size - 1));
|
|
29122
|
+
const delayNormal = percent * (size === 1 ? 0 : (400 - 160) / (size - 1));
|
|
29123
|
+
this._symbolGroup.forEachChildren((symbol, i) => {
|
|
29124
|
+
const originAttrs = Object.assign({}, symbol.attribute);
|
|
29125
|
+
symbol.setAttributes({ opacity: 0 });
|
|
29126
|
+
symbol
|
|
29127
|
+
.animate()
|
|
29128
|
+
.wait(symbolDelay + delay * i)
|
|
29129
|
+
.to({ opacity: 1 }, perSymbolDuration, easing);
|
|
29130
|
+
symbol
|
|
29131
|
+
.animate()
|
|
29132
|
+
.wait(symbolNormalDelay + delayNormal * i)
|
|
29133
|
+
.to(Object.assign({ scaleX: 1.8, scaleY: 1.8 }, activeSymbolStyle), perSymbolNormalDuration, easing)
|
|
29134
|
+
.to(Object.assign({ scaleX: 1, scaleY: 1 }, originAttrs), perSymbolNormalDuration, easing);
|
|
29135
|
+
});
|
|
29136
|
+
}
|
|
29137
|
+
if (this._labelGroup) {
|
|
29138
|
+
const size = this._labelGroup.count - 1;
|
|
29139
|
+
const delay = percent * (size === 1 ? 0 : (500 - 100) / (size - 1));
|
|
29140
|
+
const delayNormal = percent * (size === 1 ? 0 : (400 - 160) / (size - 1));
|
|
29141
|
+
this._labelGroup.forEachChildren((label, i) => {
|
|
29142
|
+
const originAttrs = Object.assign({}, label.attribute);
|
|
29143
|
+
label.setAttributes({ opacity: 0 });
|
|
29144
|
+
label
|
|
29145
|
+
.animate()
|
|
29146
|
+
.wait(symbolDelay + delay * i)
|
|
29147
|
+
.to({ opacity: 1 }, perSymbolDuration, easing);
|
|
29148
|
+
label
|
|
29149
|
+
.animate()
|
|
29150
|
+
.wait(symbolNormalDelay + delayNormal * i)
|
|
29151
|
+
.to(Object.assign({ dy: 10 }, activeLabelStyle), perSymbolNormalDuration, easing)
|
|
29152
|
+
.to(Object.assign({ dy: 0 }, originAttrs), perSymbolNormalDuration, easing);
|
|
29153
|
+
});
|
|
29154
|
+
}
|
|
29155
|
+
}
|
|
29156
|
+
goto(flag, animateConfig) {
|
|
29157
|
+
var _a;
|
|
29158
|
+
let { clipRange } = this.attribute;
|
|
29159
|
+
const { animation } = this.attribute;
|
|
29160
|
+
if (flag > 0) {
|
|
29161
|
+
if (clipRange >= 1) {
|
|
29162
|
+
return;
|
|
29163
|
+
}
|
|
29164
|
+
else if (clipRange < 0) {
|
|
29165
|
+
clipRange = 0;
|
|
29166
|
+
}
|
|
29167
|
+
}
|
|
29168
|
+
else {
|
|
29169
|
+
if (clipRange <= 0) {
|
|
29170
|
+
return;
|
|
29171
|
+
}
|
|
29172
|
+
else if (clipRange > 1) {
|
|
29173
|
+
clipRange = 1;
|
|
29174
|
+
}
|
|
29175
|
+
}
|
|
29176
|
+
if (clipRange !== this.attribute.clipRange) {
|
|
29177
|
+
this.setAttributes({ clipRange });
|
|
29178
|
+
}
|
|
29179
|
+
let i = 0;
|
|
29180
|
+
for (; i < this._timesPercent.length; i++) {
|
|
29181
|
+
if (clipRange < this._timesPercent[i]) {
|
|
29182
|
+
break;
|
|
29183
|
+
}
|
|
29184
|
+
}
|
|
29185
|
+
const nextClipRange = flag > 0 ? this._timesPercent[i] : this._timesPercent[i - 1] || 0;
|
|
29186
|
+
if (animation) {
|
|
29187
|
+
const { duration = 1000, easing = 'quadOut' } = animateConfig;
|
|
29188
|
+
const actDuration = (Math.abs(nextClipRange - clipRange) / (this._timesPercent[i] - ((_a = this._timesPercent[i - 1]) !== null && _a !== void 0 ? _a : 0))) * duration;
|
|
29189
|
+
this.animate().to({ clipRange: nextClipRange }, actDuration, easing);
|
|
29190
|
+
}
|
|
29191
|
+
else {
|
|
29192
|
+
this.setAttributes({ clipRange: nextClipRange });
|
|
29193
|
+
}
|
|
29194
|
+
}
|
|
29195
|
+
forward(animateConfig) {
|
|
29196
|
+
this.goto(1, animateConfig);
|
|
29197
|
+
}
|
|
29198
|
+
backward(animateConfig) {
|
|
29199
|
+
this.goto(-1, animateConfig);
|
|
29200
|
+
}
|
|
29201
|
+
}
|
|
29202
|
+
Timeline.defaultAttributes = {
|
|
29203
|
+
labelSpace: 10,
|
|
29204
|
+
pointLayoutMode: 'space-around',
|
|
29205
|
+
animation: true,
|
|
29206
|
+
symbolStyle: {
|
|
29207
|
+
fill: 'black',
|
|
29208
|
+
size: 12,
|
|
29209
|
+
symbolType: 'circle'
|
|
29210
|
+
},
|
|
29211
|
+
activeSymbolStyle: {
|
|
29212
|
+
fill: 'orange'
|
|
29213
|
+
},
|
|
29214
|
+
lineStyle: {
|
|
29215
|
+
lineDash: [2, 2],
|
|
29216
|
+
lineCap: 'butt',
|
|
29217
|
+
stroke: 'black',
|
|
29218
|
+
lineWidth: 2
|
|
29219
|
+
},
|
|
29220
|
+
activeLineStyle: {
|
|
29221
|
+
stroke: 'orange',
|
|
29222
|
+
lineWidth: 4
|
|
29223
|
+
},
|
|
29224
|
+
labelStyle: {
|
|
29225
|
+
fontSize: 12,
|
|
29226
|
+
fill: 'black',
|
|
29227
|
+
textAlign: 'center',
|
|
29228
|
+
textBaseline: 'top'
|
|
29229
|
+
},
|
|
29230
|
+
activeLabelStyle: {
|
|
29231
|
+
fontSize: 14,
|
|
29232
|
+
fill: 'orange'
|
|
29233
|
+
},
|
|
29234
|
+
clipRange: 0
|
|
29235
|
+
};
|
|
29236
|
+
|
|
29022
29237
|
function VTag(params) {
|
|
29023
29238
|
return new Tag(params ? params.attribute : {});
|
|
29024
29239
|
}
|
|
@@ -29374,6 +29589,6 @@ EmptyTip.defaultAttributes = {
|
|
|
29374
29589
|
}
|
|
29375
29590
|
};
|
|
29376
29591
|
|
|
29377
|
-
const version = "0.19.
|
|
29592
|
+
const version = "0.19.23";
|
|
29378
29593
|
|
|
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 };
|
|
29594
|
+
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 };
|