@visactor/vrender-components 0.17.7 → 0.17.8
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 +7 -7
- 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/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/type.d.ts +3 -3
- package/cjs/label/type.js.map +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 +10 -6
- 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 +1 -1
- package/cjs/tag/tag.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 +564 -475
- 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 +7 -7
- 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/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/type.d.ts +3 -3
- package/es/label/type.js.map +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 +10 -6
- 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 +1 -1
- package/es/tag/tag.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 +8 -8
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) => {
|
|
@@ -18358,6 +18423,10 @@
|
|
|
18358
18423
|
value: vutils.clampRange(range, limitRange[0], limitRange[1])
|
|
18359
18424
|
});
|
|
18360
18425
|
}
|
|
18426
|
+
this._dispatchEvent('scrollUp', {
|
|
18427
|
+
pre: preRange,
|
|
18428
|
+
value: vutils.clampRange(range, limitRange[0], limitRange[1])
|
|
18429
|
+
});
|
|
18361
18430
|
if (vglobal.env === 'browser') {
|
|
18362
18431
|
vglobal.removeEventListener('pointermove', this._onSliderPointerMove, { capture: true });
|
|
18363
18432
|
vglobal.removeEventListener('pointerup', this._onSliderPointerUp);
|
|
@@ -18370,7 +18439,6 @@
|
|
|
18370
18439
|
};
|
|
18371
18440
|
}
|
|
18372
18441
|
setScrollRange(range, render = true) {
|
|
18373
|
-
var _a, _b;
|
|
18374
18442
|
const { direction = 'horizontal', limitRange = [0, 1], range: preRange, realTime = true } = this.attribute;
|
|
18375
18443
|
const currScrollRange = vutils.clampRange(range, limitRange[0], limitRange[1]);
|
|
18376
18444
|
if (render) {
|
|
@@ -18382,8 +18450,8 @@
|
|
|
18382
18450
|
else {
|
|
18383
18451
|
this._slider.setAttribute('y', sliderPos[0], true);
|
|
18384
18452
|
}
|
|
18385
|
-
if (
|
|
18386
|
-
|
|
18453
|
+
if (this.stage && !this.stage.autoRender) {
|
|
18454
|
+
this.stage.renderNextFrame();
|
|
18387
18455
|
}
|
|
18388
18456
|
}
|
|
18389
18457
|
}
|
|
@@ -18393,6 +18461,10 @@
|
|
|
18393
18461
|
pre: preRange,
|
|
18394
18462
|
value: currScrollRange
|
|
18395
18463
|
});
|
|
18464
|
+
this._dispatchEvent('scrollDrag', {
|
|
18465
|
+
pre: preRange,
|
|
18466
|
+
value: currScrollRange
|
|
18467
|
+
});
|
|
18396
18468
|
}
|
|
18397
18469
|
}
|
|
18398
18470
|
getScrollRange() {
|
|
@@ -18878,7 +18950,7 @@
|
|
|
18878
18950
|
tagWidth += textWidth;
|
|
18879
18951
|
const size = (_c = shape.size) !== null && _c !== void 0 ? _c : 10;
|
|
18880
18952
|
const maxSize = vutils.isNumber(size) ? size : Math.max(size[0], size[1]);
|
|
18881
|
-
tagHeight += Math.max(textHeight,
|
|
18953
|
+
tagHeight += Math.max(textHeight, shape.visible ? maxSize : 0);
|
|
18882
18954
|
const { textAlign, textBaseline } = textStyle;
|
|
18883
18955
|
if (vutils.isValid(minWidth) || vutils.isValid(maxWidth)) {
|
|
18884
18956
|
if (vutils.isValid(minWidth) && tagWidth < minWidth) {
|
|
@@ -20193,19 +20265,25 @@
|
|
|
20193
20265
|
}
|
|
20194
20266
|
let labels;
|
|
20195
20267
|
if (vutils.isFunction(customLayoutFunc)) {
|
|
20196
|
-
labels = customLayoutFunc(data, this.
|
|
20268
|
+
labels = customLayoutFunc(data, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null);
|
|
20197
20269
|
}
|
|
20198
20270
|
else {
|
|
20199
20271
|
labels = this._layout(data);
|
|
20200
20272
|
}
|
|
20201
20273
|
if (vutils.isFunction(customOverlapFunc)) {
|
|
20202
|
-
labels = customOverlapFunc(labels, this.
|
|
20274
|
+
labels = customOverlapFunc(labels, this.getRelatedGraphic.bind(this), this._isCollectionBase ? (d) => this._idToPoint.get(d.id) : null);
|
|
20203
20275
|
}
|
|
20204
20276
|
else {
|
|
20205
20277
|
if (overlap !== false) {
|
|
20206
20278
|
labels = this._overlapping(labels);
|
|
20207
20279
|
}
|
|
20208
20280
|
}
|
|
20281
|
+
if (labels && labels.length) {
|
|
20282
|
+
labels.forEach(label => {
|
|
20283
|
+
this._bindEvent(label);
|
|
20284
|
+
this._setStatesOfText(label);
|
|
20285
|
+
});
|
|
20286
|
+
}
|
|
20209
20287
|
if (smartInvert !== false) {
|
|
20210
20288
|
this._smartInvert(labels);
|
|
20211
20289
|
}
|
|
@@ -20254,21 +20332,15 @@
|
|
|
20254
20332
|
attributes.width = (_a = attributes.width) !== null && _a !== void 0 ? _a : 0;
|
|
20255
20333
|
attributes.height = (_b = attributes.height) !== null && _b !== void 0 ? _b : 0;
|
|
20256
20334
|
const text = graphicCreator.richtext(attributes);
|
|
20257
|
-
this._bindEvent(text);
|
|
20258
|
-
this._setStatesOfText(text);
|
|
20259
20335
|
return text;
|
|
20260
20336
|
}
|
|
20261
20337
|
else if (attributes.textType === 'html') {
|
|
20262
20338
|
attributes.textConfig = [];
|
|
20263
20339
|
attributes.html = Object.assign(Object.assign({ dom: attributes.text }, DEFAULT_HTML_TEXT_SPEC), attributes);
|
|
20264
20340
|
const text = graphicCreator.richtext(attributes);
|
|
20265
|
-
this._bindEvent(text);
|
|
20266
|
-
this._setStatesOfText(text);
|
|
20267
20341
|
return text;
|
|
20268
20342
|
}
|
|
20269
20343
|
const text = graphicCreator.text(attributes);
|
|
20270
|
-
this._bindEvent(text);
|
|
20271
|
-
this._setStatesOfText(text);
|
|
20272
20344
|
return text;
|
|
20273
20345
|
}
|
|
20274
20346
|
_prepare() {
|
|
@@ -20345,7 +20417,7 @@
|
|
|
20345
20417
|
};
|
|
20346
20418
|
}
|
|
20347
20419
|
}
|
|
20348
|
-
|
|
20420
|
+
getRelatedGraphic(item) {
|
|
20349
20421
|
return this._idToGraphic.get(item.id);
|
|
20350
20422
|
}
|
|
20351
20423
|
_layout(data = []) {
|
|
@@ -20353,7 +20425,7 @@
|
|
|
20353
20425
|
const labels = [];
|
|
20354
20426
|
for (let i = 0; i < data.length; i++) {
|
|
20355
20427
|
const textData = data[i];
|
|
20356
|
-
const baseMark = this.
|
|
20428
|
+
const baseMark = this.getRelatedGraphic(textData);
|
|
20357
20429
|
const labelAttribute = Object.assign(Object.assign({ fill: this._isCollectionBase
|
|
20358
20430
|
? vutils.isArray(baseMark.attribute.stroke)
|
|
20359
20431
|
? baseMark.attribute.stroke.find(entry => !!entry && entry !== true)
|
|
@@ -20416,7 +20488,7 @@
|
|
|
20416
20488
|
continue;
|
|
20417
20489
|
}
|
|
20418
20490
|
const text = labels[i];
|
|
20419
|
-
const baseMark = this.
|
|
20491
|
+
const baseMark = this.getRelatedGraphic(text.attribute);
|
|
20420
20492
|
text.update();
|
|
20421
20493
|
if (!vutils.isRectIntersect(baseMark.AABBBounds, { x1: 0, x2: bmpTool.width, y1: 0, y2: bmpTool.height }, true)) {
|
|
20422
20494
|
continue;
|
|
@@ -20505,7 +20577,7 @@
|
|
|
20505
20577
|
labels.forEach((text, index) => {
|
|
20506
20578
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
20507
20579
|
const labelLine = this._labelLine(text);
|
|
20508
|
-
const relatedGraphic = this.
|
|
20580
|
+
const relatedGraphic = this.getRelatedGraphic(text.attribute);
|
|
20509
20581
|
const textId = text.attribute.id;
|
|
20510
20582
|
const textKey = this._isCollectionBase ? textId : relatedGraphic;
|
|
20511
20583
|
const state = (prevTextMap === null || prevTextMap === void 0 ? void 0 : prevTextMap.get(textKey)) ? 'update' : 'enter';
|
|
@@ -20562,7 +20634,7 @@
|
|
|
20562
20634
|
labels.forEach(text => {
|
|
20563
20635
|
var _a;
|
|
20564
20636
|
const labelLine = this._labelLine(text);
|
|
20565
|
-
const relatedGraphic = this.
|
|
20637
|
+
const relatedGraphic = this.getRelatedGraphic(text.attribute);
|
|
20566
20638
|
const state = (prevTextMap === null || prevTextMap === void 0 ? void 0 : prevTextMap.get(relatedGraphic)) ? 'update' : 'enter';
|
|
20567
20639
|
const textKey = this._isCollectionBase ? text.attribute.id : relatedGraphic;
|
|
20568
20640
|
if (state === 'enter') {
|
|
@@ -20677,7 +20749,7 @@
|
|
|
20677
20749
|
if (!label) {
|
|
20678
20750
|
continue;
|
|
20679
20751
|
}
|
|
20680
|
-
const baseMark = this.
|
|
20752
|
+
const baseMark = this.getRelatedGraphic(label.attribute);
|
|
20681
20753
|
const backgroundColor = baseMark.attribute.fill;
|
|
20682
20754
|
const foregroundColor = label.attribute.fill;
|
|
20683
20755
|
const baseColor = backgroundColor;
|
|
@@ -21468,7 +21540,8 @@
|
|
|
21468
21540
|
}
|
|
21469
21541
|
if (points[0].x < 0) {
|
|
21470
21542
|
if (vutils.isNumberClose(points[0].y, points[1].y)) {
|
|
21471
|
-
if (
|
|
21543
|
+
if ((vutils.isGreater(arc.middleAngle, -Math.PI) && vutils.isLess(arc.middleAngle, 0)) ||
|
|
21544
|
+
(vutils.isGreater(arc.middleAngle, Math.PI) && vutils.isLess(arc.middleAngle, Math.PI * 2))) {
|
|
21472
21545
|
min = 0;
|
|
21473
21546
|
max = points[1].y + height / 2;
|
|
21474
21547
|
}
|
|
@@ -21834,7 +21907,7 @@
|
|
|
21834
21907
|
}
|
|
21835
21908
|
const { autoRotate = true } = attribute;
|
|
21836
21909
|
let symbol;
|
|
21837
|
-
if (attribute
|
|
21910
|
+
if (attribute && attribute.visible) {
|
|
21838
21911
|
const startAngle = this._startAngle;
|
|
21839
21912
|
const endAngle = this._endAngle;
|
|
21840
21913
|
const { state } = this.attribute;
|
|
@@ -21890,18 +21963,18 @@
|
|
|
21890
21963
|
return points;
|
|
21891
21964
|
}
|
|
21892
21965
|
_clipPoints(points) {
|
|
21893
|
-
const { startSymbol, endSymbol } = this.attribute;
|
|
21966
|
+
const { startSymbol = {}, endSymbol = {} } = this.attribute;
|
|
21894
21967
|
let pointsAfterClip = points;
|
|
21895
|
-
if (startSymbol
|
|
21896
|
-
const startSize =
|
|
21968
|
+
if (startSymbol.visible) {
|
|
21969
|
+
const startSize = startSymbol.clip ? startSymbol.size || 10 : 0;
|
|
21897
21970
|
const pointsStart = {
|
|
21898
21971
|
x: points[0].x - (startSize / 2) * (Math.cos(this._startAngle) || 0),
|
|
21899
21972
|
y: points[0].y - (startSize / 2) * (Math.sin(this._startAngle) || 0)
|
|
21900
21973
|
};
|
|
21901
21974
|
pointsAfterClip = [pointsStart, ...pointsAfterClip.slice(1)];
|
|
21902
21975
|
}
|
|
21903
|
-
if (endSymbol
|
|
21904
|
-
const endSize =
|
|
21976
|
+
if (endSymbol.visible) {
|
|
21977
|
+
const endSize = endSymbol.clip ? endSymbol.size || 10 : 0;
|
|
21905
21978
|
const pointsEnd = {
|
|
21906
21979
|
x: points[points.length - 1].x - (endSize / 2) * (Math.cos(this._endAngle) || 0),
|
|
21907
21980
|
y: points[points.length - 1].y - (endSize / 2) * (Math.sin(this._endAngle) || 0)
|
|
@@ -22157,15 +22230,15 @@
|
|
|
22157
22230
|
axisContainer.setMode(this.mode);
|
|
22158
22231
|
this.axisContainer = axisContainer;
|
|
22159
22232
|
container.add(axisContainer);
|
|
22160
|
-
if (line
|
|
22233
|
+
if (line && line.visible) {
|
|
22161
22234
|
this.renderLine(axisContainer);
|
|
22162
22235
|
}
|
|
22163
22236
|
if (items && items.length) {
|
|
22164
22237
|
this.data = this._transformItems(items[0]);
|
|
22165
|
-
if (tick
|
|
22238
|
+
if (tick && tick.visible) {
|
|
22166
22239
|
this.renderTicks(axisContainer);
|
|
22167
22240
|
}
|
|
22168
|
-
if (label
|
|
22241
|
+
if (label && label.visible) {
|
|
22169
22242
|
const labelGroup = graphicCreator.group({ x: 0, y: 0, pickable: false });
|
|
22170
22243
|
labelGroup.name = exports.AXIS_ELEMENT_NAME.labelContainer;
|
|
22171
22244
|
labelGroup.id = this._getNodeId('label-container');
|
|
@@ -22180,7 +22253,7 @@
|
|
|
22180
22253
|
});
|
|
22181
22254
|
}
|
|
22182
22255
|
}
|
|
22183
|
-
if (title
|
|
22256
|
+
if (title && title.visible) {
|
|
22184
22257
|
this.renderTitle(axisContainer);
|
|
22185
22258
|
}
|
|
22186
22259
|
}
|
|
@@ -22212,7 +22285,7 @@
|
|
|
22212
22285
|
});
|
|
22213
22286
|
this.tickLineItems = tickLineItems;
|
|
22214
22287
|
const { subTick } = this.attribute;
|
|
22215
|
-
if (subTick
|
|
22288
|
+
if (subTick && subTick.visible) {
|
|
22216
22289
|
const subTickLineItems = this.getSubTickLineItems();
|
|
22217
22290
|
if (subTickLineItems.length) {
|
|
22218
22291
|
subTickLineItems.forEach((item, index) => {
|
|
@@ -22432,15 +22505,15 @@
|
|
|
22432
22505
|
beta }, style);
|
|
22433
22506
|
}
|
|
22434
22507
|
_getLabelAttribute(tickDatum, index, tickData, layer) {
|
|
22435
|
-
var _a, _b
|
|
22508
|
+
var _a, _b;
|
|
22436
22509
|
const { space = 4, inside = false, formatMethod, type = 'text', text } = this.attribute.label;
|
|
22437
22510
|
let offset = space;
|
|
22438
22511
|
let tickLength = 0;
|
|
22439
|
-
if (((_a = this.attribute.tick) === null || _a === void 0 ? void 0 : _a.visible) &&
|
|
22440
|
-
tickLength =
|
|
22512
|
+
if (((_a = this.attribute.tick) === null || _a === void 0 ? void 0 : _a.visible) && this.attribute.tick.inside === inside) {
|
|
22513
|
+
tickLength = this.attribute.tick.length || 4;
|
|
22441
22514
|
}
|
|
22442
|
-
if (((
|
|
22443
|
-
tickLength = Math.max(tickLength,
|
|
22515
|
+
if (((_b = this.attribute.subTick) === null || _b === void 0 ? void 0 : _b.visible) && this.attribute.subTick.inside === inside) {
|
|
22516
|
+
tickLength = Math.max(tickLength, this.attribute.subTick.length || 2);
|
|
22444
22517
|
}
|
|
22445
22518
|
offset += tickLength;
|
|
22446
22519
|
const axisVector = this.getRelativeVector(tickDatum.point);
|
|
@@ -22880,8 +22953,8 @@
|
|
|
22880
22953
|
container.add(axisLineGroup);
|
|
22881
22954
|
}
|
|
22882
22955
|
getTitleAttribute() {
|
|
22883
|
-
var _a, _b, _c
|
|
22884
|
-
const
|
|
22956
|
+
var _a, _b, _c;
|
|
22957
|
+
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"]);
|
|
22885
22958
|
let percent = 0.5;
|
|
22886
22959
|
if (position === 'start') {
|
|
22887
22960
|
percent = 0;
|
|
@@ -22894,7 +22967,7 @@
|
|
|
22894
22967
|
const point = this.getTickCoord(percent);
|
|
22895
22968
|
const axisVector = this.getRelativeVector();
|
|
22896
22969
|
let labelLength = 0;
|
|
22897
|
-
if (((_a = this.attribute.label) === null || _a === void 0 ? void 0 : _a.visible) &&
|
|
22970
|
+
if (((_a = this.attribute.label) === null || _a === void 0 ? void 0 : _a.visible) && this.attribute.label.inside === false) {
|
|
22898
22971
|
const space = +vutils.get(this.attribute, 'label.space', 4);
|
|
22899
22972
|
labelLength += space;
|
|
22900
22973
|
const layerCount = Object.keys(this.axisLabelLayerSize).length;
|
|
@@ -22955,11 +23028,11 @@
|
|
|
22955
23028
|
}
|
|
22956
23029
|
}
|
|
22957
23030
|
let tickLength = 0;
|
|
22958
|
-
if (((
|
|
22959
|
-
tickLength =
|
|
23031
|
+
if (((_b = this.attribute.tick) === null || _b === void 0 ? void 0 : _b.visible) && this.attribute.tick.inside === false) {
|
|
23032
|
+
tickLength = this.attribute.tick.length || 4;
|
|
22960
23033
|
}
|
|
22961
|
-
if (((
|
|
22962
|
-
tickLength = Math.max(tickLength,
|
|
23034
|
+
if (((_c = this.attribute.subTick) === null || _c === void 0 ? void 0 : _c.visible) && this.attribute.subTick.inside === false) {
|
|
23035
|
+
tickLength = Math.max(tickLength, this.attribute.subTick.length || 2);
|
|
22963
23036
|
}
|
|
22964
23037
|
const offset = tickLength + labelLength + space;
|
|
22965
23038
|
const titlePoint = this.getVerticalCoord(point, offset, false);
|
|
@@ -22995,9 +23068,9 @@
|
|
|
22995
23068
|
}
|
|
22996
23069
|
const attrs = Object.assign(Object.assign(Object.assign({}, titlePoint), restAttrs), { textStyle: Object.assign({ textAlign,
|
|
22997
23070
|
textBaseline }, textStyle), state: {
|
|
22998
|
-
text: vutils.merge({}, DEFAULT_STATES$1, state
|
|
22999
|
-
shape: vutils.merge({}, DEFAULT_STATES$1, state
|
|
23000
|
-
panel: vutils.merge({}, DEFAULT_STATES$1, state
|
|
23071
|
+
text: vutils.merge({}, DEFAULT_STATES$1, state.text),
|
|
23072
|
+
shape: vutils.merge({}, DEFAULT_STATES$1, state.shape),
|
|
23073
|
+
panel: vutils.merge({}, DEFAULT_STATES$1, state.background)
|
|
23001
23074
|
} });
|
|
23002
23075
|
attrs.angle = angle;
|
|
23003
23076
|
if (shape && shape.visible) {
|
|
@@ -23033,7 +23106,7 @@
|
|
|
23033
23106
|
}
|
|
23034
23107
|
getLabelAlign(vector, inside, angle) {
|
|
23035
23108
|
const orient = this.attribute.orient;
|
|
23036
|
-
if (vutils.isValidNumber(angle)) {
|
|
23109
|
+
if (vutils.isValidNumber(angle) || (vector[0] === 0 && vector[1] === 0)) {
|
|
23037
23110
|
if (orient === 'top' || orient === 'bottom') {
|
|
23038
23111
|
return getXAxisLabelAlign(orient, angle);
|
|
23039
23112
|
}
|
|
@@ -23228,9 +23301,9 @@
|
|
|
23228
23301
|
let limitLength = limitSize;
|
|
23229
23302
|
let titleHeight = 0;
|
|
23230
23303
|
let titleSpacing = 0;
|
|
23231
|
-
const axisLineWidth =
|
|
23232
|
-
const tickLength =
|
|
23233
|
-
if (
|
|
23304
|
+
const axisLineWidth = line && line.visible ? (_b = line.style.lineWidth) !== null && _b !== void 0 ? _b : 1 : 0;
|
|
23305
|
+
const tickLength = tick && tick.visible ? (_c = tick.length) !== null && _c !== void 0 ? _c : 4 : 0;
|
|
23306
|
+
if (title && title.visible && typeof title.text === 'string') {
|
|
23234
23307
|
titleHeight = measureTextSize(title.text, title.textStyle).height;
|
|
23235
23308
|
const padding = vutils.normalizePadding(title.padding);
|
|
23236
23309
|
titleSpacing = title.space + padding[0] + padding[2];
|
|
@@ -23332,7 +23405,7 @@
|
|
|
23332
23405
|
super((options === null || options === void 0 ? void 0 : options.skipDefault) ? attributes : vutils.merge({}, CircleAxis.defaultAttributes, attributes));
|
|
23333
23406
|
}
|
|
23334
23407
|
renderLine(container) {
|
|
23335
|
-
const { startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE, radius, center, innerRadius = 0, line, inside = false } = this.attribute;
|
|
23408
|
+
const { startAngle = POLAR_START_ANGLE, endAngle = POLAR_END_ANGLE, radius, center, innerRadius = 0, line = {}, inside = false } = this.attribute;
|
|
23336
23409
|
let arcRadius = radius;
|
|
23337
23410
|
let arcInnerRadius = innerRadius;
|
|
23338
23411
|
if (inside && innerRadius > 0) {
|
|
@@ -23340,30 +23413,30 @@
|
|
|
23340
23413
|
arcInnerRadius = 0;
|
|
23341
23414
|
}
|
|
23342
23415
|
const arcAttrs = Object.assign(Object.assign(Object.assign({}, center), { startAngle,
|
|
23343
|
-
endAngle, radius: arcRadius, innerRadius: arcInnerRadius }), line
|
|
23416
|
+
endAngle, radius: arcRadius, innerRadius: arcInnerRadius }), line.style);
|
|
23344
23417
|
const axisLine = graphicCreator.circle(arcAttrs);
|
|
23345
23418
|
axisLine.name = exports.AXIS_ELEMENT_NAME.line;
|
|
23346
23419
|
axisLine.id = this._getNodeId('line');
|
|
23347
|
-
if (!vutils.isEmpty(line
|
|
23420
|
+
if (!vutils.isEmpty(line.state)) {
|
|
23348
23421
|
axisLine.states = vutils.merge({}, DEFAULT_STATES$1, line.state);
|
|
23349
23422
|
}
|
|
23350
23423
|
container.add(axisLine);
|
|
23351
23424
|
}
|
|
23352
23425
|
getTitleAttribute() {
|
|
23353
|
-
var _a, _b, _c
|
|
23426
|
+
var _a, _b, _c;
|
|
23354
23427
|
const { center, radius, innerRadius = 0 } = this.attribute;
|
|
23355
|
-
const
|
|
23428
|
+
const _d = this.attribute.title, { space = 4, textStyle = {}, shape, background, state = {} } = _d, restAttrs = __rest(_d, ["space", "textStyle", "shape", "background", "state"]);
|
|
23356
23429
|
let titlePoint = center;
|
|
23357
23430
|
let labelHeight = 0;
|
|
23358
|
-
if (((_a = this.attribute.label) === null || _a === void 0 ? void 0 : _a.visible) &&
|
|
23431
|
+
if (((_a = this.attribute.label) === null || _a === void 0 ? void 0 : _a.visible) && this.attribute.label.inside === false) {
|
|
23359
23432
|
labelHeight = vutils.get(this.attribute.label, 'style.fontSize', 12) + vutils.get(this.attribute.label, 'space', 4);
|
|
23360
23433
|
}
|
|
23361
23434
|
let tickLength = 0;
|
|
23362
|
-
if (((
|
|
23363
|
-
tickLength =
|
|
23435
|
+
if (((_b = this.attribute.tick) === null || _b === void 0 ? void 0 : _b.visible) && this.attribute.tick.inside === false) {
|
|
23436
|
+
tickLength = this.attribute.tick.length || 4;
|
|
23364
23437
|
}
|
|
23365
|
-
if (((
|
|
23366
|
-
tickLength = Math.max(tickLength,
|
|
23438
|
+
if (((_c = this.attribute.subTick) === null || _c === void 0 ? void 0 : _c.visible) && this.attribute.subTick.inside === false) {
|
|
23439
|
+
tickLength = Math.max(tickLength, this.attribute.subTick.length || 2);
|
|
23367
23440
|
}
|
|
23368
23441
|
const offset = radius + tickLength + labelHeight + space;
|
|
23369
23442
|
let textBaseline = 'middle';
|
|
@@ -23386,9 +23459,9 @@
|
|
|
23386
23459
|
};
|
|
23387
23460
|
}
|
|
23388
23461
|
const attrs = Object.assign(Object.assign(Object.assign({}, titlePoint), restAttrs), { textStyle: Object.assign({ textBaseline, textAlign: 'center' }, textStyle), state: {
|
|
23389
|
-
text: vutils.merge({}, DEFAULT_STATES$1, state
|
|
23390
|
-
shape: vutils.merge({}, DEFAULT_STATES$1, state
|
|
23391
|
-
panel: vutils.merge({}, DEFAULT_STATES$1, state
|
|
23462
|
+
text: vutils.merge({}, DEFAULT_STATES$1, state.text),
|
|
23463
|
+
shape: vutils.merge({}, DEFAULT_STATES$1, state.shape),
|
|
23464
|
+
panel: vutils.merge({}, DEFAULT_STATES$1, state.background)
|
|
23392
23465
|
} });
|
|
23393
23466
|
const { angle } = restAttrs;
|
|
23394
23467
|
attrs.angle = angle;
|
|
@@ -23527,11 +23600,12 @@
|
|
|
23527
23600
|
let duration = this.duration;
|
|
23528
23601
|
let easing = this.easing;
|
|
23529
23602
|
Object.keys(this._newElementAttrMap).forEach(id => {
|
|
23530
|
-
var _a
|
|
23603
|
+
var _a;
|
|
23531
23604
|
const { node, attrs, state } = this._newElementAttrMap[id];
|
|
23532
23605
|
if (state === 'enter') {
|
|
23533
|
-
|
|
23534
|
-
|
|
23606
|
+
const { enter = {} } = (_a = this.params) !== null && _a !== void 0 ? _a : {};
|
|
23607
|
+
duration = vutils.isValidNumber(enter.duration) ? enter.duration : duration;
|
|
23608
|
+
easing = enter.easing ? enter.easing : easing;
|
|
23535
23609
|
}
|
|
23536
23610
|
if (node.type === 'path') {
|
|
23537
23611
|
node
|
|
@@ -24498,13 +24572,13 @@
|
|
|
24498
24572
|
if (this._layoutAttrFromConfig) {
|
|
24499
24573
|
return this._layoutAttrFromConfig;
|
|
24500
24574
|
}
|
|
24501
|
-
const { position: positionConfig, size, orient, middleHandlerStyle, startHandlerStyle, endHandlerStyle } = this.attribute;
|
|
24575
|
+
const { position: positionConfig, size, orient, middleHandlerStyle = {}, startHandlerStyle = {}, endHandlerStyle = {} } = this.attribute;
|
|
24502
24576
|
const { width: widthConfig, height: heightConfig } = size;
|
|
24503
|
-
const middleHandlerSize = (_b = (_a = middleHandlerStyle
|
|
24577
|
+
const middleHandlerSize = (_b = (_a = middleHandlerStyle.background) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 10;
|
|
24504
24578
|
let width;
|
|
24505
24579
|
let height;
|
|
24506
24580
|
let position;
|
|
24507
|
-
if (middleHandlerStyle
|
|
24581
|
+
if (middleHandlerStyle.visible) {
|
|
24508
24582
|
if (this._isHorizontal) {
|
|
24509
24583
|
width = widthConfig;
|
|
24510
24584
|
height = heightConfig - middleHandlerSize;
|
|
@@ -24527,9 +24601,9 @@
|
|
|
24527
24601
|
height = heightConfig;
|
|
24528
24602
|
position = positionConfig;
|
|
24529
24603
|
}
|
|
24530
|
-
const startHandlerSize = (_c = startHandlerStyle
|
|
24531
|
-
const endHandlerSize = (_d = endHandlerStyle
|
|
24532
|
-
if (startHandlerStyle
|
|
24604
|
+
const startHandlerSize = (_c = startHandlerStyle.size) !== null && _c !== void 0 ? _c : (this._isHorizontal ? height : width);
|
|
24605
|
+
const endHandlerSize = (_d = endHandlerStyle.size) !== null && _d !== void 0 ? _d : (this._isHorizontal ? height : width);
|
|
24606
|
+
if (startHandlerStyle.visible) {
|
|
24533
24607
|
if (this._isHorizontal) {
|
|
24534
24608
|
width -= (startHandlerSize + endHandlerSize) / 2;
|
|
24535
24609
|
position = {
|
|
@@ -24553,9 +24627,9 @@
|
|
|
24553
24627
|
return this._layoutAttrFromConfig;
|
|
24554
24628
|
}
|
|
24555
24629
|
render() {
|
|
24556
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t
|
|
24630
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
24557
24631
|
this._layoutAttrFromConfig = null;
|
|
24558
|
-
const { orient, backgroundStyle, backgroundChartStyle, selectedBackgroundStyle, selectedBackgroundChartStyle, middleHandlerStyle, startHandlerStyle, endHandlerStyle, brushSelect } = this.attribute;
|
|
24632
|
+
const { orient, backgroundStyle, backgroundChartStyle = {}, selectedBackgroundStyle = {}, selectedBackgroundChartStyle = {}, middleHandlerStyle = {}, startHandlerStyle = {}, endHandlerStyle = {}, brushSelect } = this.attribute;
|
|
24559
24633
|
const { start, end } = this.state;
|
|
24560
24634
|
const { position, width, height } = this.getLayoutAttrFromConfig();
|
|
24561
24635
|
const startHandlerMinSize = (_a = startHandlerStyle.triggerMinSize) !== null && _a !== void 0 ? _a : 40;
|
|
@@ -24564,8 +24638,8 @@
|
|
|
24564
24638
|
this._container = group;
|
|
24565
24639
|
this._background = group.createOrUpdateChild('background', Object.assign({ x: position.x, y: position.y, width,
|
|
24566
24640
|
height, cursor: brushSelect ? 'crosshair' : 'auto' }, backgroundStyle), 'rect');
|
|
24567
|
-
((_c = backgroundChartStyle
|
|
24568
|
-
((_d = backgroundChartStyle
|
|
24641
|
+
((_c = backgroundChartStyle.line) === null || _c === void 0 ? void 0 : _c.visible) && this.setPreviewAttributes('line', group);
|
|
24642
|
+
((_d = backgroundChartStyle.area) === null || _d === void 0 ? void 0 : _d.visible) && this.setPreviewAttributes('area', group);
|
|
24569
24643
|
brushSelect && this.renderDragMask();
|
|
24570
24644
|
if (this._isHorizontal) {
|
|
24571
24645
|
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');
|
|
@@ -24573,18 +24647,19 @@
|
|
|
24573
24647
|
else {
|
|
24574
24648
|
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');
|
|
24575
24649
|
}
|
|
24576
|
-
((_e = selectedBackgroundChartStyle
|
|
24577
|
-
((_f = selectedBackgroundChartStyle
|
|
24650
|
+
((_e = selectedBackgroundChartStyle.line) === null || _e === void 0 ? void 0 : _e.visible) && this.setSelectedPreviewAttributes('line', group);
|
|
24651
|
+
((_f = selectedBackgroundChartStyle.area) === null || _f === void 0 ? void 0 : _f.visible) && this.setSelectedPreviewAttributes('area', group);
|
|
24578
24652
|
if (this._showText) {
|
|
24579
24653
|
this.renderText();
|
|
24580
24654
|
}
|
|
24581
24655
|
if (this._isHorizontal) {
|
|
24582
|
-
if (middleHandlerStyle
|
|
24583
|
-
|
|
24584
|
-
this.
|
|
24656
|
+
if (middleHandlerStyle.visible) {
|
|
24657
|
+
const middleHandlerBackgroundSize = ((_g = middleHandlerStyle.background) === null || _g === void 0 ? void 0 : _g.size) || 10;
|
|
24658
|
+
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');
|
|
24659
|
+
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');
|
|
24585
24660
|
}
|
|
24586
|
-
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign({ x: position.x + start * width, y: position.y + height / 2, size: height, symbolType: (
|
|
24587
|
-
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign({ x: position.x + end * width, y: position.y + height / 2, size: height, symbolType: (
|
|
24661
|
+
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');
|
|
24662
|
+
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');
|
|
24588
24663
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
|
|
24589
24664
|
const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
|
|
24590
24665
|
const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
|
|
@@ -24593,14 +24668,15 @@
|
|
|
24593
24668
|
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');
|
|
24594
24669
|
}
|
|
24595
24670
|
else {
|
|
24596
|
-
if (middleHandlerStyle
|
|
24597
|
-
|
|
24671
|
+
if (middleHandlerStyle.visible) {
|
|
24672
|
+
const middleHandlerBackgroundSize = ((_o = middleHandlerStyle.background) === null || _o === void 0 ? void 0 : _o.size) || 10;
|
|
24673
|
+
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');
|
|
24598
24674
|
this._middleHandlerSymbol = group.createOrUpdateChild('middleHandlerSymbol', Object.assign({ x: orient === 'left'
|
|
24599
|
-
? position.x -
|
|
24600
|
-
: position.x + width +
|
|
24675
|
+
? position.x - middleHandlerBackgroundSize / 2
|
|
24676
|
+
: 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');
|
|
24601
24677
|
}
|
|
24602
|
-
this._startHandler = group.createOrUpdateChild('startHandler', Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + start * height, size: width, symbolType: (
|
|
24603
|
-
this._endHandler = group.createOrUpdateChild('endHandler', Object.assign(Object.assign({ x: position.x + width / 2, y: position.y + end * height, size: width, symbolType: (
|
|
24678
|
+
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');
|
|
24679
|
+
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');
|
|
24604
24680
|
const startHandlerWidth = Math.max(this._startHandler.AABBBounds.width(), startHandlerMinSize);
|
|
24605
24681
|
const startHandlerHeight = Math.max(this._startHandler.AABBBounds.height(), startHandlerMinSize);
|
|
24606
24682
|
const endHandlerWidth = Math.max(this._endHandler.AABBBounds.width(), endHandlerMinSize);
|
|
@@ -24699,11 +24775,11 @@
|
|
|
24699
24775
|
else {
|
|
24700
24776
|
this._previewArea = this._previewGroup.createOrUpdateChild('previewArea', { curveType: 'basis' }, 'area');
|
|
24701
24777
|
}
|
|
24702
|
-
const { backgroundChartStyle } = this.attribute;
|
|
24778
|
+
const { backgroundChartStyle = {} } = this.attribute;
|
|
24703
24779
|
type === 'line' &&
|
|
24704
|
-
this._previewLine.setAttributes(Object.assign({ points: this.getPreviewLinePoints(), curveType: 'basis', pickable: false }, backgroundChartStyle
|
|
24780
|
+
this._previewLine.setAttributes(Object.assign({ points: this.getPreviewLinePoints(), curveType: 'basis', pickable: false }, backgroundChartStyle.line));
|
|
24705
24781
|
type === 'area' &&
|
|
24706
|
-
this._previewArea.setAttributes(Object.assign({ points: this.getPreviewAreaPoints(), curveType: 'basis', pickable: false }, backgroundChartStyle
|
|
24782
|
+
this._previewArea.setAttributes(Object.assign({ points: this.getPreviewAreaPoints(), curveType: 'basis', pickable: false }, backgroundChartStyle.area));
|
|
24707
24783
|
}
|
|
24708
24784
|
setSelectedPreviewAttributes(type, group) {
|
|
24709
24785
|
if (!this._selectedPreviewGroupClip) {
|
|
@@ -24716,7 +24792,7 @@
|
|
|
24716
24792
|
else {
|
|
24717
24793
|
this._selectedPreviewArea = this._selectedPreviewGroup.createOrUpdateChild('selectedPreviewArea', { curveType: 'basis' }, 'area');
|
|
24718
24794
|
}
|
|
24719
|
-
const { selectedBackgroundChartStyle } = this.attribute;
|
|
24795
|
+
const { selectedBackgroundChartStyle = {} } = this.attribute;
|
|
24720
24796
|
const { start, end } = this.state;
|
|
24721
24797
|
const { position, width, height } = this.getLayoutAttrFromConfig();
|
|
24722
24798
|
this._selectedPreviewGroupClip.setAttributes({
|
|
@@ -24735,9 +24811,9 @@
|
|
|
24735
24811
|
pickable: false
|
|
24736
24812
|
});
|
|
24737
24813
|
type === 'line' &&
|
|
24738
|
-
this._selectedPreviewLine.setAttributes(Object.assign({ points: this.getPreviewLinePoints(), curveType: 'basis', pickable: false }, selectedBackgroundChartStyle
|
|
24814
|
+
this._selectedPreviewLine.setAttributes(Object.assign({ points: this.getPreviewLinePoints(), curveType: 'basis', pickable: false }, selectedBackgroundChartStyle.line));
|
|
24739
24815
|
type === 'area' &&
|
|
24740
|
-
this._selectedPreviewArea.setAttributes(Object.assign({ points: this.getPreviewAreaPoints(), curveType: 'basis', pickable: false }, selectedBackgroundChartStyle
|
|
24816
|
+
this._selectedPreviewArea.setAttributes(Object.assign({ points: this.getPreviewAreaPoints(), curveType: 'basis', pickable: false }, selectedBackgroundChartStyle.area));
|
|
24741
24817
|
}
|
|
24742
24818
|
maybeAddLabel(container, attributes, name) {
|
|
24743
24819
|
let labelShape = this.find(node => node.name === name, true);
|
|
@@ -24785,9 +24861,9 @@
|
|
|
24785
24861
|
}
|
|
24786
24862
|
getMiddleHandlerSize() {
|
|
24787
24863
|
var _a, _b, _c, _d;
|
|
24788
|
-
const { middleHandlerStyle } = this.attribute;
|
|
24789
|
-
const middleHandlerRectSize = (_b = (_a = middleHandlerStyle
|
|
24790
|
-
const middleHandlerSymbolSize = (_d = (_c = middleHandlerStyle
|
|
24864
|
+
const { middleHandlerStyle = {} } = this.attribute;
|
|
24865
|
+
const middleHandlerRectSize = (_b = (_a = middleHandlerStyle.background) === null || _a === void 0 ? void 0 : _a.size) !== null && _b !== void 0 ? _b : 10;
|
|
24866
|
+
const middleHandlerSymbolSize = (_d = (_c = middleHandlerStyle.icon) === null || _c === void 0 ? void 0 : _c.size) !== null && _d !== void 0 ? _d : 10;
|
|
24791
24867
|
return Math.max(middleHandlerRectSize, ...vutils.array(middleHandlerSymbolSize));
|
|
24792
24868
|
}
|
|
24793
24869
|
setPreviewPointsX(callback) {
|
|
@@ -24849,13 +24925,13 @@
|
|
|
24849
24925
|
}
|
|
24850
24926
|
_initContainer() {
|
|
24851
24927
|
var _a, _b;
|
|
24852
|
-
const { limitRect, clipInRange } = this.attribute;
|
|
24928
|
+
const { limitRect = {}, clipInRange } = this.attribute;
|
|
24853
24929
|
let group;
|
|
24854
24930
|
if (clipInRange) {
|
|
24855
24931
|
const groupClip = graphicCreator.group(Object.assign(Object.assign({}, limitRect), { clip: true, pickable: false }));
|
|
24856
24932
|
group = graphicCreator.group({
|
|
24857
|
-
x: -((_a = limitRect
|
|
24858
|
-
y: -((_b = limitRect
|
|
24933
|
+
x: -((_a = limitRect.x) !== null && _a !== void 0 ? _a : 0),
|
|
24934
|
+
y: -((_b = limitRect.y) !== null && _b !== void 0 ? _b : 0),
|
|
24859
24935
|
pickable: false
|
|
24860
24936
|
});
|
|
24861
24937
|
groupClip.add(group);
|
|
@@ -24874,12 +24950,14 @@
|
|
|
24874
24950
|
this._container = group;
|
|
24875
24951
|
}
|
|
24876
24952
|
_updateContainer() {
|
|
24877
|
-
var _a, _b
|
|
24878
|
-
const { limitRect, clipInRange } = this.attribute;
|
|
24879
|
-
(
|
|
24953
|
+
var _a, _b;
|
|
24954
|
+
const { limitRect = {}, clipInRange } = this.attribute;
|
|
24955
|
+
if (this._containerClip) {
|
|
24956
|
+
this._containerClip.setAttributes(Object.assign({}, limitRect));
|
|
24957
|
+
}
|
|
24880
24958
|
this._container.setAttributes({
|
|
24881
|
-
x: clipInRange ? -((
|
|
24882
|
-
y: clipInRange ? -((
|
|
24959
|
+
x: clipInRange ? -((_a = limitRect.x) !== null && _a !== void 0 ? _a : 0) : 0,
|
|
24960
|
+
y: clipInRange ? -((_b = limitRect.y) !== null && _b !== void 0 ? _b : 0) : 0
|
|
24883
24961
|
});
|
|
24884
24962
|
}
|
|
24885
24963
|
render() {
|
|
@@ -25218,7 +25296,7 @@
|
|
|
25218
25296
|
y: points[points.length - 1].y + labelOffsetY
|
|
25219
25297
|
};
|
|
25220
25298
|
}
|
|
25221
|
-
this._label.setAttributes(Object.assign(Object.assign({}, labelPoint), { angle: label.autoRotate ? labelAngle + ((_b = label
|
|
25299
|
+
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) }));
|
|
25222
25300
|
if (limitRect && confine) {
|
|
25223
25301
|
const { x, y, width, height } = limitRect;
|
|
25224
25302
|
limitShapeInBounds(this._label, {
|
|
@@ -25251,18 +25329,21 @@
|
|
|
25251
25329
|
this.setLabelPos();
|
|
25252
25330
|
}
|
|
25253
25331
|
updateMarker() {
|
|
25254
|
-
var _a, _b;
|
|
25255
25332
|
const { points, startSymbol, endSymbol, label, lineStyle, mainSegmentIndex, multiSegment } = this
|
|
25256
25333
|
.attribute;
|
|
25257
|
-
(
|
|
25258
|
-
|
|
25259
|
-
|
|
25260
|
-
|
|
25261
|
-
|
|
25262
|
-
|
|
25263
|
-
|
|
25264
|
-
|
|
25265
|
-
|
|
25334
|
+
if (this._line) {
|
|
25335
|
+
this._line.setAttributes({
|
|
25336
|
+
points,
|
|
25337
|
+
startSymbol,
|
|
25338
|
+
endSymbol,
|
|
25339
|
+
lineStyle,
|
|
25340
|
+
mainSegmentIndex,
|
|
25341
|
+
multiSegment
|
|
25342
|
+
});
|
|
25343
|
+
}
|
|
25344
|
+
if (this._label) {
|
|
25345
|
+
this._label.setAttributes(Object.assign({ dx: 0, dy: 0 }, label));
|
|
25346
|
+
}
|
|
25266
25347
|
this.setLabelPos();
|
|
25267
25348
|
}
|
|
25268
25349
|
isValidPoints() {
|
|
@@ -25321,11 +25402,11 @@
|
|
|
25321
25402
|
setLabelPos() {
|
|
25322
25403
|
var _a;
|
|
25323
25404
|
if (this._label && this._area) {
|
|
25324
|
-
const { label } = this.attribute;
|
|
25325
|
-
const labelPosition = (_a = label
|
|
25405
|
+
const { label = {} } = this.attribute;
|
|
25406
|
+
const labelPosition = (_a = label.position) !== null && _a !== void 0 ? _a : 'middle';
|
|
25326
25407
|
const labelPoint = this._getPositionByDirection(this._area, labelPosition);
|
|
25327
25408
|
this._label.setAttributes(Object.assign(Object.assign({}, labelPoint), { textStyle: Object.assign(Object.assign({}, DEFAULT_MARK_AREA_TEXT_STYLE_MAP[labelPosition]), label.textStyle) }));
|
|
25328
|
-
if (this.attribute.limitRect &&
|
|
25409
|
+
if (this.attribute.limitRect && label.confine) {
|
|
25329
25410
|
const { x, y, width, height } = this.attribute.limitRect;
|
|
25330
25411
|
limitShapeInBounds(this._label, {
|
|
25331
25412
|
x1: x,
|
|
@@ -25349,10 +25430,13 @@
|
|
|
25349
25430
|
this.setLabelPos();
|
|
25350
25431
|
}
|
|
25351
25432
|
updateMarker() {
|
|
25352
|
-
var _a, _b;
|
|
25353
25433
|
const { points, label, areaStyle } = this.attribute;
|
|
25354
|
-
(
|
|
25355
|
-
|
|
25434
|
+
if (this._area) {
|
|
25435
|
+
this._area.setAttributes(Object.assign({ points: points }, areaStyle));
|
|
25436
|
+
}
|
|
25437
|
+
if (this._area) {
|
|
25438
|
+
this._label.setAttributes(Object.assign({ dx: 0, dy: 0 }, label));
|
|
25439
|
+
}
|
|
25356
25440
|
this.setLabelPos();
|
|
25357
25441
|
}
|
|
25358
25442
|
isValidPoints() {
|
|
@@ -25378,23 +25462,23 @@
|
|
|
25378
25462
|
if (!item) {
|
|
25379
25463
|
return;
|
|
25380
25464
|
}
|
|
25381
|
-
const { autoRotate = true, refX = 0, refY = 0, refAngle = 0, textStyle, richTextStyle, imageStyle, position = exports.IMarkPointItemPosition.middle } = itemContent;
|
|
25465
|
+
const { autoRotate = true, refX = 0, refY = 0, refAngle = 0, textStyle = {}, richTextStyle = {}, imageStyle = {}, position = exports.IMarkPointItemPosition.middle } = itemContent;
|
|
25382
25466
|
const itemAngle = ((_a = this._line) === null || _a === void 0 ? void 0 : _a.getEndAngle()) || 0;
|
|
25383
25467
|
const itemOffsetX = refX * Math.cos(itemAngle) + refY * Math.cos(itemAngle - Math.PI / 2);
|
|
25384
25468
|
const itemOffsetY = refX * Math.sin(itemAngle) + refY * Math.sin(itemAngle - Math.PI / 2);
|
|
25385
25469
|
if (itemType === 'text') {
|
|
25386
|
-
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
|
|
25470
|
+
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) }));
|
|
25387
25471
|
}
|
|
25388
25472
|
else if (itemType === 'richText') {
|
|
25389
25473
|
item.setAttributes({
|
|
25390
|
-
dx: this.getItemDx(item, position, richTextStyle) + (
|
|
25391
|
-
dy: this.getItemDy(item, position, richTextStyle) + (
|
|
25474
|
+
dx: this.getItemDx(item, position, richTextStyle) + (richTextStyle.dx || 0),
|
|
25475
|
+
dy: this.getItemDy(item, position, richTextStyle) + (richTextStyle.dy || 0)
|
|
25392
25476
|
});
|
|
25393
25477
|
}
|
|
25394
25478
|
else if (itemType === 'image') {
|
|
25395
25479
|
item.setAttributes({
|
|
25396
|
-
dx: this.getItemDx(item, position, imageStyle) + (
|
|
25397
|
-
dy: this.getItemDy(item, position, imageStyle) + (
|
|
25480
|
+
dx: this.getItemDx(item, position, imageStyle) + (imageStyle.dx || 0),
|
|
25481
|
+
dy: this.getItemDy(item, position, imageStyle) + (imageStyle.dy || 0)
|
|
25398
25482
|
});
|
|
25399
25483
|
}
|
|
25400
25484
|
item.setAttributes({
|
|
@@ -25485,16 +25569,17 @@
|
|
|
25485
25569
|
return points;
|
|
25486
25570
|
}
|
|
25487
25571
|
setItemLineAttr(itemLine, position, itemPosition, visible) {
|
|
25488
|
-
|
|
25489
|
-
|
|
25490
|
-
|
|
25491
|
-
|
|
25492
|
-
|
|
25493
|
-
|
|
25494
|
-
|
|
25495
|
-
|
|
25496
|
-
|
|
25497
|
-
|
|
25572
|
+
if (this._line) {
|
|
25573
|
+
const { startSymbol, endSymbol, lineStyle } = itemLine;
|
|
25574
|
+
const points = this.getItemLineAttr(itemLine, position, itemPosition);
|
|
25575
|
+
this._line.setAttributes({
|
|
25576
|
+
points,
|
|
25577
|
+
startSymbol,
|
|
25578
|
+
endSymbol,
|
|
25579
|
+
lineStyle,
|
|
25580
|
+
visible
|
|
25581
|
+
});
|
|
25582
|
+
}
|
|
25498
25583
|
}
|
|
25499
25584
|
getDecorativeLineAttr(itemLine, itemPosition) {
|
|
25500
25585
|
var _a;
|
|
@@ -25512,26 +25597,27 @@
|
|
|
25512
25597
|
};
|
|
25513
25598
|
}
|
|
25514
25599
|
setDecorativeLineAttr(itemLine, itemPosition, visible) {
|
|
25515
|
-
|
|
25516
|
-
|
|
25517
|
-
|
|
25518
|
-
|
|
25519
|
-
|
|
25520
|
-
|
|
25521
|
-
|
|
25522
|
-
|
|
25523
|
-
|
|
25524
|
-
|
|
25525
|
-
|
|
25526
|
-
|
|
25527
|
-
|
|
25600
|
+
if (this._decorativeLine) {
|
|
25601
|
+
const { lineStyle } = itemLine;
|
|
25602
|
+
const { startPointOffsetX, startPointOffsetY, endPointOffsetX, endPointOffsetY } = this.getDecorativeLineAttr(itemLine, itemPosition);
|
|
25603
|
+
this._decorativeLine.setAttributes(Object.assign(Object.assign({ points: [
|
|
25604
|
+
{
|
|
25605
|
+
x: itemPosition.x + startPointOffsetX,
|
|
25606
|
+
y: itemPosition.y + startPointOffsetY
|
|
25607
|
+
},
|
|
25608
|
+
{
|
|
25609
|
+
x: itemPosition.x + endPointOffsetX,
|
|
25610
|
+
y: itemPosition.y + endPointOffsetY
|
|
25611
|
+
}
|
|
25612
|
+
] }, lineStyle), { visible }));
|
|
25613
|
+
}
|
|
25528
25614
|
}
|
|
25529
25615
|
initMarker(container) {
|
|
25530
25616
|
var _a;
|
|
25531
|
-
const { position, itemLine, itemContent } = this.attribute;
|
|
25617
|
+
const { position, itemLine = {}, itemContent = {} } = this.attribute;
|
|
25532
25618
|
const itemPosition = {
|
|
25533
|
-
x: position.x + (
|
|
25534
|
-
y: position.y + (
|
|
25619
|
+
x: position.x + (itemContent.offsetX || 0),
|
|
25620
|
+
y: position.y + (itemContent.offsetY || 0)
|
|
25535
25621
|
};
|
|
25536
25622
|
const line = new Segment({
|
|
25537
25623
|
points: [],
|
|
@@ -25546,22 +25632,22 @@
|
|
|
25546
25632
|
decorativeLine.name = 'mark-point-decorativeLine';
|
|
25547
25633
|
this._decorativeLine = decorativeLine;
|
|
25548
25634
|
container.add(decorativeLine);
|
|
25549
|
-
this.setItemLineAttr(itemLine, position, itemPosition, itemLine
|
|
25550
|
-
this.setDecorativeLineAttr(itemLine, itemPosition, (_a = itemLine
|
|
25635
|
+
this.setItemLineAttr(itemLine, position, itemPosition, itemLine.visible);
|
|
25636
|
+
this.setDecorativeLineAttr(itemLine, itemPosition, (_a = itemLine.decorativeLine) === null || _a === void 0 ? void 0 : _a.visible);
|
|
25551
25637
|
const item = this.initItem(itemContent, itemPosition);
|
|
25552
25638
|
this._item = item;
|
|
25553
25639
|
container.add(item);
|
|
25554
25640
|
}
|
|
25555
25641
|
updateMarker() {
|
|
25556
25642
|
var _a;
|
|
25557
|
-
const { position, itemLine, itemContent } = this.attribute;
|
|
25643
|
+
const { position, itemLine = {}, itemContent = {} } = this.attribute;
|
|
25558
25644
|
const { type = 'text' } = itemContent;
|
|
25559
25645
|
const itemPosition = {
|
|
25560
|
-
x: position.x + (
|
|
25561
|
-
y: position.y + (
|
|
25646
|
+
x: position.x + (itemContent.offsetX || 0),
|
|
25647
|
+
y: position.y + (itemContent.offsetY || 0)
|
|
25562
25648
|
};
|
|
25563
|
-
this.setItemLineAttr(itemLine, position, itemPosition, itemLine
|
|
25564
|
-
this.setDecorativeLineAttr(itemLine, itemPosition, (_a = itemLine
|
|
25649
|
+
this.setItemLineAttr(itemLine, position, itemPosition, itemLine.visible);
|
|
25650
|
+
this.setDecorativeLineAttr(itemLine, itemPosition, (_a = itemLine.decorativeLine) === null || _a === void 0 ? void 0 : _a.visible);
|
|
25565
25651
|
this.setItemAttributes(this._item, itemContent, itemPosition, type);
|
|
25566
25652
|
}
|
|
25567
25653
|
isValidPoints() {
|
|
@@ -25892,9 +25978,8 @@
|
|
|
25892
25978
|
this._itemHeight = 0;
|
|
25893
25979
|
this._itemMaxWidth = 0;
|
|
25894
25980
|
this._onHover = (e) => {
|
|
25895
|
-
var _a;
|
|
25896
25981
|
const target = e.target;
|
|
25897
|
-
if (
|
|
25982
|
+
if (target && target.name && target.name.startsWith(exports.LEGEND_ELEMENT_NAME.item)) {
|
|
25898
25983
|
const legendItem = target.delegate;
|
|
25899
25984
|
if (this._lastActiveItem) {
|
|
25900
25985
|
if (this._lastActiveItem.id === legendItem.id) {
|
|
@@ -25916,15 +26001,15 @@
|
|
|
25916
26001
|
}
|
|
25917
26002
|
};
|
|
25918
26003
|
this._onClick = (e) => {
|
|
25919
|
-
var _a, _b, _c, _d
|
|
26004
|
+
var _a, _b, _c, _d;
|
|
25920
26005
|
const target = e.target;
|
|
25921
|
-
if (
|
|
26006
|
+
if (target && target.name && target.name.startsWith(exports.LEGEND_ELEMENT_NAME.item)) {
|
|
25922
26007
|
const legendItem = target.delegate;
|
|
25923
26008
|
if (target.name === exports.LEGEND_ELEMENT_NAME.focus) {
|
|
25924
26009
|
const isFocusSelected = legendItem.hasState(exports.LegendStateValue.focus);
|
|
25925
26010
|
legendItem.toggleState(exports.LegendStateValue.focus);
|
|
25926
26011
|
if (isFocusSelected) {
|
|
25927
|
-
(
|
|
26012
|
+
(_a = this._itemsContainer) === null || _a === void 0 ? void 0 : _a.getChildren().forEach(item => {
|
|
25928
26013
|
this._removeLegendItemState(item, [exports.LegendStateValue.unSelected, exports.LegendStateValue.unSelectedHover, exports.LegendStateValue.focus], e);
|
|
25929
26014
|
this._setLegendItemState(item, exports.LegendStateValue.selected, e);
|
|
25930
26015
|
});
|
|
@@ -25932,7 +26017,7 @@
|
|
|
25932
26017
|
else {
|
|
25933
26018
|
this._setLegendItemState(legendItem, exports.LegendStateValue.selected, e);
|
|
25934
26019
|
this._removeLegendItemState(legendItem, [exports.LegendStateValue.unSelected, exports.LegendStateValue.unSelectedHover], e);
|
|
25935
|
-
(
|
|
26020
|
+
(_b = this._itemsContainer) === null || _b === void 0 ? void 0 : _b.getChildren().forEach(item => {
|
|
25936
26021
|
if (legendItem !== item) {
|
|
25937
26022
|
this._removeLegendItemState(item, [exports.LegendStateValue.selected, exports.LegendStateValue.selectedHover, exports.LegendStateValue.focus], e);
|
|
25938
26023
|
this._setLegendItemState(item, exports.LegendStateValue.unSelected, e);
|
|
@@ -25941,7 +26026,7 @@
|
|
|
25941
26026
|
}
|
|
25942
26027
|
}
|
|
25943
26028
|
else {
|
|
25944
|
-
(
|
|
26029
|
+
(_c = this._itemsContainer) === null || _c === void 0 ? void 0 : _c.getChildren().forEach(item => {
|
|
25945
26030
|
item.removeState(exports.LegendStateValue.focus);
|
|
25946
26031
|
});
|
|
25947
26032
|
const { selectMode = 'multiple', allowAllCanceled = true } = this.attribute;
|
|
@@ -25964,7 +26049,7 @@
|
|
|
25964
26049
|
else {
|
|
25965
26050
|
this._setLegendItemState(legendItem, exports.LegendStateValue.selected, e);
|
|
25966
26051
|
this._removeLegendItemState(legendItem, [exports.LegendStateValue.unSelected, exports.LegendStateValue.unSelectedHover], e);
|
|
25967
|
-
(
|
|
26052
|
+
(_d = this._itemsContainer) === null || _d === void 0 ? void 0 : _d.getChildren().forEach(item => {
|
|
25968
26053
|
if (legendItem !== item) {
|
|
25969
26054
|
this._removeLegendItemState(item, [exports.LegendStateValue.selected, exports.LegendStateValue.selectedHover], e);
|
|
25970
26055
|
this._setLegendItemState(item, exports.LegendStateValue.unSelected, e);
|
|
@@ -26142,7 +26227,7 @@
|
|
|
26142
26227
|
let focusStartX = 0;
|
|
26143
26228
|
let shapeSize = 0;
|
|
26144
26229
|
let shapeSpace = 0;
|
|
26145
|
-
if (
|
|
26230
|
+
if (shapeAttr && shapeAttr.visible !== false) {
|
|
26146
26231
|
shapeSize = vutils.get(shapeStyle, 'style.size', DEFAULT_SHAPE_SIZE);
|
|
26147
26232
|
shapeSpace = vutils.get(shapeAttr, 'space', DEFAULT_SHAPE_SPACE);
|
|
26148
26233
|
const itemShape = graphicCreator.symbol(Object.assign(Object.assign({ x: 0, y: 0, symbolType: 'circle', strokeBoundsBuffer: 0 }, shape), shapeStyle.style));
|
|
@@ -26780,15 +26865,16 @@
|
|
|
26780
26865
|
const originPos = (this._isHorizontal ? endHandler.attribute.x : endHandler.attribute.y);
|
|
26781
26866
|
const newPos = vutils.clamp(originPos + delta, trackLen, railLen);
|
|
26782
26867
|
const currentValue = (newPos / railLen) * (max - min) + min;
|
|
26868
|
+
const startHandlerAttribute = startHandler === null || startHandler === void 0 ? void 0 : startHandler.attribute;
|
|
26783
26869
|
this._updateHandler(endHandler, newPos, currentValue);
|
|
26784
26870
|
this._track.setAttributes(this._isHorizontal
|
|
26785
26871
|
? {
|
|
26786
|
-
x: Math.min(
|
|
26787
|
-
width: Math.abs(
|
|
26872
|
+
x: Math.min(startHandlerAttribute.x, endHandler.attribute.x),
|
|
26873
|
+
width: Math.abs(startHandlerAttribute.x - endHandler.attribute.x)
|
|
26788
26874
|
}
|
|
26789
26875
|
: {
|
|
26790
|
-
y: Math.min(
|
|
26791
|
-
height: Math.abs(
|
|
26876
|
+
y: Math.min(startHandlerAttribute.y, endHandler.attribute.y),
|
|
26877
|
+
height: Math.abs(startHandlerAttribute.y - endHandler.attribute.y)
|
|
26792
26878
|
});
|
|
26793
26879
|
}
|
|
26794
26880
|
this._prePos = currentPos;
|
|
@@ -27044,7 +27130,7 @@
|
|
|
27044
27130
|
const handlerStart = max === min ? (position === 'start' ? 0 : railLen) : ((value - min) / (max - min)) * railLen;
|
|
27045
27131
|
const textSpace = (_a = handlerText.space) !== null && _a !== void 0 ? _a : 4;
|
|
27046
27132
|
const textStyle = {
|
|
27047
|
-
text:
|
|
27133
|
+
text: handlerText.formatter ? handlerText.formatter(value) : value.toFixed((_b = handlerText.precision) !== null && _b !== void 0 ? _b : 0),
|
|
27048
27134
|
lineHeight: (_c = handlerText.style) === null || _c === void 0 ? void 0 : _c.lineHeight,
|
|
27049
27135
|
cursor: slidable === false ? 'default' : getDefaultCursor(isHorizontal)
|
|
27050
27136
|
};
|
|
@@ -27143,9 +27229,9 @@
|
|
|
27143
27229
|
handler.setAttribute(isHorizontal ? 'x' : 'y', position);
|
|
27144
27230
|
const updateHandlerText = handler.name === exports.SLIDER_ELEMENT_NAME.startHandler ? this._startHandlerText : this._endHandlerText;
|
|
27145
27231
|
if (updateHandlerText) {
|
|
27146
|
-
const { handlerText } = this.attribute;
|
|
27147
|
-
updateHandlerText
|
|
27148
|
-
text:
|
|
27232
|
+
const { handlerText = {} } = this.attribute;
|
|
27233
|
+
updateHandlerText.setAttributes({
|
|
27234
|
+
text: handlerText.formatter ? handlerText.formatter(value) : value.toFixed((_a = handlerText.precision) !== null && _a !== void 0 ? _a : 0),
|
|
27149
27235
|
[isHorizontal ? 'x' : 'y']: position
|
|
27150
27236
|
});
|
|
27151
27237
|
}
|
|
@@ -27161,16 +27247,14 @@
|
|
|
27161
27247
|
_updateHandlerText(handlerText, position, value) {
|
|
27162
27248
|
var _a;
|
|
27163
27249
|
const isHorizontal = this._isHorizontal;
|
|
27164
|
-
const { handlerText: handlerTextAttr } = this.attribute;
|
|
27250
|
+
const { handlerText: handlerTextAttr = {} } = this.attribute;
|
|
27165
27251
|
handlerText.setAttributes({
|
|
27166
27252
|
[isHorizontal ? 'x' : 'y']: position,
|
|
27167
|
-
text: (handlerTextAttr
|
|
27168
|
-
? handlerTextAttr.formatter(value)
|
|
27169
|
-
: value.toFixed((_a = handlerTextAttr === null || handlerTextAttr === void 0 ? void 0 : handlerTextAttr.precision) !== null && _a !== void 0 ? _a : 0)
|
|
27253
|
+
text: handlerTextAttr.formatter ? handlerTextAttr.formatter(value) : value.toFixed((_a = handlerTextAttr.precision) !== null && _a !== void 0 ? _a : 0)
|
|
27170
27254
|
});
|
|
27171
27255
|
const updateHandler = handlerText.name === exports.SLIDER_ELEMENT_NAME.startHandlerText ? this._startHandler : this._endHandler;
|
|
27172
27256
|
if (updateHandler) {
|
|
27173
|
-
updateHandler
|
|
27257
|
+
updateHandler.setAttributes({
|
|
27174
27258
|
[isHorizontal ? 'x' : 'y']: position
|
|
27175
27259
|
});
|
|
27176
27260
|
}
|
|
@@ -27594,46 +27678,46 @@
|
|
|
27594
27678
|
this.name = 'title';
|
|
27595
27679
|
}
|
|
27596
27680
|
render() {
|
|
27597
|
-
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
|
|
27598
|
-
const { textType, text, subtextType, textStyle, subtext, subtextStyle, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
27681
|
+
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;
|
|
27682
|
+
const { textType, text, subtextType, textStyle = {}, subtext, subtextStyle = {}, width, height, minWidth, maxWidth, minHeight, maxHeight, align, verticalAlign, padding = 0 } = this.attribute;
|
|
27599
27683
|
const parsedPadding = vutils.normalizePadding(padding);
|
|
27600
27684
|
const group = this.createOrUpdateChild('title-container', { x: parsedPadding[3], y: parsedPadding[0], zIndex: 1 }, 'group');
|
|
27601
|
-
if (
|
|
27685
|
+
if (this.attribute.visible !== false && textStyle.visible !== false) {
|
|
27602
27686
|
if (textType === 'rich' || vutils.isValid(textStyle.character)) {
|
|
27603
|
-
const attr = Object.assign({ x: (
|
|
27687
|
+
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);
|
|
27604
27688
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
27605
27689
|
}
|
|
27606
27690
|
else if (textType === 'html') {
|
|
27607
|
-
const attr = Object.assign({ html: Object.assign(Object.assign({ dom: text }, DEFAULT_HTML_TEXT_SPEC), textStyle), x: (
|
|
27691
|
+
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);
|
|
27608
27692
|
this._mainTitle = group.createOrUpdateChild('mainTitle', attr, 'richtext');
|
|
27609
27693
|
}
|
|
27610
27694
|
else if (vutils.isValid(text)) {
|
|
27611
|
-
this._mainTitle = group.createOrUpdateChild('mainTitle', Object.assign(Object.assign({ text: [text] }, textStyle), { maxLineWidth: (
|
|
27695
|
+
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');
|
|
27612
27696
|
}
|
|
27613
27697
|
}
|
|
27614
|
-
const maintextHeight = this._mainTitle ?
|
|
27615
|
-
const maintextWidth = this._mainTitle ?
|
|
27616
|
-
if (
|
|
27698
|
+
const maintextHeight = this._mainTitle ? this._mainTitle.AABBBounds.height() : 0;
|
|
27699
|
+
const maintextWidth = this._mainTitle ? this._mainTitle.AABBBounds.width() : 0;
|
|
27700
|
+
if (this.attribute.visible !== false && subtextStyle.visible !== false) {
|
|
27617
27701
|
if (subtextType === 'rich' || vutils.isValid(subtextStyle.character)) {
|
|
27618
|
-
const attr = Object.assign({ x: (
|
|
27702
|
+
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);
|
|
27619
27703
|
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
27620
27704
|
}
|
|
27621
27705
|
else if (subtextType === 'html') {
|
|
27622
|
-
const attr = Object.assign({ html: Object.assign(Object.assign({ dom: subtext }, DEFAULT_HTML_TEXT_SPEC), subtextStyle), x: (
|
|
27706
|
+
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);
|
|
27623
27707
|
this._subTitle = group.createOrUpdateChild('subTitle', attr, 'richtext');
|
|
27624
27708
|
}
|
|
27625
27709
|
else if (vutils.isValid(subtext)) {
|
|
27626
|
-
this._subTitle = group.createOrUpdateChild('subTitle', Object.assign(Object.assign({ text: [subtext] }, subtextStyle), { maxLineWidth: (
|
|
27710
|
+
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');
|
|
27627
27711
|
}
|
|
27628
27712
|
}
|
|
27629
|
-
const subtextHeight = this._subTitle ?
|
|
27630
|
-
const subtextWidth = this._subTitle ?
|
|
27713
|
+
const subtextHeight = this._subTitle ? this._subTitle.AABBBounds.height() : 0;
|
|
27714
|
+
const subtextWidth = this._subTitle ? this._subTitle.AABBBounds.width() : 0;
|
|
27631
27715
|
let titleWidth = Math.max(maintextWidth, subtextWidth);
|
|
27632
|
-
let titleHeight = maintextHeight + ((
|
|
27716
|
+
let titleHeight = maintextHeight + ((_14 = subtextStyle.height) !== null && _14 !== void 0 ? _14 : subtextHeight);
|
|
27633
27717
|
if (vutils.isValid(width)) {
|
|
27634
27718
|
titleWidth = width;
|
|
27635
|
-
|
|
27636
|
-
|
|
27719
|
+
this._mainTitle && this._mainTitle.setAttribute('maxLineWidth', width);
|
|
27720
|
+
this._subTitle && this._subTitle.setAttribute('maxLineWidth', width);
|
|
27637
27721
|
}
|
|
27638
27722
|
if (vutils.isValid(height)) {
|
|
27639
27723
|
titleHeight = height;
|
|
@@ -27642,10 +27726,10 @@
|
|
|
27642
27726
|
titleWidth = minWidth;
|
|
27643
27727
|
}
|
|
27644
27728
|
if (vutils.isValid(maxWidth)) {
|
|
27645
|
-
|
|
27646
|
-
|
|
27647
|
-
|
|
27648
|
-
|
|
27729
|
+
this._mainTitle && this._mainTitle.setAttribute('maxLineWidth', maxWidth);
|
|
27730
|
+
this._subTitle && this._subTitle.setAttribute('maxLineWidth', maxWidth);
|
|
27731
|
+
this._mainTitle && this._mainTitle.setAttribute('maxWidth', maxWidth);
|
|
27732
|
+
this._subTitle && this._subTitle.setAttribute('maxWidth', maxWidth);
|
|
27649
27733
|
if (titleWidth > maxWidth) {
|
|
27650
27734
|
titleWidth = maxWidth;
|
|
27651
27735
|
}
|
|
@@ -27654,8 +27738,8 @@
|
|
|
27654
27738
|
titleHeight = minHeight;
|
|
27655
27739
|
}
|
|
27656
27740
|
if (vutils.isValid(maxHeight)) {
|
|
27657
|
-
|
|
27658
|
-
|
|
27741
|
+
this._mainTitle && this._mainTitle.setAttribute('maxHeight', maxHeight);
|
|
27742
|
+
this._subTitle && this._subTitle.setAttribute('maxHeight', maxHeight - maintextHeight);
|
|
27659
27743
|
if (titleHeight > maxHeight) {
|
|
27660
27744
|
titleHeight = maxHeight;
|
|
27661
27745
|
}
|
|
@@ -27663,69 +27747,73 @@
|
|
|
27663
27747
|
group.attribute.width = titleWidth;
|
|
27664
27748
|
group.attribute.height = titleHeight;
|
|
27665
27749
|
group.attribute.boundsPadding = parsedPadding;
|
|
27666
|
-
if (
|
|
27667
|
-
|
|
27668
|
-
|
|
27669
|
-
|
|
27670
|
-
(
|
|
27671
|
-
|
|
27672
|
-
|
|
27673
|
-
|
|
27674
|
-
|
|
27675
|
-
|
|
27676
|
-
|
|
27677
|
-
|
|
27678
|
-
|
|
27679
|
-
|
|
27680
|
-
|
|
27681
|
-
|
|
27682
|
-
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign)) {
|
|
27683
|
-
const mainTitleVerticalAlign = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.verticalAlign : verticalAlign;
|
|
27684
|
-
const mainTitleHeight = (textStyle === null || textStyle === void 0 ? void 0 : textStyle.height) ? textStyle === null || textStyle === void 0 ? void 0 : textStyle.height : titleHeight;
|
|
27685
|
-
if (mainTitleVerticalAlign === 'top') {
|
|
27686
|
-
(_36 = this._mainTitle) === null || _36 === void 0 ? void 0 : _36.setAttribute('y', 0);
|
|
27687
|
-
(_37 = this._mainTitle) === null || _37 === void 0 ? void 0 : _37.setAttribute('textBaseline', 'top');
|
|
27688
|
-
}
|
|
27689
|
-
else if (mainTitleVerticalAlign === 'middle') {
|
|
27690
|
-
(_38 = this._mainTitle) === null || _38 === void 0 ? void 0 : _38.setAttribute('y', mainTitleHeight / 2);
|
|
27691
|
-
(_39 = this._mainTitle) === null || _39 === void 0 ? void 0 : _39.setAttribute('textBaseline', 'middle');
|
|
27692
|
-
}
|
|
27693
|
-
else if (mainTitleVerticalAlign === 'bottom') {
|
|
27694
|
-
(_40 = this._mainTitle) === null || _40 === void 0 ? void 0 : _40.setAttribute('y', mainTitleHeight);
|
|
27695
|
-
(_41 = this._mainTitle) === null || _41 === void 0 ? void 0 : _41.setAttribute('textBaseline', 'bottom');
|
|
27696
|
-
}
|
|
27697
|
-
}
|
|
27698
|
-
if (vutils.isValid(align) || vutils.isValid(subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align)) {
|
|
27699
|
-
const subTitleAlign = (subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align) ? subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.align : align;
|
|
27700
|
-
const subTitleWidth = (_42 = subtextStyle === null || subtextStyle === void 0 ? void 0 : subtextStyle.width) !== null && _42 !== void 0 ? _42 : subtextWidth;
|
|
27701
|
-
if (subTitleAlign === 'left') {
|
|
27702
|
-
(_43 = this._subTitle) === null || _43 === void 0 ? void 0 : _43.setAttribute('x', 0);
|
|
27703
|
-
(_44 = this._subTitle) === null || _44 === void 0 ? void 0 : _44.setAttribute('textAlign', 'left');
|
|
27704
|
-
}
|
|
27705
|
-
else if (subTitleAlign === 'center') {
|
|
27706
|
-
(_45 = this._subTitle) === null || _45 === void 0 ? void 0 : _45.setAttribute('x', subTitleWidth / 2);
|
|
27707
|
-
(_46 = this._subTitle) === null || _46 === void 0 ? void 0 : _46.setAttribute('textAlign', 'center');
|
|
27750
|
+
if (this._mainTitle) {
|
|
27751
|
+
if (vutils.isValid(align) || vutils.isValid(textStyle.align)) {
|
|
27752
|
+
const mainTitleAlign = textStyle.align ? textStyle.align : align;
|
|
27753
|
+
const mainTitleWidth = (_15 = textStyle.width) !== null && _15 !== void 0 ? _15 : maintextWidth;
|
|
27754
|
+
if (mainTitleAlign === 'left') {
|
|
27755
|
+
this._mainTitle.setAttribute('x', 0);
|
|
27756
|
+
this._mainTitle.setAttribute('textAlign', 'left');
|
|
27757
|
+
}
|
|
27758
|
+
else if (mainTitleAlign === 'center') {
|
|
27759
|
+
this._mainTitle.setAttribute('x', mainTitleWidth / 2);
|
|
27760
|
+
this._mainTitle.setAttribute('textAlign', 'center');
|
|
27761
|
+
}
|
|
27762
|
+
else if (mainTitleAlign === 'right') {
|
|
27763
|
+
this._mainTitle.setAttribute('x', mainTitleWidth);
|
|
27764
|
+
this._mainTitle.setAttribute('textAlign', 'right');
|
|
27765
|
+
}
|
|
27708
27766
|
}
|
|
27709
|
-
|
|
27710
|
-
|
|
27711
|
-
|
|
27767
|
+
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle.verticalAlign)) {
|
|
27768
|
+
const mainTitleVerticalAlign = textStyle.verticalAlign ? textStyle.verticalAlign : verticalAlign;
|
|
27769
|
+
const mainTitleHeight = textStyle.height ? textStyle.height : titleHeight;
|
|
27770
|
+
if (mainTitleVerticalAlign === 'top') {
|
|
27771
|
+
this._mainTitle.setAttribute('y', 0);
|
|
27772
|
+
this._mainTitle.setAttribute('textBaseline', 'top');
|
|
27773
|
+
}
|
|
27774
|
+
else if (mainTitleVerticalAlign === 'middle') {
|
|
27775
|
+
this._mainTitle.setAttribute('y', mainTitleHeight / 2);
|
|
27776
|
+
this._mainTitle.setAttribute('textBaseline', 'middle');
|
|
27777
|
+
}
|
|
27778
|
+
else if (mainTitleVerticalAlign === 'bottom') {
|
|
27779
|
+
this._mainTitle.setAttribute('y', mainTitleHeight);
|
|
27780
|
+
this._mainTitle.setAttribute('textBaseline', 'bottom');
|
|
27781
|
+
}
|
|
27712
27782
|
}
|
|
27713
27783
|
}
|
|
27714
|
-
if (
|
|
27715
|
-
|
|
27716
|
-
|
|
27717
|
-
|
|
27718
|
-
|
|
27719
|
-
|
|
27720
|
-
|
|
27721
|
-
|
|
27722
|
-
|
|
27723
|
-
|
|
27724
|
-
|
|
27784
|
+
if (this._subTitle) {
|
|
27785
|
+
if (vutils.isValid(align) || vutils.isValid(subtextStyle.align)) {
|
|
27786
|
+
const subTitleAlign = subtextStyle.align ? subtextStyle.align : align;
|
|
27787
|
+
const subTitleWidth = (_16 = subtextStyle.width) !== null && _16 !== void 0 ? _16 : subtextWidth;
|
|
27788
|
+
if (subTitleAlign === 'left') {
|
|
27789
|
+
this._subTitle.setAttribute('x', 0);
|
|
27790
|
+
this._subTitle.setAttribute('textAlign', 'left');
|
|
27791
|
+
}
|
|
27792
|
+
else if (subTitleAlign === 'center') {
|
|
27793
|
+
this._subTitle.setAttribute('x', subTitleWidth / 2);
|
|
27794
|
+
this._subTitle.setAttribute('textAlign', 'center');
|
|
27795
|
+
}
|
|
27796
|
+
else if (subTitleAlign === 'right') {
|
|
27797
|
+
this._subTitle.setAttribute('x', subTitleWidth);
|
|
27798
|
+
this._subTitle.setAttribute('textAlign', 'right');
|
|
27799
|
+
}
|
|
27725
27800
|
}
|
|
27726
|
-
|
|
27727
|
-
|
|
27728
|
-
|
|
27801
|
+
if (vutils.isValid(verticalAlign) || vutils.isValid(textStyle.verticalAlign)) {
|
|
27802
|
+
const subTitleVerticalAlign = subtextStyle.verticalAlign ? subtextStyle.verticalAlign : verticalAlign;
|
|
27803
|
+
const subTitleYStart = maintextHeight;
|
|
27804
|
+
const subTitleHeight = (_17 = subtextStyle.height) !== null && _17 !== void 0 ? _17 : 0;
|
|
27805
|
+
if (subTitleVerticalAlign === 'top') {
|
|
27806
|
+
this._subTitle.setAttribute('y', subTitleYStart);
|
|
27807
|
+
this._subTitle.setAttribute('textBaseline', 'top');
|
|
27808
|
+
}
|
|
27809
|
+
else if (subTitleVerticalAlign === 'middle') {
|
|
27810
|
+
this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight / 2);
|
|
27811
|
+
this._subTitle.setAttribute('textBaseline', 'middle');
|
|
27812
|
+
}
|
|
27813
|
+
else if (subTitleVerticalAlign === 'bottom') {
|
|
27814
|
+
this._subTitle.setAttribute('y', subTitleYStart + subTitleHeight);
|
|
27815
|
+
this._subTitle.setAttribute('textBaseline', 'bottom');
|
|
27816
|
+
}
|
|
27729
27817
|
}
|
|
27730
27818
|
}
|
|
27731
27819
|
}
|
|
@@ -27788,7 +27876,7 @@
|
|
|
27788
27876
|
}
|
|
27789
27877
|
render() {
|
|
27790
27878
|
var _a, _b, _c;
|
|
27791
|
-
const { visible, title, content, size, limitRatio = Infinity } = this.attribute;
|
|
27879
|
+
const { visible, title = {}, content, size, limitRatio = Infinity } = this.attribute;
|
|
27792
27880
|
const limit = Math.min(size.width, size.height) * limitRatio;
|
|
27793
27881
|
const group = this.createOrUpdateChild('indicator-container', { x: 0, y: 0, zIndex: 1 }, 'group');
|
|
27794
27882
|
if (visible !== true) {
|
|
@@ -27822,7 +27910,7 @@
|
|
|
27822
27910
|
}
|
|
27823
27911
|
const titleHeight = this._title ? this._title.AABBBounds.height() : 0;
|
|
27824
27912
|
if (vutils.isValid(content)) {
|
|
27825
|
-
const titleSpace = this._title ? (
|
|
27913
|
+
const titleSpace = this._title ? (title.space ? title.space : 0) : 0;
|
|
27826
27914
|
const contents = vutils.array(content);
|
|
27827
27915
|
const contentComponents = [];
|
|
27828
27916
|
let lastContentHeight = 0;
|
|
@@ -27847,7 +27935,7 @@
|
|
|
27847
27935
|
contentComponent.setAttribute('maxLineWidth', limit);
|
|
27848
27936
|
}
|
|
27849
27937
|
contentComponents.push(contentComponent);
|
|
27850
|
-
const contentSpace =
|
|
27938
|
+
const contentSpace = contentItem.space ? contentItem.space : 0;
|
|
27851
27939
|
lastContentHeight += contentComponent.AABBBounds.height() + contentSpace;
|
|
27852
27940
|
}
|
|
27853
27941
|
else {
|
|
@@ -28066,15 +28154,15 @@
|
|
|
28066
28154
|
this.updateLayout();
|
|
28067
28155
|
};
|
|
28068
28156
|
this.updateLayout = () => {
|
|
28069
|
-
var _a, _b, _c, _d
|
|
28157
|
+
var _a, _b, _c, _d;
|
|
28070
28158
|
this._layout = this.attribute.layout;
|
|
28071
28159
|
if (this._layout === 'horizontal') {
|
|
28072
|
-
this._backwardAttr.style.symbolType = (
|
|
28073
|
-
this._forwardAttr.style.symbolType = (
|
|
28160
|
+
this._backwardAttr.style.symbolType = (_a = this._backwardAttr.style.symbolType) !== null && _a !== void 0 ? _a : iconLeft;
|
|
28161
|
+
this._forwardAttr.style.symbolType = (_b = this._forwardAttr.style.symbolType) !== null && _b !== void 0 ? _b : iconRight;
|
|
28074
28162
|
}
|
|
28075
28163
|
else if (this._layout === 'vertical') {
|
|
28076
|
-
this._backwardAttr.style.symbolType = (
|
|
28077
|
-
this._forwardAttr.style.symbolType = (
|
|
28164
|
+
this._backwardAttr.style.symbolType = (_c = this._backwardAttr.style.symbolType) !== null && _c !== void 0 ? _c : iconUp;
|
|
28165
|
+
this._forwardAttr.style.symbolType = (_d = this._forwardAttr.style.symbolType) !== null && _d !== void 0 ? _d : iconDown;
|
|
28078
28166
|
}
|
|
28079
28167
|
};
|
|
28080
28168
|
this._initPlay = () => {
|
|
@@ -28353,21 +28441,21 @@
|
|
|
28353
28441
|
this._initSlider();
|
|
28354
28442
|
}
|
|
28355
28443
|
_initAttributes() {
|
|
28356
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
28357
28444
|
this._size = this.attribute.size;
|
|
28358
28445
|
this._orient = this.attribute.orient;
|
|
28359
28446
|
this._data = this.attribute.data;
|
|
28360
28447
|
this._minIndex = 0;
|
|
28361
28448
|
this._maxIndex = this._data.length - 1;
|
|
28362
|
-
|
|
28363
|
-
this.
|
|
28364
|
-
this.
|
|
28365
|
-
this.
|
|
28366
|
-
this.
|
|
28367
|
-
this.
|
|
28368
|
-
this.
|
|
28369
|
-
this.
|
|
28370
|
-
this.
|
|
28449
|
+
const { slider = {}, controller = {} } = this.attribute;
|
|
28450
|
+
this._sliderVisible = slider.visible;
|
|
28451
|
+
this._railStyle = Object.assign({}, slider.railStyle);
|
|
28452
|
+
this._trackStyle = Object.assign({}, slider.trackStyle);
|
|
28453
|
+
this._handlerStyle = Object.assign({}, slider.handlerStyle);
|
|
28454
|
+
this._controllerVisible = controller.visible;
|
|
28455
|
+
this._start = Object.assign({}, controller.start);
|
|
28456
|
+
this._pause = Object.assign({}, controller.pause);
|
|
28457
|
+
this._forward = Object.assign({}, controller.forward);
|
|
28458
|
+
this._backward = Object.assign({}, controller.backward);
|
|
28371
28459
|
}
|
|
28372
28460
|
_initLayoutInfo() {
|
|
28373
28461
|
var _a, _b, _c;
|
|
@@ -28828,12 +28916,12 @@
|
|
|
28828
28916
|
this._operatingMaskMoveRangeY = [-Infinity, Infinity];
|
|
28829
28917
|
this._brushMaskAABBBoundsDict = {};
|
|
28830
28918
|
this._onBrushStart = (e) => {
|
|
28831
|
-
var _a
|
|
28919
|
+
var _a;
|
|
28832
28920
|
if (this._outOfInteractiveRange(e)) {
|
|
28833
28921
|
return;
|
|
28834
28922
|
}
|
|
28835
28923
|
e.stopPropagation();
|
|
28836
|
-
const brushMoved = (
|
|
28924
|
+
const brushMoved = (_a = this.attribute.brushMoved) !== null && _a !== void 0 ? _a : true;
|
|
28837
28925
|
this._activeMoveState = brushMoved && this._isPosInBrushMask(e);
|
|
28838
28926
|
this._activeDrawState = !this._activeMoveState;
|
|
28839
28927
|
this._activeDrawState && this._initDraw(e);
|
|
@@ -28848,7 +28936,6 @@
|
|
|
28848
28936
|
this._activeMoveState && this._moving(e);
|
|
28849
28937
|
};
|
|
28850
28938
|
this._onBrushEnd = (e) => {
|
|
28851
|
-
var _a;
|
|
28852
28939
|
e.preventDefault();
|
|
28853
28940
|
const { removeOnClick = true } = this.attribute;
|
|
28854
28941
|
if (this._activeDrawState && !this._isDrawedBeforeEnd && removeOnClick) {
|
|
@@ -28879,7 +28966,9 @@
|
|
|
28879
28966
|
this._activeDrawState = false;
|
|
28880
28967
|
this._activeMoveState = false;
|
|
28881
28968
|
this._isDrawedBeforeEnd = false;
|
|
28882
|
-
(
|
|
28969
|
+
if (this._operatingMask) {
|
|
28970
|
+
this._operatingMask.setAttribute('pickable', false);
|
|
28971
|
+
}
|
|
28883
28972
|
};
|
|
28884
28973
|
}
|
|
28885
28974
|
_bindBrushEvents() {
|
|
@@ -28948,15 +29037,15 @@
|
|
|
28948
29037
|
});
|
|
28949
29038
|
}
|
|
28950
29039
|
_drawing(e) {
|
|
28951
|
-
var _a;
|
|
29040
|
+
var _a, _b;
|
|
28952
29041
|
const pos = this.eventPosToStagePos(e);
|
|
28953
29042
|
const { x1 = 0, x2 = 0, y1 = 0, y2 = 0 } = (_a = this._operatingMask) === null || _a === void 0 ? void 0 : _a._AABBBounds;
|
|
28954
29043
|
const { sizeThreshold = DEFAULT_SIZE_THRESHOLD, brushType } = this.attribute;
|
|
28955
29044
|
const cacheLength = this._cacheDrawPoints.length;
|
|
28956
29045
|
this._isDrawedBeforeEnd = !!(Math.abs(x2 - x1) > sizeThreshold || Math.abs(y1 - y2) > sizeThreshold);
|
|
28957
29046
|
if (cacheLength > 0) {
|
|
28958
|
-
const lastPos = this._cacheDrawPoints[this._cacheDrawPoints.length - 1];
|
|
28959
|
-
if (pos.x ===
|
|
29047
|
+
const lastPos = (_b = this._cacheDrawPoints[this._cacheDrawPoints.length - 1]) !== null && _b !== void 0 ? _b : {};
|
|
29048
|
+
if (pos.x === lastPos.x && pos.y === lastPos.y) {
|
|
28960
29049
|
return;
|
|
28961
29050
|
}
|
|
28962
29051
|
}
|
|
@@ -29291,7 +29380,7 @@
|
|
|
29291
29380
|
const titleHeight = isVisible(titleAttr) ? titleAttr.height + titleAttr.spaceRow : 0;
|
|
29292
29381
|
this._tooltipContent = this.createOrUpdateChild(TOOLTIP_CONTENT_NAME, { visible: true }, 'group');
|
|
29293
29382
|
this._tooltipContent.removeAllChild();
|
|
29294
|
-
if (content
|
|
29383
|
+
if (content && content.length) {
|
|
29295
29384
|
this._tooltipContent.setAttribute('x', padding[3]);
|
|
29296
29385
|
this._tooltipContent.setAttribute('y', padding[0] + titleHeight);
|
|
29297
29386
|
let lastYPos = 0;
|
|
@@ -29474,7 +29563,7 @@
|
|
|
29474
29563
|
if (isVisible(titleAttr)) {
|
|
29475
29564
|
containerHeight += titleMaxHeight + titleAttr.spaceRow;
|
|
29476
29565
|
}
|
|
29477
|
-
if (content
|
|
29566
|
+
if (content && content.length) {
|
|
29478
29567
|
const filteredContent = [];
|
|
29479
29568
|
content.forEach((item, i) => {
|
|
29480
29569
|
const itemAttr = Tooltip.getContentAttr(attribute, i);
|
|
@@ -29720,7 +29809,7 @@
|
|
|
29720
29809
|
}
|
|
29721
29810
|
};
|
|
29722
29811
|
|
|
29723
|
-
const version = "0.17.
|
|
29812
|
+
const version = "0.17.8";
|
|
29724
29813
|
|
|
29725
29814
|
exports.AbstractComponent = AbstractComponent;
|
|
29726
29815
|
exports.ArcInfo = ArcInfo;
|