@visactor/vrender-components 0.17.8-alpha.0 → 0.17.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/axis/animate/group-transition.js +6 -3
- package/cjs/axis/animate/group-transition.js.map +1 -1
- package/cjs/axis/base.js +8 -8
- package/cjs/axis/base.js.map +1 -1
- package/cjs/axis/circle.js +12 -12
- package/cjs/axis/circle.js.map +1 -1
- package/cjs/axis/line.js +11 -11
- package/cjs/axis/line.js.map +1 -1
- package/cjs/brush/brush.js +6 -7
- package/cjs/brush/brush.js.map +1 -1
- package/cjs/data-zoom/data-zoom.js +56 -49
- package/cjs/data-zoom/data-zoom.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/indicator/indicator.js +3 -3
- package/cjs/indicator/indicator.js.map +1 -1
- package/cjs/jsx/index.js +1 -1
- package/cjs/label/arc.js +3 -1
- package/cjs/label/arc.js.map +1 -1
- package/cjs/label/base.d.ts +1 -1
- package/cjs/label/base.js +14 -15
- package/cjs/label/base.js.map +1 -1
- package/cjs/label/index.js +2 -1
- package/cjs/label/line.js +1 -2
- package/cjs/label/type.d.ts +3 -3
- package/cjs/label/type.js.map +1 -1
- package/cjs/label/util.js +1 -1
- package/cjs/legend/discrete/discrete.js +8 -9
- package/cjs/legend/discrete/discrete.js.map +1 -1
- package/cjs/marker/area.js +4 -5
- package/cjs/marker/area.js.map +1 -1
- package/cjs/marker/base.js +8 -8
- package/cjs/marker/base.js.map +1 -1
- package/cjs/marker/line.js +3 -4
- package/cjs/marker/line.js.map +1 -1
- package/cjs/marker/point.js +39 -38
- package/cjs/marker/point.js.map +1 -1
- package/cjs/player/base-player.js +7 -10
- package/cjs/player/base-player.js.map +1 -1
- package/cjs/player/controller/controller.js +4 -4
- package/cjs/player/controller/controller.js.map +1 -1
- package/cjs/scrollbar/scrollbar.js +11 -7
- package/cjs/scrollbar/scrollbar.js.map +1 -1
- package/cjs/segment/segment.js +6 -6
- package/cjs/segment/segment.js.map +1 -1
- package/cjs/slider/slider.js +13 -13
- package/cjs/slider/slider.js.map +1 -1
- package/cjs/tag/tag.js +6 -3
- package/cjs/tag/tag.js.map +1 -1
- package/cjs/tag/type.d.ts +1 -0
- package/cjs/tag/type.js.map +1 -1
- package/cjs/title/title.js +77 -77
- package/cjs/title/title.js.map +1 -1
- package/cjs/tooltip/tooltip.js +2 -2
- package/cjs/tooltip/tooltip.js.map +1 -1
- package/dist/index.js +574 -477
- package/dist/index.min.js +1 -1
- package/es/axis/animate/group-transition.js +5 -3
- package/es/axis/animate/group-transition.js.map +1 -1
- package/es/axis/base.js +8 -8
- package/es/axis/base.js.map +1 -1
- package/es/axis/circle.js +11 -11
- package/es/axis/circle.js.map +1 -1
- package/es/axis/line.js +11 -11
- package/es/axis/line.js.map +1 -1
- package/es/brush/brush.js +6 -7
- package/es/brush/brush.js.map +1 -1
- package/es/data-zoom/data-zoom.js +56 -49
- package/es/data-zoom/data-zoom.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/indicator/indicator.js +3 -3
- package/es/indicator/indicator.js.map +1 -1
- package/es/jsx/index.js +1 -1
- package/es/label/arc.js +1 -1
- package/es/label/arc.js.map +1 -1
- package/es/label/base.d.ts +1 -1
- package/es/label/base.js +14 -15
- package/es/label/base.js.map +1 -1
- package/es/label/index.js +2 -1
- package/es/label/line.js +1 -2
- package/es/label/type.d.ts +3 -3
- package/es/label/type.js.map +1 -1
- package/es/label/util.js +1 -1
- package/es/legend/discrete/discrete.js +8 -9
- package/es/legend/discrete/discrete.js.map +1 -1
- package/es/marker/area.js +4 -5
- package/es/marker/area.js.map +1 -1
- package/es/marker/base.js +8 -8
- package/es/marker/base.js.map +1 -1
- package/es/marker/line.js +3 -4
- package/es/marker/line.js.map +1 -1
- package/es/marker/point.js +39 -38
- package/es/marker/point.js.map +1 -1
- package/es/player/base-player.js +7 -10
- package/es/player/base-player.js.map +1 -1
- package/es/player/controller/controller.js +4 -4
- package/es/player/controller/controller.js.map +1 -1
- package/es/scrollbar/scrollbar.js +11 -7
- package/es/scrollbar/scrollbar.js.map +1 -1
- package/es/segment/segment.js +6 -6
- package/es/segment/segment.js.map +1 -1
- package/es/slider/slider.js +13 -13
- package/es/slider/slider.js.map +1 -1
- package/es/tag/tag.js +6 -3
- package/es/tag/tag.js.map +1 -1
- package/es/tag/type.d.ts +1 -0
- package/es/tag/type.js.map +1 -1
- package/es/title/title.js +75 -77
- package/es/title/title.js.map +1 -1
- package/es/tooltip/tooltip.js +2 -2
- package/es/tooltip/tooltip.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -3868,6 +3868,168 @@
|
|
|
3868
3868
|
},
|
|
3869
3869
|
__metadata$F = undefined && undefined.__metadata || function (k, v) {
|
|
3870
3870
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
3871
|
+
};
|
|
3872
|
+
var VWindow = Symbol["for"]("VWindow");
|
|
3873
|
+
var WindowHandlerContribution = Symbol["for"]("WindowHandlerContribution");
|
|
3874
|
+
var DefaultWindow = /*#__PURE__*/function () {
|
|
3875
|
+
function DefaultWindow() {
|
|
3876
|
+
_classCallCheck(this, DefaultWindow);
|
|
3877
|
+
this.hooks = {
|
|
3878
|
+
onChange: new SyncHook(["x", "y", "width", "height"])
|
|
3879
|
+
}, this._uid = Generator.GenAutoIncrementId(), this.global = application.global, this.postInit();
|
|
3880
|
+
}
|
|
3881
|
+
_createClass(DefaultWindow, [{
|
|
3882
|
+
key: "width",
|
|
3883
|
+
get: function get() {
|
|
3884
|
+
if (this._handler) {
|
|
3885
|
+
var wh = this._handler.getWH();
|
|
3886
|
+
return this._width = wh.width;
|
|
3887
|
+
}
|
|
3888
|
+
return this._width;
|
|
3889
|
+
}
|
|
3890
|
+
}, {
|
|
3891
|
+
key: "height",
|
|
3892
|
+
get: function get() {
|
|
3893
|
+
if (this._handler) {
|
|
3894
|
+
var wh = this._handler.getWH();
|
|
3895
|
+
return this._height = wh.height;
|
|
3896
|
+
}
|
|
3897
|
+
return this._height;
|
|
3898
|
+
}
|
|
3899
|
+
}, {
|
|
3900
|
+
key: "dpr",
|
|
3901
|
+
get: function get() {
|
|
3902
|
+
return this._handler.getDpr();
|
|
3903
|
+
}
|
|
3904
|
+
}, {
|
|
3905
|
+
key: "postInit",
|
|
3906
|
+
value: function postInit() {
|
|
3907
|
+
var _this = this;
|
|
3908
|
+
this.global.hooks.onSetEnv.tap("window", function () {
|
|
3909
|
+
_this.active();
|
|
3910
|
+
}), this.active();
|
|
3911
|
+
}
|
|
3912
|
+
}, {
|
|
3913
|
+
key: "active",
|
|
3914
|
+
value: function active() {
|
|
3915
|
+
var global = this.global;
|
|
3916
|
+
if (!global.env || this.actived) return;
|
|
3917
|
+
container.getNamed(WindowHandlerContribution, global.env).configure(this, global), this.actived = !0;
|
|
3918
|
+
}
|
|
3919
|
+
}, {
|
|
3920
|
+
key: "style",
|
|
3921
|
+
get: function get() {
|
|
3922
|
+
return this._handler.getStyle();
|
|
3923
|
+
},
|
|
3924
|
+
set: function set(style) {
|
|
3925
|
+
this._handler.setStyle(style);
|
|
3926
|
+
}
|
|
3927
|
+
}, {
|
|
3928
|
+
key: "create",
|
|
3929
|
+
value: function create(params) {
|
|
3930
|
+
this._handler.createWindow(params);
|
|
3931
|
+
var windowWH = this._handler.getWH();
|
|
3932
|
+
this._width = windowWH.width, this._height = windowWH.height, this.title = this._handler.getTitle(), this.resizable = !0;
|
|
3933
|
+
}
|
|
3934
|
+
}, {
|
|
3935
|
+
key: "setWindowHandler",
|
|
3936
|
+
value: function setWindowHandler(handler) {
|
|
3937
|
+
this._handler = handler;
|
|
3938
|
+
}
|
|
3939
|
+
}, {
|
|
3940
|
+
key: "setDpr",
|
|
3941
|
+
value: function setDpr(dpr) {
|
|
3942
|
+
return this._handler.setDpr(dpr);
|
|
3943
|
+
}
|
|
3944
|
+
}, {
|
|
3945
|
+
key: "resize",
|
|
3946
|
+
value: function resize(w, h) {
|
|
3947
|
+
return this._handler.resizeWindow(w, h);
|
|
3948
|
+
}
|
|
3949
|
+
}, {
|
|
3950
|
+
key: "configure",
|
|
3951
|
+
value: function configure() {
|
|
3952
|
+
throw new Error("暂不支持");
|
|
3953
|
+
}
|
|
3954
|
+
}, {
|
|
3955
|
+
key: "release",
|
|
3956
|
+
value: function release() {
|
|
3957
|
+
return this._handler.releaseWindow();
|
|
3958
|
+
}
|
|
3959
|
+
}, {
|
|
3960
|
+
key: "getContext",
|
|
3961
|
+
value: function getContext() {
|
|
3962
|
+
return this._handler.getContext();
|
|
3963
|
+
}
|
|
3964
|
+
}, {
|
|
3965
|
+
key: "getNativeHandler",
|
|
3966
|
+
value: function getNativeHandler() {
|
|
3967
|
+
return this._handler.getNativeHandler();
|
|
3968
|
+
}
|
|
3969
|
+
}, {
|
|
3970
|
+
key: "getImageBuffer",
|
|
3971
|
+
value: function getImageBuffer(type) {
|
|
3972
|
+
return this._handler.getImageBuffer ? this._handler.getImageBuffer(type) : null;
|
|
3973
|
+
}
|
|
3974
|
+
}, {
|
|
3975
|
+
key: "addEventListener",
|
|
3976
|
+
value: function addEventListener(type, listener, options) {
|
|
3977
|
+
return this._handler.addEventListener(type, listener, options);
|
|
3978
|
+
}
|
|
3979
|
+
}, {
|
|
3980
|
+
key: "removeEventListener",
|
|
3981
|
+
value: function removeEventListener(type, listener, options) {
|
|
3982
|
+
return this._handler.removeEventListener(type, listener, options);
|
|
3983
|
+
}
|
|
3984
|
+
}, {
|
|
3985
|
+
key: "dispatchEvent",
|
|
3986
|
+
value: function dispatchEvent(event) {
|
|
3987
|
+
return this._handler.dispatchEvent(event);
|
|
3988
|
+
}
|
|
3989
|
+
}, {
|
|
3990
|
+
key: "getBoundingClientRect",
|
|
3991
|
+
value: function getBoundingClientRect() {
|
|
3992
|
+
return this._handler.getBoundingClientRect();
|
|
3993
|
+
}
|
|
3994
|
+
}, {
|
|
3995
|
+
key: "getContainer",
|
|
3996
|
+
value: function getContainer() {
|
|
3997
|
+
return this._handler.container;
|
|
3998
|
+
}
|
|
3999
|
+
}, {
|
|
4000
|
+
key: "clearViewBox",
|
|
4001
|
+
value: function clearViewBox(viewBox, color) {
|
|
4002
|
+
this._handler.clearViewBox(viewBox, color);
|
|
4003
|
+
}
|
|
4004
|
+
}, {
|
|
4005
|
+
key: "isVisible",
|
|
4006
|
+
value: function isVisible(bbox) {
|
|
4007
|
+
return this._handler.isVisible(bbox);
|
|
4008
|
+
}
|
|
4009
|
+
}, {
|
|
4010
|
+
key: "onVisibleChange",
|
|
4011
|
+
value: function onVisibleChange(cb) {
|
|
4012
|
+
return this._handler.onVisibleChange(cb);
|
|
4013
|
+
}
|
|
4014
|
+
}, {
|
|
4015
|
+
key: "getTopLeft",
|
|
4016
|
+
value: function getTopLeft(baseWindow) {
|
|
4017
|
+
return this._handler.getTopLeft(baseWindow);
|
|
4018
|
+
}
|
|
4019
|
+
}]);
|
|
4020
|
+
return DefaultWindow;
|
|
4021
|
+
}();
|
|
4022
|
+
DefaultWindow = __decorate$P([injectable(), __metadata$F("design:paramtypes", [])], DefaultWindow);
|
|
4023
|
+
|
|
4024
|
+
var __decorate$O = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
4025
|
+
var d,
|
|
4026
|
+
c = arguments.length,
|
|
4027
|
+
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
4028
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _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);
|
|
4029
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4030
|
+
},
|
|
4031
|
+
__metadata$E = undefined && undefined.__metadata || function (k, v) {
|
|
4032
|
+
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
3871
4033
|
},
|
|
3872
4034
|
__param$y = undefined && undefined.__param || function (paramIndex, decorator) {
|
|
3873
4035
|
return function (target, key) {
|
|
@@ -3948,10 +4110,45 @@
|
|
|
3948
4110
|
specialCharSet: "-/: .,@%'\"~" + vutils.TextMeasure.ALPHABET_CHAR_SET + vutils.TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
3949
4111
|
}, null != option ? option : {}), textSpec);
|
|
3950
4112
|
}
|
|
4113
|
+
}, {
|
|
4114
|
+
key: "drawGraphicToCanvas",
|
|
4115
|
+
value: function drawGraphicToCanvas(graphic, stage, canvas) {
|
|
4116
|
+
if (!stage.defaultLayer) return null;
|
|
4117
|
+
var window = container.get(VWindow),
|
|
4118
|
+
bounds = graphic.AABBBounds,
|
|
4119
|
+
width = bounds.width(),
|
|
4120
|
+
height = bounds.height();
|
|
4121
|
+
window.create({
|
|
4122
|
+
width: width,
|
|
4123
|
+
height: height,
|
|
4124
|
+
canvas: canvas,
|
|
4125
|
+
dpr: stage.window.dpr,
|
|
4126
|
+
canvasControled: !0,
|
|
4127
|
+
offscreen: !0,
|
|
4128
|
+
title: ""
|
|
4129
|
+
});
|
|
4130
|
+
var x = -bounds.x1,
|
|
4131
|
+
y = -bounds.y1,
|
|
4132
|
+
disableCheckGraphicWidthOutRange = stage.params.optimize.disableCheckGraphicWidthOutRange;
|
|
4133
|
+
stage.params.optimize.disableCheckGraphicWidthOutRange = !0, stage.defaultLayer.getNativeHandler().drawTo(window, [graphic], {
|
|
4134
|
+
x: x,
|
|
4135
|
+
y: y,
|
|
4136
|
+
width: width,
|
|
4137
|
+
height: height,
|
|
4138
|
+
stage: stage,
|
|
4139
|
+
layer: stage.defaultLayer,
|
|
4140
|
+
renderService: stage.renderService,
|
|
4141
|
+
background: "transparent",
|
|
4142
|
+
clear: !0,
|
|
4143
|
+
updateBounds: !1
|
|
4144
|
+
}), stage.params.optimize.disableCheckGraphicWidthOutRange = disableCheckGraphicWidthOutRange;
|
|
4145
|
+
var c = window.getNativeHandler();
|
|
4146
|
+
return c.nativeCanvas ? c.nativeCanvas : null;
|
|
4147
|
+
}
|
|
3951
4148
|
}]);
|
|
3952
4149
|
return DefaultGraphicUtil;
|
|
3953
4150
|
}();
|
|
3954
|
-
DefaultGraphicUtil = __decorate$
|
|
4151
|
+
DefaultGraphicUtil = __decorate$O([injectable(), __param$y(0, inject(ContributionProvider)), __param$y(0, named(TextMeasureContribution)), __metadata$E("design:paramtypes", [Object])], DefaultGraphicUtil);
|
|
3955
4152
|
var TransformMode;
|
|
3956
4153
|
!function (TransformMode) {
|
|
3957
4154
|
TransformMode[TransformMode.transform = 0] = "transform", TransformMode[TransformMode.matrix = 1] = "matrix";
|
|
@@ -4028,7 +4225,7 @@
|
|
|
4028
4225
|
}]);
|
|
4029
4226
|
return DefaultTransformUtil;
|
|
4030
4227
|
}();
|
|
4031
|
-
DefaultTransformUtil = __decorate$
|
|
4228
|
+
DefaultTransformUtil = __decorate$O([injectable(), __metadata$E("design:paramtypes", [])], DefaultTransformUtil);
|
|
4032
4229
|
|
|
4033
4230
|
var defaultThemeObj = {
|
|
4034
4231
|
arc: DefaultArcAttribute,
|
|
@@ -7554,14 +7751,14 @@
|
|
|
7554
7751
|
var VirtualLayerHandlerContribution = Symbol["for"]("VirtualLayerHandlerContribution");
|
|
7555
7752
|
|
|
7556
7753
|
var _DefaultLayerService_,
|
|
7557
|
-
__decorate$
|
|
7754
|
+
__decorate$N = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
7558
7755
|
var d,
|
|
7559
7756
|
c = arguments.length,
|
|
7560
7757
|
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
7561
7758
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _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);
|
|
7562
7759
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7563
7760
|
},
|
|
7564
|
-
__metadata$
|
|
7761
|
+
__metadata$D = undefined && undefined.__metadata || function (k, v) {
|
|
7565
7762
|
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
7566
7763
|
};
|
|
7567
7764
|
var DefaultLayerService = _DefaultLayerService_ = /*#__PURE__*/function () {
|
|
@@ -7647,169 +7844,7 @@
|
|
|
7647
7844
|
}]);
|
|
7648
7845
|
return DefaultLayerService_1;
|
|
7649
7846
|
}();
|
|
7650
|
-
DefaultLayerService.idprefix = "visactor_layer", DefaultLayerService.prefix_count = 0, DefaultLayerService = _DefaultLayerService_ = __decorate$
|
|
7651
|
-
|
|
7652
|
-
var __decorate$N = undefined && undefined.__decorate || function (decorators, target, key, desc) {
|
|
7653
|
-
var d,
|
|
7654
|
-
c = arguments.length,
|
|
7655
|
-
r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
|
|
7656
|
-
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _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);
|
|
7657
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7658
|
-
},
|
|
7659
|
-
__metadata$D = undefined && undefined.__metadata || function (k, v) {
|
|
7660
|
-
if ("object" == (typeof Reflect === "undefined" ? "undefined" : _typeof(Reflect)) && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
7661
|
-
};
|
|
7662
|
-
var VWindow = Symbol["for"]("VWindow");
|
|
7663
|
-
var WindowHandlerContribution = Symbol["for"]("WindowHandlerContribution");
|
|
7664
|
-
var DefaultWindow = /*#__PURE__*/function () {
|
|
7665
|
-
function DefaultWindow() {
|
|
7666
|
-
_classCallCheck(this, DefaultWindow);
|
|
7667
|
-
this.hooks = {
|
|
7668
|
-
onChange: new SyncHook(["x", "y", "width", "height"])
|
|
7669
|
-
}, this._uid = Generator.GenAutoIncrementId(), this.global = application.global, this.postInit();
|
|
7670
|
-
}
|
|
7671
|
-
_createClass(DefaultWindow, [{
|
|
7672
|
-
key: "width",
|
|
7673
|
-
get: function get() {
|
|
7674
|
-
if (this._handler) {
|
|
7675
|
-
var wh = this._handler.getWH();
|
|
7676
|
-
return this._width = wh.width;
|
|
7677
|
-
}
|
|
7678
|
-
return this._width;
|
|
7679
|
-
}
|
|
7680
|
-
}, {
|
|
7681
|
-
key: "height",
|
|
7682
|
-
get: function get() {
|
|
7683
|
-
if (this._handler) {
|
|
7684
|
-
var wh = this._handler.getWH();
|
|
7685
|
-
return this._height = wh.height;
|
|
7686
|
-
}
|
|
7687
|
-
return this._height;
|
|
7688
|
-
}
|
|
7689
|
-
}, {
|
|
7690
|
-
key: "dpr",
|
|
7691
|
-
get: function get() {
|
|
7692
|
-
return this._handler.getDpr();
|
|
7693
|
-
}
|
|
7694
|
-
}, {
|
|
7695
|
-
key: "postInit",
|
|
7696
|
-
value: function postInit() {
|
|
7697
|
-
var _this = this;
|
|
7698
|
-
this.global.hooks.onSetEnv.tap("window", function () {
|
|
7699
|
-
_this.active();
|
|
7700
|
-
}), this.active();
|
|
7701
|
-
}
|
|
7702
|
-
}, {
|
|
7703
|
-
key: "active",
|
|
7704
|
-
value: function active() {
|
|
7705
|
-
var global = this.global;
|
|
7706
|
-
if (!global.env || this.actived) return;
|
|
7707
|
-
container.getNamed(WindowHandlerContribution, global.env).configure(this, global), this.actived = !0;
|
|
7708
|
-
}
|
|
7709
|
-
}, {
|
|
7710
|
-
key: "style",
|
|
7711
|
-
get: function get() {
|
|
7712
|
-
return this._handler.getStyle();
|
|
7713
|
-
},
|
|
7714
|
-
set: function set(style) {
|
|
7715
|
-
this._handler.setStyle(style);
|
|
7716
|
-
}
|
|
7717
|
-
}, {
|
|
7718
|
-
key: "create",
|
|
7719
|
-
value: function create(params) {
|
|
7720
|
-
this._handler.createWindow(params);
|
|
7721
|
-
var windowWH = this._handler.getWH();
|
|
7722
|
-
this._width = windowWH.width, this._height = windowWH.height, this.title = this._handler.getTitle(), this.resizable = !0;
|
|
7723
|
-
}
|
|
7724
|
-
}, {
|
|
7725
|
-
key: "setWindowHandler",
|
|
7726
|
-
value: function setWindowHandler(handler) {
|
|
7727
|
-
this._handler = handler;
|
|
7728
|
-
}
|
|
7729
|
-
}, {
|
|
7730
|
-
key: "setDpr",
|
|
7731
|
-
value: function setDpr(dpr) {
|
|
7732
|
-
return this._handler.setDpr(dpr);
|
|
7733
|
-
}
|
|
7734
|
-
}, {
|
|
7735
|
-
key: "resize",
|
|
7736
|
-
value: function resize(w, h) {
|
|
7737
|
-
return this._handler.resizeWindow(w, h);
|
|
7738
|
-
}
|
|
7739
|
-
}, {
|
|
7740
|
-
key: "configure",
|
|
7741
|
-
value: function configure() {
|
|
7742
|
-
throw new Error("暂不支持");
|
|
7743
|
-
}
|
|
7744
|
-
}, {
|
|
7745
|
-
key: "release",
|
|
7746
|
-
value: function release() {
|
|
7747
|
-
return this._handler.releaseWindow();
|
|
7748
|
-
}
|
|
7749
|
-
}, {
|
|
7750
|
-
key: "getContext",
|
|
7751
|
-
value: function getContext() {
|
|
7752
|
-
return this._handler.getContext();
|
|
7753
|
-
}
|
|
7754
|
-
}, {
|
|
7755
|
-
key: "getNativeHandler",
|
|
7756
|
-
value: function getNativeHandler() {
|
|
7757
|
-
return this._handler.getNativeHandler();
|
|
7758
|
-
}
|
|
7759
|
-
}, {
|
|
7760
|
-
key: "getImageBuffer",
|
|
7761
|
-
value: function getImageBuffer(type) {
|
|
7762
|
-
return this._handler.getImageBuffer ? this._handler.getImageBuffer(type) : null;
|
|
7763
|
-
}
|
|
7764
|
-
}, {
|
|
7765
|
-
key: "addEventListener",
|
|
7766
|
-
value: function addEventListener(type, listener, options) {
|
|
7767
|
-
return this._handler.addEventListener(type, listener, options);
|
|
7768
|
-
}
|
|
7769
|
-
}, {
|
|
7770
|
-
key: "removeEventListener",
|
|
7771
|
-
value: function removeEventListener(type, listener, options) {
|
|
7772
|
-
return this._handler.removeEventListener(type, listener, options);
|
|
7773
|
-
}
|
|
7774
|
-
}, {
|
|
7775
|
-
key: "dispatchEvent",
|
|
7776
|
-
value: function dispatchEvent(event) {
|
|
7777
|
-
return this._handler.dispatchEvent(event);
|
|
7778
|
-
}
|
|
7779
|
-
}, {
|
|
7780
|
-
key: "getBoundingClientRect",
|
|
7781
|
-
value: function getBoundingClientRect() {
|
|
7782
|
-
return this._handler.getBoundingClientRect();
|
|
7783
|
-
}
|
|
7784
|
-
}, {
|
|
7785
|
-
key: "getContainer",
|
|
7786
|
-
value: function getContainer() {
|
|
7787
|
-
return this._handler.container;
|
|
7788
|
-
}
|
|
7789
|
-
}, {
|
|
7790
|
-
key: "clearViewBox",
|
|
7791
|
-
value: function clearViewBox(viewBox, color) {
|
|
7792
|
-
this._handler.clearViewBox(viewBox, color);
|
|
7793
|
-
}
|
|
7794
|
-
}, {
|
|
7795
|
-
key: "isVisible",
|
|
7796
|
-
value: function isVisible(bbox) {
|
|
7797
|
-
return this._handler.isVisible(bbox);
|
|
7798
|
-
}
|
|
7799
|
-
}, {
|
|
7800
|
-
key: "onVisibleChange",
|
|
7801
|
-
value: function onVisibleChange(cb) {
|
|
7802
|
-
return this._handler.onVisibleChange(cb);
|
|
7803
|
-
}
|
|
7804
|
-
}, {
|
|
7805
|
-
key: "getTopLeft",
|
|
7806
|
-
value: function getTopLeft(baseWindow) {
|
|
7807
|
-
return this._handler.getTopLeft(baseWindow);
|
|
7808
|
-
}
|
|
7809
|
-
}]);
|
|
7810
|
-
return DefaultWindow;
|
|
7811
|
-
}();
|
|
7812
|
-
DefaultWindow = __decorate$N([injectable(), __metadata$D("design:paramtypes", [])], DefaultWindow);
|
|
7847
|
+
DefaultLayerService.idprefix = "visactor_layer", DefaultLayerService.prefix_count = 0, DefaultLayerService = _DefaultLayerService_ = __decorate$N([injectable(), __metadata$D("design:paramtypes", [])], DefaultLayerService);
|
|
7813
7848
|
|
|
7814
7849
|
var coreModule = new ContainerModule(function (bind) {
|
|
7815
7850
|
bind(VGlobal).to(DefaultGlobal).inSingletonScope(), bind(VWindow).to(DefaultWindow), bind(GraphicUtil).to(DefaultGraphicUtil).inSingletonScope(), bind(TransformUtil).to(DefaultTransformUtil).inSingletonScope(), bind(LayerService).to(DefaultLayerService).inSingletonScope();
|
|
@@ -8245,7 +8280,7 @@
|
|
|
8245
8280
|
var _a;
|
|
8246
8281
|
var attribute = this.attribute,
|
|
8247
8282
|
textTheme = getTheme(this).text;
|
|
8248
|
-
if (this.
|
|
8283
|
+
if (!this.isSimplify()) return;
|
|
8249
8284
|
var _attribute$maxLineWid = attribute.maxLineWidth,
|
|
8250
8285
|
maxLineWidth = _attribute$maxLineWid === void 0 ? textTheme.maxLineWidth : _attribute$maxLineWid;
|
|
8251
8286
|
return Number.isFinite(maxLineWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
|
|
@@ -8253,23 +8288,28 @@
|
|
|
8253
8288
|
}, {
|
|
8254
8289
|
key: "clipedWidth",
|
|
8255
8290
|
get: function get() {
|
|
8256
|
-
if (
|
|
8291
|
+
if (this.isSimplify()) return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
|
|
8257
8292
|
}
|
|
8258
8293
|
}, {
|
|
8259
8294
|
key: "cliped",
|
|
8260
8295
|
get: function get() {
|
|
8261
8296
|
var textTheme = getTheme(this).text,
|
|
8262
8297
|
attribute = this.attribute;
|
|
8263
|
-
if (this.
|
|
8298
|
+
if (!this.isSimplify()) return;
|
|
8264
8299
|
var _attribute$maxLineWid2 = attribute.maxLineWidth,
|
|
8265
8300
|
maxLineWidth = _attribute$maxLineWid2 === void 0 ? textTheme.maxLineWidth : _attribute$maxLineWid2;
|
|
8266
|
-
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), this.clipedText !== attribute.text.toString());
|
|
8301
|
+
return !!Number.isFinite(maxLineWidth) && (this.tryUpdateAABBBounds(), null != this.clipedText && this.clipedText !== attribute.text.toString());
|
|
8267
8302
|
}
|
|
8268
8303
|
}, {
|
|
8269
8304
|
key: "multilineLayout",
|
|
8270
8305
|
get: function get() {
|
|
8271
8306
|
if (this.isMultiLine) return this.tryUpdateAABBBounds(), this.cache.layoutData;
|
|
8272
8307
|
}
|
|
8308
|
+
}, {
|
|
8309
|
+
key: "isSimplify",
|
|
8310
|
+
value: function isSimplify() {
|
|
8311
|
+
return !this.isMultiLine && "vertical" !== this.attribute.direction;
|
|
8312
|
+
}
|
|
8273
8313
|
}, {
|
|
8274
8314
|
key: "isMultiLine",
|
|
8275
8315
|
get: function get() {
|
|
@@ -9983,7 +10023,14 @@
|
|
|
9983
10023
|
}, {
|
|
9984
10024
|
key: "toCustomPath",
|
|
9985
10025
|
value: function toCustomPath() {
|
|
9986
|
-
|
|
10026
|
+
var attribute = this.attribute;
|
|
10027
|
+
var width = vutils.isNil(attribute.width) ? attribute.x1 - attribute.x : attribute.width,
|
|
10028
|
+
height = vutils.isNil(attribute.height) ? attribute.y1 - attribute.y : attribute.height,
|
|
10029
|
+
x = 0,
|
|
10030
|
+
y = 0;
|
|
10031
|
+
width < 0 && (x = width, width = -width), height < 0 && (y = height, height = -height);
|
|
10032
|
+
var path = new CustomPath2D();
|
|
10033
|
+
return path.moveTo(x, y), path.rect(x, y, width, height), path;
|
|
9987
10034
|
}
|
|
9988
10035
|
}, {
|
|
9989
10036
|
key: "clone",
|
|
@@ -14009,7 +14056,7 @@
|
|
|
14009
14056
|
y: null !== (_d = endPoint.y1) && void 0 !== _d ? _d : endPoint.y
|
|
14010
14057
|
});
|
|
14011
14058
|
}
|
|
14012
|
-
lastBottomSeg = calcLineCache(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType), bottomCaches.unshift(lastBottomSeg);
|
|
14059
|
+
bottomPoints.length > 1 && (lastBottomSeg = calcLineCache(bottomPoints, "stepBefore" === curveType ? "stepAfter" : "stepAfter" === curveType ? "stepBefore" : curveType), bottomCaches.unshift(lastBottomSeg));
|
|
14013
14060
|
}
|
|
14014
14061
|
area.cacheArea = bottomCaches.map(function (item, index) {
|
|
14015
14062
|
return {
|
|
@@ -15053,8 +15100,8 @@
|
|
|
15053
15100
|
}();
|
|
15054
15101
|
Canvas3DPickItemInterceptor = __decorate$y([injectable()], Canvas3DPickItemInterceptor);
|
|
15055
15102
|
|
|
15056
|
-
var pickModule = new ContainerModule(function (bind) {
|
|
15057
|
-
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);
|
|
15103
|
+
var pickModule = new ContainerModule(function (bind, unbind, isBound) {
|
|
15104
|
+
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);
|
|
15058
15105
|
});
|
|
15059
15106
|
|
|
15060
15107
|
var graphicModule = new ContainerModule(function (bind) {
|
|
@@ -15866,12 +15913,12 @@
|
|
|
15866
15913
|
}
|
|
15867
15914
|
var d = context.dpr % 1;
|
|
15868
15915
|
(d || .5 !== d) && (dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr, dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr, dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr, dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr), this.backupDirtyBounds.copy(dirtyBounds), context.inuse = !0, context.clearMatrix(), context.setTransformForCurrent(!0);
|
|
15869
|
-
var drawInArea = dirtyBounds.width() * context.dpr
|
|
15916
|
+
var drawInArea = dirtyBounds.width() * context.dpr < context.canvas.width || dirtyBounds.height() * context.dpr < context.canvas.height;
|
|
15870
15917
|
context.save(), context.translate(x, y, !0), drawInArea && (context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()), context.clip()), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext), context.save(), renderService.renderTreeRoots.sort(function (a, b) {
|
|
15871
15918
|
var _a, _b;
|
|
15872
15919
|
return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : DefaultAttribute.zIndex);
|
|
15873
15920
|
}).forEach(function (group) {
|
|
15874
|
-
_this2.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0));
|
|
15921
|
+
group.isContainer ? _this2.renderGroup(group, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : _this2.renderItem(group, drawContext);
|
|
15875
15922
|
}), context.restore(), context.restore(), context.draw(), context.inuse = !1;
|
|
15876
15923
|
}
|
|
15877
15924
|
}, {
|
|
@@ -16652,7 +16699,11 @@
|
|
|
16652
16699
|
container.load(renderModule);
|
|
16653
16700
|
}
|
|
16654
16701
|
|
|
16655
|
-
|
|
16702
|
+
var loaded$d = !1;
|
|
16703
|
+
function preLoadAllModule() {
|
|
16704
|
+
loaded$d || (loaded$d = !0, container.load(coreModule), container.load(graphicModule), container.load(renderModule$1), container.load(pickModule), container.load(pluginModule), load$1(container), load(container));
|
|
16705
|
+
}
|
|
16706
|
+
preLoadAllModule();
|
|
16656
16707
|
var vglobal = container.get(VGlobal);
|
|
16657
16708
|
application.global = vglobal;
|
|
16658
16709
|
var graphicUtil = container.get(GraphicUtil);
|
|
@@ -16664,8 +16715,23 @@
|
|
|
16664
16715
|
var layerService = container.get(LayerService);
|
|
16665
16716
|
application.layerService = layerService;
|
|
16666
16717
|
|
|
16718
|
+
var _isBrowserEnv;
|
|
16719
|
+
function initIsBrowserEnv() {
|
|
16720
|
+
if (null == _isBrowserEnv) {
|
|
16721
|
+
try {
|
|
16722
|
+
_isBrowserEnv = !!window;
|
|
16723
|
+
} catch (err) {
|
|
16724
|
+
_isBrowserEnv = !1;
|
|
16725
|
+
}
|
|
16726
|
+
if (_isBrowserEnv) try {
|
|
16727
|
+
_isBrowserEnv = !tt;
|
|
16728
|
+
} catch (err) {
|
|
16729
|
+
_isBrowserEnv = !0;
|
|
16730
|
+
}
|
|
16731
|
+
}
|
|
16732
|
+
}
|
|
16667
16733
|
function isBrowserEnv() {
|
|
16668
|
-
return
|
|
16734
|
+
return initIsBrowserEnv(), _isBrowserEnv;
|
|
16669
16735
|
}
|
|
16670
16736
|
|
|
16671
16737
|
var loadArcModule = !1;
|
|
@@ -18280,7 +18346,6 @@
|
|
|
18280
18346
|
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : vutils.merge({}, ScrollBar.defaultAttributes, attributes));
|
|
18281
18347
|
this.name = 'scrollbar';
|
|
18282
18348
|
this._onRailPointerDown = (e) => {
|
|
18283
|
-
var _a, _b;
|
|
18284
18349
|
const { viewX, viewY } = e;
|
|
18285
18350
|
const { direction, width, height, range } = this.attribute;
|
|
18286
18351
|
const sliderSize = this._sliderSize;
|
|
@@ -18299,8 +18364,8 @@
|
|
|
18299
18364
|
this._slider.setAttribute('x', currentXPos, true);
|
|
18300
18365
|
}
|
|
18301
18366
|
this.setScrollRange([currentScrollValue - (range[1] - range[0]) / 2, currentScrollValue + (range[1] - range[0]) / 2], false);
|
|
18302
|
-
if (
|
|
18303
|
-
|
|
18367
|
+
if (this.stage && !this.stage.autoRender) {
|
|
18368
|
+
this.stage.renderNextFrame();
|
|
18304
18369
|
}
|
|
18305
18370
|
};
|
|
18306
18371
|
this._onSliderPointerDown = (e) => {
|
|
@@ -18352,6 +18417,12 @@
|
|
|
18352
18417
|
const preScrollRange = this.getScrollRange();
|
|
18353
18418
|
const [currentPos, currentScrollValue] = this._computeScrollValue(e);
|
|
18354
18419
|
const range = [preScrollRange[0] + currentScrollValue, preScrollRange[1] + currentScrollValue];
|
|
18420
|
+
if (!realTime) {
|
|
18421
|
+
this._dispatchEvent('scroll', {
|
|
18422
|
+
pre: preRange,
|
|
18423
|
+
value: vutils.clampRange(range, limitRange[0], limitRange[1])
|
|
18424
|
+
});
|
|
18425
|
+
}
|
|
18355
18426
|
this._dispatchEvent('scrollUp', {
|
|
18356
18427
|
pre: preRange,
|
|
18357
18428
|
value: vutils.clampRange(range, limitRange[0], limitRange[1])
|
|
@@ -18368,7 +18439,6 @@
|
|
|
18368
18439
|
};
|
|
18369
18440
|
}
|
|
18370
18441
|
setScrollRange(range, render = true) {
|
|
18371
|
-
var _a, _b;
|
|
18372
18442
|
const { direction = 'horizontal', limitRange = [0, 1], range: preRange, realTime = true } = this.attribute;
|
|
18373
18443
|
const currScrollRange = vutils.clampRange(range, limitRange[0], limitRange[1]);
|
|
18374
18444
|
if (render) {
|
|
@@ -18380,13 +18450,17 @@
|
|
|
18380
18450
|
else {
|
|
18381
18451
|
this._slider.setAttribute('y', sliderPos[0], true);
|
|
18382
18452
|
}
|
|
18383
|
-
if (
|
|
18384
|
-
|
|
18453
|
+
if (this.stage && !this.stage.autoRender) {
|
|
18454
|
+
this.stage.renderNextFrame();
|
|
18385
18455
|
}
|
|
18386
18456
|
}
|
|
18387
18457
|
}
|
|
18388
18458
|
this.attribute.range = currScrollRange;
|
|
18389
18459
|
if (realTime) {
|
|
18460
|
+
this._dispatchEvent('scroll', {
|
|
18461
|
+
pre: preRange,
|
|
18462
|
+
value: currScrollRange
|
|
18463
|
+
});
|
|
18390
18464
|
this._dispatchEvent('scrollDrag', {
|
|
18391
18465
|
pre: preRange,
|
|
18392
18466
|
value: currScrollRange
|
|
@@ -18816,7 +18890,7 @@
|
|
|
18816
18890
|
}
|
|
18817
18891
|
render() {
|
|
18818
18892
|
var _a, _b, _c;
|
|
18819
|
-
const { text = '', textStyle = {}, shape = {}, panel = {}, space = 4, minWidth, maxWidth, padding = 4, visible, state, type } = this.attribute;
|
|
18893
|
+
const { text = '', textStyle = {}, shape = {}, panel = {}, space = 4, minWidth, maxWidth, padding = 4, visible, state, type, textAlwaysCenter } = this.attribute;
|
|
18820
18894
|
const parsedPadding = vutils.normalizePadding(padding);
|
|
18821
18895
|
const group = this.createOrUpdateChild('tag-content', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
18822
18896
|
let symbol;
|
|
@@ -18876,7 +18950,7 @@
|
|
|
18876
18950
|
tagWidth += textWidth;
|
|
18877
18951
|
const size = (_c = shape.size) !== null && _c !== void 0 ? _c : 10;
|
|
18878
18952
|
const maxSize = vutils.isNumber(size) ? size : Math.max(size[0], size[1]);
|
|
18879
|
-
tagHeight += Math.max(textHeight,
|
|
18953
|
+
tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
|
|
18880
18954
|
const { textAlign, textBaseline } = textStyle;
|
|
18881
18955
|
if (vutils.isValid(minWidth) || vutils.isValid(maxWidth)) {
|
|
18882
18956
|
if (vutils.isValid(minWidth) && tagWidth < minWidth) {
|
|
@@ -18906,6 +18980,12 @@
|
|
|
18906
18980
|
else if (textAlign === 'left' || textAlign === 'start') {
|
|
18907
18981
|
group.setAttribute('x', parsedPadding[3]);
|
|
18908
18982
|
}
|
|
18983
|
+
if (textAlwaysCenter && (textAlign === 'left' || textAlign === 'start')) {
|
|
18984
|
+
textShape.setAttributes({
|
|
18985
|
+
x: textX + tagWidth / 2,
|
|
18986
|
+
textAlign: 'center'
|
|
18987
|
+
});
|
|
18988
|
+
}
|
|
18909
18989
|
if (textBaseline === 'middle') {
|
|
18910
18990
|
y -= tagHeight / 2;
|
|
18911
18991
|
if (symbol) {
|
|
@@ -20191,19 +20271,25 @@
|
|
|
20191
20271
|
}
|
|
20192
20272
|
let labels;
|
|
20193
20273
|
if (vutils.isFunction(customLayoutFunc)) {
|
|
20194
|
-
labels = customLayoutFunc(data, this.
|
|
20274
|
+
labels = customLayoutFunc(data, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null);
|
|
20195
20275
|
}
|
|
20196
20276
|
else {
|
|
20197
20277
|
labels = this._layout(data);
|
|
20198
20278
|
}
|
|
20199
20279
|
if (vutils.isFunction(customOverlapFunc)) {
|
|
20200
|
-
labels = customOverlapFunc(labels, this.
|
|
20280
|
+
labels = customOverlapFunc(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null);
|
|
20201
20281
|
}
|
|
20202
20282
|
else {
|
|
20203
20283
|
if (overlap !== false) {
|
|
20204
20284
|
labels = this._overlapping(labels);
|
|
20205
20285
|
}
|
|
20206
20286
|
}
|
|
20287
|
+
if (labels && labels.length) {
|
|
20288
|
+
labels.forEach(label => {
|
|
20289
|
+
this._bindEvent(label);
|
|
20290
|
+
this._setStatesOfText(label);
|
|
20291
|
+
});
|
|
20292
|
+
}
|
|
20207
20293
|
if (smartInvert !== false) {
|
|
20208
20294
|
this._smartInvert(labels);
|
|
20209
20295
|
}
|
|
@@ -20252,21 +20338,15 @@
|
|
|
20252
20338
|
attributes.width = (_a = attributes.width) !== null && _a !== void 0 ? _a : 0;
|
|
20253
20339
|
attributes.height = (_b = attributes.height) !== null && _b !== void 0 ? _b : 0;
|
|
20254
20340
|
const text = graphicCreator.richtext(attributes);
|
|
20255
|
-
this._bindEvent(text);
|
|
20256
|
-
this._setStatesOfText(text);
|
|
20257
20341
|
return text;
|
|
20258
20342
|
}
|
|
20259
20343
|
else if (attributes.textType === 'html') {
|
|
20260
20344
|
attributes.textConfig = [];
|
|
20261
20345
|
attributes.html = Object.assign(Object.assign({ dom: attributes.text }, DEFAULT_HTML_TEXT_SPEC), attributes);
|
|
20262
20346
|
const text = graphicCreator.richtext(attributes);
|
|
20263
|
-
this._bindEvent(text);
|
|
20264
|
-
this._setStatesOfText(text);
|
|
20265
20347
|
return text;
|
|
20266
20348
|
}
|
|
20267
20349
|
const text = graphicCreator.text(attributes);
|
|
20268
|
-
this._bindEvent(text);
|
|
20269
|
-
this._setStatesOfText(text);
|
|
20270
20350
|
return text;
|
|
20271
20351
|
}
|
|
20272
20352
|
_prepare() {
|
|
@@ -20343,7 +20423,7 @@
|
|
|
20343
20423
|
};
|
|
20344
20424
|
}
|
|
20345
20425
|
}
|
|
20346
|
-
|
|
20426
|
+
getRelatedGraphic(item) {
|
|
20347
20427
|
return this._idToGraphic.get(item.id);
|
|
20348
20428
|
}
|
|
20349
20429
|
_layout(data = []) {
|
|
@@ -20351,7 +20431,7 @@
|
|
|
20351
20431
|
const labels = [];
|
|
20352
20432
|
for (let i = 0; i < data.length; i++) {
|
|
20353
20433
|
const textData = data[i];
|
|
20354
|
-
const baseMark = this.
|
|
20434
|
+
const baseMark = this.getRelatedGraphic(textData);
|
|
20355
20435
|
const labelAttribute = Object.assign(Object.assign({ fill: this._isCollectionBase
|
|
20356
20436
|
? vutils.isArray(baseMark.attribute.stroke)
|
|
20357
20437
|
? baseMark.attribute.stroke.find(entry => !!entry && entry !== true)
|
|
@@ -20414,7 +20494,7 @@
|
|
|
20414
20494
|
continue;
|
|
20415
20495
|
}
|
|
20416
20496
|
const text = labels[i];
|
|
20417
|
-
const baseMark = this.
|
|
20497
|
+
const baseMark = this.getRelatedGraphic(text.attribute);
|
|
20418
20498
|
text.update();
|
|
20419
20499
|
if (!vutils.isRectIntersect(baseMark.AABBBounds, { x1: 0, x2: bmpTool.width, y1: 0, y2: bmpTool.height }, true)) {
|
|
20420
20500
|
continue;
|
|
@@ -20503,7 +20583,7 @@
|
|
|
20503
20583
|
labels.forEach((text, index) => {
|
|
20504
20584
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
20505
20585
|
const labelLine = this._labelLine(text);
|
|
20506
|
-
const relatedGraphic = this.
|
|
20586
|
+
const relatedGraphic = this.getRelatedGraphic(text.attribute);
|
|
20507
20587
|
const textId = text.attribute.id;
|
|
20508
20588
|
const textKey = this._isCollectionBase ? textId : relatedGraphic;
|
|
20509
20589
|
const state = (prevTextMap === null || prevTextMap === void 0 ? void 0 : prevTextMap.get(textKey)) ? 'update' : 'enter';
|
|
@@ -20560,7 +20640,7 @@
|
|
|
20560
20640
|
labels.forEach(text => {
|
|
20561
20641
|
var _a;
|
|
20562
20642
|
const labelLine = this._labelLine(text);
|
|
20563
|
-
const relatedGraphic = this.
|
|
20643
|
+
const relatedGraphic = this.getRelatedGraphic(text.attribute);
|
|
20564
20644
|
const state = (prevTextMap === null || prevTextMap === void 0 ? void 0 : prevTextMap.get(relatedGraphic)) ? 'update' : 'enter';
|
|
20565
20645
|
const textKey = this._isCollectionBase ? text.attribute.id : relatedGraphic;
|
|
20566
20646
|
if (state === 'enter') {
|
|
@@ -20675,7 +20755,7 @@
|
|
|
20675
20755
|
if (!label) {
|
|
20676
20756
|
continue;
|
|
20677
20757
|
}
|
|
20678
|
-
const baseMark = this.
|
|
20758
|
+
const baseMark = this.getRelatedGraphic(label.attribute);
|
|
20679
20759
|
const backgroundColor = baseMark.attribute.fill;
|
|
20680
20760
|
const foregroundColor = label.attribute.fill;
|
|
20681
20761
|
const baseColor = backgroundColor;
|
|
@@ -21466,7 +21546,8 @@
|
|
|
21466
21546
|
}
|
|
21467
21547
|
if (points[0].x < 0) {
|
|
21468
21548
|
if (vutils.isNumberClose(points[0].y, points[1].y)) {
|
|
21469
|
-
if (
|
|
21549
|
+
if ((vutils.isGreater(arc.middleAngle, -Math.PI) && vutils.isLess(arc.middleAngle, 0)) ||
|
|
21550
|
+
(vutils.isGreater(arc.middleAngle, Math.PI) && vutils.isLess(arc.middleAngle, Math.PI * 2))) {
|
|
21470
21551
|
min = 0;
|
|
21471
21552
|
max = points[1].y + height / 2;
|
|
21472
21553
|
}
|
|
@@ -21832,7 +21913,7 @@
|
|
|
21832
21913
|
}
|
|
21833
21914
|
const { autoRotate = true } = attribute;
|
|
21834
21915
|
let symbol;
|
|
21835
|
-
if (attribute
|
|
21916
|
+
if (attribute && attribute.visible) {
|
|
21836
21917
|
const startAngle = this._startAngle;
|
|
21837
21918
|
const endAngle = this._endAngle;
|
|
21838
21919
|
const { state } = this.attribute;
|
|
@@ -21888,18 +21969,18 @@
|
|
|
21888
21969
|
return points;
|
|
21889
21970
|
}
|
|
21890
21971
|
_clipPoints(points) {
|
|
21891
|
-
const { startSymbol, endSymbol } = this.attribute;
|
|
21972
|
+
const { startSymbol = {}, endSymbol = {} } = this.attribute;
|
|
21892
21973
|
let pointsAfterClip = points;
|
|
21893
|
-
if (startSymbol
|
|
21894
|
-
const startSize =
|
|
21974
|
+
if (startSymbol.visible) {
|
|
21975
|
+
const startSize = startSymbol.clip ? startSymbol.size || 10 : 0;
|
|
21895
21976
|
const pointsStart = {
|
|
21896
21977
|
x: points[0].x - (startSize / 2) * (Math.cos(this._startAngle) || 0),
|
|
21897
21978
|
y: points[0].y - (startSize / 2) * (Math.sin(this._startAngle) || 0)
|
|
21898
21979
|
};
|
|
21899
21980
|
pointsAfterClip = [pointsStart, ...pointsAfterClip.slice(1)];
|
|
21900
21981
|
}
|
|
21901
|
-
if (endSymbol
|
|
21902
|
-
const endSize =
|
|
21982
|
+
if (endSymbol.visible) {
|
|
21983
|
+
const endSize = endSymbol.clip ? endSymbol.size || 10 : 0;
|
|
21903
21984
|
const pointsEnd = {
|
|
21904
21985
|
x: points[points.length - 1].x - (endSize / 2) * (Math.cos(this._endAngle) || 0),
|
|
21905
21986
|
y: points[points.length - 1].y - (endSize / 2) * (Math.sin(this._endAngle) || 0)
|
|
@@ -22155,15 +22236,15 @@
|
|
|
22155
22236
|
axisContainer.setMode(this.mode);
|
|
22156
22237
|
this.axisContainer = axisContainer;
|
|
22157
22238
|
container.add(axisContainer);
|
|
22158
|
-
if (line
|
|
22239
|
+
if (line && line.visible) {
|
|
22159
22240
|
this.renderLine(axisContainer);
|
|
22160
22241
|
}
|
|
22161
22242
|
if (items && items.length) {
|
|
22162
22243
|
this.data = this._transformItems(items[0]);
|
|
22163
|
-
if (tick
|
|
22244
|
+
if (tick && tick.visible) {
|
|
22164
22245
|
this.renderTicks(axisContainer);
|
|
22165
22246
|
}
|
|
22166
|
-
if (label
|
|
22247
|
+
if (label && label.visible) {
|
|
22167
22248
|
const labelGroup = graphicCreator.group({ x: 0, y: 0, pickable: false });
|
|
22168
22249
|
labelGroup.name = exports.AXIS_ELEMENT_NAME.labelContainer;
|
|
22169
22250
|
labelGroup.id = this._getNodeId('label-container');
|
|
@@ -22178,7 +22259,7 @@
|
|
|
22178
22259
|
});
|
|
22179
22260
|
}
|
|
22180
22261
|
}
|
|
22181
|
-
if (title
|
|
22262
|
+
if (title && title.visible) {
|
|
22182
22263
|
this.renderTitle(axisContainer);
|
|
22183
22264
|
}
|
|
22184
22265
|
}
|
|
@@ -22210,7 +22291,7 @@
|
|
|
22210
22291
|
});
|
|
22211
22292
|
this.tickLineItems = tickLineItems;
|
|
22212
22293
|
const { subTick } = this.attribute;
|
|
22213
|
-
if (subTick
|
|
22294
|
+
if (subTick && subTick.visible) {
|
|
22214
22295
|
const subTickLineItems = this.getSubTickLineItems();
|
|
22215
22296
|
if (subTickLineItems.length) {
|
|
22216
22297
|
subTickLineItems.forEach((item, index) => {
|
|
@@ -22430,15 +22511,15 @@
|
|
|
22430
22511
|
beta }, style);
|
|
22431
22512
|
}
|
|
22432
22513
|
_getLabelAttribute(tickDatum, index, tickData, layer) {
|
|
22433
|
-
var _a, _b
|
|
22514
|
+
var _a, _b;
|
|
22434
22515
|
const { space = 4, inside = false, formatMethod, type = 'text', text } = this.attribute.label;
|
|
22435
22516
|
let offset = space;
|
|
22436
22517
|
let tickLength = 0;
|
|
22437
|
-
if (((_a = this.attribute.tick) === null || _a === void 0 ? void 0 : _a.visible) &&
|
|
22438
|
-
tickLength =
|
|
22518
|
+
if (((_a = this.attribute.tick) === null || _a === void 0 ? void 0 : _a.visible) && this.attribute.tick.inside === inside) {
|
|
22519
|
+
tickLength = this.attribute.tick.length || 4;
|
|
22439
22520
|
}
|
|
22440
|
-
if (((
|
|
22441
|
-
tickLength = Math.max(tickLength,
|
|
22521
|
+
if (((_b = this.attribute.subTick) === null || _b === void 0 ? void 0 : _b.visible) && this.attribute.subTick.inside === inside) {
|
|
22522
|
+
tickLength = Math.max(tickLength, this.attribute.subTick.length || 2);
|
|
22442
22523
|
}
|
|
22443
22524
|
offset += tickLength;
|
|
22444
22525
|
const axisVector = this.getRelativeVector(tickDatum.point);
|
|
@@ -22451,7 +22532,7 @@
|
|
|
22451
22532
|
}
|
|
22452
22533
|
}
|
|
22453
22534
|
const point = this.getVerticalCoord(tickDatum.point, offset, inside);
|
|
22454
|
-
const vector = this.getVerticalVector(offset, inside, point);
|
|
22535
|
+
const vector = this.getVerticalVector(offset || 1, inside, point);
|
|
22455
22536
|
const textContent = formatMethod
|
|
22456
22537
|
? formatMethod(`${tickDatum.label}`, tickDatum, index, tickData, layer)
|
|
22457
22538
|
: tickDatum.label;
|
|
@@ -22878,8 +22959,8 @@
|
|
|
22878
22959
|
container.add(axisLineGroup);
|
|
22879
22960
|
}
|
|
22880
22961
|
getTitleAttribute() {
|
|
22881
|
-
var _a, _b, _c
|
|
22882
|
-
const
|
|
22962
|
+
var _a, _b, _c;
|
|
22963
|
+
const _d = this.attribute.title, { position = 'middle', space = 4, textStyle = {}, autoRotate = true, shape, background, state = {} } = _d, restAttrs = __rest(_d, ["position", "space", "textStyle", "autoRotate", "shape", "background", "state"]);
|
|
22883
22964
|
let percent = 0.5;
|
|
22884
22965
|
if (position === 'start') {
|
|
22885
22966
|
percent = 0;
|
|
@@ -22892,7 +22973,7 @@
|
|
|
22892
22973
|
const point = this.getTickCoord(percent);
|
|
22893
22974
|
const axisVector = this.getRelativeVector();
|
|
22894
22975
|
let labelLength = 0;
|
|
22895
|
-
if (((_a = this.attribute.label) === null || _a === void 0 ? void 0 : _a.visible) &&
|
|
22976
|
+
if (((_a = this.attribute.label) === null || _a === void 0 ? void 0 : _a.visible) && this.attribute.label.inside === false) {
|
|
22896
22977
|
const space = +vutils.get(this.attribute, 'label.space', 4);
|
|
22897
22978
|
labelLength += space;
|
|
22898
22979
|
const layerCount = Object.keys(this.axisLabelLayerSize).length;
|
|
@@ -22953,11 +23034,11 @@
|
|
|
22953
23034
|
}
|
|
22954
23035
|
}
|
|
22955
23036
|
let tickLength = 0;
|
|
22956
|
-
if (((
|
|
22957
|
-
tickLength =
|
|
23037
|
+
if (((_b = this.attribute.tick) === null || _b === void 0 ? void 0 : _b.visible) && this.attribute.tick.inside === false) {
|
|
23038
|
+
tickLength = this.attribute.tick.length || 4;
|
|
22958
23039
|
}
|
|
22959
|
-
if (((
|
|
22960
|
-
tickLength = Math.max(tickLength,
|
|
23040
|
+
if (((_c = this.attribute.subTick) === null || _c === void 0 ? void 0 : _c.visible) && this.attribute.subTick.inside === false) {
|
|
23041
|
+
tickLength = Math.max(tickLength, this.attribute.subTick.length || 2);
|
|
22961
23042
|
}
|
|
22962
23043
|
const offset = tickLength + labelLength + space;
|
|
22963
23044
|
const titlePoint = this.getVerticalCoord(point, offset, false);
|
|
@@ -22993,9 +23074,9 @@
|
|
|
22993
23074
|
}
|
|
22994
23075
|
const attrs = Object.assign(Object.assign(Object.assign({}, titlePoint), restAttrs), { textStyle: Object.assign({ textAlign,
|
|
22995
23076
|
textBaseline }, textStyle), state: {
|
|
22996
|
-
text: vutils.merge({}, DEFAULT_STATES$1, state
|
|
22997
|
-
shape: vutils.merge({}, DEFAULT_STATES$1, state
|
|
22998
|
-
panel: vutils.merge({}, DEFAULT_STATES$1, state
|
|
23077
|
+
text: vutils.merge({}, DEFAULT_STATES$1, state.text),
|
|
23078
|
+
shape: vutils.merge({}, DEFAULT_STATES$1, state.shape),
|
|
23079
|
+
panel: vutils.merge({}, DEFAULT_STATES$1, state.background)
|
|
22999
23080
|
} });
|
|
23000
23081
|
attrs.angle = angle;
|
|
23001
23082
|
if (shape && shape.visible) {
|
|
@@ -23031,7 +23112,7 @@
|
|
|
23031
23112
|
}
|
|
23032
23113
|
getLabelAlign(vector, inside, angle) {
|
|
23033
23114
|
const orient = this.attribute.orient;
|
|
23034
|
-
if (vutils.isValidNumber(angle)) {
|
|
23115
|
+
if (vutils.isValidNumber(angle) || (vector[0] === 0 && vector[1] === 0)) {
|
|
23035
23116
|
if (orient === 'top' || orient === 'bottom') {
|
|
23036
23117
|
return getXAxisLabelAlign(orient, angle);
|
|
23037
23118
|
}
|
|
@@ -23226,9 +23307,9 @@
|
|
|
23226
23307
|
let limitLength = limitSize;
|
|
23227
23308
|
let titleHeight = 0;
|
|
23228
23309
|
let titleSpacing = 0;
|
|
23229
|
-
const axisLineWidth =
|
|
23230
|
-
const tickLength =
|
|
23231
|
-
if (
|
|
23310
|
+
const axisLineWidth = line && line.visible ? (_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1 : 0;
|
|
23311
|
+
const tickLength = tick && tick.visible ? (_c = tick.length) !== null && _c !== void 0 ? _c : 4 : 0;
|
|
23312
|
+
if (title && title.visible && typeof title.text === 'string') {
|
|
23232
23313
|
titleHeight = measureTextSize(title.text, title.textStyle).height;
|
|
23233
23314
|
const padding = vutils.normalizePadding(title.padding);
|
|
23234
23315
|
titleSpacing = title.space + padding[0] + padding[2];
|
|
@@ -23330,7 +23411,7 @@
|
|
|
23330
23411
|
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : vutils.merge({}, CircleAxis.defaultAttributes, attributes));
|
|
23331
23412
|
}
|
|
23332
23413
|
renderLine(container) {
|
|
23333
|
-
const { startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE, radius, center, innerRadius = 0, line, inside = false } = this.attribute;
|
|
23414
|
+
const { startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE, radius, center, innerRadius = 0, line = {}, inside = false } = this.attribute;
|
|
23334
23415
|
let arcRadius = radius;
|
|
23335
23416
|
let arcInnerRadius = innerRadius;
|
|
23336
23417
|
if (inside && innerRadius > 0) {
|
|
@@ -23338,30 +23419,30 @@
|
|
|
23338
23419
|
arcInnerRadius = 0;
|
|
23339
23420
|
}
|
|
23340
23421
|
const arcAttrs = Object.assign(Object.assign(Object.assign({}, center), { startAngle,
|
|
23341
|
-
endAngle, radius: arcRadius, innerRadius: arcInnerRadius }), line
|
|
23422
|
+
endAngle, radius: arcRadius, innerRadius: arcInnerRadius }), line.style);
|
|
23342
23423
|
const axisLine = graphicCreator.circle(arcAttrs);
|
|
23343
23424
|
axisLine.name = exports.AXIS_ELEMENT_NAME.line;
|
|
23344
23425
|
axisLine.id = this._getNodeId('line');
|
|
23345
|
-
if (!vutils.isEmpty(line
|
|
23426
|
+
if (!vutils.isEmpty(line.state)) {
|
|
23346
23427
|
axisLine.states = vutils.merge({}, DEFAULT_STATES$1, line.state);
|
|
23347
23428
|
}
|
|
23348
23429
|
container.add(axisLine);
|
|
23349
23430
|
}
|
|
23350
23431
|
getTitleAttribute() {
|
|
23351
|
-
var _a, _b, _c
|
|
23432
|
+
var _a, _b, _c;
|
|
23352
23433
|
const { center, radius, innerRadius = 0 } = this.attribute;
|
|
23353
|
-
const
|
|
23434
|
+
const _d = this.attribute.title, { space = 4, textStyle = {}, shape, background, state = {} } = _d, restAttrs = __rest(_d, ["space", "textStyle", "shape", "background", "state"]);
|
|
23354
23435
|
let titlePoint = center;
|
|
23355
23436
|
let labelHeight = 0;
|
|
23356
|
-
if (((_a = this.attribute.label) === null || _a === void 0 ? void 0 : _a.visible) &&
|
|
23437
|
+
if (((_a = this.attribute.label) === null || _a === void 0 ? void 0 : _a.visible) && this.attribute.label.inside === false) {
|
|
23357
23438
|
labelHeight = vutils.get(this.attribute.label, 'style.fontSize', 12) + vutils.get(this.attribute.label, 'space', 4);
|
|
23358
23439
|
}
|
|
23359
23440
|
let tickLength = 0;
|
|
23360
|
-
if (((
|
|
23361
|
-
tickLength =
|
|
23441
|
+
if (((_b = this.attribute.tick) === null || _b === void 0 ? void 0 : _b.visible) && this.attribute.tick.inside === false) {
|
|
23442
|
+
tickLength = this.attribute.tick.length || 4;
|
|
23362
23443
|
}
|
|
23363
|
-
if (((
|
|
23364
|
-
tickLength = Math.max(tickLength,
|
|
23444
|
+
if (((_c = this.attribute.subTick) === null || _c === void 0 ? void 0 : _c.visible) && this.attribute.subTick.inside === false) {
|
|
23445
|
+
tickLength = Math.max(tickLength, this.attribute.subTick.length || 2);
|
|
23365
23446
|
}
|
|
23366
23447
|
const offset = radius + tickLength + labelHeight + space;
|
|
23367
23448
|
let textBaseline = 'middle';
|
|
@@ -23384,9 +23465,9 @@
|
|
|
23384
23465
|
};
|
|
23385
23466
|
}
|
|
23386
23467
|
const attrs = Object.assign(Object.assign(Object.assign({}, titlePoint), restAttrs), { textStyle: Object.assign({ textBaseline, textAlign: 'center' }, textStyle), state: {
|
|
23387
|
-
text: vutils.merge({}, DEFAULT_STATES$1, state
|
|
23388
|
-
shape: vutils.merge({}, DEFAULT_STATES$1, state
|
|
23389
|
-
panel: vutils.merge({}, DEFAULT_STATES$1, state
|
|
23468
|
+
text: vutils.merge({}, DEFAULT_STATES$1, state.text),
|
|
23469
|
+
shape: vutils.merge({}, DEFAULT_STATES$1, state.shape),
|
|
23470
|
+
panel: vutils.merge({}, DEFAULT_STATES$1, state.background)
|
|
23390
23471
|
} });
|
|
23391
23472
|
const { angle } = restAttrs;
|
|
23392
23473
|
attrs.angle = angle;
|
|
@@ -23525,11 +23606,12 @@
|
|
|
23525
23606
|
let duration = this.duration;
|
|
23526
23607
|
let easing = this.easing;
|
|
23527
23608
|
Object.keys(this._newElementAttrMap).forEach(id => {
|
|
23528
|
-
var _a
|
|
23609
|
+
var _a;
|
|
23529
23610
|
const { node, attrs, state } = this._newElementAttrMap[id];
|
|
23530
23611
|
if (state === 'enter') {
|
|
23531
|
-
|
|
23532
|
-
|
|
23612
|
+
const { enter = {} } = (_a = this.params) !== null && _a !== void 0 ? _a : {};
|
|
23613
|
+
duration = vutils.isValidNumber(enter.duration) ? enter.duration : duration;
|
|
23614
|
+
easing = enter.easing ? enter.easing : easing;
|
|
23533
23615
|
}
|
|
23534
23616
|
if (node.type === 'path') {
|
|
23535
23617
|
node
|
|
@@ -24496,13 +24578,13 @@
|
|
|
24496
24578
|
if (this._layoutAttrFromConfig) {
|
|
24497
24579
|
return this._layoutAttrFromConfig;
|
|
24498
24580
|
}
|
|
24499
|
-
const { position: positionConfig, size, orient, middleHandlerStyle, startHandlerStyle, endHandlerStyle } = this.attribute;
|
|
24581
|
+
const { position: positionConfig, size, orient, middleHandlerStyle = {}, startHandlerStyle = {}, endHandlerStyle = {} } = this.attribute;
|
|
24500
24582
|
const { width: widthConfig, height: heightConfig } = size;
|
|
24501
|
-
const middleHandlerSize = (_b = (_a = middleHandlerStyle
|
|
24583
|
+
const middleHandlerSize = (_b = (_a = middleHandlerStyle.background) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 10;
|
|
24502
24584
|
let width;
|
|
24503
24585
|
let height;
|
|
24504
24586
|
let position;
|
|
24505
|
-
if (middleHandlerStyle
|
|
24587
|
+
if (middleHandlerStyle.visible) {
|
|
24506
24588
|
if (this._isHorizontal) {
|
|
24507
24589
|
width = widthConfig;
|
|
24508
24590
|
height = heightConfig - middleHandlerSize;
|
|
@@ -24525,9 +24607,9 @@
|
|
|
24525
24607
|
height = heightConfig;
|
|
24526
24608
|
position = positionConfig;
|
|
24527
24609
|
}
|
|
24528
|
-
const startHandlerSize = (_c = startHandlerStyle
|
|
24529
|
-
const endHandlerSize = (_d = endHandlerStyle
|
|
24530
|
-
if (startHandlerStyle
|
|
24610
|
+
const startHandlerSize = (_c = startHandlerStyle.size) !== null && _c !== void 0 ? _c : (this._isHorizontal ? height : width);
|
|
24611
|
+
const endHandlerSize = (_d = endHandlerStyle.size) !== null && _d !== void 0 ? _d : (this._isHorizontal ? height : width);
|
|
24612
|
+
if (startHandlerStyle.visible) {
|
|
24531
24613
|
if (this._isHorizontal) {
|
|
24532
24614
|
width -= (startHandlerSize + endHandlerSize) / 2;
|
|
24533
24615
|
position = {
|
|
@@ -24551,9 +24633,9 @@
|
|
|
24551
24633
|
return this._layoutAttrFromConfig;
|
|
24552
24634
|
}
|
|
24553
24635
|
render() {
|
|
24554
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t
|
|
24636
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
24555
24637
|
this._layoutAttrFromConfig = null;
|
|
24556
|
-
const { orient, backgroundStyle, backgroundChartStyle, selectedBackgroundStyle, selectedBackgroundChartStyle, middleHandlerStyle, startHandlerStyle, endHandlerStyle, brushSelect } = this.attribute;
|
|
24638
|
+
const { orient, backgroundStyle, backgroundChartStyle = {}, selectedBackgroundStyle = {}, selectedBackgroundChartStyle = {}, middleHandlerStyle = {}, startHandlerStyle = {}, endHandlerStyle = {}, brushSelect } = this.attribute;
|
|
24557
24639
|
const { start, end } = this.state;
|
|
24558
24640
|
const { position, width, height } = this.getLayoutAttrFromConfig();
|
|
24559
24641
|
const startHandlerMinSize = (_a = startHandlerStyle.triggerMinSize) !== null && _a !== void 0 ? _a : 40;
|
|
@@ -24562,8 +24644,8 @@
|
|
|
24562
24644
|
this._container = group;
|
|
24563
24645
|
this._background = group.createOrUpdateChild('background', Object.assign({ x: position.x, y: position.y, width,
|
|
24564
24646
|
height, cursor: brushSelect ? 'crosshair' : 'auto' }, backgroundStyle), 'rect');
|
|
24565
|
-
((_c = backgroundChartStyle
|
|
24566
|
-
((_d = backgroundChartStyle
|
|
24647
|
+
((_c = backgroundChartStyle.line) === null || _c === void 0 ? void 0 : _c.visible) && this.setPreviewAttributes('line', group);
|
|
24648
|
+
((_d = backgroundChartStyle.area) === null || _d === void 0 ? void 0 : _d.visible) && this.setPreviewAttributes('area', group);
|
|
24567
24649
|
brushSelect && this.renderDragMask();
|
|
24568
24650
|
if (this._isHorizontal) {
|
|
24569
24651
|
this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign({ x: position.x + start * width, y: position.y, width: (end - start) * width, height: height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), 'rect');
|
|
@@ -24571,18 +24653,19 @@
|
|
|
24571
24653
|
else {
|
|
24572
24654
|
this._selectedBackground = group.createOrUpdateChild('selectedBackground', Object.assign({ x: position.x, y: position.y + start * height, width, height: (end - start) * height, cursor: brushSelect ? 'crosshair' : 'move' }, selectedBackgroundStyle), 'rect');
|
|
24573
24655
|
}
|
|
24574
|
-
((_e = selectedBackgroundChartStyle
|
|
24575
|
-
((_f = selectedBackgroundChartStyle
|
|
24656
|
+
((_e = selectedBackgroundChartStyle.line) === null || _e === void 0 ? void 0 : _e.visible) && this.setSelectedPreviewAttributes('line', group);
|
|
24657
|
+
((_f = selectedBackgroundChartStyle.area) === null || _f === void 0 ? void 0 : _f.visible) && this.setSelectedPreviewAttributes('area', group);
|
|
24576
24658
|
if (this._showText) {
|
|
24577
24659
|
this.renderText();
|
|
24578
24660
|
}
|
|
24579
24661
|
if (this._isHorizontal) {
|
|
24580
|
-
if (middleHandlerStyle
|
|
24581
|
-
|
|
24582
|
-
this.
|
|
24662
|
+
if (middleHandlerStyle.visible) {
|
|
24663
|
+
const middleHandlerBackgroundSize = ((_g = middleHandlerStyle.background) === null || _g === void 0 ? void 0 : _g.size) || 10;
|
|
24664
|
+
this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign({ x: position.x + start * width, y: position.y - middleHandlerBackgroundSize, width: (end - start) * width, height: middleHandlerBackgroundSize }, (_h = middleHandlerStyle.background) === null || _h === void 0 ? void 0 : _h.style), 'rect');
|
|
24665
|
+
this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign({ x: position.x + ((start + end) / 2) * width, y: position.y - middleHandlerBackgroundSize / 2, strokeBoundsBuffer: 0, angle: 0, symbolType: (_k = (_j = middleHandlerStyle.icon) === null || _j === void 0 ? void 0 : _j.symbolType) !== null && _k !== void 0 ? _k : 'square' }, middleHandlerStyle.icon), 'symbol');
|
|
24583
24666
|
}
|
|
24584
|
-
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign({ x: position.x + start * width, y: position.y + height / 2, size: height, symbolType: (
|
|
24585
|
-
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign({ x: position.x + end * width, y: position.y + height / 2, size: height, symbolType: (
|
|
24667
|
+
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign({ x: position.x + start * width, y: position.y + height / 2, size: height, symbolType: (_l = startHandlerStyle.symbolType) !== null && _l !== void 0 ? _l : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), startHandlerStyle), 'symbol');
|
|
24668
|
+
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign({ x: position.x + end * width, y: position.y + height / 2, size: height, symbolType: (_m = endHandlerStyle.symbolType) !== null && _m !== void 0 ? _m : 'square' }, DEFAULT_HANDLER_ATTR_MAP.horizontal), endHandlerStyle), 'symbol');
|
|
24586
24669
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
|
|
24587
24670
|
const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
|
|
24588
24671
|
const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
|
|
@@ -24591,14 +24674,15 @@
|
|
|
24591
24674
|
this._endHandlerMask = group.createOrUpdateChild('endHandlerMask', Object.assign({ x: position.x + end * width - endHandlerWidth / 2, y: position.y + height / 2 - endHandlerHeight / 2, width: endHandlerWidth, height: endHandlerHeight, fill: 'white', fillOpacity: 0, zIndex: 999 }, DEFAULT_HANDLER_ATTR_MAP.horizontal), 'rect');
|
|
24592
24675
|
}
|
|
24593
24676
|
else {
|
|
24594
|
-
if (middleHandlerStyle
|
|
24595
|
-
|
|
24677
|
+
if (middleHandlerStyle.visible) {
|
|
24678
|
+
const middleHandlerBackgroundSize = ((_o = middleHandlerStyle.background) === null || _o === void 0 ? void 0 : _o.size) || 10;
|
|
24679
|
+
this._middleHandlerRect = group.createOrUpdateChild('middleHandlerRect', Object.assign({ x: orient === 'left' ? position.x - middleHandlerBackgroundSize : position.x + width, y: position.y + start * height, width: middleHandlerBackgroundSize, height: (end - start) * height }, (_p = middleHandlerStyle.background) === null || _p === void 0 ? void 0 : _p.style), 'rect');
|
|
24596
24680
|
this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign({ x: orient === 'left'
|
|
24597
|
-
? position.x -
|
|
24598
|
-
: position.x + width +
|
|
24681
|
+
? position.x - middleHandlerBackgroundSize / 2
|
|
24682
|
+
: position.x + width + middleHandlerBackgroundSize / 2, y: position.y + ((start + end) / 2) * height, angle: 90 * (Math.PI / 180), symbolType: (_r = (_q = middleHandlerStyle.icon) === null || _q === void 0 ? void 0 : _q.symbolType) !== null && _r !== void 0 ? _r : 'square', strokeBoundsBuffer: 0 }, middleHandlerStyle.icon), 'symbol');
|
|
24599
24683
|
}
|
|
24600
|
-
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + start * height, size: width, symbolType: (
|
|
24601
|
-
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + end * height, size: width, symbolType: (
|
|
24684
|
+
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + start * height, size: width, symbolType: (_s = startHandlerStyle.symbolType) !== null && _s !== void 0 ? _s : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), startHandlerStyle), 'symbol');
|
|
24685
|
+
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + end * height, size: width, symbolType: (_t = endHandlerStyle.symbolType) !== null && _t !== void 0 ? _t : 'square' }, DEFAULT_HANDLER_ATTR_MAP.vertical), endHandlerStyle), 'symbol');
|
|
24602
24686
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
|
|
24603
24687
|
const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
|
|
24604
24688
|
const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
|
|
@@ -24697,11 +24781,11 @@
|
|
|
24697
24781
|
else {
|
|
24698
24782
|
this._previewArea = this._previewGroup.createOrUpdateChild('previewArea', { curveType: 'basis' }, 'area');
|
|
24699
24783
|
}
|
|
24700
|
-
const { backgroundChartStyle } = this.attribute;
|
|
24784
|
+
const { backgroundChartStyle = {} } = this.attribute;
|
|
24701
24785
|
type === 'line' &&
|
|
24702
|
-
this._previewLine.setAttributes(Object.assign({ points: this.getPreviewLinePoints(), curveType: 'basis', pickable: false }, backgroundChartStyle
|
|
24786
|
+
this._previewLine.setAttributes(Object.assign({ points: this.getPreviewLinePoints(), curveType: 'basis', pickable: false }, backgroundChartStyle.line));
|
|
24703
24787
|
type === 'area' &&
|
|
24704
|
-
this._previewArea.setAttributes(Object.assign({ points: this.getPreviewAreaPoints(), curveType: 'basis', pickable: false }, backgroundChartStyle
|
|
24788
|
+
this._previewArea.setAttributes(Object.assign({ points: this.getPreviewAreaPoints(), curveType: 'basis', pickable: false }, backgroundChartStyle.area));
|
|
24705
24789
|
}
|
|
24706
24790
|
setSelectedPreviewAttributes(type, group) {
|
|
24707
24791
|
if (!this._selectedPreviewGroupClip) {
|
|
@@ -24714,7 +24798,7 @@
|
|
|
24714
24798
|
else {
|
|
24715
24799
|
this._selectedPreviewArea = this._selectedPreviewGroup.createOrUpdateChild('selectedPreviewArea', { curveType: 'basis' }, 'area');
|
|
24716
24800
|
}
|
|
24717
|
-
const { selectedBackgroundChartStyle } = this.attribute;
|
|
24801
|
+
const { selectedBackgroundChartStyle = {} } = this.attribute;
|
|
24718
24802
|
const { start, end } = this.state;
|
|
24719
24803
|
const { position, width, height } = this.getLayoutAttrFromConfig();
|
|
24720
24804
|
this._selectedPreviewGroupClip.setAttributes({
|
|
@@ -24733,9 +24817,9 @@
|
|
|
24733
24817
|
pickable: false
|
|
24734
24818
|
});
|
|
24735
24819
|
type === 'line' &&
|
|
24736
|
-
this._selectedPreviewLine.setAttributes(Object.assign({ points: this.getPreviewLinePoints(), curveType: 'basis', pickable: false }, selectedBackgroundChartStyle
|
|
24820
|
+
this._selectedPreviewLine.setAttributes(Object.assign({ points: this.getPreviewLinePoints(), curveType: 'basis', pickable: false }, selectedBackgroundChartStyle.line));
|
|
24737
24821
|
type === 'area' &&
|
|
24738
|
-
this._selectedPreviewArea.setAttributes(Object.assign({ points: this.getPreviewAreaPoints(), curveType: 'basis', pickable: false }, selectedBackgroundChartStyle
|
|
24822
|
+
this._selectedPreviewArea.setAttributes(Object.assign({ points: this.getPreviewAreaPoints(), curveType: 'basis', pickable: false }, selectedBackgroundChartStyle.area));
|
|
24739
24823
|
}
|
|
24740
24824
|
maybeAddLabel(container, attributes, name) {
|
|
24741
24825
|
let labelShape = this.find(node => node.name === name, true);
|
|
@@ -24783,9 +24867,9 @@
|
|
|
24783
24867
|
}
|
|
24784
24868
|
getMiddleHandlerSize() {
|
|
24785
24869
|
var _a, _b, _c, _d;
|
|
24786
|
-
const { middleHandlerStyle } = this.attribute;
|
|
24787
|
-
const middleHandlerRectSize = (_b = (_a = middleHandlerStyle
|
|
24788
|
-
const middleHandlerSymbolSize = (_d = (_c = middleHandlerStyle
|
|
24870
|
+
const { middleHandlerStyle = {} } = this.attribute;
|
|
24871
|
+
const middleHandlerRectSize = (_b = (_a = middleHandlerStyle.background) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 10;
|
|
24872
|
+
const middleHandlerSymbolSize = (_d = (_c = middleHandlerStyle.icon) === null || _c === void 0 ? void 0 : _c.size) !== null && _d !== void 0 ? _d : 10;
|
|
24789
24873
|
return Math.max(middleHandlerRectSize, ...vutils.array(middleHandlerSymbolSize));
|
|
24790
24874
|
}
|
|
24791
24875
|
setPreviewPointsX(callback) {
|
|
@@ -24847,13 +24931,13 @@
|
|
|
24847
24931
|
}
|
|
24848
24932
|
_initContainer() {
|
|
24849
24933
|
var _a, _b;
|
|
24850
|
-
const { limitRect, clipInRange } = this.attribute;
|
|
24934
|
+
const { limitRect = {}, clipInRange } = this.attribute;
|
|
24851
24935
|
let group;
|
|
24852
24936
|
if (clipInRange) {
|
|
24853
24937
|
const groupClip = graphicCreator.group(Object.assign(Object.assign({}, limitRect), { clip: true, pickable: false }));
|
|
24854
24938
|
group = graphicCreator.group({
|
|
24855
|
-
x: -((_a = limitRect
|
|
24856
|
-
y: -((_b = limitRect
|
|
24939
|
+
x: -((_a = limitRect.x) !== null && _a !== void 0 ? _a : 0),
|
|
24940
|
+
y: -((_b = limitRect.y) !== null && _b !== void 0 ? _b : 0),
|
|
24857
24941
|
pickable: false
|
|
24858
24942
|
});
|
|
24859
24943
|
groupClip.add(group);
|
|
@@ -24872,12 +24956,14 @@
|
|
|
24872
24956
|
this._container = group;
|
|
24873
24957
|
}
|
|
24874
24958
|
_updateContainer() {
|
|
24875
|
-
var _a, _b
|
|
24876
|
-
const { limitRect, clipInRange } = this.attribute;
|
|
24877
|
-
(
|
|
24959
|
+
var _a, _b;
|
|
24960
|
+
const { limitRect = {}, clipInRange } = this.attribute;
|
|
24961
|
+
if (this._containerClip) {
|
|
24962
|
+
this._containerClip.setAttributes(Object.assign({}, limitRect));
|
|
24963
|
+
}
|
|
24878
24964
|
this._container.setAttributes({
|
|
24879
|
-
x: clipInRange ? -((
|
|
24880
|
-
y: clipInRange ? -((
|
|
24965
|
+
x: clipInRange ? -((_a = limitRect.x) !== null && _a !== void 0 ? _a : 0) : 0,
|
|
24966
|
+
y: clipInRange ? -((_b = limitRect.y) !== null && _b !== void 0 ? _b : 0) : 0
|
|
24881
24967
|
});
|
|
24882
24968
|
}
|
|
24883
24969
|
render() {
|
|
@@ -25216,7 +25302,7 @@
|
|
|
25216
25302
|
y: points[points.length - 1].y + labelOffsetY
|
|
25217
25303
|
};
|
|
25218
25304
|
}
|
|
25219
|
-
this._label.setAttributes(Object.assign(Object.assign({}, labelPoint), { angle: label.autoRotate ? labelAngle + ((_b = label
|
|
25305
|
+
this._label.setAttributes(Object.assign(Object.assign({}, labelPoint), { angle: label.autoRotate ? labelAngle + ((_b = label.refAngle) !== null && _b !== void 0 ? _b : 0) : 0, textStyle: Object.assign(Object.assign({}, DEFAULT_MARK_LINE_TEXT_STYLE_MAP[position]), label.textStyle) }));
|
|
25220
25306
|
if (limitRect && confine) {
|
|
25221
25307
|
const { x, y, width, height } = limitRect;
|
|
25222
25308
|
limitShapeInBounds(this._label, {
|
|
@@ -25249,18 +25335,21 @@
|
|
|
25249
25335
|
this.setLabelPos();
|
|
25250
25336
|
}
|
|
25251
25337
|
updateMarker() {
|
|
25252
|
-
var _a, _b;
|
|
25253
25338
|
const { points, startSymbol, endSymbol, label, lineStyle, mainSegmentIndex, multiSegment } = this
|
|
25254
25339
|
.attribute;
|
|
25255
|
-
(
|
|
25256
|
-
|
|
25257
|
-
|
|
25258
|
-
|
|
25259
|
-
|
|
25260
|
-
|
|
25261
|
-
|
|
25262
|
-
|
|
25263
|
-
|
|
25340
|
+
if (this._line) {
|
|
25341
|
+
this._line.setAttributes({
|
|
25342
|
+
points,
|
|
25343
|
+
startSymbol,
|
|
25344
|
+
endSymbol,
|
|
25345
|
+
lineStyle,
|
|
25346
|
+
mainSegmentIndex,
|
|
25347
|
+
multiSegment
|
|
25348
|
+
});
|
|
25349
|
+
}
|
|
25350
|
+
if (this._label) {
|
|
25351
|
+
this._label.setAttributes(Object.assign({ dx: 0, dy: 0 }, label));
|
|
25352
|
+
}
|
|
25264
25353
|
this.setLabelPos();
|
|
25265
25354
|
}
|
|
25266
25355
|
isValidPoints() {
|
|
@@ -25319,11 +25408,11 @@
|
|
|
25319
25408
|
setLabelPos() {
|
|
25320
25409
|
var _a;
|
|
25321
25410
|
if (this._label && this._area) {
|
|
25322
|
-
const { label } = this.attribute;
|
|
25323
|
-
const labelPosition = (_a = label
|
|
25411
|
+
const { label = {} } = this.attribute;
|
|
25412
|
+
const labelPosition = (_a = label.position) !== null && _a !== void 0 ? _a : 'middle';
|
|
25324
25413
|
const labelPoint = this._getPositionByDirection(this._area, labelPosition);
|
|
25325
25414
|
this._label.setAttributes(Object.assign(Object.assign({}, labelPoint), { textStyle: Object.assign(Object.assign({}, DEFAULT_MARK_AREA_TEXT_STYLE_MAP[labelPosition]), label.textStyle) }));
|
|
25326
|
-
if (this.attribute.limitRect &&
|
|
25415
|
+
if (this.attribute.limitRect && label.confine) {
|
|
25327
25416
|
const { x, y, width, height } = this.attribute.limitRect;
|
|
25328
25417
|
limitShapeInBounds(this._label, {
|
|
25329
25418
|
x1: x,
|
|
@@ -25347,10 +25436,13 @@
|
|
|
25347
25436
|
this.setLabelPos();
|
|
25348
25437
|
}
|
|
25349
25438
|
updateMarker() {
|
|
25350
|
-
var _a, _b;
|
|
25351
25439
|
const { points, label, areaStyle } = this.attribute;
|
|
25352
|
-
(
|
|
25353
|
-
|
|
25440
|
+
if (this._area) {
|
|
25441
|
+
this._area.setAttributes(Object.assign({ points: points }, areaStyle));
|
|
25442
|
+
}
|
|
25443
|
+
if (this._area) {
|
|
25444
|
+
this._label.setAttributes(Object.assign({ dx: 0, dy: 0 }, label));
|
|
25445
|
+
}
|
|
25354
25446
|
this.setLabelPos();
|
|
25355
25447
|
}
|
|
25356
25448
|
isValidPoints() {
|
|
@@ -25376,23 +25468,23 @@
|
|
|
25376
25468
|
if (!item) {
|
|
25377
25469
|
return;
|
|
25378
25470
|
}
|
|
25379
|
-
const { autoRotate = true, refX = 0, refY = 0, refAngle = 0, textStyle, richTextStyle, imageStyle, position = exports.IMarkPointItemPosition.middle } = itemContent;
|
|
25471
|
+
const { autoRotate = true, refX = 0, refY = 0, refAngle = 0, textStyle = {}, richTextStyle = {}, imageStyle = {}, position = exports.IMarkPointItemPosition.middle } = itemContent;
|
|
25380
25472
|
const itemAngle = ((_a = this._line) === null || _a === void 0 ? void 0 : _a.getEndAngle()) || 0;
|
|
25381
25473
|
const itemOffsetX = refX * Math.cos(itemAngle) + refY * Math.cos(itemAngle - Math.PI / 2);
|
|
25382
25474
|
const itemOffsetY = refX * Math.sin(itemAngle) + refY * Math.sin(itemAngle - Math.PI / 2);
|
|
25383
25475
|
if (itemType === 'text') {
|
|
25384
|
-
item.setAttributes(Object.assign(Object.assign({}, textStyle), { textStyle: Object.assign(Object.assign({}, DEFAULT_MARK_POINT_TEXT_STYLE_MAP[(itemContent === null || itemContent === void 0 ? void 0 : itemContent.position) || 'end']), textStyle
|
|
25476
|
+
item.setAttributes(Object.assign(Object.assign({}, textStyle), { textStyle: Object.assign(Object.assign({}, DEFAULT_MARK_POINT_TEXT_STYLE_MAP[(itemContent === null || itemContent === void 0 ? void 0 : itemContent.position) || 'end']), textStyle.textStyle) }));
|
|
25385
25477
|
}
|
|
25386
25478
|
else if (itemType === 'richText') {
|
|
25387
25479
|
item.setAttributes({
|
|
25388
|
-
dx: this.getItemDx(item, position, richTextStyle) + (
|
|
25389
|
-
dy: this.getItemDy(item, position, richTextStyle) + (
|
|
25480
|
+
dx: this.getItemDx(item, position, richTextStyle) + (richTextStyle.dx || 0),
|
|
25481
|
+
dy: this.getItemDy(item, position, richTextStyle) + (richTextStyle.dy || 0)
|
|
25390
25482
|
});
|
|
25391
25483
|
}
|
|
25392
25484
|
else if (itemType === 'image') {
|
|
25393
25485
|
item.setAttributes({
|
|
25394
|
-
dx: this.getItemDx(item, position, imageStyle) + (
|
|
25395
|
-
dy: this.getItemDy(item, position, imageStyle) + (
|
|
25486
|
+
dx: this.getItemDx(item, position, imageStyle) + (imageStyle.dx || 0),
|
|
25487
|
+
dy: this.getItemDy(item, position, imageStyle) + (imageStyle.dy || 0)
|
|
25396
25488
|
});
|
|
25397
25489
|
}
|
|
25398
25490
|
item.setAttributes({
|
|
@@ -25483,16 +25575,17 @@
|
|
|
25483
25575
|
return points;
|
|
25484
25576
|
}
|
|
25485
25577
|
setItemLineAttr(itemLine, position, itemPosition, visible) {
|
|
25486
|
-
|
|
25487
|
-
|
|
25488
|
-
|
|
25489
|
-
|
|
25490
|
-
|
|
25491
|
-
|
|
25492
|
-
|
|
25493
|
-
|
|
25494
|
-
|
|
25495
|
-
|
|
25578
|
+
if (this._line) {
|
|
25579
|
+
const { startSymbol, endSymbol, lineStyle } = itemLine;
|
|
25580
|
+
const points = this.getItemLineAttr(itemLine, position, itemPosition);
|
|
25581
|
+
this._line.setAttributes({
|
|
25582
|
+
points,
|
|
25583
|
+
startSymbol,
|
|
25584
|
+
endSymbol,
|
|
25585
|
+
lineStyle,
|
|
25586
|
+
visible
|
|
25587
|
+
});
|
|
25588
|
+
}
|
|
25496
25589
|
}
|
|
25497
25590
|
getDecorativeLineAttr(itemLine, itemPosition) {
|
|
25498
25591
|
var _a;
|
|
@@ -25510,26 +25603,27 @@
|
|
|
25510
25603
|
};
|
|
25511
25604
|
}
|
|
25512
25605
|
setDecorativeLineAttr(itemLine, itemPosition, visible) {
|
|
25513
|
-
|
|
25514
|
-
|
|
25515
|
-
|
|
25516
|
-
|
|
25517
|
-
|
|
25518
|
-
|
|
25519
|
-
|
|
25520
|
-
|
|
25521
|
-
|
|
25522
|
-
|
|
25523
|
-
|
|
25524
|
-
|
|
25525
|
-
|
|
25606
|
+
if (this._decorativeLine) {
|
|
25607
|
+
const { lineStyle } = itemLine;
|
|
25608
|
+
const { startPointOffsetX, startPointOffsetY, endPointOffsetX, endPointOffsetY } = this.getDecorativeLineAttr(itemLine, itemPosition);
|
|
25609
|
+
this._decorativeLine.setAttributes(Object.assign(Object.assign({ points: [
|
|
25610
|
+
{
|
|
25611
|
+
x: itemPosition.x + startPointOffsetX,
|
|
25612
|
+
y: itemPosition.y + startPointOffsetY
|
|
25613
|
+
},
|
|
25614
|
+
{
|
|
25615
|
+
x: itemPosition.x + endPointOffsetX,
|
|
25616
|
+
y: itemPosition.y + endPointOffsetY
|
|
25617
|
+
}
|
|
25618
|
+
] }, lineStyle), { visible }));
|
|
25619
|
+
}
|
|
25526
25620
|
}
|
|
25527
25621
|
initMarker(container) {
|
|
25528
25622
|
var _a;
|
|
25529
|
-
const { position, itemLine, itemContent } = this.attribute;
|
|
25623
|
+
const { position, itemLine = {}, itemContent = {} } = this.attribute;
|
|
25530
25624
|
const itemPosition = {
|
|
25531
|
-
x: position.x + (
|
|
25532
|
-
y: position.y + (
|
|
25625
|
+
x: position.x + (itemContent.offsetX || 0),
|
|
25626
|
+
y: position.y + (itemContent.offsetY || 0)
|
|
25533
25627
|
};
|
|
25534
25628
|
const line = new Segment({
|
|
25535
25629
|
points: [],
|
|
@@ -25544,22 +25638,22 @@
|
|
|
25544
25638
|
decorativeLine.name = 'mark-point-decorativeLine';
|
|
25545
25639
|
this._decorativeLine = decorativeLine;
|
|
25546
25640
|
container.add(decorativeLine);
|
|
25547
|
-
this.setItemLineAttr(itemLine, position, itemPosition, itemLine
|
|
25548
|
-
this.setDecorativeLineAttr(itemLine, itemPosition, (_a = itemLine
|
|
25641
|
+
this.setItemLineAttr(itemLine, position, itemPosition, itemLine.visible);
|
|
25642
|
+
this.setDecorativeLineAttr(itemLine, itemPosition, (_a = itemLine.decorativeLine) === null || _a === void 0 ? void 0 : _a.visible);
|
|
25549
25643
|
const item = this.initItem(itemContent, itemPosition);
|
|
25550
25644
|
this._item = item;
|
|
25551
25645
|
container.add(item);
|
|
25552
25646
|
}
|
|
25553
25647
|
updateMarker() {
|
|
25554
25648
|
var _a;
|
|
25555
|
-
const { position, itemLine, itemContent } = this.attribute;
|
|
25649
|
+
const { position, itemLine = {}, itemContent = {} } = this.attribute;
|
|
25556
25650
|
const { type = 'text' } = itemContent;
|
|
25557
25651
|
const itemPosition = {
|
|
25558
|
-
x: position.x + (
|
|
25559
|
-
y: position.y + (
|
|
25652
|
+
x: position.x + (itemContent.offsetX || 0),
|
|
25653
|
+
y: position.y + (itemContent.offsetY || 0)
|
|
25560
25654
|
};
|
|
25561
|
-
this.setItemLineAttr(itemLine, position, itemPosition, itemLine
|
|
25562
|
-
this.setDecorativeLineAttr(itemLine, itemPosition, (_a = itemLine
|
|
25655
|
+
this.setItemLineAttr(itemLine, position, itemPosition, itemLine.visible);
|
|
25656
|
+
this.setDecorativeLineAttr(itemLine, itemPosition, (_a = itemLine.decorativeLine) === null || _a === void 0 ? void 0 : _a.visible);
|
|
25563
25657
|
this.setItemAttributes(this._item, itemContent, itemPosition, type);
|
|
25564
25658
|
}
|
|
25565
25659
|
isValidPoints() {
|
|
@@ -25890,9 +25984,8 @@
|
|
|
25890
25984
|
this._itemHeight = 0;
|
|
25891
25985
|
this._itemMaxWidth = 0;
|
|
25892
25986
|
this._onHover = (e) => {
|
|
25893
|
-
var _a;
|
|
25894
25987
|
const target = e.target;
|
|
25895
|
-
if (
|
|
25988
|
+
if (target && target.name && target.name.startsWith(exports.LEGEND_ELEMENT_NAME.item)) {
|
|
25896
25989
|
const legendItem = target.delegate;
|
|
25897
25990
|
if (this._lastActiveItem) {
|
|
25898
25991
|
if (this._lastActiveItem.id === legendItem.id) {
|
|
@@ -25914,15 +26007,15 @@
|
|
|
25914
26007
|
}
|
|
25915
26008
|
};
|
|
25916
26009
|
this._onClick = (e) => {
|
|
25917
|
-
var _a, _b, _c, _d
|
|
26010
|
+
var _a, _b, _c, _d;
|
|
25918
26011
|
const target = e.target;
|
|
25919
|
-
if (
|
|
26012
|
+
if (target && target.name && target.name.startsWith(exports.LEGEND_ELEMENT_NAME.item)) {
|
|
25920
26013
|
const legendItem = target.delegate;
|
|
25921
26014
|
if (target.name === exports.LEGEND_ELEMENT_NAME.focus) {
|
|
25922
26015
|
const isFocusSelected = legendItem.hasState(exports.LegendStateValue.focus);
|
|
25923
26016
|
legendItem.toggleState(exports.LegendStateValue.focus);
|
|
25924
26017
|
if (isFocusSelected) {
|
|
25925
|
-
(
|
|
26018
|
+
(_a = this._itemsContainer) === null || _a === void 0 ? void 0 : _a.getChildren().forEach(item => {
|
|
25926
26019
|
this._removeLegendItemState(item, [exports.LegendStateValue.unSelected, exports.LegendStateValue.unSelectedHover, exports.LegendStateValue.focus], e);
|
|
25927
26020
|
this._setLegendItemState(item, exports.LegendStateValue.selected, e);
|
|
25928
26021
|
});
|
|
@@ -25930,7 +26023,7 @@
|
|
|
25930
26023
|
else {
|
|
25931
26024
|
this._setLegendItemState(legendItem, exports.LegendStateValue.selected, e);
|
|
25932
26025
|
this._removeLegendItemState(legendItem, [exports.LegendStateValue.unSelected, exports.LegendStateValue.unSelectedHover], e);
|
|
25933
|
-
(
|
|
26026
|
+
(_b = this._itemsContainer) === null || _b === void 0 ? void 0 : _b.getChildren().forEach(item => {
|
|
25934
26027
|
if (legendItem !== item) {
|
|
25935
26028
|
this._removeLegendItemState(item, [exports.LegendStateValue.selected, exports.LegendStateValue.selectedHover, exports.LegendStateValue.focus], e);
|
|
25936
26029
|
this._setLegendItemState(item, exports.LegendStateValue.unSelected, e);
|
|
@@ -25939,7 +26032,7 @@
|
|
|
25939
26032
|
}
|
|
25940
26033
|
}
|
|
25941
26034
|
else {
|
|
25942
|
-
(
|
|
26035
|
+
(_c = this._itemsContainer) === null || _c === void 0 ? void 0 : _c.getChildren().forEach(item => {
|
|
25943
26036
|
item.removeState(exports.LegendStateValue.focus);
|
|
25944
26037
|
});
|
|
25945
26038
|
const { selectMode = 'multiple', allowAllCanceled = true } = this.attribute;
|
|
@@ -25962,7 +26055,7 @@
|
|
|
25962
26055
|
else {
|
|
25963
26056
|
this._setLegendItemState(legendItem, exports.LegendStateValue.selected, e);
|
|
25964
26057
|
this._removeLegendItemState(legendItem, [exports.LegendStateValue.unSelected, exports.LegendStateValue.unSelectedHover], e);
|
|
25965
|
-
(
|
|
26058
|
+
(_d = this._itemsContainer) === null || _d === void 0 ? void 0 : _d.getChildren().forEach(item => {
|
|
25966
26059
|
if (legendItem !== item) {
|
|
25967
26060
|
this._removeLegendItemState(item, [exports.LegendStateValue.selected, exports.LegendStateValue.selectedHover], e);
|
|
25968
26061
|
this._setLegendItemState(item, exports.LegendStateValue.unSelected, e);
|
|
@@ -26140,7 +26233,7 @@
|
|
|
26140
26233
|
let focusStartX = 0;
|
|
26141
26234
|
let shapeSize = 0;
|
|
26142
26235
|
let shapeSpace = 0;
|
|
26143
|
-
if (
|
|
26236
|
+
if (shapeAttr && shapeAttr.visible !== false) {
|
|
26144
26237
|
shapeSize = vutils.get(shapeStyle, 'style.size', DEFAULT_SHAPE_SIZE);
|
|
26145
26238
|
shapeSpace = vutils.get(shapeAttr, 'space', DEFAULT_SHAPE_SPACE);
|
|
26146
26239
|
const itemShape = graphicCreator.symbol(Object.assign(Object.assign({ x: 0, y: 0, symbolType: 'circle', strokeBoundsBuffer: 0 }, shape), shapeStyle.style));
|
|
@@ -26778,15 +26871,16 @@
|
|
|
26778
26871
|
const originPos = (this._isHorizontal ? endHandler.attribute.x : endHandler.attribute.y);
|
|
26779
26872
|
const newPos = vutils.clamp(originPos + delta, trackLen, railLen);
|
|
26780
26873
|
const currentValue = (newPos / railLen) * (max - min) + min;
|
|
26874
|
+
const startHandlerAttribute = startHandler === null || startHandler === void 0 ? void 0 : startHandler.attribute;
|
|
26781
26875
|
this._updateHandler(endHandler, newPos, currentValue);
|
|
26782
26876
|
this._track.setAttributes(this._isHorizontal
|
|
26783
26877
|
? {
|
|
26784
|
-
x: Math.min(
|
|
26785
|
-
width: Math.abs(
|
|
26878
|
+
x: Math.min(startHandlerAttribute.x, endHandler.attribute.x),
|
|
26879
|
+
width: Math.abs(startHandlerAttribute.x - endHandler.attribute.x)
|
|
26786
26880
|
}
|
|
26787
26881
|
: {
|
|
26788
|
-
y: Math.min(
|
|
26789
|
-
height: Math.abs(
|
|
26882
|
+
y: Math.min(startHandlerAttribute.y, endHandler.attribute.y),
|
|
26883
|
+
height: Math.abs(startHandlerAttribute.y - endHandler.attribute.y)
|
|
26790
26884
|
});
|
|
26791
26885
|
}
|
|
26792
26886
|
this._prePos = currentPos;
|
|
@@ -27042,7 +27136,7 @@
|
|
|
27042
27136
|
const handlerStart = max === min ? (position === 'start' ? 0 : railLen) : ((value - min) / (max - min)) * railLen;
|
|
27043
27137
|
const textSpace = (_a = handlerText.space) !== null && _a !== void 0 ? _a : 4;
|
|
27044
27138
|
const textStyle = {
|
|
27045
|
-
text:
|
|
27139
|
+
text: handlerText.formatter ? handlerText.formatter(value) : value.toFixed((_b = handlerText.precision) !== null && _b !== void 0 ? _b : 0),
|
|
27046
27140
|
lineHeight: (_c = handlerText.style) === null || _c === void 0 ? void 0 : _c.lineHeight,
|
|
27047
27141
|
cursor: slidable === false ? 'default' : getDefaultCursor(isHorizontal)
|
|
27048
27142
|
};
|
|
@@ -27141,9 +27235,9 @@
|
|
|
27141
27235
|
handler.setAttribute(isHorizontal ? 'x' : 'y', position);
|
|
27142
27236
|
const updateHandlerText = handler.name === exports.SLIDER_ELEMENT_NAME.startHandler ? this._startHandlerText : this._endHandlerText;
|
|
27143
27237
|
if (updateHandlerText) {
|
|
27144
|
-
const { handlerText } = this.attribute;
|
|
27145
|
-
updateHandlerText
|
|
27146
|
-
text:
|
|
27238
|
+
const { handlerText = {} } = this.attribute;
|
|
27239
|
+
updateHandlerText.setAttributes({
|
|
27240
|
+
text: handlerText.formatter ? handlerText.formatter(value) : value.toFixed((_a = handlerText.precision) !== null && _a !== void 0 ? _a : 0),
|
|
27147
27241
|
[isHorizontal ? 'x' : 'y']: position
|
|
27148
27242
|
});
|
|
27149
27243
|
}
|
|
@@ -27159,16 +27253,14 @@
|
|
|
27159
27253
|
_updateHandlerText(handlerText, position, value) {
|
|
27160
27254
|
var _a;
|
|
27161
27255
|
const isHorizontal = this._isHorizontal;
|
|
27162
|
-
const { handlerText: handlerTextAttr } = this.attribute;
|
|
27256
|
+
const { handlerText: handlerTextAttr = {} } = this.attribute;
|
|
27163
27257
|
handlerText.setAttributes({
|
|
27164
27258
|
[isHorizontal ? 'x' : 'y']: position,
|
|
27165
|
-
text: (handlerTextAttr
|
|
27166
|
-
? handlerTextAttr.formatter(value)
|
|
27167
|
-
: value.toFixed((_a = handlerTextAttr === null || handlerTextAttr === void 0 ? void 0 : handlerTextAttr.precision) !== null && _a !== void 0 ? _a : 0)
|
|
27259
|
+
text: handlerTextAttr.formatter ? handlerTextAttr.formatter(value) : value.toFixed((_a = handlerTextAttr.precision) !== null && _a !== void 0 ? _a : 0)
|
|
27168
27260
|
});
|
|
27169
27261
|
const updateHandler = handlerText.name === exports.SLIDER_ELEMENT_NAME.startHandlerText ? this._startHandler : this._endHandler;
|
|
27170
27262
|
if (updateHandler) {
|
|
27171
|
-
updateHandler
|
|
27263
|
+
updateHandler.setAttributes({
|
|
27172
27264
|
[isHorizontal ? 'x' : 'y']: position
|
|
27173
27265
|
});
|
|
27174
27266
|
}
|
|
@@ -27592,46 +27684,46 @@
|
|
|
27592
27684
|
this.name = 'title';
|
|
27593
27685
|
}
|
|
27594
27686
|
render() {
|
|
27595
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17
|
|
27596
|
-
const { textType, text, subtextType, textStyle, subtext, subtextStyle, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
27687
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17;
|
|
27688
|
+
const { textType, text, subtextType, textStyle = {}, subtext, subtextStyle = {}, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
27597
27689
|
const parsedPadding = vutils.normalizePadding(padding);
|
|
27598
27690
|
const group = this.createOrUpdateChild('title-container', { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 }, 'group');
|
|
27599
|
-
if (
|
|
27691
|
+
if (this.attribute.visible !== false && textStyle.visible !== false) {
|
|
27600
27692
|
if (textType === 'rich' || vutils.isValid(textStyle.character)) {
|
|
27601
|
-
const attr = Object.assign({ x: (
|
|
27693
|
+
const attr = Object.assign({ x: (_a = textStyle.x) !== null && _a !== void 0 ? _a : 0, y: (_b = textStyle.y) !== null && _b !== void 0 ? _b : 0, width: (_d = (_c = textStyle.width) !== null && _c !== void 0 ? _c : width) !== null && _d !== void 0 ? _d : 0, height: (_f = (_e = textStyle.height) !== null && _e !== void 0 ? _e : height) !== null && _f !== void 0 ? _f : 0, ellipsis: (_g = textStyle.ellipsis) !== null && _g !== void 0 ? _g : true, wordBreak: (_h = textStyle.wordBreak) !== null && _h !== void 0 ? _h : 'break-word', maxHeight: textStyle.maxHeight, maxWidth: textStyle.maxWidth, textConfig: (_j = textStyle.character) !== null && _j !== void 0 ? _j : text }, textStyle);
|
|
27602
27694
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
27603
27695
|
}
|
|
27604
27696
|
else if (textType === 'html') {
|
|
27605
|
-
const attr = Object.assign({ html: Object.assign(Object.assign({ dom: text }, DEFAULT_HTML_TEXT_SPEC), textStyle), x: (
|
|
27697
|
+
const attr = Object.assign({ html: Object.assign(Object.assign({ dom: text }, DEFAULT_HTML_TEXT_SPEC), textStyle), x: (_k = textStyle.x) !== null && _k !== void 0 ? _k : 0, y: (_l = textStyle.y) !== null && _l !== void 0 ? _l : 0, width: (_o = (_m = textStyle.width) !== null && _m !== void 0 ? _m : width) !== null && _o !== void 0 ? _o : 0, height: (_q = (_p = textStyle.height) !== null && _p !== void 0 ? _p : height) !== null && _q !== void 0 ? _q : 0, ellipsis: (_r = textStyle.ellipsis) !== null && _r !== void 0 ? _r : true, wordBreak: (_s = textStyle.wordBreak) !== null && _s !== void 0 ? _s : 'break-word', maxHeight: textStyle.maxHeight, maxWidth: textStyle.maxWidth, textConfig: [] }, textStyle);
|
|
27606
27698
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
27607
27699
|
}
|
|
27608
27700
|
else if (vutils.isValid(text)) {
|
|
27609
|
-
this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: [text] }, textStyle), { maxLineWidth: (
|
|
27701
|
+
this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: [text] }, textStyle), { maxLineWidth: (_t = textStyle.maxLineWidth) !== null && _t !== void 0 ? _t : width, heightLimit: textStyle.heightLimit, lineClamp: textStyle.lineClamp, ellipsis: (_u = textStyle.ellipsis) !== null && _u !== void 0 ? _u : true, x: 0, y: 0 }), 'wrapText');
|
|
27610
27702
|
}
|
|
27611
27703
|
}
|
|
27612
|
-
const maintextHeight = this._mainTitle ?
|
|
27613
|
-
const maintextWidth = this._mainTitle ?
|
|
27614
|
-
if (
|
|
27704
|
+
const maintextHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0;
|
|
27705
|
+
const maintextWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;
|
|
27706
|
+
if (this.attribute.visible !== false && subtextStyle.visible !== false) {
|
|
27615
27707
|
if (subtextType === 'rich' || vutils.isValid(subtextStyle.character)) {
|
|
27616
|
-
const attr = Object.assign({ x: (
|
|
27708
|
+
const attr = Object.assign({ x: (_v = subtextStyle.x) !== null && _v !== void 0 ? _v : 0, y: (_w = subtextStyle.y) !== null && _w !== void 0 ? _w : 0, width: (_y = (_x = subtextStyle.width) !== null && _x !== void 0 ? _x : width) !== null && _y !== void 0 ? _y : 0, height: (_0 = (_z = subtextStyle.height) !== null && _z !== void 0 ? _z : height) !== null && _0 !== void 0 ? _0 : 0, ellipsis: (_1 = subtextStyle.ellipsis) !== null && _1 !== void 0 ? _1 : true, wordBreak: (_2 = subtextStyle.wordBreak) !== null && _2 !== void 0 ? _2 : 'break-word', maxHeight: subtextStyle.maxHeight, maxWidth: subtextStyle.maxWidth, textConfig: (_3 = subtextStyle.character) !== null && _3 !== void 0 ? _3 : subtext }, subtextStyle);
|
|
27617
27709
|
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
27618
27710
|
}
|
|
27619
27711
|
else if (subtextType === 'html') {
|
|
27620
|
-
const attr = Object.assign({ html: Object.assign(Object.assign({ dom: subtext }, DEFAULT_HTML_TEXT_SPEC), subtextStyle), x: (
|
|
27712
|
+
const attr = Object.assign({ html: Object.assign(Object.assign({ dom: subtext }, DEFAULT_HTML_TEXT_SPEC), subtextStyle), x: (_4 = subtextStyle.x) !== null && _4 !== void 0 ? _4 : 0, y: (_5 = subtextStyle.y) !== null && _5 !== void 0 ? _5 : 0, width: (_7 = (_6 = subtextStyle.width) !== null && _6 !== void 0 ? _6 : width) !== null && _7 !== void 0 ? _7 : 0, height: (_9 = (_8 = subtextStyle.height) !== null && _8 !== void 0 ? _8 : height) !== null && _9 !== void 0 ? _9 : 0, ellipsis: (_10 = subtextStyle.ellipsis) !== null && _10 !== void 0 ? _10 : true, wordBreak: (_11 = subtextStyle.wordBreak) !== null && _11 !== void 0 ? _11 : 'break-word', maxHeight: subtextStyle.maxHeight, maxWidth: subtextStyle.maxWidth, textConfig: [] }, subtextStyle);
|
|
27621
27713
|
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
27622
27714
|
}
|
|
27623
27715
|
else if (vutils.isValid(subtext)) {
|
|
27624
|
-
this._subTitle = group.createOrUpdateChild('subTitle', Object.assign(Object.assign({ text: [subtext] }, subtextStyle), { maxLineWidth: (
|
|
27716
|
+
this._subTitle = group.createOrUpdateChild('subTitle', Object.assign(Object.assign({ text: [subtext] }, subtextStyle), { maxLineWidth: (_12 = subtextStyle.maxLineWidth) !== null && _12 !== void 0 ? _12 : width, heightLimit: subtextStyle.heightLimit, lineClamp: subtextStyle.lineClamp, ellipsis: (_13 = subtextStyle.ellipsis) !== null && _13 !== void 0 ? _13 : true, x: 0, y: maintextHeight }), 'wrapText');
|
|
27625
27717
|
}
|
|
27626
27718
|
}
|
|
27627
|
-
const subtextHeight = this._subTitle ?
|
|
27628
|
-
const subtextWidth = this._subTitle ?
|
|
27719
|
+
const subtextHeight = this._subTitle ? this._subTitle.AABBBounds.height() : 0;
|
|
27720
|
+
const subtextWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;
|
|
27629
27721
|
let titleWidth = Math.max(maintextWidth, subtextWidth);
|
|
27630
|
-
let titleHeight = maintextHeight + ((
|
|
27722
|
+
let titleHeight = maintextHeight + ((_14 = subtextStyle.height) !== null && _14 !== void 0 ? _14 : subtextHeight);
|
|
27631
27723
|
if (vutils.isValid(width)) {
|
|
27632
27724
|
titleWidth = width;
|
|
27633
|
-
|
|
27634
|
-
|
|
27725
|
+
this._mainTitle && this._mainTitle.setAttribute('maxLineWidth', width);
|
|
27726
|
+
this._subTitle && this._subTitle.setAttribute('maxLineWidth', width);
|
|
27635
27727
|
}
|
|
27636
27728
|
if (vutils.isValid(height)) {
|
|
27637
27729
|
titleHeight = height;
|
|
@@ -27640,10 +27732,10 @@
|
|
|
27640
27732
|
titleWidth = minWidth;
|
|
27641
27733
|
}
|
|
27642
27734
|
if (vutils.isValid(maxWidth)) {
|
|
27643
|
-
|
|
27644
|
-
|
|
27645
|
-
|
|
27646
|
-
|
|
27735
|
+
this._mainTitle && this._mainTitle.setAttribute('maxLineWidth', maxWidth);
|
|
27736
|
+
this._subTitle && this._subTitle.setAttribute('maxLineWidth', maxWidth);
|
|
27737
|
+
this._mainTitle && this._mainTitle.setAttribute('maxWidth', maxWidth);
|
|
27738
|
+
this._subTitle && this._subTitle.setAttribute('maxWidth', maxWidth);
|
|
27647
27739
|
if (titleWidth > maxWidth) {
|
|
27648
27740
|
titleWidth = maxWidth;
|
|
27649
27741
|
}
|
|
@@ -27652,8 +27744,8 @@
|
|
|
27652
27744
|
titleHeight = minHeight;
|
|
27653
27745
|
}
|
|
27654
27746
|
if (vutils.isValid(maxHeight)) {
|
|
27655
|
-
|
|
27656
|
-
|
|
27747
|
+
this._mainTitle && this._mainTitle.setAttribute('maxHeight', maxHeight);
|
|
27748
|
+
this._subTitle && this._subTitle.setAttribute('maxHeight', maxHeight - maintextHeight);
|
|
27657
27749
|
if (titleHeight > maxHeight) {
|
|
27658
27750
|
titleHeight = maxHeight;
|
|
27659
27751
|
}
|
|
@@ -27661,69 +27753,73 @@
|
|
|
27661
27753
|
group.attribute.width = titleWidth;
|
|
27662
27754
|
group.attribute.height = titleHeight;
|
|
27663
27755
|
group.attribute.boundsPadding = parsedPadding;
|
|
27664
|
-
if (
|
|
27665
|
-
|
|
27666
|
-
|
|
27667
|
-
|
|
27668
|
-
(
|
|
27669
|
-
|
|
27670
|
-
|
|
27671
|
-
|
|
27672
|
-
|
|
27673
|
-
|
|
27674
|
-
|
|
27675
|
-
|
|
27676
|
-
|
|
27677
|
-
|
|
27678
|
-
|
|
27679
|
-
|
|
27680
|
-
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign)) {
|
|
27681
|
-
const mainTitleVerticalAlign = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign : verticalAlign;
|
|
27682
|
-
const mainTitleHeight = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.height) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.height : titleHeight;
|
|
27683
|
-
if (mainTitleVerticalAlign === 'top') {
|
|
27684
|
-
(_36 = this._mainTitle) === null || _36 === void 0 ? void 0 : _36.setAttribute('y', 0);
|
|
27685
|
-
(_37 = this._mainTitle) === null || _37 === void 0 ? void 0 : _37.setAttribute('textBaseline', 'top');
|
|
27686
|
-
}
|
|
27687
|
-
else if (mainTitleVerticalAlign === 'middle') {
|
|
27688
|
-
(_38 = this._mainTitle) === null || _38 === void 0 ? void 0 : _38.setAttribute('y', mainTitleHeight / 2);
|
|
27689
|
-
(_39 = this._mainTitle) === null || _39 === void 0 ? void 0 : _39.setAttribute('textBaseline', 'middle');
|
|
27690
|
-
}
|
|
27691
|
-
else if (mainTitleVerticalAlign === 'bottom') {
|
|
27692
|
-
(_40 = this._mainTitle) === null || _40 === void 0 ? void 0 : _40.setAttribute('y', mainTitleHeight);
|
|
27693
|
-
(_41 = this._mainTitle) === null || _41 === void 0 ? void 0 : _41.setAttribute('textBaseline', 'bottom');
|
|
27694
|
-
}
|
|
27695
|
-
}
|
|
27696
|
-
if (vutils.isValid(align) || vutils.isValid(subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align)) {
|
|
27697
|
-
const subTitleAlign = (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align) ? subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align : align;
|
|
27698
|
-
const subTitleWidth = (_42 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.width) !== null && _42 !== void 0 ? _42 : subtextWidth;
|
|
27699
|
-
if (subTitleAlign === 'left') {
|
|
27700
|
-
(_43 = this._subTitle) === null || _43 === void 0 ? void 0 : _43.setAttribute('x', 0);
|
|
27701
|
-
(_44 = this._subTitle) === null || _44 === void 0 ? void 0 : _44.setAttribute('textAlign', 'left');
|
|
27702
|
-
}
|
|
27703
|
-
else if (subTitleAlign === 'center') {
|
|
27704
|
-
(_45 = this._subTitle) === null || _45 === void 0 ? void 0 : _45.setAttribute('x', subTitleWidth / 2);
|
|
27705
|
-
(_46 = this._subTitle) === null || _46 === void 0 ? void 0 : _46.setAttribute('textAlign', 'center');
|
|
27756
|
+
if (this._mainTitle) {
|
|
27757
|
+
if (vutils.isValid(align) || vutils.isValid(textStyle.align)) {
|
|
27758
|
+
const mainTitleAlign = textStyle.align ? textStyle.align : align;
|
|
27759
|
+
const mainTitleWidth = (_15 = textStyle.width) !== null && _15 !== void 0 ? _15 : maintextWidth;
|
|
27760
|
+
if (mainTitleAlign === 'left') {
|
|
27761
|
+
this._mainTitle.setAttribute('x', 0);
|
|
27762
|
+
this._mainTitle.setAttribute('textAlign', 'left');
|
|
27763
|
+
}
|
|
27764
|
+
else if (mainTitleAlign === 'center') {
|
|
27765
|
+
this._mainTitle.setAttribute('x', mainTitleWidth / 2);
|
|
27766
|
+
this._mainTitle.setAttribute('textAlign', 'center');
|
|
27767
|
+
}
|
|
27768
|
+
else if (mainTitleAlign === 'right') {
|
|
27769
|
+
this._mainTitle.setAttribute('x', mainTitleWidth);
|
|
27770
|
+
this._mainTitle.setAttribute('textAlign', 'right');
|
|
27771
|
+
}
|
|
27706
27772
|
}
|
|
27707
|
-
|
|
27708
|
-
|
|
27709
|
-
|
|
27773
|
+
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle.verticalAlign)) {
|
|
27774
|
+
const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;
|
|
27775
|
+
const mainTitleHeight = textStyle.height ? textStyle.height : titleHeight;
|
|
27776
|
+
if (mainTitleVerticalAlign === 'top') {
|
|
27777
|
+
this._mainTitle.setAttribute('y', 0);
|
|
27778
|
+
this._mainTitle.setAttribute('textBaseline', 'top');
|
|
27779
|
+
}
|
|
27780
|
+
else if (mainTitleVerticalAlign === 'middle') {
|
|
27781
|
+
this._mainTitle.setAttribute('y', mainTitleHeight / 2);
|
|
27782
|
+
this._mainTitle.setAttribute('textBaseline', 'middle');
|
|
27783
|
+
}
|
|
27784
|
+
else if (mainTitleVerticalAlign === 'bottom') {
|
|
27785
|
+
this._mainTitle.setAttribute('y', mainTitleHeight);
|
|
27786
|
+
this._mainTitle.setAttribute('textBaseline', 'bottom');
|
|
27787
|
+
}
|
|
27710
27788
|
}
|
|
27711
27789
|
}
|
|
27712
|
-
if (
|
|
27713
|
-
|
|
27714
|
-
|
|
27715
|
-
|
|
27716
|
-
|
|
27717
|
-
|
|
27718
|
-
|
|
27719
|
-
|
|
27720
|
-
|
|
27721
|
-
|
|
27722
|
-
|
|
27790
|
+
if (this._subTitle) {
|
|
27791
|
+
if (vutils.isValid(align) || vutils.isValid(subtextStyle.align)) {
|
|
27792
|
+
const subTitleAlign = subtextStyle.align ? subtextStyle.align : align;
|
|
27793
|
+
const subTitleWidth = (_16 = subtextStyle.width) !== null && _16 !== void 0 ? _16 : subtextWidth;
|
|
27794
|
+
if (subTitleAlign === 'left') {
|
|
27795
|
+
this._subTitle.setAttribute('x', 0);
|
|
27796
|
+
this._subTitle.setAttribute('textAlign', 'left');
|
|
27797
|
+
}
|
|
27798
|
+
else if (subTitleAlign === 'center') {
|
|
27799
|
+
this._subTitle.setAttribute('x', subTitleWidth / 2);
|
|
27800
|
+
this._subTitle.setAttribute('textAlign', 'center');
|
|
27801
|
+
}
|
|
27802
|
+
else if (subTitleAlign === 'right') {
|
|
27803
|
+
this._subTitle.setAttribute('x', subTitleWidth);
|
|
27804
|
+
this._subTitle.setAttribute('textAlign', 'right');
|
|
27805
|
+
}
|
|
27723
27806
|
}
|
|
27724
|
-
|
|
27725
|
-
|
|
27726
|
-
|
|
27807
|
+
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle.verticalAlign)) {
|
|
27808
|
+
const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign;
|
|
27809
|
+
const subTitleYStart = maintextHeight;
|
|
27810
|
+
const subTitleHeight = (_17 = subtextStyle.height) !== null && _17 !== void 0 ? _17 : 0;
|
|
27811
|
+
if (subTitleVerticalAlign === 'top') {
|
|
27812
|
+
this._subTitle.setAttribute('y', subTitleYStart);
|
|
27813
|
+
this._subTitle.setAttribute('textBaseline', 'top');
|
|
27814
|
+
}
|
|
27815
|
+
else if (subTitleVerticalAlign === 'middle') {
|
|
27816
|
+
this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight / 2);
|
|
27817
|
+
this._subTitle.setAttribute('textBaseline', 'middle');
|
|
27818
|
+
}
|
|
27819
|
+
else if (subTitleVerticalAlign === 'bottom') {
|
|
27820
|
+
this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight);
|
|
27821
|
+
this._subTitle.setAttribute('textBaseline', 'bottom');
|
|
27822
|
+
}
|
|
27727
27823
|
}
|
|
27728
27824
|
}
|
|
27729
27825
|
}
|
|
@@ -27786,7 +27882,7 @@
|
|
|
27786
27882
|
}
|
|
27787
27883
|
render() {
|
|
27788
27884
|
var _a, _b, _c;
|
|
27789
|
-
const { visible, title, content, size, limitRatio = Infinity } = this.attribute;
|
|
27885
|
+
const { visible, title = {}, content, size, limitRatio = Infinity } = this.attribute;
|
|
27790
27886
|
const limit = Math.min(size.width, size.height) * limitRatio;
|
|
27791
27887
|
const group = this.createOrUpdateChild('indicator-container', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
27792
27888
|
if (visible !== true) {
|
|
@@ -27820,7 +27916,7 @@
|
|
|
27820
27916
|
}
|
|
27821
27917
|
const titleHeight = this._title ? this._title.AABBBounds.height() : 0;
|
|
27822
27918
|
if (vutils.isValid(content)) {
|
|
27823
|
-
const titleSpace = this._title ? (
|
|
27919
|
+
const titleSpace = this._title ? (title.space ? title.space : 0) : 0;
|
|
27824
27920
|
const contents = vutils.array(content);
|
|
27825
27921
|
const contentComponents = [];
|
|
27826
27922
|
let lastContentHeight = 0;
|
|
@@ -27845,7 +27941,7 @@
|
|
|
27845
27941
|
contentComponent.setAttribute('maxLineWidth', limit);
|
|
27846
27942
|
}
|
|
27847
27943
|
contentComponents.push(contentComponent);
|
|
27848
|
-
const contentSpace =
|
|
27944
|
+
const contentSpace = contentItem.space ? contentItem.space : 0;
|
|
27849
27945
|
lastContentHeight += contentComponent.AABBBounds.height() + contentSpace;
|
|
27850
27946
|
}
|
|
27851
27947
|
else {
|
|
@@ -28064,15 +28160,15 @@
|
|
|
28064
28160
|
this.updateLayout();
|
|
28065
28161
|
};
|
|
28066
28162
|
this.updateLayout = () => {
|
|
28067
|
-
var _a, _b, _c, _d
|
|
28163
|
+
var _a, _b, _c, _d;
|
|
28068
28164
|
this._layout = this.attribute.layout;
|
|
28069
28165
|
if (this._layout === 'horizontal') {
|
|
28070
|
-
this._backwardAttr.style.symbolType = (
|
|
28071
|
-
this._forwardAttr.style.symbolType = (
|
|
28166
|
+
this._backwardAttr.style.symbolType = (_a = this._backwardAttr.style.symbolType) !== null && _a !== void 0 ? _a : iconLeft;
|
|
28167
|
+
this._forwardAttr.style.symbolType = (_b = this._forwardAttr.style.symbolType) !== null && _b !== void 0 ? _b : iconRight;
|
|
28072
28168
|
}
|
|
28073
28169
|
else if (this._layout === 'vertical') {
|
|
28074
|
-
this._backwardAttr.style.symbolType = (
|
|
28075
|
-
this._forwardAttr.style.symbolType = (
|
|
28170
|
+
this._backwardAttr.style.symbolType = (_c = this._backwardAttr.style.symbolType) !== null && _c !== void 0 ? _c : iconUp;
|
|
28171
|
+
this._forwardAttr.style.symbolType = (_d = this._forwardAttr.style.symbolType) !== null && _d !== void 0 ? _d : iconDown;
|
|
28076
28172
|
}
|
|
28077
28173
|
};
|
|
28078
28174
|
this._initPlay = () => {
|
|
@@ -28351,21 +28447,21 @@
|
|
|
28351
28447
|
this._initSlider();
|
|
28352
28448
|
}
|
|
28353
28449
|
_initAttributes() {
|
|
28354
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
28355
28450
|
this._size = this.attribute.size;
|
|
28356
28451
|
this._orient = this.attribute.orient;
|
|
28357
28452
|
this._data = this.attribute.data;
|
|
28358
28453
|
this._minIndex = 0;
|
|
28359
28454
|
this._maxIndex = this._data.length - 1;
|
|
28360
|
-
|
|
28361
|
-
this.
|
|
28362
|
-
this.
|
|
28363
|
-
this.
|
|
28364
|
-
this.
|
|
28365
|
-
this.
|
|
28366
|
-
this.
|
|
28367
|
-
this.
|
|
28368
|
-
this.
|
|
28455
|
+
const { slider = {}, controller = {} } = this.attribute;
|
|
28456
|
+
this._sliderVisible = slider.visible;
|
|
28457
|
+
this._railStyle = Object.assign({}, slider.railStyle);
|
|
28458
|
+
this._trackStyle = Object.assign({}, slider.trackStyle);
|
|
28459
|
+
this._handlerStyle = Object.assign({}, slider.handlerStyle);
|
|
28460
|
+
this._controllerVisible = controller.visible;
|
|
28461
|
+
this._start = Object.assign({}, controller.start);
|
|
28462
|
+
this._pause = Object.assign({}, controller.pause);
|
|
28463
|
+
this._forward = Object.assign({}, controller.forward);
|
|
28464
|
+
this._backward = Object.assign({}, controller.backward);
|
|
28369
28465
|
}
|
|
28370
28466
|
_initLayoutInfo() {
|
|
28371
28467
|
var _a, _b, _c;
|
|
@@ -28826,12 +28922,12 @@
|
|
|
28826
28922
|
this._operatingMaskMoveRangeY = [-Infinity, Infinity];
|
|
28827
28923
|
this._brushMaskAABBBoundsDict = {};
|
|
28828
28924
|
this._onBrushStart = (e) => {
|
|
28829
|
-
var _a
|
|
28925
|
+
var _a;
|
|
28830
28926
|
if (this._outOfInteractiveRange(e)) {
|
|
28831
28927
|
return;
|
|
28832
28928
|
}
|
|
28833
28929
|
e.stopPropagation();
|
|
28834
|
-
const brushMoved = (
|
|
28930
|
+
const brushMoved = (_a = this.attribute.brushMoved) !== null && _a !== void 0 ? _a : true;
|
|
28835
28931
|
this._activeMoveState = brushMoved && this._isPosInBrushMask(e);
|
|
28836
28932
|
this._activeDrawState = !this._activeMoveState;
|
|
28837
28933
|
this._activeDrawState && this._initDraw(e);
|
|
@@ -28846,7 +28942,6 @@
|
|
|
28846
28942
|
this._activeMoveState && this._moving(e);
|
|
28847
28943
|
};
|
|
28848
28944
|
this._onBrushEnd = (e) => {
|
|
28849
|
-
var _a;
|
|
28850
28945
|
e.preventDefault();
|
|
28851
28946
|
const { removeOnClick = true } = this.attribute;
|
|
28852
28947
|
if (this._activeDrawState && !this._isDrawedBeforeEnd && removeOnClick) {
|
|
@@ -28877,7 +28972,9 @@
|
|
|
28877
28972
|
this._activeDrawState = false;
|
|
28878
28973
|
this._activeMoveState = false;
|
|
28879
28974
|
this._isDrawedBeforeEnd = false;
|
|
28880
|
-
(
|
|
28975
|
+
if (this._operatingMask) {
|
|
28976
|
+
this._operatingMask.setAttribute('pickable', false);
|
|
28977
|
+
}
|
|
28881
28978
|
};
|
|
28882
28979
|
}
|
|
28883
28980
|
_bindBrushEvents() {
|
|
@@ -28946,15 +29043,15 @@
|
|
|
28946
29043
|
});
|
|
28947
29044
|
}
|
|
28948
29045
|
_drawing(e) {
|
|
28949
|
-
var _a;
|
|
29046
|
+
var _a, _b;
|
|
28950
29047
|
const pos = this.eventPosToStagePos(e);
|
|
28951
29048
|
const { x1 = 0, x2 = 0, y1 = 0, y2 = 0 } = (_a = this._operatingMask) === null || _a === void 0 ? void 0 : _a._AABBBounds;
|
|
28952
29049
|
const { sizeThreshold = DEFAULT_SIZE_THRESHOLD, brushType } = this.attribute;
|
|
28953
29050
|
const cacheLength = this._cacheDrawPoints.length;
|
|
28954
29051
|
this._isDrawedBeforeEnd = !!(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold);
|
|
28955
29052
|
if (cacheLength > 0) {
|
|
28956
|
-
const lastPos = this._cacheDrawPoints[this._cacheDrawPoints.length - 1];
|
|
28957
|
-
if (pos.x ===
|
|
29053
|
+
const lastPos = (_b = this._cacheDrawPoints[this._cacheDrawPoints.length - 1]) !== null && _b !== void 0 ? _b : {};
|
|
29054
|
+
if (pos.x === lastPos.x && pos.y === lastPos.y) {
|
|
28958
29055
|
return;
|
|
28959
29056
|
}
|
|
28960
29057
|
}
|
|
@@ -29289,7 +29386,7 @@
|
|
|
29289
29386
|
const titleHeight = isVisible(titleAttr) ? titleAttr.height + titleAttr.spaceRow : 0;
|
|
29290
29387
|
this._tooltipContent = this.createOrUpdateChild(TOOLTIP_CONTENT_NAME, { visible: true }, 'group');
|
|
29291
29388
|
this._tooltipContent.removeAllChild();
|
|
29292
|
-
if (content
|
|
29389
|
+
if (content && content.length) {
|
|
29293
29390
|
this._tooltipContent.setAttribute('x', padding[3]);
|
|
29294
29391
|
this._tooltipContent.setAttribute('y', padding[0] + titleHeight);
|
|
29295
29392
|
let lastYPos = 0;
|
|
@@ -29472,7 +29569,7 @@
|
|
|
29472
29569
|
if (isVisible(titleAttr)) {
|
|
29473
29570
|
containerHeight += titleMaxHeight + titleAttr.spaceRow;
|
|
29474
29571
|
}
|
|
29475
|
-
if (content
|
|
29572
|
+
if (content && content.length) {
|
|
29476
29573
|
const filteredContent = [];
|
|
29477
29574
|
content.forEach((item, i) => {
|
|
29478
29575
|
const itemAttr = Tooltip.getContentAttr(attribute, i);
|
|
@@ -29718,7 +29815,7 @@
|
|
|
29718
29815
|
}
|
|
29719
29816
|
};
|
|
29720
29817
|
|
|
29721
|
-
const version = "0.17.
|
|
29818
|
+
const version = "0.17.9";
|
|
29722
29819
|
|
|
29723
29820
|
exports.AbstractComponent = AbstractComponent;
|
|
29724
29821
|
exports.ArcInfo = ArcInfo;
|