@visactor/vchart 1.12.2-alpha.2 → 1.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es5/index.js +1 -1
- package/build/index.js +668 -911
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/animation/config.js +2 -2
- package/cjs/animation/config.js.map +1 -1
- package/cjs/animation/utils.js +5 -4
- package/cjs/animation/utils.js.map +1 -1
- package/cjs/chart/base/base-chart.js +1 -1
- package/cjs/chart/base/base-chart.js.map +1 -1
- package/cjs/chart/sankey/sankey-transformer.js +2 -1
- package/cjs/chart/sankey/sankey-transformer.js.map +1 -1
- package/cjs/compile/compilable-base.js +2 -1
- package/cjs/compile/util.js +1 -2
- package/cjs/component/axis/base-axis.d.ts +1 -1
- package/cjs/component/axis/base-axis.js +3 -5
- package/cjs/component/axis/base-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.d.ts +2 -3
- package/cjs/component/axis/cartesian/axis.js +11 -19
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/common.js.map +1 -1
- package/cjs/component/axis/cartesian/linear-axis.d.ts +1 -5
- package/cjs/component/axis/cartesian/linear-axis.js +1 -34
- package/cjs/component/axis/cartesian/linear-axis.js.map +1 -1
- package/cjs/component/axis/interface/common.js.map +1 -1
- package/cjs/component/axis/interface/spec.d.ts +1 -5
- package/cjs/component/axis/interface/spec.js.map +1 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +0 -5
- package/cjs/component/axis/mixin/linear-axis-mixin.js +13 -47
- package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/cjs/component/brush/brush.js +7 -6
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/brush/interface.d.ts +1 -0
- package/cjs/component/brush/interface.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.js +10 -10
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/data-zoom/util.js +2 -3
- package/cjs/component/data-zoom/util.js.map +1 -1
- package/cjs/component/indicator/indicator.js +29 -16
- package/cjs/component/indicator/indicator.js.map +1 -1
- package/cjs/component/tooltip/constant.d.ts +2 -1
- package/cjs/component/tooltip/constant.js +2 -2
- package/cjs/component/tooltip/constant.js.map +1 -1
- package/cjs/component/tooltip/interface/common.d.ts +3 -3
- package/cjs/component/tooltip/interface/common.js.map +1 -1
- package/cjs/component/tooltip/processor/base.d.ts +3 -4
- package/cjs/component/tooltip/processor/base.js +6 -39
- package/cjs/component/tooltip/processor/base.js.map +1 -1
- package/cjs/component/tooltip/processor/dimension-tooltip.d.ts +2 -1
- package/cjs/component/tooltip/processor/dimension-tooltip.js +37 -6
- package/cjs/component/tooltip/processor/dimension-tooltip.js.map +1 -1
- package/cjs/component/tooltip/processor/group-tooltip.d.ts +2 -3
- package/cjs/component/tooltip/processor/group-tooltip.js +3 -12
- package/cjs/component/tooltip/processor/group-tooltip.js.map +1 -1
- package/cjs/component/tooltip/processor/interface.d.ts +0 -1
- package/cjs/component/tooltip/processor/interface.js.map +1 -1
- package/cjs/component/tooltip/processor/mark-tooltip.d.ts +2 -3
- package/cjs/component/tooltip/processor/mark-tooltip.js +4 -13
- package/cjs/component/tooltip/processor/mark-tooltip.js.map +1 -1
- package/cjs/component/tooltip/tooltip-transformer.js +2 -2
- package/cjs/component/tooltip/tooltip-transformer.js.map +1 -1
- package/cjs/component/tooltip/tooltip.js +20 -22
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/component/tooltip/utils/common.d.ts +3 -1
- package/cjs/component/tooltip/utils/common.js +19 -2
- package/cjs/component/tooltip/utils/common.js.map +1 -1
- package/cjs/component/tooltip/utils/compose.js +1 -1
- package/cjs/component/tooltip/utils/compose.js.map +1 -1
- package/cjs/component/tooltip/utils/get-spec.js +64 -81
- package/cjs/component/tooltip/utils/get-spec.js.map +1 -1
- package/cjs/component/tooltip/utils/index.d.ts +0 -1
- package/cjs/component/tooltip/utils/index.js +1 -1
- package/cjs/component/tooltip/utils/index.js.map +1 -1
- package/cjs/component/tooltip/utils/show-tooltip.js +5 -6
- package/cjs/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/cjs/constant/layout.js +2 -1
- package/cjs/constant/polar.js +1 -2
- package/cjs/core/index.d.ts +1 -1
- package/cjs/core/index.js +1 -1
- package/cjs/core/index.js.map +1 -1
- package/cjs/event/events/dimension/util/cartesian.d.ts +1 -1
- package/cjs/event/events/dimension/util/cartesian.js +6 -4
- package/cjs/event/events/dimension/util/cartesian.js.map +1 -1
- package/cjs/event/events/dimension/util/polar.js +4 -2
- package/cjs/event/events/dimension/util/polar.js.map +1 -1
- package/cjs/plugin/components/axis-sync/tick-align-transform.js +3 -3
- package/cjs/plugin/components/axis-sync/tick-align-transform.js.map +1 -1
- package/cjs/plugin/components/axis-sync/zero-align-transform.js +3 -5
- package/cjs/plugin/components/axis-sync/zero-align-transform.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/base.js +27 -64
- package/cjs/plugin/components/tooltip-handler/base.js.map +1 -1
- package/cjs/plugin/components/tooltip-handler/utils/position.d.ts +3 -4
- package/cjs/plugin/components/tooltip-handler/utils/position.js +8 -11
- package/cjs/plugin/components/tooltip-handler/utils/position.js.map +1 -1
- package/cjs/scale/global-scale.js +2 -0
- package/cjs/scale/global-scale.js.map +1 -1
- package/cjs/series/bar/bar.js +3 -1
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/base/tooltip-helper.d.ts +1 -3
- package/cjs/series/base/tooltip-helper.js +5 -30
- package/cjs/series/base/tooltip-helper.js.map +1 -1
- package/cjs/series/dot/tooltip-helper.d.ts +0 -1
- package/cjs/series/dot/tooltip-helper.js +2 -19
- package/cjs/series/dot/tooltip-helper.js.map +1 -1
- package/cjs/series/interface/series.d.ts +2 -0
- package/cjs/series/interface/series.js.map +1 -1
- package/cjs/series/pie/interface.d.ts +1 -1
- package/cjs/series/pie/interface.js.map +1 -1
- package/cjs/series/pie/pie-transformer.js +2 -2
- package/cjs/series/pie/pie-transformer.js.map +1 -1
- package/cjs/series/polar/polar.js.map +1 -1
- package/cjs/series/sankey/interface.d.ts +1 -0
- package/cjs/series/sankey/interface.js.map +1 -1
- package/cjs/series/sankey/sankey.d.ts +1 -0
- package/cjs/series/sankey/sankey.js +25 -13
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/util/array.d.ts +0 -1
- package/cjs/util/array.js +2 -11
- package/cjs/util/array.js.map +1 -1
- package/esm/animation/config.js +2 -2
- package/esm/animation/config.js.map +1 -1
- package/esm/animation/utils.js +1 -1
- package/esm/animation/utils.js.map +1 -1
- package/esm/chart/base/base-chart.js +1 -1
- package/esm/chart/base/base-chart.js.map +1 -1
- package/esm/chart/sankey/sankey-transformer.js +2 -1
- package/esm/chart/sankey/sankey-transformer.js.map +1 -1
- package/esm/compile/compilable-base.js +2 -1
- package/esm/compile/util.js +1 -2
- package/esm/component/axis/base-axis.d.ts +1 -1
- package/esm/component/axis/base-axis.js +2 -6
- package/esm/component/axis/base-axis.js.map +1 -1
- package/esm/component/axis/cartesian/axis.d.ts +2 -3
- package/esm/component/axis/cartesian/axis.js +10 -18
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/interface/common.js.map +1 -1
- package/esm/component/axis/cartesian/linear-axis.d.ts +1 -5
- package/esm/component/axis/cartesian/linear-axis.js +1 -37
- package/esm/component/axis/cartesian/linear-axis.js.map +1 -1
- package/esm/component/axis/interface/common.js.map +1 -1
- package/esm/component/axis/interface/spec.d.ts +1 -5
- package/esm/component/axis/interface/spec.js.map +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.d.ts +0 -5
- package/esm/component/axis/mixin/linear-axis-mixin.js +14 -48
- package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/esm/component/brush/brush.js +8 -4
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/brush/interface.d.ts +1 -0
- package/esm/component/brush/interface.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.js +7 -7
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.js +2 -2
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/data-zoom/util.js +1 -3
- package/esm/component/data-zoom/util.js.map +1 -1
- package/esm/component/indicator/indicator.js +29 -16
- package/esm/component/indicator/indicator.js.map +1 -1
- package/esm/component/tooltip/constant.d.ts +2 -1
- package/esm/component/tooltip/constant.js +2 -0
- package/esm/component/tooltip/constant.js.map +1 -1
- package/esm/component/tooltip/interface/common.d.ts +3 -3
- package/esm/component/tooltip/interface/common.js.map +1 -1
- package/esm/component/tooltip/processor/base.d.ts +3 -4
- package/esm/component/tooltip/processor/base.js +7 -44
- package/esm/component/tooltip/processor/base.js.map +1 -1
- package/esm/component/tooltip/processor/dimension-tooltip.d.ts +2 -1
- package/esm/component/tooltip/processor/dimension-tooltip.js +43 -6
- package/esm/component/tooltip/processor/dimension-tooltip.js.map +1 -1
- package/esm/component/tooltip/processor/group-tooltip.d.ts +2 -3
- package/esm/component/tooltip/processor/group-tooltip.js +4 -13
- package/esm/component/tooltip/processor/group-tooltip.js.map +1 -1
- package/esm/component/tooltip/processor/interface.d.ts +0 -1
- package/esm/component/tooltip/processor/interface.js.map +1 -1
- package/esm/component/tooltip/processor/mark-tooltip.d.ts +2 -3
- package/esm/component/tooltip/processor/mark-tooltip.js +3 -14
- package/esm/component/tooltip/processor/mark-tooltip.js.map +1 -1
- package/esm/component/tooltip/tooltip-transformer.js +1 -1
- package/esm/component/tooltip/tooltip-transformer.js.map +1 -1
- package/esm/component/tooltip/tooltip.js +21 -23
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/component/tooltip/utils/common.d.ts +3 -1
- package/esm/component/tooltip/utils/common.js +15 -1
- package/esm/component/tooltip/utils/common.js.map +1 -1
- package/esm/component/tooltip/utils/compose.js +2 -2
- package/esm/component/tooltip/utils/compose.js.map +1 -1
- package/esm/component/tooltip/utils/get-spec.js +61 -81
- package/esm/component/tooltip/utils/get-spec.js.map +1 -1
- package/esm/component/tooltip/utils/index.d.ts +0 -1
- package/esm/component/tooltip/utils/index.js +0 -2
- package/esm/component/tooltip/utils/index.js.map +1 -1
- package/esm/component/tooltip/utils/show-tooltip.js +5 -6
- package/esm/component/tooltip/utils/show-tooltip.js.map +1 -1
- package/esm/constant/layout.js +2 -1
- package/esm/constant/polar.js +1 -2
- package/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/event/events/dimension/util/cartesian.d.ts +1 -1
- package/esm/event/events/dimension/util/cartesian.js +6 -4
- package/esm/event/events/dimension/util/cartesian.js.map +1 -1
- package/esm/event/events/dimension/util/polar.js +3 -1
- package/esm/event/events/dimension/util/polar.js.map +1 -1
- package/esm/plugin/components/axis-sync/tick-align-transform.js +2 -4
- package/esm/plugin/components/axis-sync/tick-align-transform.js.map +1 -1
- package/esm/plugin/components/axis-sync/zero-align-transform.js +4 -4
- package/esm/plugin/components/axis-sync/zero-align-transform.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/base.js +20 -57
- package/esm/plugin/components/tooltip-handler/base.js.map +1 -1
- package/esm/plugin/components/tooltip-handler/utils/position.d.ts +3 -4
- package/esm/plugin/components/tooltip-handler/utils/position.js +8 -11
- package/esm/plugin/components/tooltip-handler/utils/position.js.map +1 -1
- package/esm/scale/global-scale.js +1 -0
- package/esm/scale/global-scale.js.map +1 -1
- package/esm/series/bar/bar.js +1 -1
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/base/tooltip-helper.d.ts +1 -3
- package/esm/series/base/tooltip-helper.js +4 -25
- package/esm/series/base/tooltip-helper.js.map +1 -1
- package/esm/series/dot/tooltip-helper.d.ts +0 -1
- package/esm/series/dot/tooltip-helper.js +3 -20
- package/esm/series/dot/tooltip-helper.js.map +1 -1
- package/esm/series/interface/series.d.ts +2 -0
- package/esm/series/interface/series.js.map +1 -1
- package/esm/series/pie/interface.d.ts +1 -1
- package/esm/series/pie/interface.js.map +1 -1
- package/esm/series/pie/pie-transformer.js +1 -1
- package/esm/series/pie/pie-transformer.js.map +1 -1
- package/esm/series/polar/polar.js.map +1 -1
- package/esm/series/sankey/interface.d.ts +1 -0
- package/esm/series/sankey/interface.js.map +1 -1
- package/esm/series/sankey/sankey.d.ts +1 -0
- package/esm/series/sankey/sankey.js +23 -13
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/util/array.d.ts +0 -1
- package/esm/util/array.js +0 -9
- package/esm/util/array.js.map +1 -1
- package/package.json +15 -15
- package/cjs/component/axis/mixin/util/break-data.d.ts +0 -4
- package/cjs/component/axis/mixin/util/break-data.js +0 -39
- package/cjs/component/axis/mixin/util/break-data.js.map +0 -1
- package/cjs/component/tooltip/utils/pattern.d.ts +0 -4
- package/cjs/component/tooltip/utils/pattern.js +0 -13
- package/cjs/component/tooltip/utils/pattern.js.map +0 -1
- package/esm/component/axis/mixin/util/break-data.d.ts +0 -4
- package/esm/component/axis/mixin/util/break-data.js +0 -31
- package/esm/component/axis/mixin/util/break-data.js.map +0 -1
- package/esm/component/tooltip/utils/pattern.d.ts +0 -4
- package/esm/component/tooltip/utils/pattern.js +0 -5
- package/esm/component/tooltip/utils/pattern.js.map +0 -1
package/build/index.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
19
19
|
PERFORMANCE OF THIS SOFTWARE.
|
|
20
20
|
***************************************************************************** */
|
|
21
|
-
function __rest$
|
|
21
|
+
function __rest$e(s, e) {
|
|
22
22
|
var t = {};
|
|
23
23
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
24
24
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
@@ -11979,7 +11979,7 @@
|
|
|
11979
11979
|
delta = this._duringTime + delta * this.timeScale - this._startTime, this._duringTime = this._startTime;
|
|
11980
11980
|
}
|
|
11981
11981
|
this.status === AnimateStatus.INITIAL && (this.status = AnimateStatus.RUNNING, this._onStart && this._onStart.forEach(cb => cb()));
|
|
11982
|
-
this.setPosition(this.rawPosition + delta * this.timeScale) && this.status === AnimateStatus.RUNNING && (this.status = AnimateStatus.END, this._onEnd && this._onEnd.forEach(cb => cb()));
|
|
11982
|
+
this.setPosition(Math.max(this.rawPosition, 0) + delta * this.timeScale) && this.status === AnimateStatus.RUNNING && (this.status = AnimateStatus.END, this._onEnd && this._onEnd.forEach(cb => cb()));
|
|
11983
11983
|
}
|
|
11984
11984
|
setPosition(rawPosition) {
|
|
11985
11985
|
let sa,
|
|
@@ -12102,7 +12102,7 @@
|
|
|
12102
12102
|
end = !1;
|
|
12103
12103
|
const startAt = null !== (_a = this._startAt) && void 0 !== _a ? _a : 0;
|
|
12104
12104
|
if (rawPosition < 0 && (rawPosition = 0), rawPosition < startAt) return this.rawPosition = rawPosition, !1;
|
|
12105
|
-
if (rawPosition -= startAt, d <= 0
|
|
12105
|
+
if (rawPosition -= startAt, d <= 0 && (end = !0, d < 0)) return end;
|
|
12106
12106
|
if (loop = Math.floor(rawPosition / d), position = rawPosition - loop * d, end = rawPosition >= loopCount * d + d, end && (position = d, loop = loopCount, rawPosition = position * loop + d), rawPosition === prevRawPos) return end;
|
|
12107
12107
|
const rev = !this.reversed != !(this.bounce && loop % 2);
|
|
12108
12108
|
return rev && (position = d - position), this._deltaPosition = position - this.position, this.position = position, this.rawPosition = rawPosition + startAt, this.updatePosition(end, rev), end;
|
|
@@ -13682,7 +13682,7 @@
|
|
|
13682
13682
|
var _a;
|
|
13683
13683
|
data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map((mark, index) => {
|
|
13684
13684
|
(null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(svgStr, res.data)) : (data.loadState = "fail", mark.imageLoadFail(svgStr));
|
|
13685
|
-
});
|
|
13685
|
+
}), data.waitingMark && (data.waitingMark = []);
|
|
13686
13686
|
})) : (data.loadState = "fail", mark.imageLoadFail(svgStr)));
|
|
13687
13687
|
}
|
|
13688
13688
|
static GetFile(url, type) {
|
|
@@ -13713,7 +13713,7 @@
|
|
|
13713
13713
|
var _a;
|
|
13714
13714
|
data.loadState = (null == res ? void 0 : res.data) ? "success" : "fail", data.data = null == res ? void 0 : res.data, null === (_a = data.waitingMark) || void 0 === _a || _a.map((mark, index) => {
|
|
13715
13715
|
(null == res ? void 0 : res.data) ? (data.loadState = "success", data.data = res.data, mark.imageLoadSuccess(url, res.data)) : (data.loadState = "fail", mark.imageLoadFail(url));
|
|
13716
|
-
});
|
|
13716
|
+
}), data.waitingMark && (data.waitingMark = []);
|
|
13717
13717
|
});
|
|
13718
13718
|
promises.push(end);
|
|
13719
13719
|
} else data.loadState = "fail", marks.forEach(mark => mark.imageLoadFail(url));
|
|
@@ -23036,7 +23036,7 @@
|
|
|
23036
23036
|
release() {
|
|
23037
23037
|
super.release(), this.hooks.beforeRender.unTap("constructor", this.beforeRender), this.hooks.afterRender.unTap("constructor", this.afterRender), this.eventSystem && this.eventSystem.release(), this.layerService.releaseStage(this), this.pluginService.release(), this.forEach(layer => {
|
|
23038
23038
|
layer.release();
|
|
23039
|
-
}), this.interactiveLayer && this.interactiveLayer.release(), this.window.release(), this.ticker.remTimeline(this.timeline), this.renderService.renderTreeRoots = [];
|
|
23039
|
+
}), this.interactiveLayer && (this.interactiveLayer.release(), this.interactiveLayer.removeAllChild()), this.window.release(), this.ticker.remTimeline(this.timeline), this.renderService.renderTreeRoots = [];
|
|
23040
23040
|
}
|
|
23041
23041
|
setStage(stage) {}
|
|
23042
23042
|
dirty(b, matrix) {
|
|
@@ -24606,18 +24606,6 @@
|
|
|
24606
24606
|
Factory$2.registerPlugin("ViewTransform3dPlugin", ViewTransform3dPlugin);
|
|
24607
24607
|
};
|
|
24608
24608
|
|
|
24609
|
-
function combineArray(arr) {
|
|
24610
|
-
const result = [];
|
|
24611
|
-
for (let index = 0; index < arr.length; index++) {
|
|
24612
|
-
const element = arr[index];
|
|
24613
|
-
if (index === 0) {
|
|
24614
|
-
result.push(element[0]);
|
|
24615
|
-
}
|
|
24616
|
-
result.push(element[1]);
|
|
24617
|
-
}
|
|
24618
|
-
return result;
|
|
24619
|
-
}
|
|
24620
|
-
|
|
24621
24609
|
const warn = (msg, detail) => {
|
|
24622
24610
|
if (isFunction$1(config.warnHandler)) {
|
|
24623
24611
|
config.warnHandler.call(null, msg, detail);
|
|
@@ -24894,7 +24882,9 @@
|
|
|
24894
24882
|
const bctx = vglobal.createCanvas({
|
|
24895
24883
|
width: 1,
|
|
24896
24884
|
height: 1
|
|
24897
|
-
}).getContext("2d"
|
|
24885
|
+
}).getContext("2d", {
|
|
24886
|
+
willReadFrequently: !0
|
|
24887
|
+
});
|
|
24898
24888
|
bctx.fillStyle = backgroundColor, bctx.fillRect(0, 0, 1, 1);
|
|
24899
24889
|
const bgPixel = bctx.getImageData(0, 0, 1, 1).data;
|
|
24900
24890
|
return (imageData, y, x) => {
|
|
@@ -24911,7 +24901,9 @@
|
|
|
24911
24901
|
height: height,
|
|
24912
24902
|
dpr: 1
|
|
24913
24903
|
}),
|
|
24914
|
-
tempContext = maskCanvas.getContext("2d"
|
|
24904
|
+
tempContext = maskCanvas.getContext("2d", {
|
|
24905
|
+
willReadFrequently: !0
|
|
24906
|
+
});
|
|
24915
24907
|
if (cacheCanvas) {
|
|
24916
24908
|
const prevWidth = cacheCanvas.width,
|
|
24917
24909
|
prevHeight = cacheCanvas.height;
|
|
@@ -30435,7 +30427,7 @@
|
|
|
30435
30427
|
registerGroup(), registerRect(), registerSymbol(), registerRichtext(), registerText();
|
|
30436
30428
|
}
|
|
30437
30429
|
|
|
30438
|
-
var __rest$
|
|
30430
|
+
var __rest$d = undefined && undefined.__rest || function (s, e) {
|
|
30439
30431
|
var t = {};
|
|
30440
30432
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
30441
30433
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -30453,10 +30445,11 @@
|
|
|
30453
30445
|
return this._textShape;
|
|
30454
30446
|
}
|
|
30455
30447
|
constructor(attributes, options) {
|
|
30456
|
-
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Tag.defaultAttributes, attributes)), this.name = "tag";
|
|
30448
|
+
super((null == options ? void 0 : options.skipDefault) ? attributes : merge$2({}, Tag.defaultAttributes, attributes)), this.name = "tag", this._tagStates = [], this._rectStates = [], this._symbolStates = [], this._textStates = [];
|
|
30457
30449
|
}
|
|
30458
30450
|
render() {
|
|
30459
30451
|
var _a, _b, _c;
|
|
30452
|
+
this.cacheStates();
|
|
30460
30453
|
const {
|
|
30461
30454
|
text = "",
|
|
30462
30455
|
textStyle = {},
|
|
@@ -30486,7 +30479,7 @@
|
|
|
30486
30479
|
const {
|
|
30487
30480
|
visible: shapeVisible
|
|
30488
30481
|
} = shape,
|
|
30489
|
-
shapeStyle = __rest$
|
|
30482
|
+
shapeStyle = __rest$d(shape, ["visible"]);
|
|
30490
30483
|
if (isBoolean$1(shapeVisible)) {
|
|
30491
30484
|
const size = (null == shapeStyle ? void 0 : shapeStyle.size) || 10,
|
|
30492
30485
|
maxSize = isNumber$1(size) ? size : Math.max(size[0], size[1]);
|
|
@@ -30517,7 +30510,7 @@
|
|
|
30517
30510
|
const {
|
|
30518
30511
|
visible: bgVisible
|
|
30519
30512
|
} = panel,
|
|
30520
|
-
backgroundStyle = __rest$
|
|
30513
|
+
backgroundStyle = __rest$d(panel, ["visible"]);
|
|
30521
30514
|
if (visible && isBoolean$1(bgVisible)) {
|
|
30522
30515
|
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
30523
30516
|
visible: bgVisible && !!text,
|
|
@@ -30605,7 +30598,7 @@
|
|
|
30605
30598
|
const {
|
|
30606
30599
|
visible: bgVisible
|
|
30607
30600
|
} = panel,
|
|
30608
|
-
backgroundStyle = __rest$
|
|
30601
|
+
backgroundStyle = __rest$d(panel, ["visible"]);
|
|
30609
30602
|
if (visible && isBoolean$1(bgVisible)) {
|
|
30610
30603
|
const bgRect = this.createOrUpdateChild("tag-panel", Object.assign(Object.assign({}, backgroundStyle), {
|
|
30611
30604
|
visible: bgVisible && !!text,
|
|
@@ -30621,7 +30614,24 @@
|
|
|
30621
30614
|
this._bgRect = bgRect;
|
|
30622
30615
|
}
|
|
30623
30616
|
}
|
|
30624
|
-
this._textShape = textShape;
|
|
30617
|
+
this._textShape = textShape, this._symbol = symbol, this.resetStates();
|
|
30618
|
+
}
|
|
30619
|
+
initAttributes(params, options) {
|
|
30620
|
+
params = (null == options ? void 0 : options.skipDefault) ? params : merge$2({}, Tag.defaultAttributes, params), super.initAttributes(params), this.render();
|
|
30621
|
+
}
|
|
30622
|
+
addState(stateName, keepCurrentStates, hasAnimation) {
|
|
30623
|
+
super.addState(stateName, keepCurrentStates, hasAnimation), this._textShape && this._textShape.addState(stateName, keepCurrentStates, hasAnimation), this._bgRect && this._bgRect.addState(stateName, keepCurrentStates, hasAnimation), this._symbol && this._symbol.addState(stateName, keepCurrentStates, hasAnimation);
|
|
30624
|
+
}
|
|
30625
|
+
removeState(stateName, hasAnimation) {
|
|
30626
|
+
super.removeState(stateName, hasAnimation), this._textShape && this._textShape.removeState(stateName, hasAnimation), this._bgRect && this._bgRect.removeState(stateName, hasAnimation), this._symbol && this._symbol.removeState(stateName, hasAnimation);
|
|
30627
|
+
}
|
|
30628
|
+
cacheStates() {
|
|
30629
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
30630
|
+
this._tagStates = null !== (_b = null === (_a = this.currentStates) || void 0 === _a ? void 0 : _a.slice()) && void 0 !== _b ? _b : [], this._rectStates = null !== (_e = null === (_d = null === (_c = this._bgRect) || void 0 === _c ? void 0 : _c.currentStates) || void 0 === _d ? void 0 : _d.slice()) && void 0 !== _e ? _e : [], this._symbolStates = null !== (_h = null === (_g = null === (_f = this._symbol) || void 0 === _f ? void 0 : _f.currentStates) || void 0 === _g ? void 0 : _g.slice()) && void 0 !== _h ? _h : [], this._textStates = null !== (_l = null === (_k = null === (_j = this._textShape) || void 0 === _j ? void 0 : _j.currentStates) || void 0 === _k ? void 0 : _k.slice()) && void 0 !== _l ? _l : [], this.clearStates(), null === (_m = this._bgRect) || void 0 === _m || _m.clearStates(), null === (_o = this._symbol) || void 0 === _o || _o.clearStates(), null === (_p = this._textShape) || void 0 === _p || _p.clearStates();
|
|
30631
|
+
}
|
|
30632
|
+
resetStates() {
|
|
30633
|
+
var _a, _b, _c;
|
|
30634
|
+
this._tagStates.length && this.useStates(this._tagStates), this._rectStates.length && (null === (_a = this._bgRect) || void 0 === _a || _a.useStates(this._rectStates)), this._symbolStates.length && (null === (_b = this._symbol) || void 0 === _b || _b.useStates(this._symbolStates)), this._textStates.length && (null === (_c = this._textShape) || void 0 === _c || _c.useStates(this._textStates));
|
|
30625
30635
|
}
|
|
30626
30636
|
}
|
|
30627
30637
|
Tag.defaultAttributes = {
|
|
@@ -30671,7 +30681,7 @@
|
|
|
30671
30681
|
merge$2(theme.poptip, DEFAULT_THEME, defaultPoptipTheme);
|
|
30672
30682
|
}
|
|
30673
30683
|
|
|
30674
|
-
var __rest$
|
|
30684
|
+
var __rest$c = undefined && undefined.__rest || function (s, e) {
|
|
30675
30685
|
var t = {};
|
|
30676
30686
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
30677
30687
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -30758,7 +30768,7 @@
|
|
|
30758
30768
|
const {
|
|
30759
30769
|
visible: bgVisible
|
|
30760
30770
|
} = panel,
|
|
30761
|
-
backgroundStyle = __rest$
|
|
30771
|
+
backgroundStyle = __rest$c(panel, ["visible"]),
|
|
30762
30772
|
symbolSize = null !== (_a = backgroundStyle.size) && void 0 !== _a ? _a : 12,
|
|
30763
30773
|
spaceSize = isArray$1(symbolSize) ? [symbolSize[0] + (null !== (_b = backgroundStyle.space) && void 0 !== _b ? _b : 0), symbolSize[1] + (null !== (_c = backgroundStyle.space) && void 0 !== _c ? _c : 0)] : symbolSize + (null !== (_d = backgroundStyle.space) && void 0 !== _d ? _d : 0),
|
|
30764
30774
|
lineWidth = null !== (_e = backgroundStyle.lineWidth) && void 0 !== _e ? _e : 1,
|
|
@@ -31769,7 +31779,7 @@
|
|
|
31769
31779
|
registerGroup(), registerText(), registerRichtext(), registerLine();
|
|
31770
31780
|
}
|
|
31771
31781
|
|
|
31772
|
-
var __rest$
|
|
31782
|
+
var __rest$b = undefined && undefined.__rest || function (s, e) {
|
|
31773
31783
|
var t = {};
|
|
31774
31784
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
31775
31785
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -31790,7 +31800,7 @@
|
|
|
31790
31800
|
const {
|
|
31791
31801
|
data: data
|
|
31792
31802
|
} = attributes,
|
|
31793
|
-
restAttributes = __rest$
|
|
31803
|
+
restAttributes = __rest$b(attributes, ["data"]);
|
|
31794
31804
|
super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
|
|
31795
31805
|
data: data
|
|
31796
31806
|
}, merge$2({}, LabelBase.defaultAttributes, restAttributes))), this.name = "label", this._onHover = e => {
|
|
@@ -32319,7 +32329,7 @@
|
|
|
32319
32329
|
};
|
|
32320
32330
|
const getLabelComponent = type => labelComponentMap[type];
|
|
32321
32331
|
|
|
32322
|
-
var __rest$
|
|
32332
|
+
var __rest$a = undefined && undefined.__rest || function (s, e) {
|
|
32323
32333
|
var t = {};
|
|
32324
32334
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
32325
32335
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -32333,7 +32343,7 @@
|
|
|
32333
32343
|
const {
|
|
32334
32344
|
data: data
|
|
32335
32345
|
} = attributes,
|
|
32336
|
-
restAttributes = __rest$
|
|
32346
|
+
restAttributes = __rest$a(attributes, ["data"]);
|
|
32337
32347
|
super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
|
|
32338
32348
|
data: data
|
|
32339
32349
|
}, merge$2({}, SymbolLabel.defaultAttributes, restAttributes))), this.name = "symbol-label";
|
|
@@ -32355,7 +32365,7 @@
|
|
|
32355
32365
|
registerLabelComponent("symbol", SymbolLabel), registerLabelComponent("line-data", SymbolLabel);
|
|
32356
32366
|
};
|
|
32357
32367
|
|
|
32358
|
-
var __rest$
|
|
32368
|
+
var __rest$9 = undefined && undefined.__rest || function (s, e) {
|
|
32359
32369
|
var t = {};
|
|
32360
32370
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
32361
32371
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -32369,7 +32379,7 @@
|
|
|
32369
32379
|
const {
|
|
32370
32380
|
data: data
|
|
32371
32381
|
} = attributes,
|
|
32372
|
-
restAttributes = __rest$
|
|
32382
|
+
restAttributes = __rest$9(attributes, ["data"]);
|
|
32373
32383
|
super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
|
|
32374
32384
|
data: data
|
|
32375
32385
|
}, merge$2({}, RectLabel.defaultAttributes, restAttributes)));
|
|
@@ -32419,7 +32429,7 @@
|
|
|
32419
32429
|
registerLabelComponent("rect", RectLabel);
|
|
32420
32430
|
};
|
|
32421
32431
|
|
|
32422
|
-
var __rest$
|
|
32432
|
+
var __rest$8 = undefined && undefined.__rest || function (s, e) {
|
|
32423
32433
|
var t = {};
|
|
32424
32434
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
32425
32435
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -32433,7 +32443,7 @@
|
|
|
32433
32443
|
const {
|
|
32434
32444
|
data: data
|
|
32435
32445
|
} = attributes,
|
|
32436
|
-
restAttributes = __rest$
|
|
32446
|
+
restAttributes = __rest$8(attributes, ["data"]);
|
|
32437
32447
|
super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
|
|
32438
32448
|
data: data
|
|
32439
32449
|
}, merge$2({}, LineLabel.defaultAttributes, restAttributes))), this.name = "line-label";
|
|
@@ -32473,7 +32483,7 @@
|
|
|
32473
32483
|
registerLabelComponent("line", LineLabel$1), registerLabelComponent("area", LineLabel$1);
|
|
32474
32484
|
};
|
|
32475
32485
|
|
|
32476
|
-
var __rest$
|
|
32486
|
+
var __rest$7 = undefined && undefined.__rest || function (s, e) {
|
|
32477
32487
|
var t = {};
|
|
32478
32488
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
32479
32489
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -32505,7 +32515,7 @@
|
|
|
32505
32515
|
const {
|
|
32506
32516
|
data: data
|
|
32507
32517
|
} = attributes,
|
|
32508
|
-
restAttributes = __rest$
|
|
32518
|
+
restAttributes = __rest$7(attributes, ["data"]);
|
|
32509
32519
|
super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
|
|
32510
32520
|
data: data
|
|
32511
32521
|
}, merge$2({}, ArcLabel.defaultAttributes, restAttributes))), this.name = "arc-label", this._ellipsisWidth = 0, this._arcLeft = new Map(), this._arcRight = new Map();
|
|
@@ -32594,6 +32604,7 @@
|
|
|
32594
32604
|
case "inside":
|
|
32595
32605
|
case "inside-inner":
|
|
32596
32606
|
case "inside-outer":
|
|
32607
|
+
case "inside-center":
|
|
32597
32608
|
arcs.push(...this._layoutInsideLabels(rightArcs, attribute, currentMarks)), arcs.push(...this._layoutInsideLabels(leftArcs, attribute, currentMarks));
|
|
32598
32609
|
break;
|
|
32599
32610
|
default:
|
|
@@ -32627,7 +32638,7 @@
|
|
|
32627
32638
|
align = this._computeAlign(arc, attribute);
|
|
32628
32639
|
let labelRadius,
|
|
32629
32640
|
alignOffset = 0;
|
|
32630
|
-
if ("inside" === position && (alignOffset = "left" === align ? labelWidth : "right" === align ? 0 : labelWidth / 2), labelRadius = "inside-inner" === position ? innerRadius - offsetRadius + alignOffset : outerRadius + offsetRadius - alignOffset, arc.labelPosition = polarToCartesian(arc.circleCenter, labelRadius, arc.middleAngle), arc.labelLimit = labelWidth, isGreater(labelWidth, 0) || (arc.labelVisible = !1), !1 !== labelConfig.rotate) {
|
|
32641
|
+
if ("inside" === position && (alignOffset = "left" === align ? labelWidth : "right" === align ? 0 : labelWidth / 2), labelRadius = "inside-inner" === position ? innerRadius - offsetRadius + alignOffset : "inside-center" === position ? innerRadius + (outerRadius - innerRadius) / 2 : outerRadius + offsetRadius - alignOffset, arc.labelPosition = polarToCartesian(arc.circleCenter, labelRadius, arc.middleAngle), arc.labelLimit = labelWidth, isGreater(labelWidth, 0) || (arc.labelVisible = !1), !1 !== labelConfig.rotate) {
|
|
32631
32642
|
arc.angle = null !== (_b = null === (_a = attribute.textStyle) || void 0 === _a ? void 0 : _a.angle) && void 0 !== _b ? _b : arc.middleAngle;
|
|
32632
32643
|
let offsetAngle = null !== (_c = labelConfig.offsetAngle) && void 0 !== _c ? _c : 0;
|
|
32633
32644
|
["inside-inner", "inside-outer"].includes(position) && (offsetAngle += Math.PI / 2), arc.angle += offsetAngle;
|
|
@@ -32997,7 +33008,7 @@
|
|
|
32997
33008
|
return Math.min(width / 2, height / 2);
|
|
32998
33009
|
}
|
|
32999
33010
|
_canPlaceInside(textBound, shapeBound) {
|
|
33000
|
-
return "inside" === this.attribute.position;
|
|
33011
|
+
return "inside" === this.attribute.position || "inside-center" === this.attribute.position;
|
|
33001
33012
|
}
|
|
33002
33013
|
computeLayoutOuterRadius(r, width, height) {
|
|
33003
33014
|
return r / (Math.min(width, height) / 2);
|
|
@@ -33035,7 +33046,7 @@
|
|
|
33035
33046
|
registerLabelComponent("arc", ArcLabel);
|
|
33036
33047
|
};
|
|
33037
33048
|
|
|
33038
|
-
var __rest$
|
|
33049
|
+
var __rest$6 = undefined && undefined.__rest || function (s, e) {
|
|
33039
33050
|
var t = {};
|
|
33040
33051
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
33041
33052
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -33049,7 +33060,7 @@
|
|
|
33049
33060
|
const {
|
|
33050
33061
|
dataLabels: dataLabels
|
|
33051
33062
|
} = attributes,
|
|
33052
|
-
restAttributes = __rest$
|
|
33063
|
+
restAttributes = __rest$6(attributes, ["dataLabels"]);
|
|
33053
33064
|
super((null == options ? void 0 : options.skipDefault) ? attributes : Object.assign({
|
|
33054
33065
|
dataLabels: dataLabels
|
|
33055
33066
|
}, merge$2({}, DataLabel.defaultAttributes, restAttributes))), this.name = "data-label";
|
|
@@ -33362,7 +33373,7 @@
|
|
|
33362
33373
|
|
|
33363
33374
|
var AXIS_ELEMENT_NAME;
|
|
33364
33375
|
!function (AXIS_ELEMENT_NAME) {
|
|
33365
|
-
AXIS_ELEMENT_NAME.innerView = "inner-view", AXIS_ELEMENT_NAME.axisContainer = "axis-container", AXIS_ELEMENT_NAME.labelContainer = "axis-label-container", AXIS_ELEMENT_NAME.tickContainer = "axis-tick-container", AXIS_ELEMENT_NAME.tick = "axis-tick", AXIS_ELEMENT_NAME.subTick = "axis-sub-tick", AXIS_ELEMENT_NAME.label = "axis-label", AXIS_ELEMENT_NAME.title = "axis-title", AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container", AXIS_ELEMENT_NAME.grid = "axis-grid", AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region", AXIS_ELEMENT_NAME.line = "axis-line", AXIS_ELEMENT_NAME.background = "axis-background", AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background"
|
|
33376
|
+
AXIS_ELEMENT_NAME.innerView = "inner-view", AXIS_ELEMENT_NAME.axisContainer = "axis-container", AXIS_ELEMENT_NAME.labelContainer = "axis-label-container", AXIS_ELEMENT_NAME.tickContainer = "axis-tick-container", AXIS_ELEMENT_NAME.tick = "axis-tick", AXIS_ELEMENT_NAME.subTick = "axis-sub-tick", AXIS_ELEMENT_NAME.label = "axis-label", AXIS_ELEMENT_NAME.title = "axis-title", AXIS_ELEMENT_NAME.gridContainer = "axis-grid-container", AXIS_ELEMENT_NAME.grid = "axis-grid", AXIS_ELEMENT_NAME.gridRegion = "axis-grid-region", AXIS_ELEMENT_NAME.line = "axis-line", AXIS_ELEMENT_NAME.background = "axis-background", AXIS_ELEMENT_NAME.axisLabelBackground = "axis-label-background";
|
|
33366
33377
|
}(AXIS_ELEMENT_NAME || (AXIS_ELEMENT_NAME = {}));
|
|
33367
33378
|
var AxisStateValue;
|
|
33368
33379
|
!function (AxisStateValue) {
|
|
@@ -33429,12 +33440,6 @@
|
|
|
33429
33440
|
}
|
|
33430
33441
|
}
|
|
33431
33442
|
};
|
|
33432
|
-
const DEFAULT_AXIS_BREAK_SYMBOL_STYLE = {
|
|
33433
|
-
size: 8,
|
|
33434
|
-
stroke: "#000",
|
|
33435
|
-
lineWidth: 1,
|
|
33436
|
-
zIndex: 1
|
|
33437
|
-
};
|
|
33438
33443
|
|
|
33439
33444
|
const clampRadian = function () {
|
|
33440
33445
|
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
@@ -33466,19 +33471,6 @@
|
|
|
33466
33471
|
y: baseY - dy
|
|
33467
33472
|
};
|
|
33468
33473
|
}
|
|
33469
|
-
function getAxisBreakSymbolAttrs() {
|
|
33470
|
-
let props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
33471
|
-
var _a, _b;
|
|
33472
|
-
const {
|
|
33473
|
-
style = {}
|
|
33474
|
-
} = props,
|
|
33475
|
-
symbolStyle = merge$2({}, DEFAULT_AXIS_BREAK_SYMBOL_STYLE, style),
|
|
33476
|
-
symbolSize = null !== (_a = symbolStyle.size) && void 0 !== _a ? _a : DEFAULT_AXIS_BREAK_SYMBOL_STYLE.size;
|
|
33477
|
-
return Object.assign(Object.assign({}, symbolStyle), {
|
|
33478
|
-
symbolType: null !== (_b = symbolStyle.symbolType) && void 0 !== _b ? _b : `M ${-symbolSize / 2} ${symbolSize / 6} L ${symbolSize / 2} ${-symbolSize / 6}`,
|
|
33479
|
-
symbolSize: symbolSize
|
|
33480
|
-
});
|
|
33481
|
-
}
|
|
33482
33474
|
function getElMap(g) {
|
|
33483
33475
|
const elMap = {};
|
|
33484
33476
|
return traverseGroup(g, el => {
|
|
@@ -34135,7 +34127,7 @@
|
|
|
34135
34127
|
registerGroup(), registerPath();
|
|
34136
34128
|
}
|
|
34137
34129
|
|
|
34138
|
-
var __rest$
|
|
34130
|
+
var __rest$5 = undefined && undefined.__rest || function (s, e) {
|
|
34139
34131
|
var t = {};
|
|
34140
34132
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
34141
34133
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -34151,50 +34143,7 @@
|
|
|
34151
34143
|
}
|
|
34152
34144
|
_renderInner(container) {
|
|
34153
34145
|
var _a;
|
|
34154
|
-
|
|
34155
|
-
const transformedBreaks = [];
|
|
34156
|
-
for (let index = 0; index < this.attribute.breaks.length; index++) {
|
|
34157
|
-
const aBreak = this.attribute.breaks[index],
|
|
34158
|
-
{
|
|
34159
|
-
range: range,
|
|
34160
|
-
breakSymbol: breakSymbol,
|
|
34161
|
-
rawRange: rawRange
|
|
34162
|
-
} = aBreak;
|
|
34163
|
-
transformedBreaks.push({
|
|
34164
|
-
startPoint: this.getTickCoord(range[0]),
|
|
34165
|
-
endPoint: this.getTickCoord(range[1]),
|
|
34166
|
-
range: range,
|
|
34167
|
-
breakSymbol: breakSymbol,
|
|
34168
|
-
rawRange: rawRange
|
|
34169
|
-
});
|
|
34170
|
-
}
|
|
34171
|
-
this._breaks = transformedBreaks;
|
|
34172
|
-
}
|
|
34173
|
-
super._renderInner(container), this._breaks && this._breaks.length && this._breaks.forEach((b, index) => {
|
|
34174
|
-
const {
|
|
34175
|
-
startPoint: startPoint,
|
|
34176
|
-
endPoint: endPoint,
|
|
34177
|
-
breakSymbol: breakSymbol,
|
|
34178
|
-
rawRange: rawRange
|
|
34179
|
-
} = b;
|
|
34180
|
-
if (!1 !== (null == breakSymbol ? void 0 : breakSymbol.visible)) {
|
|
34181
|
-
const axisBreakGroup = graphicCreator.group({
|
|
34182
|
-
zIndex: 99
|
|
34183
|
-
});
|
|
34184
|
-
axisBreakGroup.name = AXIS_ELEMENT_NAME.axisBreak, axisBreakGroup.id = this._getNodeId(`${AXIS_ELEMENT_NAME.axisBreak}-${index}`), axisBreakGroup.data = rawRange;
|
|
34185
|
-
const symbolStyle = getAxisBreakSymbolAttrs(breakSymbol),
|
|
34186
|
-
shape1 = graphicCreator.symbol(Object.assign({
|
|
34187
|
-
x: startPoint.x,
|
|
34188
|
-
y: startPoint.y
|
|
34189
|
-
}, symbolStyle));
|
|
34190
|
-
shape1.name = AXIS_ELEMENT_NAME.axisBreakSymbol;
|
|
34191
|
-
const shape2 = graphicCreator.symbol(Object.assign({
|
|
34192
|
-
x: endPoint.x,
|
|
34193
|
-
y: endPoint.y
|
|
34194
|
-
}, symbolStyle));
|
|
34195
|
-
shape2.name = AXIS_ELEMENT_NAME.axisBreakSymbol, axisBreakGroup.add(shape1), axisBreakGroup.add(shape2), container.add(axisBreakGroup);
|
|
34196
|
-
}
|
|
34197
|
-
});
|
|
34146
|
+
super._renderInner(container);
|
|
34198
34147
|
const {
|
|
34199
34148
|
panel: panel
|
|
34200
34149
|
} = this.attribute;
|
|
@@ -34221,25 +34170,18 @@
|
|
|
34221
34170
|
startSymbol: startSymbol,
|
|
34222
34171
|
endSymbol: endSymbol,
|
|
34223
34172
|
style: style,
|
|
34173
|
+
breakRange: breakRange,
|
|
34174
|
+
breakShape: breakShape,
|
|
34175
|
+
breakShapeStyle: breakShapeStyle,
|
|
34224
34176
|
state: state
|
|
34225
34177
|
} = _a,
|
|
34226
|
-
restLineAttrs = __rest$
|
|
34178
|
+
restLineAttrs = __rest$5(_a, ["startSymbol", "endSymbol", "style", "breakRange", "breakShape", "breakShapeStyle", "state"]),
|
|
34227
34179
|
lineAttrs = Object.assign({
|
|
34180
|
+
points: [start, end],
|
|
34228
34181
|
startSymbol: startSymbol,
|
|
34229
34182
|
endSymbol: endSymbol,
|
|
34230
34183
|
lineStyle: style
|
|
34231
34184
|
}, restLineAttrs);
|
|
34232
|
-
if (this._breaks && this._breaks.length) {
|
|
34233
|
-
const linePoints = [];
|
|
34234
|
-
let lastStartPoint = start;
|
|
34235
|
-
this._breaks.forEach(b => {
|
|
34236
|
-
const {
|
|
34237
|
-
startPoint: startPoint,
|
|
34238
|
-
endPoint: endPoint
|
|
34239
|
-
} = b;
|
|
34240
|
-
linePoints.push([lastStartPoint, startPoint]), lastStartPoint = endPoint;
|
|
34241
|
-
}), linePoints.push([lastStartPoint, end]), lineAttrs.points = linePoints, lineAttrs.multiSegment = !0;
|
|
34242
|
-
} else lineAttrs.points = [start, end];
|
|
34243
34185
|
isEmpty(state) || (lineAttrs.state = {
|
|
34244
34186
|
line: merge$2({}, DEFAULT_STATES$1, state),
|
|
34245
34187
|
symbol: merge$2({}, DEFAULT_STATES$1, state)
|
|
@@ -34260,7 +34202,7 @@
|
|
|
34260
34202
|
state = {},
|
|
34261
34203
|
maxWidth: maxWidth
|
|
34262
34204
|
} = _d,
|
|
34263
|
-
restAttrs = __rest$
|
|
34205
|
+
restAttrs = __rest$5(_d, ["position", "space", "textStyle", "autoRotate", "shape", "background", "state", "maxWidth"]);
|
|
34264
34206
|
let percent = .5;
|
|
34265
34207
|
"start" === position ? percent = 0 : "end" === position && (percent = 1);
|
|
34266
34208
|
const {
|
|
@@ -34556,7 +34498,7 @@
|
|
|
34556
34498
|
}
|
|
34557
34499
|
}
|
|
34558
34500
|
|
|
34559
|
-
var __rest$
|
|
34501
|
+
var __rest$4 = undefined && undefined.__rest || function (s, e) {
|
|
34560
34502
|
var t = {};
|
|
34561
34503
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
34562
34504
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -34615,7 +34557,7 @@
|
|
|
34615
34557
|
background: background,
|
|
34616
34558
|
state = {}
|
|
34617
34559
|
} = _d,
|
|
34618
|
-
restAttrs = __rest$
|
|
34560
|
+
restAttrs = __rest$4(_d, ["space", "textStyle", "shape", "background", "state"]);
|
|
34619
34561
|
let titlePoint = center,
|
|
34620
34562
|
labelHeight = 0;
|
|
34621
34563
|
(null === (_a = this.attribute.label) || void 0 === _a ? void 0 : _a.visible) && !1 === this.attribute.label.inside && (labelHeight = get$1(this.attribute.label, "style.fontSize", 12) + get$1(this.attribute.label, "space", 4));
|
|
@@ -35842,28 +35784,7 @@
|
|
|
35842
35784
|
}
|
|
35843
35785
|
}
|
|
35844
35786
|
|
|
35845
|
-
function getScaleTicks(op, scale, count, getTicks) {
|
|
35846
|
-
let scaleTicks;
|
|
35847
|
-
const {
|
|
35848
|
-
breakData: breakData
|
|
35849
|
-
} = op;
|
|
35850
|
-
if (breakData) {
|
|
35851
|
-
const {
|
|
35852
|
-
range: breakRanges
|
|
35853
|
-
} = breakData(),
|
|
35854
|
-
domain = scale.domain();
|
|
35855
|
-
scaleTicks = [];
|
|
35856
|
-
for (let i = 0; i < domain.length; i++) if (i < domain.length - 1) {
|
|
35857
|
-
getTicks(count, [domain[i], domain[i + 1]]).forEach(tick => {
|
|
35858
|
-
breakRanges.some(breakRange => tick >= breakRange[0] && tick <= breakRange[1]) || scaleTicks.push(tick);
|
|
35859
|
-
});
|
|
35860
|
-
}
|
|
35861
|
-
scale.domain(domain);
|
|
35862
|
-
} else scaleTicks = getTicks(count);
|
|
35863
|
-
return scaleTicks;
|
|
35864
|
-
}
|
|
35865
35787
|
const continuousTicks = (scale, op) => {
|
|
35866
|
-
var _a, _b;
|
|
35867
35788
|
if (!isContinuous(scale.type)) return convertDomainToTickData(scale.domain());
|
|
35868
35789
|
const range = scale.range(),
|
|
35869
35790
|
rangeSize = Math.abs(range[range.length - 1] - range[0]);
|
|
@@ -35873,33 +35794,27 @@
|
|
|
35873
35794
|
forceTickCount: forceTickCount,
|
|
35874
35795
|
tickStep: tickStep,
|
|
35875
35796
|
noDecimals = !1,
|
|
35876
|
-
labelStyle: labelStyle
|
|
35877
|
-
breakData: breakData
|
|
35797
|
+
labelStyle: labelStyle
|
|
35878
35798
|
} = op;
|
|
35879
35799
|
let scaleTicks;
|
|
35880
|
-
if (isValid$1(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$1(forceTickCount)) scaleTicks =
|
|
35881
|
-
const count =
|
|
35800
|
+
if (isValid$1(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$1(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if ("d3" === op.tickMode) {
|
|
35801
|
+
const count = isFunction$1(tickCount) ? tickCount({
|
|
35882
35802
|
axisLength: rangeSize,
|
|
35883
35803
|
labelStyle: labelStyle
|
|
35884
|
-
}) : tickCount
|
|
35885
|
-
scaleTicks =
|
|
35886
|
-
noDecimals: noDecimals
|
|
35887
|
-
}) : scale.d3Ticks(count, {
|
|
35804
|
+
}) : tickCount;
|
|
35805
|
+
scaleTicks = scale.d3Ticks(null != count ? count : 5, {
|
|
35888
35806
|
noDecimals: noDecimals
|
|
35889
|
-
})
|
|
35807
|
+
});
|
|
35890
35808
|
} else {
|
|
35891
|
-
const count =
|
|
35809
|
+
const count = isFunction$1(tickCount) ? tickCount({
|
|
35892
35810
|
axisLength: rangeSize,
|
|
35893
35811
|
labelStyle: labelStyle
|
|
35894
|
-
}) : tickCount
|
|
35812
|
+
}) : tickCount,
|
|
35895
35813
|
customTicks = isFunction$1(op.tickMode) ? op.tickMode : void 0;
|
|
35896
|
-
scaleTicks =
|
|
35814
|
+
scaleTicks = scale.ticks(null != count ? count : 5, {
|
|
35897
35815
|
noDecimals: noDecimals,
|
|
35898
35816
|
customTicks: customTicks
|
|
35899
|
-
})
|
|
35900
|
-
noDecimals: noDecimals,
|
|
35901
|
-
customTicks: customTicks
|
|
35902
|
-
}));
|
|
35817
|
+
});
|
|
35903
35818
|
}
|
|
35904
35819
|
if (op.sampling && ("cartesian" === op.coordinateType || "polar" === op.coordinateType && "radius" === op.axisOrientType)) {
|
|
35905
35820
|
const {
|
|
@@ -35910,8 +35825,7 @@
|
|
|
35910
35825
|
AABBBounds: bounds,
|
|
35911
35826
|
value: scaleTicks[i]
|
|
35912
35827
|
}));
|
|
35913
|
-
|
|
35914
|
-
for (; items.length >= 3 && hasOverlap$1(items, labelGap);) items = samplingMethod(items, labelGap);
|
|
35828
|
+
for (; items.length >= 3 && hasOverlap$1(items, labelGap);) items = methods$1.parity(items);
|
|
35915
35829
|
const ticks = items.map(item => item.value);
|
|
35916
35830
|
ticks.length < 3 && labelFlush && (ticks.length > 1 && ticks.pop(), last(ticks) !== last(scaleTicks) && ticks.push(last(scaleTicks))), scaleTicks = ticks;
|
|
35917
35831
|
}
|
|
@@ -36409,7 +36323,7 @@
|
|
|
36409
36323
|
}
|
|
36410
36324
|
mixin(LineAxisGrid, LineAxisMixin);
|
|
36411
36325
|
|
|
36412
|
-
var __rest$
|
|
36326
|
+
var __rest$3 = undefined && undefined.__rest || function (s, e) {
|
|
36413
36327
|
var t = {};
|
|
36414
36328
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
36415
36329
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -36435,7 +36349,7 @@
|
|
|
36435
36349
|
center: center,
|
|
36436
36350
|
subGrid: subGrid
|
|
36437
36351
|
} = _a,
|
|
36438
|
-
grid = __rest$
|
|
36352
|
+
grid = __rest$3(_a, ["radius", "innerRadius", "startAngle", "endAngle", "center", "subGrid"]),
|
|
36439
36353
|
{
|
|
36440
36354
|
alignWithLabel = !0
|
|
36441
36355
|
} = grid || {},
|
|
@@ -36628,7 +36542,7 @@
|
|
|
36628
36542
|
loadTagComponent(), registerRect(), registerSymbol(), registerArea(), registerLine();
|
|
36629
36543
|
}
|
|
36630
36544
|
|
|
36631
|
-
var __rest$
|
|
36545
|
+
var __rest$2 = undefined && undefined.__rest || function (s, e) {
|
|
36632
36546
|
var t = {};
|
|
36633
36547
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
36634
36548
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -36837,11 +36751,11 @@
|
|
|
36837
36751
|
{
|
|
36838
36752
|
formatMethod: startTextFormat
|
|
36839
36753
|
} = startTextStyle,
|
|
36840
|
-
restStartTextStyle = __rest$
|
|
36754
|
+
restStartTextStyle = __rest$2(startTextStyle, ["formatMethod"]),
|
|
36841
36755
|
{
|
|
36842
36756
|
formatMethod: endTextFormat
|
|
36843
36757
|
} = endTextStyle,
|
|
36844
|
-
restEndTextStyle = __rest$
|
|
36758
|
+
restEndTextStyle = __rest$2(endTextStyle, ["formatMethod"]),
|
|
36845
36759
|
{
|
|
36846
36760
|
start: start,
|
|
36847
36761
|
end: end
|
|
@@ -39347,7 +39261,7 @@
|
|
|
39347
39261
|
loadBaseLegend(), loadSliderComponent(), registerPath();
|
|
39348
39262
|
}
|
|
39349
39263
|
|
|
39350
|
-
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
39264
|
+
var __rest$1 = undefined && undefined.__rest || function (s, e) {
|
|
39351
39265
|
var t = {};
|
|
39352
39266
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
39353
39267
|
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
@@ -39797,7 +39711,7 @@
|
|
|
39797
39711
|
space: pagerSpace = DEFAULT_PAGER_SPACE,
|
|
39798
39712
|
defaultCurrent = 1
|
|
39799
39713
|
} = pager,
|
|
39800
|
-
compStyle = __rest(pager, ["space", "defaultCurrent"]),
|
|
39714
|
+
compStyle = __rest$1(pager, ["space", "defaultCurrent"]),
|
|
39801
39715
|
{
|
|
39802
39716
|
isHorizontal: isHorizontal
|
|
39803
39717
|
} = this._itemContext;
|
|
@@ -39865,7 +39779,7 @@
|
|
|
39865
39779
|
space: pagerSpace = DEFAULT_PAGER_SPACE,
|
|
39866
39780
|
defaultCurrent = 1
|
|
39867
39781
|
} = pager,
|
|
39868
|
-
compStyle = __rest(pager, ["space", "defaultCurrent"]),
|
|
39782
|
+
compStyle = __rest$1(pager, ["space", "defaultCurrent"]),
|
|
39869
39783
|
{
|
|
39870
39784
|
isHorizontal: isHorizontal
|
|
39871
39785
|
} = this._itemContext;
|
|
@@ -48866,6 +48780,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
48866
48780
|
isProgressive() {
|
|
48867
48781
|
return this.renderContext && (!!this.renderContext.progressive || !!this.renderContext.beforeTransformProgressive);
|
|
48868
48782
|
}
|
|
48783
|
+
canAnimateAfterProgressive() {
|
|
48784
|
+
return this.renderContext && this.renderContext.beforeTransformProgressive && this.renderContext.beforeTransformProgressive.canAnimate();
|
|
48785
|
+
}
|
|
48869
48786
|
isDoingProgressive() {
|
|
48870
48787
|
return this.renderContext && (this.renderContext.progressive && this.renderContext.progressive.currentIndex < this.renderContext.progressive.totalStep || this.renderContext.beforeTransformProgressive && this.renderContext.beforeTransformProgressive.unfinished());
|
|
48871
48788
|
}
|
|
@@ -50466,10 +50383,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
50466
50383
|
var _b;
|
|
50467
50384
|
const matched = 1 === diff.prev.length && 1 === diff.next.length && diff.prev[0].markType === diff.next[0].markType,
|
|
50468
50385
|
enableMarkMorphConfig = diff.prev.every(mark => mark.getMorphConfig().morph) && diff.next.every(mark => mark.getMorphConfig().morph);
|
|
50469
|
-
|
|
50386
|
+
runningConfig.morph && enableMarkMorphConfig || runningConfig.morphAll ? null === (_b = this.addMorphMarks) || void 0 === _b || _b.call(this, {
|
|
50470
50387
|
prev: diff.prev,
|
|
50471
50388
|
next: diff.next
|
|
50472
|
-
}));
|
|
50389
|
+
}) : matched && runningConfig.reuse && (diff.next[0].reuse(diff.prev[0]), diff.prev[0].detachAll(), diff.prev[0].clear(), this._cachedGrammars.unrecord(diff.prev[0]));
|
|
50473
50390
|
});
|
|
50474
50391
|
}
|
|
50475
50392
|
detachCachedGrammar() {
|
|
@@ -50646,7 +50563,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
50646
50563
|
if (this._progressiveMarks && this._progressiveMarks.some(mark => mark.isDoingProgressive())) {
|
|
50647
50564
|
const raf = vglobal.getRequestAnimationFrame();
|
|
50648
50565
|
this._progressiveRafId = raf(this.handleProgressiveFrame);
|
|
50649
|
-
}
|
|
50566
|
+
} else this._progressiveMarks && this._progressiveMarks.every(mark => mark.canAnimateAfterProgressive()) ? this.animate.animate() : this._progressiveMarks && (this._progressiveMarks = null);
|
|
50650
50567
|
}
|
|
50651
50568
|
clearProgressive() {
|
|
50652
50569
|
if (this._progressiveRafId) {
|
|
@@ -51884,6 +51801,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
51884
51801
|
Factory.registerGraphicComponent(AxisEnum.circleAxis, attrs => new CircleAxis(attrs)), Factory.registerComponent(ComponentEnum.axis, Axis);
|
|
51885
51802
|
};
|
|
51886
51803
|
|
|
51804
|
+
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
51805
|
+
var t = {};
|
|
51806
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
51807
|
+
if (null != s && "function" == typeof Object.getOwnPropertySymbols) {
|
|
51808
|
+
var i = 0;
|
|
51809
|
+
for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]);
|
|
51810
|
+
}
|
|
51811
|
+
return t;
|
|
51812
|
+
};
|
|
51887
51813
|
const generateLabelAttributes = function (marks, groupSize, encoder, labelStyle, parameters) {
|
|
51888
51814
|
let theme = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
|
51889
51815
|
var _a;
|
|
@@ -51924,34 +51850,44 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
51924
51850
|
}
|
|
51925
51851
|
const data = null !== (_b = addition.data) && void 0 !== _b ? _b : [],
|
|
51926
51852
|
themeDatum = null !== (_d = null === (_c = null == currentTheme ? void 0 : currentTheme.data) || void 0 === _c ? void 0 : _c[0]) && void 0 !== _d ? _d : {};
|
|
51927
|
-
data && data.length > 0
|
|
51853
|
+
if (data && data.length > 0) data.forEach((d, index) => {
|
|
51928
51854
|
if (mark.elements[index]) {
|
|
51929
51855
|
const attributes = invokeEncoder(encoder, d, mark.elements[index], labelParameters);
|
|
51930
51856
|
merge$2(d, themeDatum, attributes);
|
|
51931
51857
|
}
|
|
51932
|
-
})
|
|
51933
|
-
|
|
51934
|
-
|
|
51935
|
-
|
|
51936
|
-
|
|
51858
|
+
});else {
|
|
51859
|
+
const mergeAttributes = (attributes, themeDatum) => {
|
|
51860
|
+
const {
|
|
51861
|
+
data: labelData
|
|
51862
|
+
} = attributes,
|
|
51863
|
+
restAttribute = __rest(attributes, ["data"]);
|
|
51864
|
+
return Object.assign(Object.assign({}, merge$2({}, themeDatum, restAttribute)), {
|
|
51865
|
+
data: labelData
|
|
51937
51866
|
});
|
|
51938
|
-
}
|
|
51939
|
-
|
|
51940
|
-
|
|
51941
|
-
|
|
51942
|
-
|
|
51943
|
-
|
|
51944
|
-
|
|
51945
|
-
|
|
51946
|
-
|
|
51947
|
-
|
|
51948
|
-
|
|
51949
|
-
|
|
51950
|
-
|
|
51951
|
-
|
|
51952
|
-
|
|
51953
|
-
|
|
51954
|
-
|
|
51867
|
+
};
|
|
51868
|
+
mark.elements.forEach(element => {
|
|
51869
|
+
if ("willRelease" !== element.getGraphicItem().releaseStatus) if (mark.isCollectionMark()) {
|
|
51870
|
+
element.getDatum().forEach(entry => {
|
|
51871
|
+
const attributes = invokeEncoder(encoder, entry, element, labelParameters);
|
|
51872
|
+
data.push(mergeAttributes(attributes, themeDatum));
|
|
51873
|
+
});
|
|
51874
|
+
} else {
|
|
51875
|
+
const attributes = invokeEncoder(encoder, element.getDatum(), element, labelParameters);
|
|
51876
|
+
data.push(mergeAttributes(attributes, themeDatum));
|
|
51877
|
+
}
|
|
51878
|
+
});
|
|
51879
|
+
}
|
|
51880
|
+
const graphicItemName = null === (_e = mark.graphicItem) || void 0 === _e ? void 0 : _e.name,
|
|
51881
|
+
result = merge$2({}, currentTheme, {
|
|
51882
|
+
baseMarkGroupName: graphicItemName,
|
|
51883
|
+
getBaseMarks: () => mark.elements.map(element => element.getGraphicItem())
|
|
51884
|
+
}, null != addition ? addition : {});
|
|
51885
|
+
return result.data = null != data ? data : currentTheme.data, result;
|
|
51886
|
+
}).filter(label => !isNil$1(label)),
|
|
51887
|
+
result = merge$2({}, labelTheme, {
|
|
51888
|
+
size: groupSize
|
|
51889
|
+
});
|
|
51890
|
+
return result.dataLabels = dataLabels, result;
|
|
51955
51891
|
};
|
|
51956
51892
|
let Label$1 = class Label extends Component {
|
|
51957
51893
|
constructor(view, group) {
|
|
@@ -54392,11 +54328,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
54392
54328
|
if (!chart) {
|
|
54393
54329
|
return null;
|
|
54394
54330
|
}
|
|
54395
|
-
const { x, y } = pos;
|
|
54396
54331
|
const angleAxisList = getAxis(chart, (cmp) => cmp.getOrient() === 'angle', pos);
|
|
54397
54332
|
const radiusAxisList = getAxis(chart, (cmp) => cmp.getOrient() === 'radius', pos);
|
|
54333
|
+
if ((!angleAxisList || !angleAxisList.length) && (!radiusAxisList || !radiusAxisList.length)) {
|
|
54334
|
+
return null;
|
|
54335
|
+
}
|
|
54398
54336
|
const targetAxisInfo = [];
|
|
54399
54337
|
const getDimensionField = (series) => series.getDimensionField()[0];
|
|
54338
|
+
const { x, y } = pos;
|
|
54400
54339
|
if (angleAxisList) {
|
|
54401
54340
|
angleAxisList.forEach(axis => {
|
|
54402
54341
|
var _a;
|
|
@@ -54539,6 +54478,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
54539
54478
|
const { x, y } = pos;
|
|
54540
54479
|
const xAxisList = (_a = getAxis(chart, (cmp) => isXAxis(cmp.getOrient()), pos)) !== null && _a !== void 0 ? _a : [];
|
|
54541
54480
|
const yAxisList = (_b = getAxis(chart, (cmp) => isYAxis(cmp.getOrient()), pos)) !== null && _b !== void 0 ? _b : [];
|
|
54481
|
+
if (!xAxisList.length && !yAxisList.length) {
|
|
54482
|
+
return null;
|
|
54483
|
+
}
|
|
54542
54484
|
const bandAxisSet = new Set();
|
|
54543
54485
|
const linearAxisSet = new Set();
|
|
54544
54486
|
const forceAxisSet = new Set();
|
|
@@ -54562,14 +54504,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
54562
54504
|
axisList.forEach(axis => {
|
|
54563
54505
|
if (forceAxisSet.size > 0) {
|
|
54564
54506
|
if (forceAxisSet.has(axis)) {
|
|
54565
|
-
const info = getDimensionInfoByPosition(axis, posValue,
|
|
54507
|
+
const info = getDimensionInfoByPosition(axis, posValue, getDimensionFieldFunc(isXAxis, isDiscrete(axis.getScale().type)));
|
|
54566
54508
|
info && targetAxisInfo.push(info);
|
|
54567
54509
|
}
|
|
54568
54510
|
}
|
|
54569
54511
|
else {
|
|
54570
54512
|
const hasDiscreteAxis = bandAxisSet.size > 0;
|
|
54571
54513
|
if ((hasDiscreteAxis ? bandAxisSet : linearAxisSet).has(axis)) {
|
|
54572
|
-
const info = getDimensionInfoByPosition(axis, posValue,
|
|
54514
|
+
const info = getDimensionInfoByPosition(axis, posValue, getDimensionFieldFunc(isXAxis, hasDiscreteAxis));
|
|
54573
54515
|
info && targetAxisInfo.push(info);
|
|
54574
54516
|
}
|
|
54575
54517
|
}
|
|
@@ -54592,7 +54534,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
54592
54534
|
}
|
|
54593
54535
|
return targetAxisInfo;
|
|
54594
54536
|
};
|
|
54595
|
-
const getDimensionInfoByPosition = (axis, posValue,
|
|
54537
|
+
const getDimensionInfoByPosition = (axis, posValue, getDimensionField) => {
|
|
54596
54538
|
const value = axis.positionToData(posValue, true);
|
|
54597
54539
|
return isNil$1(value) ? null : getDimensionInfoByValue(axis, value, getDimensionField);
|
|
54598
54540
|
};
|
|
@@ -58873,7 +58815,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58873
58815
|
this._product.encode(updateStyles, true);
|
|
58874
58816
|
}
|
|
58875
58817
|
_separateStyle() {
|
|
58876
|
-
const _a = this.stateStyle, _b = STATE_VALUE_ENUM.STATE_NORMAL, normalStyle = _a[_b]; __rest$
|
|
58818
|
+
const _a = this.stateStyle, _b = STATE_VALUE_ENUM.STATE_NORMAL, normalStyle = _a[_b]; __rest$e(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
58877
58819
|
const enterStyles = this._option.noSeparateStyle ? null : {};
|
|
58878
58820
|
const updateStyles = {};
|
|
58879
58821
|
Object.keys(normalStyle).forEach(key => {
|
|
@@ -58893,7 +58835,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58893
58835
|
return { enterStyles, updateStyles };
|
|
58894
58836
|
}
|
|
58895
58837
|
compileEncode() {
|
|
58896
|
-
const _a = this.stateStyle, _b = STATE_VALUE_ENUM.STATE_NORMAL; _a[_b]; const temp = __rest$
|
|
58838
|
+
const _a = this.stateStyle, _b = STATE_VALUE_ENUM.STATE_NORMAL; _a[_b]; const temp = __rest$e(_a, [typeof _b === "symbol" ? _b : _b + ""]);
|
|
58897
58839
|
const { enterStyles, updateStyles } = this._separateStyle();
|
|
58898
58840
|
this._product.encode(updateStyles, true);
|
|
58899
58841
|
this._product.encodeState('group', enterStyles, true);
|
|
@@ -59338,7 +59280,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59338
59280
|
}
|
|
59339
59281
|
_computeGradientAttr(gradientStyle) {
|
|
59340
59282
|
var _a, _b;
|
|
59341
|
-
const { gradient, scale, field } = gradientStyle, rest = __rest$
|
|
59283
|
+
const { gradient, scale, field } = gradientStyle, rest = __rest$e(gradientStyle, ["gradient", "scale", "field"]);
|
|
59342
59284
|
let colorScale = scale;
|
|
59343
59285
|
let colorField = field;
|
|
59344
59286
|
if ((!scale || !field) && this.model.modelType === 'series') {
|
|
@@ -59385,7 +59327,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59385
59327
|
};
|
|
59386
59328
|
}
|
|
59387
59329
|
_computeBorderAttr(borderStyle) {
|
|
59388
|
-
const { scale, field } = borderStyle, mergedStyle = __rest$
|
|
59330
|
+
const { scale, field } = borderStyle, mergedStyle = __rest$e(borderStyle, ["scale", "field"]);
|
|
59389
59331
|
return (data, opt) => {
|
|
59390
59332
|
var _a, _b, _c;
|
|
59391
59333
|
const computeStyle = {};
|
|
@@ -59792,7 +59734,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59792
59734
|
};
|
|
59793
59735
|
this._option = merge$2(this._option, { animation: spec.animation !== false }, options);
|
|
59794
59736
|
this._onError = (_a = this._option) === null || _a === void 0 ? void 0 : _a.onError;
|
|
59795
|
-
const _g = this._option, { dom, renderCanvas, mode, stage, poptip } = _g, restOptions = __rest$
|
|
59737
|
+
const _g = this._option, { dom, renderCanvas, mode, stage, poptip } = _g, restOptions = __rest$e(_g, ["dom", "renderCanvas", "mode", "stage", "poptip"]);
|
|
59796
59738
|
const isTrueBrowseEnv = isTrueBrowser(mode);
|
|
59797
59739
|
if (isTrueBrowseEnv) {
|
|
59798
59740
|
registerBrowserEnv();
|
|
@@ -60944,7 +60886,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60944
60886
|
};
|
|
60945
60887
|
registerVChartCore();
|
|
60946
60888
|
|
|
60947
|
-
const version = "1.12.2
|
|
60889
|
+
const version = "1.12.2";
|
|
60948
60890
|
|
|
60949
60891
|
const addVChartProperty = (data, op) => {
|
|
60950
60892
|
const context = op.beforeCall();
|
|
@@ -60971,28 +60913,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60971
60913
|
}
|
|
60972
60914
|
}
|
|
60973
60915
|
|
|
60974
|
-
const getTooltipActualActiveType = (spec) => {
|
|
60975
|
-
var _a, _b, _c;
|
|
60976
|
-
if ((spec === null || spec === void 0 ? void 0 : spec.visible) === false) {
|
|
60977
|
-
return [];
|
|
60978
|
-
}
|
|
60979
|
-
const activeTypeMap = {
|
|
60980
|
-
mark: ((_a = spec === null || spec === void 0 ? void 0 : spec.mark) === null || _a === void 0 ? void 0 : _a.visible) !== false,
|
|
60981
|
-
dimension: ((_b = spec === null || spec === void 0 ? void 0 : spec.dimension) === null || _b === void 0 ? void 0 : _b.visible) !== false,
|
|
60982
|
-
group: ((_c = spec === null || spec === void 0 ? void 0 : spec.group) === null || _c === void 0 ? void 0 : _c.visible) !== false
|
|
60983
|
-
};
|
|
60984
|
-
if (isValid$1(spec === null || spec === void 0 ? void 0 : spec.activeType)) {
|
|
60985
|
-
Object.keys(activeTypeMap).forEach(t => {
|
|
60986
|
-
var _a;
|
|
60987
|
-
activeTypeMap[t] = (_a = spec === null || spec === void 0 ? void 0 : spec.activeType) === null || _a === void 0 ? void 0 : _a.includes(t);
|
|
60988
|
-
});
|
|
60989
|
-
}
|
|
60990
|
-
return Object.keys(activeTypeMap).filter(t => activeTypeMap[t]);
|
|
60991
|
-
};
|
|
60992
|
-
function isEmptyPos(params) {
|
|
60993
|
-
return isNil$1(params.mark) && isNil$1(params.model) && isNil$1(params.datum);
|
|
60994
|
-
}
|
|
60995
|
-
|
|
60996
60916
|
class BaseSeriesTooltipHelper extends BaseTooltipHelper {
|
|
60997
60917
|
constructor(series) {
|
|
60998
60918
|
super();
|
|
@@ -61071,22 +60991,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61071
60991
|
this.updateTooltipSpec();
|
|
61072
60992
|
}
|
|
61073
60993
|
updateTooltipSpec() {
|
|
61074
|
-
var _a
|
|
61075
|
-
const seriesTooltipSpec = (
|
|
61076
|
-
|
|
61077
|
-
const spec = Object.assign(Object.assign({}, chartTooltipSpec), seriesTooltipSpec);
|
|
61078
|
-
['mark', 'dimension', 'group'].forEach(activeType => {
|
|
61079
|
-
const pattern = spec[activeType];
|
|
61080
|
-
if (isValid$1(pattern)) {
|
|
61081
|
-
spec[activeType] = Object.assign(Object.assign({}, pattern), { title: addExtraInfoToTooltipTitlePattern(pattern.title, {
|
|
61082
|
-
seriesId: this.series.id
|
|
61083
|
-
}, true), content: addExtraInfoToTooltipContentPattern(pattern.content, {
|
|
61084
|
-
seriesId: this.series.id
|
|
61085
|
-
}, true) });
|
|
61086
|
-
}
|
|
61087
|
-
});
|
|
61088
|
-
this.spec = spec;
|
|
61089
|
-
this.activeType = getTooltipActualActiveType(spec);
|
|
60994
|
+
var _a;
|
|
60995
|
+
const seriesTooltipSpec = (_a = this.series.getSpec()) === null || _a === void 0 ? void 0 : _a.tooltip;
|
|
60996
|
+
this.spec = seriesTooltipSpec;
|
|
61090
60997
|
this._seriesCacheInfo = this._getSeriesCacheInfo();
|
|
61091
60998
|
}
|
|
61092
60999
|
getDefaultTooltipPattern(activeType, dimensionInfo) {
|
|
@@ -61167,26 +61074,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61167
61074
|
return null;
|
|
61168
61075
|
}
|
|
61169
61076
|
}
|
|
61170
|
-
const merge = (source, extraInfo, overwrite) => {
|
|
61171
|
-
const info = isFunction$1(extraInfo) ? extraInfo(source) : extraInfo;
|
|
61172
|
-
return overwrite ? Object.assign(Object.assign({}, source), info) : Object.assign(Object.assign({}, info), source);
|
|
61173
|
-
};
|
|
61174
|
-
const addExtraInfoToTooltipTitlePattern = (pattern, extraInfo, overwrite) => {
|
|
61175
|
-
const result = isValid$1(pattern)
|
|
61176
|
-
? isFunction$1(pattern)
|
|
61177
|
-
? (...args) => merge(pattern(...args), extraInfo, overwrite)
|
|
61178
|
-
: merge(pattern, extraInfo, overwrite)
|
|
61179
|
-
: undefined;
|
|
61180
|
-
return result;
|
|
61181
|
-
};
|
|
61182
|
-
const addExtraInfoToTooltipContentPattern = (pattern, extraInfo, overwrite) => {
|
|
61183
|
-
const result = isValid$1(pattern)
|
|
61184
|
-
? array(pattern).map(patternItem => isFunction$1(patternItem)
|
|
61185
|
-
? (...args) => array(patternItem(...args)).map(line => merge(line, extraInfo, overwrite))
|
|
61186
|
-
: merge(patternItem, extraInfo, overwrite))
|
|
61187
|
-
: undefined;
|
|
61188
|
-
return result;
|
|
61189
|
-
};
|
|
61190
61077
|
|
|
61191
61078
|
const methods = {
|
|
61192
61079
|
min: (arr) => {
|
|
@@ -61521,10 +61408,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61521
61408
|
update: [
|
|
61522
61409
|
{
|
|
61523
61410
|
type: 'update',
|
|
61524
|
-
options: { excludeChannels: ['points', 'defined'] }
|
|
61411
|
+
options: { excludeChannels: ['points', 'defined', 'segments'] }
|
|
61525
61412
|
},
|
|
61526
61413
|
{
|
|
61527
|
-
channel: ['points'],
|
|
61414
|
+
channel: ['points', 'segments'],
|
|
61528
61415
|
custom: TagPointsUpdate,
|
|
61529
61416
|
duration: DEFAULT_ANIMATION_CONFIG.update.duration,
|
|
61530
61417
|
easing: DEFAULT_ANIMATION_CONFIG.update.easing,
|
|
@@ -61589,7 +61476,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61589
61476
|
View.useRegisters([registerGrowPointsInAnimation, registerGrowPointsOutAnimation]);
|
|
61590
61477
|
};
|
|
61591
61478
|
|
|
61592
|
-
const AnimationStates = Object.keys(DEFAULT_ANIMATION_CONFIG);
|
|
61479
|
+
const AnimationStates = [...Object.keys(DEFAULT_ANIMATION_CONFIG), 'normal'];
|
|
61593
61480
|
function animationConfig(defaultConfig = {}, userConfig, params) {
|
|
61594
61481
|
const config = {};
|
|
61595
61482
|
for (let i = 0; i < AnimationStates.length; i++) {
|
|
@@ -63857,13 +63744,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63857
63744
|
}
|
|
63858
63745
|
|
|
63859
63746
|
function isValidAlignDomain(domain) {
|
|
63860
|
-
return domain.length === 2 && isValidNumber$1(domain[0]) && isValidNumber$1(
|
|
63747
|
+
return domain.length === 2 && isValidNumber$1(domain[0]) && isValidNumber$1(domain[1]) && domain[1] >= domain[0];
|
|
63861
63748
|
}
|
|
63862
63749
|
function getScaleInfo(axis, domain) {
|
|
63863
|
-
const total =
|
|
63864
|
-
const includeZero =
|
|
63750
|
+
const total = domain[1] - domain[0];
|
|
63751
|
+
const includeZero = domain[1] * domain[0] < 0;
|
|
63865
63752
|
let negative = domain[0] <= 0 ? 0 - domain[0] : 0;
|
|
63866
|
-
let positive =
|
|
63753
|
+
let positive = domain[1] > 0 ? domain[1] - 0 : 0;
|
|
63867
63754
|
if (total === 0) {
|
|
63868
63755
|
if (domain[0] < 0) {
|
|
63869
63756
|
negative = 1;
|
|
@@ -64098,12 +63985,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64098
63985
|
return data;
|
|
64099
63986
|
}
|
|
64100
63987
|
const targetDomain = targetScale.domain();
|
|
64101
|
-
const targetRange =
|
|
63988
|
+
const targetRange = targetDomain[1] - targetDomain[0];
|
|
64102
63989
|
if (targetRange === 0) {
|
|
64103
63990
|
return data;
|
|
64104
63991
|
}
|
|
64105
63992
|
const currentDomain = currentScale.domain();
|
|
64106
|
-
const currentRange =
|
|
63993
|
+
const currentRange = currentDomain[1] - currentDomain[0];
|
|
64107
63994
|
if (targetRange === 0) {
|
|
64108
63995
|
return data;
|
|
64109
63996
|
}
|
|
@@ -64442,7 +64329,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64442
64329
|
|
|
64443
64330
|
class BaseComponent extends LayoutModel {
|
|
64444
64331
|
static createComponent(specInfo, options) {
|
|
64445
|
-
const { spec } = specInfo, others = __rest$
|
|
64332
|
+
const { spec } = specInfo, others = __rest$e(specInfo, ["spec"]);
|
|
64446
64333
|
return new this(spec, Object.assign(Object.assign({}, options), others));
|
|
64447
64334
|
}
|
|
64448
64335
|
getRegions() {
|
|
@@ -64723,16 +64610,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64723
64610
|
}
|
|
64724
64611
|
else if (viewData && viewData.latestData && viewData.latestData.length) {
|
|
64725
64612
|
const seriesData = (_a = s.getViewDataStatistics) === null || _a === void 0 ? void 0 : _a.call(s);
|
|
64726
|
-
const userSetBreaks = this.type === ComponentTypeEnum.cartesianLinearAxis && this._spec.breaks && this._spec.breaks.length;
|
|
64727
64613
|
field.forEach(f => {
|
|
64728
64614
|
var _a;
|
|
64729
64615
|
if ((_a = seriesData === null || seriesData === void 0 ? void 0 : seriesData.latestData) === null || _a === void 0 ? void 0 : _a[f]) {
|
|
64730
|
-
|
|
64731
|
-
data.push(Object.assign(Object.assign({}, seriesData.latestData[f]), { values: viewData.latestData.map((obj) => obj[f]) }));
|
|
64732
|
-
}
|
|
64733
|
-
else {
|
|
64734
|
-
data.push(seriesData.latestData[f]);
|
|
64735
|
-
}
|
|
64616
|
+
data.push(seriesData.latestData[f]);
|
|
64736
64617
|
}
|
|
64737
64618
|
});
|
|
64738
64619
|
}
|
|
@@ -64943,7 +64824,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64943
64824
|
};
|
|
64944
64825
|
}
|
|
64945
64826
|
if (spec.title && spec.title.visible) {
|
|
64946
|
-
const _a = spec.title, { autoRotate, angle, style: titleStyle = {}, background: titleBackgroundSpec, state: titleState, shape: titleShapeSpec } = _a, restTitleAttrs = __rest$
|
|
64827
|
+
const _a = spec.title, { autoRotate, angle, style: titleStyle = {}, background: titleBackgroundSpec, state: titleState, shape: titleShapeSpec } = _a, restTitleAttrs = __rest$e(_a, ["autoRotate", "angle", "style", "background", "state", "shape"]);
|
|
64947
64828
|
let titleAngle = angle;
|
|
64948
64829
|
let titleTextStyle;
|
|
64949
64830
|
if (spec.orient === 'left' || spec.orient === 'right') {
|
|
@@ -65180,7 +65061,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65180
65061
|
};
|
|
65181
65062
|
this._updateAxisLayout = () => {
|
|
65182
65063
|
const startPoint = this.getLayoutStartPoint();
|
|
65183
|
-
const _a = this._getUpdateAttribute(false), { grid: updateGridAttrs } = _a, updateAxisAttrs = __rest$
|
|
65064
|
+
const _a = this._getUpdateAttribute(false), { grid: updateGridAttrs } = _a, updateAxisAttrs = __rest$e(_a, ["grid"]);
|
|
65184
65065
|
const axisProduct = this._axisMark.getProduct();
|
|
65185
65066
|
const axisAttrs = mergeSpec({ x: startPoint.x, y: startPoint.y }, this._axisStyle, updateAxisAttrs);
|
|
65186
65067
|
axisProduct.encode(axisAttrs);
|
|
@@ -65203,7 +65084,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65203
65084
|
? (_a = item
|
|
65204
65085
|
.getTickData()
|
|
65205
65086
|
.getLatestData()) === null || _a === void 0 ? void 0 : _a.find((d) => d.value === 0)
|
|
65206
|
-
: item.getScale().domain()[0] <= 0 &&
|
|
65087
|
+
: item.getScale().domain()[0] <= 0 && item.getScale().domain()[1] >= 0));
|
|
65207
65088
|
};
|
|
65208
65089
|
const relativeAxes = axesComponents.filter(item => isValidAxis(item));
|
|
65209
65090
|
if (relativeAxes.length) {
|
|
@@ -65293,7 +65174,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65293
65174
|
return specInfos;
|
|
65294
65175
|
}
|
|
65295
65176
|
static createComponent(specInfo, options) {
|
|
65296
|
-
const { spec } = specInfo, others = __rest$
|
|
65177
|
+
const { spec } = specInfo, others = __rest$e(specInfo, ["spec"]);
|
|
65297
65178
|
const C = Factory$1.getComponentInKey(others.type);
|
|
65298
65179
|
if (C) {
|
|
65299
65180
|
return new C(spec, Object.assign(Object.assign({}, options), others));
|
|
@@ -65309,7 +65190,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65309
65190
|
setLayout3dBox(box3d) {
|
|
65310
65191
|
this.layout3dBox = box3d;
|
|
65311
65192
|
}
|
|
65312
|
-
|
|
65193
|
+
updateScaleRange() {
|
|
65194
|
+
let isScaleChange = false;
|
|
65313
65195
|
const { width, height } = this.getLayoutRect();
|
|
65314
65196
|
const { left, right, top, bottom } = this._innerOffset;
|
|
65315
65197
|
let newRange = [];
|
|
@@ -65329,16 +65211,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65329
65211
|
newRange = this._inverse ? [top, height - bottom] : [height - bottom, top];
|
|
65330
65212
|
}
|
|
65331
65213
|
}
|
|
65332
|
-
|
|
65333
|
-
|
|
65334
|
-
updateScaleRange() {
|
|
65335
|
-
let isScaleChange = false;
|
|
65336
|
-
const newRange = this.getNewScaleRange();
|
|
65337
|
-
const range = this._scale.range();
|
|
65338
|
-
if (newRange.length === range.length && newRange.every((value, index) => value === range[index])) {
|
|
65339
|
-
isScaleChange = false;
|
|
65340
|
-
}
|
|
65341
|
-
else {
|
|
65214
|
+
const [start, end] = this._scale.range();
|
|
65215
|
+
if (newRange[0] !== start || newRange[1] !== end) {
|
|
65342
65216
|
isScaleChange = true;
|
|
65343
65217
|
this._scale.range(newRange);
|
|
65344
65218
|
}
|
|
@@ -65574,7 +65448,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65574
65448
|
: clamp$1(pos, this._innerOffset.top, this.getLayoutRect().height - this._innerOffset.bottom);
|
|
65575
65449
|
}
|
|
65576
65450
|
const range = this._scale.range();
|
|
65577
|
-
if ((pos - range[0]) * (pos -
|
|
65451
|
+
if ((pos - range[0]) * (pos - range[1]) > 0) {
|
|
65578
65452
|
return null;
|
|
65579
65453
|
}
|
|
65580
65454
|
return this._scale.invert(pos);
|
|
@@ -65713,14 +65587,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65713
65587
|
const normalizedValue = this._getNormalizedValue([obj.value], length);
|
|
65714
65588
|
return getAxisItem(obj.value, normalizedValue);
|
|
65715
65589
|
})
|
|
65716
|
-
.filter((entry) =>
|
|
65717
|
-
const { value, rawValue } = entry;
|
|
65718
|
-
const domain = this._scale.domain();
|
|
65719
|
-
if (isContinuous(this._scale.type)) {
|
|
65720
|
-
return rawValue >= domain[0] && rawValue <= last(domain);
|
|
65721
|
-
}
|
|
65722
|
-
return domain.includes(rawValue);
|
|
65723
|
-
})
|
|
65590
|
+
.filter((entry) => entry.value >= 0 && entry.value <= 1)
|
|
65724
65591
|
];
|
|
65725
65592
|
}
|
|
65726
65593
|
return [];
|
|
@@ -65749,21 +65616,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65749
65616
|
});
|
|
65750
65617
|
if (this._autoIndentOnce && this._hasAutoIndent) {
|
|
65751
65618
|
['x1', 'x2', 'y1', 'y2'].forEach(key => {
|
|
65752
|
-
this.layout.getLastComputeOutBounds()[key] =
|
|
65753
|
-
this._layoutCache._lastComputeOutBounds[key];
|
|
65619
|
+
this.layout.getLastComputeOutBounds()[key] = this._layoutCache._lastComputeOutBounds[key];
|
|
65754
65620
|
});
|
|
65755
65621
|
}
|
|
65756
65622
|
else {
|
|
65757
65623
|
this._hasAutoIndent = true;
|
|
65758
65624
|
['x1', 'x2', 'y1', 'y2'].forEach(key => {
|
|
65759
|
-
if (this.layout.getLastComputeOutBounds()[key] <
|
|
65760
|
-
this._layoutCache._lastComputeOutBounds[key]
|
|
65761
|
-
this.layout.getLastComputeOutBounds()[key] =
|
|
65762
|
-
this._layoutCache._lastComputeOutBounds[key];
|
|
65625
|
+
if (this.layout.getLastComputeOutBounds()[key] < this._layoutCache._lastComputeOutBounds[key]) {
|
|
65626
|
+
this.layout.getLastComputeOutBounds()[key] = this._layoutCache._lastComputeOutBounds[key];
|
|
65763
65627
|
}
|
|
65764
65628
|
else {
|
|
65765
|
-
this._layoutCache._lastComputeOutBounds[key] =
|
|
65766
|
-
this.layout.getLastComputeOutBounds()[key];
|
|
65629
|
+
this._layoutCache._lastComputeOutBounds[key] = this.layout.getLastComputeOutBounds()[key];
|
|
65767
65630
|
}
|
|
65768
65631
|
});
|
|
65769
65632
|
}
|
|
@@ -65833,57 +65696,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65833
65696
|
CartesianAxis.type = ComponentTypeEnum.cartesianAxis;
|
|
65834
65697
|
CartesianAxis.specKey = 'axes';
|
|
65835
65698
|
|
|
65836
|
-
const setDomain = (min, max, breaks) => breaks.reduce((r, b, i) => {
|
|
65837
|
-
r.push([b, breaks.length === i + 1 ? max : breaks[i + 1]]);
|
|
65838
|
-
return r;
|
|
65839
|
-
}, [[min, breaks[0]]]);
|
|
65840
|
-
function breakDomain(data, points) {
|
|
65841
|
-
const min = data[0];
|
|
65842
|
-
const max = data[data.length - 1];
|
|
65843
|
-
const breaks = points.filter(point => point > min && point < max);
|
|
65844
|
-
return setDomain(min, max, breaks);
|
|
65845
|
-
}
|
|
65846
|
-
const sorter = (a, b) => a - b;
|
|
65847
|
-
const fillBins = (data, points) => {
|
|
65848
|
-
const bins = [0];
|
|
65849
|
-
let i = 0;
|
|
65850
|
-
let j = 0;
|
|
65851
|
-
while (i < points.length) {
|
|
65852
|
-
if (data[j] <= points[i]) {
|
|
65853
|
-
bins[i] += 1;
|
|
65854
|
-
j += 1;
|
|
65855
|
-
}
|
|
65856
|
-
else {
|
|
65857
|
-
i += 1;
|
|
65858
|
-
bins[i] = 0;
|
|
65859
|
-
}
|
|
65860
|
-
}
|
|
65861
|
-
bins[i] = data.slice(j).length;
|
|
65862
|
-
return bins;
|
|
65863
|
-
};
|
|
65864
|
-
function breakScope(data, points) {
|
|
65865
|
-
const bins = fillBins(data, points);
|
|
65866
|
-
const count = data.length;
|
|
65867
|
-
return bins
|
|
65868
|
-
.reduce((res, bin, i) => {
|
|
65869
|
-
const last = res[i - 1] ? res[i - 1][1] : 0;
|
|
65870
|
-
const next = (last * 100 + +(bin / count).toFixed(2) * 100) / 100;
|
|
65871
|
-
res.push([last, next > 1 ? 1 : next > 0.95 ? 1 : next]);
|
|
65872
|
-
return res;
|
|
65873
|
-
}, [])
|
|
65874
|
-
.filter(s => {
|
|
65875
|
-
return !(s[0] === 0 && s[1] === 0) && !(s[0] === 1 && s[1] === 1);
|
|
65876
|
-
});
|
|
65877
|
-
}
|
|
65878
|
-
function breakData(data, points) {
|
|
65879
|
-
data.sort(sorter);
|
|
65880
|
-
points.sort(sorter);
|
|
65881
|
-
return {
|
|
65882
|
-
domain: breakDomain(data, points),
|
|
65883
|
-
scope: breakScope(data, points)
|
|
65884
|
-
};
|
|
65885
|
-
}
|
|
65886
|
-
|
|
65887
65699
|
const e10 = Math.sqrt(50);
|
|
65888
65700
|
const e5 = Math.sqrt(10);
|
|
65889
65701
|
const e2 = Math.sqrt(2);
|
|
@@ -65975,73 +65787,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65975
65787
|
return this._scale.scale(value);
|
|
65976
65788
|
}
|
|
65977
65789
|
computeLinearDomain(data) {
|
|
65978
|
-
|
|
65790
|
+
const domain = [];
|
|
65979
65791
|
if (data.length) {
|
|
65980
|
-
const userSetBreaks = this._spec.breaks && this._spec.breaks.length;
|
|
65981
|
-
let values = [];
|
|
65982
|
-
let minDomain;
|
|
65983
|
-
let maxDomain;
|
|
65984
65792
|
data.forEach(d => {
|
|
65985
65793
|
const { min, max } = d;
|
|
65986
|
-
|
|
65987
|
-
|
|
65988
|
-
if (userSetBreaks) {
|
|
65989
|
-
values = values.concat(d.values);
|
|
65990
|
-
}
|
|
65794
|
+
domain[0] = domain[0] === undefined ? min : Math.min(domain[0], min);
|
|
65795
|
+
domain[1] = domain[1] === undefined ? max : Math.max(domain[1], max);
|
|
65991
65796
|
});
|
|
65992
|
-
if (userSetBreaks) {
|
|
65993
|
-
let breakDomains = [];
|
|
65994
|
-
let breakScopes = [];
|
|
65995
|
-
let breakRanges;
|
|
65996
|
-
let source = [...values];
|
|
65997
|
-
if (this._spec.breaks.length === 1) {
|
|
65998
|
-
const { domain, scope } = breakData(source, this._spec.breaks[0].range);
|
|
65999
|
-
breakDomains = domain;
|
|
66000
|
-
breakScopes = scope;
|
|
66001
|
-
breakRanges = [this._spec.breaks[0].range];
|
|
66002
|
-
}
|
|
66003
|
-
else {
|
|
66004
|
-
breakRanges = this._spec.breaks
|
|
66005
|
-
.map((breakSpec) => breakSpec.range)
|
|
66006
|
-
.sort((a, b) => a[0] - b[0]);
|
|
66007
|
-
for (let index = 0; index < breakRanges.length; index++) {
|
|
66008
|
-
const breakRange = breakRanges[index];
|
|
66009
|
-
const { domain, scope } = breakData(source, breakRange);
|
|
66010
|
-
let finalScope = scope;
|
|
66011
|
-
const finalDomain = domain;
|
|
66012
|
-
if (index > 0) {
|
|
66013
|
-
const lastRatio = last(breakScopes)[1];
|
|
66014
|
-
const restRarioRange = 1 - lastRatio;
|
|
66015
|
-
finalScope = scope.map(eachScope => {
|
|
66016
|
-
return [lastRatio + eachScope[0] * restRarioRange, lastRatio + eachScope[1] * restRarioRange];
|
|
66017
|
-
});
|
|
66018
|
-
finalDomain[0][0] = last(breakDomains)[1];
|
|
66019
|
-
}
|
|
66020
|
-
breakDomains.push(finalDomain[0]);
|
|
66021
|
-
breakScopes.push(finalScope[0]);
|
|
66022
|
-
if (finalDomain.length > 2) {
|
|
66023
|
-
breakDomains.push(finalDomain[1]);
|
|
66024
|
-
breakScopes.push(finalScope[1]);
|
|
66025
|
-
}
|
|
66026
|
-
if (index === breakRanges.length - 1) {
|
|
66027
|
-
breakDomains.push(last(finalDomain));
|
|
66028
|
-
breakScopes.push(last(finalScope));
|
|
66029
|
-
}
|
|
66030
|
-
else {
|
|
66031
|
-
source = source.filter(val => val >= last(finalDomain)[0]);
|
|
66032
|
-
}
|
|
66033
|
-
}
|
|
66034
|
-
}
|
|
66035
|
-
domain = combineArray(breakDomains);
|
|
66036
|
-
this._break = {
|
|
66037
|
-
domain: breakDomains,
|
|
66038
|
-
scope: breakScopes,
|
|
66039
|
-
range: breakRanges
|
|
66040
|
-
};
|
|
66041
|
-
}
|
|
66042
|
-
else {
|
|
66043
|
-
domain = [minDomain, maxDomain];
|
|
66044
|
-
}
|
|
66045
65797
|
}
|
|
66046
65798
|
else {
|
|
66047
65799
|
domain[0] = 0;
|
|
@@ -66088,7 +65840,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66088
65840
|
num = Math.abs(num);
|
|
66089
65841
|
if (num < 1) {
|
|
66090
65842
|
domain[0] = 0;
|
|
66091
|
-
domain[
|
|
65843
|
+
domain[1] = 1;
|
|
66092
65844
|
}
|
|
66093
65845
|
else {
|
|
66094
65846
|
let step = num / DEFAULT_TICK_COUNT;
|
|
@@ -66096,12 +65848,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66096
65848
|
const err = step / Math.pow(10, power);
|
|
66097
65849
|
step = (err >= e10 ? 10 : err >= e5 ? 5 : err >= e2 ? 2 : 1) * Math.pow(10, power);
|
|
66098
65850
|
domain[0] = 0;
|
|
66099
|
-
domain[
|
|
65851
|
+
domain[1] = step * 10;
|
|
66100
65852
|
}
|
|
66101
65853
|
if (flag < 0) {
|
|
66102
65854
|
domain.reverse();
|
|
66103
65855
|
domain[0] *= -1;
|
|
66104
|
-
domain[
|
|
65856
|
+
domain[1] *= -1;
|
|
66105
65857
|
}
|
|
66106
65858
|
}
|
|
66107
65859
|
return domain;
|
|
@@ -66151,7 +65903,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66151
65903
|
}
|
|
66152
65904
|
const { min, max } = this._domain;
|
|
66153
65905
|
isValid$1(min) && (domain[0] = min);
|
|
66154
|
-
isValid$1(max) && (domain[
|
|
65906
|
+
isValid$1(max) && (domain[1] = max);
|
|
66155
65907
|
}
|
|
66156
65908
|
setSoftDomainMinMax(domain) {
|
|
66157
65909
|
const { softMin, softMax } = this._spec;
|
|
@@ -66168,10 +65920,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66168
65920
|
if (isValid$1(softMax)) {
|
|
66169
65921
|
let softMaxValue = isFunction$1(softMax) ? softMax(domain) : softMax;
|
|
66170
65922
|
if (isNil$1(softMaxValue)) {
|
|
66171
|
-
softMaxValue = domain[
|
|
65923
|
+
softMaxValue = domain[1];
|
|
66172
65924
|
}
|
|
66173
|
-
if (softMaxValue >= domain[
|
|
66174
|
-
domain[
|
|
65925
|
+
if (softMaxValue >= domain[1]) {
|
|
65926
|
+
domain[1] = softMaxValue;
|
|
66175
65927
|
}
|
|
66176
65928
|
this._softMaxValue = softMaxValue;
|
|
66177
65929
|
}
|
|
@@ -66210,7 +65962,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66210
65962
|
return this._domainAfterSpec;
|
|
66211
65963
|
}
|
|
66212
65964
|
_updateNiceLabelFormatter(domain) {
|
|
66213
|
-
const domainSpan = Math.abs(domain[
|
|
65965
|
+
const domainSpan = Math.abs(domain[1] - domain[0]);
|
|
66214
65966
|
const n = Math.max(-Math.floor(Math.log10(domainSpan)), 0) + 2;
|
|
66215
65967
|
const unit = Math.pow(10, n);
|
|
66216
65968
|
this.niceLabelFormatter = (value) => {
|
|
@@ -66247,45 +65999,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66247
65999
|
}
|
|
66248
66000
|
this._scale.domain(range);
|
|
66249
66001
|
}
|
|
66250
|
-
_tickTransformOption() {
|
|
66251
|
-
var _a;
|
|
66252
|
-
return Object.assign(Object.assign({}, super._tickTransformOption()), { breakData: ((_a = this._spec.breaks) === null || _a === void 0 ? void 0 : _a.length) ? () => this._break : null });
|
|
66253
|
-
}
|
|
66254
|
-
_getUpdateAttribute(ignoreGrid) {
|
|
66255
|
-
var _a;
|
|
66256
|
-
const attrs = super._getUpdateAttribute(ignoreGrid);
|
|
66257
|
-
if (!isZAxis(this._orient) && ((_a = this._spec.breaks) === null || _a === void 0 ? void 0 : _a.length) && this._break) {
|
|
66258
|
-
const { width, height } = this.getLayoutRect();
|
|
66259
|
-
const isX = isXAxis(this._orient);
|
|
66260
|
-
const axisLength = isX ? width : height;
|
|
66261
|
-
attrs.breaks = this._spec.breaks.map(obj => {
|
|
66262
|
-
const { range, breakSymbol, gap = 6 } = obj;
|
|
66263
|
-
const index = this._break.domain.findIndex(domainRange => range[0] === domainRange[0] && range[1] === domainRange[1]);
|
|
66264
|
-
const ratio = 1 - (this._break.scope[index][0] + this._break.scope[index][1]) / 2;
|
|
66265
|
-
let gapRatio;
|
|
66266
|
-
if (isPercent(gap)) {
|
|
66267
|
-
gapRatio = Number(gap.substring(0, gap.length - 1)) / 100;
|
|
66268
|
-
}
|
|
66269
|
-
else {
|
|
66270
|
-
gapRatio = gap / axisLength;
|
|
66271
|
-
}
|
|
66272
|
-
return {
|
|
66273
|
-
range: [ratio - gapRatio / 2, ratio + gapRatio / 2],
|
|
66274
|
-
breakSymbol: Object.assign({ visible: true }, breakSymbol),
|
|
66275
|
-
rawRange: range
|
|
66276
|
-
};
|
|
66277
|
-
});
|
|
66278
|
-
}
|
|
66279
|
-
return attrs;
|
|
66280
|
-
}
|
|
66281
|
-
getNewScaleRange() {
|
|
66282
|
-
var _a, _b;
|
|
66283
|
-
let newRange = super.getNewScaleRange();
|
|
66284
|
-
if (((_a = this._spec.breaks) === null || _a === void 0 ? void 0 : _a.length) && ((_b = this._break) === null || _b === void 0 ? void 0 : _b.scope)) {
|
|
66285
|
-
newRange = combineArray(this._break.scope).map(val => newRange[0] + (last(newRange) - newRange[0]) * val);
|
|
66286
|
-
}
|
|
66287
|
-
return newRange;
|
|
66288
|
-
}
|
|
66289
66002
|
computeDomain(data) {
|
|
66290
66003
|
return this.computeLinearDomain(data);
|
|
66291
66004
|
}
|
|
@@ -67060,6 +66773,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67060
66773
|
result.reMake = true;
|
|
67061
66774
|
return result;
|
|
67062
66775
|
}
|
|
66776
|
+
if (!isEqual(lastSpec.specified, s.specified)) {
|
|
66777
|
+
result.reMake = true;
|
|
66778
|
+
return result;
|
|
66779
|
+
}
|
|
67063
66780
|
if (s.range && !isEqual(s.range, scale.range())) {
|
|
67064
66781
|
scale.range(s.range);
|
|
67065
66782
|
result.reRender = true;
|
|
@@ -67473,7 +67190,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67473
67190
|
if (!constructor) {
|
|
67474
67191
|
return;
|
|
67475
67192
|
}
|
|
67476
|
-
const { spec } = specInfo, others = __rest$
|
|
67193
|
+
const { spec } = specInfo, others = __rest$e(specInfo, ["spec"]);
|
|
67477
67194
|
const region = new constructor(spec, Object.assign(Object.assign({}, this._modelOption), others));
|
|
67478
67195
|
if (region) {
|
|
67479
67196
|
region.created();
|
|
@@ -67484,7 +67201,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67484
67201
|
if (!constructor) {
|
|
67485
67202
|
return;
|
|
67486
67203
|
}
|
|
67487
|
-
const { spec } = specInfo, others = __rest$
|
|
67204
|
+
const { spec } = specInfo, others = __rest$e(specInfo, ["spec"]);
|
|
67488
67205
|
let region;
|
|
67489
67206
|
if (isValid$1(spec.regionId)) {
|
|
67490
67207
|
region = this.getRegionsInUserId(spec.regionId);
|
|
@@ -67758,7 +67475,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67758
67475
|
}
|
|
67759
67476
|
for (let i = 0; i < currentKeys.length; i++) {
|
|
67760
67477
|
const key = currentKeys[i];
|
|
67761
|
-
if (isArray$1(this._spec[key]) && this._spec[key].length !== spec[key].length) {
|
|
67478
|
+
if (isArray$1(this._spec[key]) && this._spec[key].length !== array(spec[key]).length) {
|
|
67762
67479
|
result.reMake = true;
|
|
67763
67480
|
return result;
|
|
67764
67481
|
}
|
|
@@ -69677,9 +69394,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
69677
69394
|
const depthFromSpec = this._groups ? this._groups.fields.length : 1;
|
|
69678
69395
|
const depth = isNil$1(scaleDepth) ? depthFromSpec : Math.min(depthFromSpec, scaleDepth);
|
|
69679
69396
|
const bandWidth = (_b = (_a = axisHelper.getBandwidth) === null || _a === void 0 ? void 0 : _a.call(axisHelper, depth - 1)) !== null && _b !== void 0 ? _b : DefaultBandWidth$2;
|
|
69680
|
-
const hasBarWidth = this._spec.barWidth
|
|
69681
|
-
const hasBarMinWidth = this._spec.barMinWidth
|
|
69682
|
-
const hasBarMaxWidth = this._spec.barMaxWidth
|
|
69397
|
+
const hasBarWidth = isValid$1(this._spec.barWidth) && depth === depthFromSpec;
|
|
69398
|
+
const hasBarMinWidth = isValid$1(this._spec.barMinWidth);
|
|
69399
|
+
const hasBarMaxWidth = isValid$1(this._spec.barMaxWidth);
|
|
69683
69400
|
let width = bandWidth;
|
|
69684
69401
|
if (hasBarWidth) {
|
|
69685
69402
|
width = getActualNumValue(this._spec.barWidth, bandWidth);
|
|
@@ -74200,7 +73917,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
74200
73917
|
const specFromChart = this._getDefaultSpecFromChart(chartSpec);
|
|
74201
73918
|
newSpec = mergeSpec({}, this._theme, specFromChart, spec);
|
|
74202
73919
|
const getMergedLabelSpec = (position, label) => {
|
|
74203
|
-
if (position === 'inside') {
|
|
73920
|
+
if (position === 'inside' || position === 'inside-center') {
|
|
74204
73921
|
return mergeSpec({}, this._theme.innerLabel, label);
|
|
74205
73922
|
}
|
|
74206
73923
|
return mergeSpec({}, this._theme.outerLabel, label);
|
|
@@ -74891,7 +74608,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
74891
74608
|
return specInfos;
|
|
74892
74609
|
}
|
|
74893
74610
|
static createComponent(specInfo, options) {
|
|
74894
|
-
const { spec } = specInfo, others = __rest$
|
|
74611
|
+
const { spec } = specInfo, others = __rest$e(specInfo, ["spec"]);
|
|
74895
74612
|
const C = Factory$1.getComponentInKey(others.type);
|
|
74896
74613
|
if (C) {
|
|
74897
74614
|
return new C(spec, Object.assign(Object.assign({}, options), others));
|
|
@@ -75204,7 +74921,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75204
74921
|
return { outerRadius, innerRadius };
|
|
75205
74922
|
}
|
|
75206
74923
|
_update(attrs) {
|
|
75207
|
-
const { grid: gridAttrs } = attrs, axisAttrs = __rest$
|
|
74924
|
+
const { grid: gridAttrs } = attrs, axisAttrs = __rest$e(attrs, ["grid"]);
|
|
75208
74925
|
const axisProduct = this._axisMark.getProduct();
|
|
75209
74926
|
axisProduct.encode(mergeSpec({}, this._axisStyle, axisAttrs));
|
|
75210
74927
|
if (this._gridMark) {
|
|
@@ -75816,32 +75533,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75816
75533
|
};
|
|
75817
75534
|
|
|
75818
75535
|
class DotSeriesTooltipHelper extends BaseSeriesTooltipHelper {
|
|
75819
|
-
updateTooltipSpec() {
|
|
75820
|
-
var _a;
|
|
75821
|
-
super.updateTooltipSpec();
|
|
75822
|
-
if (isValid$1((_a = this.spec) === null || _a === void 0 ? void 0 : _a.mark)) {
|
|
75823
|
-
this.spec.mark.updateContent = (prev, datum, params) => {
|
|
75824
|
-
const childrenContent = [];
|
|
75825
|
-
const childrenPrev = prev.filter((p) => p.key === 'children');
|
|
75826
|
-
childrenPrev.length > 0 &&
|
|
75827
|
-
childrenPrev[0].value.forEach((element) => {
|
|
75828
|
-
let flag = true;
|
|
75829
|
-
for (const key in element) {
|
|
75830
|
-
childrenContent.push({
|
|
75831
|
-
shapeType: 'circle',
|
|
75832
|
-
hasShape: flag,
|
|
75833
|
-
shapeColor: this.shapeColorCallback(datum[0].datum[0]),
|
|
75834
|
-
shapeStroke: this.shapeStrokeCallback(datum[0].datum[0]),
|
|
75835
|
-
key: key,
|
|
75836
|
-
value: element[key] + ''
|
|
75837
|
-
});
|
|
75838
|
-
flag = false;
|
|
75839
|
-
}
|
|
75840
|
-
});
|
|
75841
|
-
return prev.concat(childrenContent);
|
|
75842
|
-
};
|
|
75843
|
-
}
|
|
75844
|
-
}
|
|
75845
75536
|
getDefaultTooltipPattern(activeType) {
|
|
75846
75537
|
if (activeType === 'mark') {
|
|
75847
75538
|
return {
|
|
@@ -75889,20 +75580,22 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75889
75580
|
],
|
|
75890
75581
|
updateContent: (prev, datum, params) => {
|
|
75891
75582
|
const childrenContent = [];
|
|
75892
|
-
prev
|
|
75893
|
-
|
|
75894
|
-
|
|
75895
|
-
|
|
75896
|
-
|
|
75897
|
-
|
|
75898
|
-
|
|
75899
|
-
|
|
75900
|
-
|
|
75901
|
-
|
|
75902
|
-
|
|
75903
|
-
|
|
75904
|
-
|
|
75905
|
-
|
|
75583
|
+
const childrenPrev = prev.filter((p) => p.key === 'children');
|
|
75584
|
+
childrenPrev.length > 0 &&
|
|
75585
|
+
childrenPrev[0].value.forEach((element) => {
|
|
75586
|
+
let flag = true;
|
|
75587
|
+
for (const key in element) {
|
|
75588
|
+
childrenContent.push({
|
|
75589
|
+
shapeType: 'circle',
|
|
75590
|
+
hasShape: flag,
|
|
75591
|
+
shapeColor: this.shapeColorCallback(datum[0].datum[0]),
|
|
75592
|
+
shapeStroke: this.shapeStrokeCallback(datum[0].datum[0]),
|
|
75593
|
+
key: key,
|
|
75594
|
+
value: element[key] + ''
|
|
75595
|
+
});
|
|
75596
|
+
flag = false;
|
|
75597
|
+
}
|
|
75598
|
+
});
|
|
75906
75599
|
return prev.concat(childrenContent);
|
|
75907
75600
|
}
|
|
75908
75601
|
};
|
|
@@ -78551,7 +78244,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78551
78244
|
size: size,
|
|
78552
78245
|
maskCanvas: maskCanvas
|
|
78553
78246
|
} = segmentationInput,
|
|
78554
|
-
imageData = maskCanvas.getContext("2d"
|
|
78247
|
+
imageData = maskCanvas.getContext("2d", {
|
|
78248
|
+
willReadFrequently: !0
|
|
78249
|
+
}).getImageData(0, 0, maskCanvas.width, maskCanvas.height),
|
|
78555
78250
|
labels = new Array(size[0] * size[1]).fill(0);
|
|
78556
78251
|
let curLabel = 1;
|
|
78557
78252
|
const offset = [[0, 1], [1, 0], [-1, 0], [0, -1]];
|
|
@@ -78633,7 +78328,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78633
78328
|
}
|
|
78634
78329
|
function removeBorder(image, canvas, isEmptyPixel) {
|
|
78635
78330
|
canvas.width = image.width, canvas.height = image.height;
|
|
78636
|
-
const ctx = canvas.getContext("2d"
|
|
78331
|
+
const ctx = canvas.getContext("2d", {
|
|
78332
|
+
willReadFrequently: !0
|
|
78333
|
+
});
|
|
78637
78334
|
ctx.clearRect(0, 0, canvas.width, canvas.height), ctx.drawImage(image, 0, 0);
|
|
78638
78335
|
const width = canvas.width,
|
|
78639
78336
|
imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
|
@@ -78728,7 +78425,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78728
78425
|
shapeRatio: shapeRatio
|
|
78729
78426
|
} = segmentationOutput,
|
|
78730
78427
|
board = initBoardWithShape(segmentationOutput),
|
|
78731
|
-
ctx = canvas.getContext("2d"
|
|
78428
|
+
ctx = canvas.getContext("2d", {
|
|
78429
|
+
willReadFrequently: !0
|
|
78430
|
+
});
|
|
78732
78431
|
for (const region of regions) {
|
|
78733
78432
|
const {
|
|
78734
78433
|
words: regionWords,
|
|
@@ -78769,7 +78468,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78769
78468
|
shapeMaxR: shapeMaxR,
|
|
78770
78469
|
shapeRatio: shapeRatio
|
|
78771
78470
|
} = segmentationOutput,
|
|
78772
|
-
ctx = canvas.getContext("2d"
|
|
78471
|
+
ctx = canvas.getContext("2d", {
|
|
78472
|
+
willReadFrequently: !0
|
|
78473
|
+
}),
|
|
78773
78474
|
boardOrigin = initBoardWithShape(segmentationOutput);
|
|
78774
78475
|
let board = boardOrigin.slice(0);
|
|
78775
78476
|
const fontFactor = layoutConfig.fontSizeShrinkFactor;
|
|
@@ -78837,7 +78538,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78837
78538
|
shapeMaxR: shapeMaxR,
|
|
78838
78539
|
shapeRatio: shapeRatio
|
|
78839
78540
|
} = segmentationOutput,
|
|
78840
|
-
ctx = canvas.getContext("2d"
|
|
78541
|
+
ctx = canvas.getContext("2d", {
|
|
78542
|
+
willReadFrequently: !0
|
|
78543
|
+
}),
|
|
78841
78544
|
boardOrigin = initBoardWithShape(segmentationOutput);
|
|
78842
78545
|
let board = boardOrigin.slice(0);
|
|
78843
78546
|
const fontFactor = layoutConfig.fontSizeEnlargeFactor,
|
|
@@ -79086,7 +78789,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79086
78789
|
tempCanvas: canvas,
|
|
79087
78790
|
randomGenerator: randomGenerator
|
|
79088
78791
|
} = segmentationOutput,
|
|
79089
|
-
ctx = canvas.getContext("2d"
|
|
78792
|
+
ctx = canvas.getContext("2d", {
|
|
78793
|
+
willReadFrequently: !0
|
|
78794
|
+
});
|
|
79090
78795
|
let fontSize = fillingInitialFontSize,
|
|
79091
78796
|
opacity = fillingInitialOpacity;
|
|
79092
78797
|
const placedFillingWords = [];
|
|
@@ -79202,7 +78907,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79202
78907
|
width: options.size[0],
|
|
79203
78908
|
height: options.size[1]
|
|
79204
78909
|
}),
|
|
79205
|
-
tempCtx = tempCanvas.getContext("2d"
|
|
78910
|
+
tempCtx = tempCanvas.getContext("2d", {
|
|
78911
|
+
willReadFrequently: !0
|
|
78912
|
+
});
|
|
79206
78913
|
tempCtx.textAlign = "center", tempCtx.textBaseline = "middle", segmentationInput.tempCanvas = tempCanvas;
|
|
79207
78914
|
const boardW = options.size[0] + 31 >> 5 << 5;
|
|
79208
78915
|
if (segmentationInput.boardSize = [boardW, options.size[1]], segmentationInput.random ? segmentationInput.randomGenerator = Math.random : segmentationInput.randomGenerator = fakeRandom(), this.segmentationInput = segmentationInput, isString$1(segmentationInput.shapeUrl)) {
|
|
@@ -79229,6 +78936,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
79229
78936
|
segmentationInput.maskCanvas = maskCanvas, this.options.onUpdateMaskCanvas && this.options.onUpdateMaskCanvas(maskCanvas), this.doLayout(), this.isImageFinished = !0, this.isLayoutFinished = !0;
|
|
79230
78937
|
}
|
|
79231
78938
|
}
|
|
78939
|
+
canAnimate() {
|
|
78940
|
+
return !0;
|
|
78941
|
+
}
|
|
79232
78942
|
unfinished() {
|
|
79233
78943
|
return !this.isLayoutFinished;
|
|
79234
78944
|
}
|
|
@@ -80733,6 +80443,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80733
80443
|
let flattenIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1;
|
|
80734
80444
|
let parent = arguments.length > 4 ? arguments[4] : undefined;
|
|
80735
80445
|
let getNodeKey = arguments.length > 5 ? arguments[5] : undefined;
|
|
80446
|
+
let valueField = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : "value";
|
|
80736
80447
|
let sum = 0,
|
|
80737
80448
|
prevFlattenIndex = null != flattenIndex ? flattenIndex : -1,
|
|
80738
80449
|
maxDepth = depth;
|
|
@@ -80744,16 +80455,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80744
80455
|
maxDepth: -1,
|
|
80745
80456
|
depth: depth,
|
|
80746
80457
|
index: index,
|
|
80747
|
-
value: datum
|
|
80458
|
+
value: datum[valueField],
|
|
80748
80459
|
isLeaf: !0,
|
|
80749
80460
|
datum: parent ? parent.datum.concat(datum) : [datum],
|
|
80750
80461
|
parentKey: null == parent ? void 0 : parent.key
|
|
80751
80462
|
};
|
|
80752
80463
|
if (null === (_b = datum.children) || void 0 === _b ? void 0 : _b.length) {
|
|
80753
80464
|
node.children = [], node.isLeaf = !1;
|
|
80754
|
-
const res = calculateNodeValue$1(datum.children, node.children, depth + 1, prevFlattenIndex, node, getNodeKey);
|
|
80755
|
-
node.value = isNil$1(datum
|
|
80756
|
-
} else node.isLeaf = !0, node.value = toValidNumber$1(datum
|
|
80465
|
+
const res = calculateNodeValue$1(datum.children, node.children, depth + 1, prevFlattenIndex, node, getNodeKey, valueField);
|
|
80466
|
+
node.value = isNil$1(datum[valueField]) ? res.sum : Math.max(res.sum, toValidNumber$1(datum[valueField])), prevFlattenIndex = res.flattenIndex, maxDepth = Math.max(res.maxDepth, maxDepth);
|
|
80467
|
+
} else node.isLeaf = !0, node.value = toValidNumber$1(datum[valueField]);
|
|
80757
80468
|
sum += Math.abs(node.value), output.push(node);
|
|
80758
80469
|
}), {
|
|
80759
80470
|
sum: sum,
|
|
@@ -80863,7 +80574,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80863
80574
|
height: Math.abs(config.y1 - config.y0)
|
|
80864
80575
|
},
|
|
80865
80576
|
nodes = [],
|
|
80866
|
-
res = calculateNodeValue$1(data, nodes, 0, -1, null, this._getNodeKey);
|
|
80577
|
+
res = calculateNodeValue$1(data, nodes, 0, -1, null, this._getNodeKey, this.options.valueField);
|
|
80867
80578
|
if (this._maxDepth = res.maxDepth, res.sum <= 0) return [];
|
|
80868
80579
|
const root = {
|
|
80869
80580
|
flattenIndex: -1,
|
|
@@ -82108,18 +81819,51 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82108
81819
|
let links = result.links;
|
|
82109
81820
|
if (this._nodeMap = result.nodeMap, this.computeNodeValues(nodes), this.computeNodeDepths(nodes), ["right", "end", "justify"].includes(this.options.nodeAlign) && this.computeNodeEndDepths(nodes), this._maxDepth <= 1) return null;
|
|
82110
81821
|
const columns = this.computeNodeBreadths(nodes);
|
|
82111
|
-
|
|
81822
|
+
if (this.computeLinkBreadths(nodes), nodes.forEach(node => {
|
|
82112
81823
|
node.sourceLinks = node.sourceLinks.filter(link => !isNil$1(link.source) && !isNil$1(link.target)), node.targetLinks = node.targetLinks.filter(link => !isNil$1(link.source) && !isNil$1(link.target));
|
|
82113
|
-
}), links = links.filter(link => !isNil$1(link.source) && !isNil$1(link.target)), isVertical$1(this.options.direction)
|
|
82114
|
-
|
|
82115
|
-
|
|
82116
|
-
|
|
81824
|
+
}), links = links.filter(link => !isNil$1(link.source) && !isNil$1(link.target)), isVertical$1(this.options.direction)) {
|
|
81825
|
+
if (this.options.inverse) {
|
|
81826
|
+
const viewY1 = this._viewBox.x1;
|
|
81827
|
+
nodes.forEach(node => {
|
|
81828
|
+
const {
|
|
81829
|
+
y0: y0,
|
|
81830
|
+
y1: y1,
|
|
81831
|
+
x0: x0,
|
|
81832
|
+
x1: x1
|
|
81833
|
+
} = node;
|
|
81834
|
+
node.y0 = viewY1 - x1, node.y1 = viewY1 - x0, node.x0 = y0, node.x1 = y1;
|
|
81835
|
+
}), links.forEach(link => {
|
|
81836
|
+
link.vertical = !0;
|
|
81837
|
+
const {
|
|
81838
|
+
x0: x0,
|
|
81839
|
+
x1: x1,
|
|
81840
|
+
y0: y0,
|
|
81841
|
+
y1: y1
|
|
81842
|
+
} = link;
|
|
81843
|
+
link.x0 = y0, link.x1 = y1, link.y0 = viewY1 - x0, link.y1 = viewY1 - x1;
|
|
81844
|
+
});
|
|
81845
|
+
} else nodes.forEach(node => {
|
|
81846
|
+
const {
|
|
81847
|
+
y0: y0,
|
|
81848
|
+
y1: y1
|
|
81849
|
+
} = node;
|
|
81850
|
+
node.y0 = node.x0, node.y1 = node.x1, node.x0 = y0, node.x1 = y1;
|
|
81851
|
+
}), links.forEach(link => {
|
|
81852
|
+
link.vertical = !0;
|
|
81853
|
+
const x0 = link.x0,
|
|
81854
|
+
x1 = link.x1;
|
|
81855
|
+
link.x0 = link.y0, link.x1 = link.y1, link.y0 = x0, link.y1 = x1;
|
|
81856
|
+
});
|
|
81857
|
+
} else this.options.inverse && (nodes.forEach(node => {
|
|
81858
|
+
const {
|
|
81859
|
+
x0: x0,
|
|
81860
|
+
x1: x1
|
|
81861
|
+
} = node;
|
|
81862
|
+
node.x0 = viewBox.x1 - x1, node.x1 = viewBox.x1 - x0;
|
|
82117
81863
|
}), links.forEach(link => {
|
|
82118
|
-
link.
|
|
82119
|
-
|
|
82120
|
-
|
|
82121
|
-
link.x0 = link.y0, link.x1 = link.y1, link.y0 = x0, link.y1 = x1;
|
|
82122
|
-
})), links.forEach(link => {
|
|
81864
|
+
link.x0 = viewBox.x1 - link.x0, link.x1 = viewBox.x1 - link.x1;
|
|
81865
|
+
}));
|
|
81866
|
+
return links.forEach(link => {
|
|
82123
81867
|
const sourceNode = this._nodeMap[link.source],
|
|
82124
81868
|
targetNode = this._nodeMap[link.target];
|
|
82125
81869
|
link.sourceRect = {
|
|
@@ -82887,14 +82631,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82887
82631
|
return (_g = this._colorScale) === null || _g === void 0 ? void 0 : _g.scale(sourceName);
|
|
82888
82632
|
};
|
|
82889
82633
|
this._handleEmphasisElement = (params) => {
|
|
82890
|
-
var _a;
|
|
82634
|
+
var _a, _b, _c, _d, _e;
|
|
82891
82635
|
const emphasisSpec = (_a = this._spec.emphasis) !== null && _a !== void 0 ? _a : {};
|
|
82892
82636
|
const element = params.item;
|
|
82893
82637
|
if (emphasisSpec.effect === 'adjacency') {
|
|
82894
|
-
if (element && element.mark.
|
|
82638
|
+
if (element && element.mark === ((_b = this._nodeMark) === null || _b === void 0 ? void 0 : _b.getProduct())) {
|
|
82895
82639
|
this._handleNodeAdjacencyClick(element);
|
|
82896
82640
|
}
|
|
82897
|
-
else if (element && element.mark.
|
|
82641
|
+
else if (element && element.mark === ((_c = this._linkMark) === null || _c === void 0 ? void 0 : _c.getProduct())) {
|
|
82898
82642
|
this._handleLinkAdjacencyClick(element);
|
|
82899
82643
|
}
|
|
82900
82644
|
else {
|
|
@@ -82902,10 +82646,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82902
82646
|
}
|
|
82903
82647
|
}
|
|
82904
82648
|
else if (emphasisSpec.effect === 'related') {
|
|
82905
|
-
if (element && element.mark.
|
|
82649
|
+
if (element && element.mark === ((_d = this._nodeMark) === null || _d === void 0 ? void 0 : _d.getProduct())) {
|
|
82906
82650
|
this._handleNodeRelatedClick(element);
|
|
82907
82651
|
}
|
|
82908
|
-
else if (element && element.mark.
|
|
82652
|
+
else if (element && element.mark === ((_e = this._linkMark) === null || _e === void 0 ? void 0 : _e.getProduct())) {
|
|
82909
82653
|
this._handleLinkRelatedClick(element);
|
|
82910
82654
|
}
|
|
82911
82655
|
else {
|
|
@@ -82915,6 +82659,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82915
82659
|
};
|
|
82916
82660
|
this._handleClearEmpty = () => {
|
|
82917
82661
|
var _a, _b;
|
|
82662
|
+
if (!this._needClear) {
|
|
82663
|
+
return;
|
|
82664
|
+
}
|
|
82918
82665
|
const allNodeElements = (_a = this._nodeMark) === null || _a === void 0 ? void 0 : _a.getProductElements();
|
|
82919
82666
|
if (!allNodeElements || !allNodeElements.length) {
|
|
82920
82667
|
return;
|
|
@@ -82930,6 +82677,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82930
82677
|
allLinkElements.forEach(el => {
|
|
82931
82678
|
el.removeState(states);
|
|
82932
82679
|
});
|
|
82680
|
+
this._needClear = false;
|
|
82933
82681
|
};
|
|
82934
82682
|
this._handleNodeAdjacencyClick = (element) => {
|
|
82935
82683
|
const nodeDatum = element.getDatum();
|
|
@@ -82979,6 +82727,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
82979
82727
|
if (this._nodeMark) {
|
|
82980
82728
|
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
|
|
82981
82729
|
}
|
|
82730
|
+
this._needClear = true;
|
|
82982
82731
|
};
|
|
82983
82732
|
this._handleLinkAdjacencyClick = (element) => {
|
|
82984
82733
|
const curLinkDatum = element.getDatum();
|
|
@@ -83002,6 +82751,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83002
82751
|
if (this._nodeMark) {
|
|
83003
82752
|
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
|
|
83004
82753
|
}
|
|
82754
|
+
this._needClear = true;
|
|
83005
82755
|
};
|
|
83006
82756
|
this._handleNodeRelatedClick = (element) => {
|
|
83007
82757
|
var _a;
|
|
@@ -83185,6 +82935,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83185
82935
|
this._highLightElements(this._nodeMark.getProductElements(), highlightNodes);
|
|
83186
82936
|
}
|
|
83187
82937
|
}
|
|
82938
|
+
this._needClear = true;
|
|
83188
82939
|
};
|
|
83189
82940
|
this._handleLinkRelatedClick = (element) => {
|
|
83190
82941
|
var _a;
|
|
@@ -83292,6 +83043,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83292
83043
|
});
|
|
83293
83044
|
this._highLightElements(allNodeElements, highlightNodes);
|
|
83294
83045
|
}
|
|
83046
|
+
this._needClear = true;
|
|
83295
83047
|
};
|
|
83296
83048
|
}
|
|
83297
83049
|
get direction() {
|
|
@@ -83361,7 +83113,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83361
83113
|
nodeHeight: this._spec.nodeHeight,
|
|
83362
83114
|
linkHeight: this._spec.linkHeight,
|
|
83363
83115
|
equalNodeHeight: this._spec.equalNodeHeight,
|
|
83364
|
-
linkOverlap: this._spec.linkOverlap
|
|
83116
|
+
linkOverlap: this._spec.linkOverlap,
|
|
83117
|
+
inverse: this._spec.inverse
|
|
83365
83118
|
},
|
|
83366
83119
|
level: TransformLevel.sankeyLayout
|
|
83367
83120
|
});
|
|
@@ -83465,6 +83218,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83465
83218
|
this._initLinkMarkStyle();
|
|
83466
83219
|
}
|
|
83467
83220
|
_initNodeMarkStyle() {
|
|
83221
|
+
var _a, _b;
|
|
83468
83222
|
const nodeMark = this._nodeMark;
|
|
83469
83223
|
if (!nodeMark) {
|
|
83470
83224
|
return;
|
|
@@ -83475,11 +83229,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83475
83229
|
},
|
|
83476
83230
|
x1: (datum) => datum.x1,
|
|
83477
83231
|
y: (datum) => datum.y0,
|
|
83478
|
-
y1: (datum) => datum.y1
|
|
83479
|
-
fill: this._fillByNode
|
|
83232
|
+
y1: (datum) => datum.y1
|
|
83480
83233
|
}, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Mark);
|
|
83234
|
+
this.setMarkStyle(nodeMark, {
|
|
83235
|
+
fill: (_b = (_a = this._spec.node.style) === null || _a === void 0 ? void 0 : _a.fill) !== null && _b !== void 0 ? _b : this._fillByNode
|
|
83236
|
+
}, 'normal', AttributeLevel.User_Mark);
|
|
83481
83237
|
}
|
|
83482
83238
|
_initLinkMarkStyle() {
|
|
83239
|
+
var _a, _b;
|
|
83483
83240
|
const linkMark = this._linkMark;
|
|
83484
83241
|
if (!linkMark) {
|
|
83485
83242
|
return;
|
|
@@ -83490,9 +83247,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83490
83247
|
y0: (datum) => datum.y0,
|
|
83491
83248
|
y1: (datum) => datum.y1,
|
|
83492
83249
|
thickness: (datum) => datum.thickness,
|
|
83493
|
-
fill: this._fillByLink,
|
|
83494
83250
|
direction: this.direction
|
|
83495
83251
|
}, STATE_VALUE_ENUM.STATE_NORMAL, AttributeLevel.Series);
|
|
83252
|
+
this.setMarkStyle(linkMark, {
|
|
83253
|
+
fill: (_b = (_a = this._spec.link.style) === null || _a === void 0 ? void 0 : _a.fill) !== null && _b !== void 0 ? _b : this._fillByLink
|
|
83254
|
+
}, 'normal', AttributeLevel.User_Mark);
|
|
83496
83255
|
}
|
|
83497
83256
|
initLabelMarkStyle(labelMark, labelSpec) {
|
|
83498
83257
|
if (!labelMark) {
|
|
@@ -87435,7 +87194,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
87435
87194
|
if (!constructor) {
|
|
87436
87195
|
return;
|
|
87437
87196
|
}
|
|
87438
|
-
const { spec } = specInfo, others = __rest$
|
|
87197
|
+
const { spec } = specInfo, others = __rest$e(specInfo, ["spec"]);
|
|
87439
87198
|
if (spec.type === exports.SeriesTypeEnum.link) {
|
|
87440
87199
|
spec.dotSeriesSpec = this._spec.series[spec.dotSeriesIndex];
|
|
87441
87200
|
}
|
|
@@ -88183,7 +87942,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88183
87942
|
|
|
88184
87943
|
class SankeyChartSpecTransformer extends BaseChartSpecTransformer {
|
|
88185
87944
|
_getDefaultSeriesSpec(spec) {
|
|
88186
|
-
const series = Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { categoryField: spec.categoryField, valueField: spec.valueField, sourceField: spec.sourceField, targetField: spec.targetField, direction: spec.direction, nodeAlign: spec.nodeAlign, nodeGap: spec.nodeGap, nodeWidth: spec.nodeWidth, linkWidth: spec.linkWidth, minStepWidth: spec.minStepWidth, minNodeHeight: spec.minNodeHeight, minLinkHeight: spec.minLinkHeight, dropIsolatedNode: spec.dropIsolatedNode, nodeHeight: spec.nodeHeight, linkHeight: spec.linkHeight, equalNodeHeight: spec.equalNodeHeight, linkOverlap: spec.linkOverlap, iterations: spec.iterations, nodeKey: spec.nodeKey, linkSortBy: spec.linkSortBy, nodeSortBy: spec.nodeSortBy, setNodeLayer: spec.setNodeLayer, node: spec.node, link: spec.link, label: spec.label, emphasis: spec.emphasis });
|
|
87945
|
+
const series = Object.assign(Object.assign({}, super._getDefaultSeriesSpec(spec)), { categoryField: spec.categoryField, valueField: spec.valueField, sourceField: spec.sourceField, targetField: spec.targetField, direction: spec.direction, nodeAlign: spec.nodeAlign, nodeGap: spec.nodeGap, nodeWidth: spec.nodeWidth, linkWidth: spec.linkWidth, minStepWidth: spec.minStepWidth, minNodeHeight: spec.minNodeHeight, minLinkHeight: spec.minLinkHeight, dropIsolatedNode: spec.dropIsolatedNode, nodeHeight: spec.nodeHeight, linkHeight: spec.linkHeight, equalNodeHeight: spec.equalNodeHeight, linkOverlap: spec.linkOverlap, iterations: spec.iterations, nodeKey: spec.nodeKey, linkSortBy: spec.linkSortBy, nodeSortBy: spec.nodeSortBy, setNodeLayer: spec.setNodeLayer, node: spec.node, link: spec.link, label: spec.label, emphasis: spec.emphasis, inverse: spec.inverse });
|
|
88187
87946
|
const seriesType = this.seriesType;
|
|
88188
87947
|
if (seriesType) {
|
|
88189
87948
|
series.type = seriesType;
|
|
@@ -88369,7 +88128,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88369
88128
|
}
|
|
88370
88129
|
|
|
88371
88130
|
function getLegendAttributes(spec, rect) {
|
|
88372
|
-
const { title = {}, item = {}, pager = {}, background = {}, type, id, visible, orient, position, data, filter, regionId, regionIndex, seriesIndex, seriesId, padding } = spec, restSpec = __rest$
|
|
88131
|
+
const { title = {}, item = {}, pager = {}, background = {}, type, id, visible, orient, position, data, filter, regionId, regionIndex, seriesIndex, seriesId, padding } = spec, restSpec = __rest$e(spec, ["title", "item", "pager", "background", "type", "id", "visible", "orient", "position", "data", "filter", "regionId", "regionIndex", "seriesIndex", "seriesId", "padding"]);
|
|
88373
88132
|
const attrs = restSpec;
|
|
88374
88133
|
if (title.visible) {
|
|
88375
88134
|
attrs.title = transformLegendTitleAttributes(title);
|
|
@@ -88985,7 +88744,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
88985
88744
|
};
|
|
88986
88745
|
|
|
88987
88746
|
function getContinuousLegendAttributes(spec) {
|
|
88988
|
-
const _a = mergeSpec({}, spec), { title = {}, handler = {}, rail = {}, track = {}, startText, endText, handlerText, sizeBackground, background = {}, type, id, visible, orient, position, data, defaultSelected, field, filter, regionId, regionIndex, seriesIndex, seriesId, padding } = _a, restSpec = __rest$
|
|
88747
|
+
const _a = mergeSpec({}, spec), { title = {}, handler = {}, rail = {}, track = {}, startText, endText, handlerText, sizeBackground, background = {}, type, id, visible, orient, position, data, defaultSelected, field, filter, regionId, regionIndex, seriesIndex, seriesId, padding } = _a, restSpec = __rest$e(_a, ["title", "handler", "rail", "track", "startText", "endText", "handlerText", "sizeBackground", "background", "type", "id", "visible", "orient", "position", "data", "defaultSelected", "field", "filter", "regionId", "regionIndex", "seriesIndex", "seriesId", "padding"]);
|
|
88989
88748
|
const attrs = restSpec;
|
|
88990
88749
|
if (title.visible) {
|
|
88991
88750
|
attrs.title = transformLegendTitleAttributes(title);
|
|
@@ -89339,8 +89098,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89339
89098
|
component.processor.mark.showTooltip({
|
|
89340
89099
|
datum: mockDatum,
|
|
89341
89100
|
mark: null,
|
|
89342
|
-
series: info.series
|
|
89343
|
-
dimensionInfo: mockDimensionInfo
|
|
89101
|
+
series: info.series
|
|
89344
89102
|
}, mockParams, false);
|
|
89345
89103
|
const vchart = componentOptions.globalInstance;
|
|
89346
89104
|
if (VChart.globalConfig.uniqueTooltip) {
|
|
@@ -89525,31 +89283,78 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89525
89283
|
return markInfoList;
|
|
89526
89284
|
};
|
|
89527
89285
|
|
|
89528
|
-
const
|
|
89529
|
-
var _a, _b;
|
|
89530
|
-
|
|
89286
|
+
const getTooltipActualActiveType = (spec) => {
|
|
89287
|
+
var _a, _b, _c;
|
|
89288
|
+
if ((spec === null || spec === void 0 ? void 0 : spec.visible) === false) {
|
|
89289
|
+
return [];
|
|
89290
|
+
}
|
|
89291
|
+
const activeTypeMap = {
|
|
89292
|
+
mark: ((_a = spec === null || spec === void 0 ? void 0 : spec.mark) === null || _a === void 0 ? void 0 : _a.visible) !== false,
|
|
89293
|
+
dimension: ((_b = spec === null || spec === void 0 ? void 0 : spec.dimension) === null || _b === void 0 ? void 0 : _b.visible) !== false,
|
|
89294
|
+
group: ((_c = spec === null || spec === void 0 ? void 0 : spec.group) === null || _c === void 0 ? void 0 : _c.visible) !== false
|
|
89295
|
+
};
|
|
89296
|
+
if (isValid$1(spec === null || spec === void 0 ? void 0 : spec.activeType)) {
|
|
89297
|
+
Object.keys(activeTypeMap).forEach(t => {
|
|
89298
|
+
var _a;
|
|
89299
|
+
activeTypeMap[t] = (_a = spec === null || spec === void 0 ? void 0 : spec.activeType) === null || _a === void 0 ? void 0 : _a.includes(t);
|
|
89300
|
+
});
|
|
89301
|
+
}
|
|
89302
|
+
return Object.keys(activeTypeMap).filter(t => activeTypeMap[t]);
|
|
89531
89303
|
};
|
|
89304
|
+
const isActiveTypeVisible = (type, spec) => {
|
|
89305
|
+
if (!spec) {
|
|
89306
|
+
return true;
|
|
89307
|
+
}
|
|
89308
|
+
if (spec.visible === false) {
|
|
89309
|
+
return false;
|
|
89310
|
+
}
|
|
89311
|
+
if (spec[type] && spec[type].visible === false) {
|
|
89312
|
+
return false;
|
|
89313
|
+
}
|
|
89314
|
+
if (spec.activeType && !spec.activeType.includes(type)) {
|
|
89315
|
+
return false;
|
|
89316
|
+
}
|
|
89317
|
+
return true;
|
|
89318
|
+
};
|
|
89319
|
+
function isEmptyPos(params) {
|
|
89320
|
+
return isNil$1(params.mark) && isNil$1(params.model) && isNil$1(params.datum);
|
|
89321
|
+
}
|
|
89322
|
+
function combinePattern(patternList) {
|
|
89323
|
+
if (!patternList || !patternList.length) {
|
|
89324
|
+
return null;
|
|
89325
|
+
}
|
|
89326
|
+
const defaultPatternContent = [];
|
|
89327
|
+
patternList.forEach(({ content }) => {
|
|
89328
|
+
if (isFunction$1(content)) {
|
|
89329
|
+
defaultPatternContent.push(content);
|
|
89330
|
+
}
|
|
89331
|
+
else if (isArray$1(content)) {
|
|
89332
|
+
content.forEach(c => {
|
|
89333
|
+
defaultPatternContent.push(c);
|
|
89334
|
+
});
|
|
89335
|
+
}
|
|
89336
|
+
else if (content) {
|
|
89337
|
+
defaultPatternContent.push(content);
|
|
89338
|
+
}
|
|
89339
|
+
});
|
|
89340
|
+
if (defaultPatternContent.length) {
|
|
89341
|
+
return Object.assign(Object.assign({}, patternList[0]), { content: defaultPatternContent });
|
|
89342
|
+
}
|
|
89343
|
+
return patternList[0];
|
|
89344
|
+
}
|
|
89532
89345
|
|
|
89533
89346
|
const getTooltipSpecForShow = (activeType, globalSpec, series, dimensionInfo) => {
|
|
89534
|
-
var _a, _b, _c, _d, _e, _f
|
|
89347
|
+
var _a, _b, _c, _d, _e, _f;
|
|
89535
89348
|
const finalSpec = Object.assign(Object.assign({}, globalSpec), { activeType });
|
|
89536
89349
|
const { style = {} } = globalSpec;
|
|
89537
89350
|
switch (activeType) {
|
|
89538
89351
|
case 'mark':
|
|
89539
89352
|
case 'group':
|
|
89540
89353
|
if (series) {
|
|
89541
|
-
const seriesSpec = (
|
|
89542
|
-
|
|
89543
|
-
|
|
89544
|
-
|
|
89545
|
-
else if (isValid$1(globalSpec.visible) || isValid$1(globalSpec.activeType)) {
|
|
89546
|
-
finalSpec.visible = getTooltipActualActiveType(globalSpec).includes(activeType);
|
|
89547
|
-
}
|
|
89548
|
-
else {
|
|
89549
|
-
finalSpec.visible = true;
|
|
89550
|
-
}
|
|
89551
|
-
finalSpec.handler = (_d = (_c = seriesSpec.handler) !== null && _c !== void 0 ? _c : globalSpec.handler) !== null && _d !== void 0 ? _d : undefined;
|
|
89552
|
-
if ((_e = finalSpec.handler) === null || _e === void 0 ? void 0 : _e.showTooltip) {
|
|
89354
|
+
const seriesSpec = (_a = series.getSpec()) === null || _a === void 0 ? void 0 : _a.tooltip;
|
|
89355
|
+
finalSpec.visible = true;
|
|
89356
|
+
finalSpec.handler = (_b = seriesSpec === null || seriesSpec === void 0 ? void 0 : seriesSpec.handler) !== null && _b !== void 0 ? _b : globalSpec.handler;
|
|
89357
|
+
if ((_c = finalSpec.handler) === null || _c === void 0 ? void 0 : _c.showTooltip) {
|
|
89553
89358
|
return finalSpec;
|
|
89554
89359
|
}
|
|
89555
89360
|
}
|
|
@@ -89557,165 +89362,168 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89557
89362
|
case 'dimension':
|
|
89558
89363
|
if (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length) {
|
|
89559
89364
|
const seriesList = getSeriesListFromDimensionInfo(dimensionInfo);
|
|
89560
|
-
if (seriesList.every(series => { var _a; return !
|
|
89365
|
+
if (seriesList.every(series => { var _a; return !isActiveTypeVisible('dimension', (_a = series.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec); })) {
|
|
89561
89366
|
finalSpec.visible = false;
|
|
89562
89367
|
}
|
|
89563
|
-
else if (isValid$1(globalSpec.visible) || isValid$1(globalSpec.activeType)) {
|
|
89564
|
-
finalSpec.visible = getTooltipActualActiveType(globalSpec).includes('dimension');
|
|
89565
|
-
}
|
|
89566
89368
|
else {
|
|
89567
89369
|
finalSpec.visible = true;
|
|
89568
89370
|
}
|
|
89569
|
-
finalSpec.handler = (
|
|
89570
|
-
if ((
|
|
89371
|
+
finalSpec.handler = (_d = globalSpec.handler) !== null && _d !== void 0 ? _d : undefined;
|
|
89372
|
+
if ((_e = finalSpec.handler) === null || _e === void 0 ? void 0 : _e.showTooltip) {
|
|
89571
89373
|
return finalSpec;
|
|
89572
89374
|
}
|
|
89573
89375
|
}
|
|
89574
89376
|
break;
|
|
89575
89377
|
}
|
|
89576
|
-
const defaultPattern = getDefaultTooltipPattern(activeType, series, dimensionInfo);
|
|
89577
|
-
const
|
|
89578
|
-
|
|
89579
|
-
|
|
89580
|
-
|
|
89581
|
-
|
|
89582
|
-
|
|
89583
|
-
|
|
89584
|
-
|
|
89585
|
-
|
|
89586
|
-
|
|
89587
|
-
|
|
89588
|
-
|
|
89589
|
-
|
|
89590
|
-
|
|
89591
|
-
|
|
89592
|
-
|
|
89593
|
-
|
|
89378
|
+
const defaultPattern = (_f = getDefaultTooltipPattern(activeType, series, dimensionInfo)) !== null && _f !== void 0 ? _f : {};
|
|
89379
|
+
const userPattern = getSeriesTooltipPattern(activeType, globalSpec, series, dimensionInfo);
|
|
89380
|
+
if (userPattern) {
|
|
89381
|
+
const defaultPatternTitle = defaultPattern.title;
|
|
89382
|
+
const defaultTitleShape = getShapePattern(undefined, userPattern, style.shape, undefined, defaultPatternTitle);
|
|
89383
|
+
if (isValid$1(userPattern.title)) {
|
|
89384
|
+
userPattern.title = addExtraInfoToTooltipTitlePattern(userPattern.title, Object.assign(Object.assign({}, defaultPatternTitle), defaultTitleShape));
|
|
89385
|
+
}
|
|
89386
|
+
else {
|
|
89387
|
+
userPattern.title = addExtraInfoToTooltipTitlePattern(defaultPatternTitle, defaultTitleShape, true);
|
|
89388
|
+
}
|
|
89389
|
+
const defaultPatternContent = array(defaultPattern.content);
|
|
89390
|
+
if (isValid$1(userPattern.content)) {
|
|
89391
|
+
const shapePatternMap = getShapePatternMapOfEachSeries(defaultPatternContent);
|
|
89392
|
+
userPattern.content = addExtraInfoToTooltipContentPattern(userPattern.content, userLine => getShapePattern(userLine, userPattern, style.shape, shapePatternMap));
|
|
89393
|
+
}
|
|
89394
|
+
else {
|
|
89395
|
+
userPattern.content = addExtraInfoToTooltipContentPattern(defaultPatternContent, line => getShapePattern(undefined, userPattern, style.shape, undefined, line), true);
|
|
89396
|
+
}
|
|
89594
89397
|
}
|
|
89595
89398
|
finalSpec[activeType] = Object.assign(Object.assign(Object.assign({}, defaultPattern), userPattern), { activeType });
|
|
89596
89399
|
return finalSpec;
|
|
89597
89400
|
};
|
|
89598
89401
|
const getDefaultTooltipPattern = (activeType, series, dimensionInfo) => {
|
|
89599
|
-
var _a;
|
|
89600
|
-
let defaultPattern = {};
|
|
89601
89402
|
switch (activeType) {
|
|
89602
89403
|
case 'mark':
|
|
89603
89404
|
case 'group':
|
|
89604
89405
|
if (series) {
|
|
89605
|
-
|
|
89406
|
+
return series.tooltipHelper.getDefaultTooltipPattern(activeType);
|
|
89606
89407
|
}
|
|
89607
89408
|
break;
|
|
89608
89409
|
case 'dimension':
|
|
89609
89410
|
if (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length) {
|
|
89610
89411
|
const patternList = [];
|
|
89611
|
-
dimensionInfo.forEach(
|
|
89612
|
-
const { series } =
|
|
89412
|
+
dimensionInfo.forEach(info => info.data.forEach(datum => {
|
|
89413
|
+
const { series } = datum;
|
|
89613
89414
|
const mockDimensionInfo = [
|
|
89614
|
-
Object.assign(Object.assign({},
|
|
89415
|
+
Object.assign(Object.assign({}, info), { data: [datum] })
|
|
89615
89416
|
];
|
|
89616
|
-
const pattern =
|
|
89417
|
+
const pattern = series.tooltipHelper.getDefaultTooltipPattern(activeType, mockDimensionInfo);
|
|
89617
89418
|
if (pattern) {
|
|
89618
89419
|
patternList.push(pattern);
|
|
89619
89420
|
}
|
|
89620
89421
|
}));
|
|
89621
|
-
|
|
89622
|
-
patternList.forEach(({ content }) => {
|
|
89623
|
-
if (isFunction$1(content)) {
|
|
89624
|
-
defaultPatternContent.push(content);
|
|
89625
|
-
}
|
|
89626
|
-
else {
|
|
89627
|
-
defaultPatternContent.push(...array(content));
|
|
89628
|
-
}
|
|
89629
|
-
});
|
|
89630
|
-
defaultPattern = Object.assign(Object.assign({}, patternList[0]), { content: defaultPatternContent });
|
|
89422
|
+
return combinePattern(patternList);
|
|
89631
89423
|
}
|
|
89632
89424
|
break;
|
|
89633
89425
|
}
|
|
89634
|
-
return
|
|
89426
|
+
return undefined;
|
|
89635
89427
|
};
|
|
89636
|
-
const getSeriesTooltipPattern = (activeType, series, dimensionInfo) => {
|
|
89637
|
-
|
|
89638
|
-
|
|
89639
|
-
|
|
89640
|
-
|
|
89641
|
-
|
|
89642
|
-
|
|
89643
|
-
|
|
89644
|
-
|
|
89645
|
-
|
|
89646
|
-
|
|
89647
|
-
|
|
89648
|
-
|
|
89649
|
-
|
|
89650
|
-
|
|
89651
|
-
|
|
89652
|
-
|
|
89653
|
-
|
|
89654
|
-
|
|
89655
|
-
|
|
89656
|
-
.map(series => series.tooltipHelper.spec.dimension);
|
|
89657
|
-
if (seriesPatternList.length) {
|
|
89658
|
-
let seriesPatternContent = [];
|
|
89659
|
-
if (seriesPatternList.every(({ content }) => isNil$1(content))) {
|
|
89660
|
-
seriesPatternContent = undefined;
|
|
89428
|
+
const getSeriesTooltipPattern = (activeType, globalSpec, series, dimensionInfo) => {
|
|
89429
|
+
const allSeries = activeType === 'dimension' && (dimensionInfo === null || dimensionInfo === void 0 ? void 0 : dimensionInfo.length)
|
|
89430
|
+
? getSeriesListFromDimensionInfo(dimensionInfo)
|
|
89431
|
+
: (activeType === 'mark' || activeType === 'group') && series
|
|
89432
|
+
? [series]
|
|
89433
|
+
: null;
|
|
89434
|
+
if (allSeries && allSeries.length) {
|
|
89435
|
+
const seriesPatternList = [];
|
|
89436
|
+
allSeries.forEach(s => {
|
|
89437
|
+
var _a;
|
|
89438
|
+
const seriesSpec = (_a = s.tooltipHelper) === null || _a === void 0 ? void 0 : _a.spec;
|
|
89439
|
+
if (isActiveTypeVisible(activeType, seriesSpec)) {
|
|
89440
|
+
let finalPattern = seriesSpec && seriesSpec[activeType]
|
|
89441
|
+
? Object.assign(Object.assign({}, globalSpec[activeType]), seriesSpec[activeType]) : globalSpec[activeType];
|
|
89442
|
+
if (finalPattern) {
|
|
89443
|
+
finalPattern = cloneDeep(finalPattern);
|
|
89444
|
+
if (finalPattern.title) {
|
|
89445
|
+
finalPattern.title = addExtraInfoToTooltipTitlePattern(finalPattern.title, {
|
|
89446
|
+
seriesId: s.id
|
|
89447
|
+
}, true);
|
|
89661
89448
|
}
|
|
89662
|
-
|
|
89663
|
-
|
|
89664
|
-
|
|
89665
|
-
|
|
89666
|
-
}
|
|
89667
|
-
if (isFunction$1(content)) {
|
|
89668
|
-
seriesPatternContent === null || seriesPatternContent === void 0 ? void 0 : seriesPatternContent.push(content);
|
|
89669
|
-
}
|
|
89670
|
-
else {
|
|
89671
|
-
seriesPatternContent === null || seriesPatternContent === void 0 ? void 0 : seriesPatternContent.push(...array(content));
|
|
89672
|
-
}
|
|
89673
|
-
});
|
|
89449
|
+
if (finalPattern.content) {
|
|
89450
|
+
finalPattern.content = addExtraInfoToTooltipContentPattern(finalPattern.content, {
|
|
89451
|
+
seriesId: s.id
|
|
89452
|
+
}, true);
|
|
89674
89453
|
}
|
|
89675
|
-
|
|
89454
|
+
seriesPatternList.push(finalPattern);
|
|
89676
89455
|
}
|
|
89677
89456
|
}
|
|
89678
|
-
|
|
89457
|
+
});
|
|
89458
|
+
return seriesPatternList && seriesPatternList.length ? combinePattern(seriesPatternList) : null;
|
|
89679
89459
|
}
|
|
89680
|
-
return
|
|
89460
|
+
return undefined;
|
|
89461
|
+
};
|
|
89462
|
+
const getSeriesListFromDimensionInfo = (dimensionInfo) => {
|
|
89463
|
+
const list = [];
|
|
89464
|
+
dimensionInfo.forEach(info => {
|
|
89465
|
+
info.data.forEach(datum => {
|
|
89466
|
+
if (isValid$1(datum.series)) {
|
|
89467
|
+
list.push(datum.series);
|
|
89468
|
+
}
|
|
89469
|
+
});
|
|
89470
|
+
});
|
|
89471
|
+
return list;
|
|
89681
89472
|
};
|
|
89682
|
-
const getSeriesListFromDimensionInfo = memoize((dimensionInfo) => {
|
|
89683
|
-
return dimensionInfo.reduce((list, cur) => list.concat(cur.data.map(data => data.series).filter(isValid$1)), []);
|
|
89684
|
-
});
|
|
89685
89473
|
const getShapePatternMapOfEachSeries = (content) => {
|
|
89686
89474
|
const shapePatternMap = {};
|
|
89687
89475
|
content.forEach(line => {
|
|
89688
|
-
|
|
89689
|
-
|
|
89690
|
-
if (!shapePatternMap[key]) {
|
|
89476
|
+
const key = line.seriesId;
|
|
89477
|
+
if (isValid$1(key) && !shapePatternMap[key]) {
|
|
89691
89478
|
shapePatternMap[key] = line;
|
|
89692
89479
|
}
|
|
89480
|
+
if (!shapePatternMap[-1]) {
|
|
89481
|
+
shapePatternMap[-1] = line;
|
|
89482
|
+
}
|
|
89693
89483
|
});
|
|
89694
89484
|
return shapePatternMap;
|
|
89695
89485
|
};
|
|
89486
|
+
const isShapeKey = (key) => key.toLowerCase().includes('shape');
|
|
89696
89487
|
const getShapePattern = (userLinePattern, userPattern, userStyle, shapePatternMap, defaultShapePattern) => {
|
|
89697
|
-
var _a, _b
|
|
89488
|
+
var _a, _b;
|
|
89698
89489
|
if (userStyle) {
|
|
89699
89490
|
userStyle.shapeSize = (_a = userStyle.shapeSize) !== null && _a !== void 0 ? _a : userStyle.size;
|
|
89700
89491
|
}
|
|
89701
|
-
const shapePatternFromMap =
|
|
89702
|
-
|
|
89703
|
-
|
|
89704
|
-
.reduce((keys, cur) => keys.concat(Object.keys(cur)), [])
|
|
89705
|
-
.filter(key => key.toLowerCase().includes('shape')));
|
|
89492
|
+
const shapePatternFromMap = shapePatternMap
|
|
89493
|
+
? (_b = shapePatternMap[userLinePattern === null || userLinePattern === void 0 ? void 0 : userLinePattern.seriesId]) !== null && _b !== void 0 ? _b : shapePatternMap[-1]
|
|
89494
|
+
: null;
|
|
89706
89495
|
const shapePattern = {};
|
|
89707
|
-
|
|
89708
|
-
|
|
89709
|
-
|
|
89710
|
-
|
|
89711
|
-
|
|
89712
|
-
|
|
89713
|
-
|
|
89714
|
-
shapePattern[key] = value;
|
|
89496
|
+
[userLinePattern, userPattern, userStyle, shapePatternFromMap, defaultShapePattern].forEach(cfg => {
|
|
89497
|
+
if (isValid$1(cfg)) {
|
|
89498
|
+
Object.keys(cfg).forEach(key => {
|
|
89499
|
+
if (isShapeKey(key) && isNil$1(shapePattern[key]) && !isNil$1(cfg[key])) {
|
|
89500
|
+
shapePattern[key] = cfg[key];
|
|
89501
|
+
}
|
|
89502
|
+
});
|
|
89715
89503
|
}
|
|
89716
89504
|
});
|
|
89717
89505
|
return shapePattern;
|
|
89718
89506
|
};
|
|
89507
|
+
const merge = (source, extraInfo, overwrite) => {
|
|
89508
|
+
const info = isFunction$1(extraInfo) ? extraInfo(source) : extraInfo;
|
|
89509
|
+
return overwrite ? Object.assign(Object.assign({}, source), info) : Object.assign(Object.assign({}, info), source);
|
|
89510
|
+
};
|
|
89511
|
+
const addExtraInfoToTooltipTitlePattern = (pattern, extraInfo, overwrite) => {
|
|
89512
|
+
const result = isValid$1(pattern)
|
|
89513
|
+
? isFunction$1(pattern)
|
|
89514
|
+
? (...args) => merge(pattern(...args), extraInfo, overwrite)
|
|
89515
|
+
: merge(pattern, extraInfo, overwrite)
|
|
89516
|
+
: undefined;
|
|
89517
|
+
return result;
|
|
89518
|
+
};
|
|
89519
|
+
const addExtraInfoToTooltipContentPattern = (pattern, extraInfo, overwrite) => {
|
|
89520
|
+
const result = isValid$1(pattern)
|
|
89521
|
+
? array(pattern).map(patternItem => isFunction$1(patternItem)
|
|
89522
|
+
? (...args) => array(patternItem(...args)).map(line => merge(line, extraInfo, overwrite))
|
|
89523
|
+
: merge(patternItem, extraInfo, overwrite))
|
|
89524
|
+
: undefined;
|
|
89525
|
+
return result;
|
|
89526
|
+
};
|
|
89719
89527
|
|
|
89720
89528
|
const getTooltipContentValue = (field, datum, params, formatter) => {
|
|
89721
89529
|
let value;
|
|
@@ -89784,6 +89592,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89784
89592
|
key: '其他',
|
|
89785
89593
|
value: '...'
|
|
89786
89594
|
};
|
|
89595
|
+
const TOOLTIP_TYPES = ['group', 'mark', 'dimension'];
|
|
89787
89596
|
|
|
89788
89597
|
const getTimeString = (value, timeFormat, timeFormatMode) => {
|
|
89789
89598
|
if (!timeFormat && !timeFormatMode) {
|
|
@@ -89860,7 +89669,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89860
89669
|
case 'dimension':
|
|
89861
89670
|
for (const { data: d } of data) {
|
|
89862
89671
|
for (const { datum: datumList, series } of d) {
|
|
89863
|
-
if (!
|
|
89672
|
+
if (!isActiveTypeVisible('dimension', (_c = series.tooltipHelper) === null || _c === void 0 ? void 0 : _c.spec)) {
|
|
89864
89673
|
continue;
|
|
89865
89674
|
}
|
|
89866
89675
|
const contentPatterns = (_d = patternContent === null || patternContent === void 0 ? void 0 : patternContent.filter(c => isNil$1(c.seriesId) || c.seriesId === series.id)) !== null && _d !== void 0 ? _d : [];
|
|
@@ -89994,6 +89803,48 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89994
89803
|
}
|
|
89995
89804
|
return undefined;
|
|
89996
89805
|
}
|
|
89806
|
+
_updateViewSpec(params) {
|
|
89807
|
+
const { changePositionOnly, model, dimensionInfo } = params;
|
|
89808
|
+
if (!changePositionOnly || !this._cacheViewSpec) {
|
|
89809
|
+
this._cacheViewSpec = getTooltipSpecForShow(this.activeType, this.component.getSpec(), model, dimensionInfo);
|
|
89810
|
+
}
|
|
89811
|
+
}
|
|
89812
|
+
_updateActualTooltip(data, params) {
|
|
89813
|
+
var _a, _b, _c, _d;
|
|
89814
|
+
const pattern = this._cacheViewSpec[this.activeType];
|
|
89815
|
+
const { changePositionOnly } = params;
|
|
89816
|
+
if (!changePositionOnly || !this._cacheActualTooltip) {
|
|
89817
|
+
const tooltipContent = getShowContent(pattern, data, params);
|
|
89818
|
+
const visible = isValid$1(tooltipContent) ? getTooltipPatternValue(pattern.visible, data, params) !== false : false;
|
|
89819
|
+
this._cacheActualTooltip = Object.assign(Object.assign({}, tooltipContent), { visible, activeType: pattern.activeType, data });
|
|
89820
|
+
const { title, content } = this._cacheActualTooltip;
|
|
89821
|
+
this._cacheActualTooltip.title = (_b = (_a = pattern.updateTitle) === null || _a === void 0 ? void 0 : _a.call(pattern, title, data, params)) !== null && _b !== void 0 ? _b : title;
|
|
89822
|
+
this._cacheActualTooltip.content = (_d = (_c = pattern.updateContent) === null || _c === void 0 ? void 0 : _c.call(pattern, content, data, params)) !== null && _d !== void 0 ? _d : content;
|
|
89823
|
+
}
|
|
89824
|
+
}
|
|
89825
|
+
shouldHandleTooltip(params, mouseEventData) {
|
|
89826
|
+
var _a, _b;
|
|
89827
|
+
const { tooltipInfo: info } = mouseEventData;
|
|
89828
|
+
if (isNil$1(info)) {
|
|
89829
|
+
return false;
|
|
89830
|
+
}
|
|
89831
|
+
return isActiveTypeVisible(this.activeType, (_b = (_a = params.model) === null || _a === void 0 ? void 0 : _a.tooltipHelper) === null || _b === void 0 ? void 0 : _b.spec);
|
|
89832
|
+
}
|
|
89833
|
+
clearCache() {
|
|
89834
|
+
this._cacheViewSpec = undefined;
|
|
89835
|
+
this._cacheActualTooltip = undefined;
|
|
89836
|
+
}
|
|
89837
|
+
}
|
|
89838
|
+
|
|
89839
|
+
class DimensionTooltipProcessor extends BaseTooltipProcessor {
|
|
89840
|
+
constructor() {
|
|
89841
|
+
super(...arguments);
|
|
89842
|
+
this.activeType = 'dimension';
|
|
89843
|
+
}
|
|
89844
|
+
showTooltip(info, params, changePositionOnly) {
|
|
89845
|
+
const newParams = Object.assign(Object.assign({}, params), { dimensionInfo: this._preprocessDimensionInfo(info), changePositionOnly, tooltip: this.component });
|
|
89846
|
+
return this._showTooltipByHandler(info, newParams);
|
|
89847
|
+
}
|
|
89997
89848
|
_getDimensionInfo(params) {
|
|
89998
89849
|
var _a, _b;
|
|
89999
89850
|
let targetDimensionInfo;
|
|
@@ -90051,53 +89902,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90051
89902
|
}
|
|
90052
89903
|
return targetDimensionInfo;
|
|
90053
89904
|
}
|
|
90054
|
-
_updateViewSpec(params) {
|
|
90055
|
-
const { changePositionOnly, model, dimensionInfo } = params;
|
|
90056
|
-
if (!changePositionOnly || !this._cacheViewSpec) {
|
|
90057
|
-
this._cacheViewSpec = getTooltipSpecForShow(this.activeType, this.component.getSpec(), model, dimensionInfo);
|
|
90058
|
-
}
|
|
90059
|
-
}
|
|
90060
|
-
_updateActualTooltip(data, params) {
|
|
90061
|
-
var _a, _b, _c, _d;
|
|
90062
|
-
const pattern = this._cacheViewSpec[this.activeType];
|
|
90063
|
-
const { changePositionOnly } = params;
|
|
90064
|
-
if (!changePositionOnly || !this._cacheActualTooltip) {
|
|
90065
|
-
const tooltipContent = getShowContent(pattern, data, params);
|
|
90066
|
-
const visible = isValid$1(tooltipContent) ? getTooltipPatternValue(pattern.visible, data, params) !== false : false;
|
|
90067
|
-
this._cacheActualTooltip = Object.assign(Object.assign({}, tooltipContent), { visible, activeType: pattern.activeType, data });
|
|
90068
|
-
const { title, content } = this._cacheActualTooltip;
|
|
90069
|
-
this._cacheActualTooltip.title = (_b = (_a = pattern.updateTitle) === null || _a === void 0 ? void 0 : _a.call(pattern, title, data, params)) !== null && _b !== void 0 ? _b : title;
|
|
90070
|
-
this._cacheActualTooltip.content = (_d = (_c = pattern.updateContent) === null || _c === void 0 ? void 0 : _c.call(pattern, content, data, params)) !== null && _d !== void 0 ? _d : content;
|
|
90071
|
-
}
|
|
90072
|
-
}
|
|
90073
|
-
clearCache() {
|
|
90074
|
-
this._cacheViewSpec = undefined;
|
|
90075
|
-
this._cacheActualTooltip = undefined;
|
|
90076
|
-
}
|
|
90077
|
-
}
|
|
90078
|
-
|
|
90079
|
-
class DimensionTooltipProcessor extends BaseTooltipProcessor {
|
|
90080
|
-
constructor() {
|
|
90081
|
-
super(...arguments);
|
|
90082
|
-
this.activeType = 'dimension';
|
|
90083
|
-
}
|
|
90084
|
-
showTooltip(info, params, changePositionOnly) {
|
|
90085
|
-
const newParams = Object.assign(Object.assign({}, params), { dimensionInfo: this._preprocessDimensionInfo(info), changePositionOnly, tooltip: this.component });
|
|
90086
|
-
return this._showTooltipByHandler(info, newParams);
|
|
90087
|
-
}
|
|
90088
|
-
shouldHandleTooltip(params, mouseEventData) {
|
|
90089
|
-
var _a, _b;
|
|
90090
|
-
const { tooltipInfo: info } = mouseEventData;
|
|
90091
|
-
if (isNil$1(info)) {
|
|
90092
|
-
return false;
|
|
90093
|
-
}
|
|
90094
|
-
const helper = (_a = params.model) === null || _a === void 0 ? void 0 : _a.tooltipHelper;
|
|
90095
|
-
const activeType = (_b = helper === null || helper === void 0 ? void 0 : helper.activeType) !== null && _b !== void 0 ? _b : this.component.getSpec().activeType;
|
|
90096
|
-
if (!activeType.includes('dimension')) {
|
|
90097
|
-
return false;
|
|
90098
|
-
}
|
|
90099
|
-
return true;
|
|
90100
|
-
}
|
|
90101
89905
|
getMouseEventData(params) {
|
|
90102
89906
|
var _a;
|
|
90103
89907
|
return {
|
|
@@ -90117,24 +89921,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90117
89921
|
this.activeType = 'mark';
|
|
90118
89922
|
}
|
|
90119
89923
|
showTooltip(info, params, changePositionOnly) {
|
|
90120
|
-
const { datum, series
|
|
89924
|
+
const { datum, series } = info;
|
|
90121
89925
|
const tooltipData = [{ datum: [datum], series }];
|
|
90122
|
-
const newParams = Object.assign(Object.assign({}, params), {
|
|
89926
|
+
const newParams = Object.assign(Object.assign({}, params), { changePositionOnly, tooltip: this.component });
|
|
90123
89927
|
return this._showTooltipByHandler(tooltipData, newParams);
|
|
90124
89928
|
}
|
|
90125
|
-
|
|
90126
|
-
var _a;
|
|
90127
|
-
const { tooltipInfo: info } = mouseEventData;
|
|
90128
|
-
if (isNil$1(info)) {
|
|
90129
|
-
return false;
|
|
90130
|
-
}
|
|
90131
|
-
const helper = (_a = params.model) === null || _a === void 0 ? void 0 : _a.tooltipHelper;
|
|
90132
|
-
if (!(helper === null || helper === void 0 ? void 0 : helper.activeType.includes('mark'))) {
|
|
90133
|
-
return false;
|
|
90134
|
-
}
|
|
90135
|
-
return true;
|
|
90136
|
-
}
|
|
90137
|
-
getMouseEventData(params, dimensionInfo) {
|
|
89929
|
+
getMouseEventData(params) {
|
|
90138
89930
|
var _a;
|
|
90139
89931
|
let info;
|
|
90140
89932
|
let ignore;
|
|
@@ -90147,8 +89939,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90147
89939
|
info = {
|
|
90148
89940
|
mark: params.mark,
|
|
90149
89941
|
datum: params.datum,
|
|
90150
|
-
series
|
|
90151
|
-
dimensionInfo
|
|
89942
|
+
series
|
|
90152
89943
|
};
|
|
90153
89944
|
}
|
|
90154
89945
|
else if ((ignoreTriggers === null || ignoreTriggers === void 0 ? void 0 : ignoreTriggers.has(params.model)) || (ignoreTriggers === null || ignoreTriggers === void 0 ? void 0 : ignoreTriggers.has(params.mark))) {
|
|
@@ -90168,24 +89959,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90168
89959
|
this.activeType = 'group';
|
|
90169
89960
|
}
|
|
90170
89961
|
showTooltip(info, params, changePositionOnly) {
|
|
90171
|
-
const { datum, series
|
|
89962
|
+
const { datum, series } = info;
|
|
90172
89963
|
const tooltipData = [{ datum: array(datum), series }];
|
|
90173
|
-
const newParams = Object.assign(Object.assign({}, params), { groupDatum: this._getGroupDatum(params),
|
|
89964
|
+
const newParams = Object.assign(Object.assign({}, params), { groupDatum: this._getGroupDatum(params), changePositionOnly, tooltip: this.component });
|
|
90174
89965
|
return this._showTooltipByHandler(tooltipData, newParams);
|
|
90175
89966
|
}
|
|
90176
|
-
|
|
90177
|
-
var _a;
|
|
90178
|
-
const { tooltipInfo: info } = mouseEventData;
|
|
90179
|
-
if (isNil$1(info)) {
|
|
90180
|
-
return false;
|
|
90181
|
-
}
|
|
90182
|
-
const helper = (_a = params.model) === null || _a === void 0 ? void 0 : _a.tooltipHelper;
|
|
90183
|
-
if (!(helper === null || helper === void 0 ? void 0 : helper.activeType.includes('group'))) {
|
|
90184
|
-
return false;
|
|
90185
|
-
}
|
|
90186
|
-
return true;
|
|
90187
|
-
}
|
|
90188
|
-
getMouseEventData(params, dimensionInfo) {
|
|
89967
|
+
getMouseEventData(params) {
|
|
90189
89968
|
var _a, _b;
|
|
90190
89969
|
let info;
|
|
90191
89970
|
let ignore;
|
|
@@ -90201,8 +89980,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90201
89980
|
info = {
|
|
90202
89981
|
mark: params.mark,
|
|
90203
89982
|
datum: params.datum,
|
|
90204
|
-
series
|
|
90205
|
-
dimensionInfo
|
|
89983
|
+
series
|
|
90206
89984
|
};
|
|
90207
89985
|
}
|
|
90208
89986
|
}
|
|
@@ -90361,12 +90139,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90361
90139
|
dimension: false,
|
|
90362
90140
|
group: false
|
|
90363
90141
|
};
|
|
90364
|
-
|
|
90365
|
-
|
|
90366
|
-
|
|
90367
|
-
|
|
90368
|
-
|
|
90369
|
-
|
|
90142
|
+
for (let i = 0, len = TOOLTIP_TYPES.length; i < len; i++) {
|
|
90143
|
+
const type = TOOLTIP_TYPES[i];
|
|
90144
|
+
const res = this.processor[type] ? this._showTooltipByMouseEvent(type, mouseEventData, params, isClick) : false;
|
|
90145
|
+
if (res) {
|
|
90146
|
+
success[type] = true;
|
|
90147
|
+
break;
|
|
90148
|
+
}
|
|
90370
90149
|
}
|
|
90371
90150
|
if (Object.values(success).every(val => !val) && !isEmptyPos(params)) {
|
|
90372
90151
|
if (ignoreMark && isMarkInfo(this._cacheInfo)) {
|
|
@@ -90431,22 +90210,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90431
90210
|
tooltipInfo: {},
|
|
90432
90211
|
ignore: {}
|
|
90433
90212
|
};
|
|
90434
|
-
|
|
90435
|
-
|
|
90436
|
-
|
|
90437
|
-
|
|
90438
|
-
|
|
90439
|
-
for (activeType of Object.keys(this.processor)) {
|
|
90440
|
-
if (activeType !== 'dimension') {
|
|
90441
|
-
const { tooltipInfo, ignore } = this.processor[activeType].getMouseEventData(params, dimensionInfo);
|
|
90442
|
-
result.tooltipInfo[activeType] = tooltipInfo;
|
|
90443
|
-
result.ignore[activeType] = ignore;
|
|
90444
|
-
}
|
|
90445
|
-
}
|
|
90213
|
+
Object.keys(this.processor).forEach(activeType => {
|
|
90214
|
+
const { tooltipInfo, ignore } = this.processor[activeType].getMouseEventData(params);
|
|
90215
|
+
result.tooltipInfo[activeType] = tooltipInfo;
|
|
90216
|
+
result.ignore[activeType] = ignore;
|
|
90217
|
+
});
|
|
90446
90218
|
return result;
|
|
90447
90219
|
};
|
|
90448
90220
|
this._hideTooltipByHandler = (params) => {
|
|
90449
|
-
var _a, _b, _c
|
|
90221
|
+
var _a, _b, _c;
|
|
90450
90222
|
if (!this._isTooltipShown && !((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
|
|
90451
90223
|
return 0;
|
|
90452
90224
|
}
|
|
@@ -90454,15 +90226,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90454
90226
|
Object.values(this.processor).forEach((processor) => {
|
|
90455
90227
|
processor.clearCache();
|
|
90456
90228
|
});
|
|
90457
|
-
|
|
90458
|
-
if (
|
|
90459
|
-
|
|
90460
|
-
}
|
|
90461
|
-
else if ((_d = this.tooltipHandler) === null || _d === void 0 ? void 0 : _d.hideTooltip) {
|
|
90462
|
-
hideTooltip = this.tooltipHandler.hideTooltip.bind(this.tooltipHandler);
|
|
90463
|
-
}
|
|
90464
|
-
if (hideTooltip) {
|
|
90465
|
-
const result = hideTooltip(params);
|
|
90229
|
+
const handler = (_c = this._spec.handler) !== null && _c !== void 0 ? _c : this.tooltipHandler;
|
|
90230
|
+
if (handler.hideTooltip) {
|
|
90231
|
+
const result = handler.hideTooltip.call(handler, params);
|
|
90466
90232
|
if (!result) {
|
|
90467
90233
|
this._isTooltipShown = false;
|
|
90468
90234
|
}
|
|
@@ -90563,11 +90329,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90563
90329
|
}
|
|
90564
90330
|
}
|
|
90565
90331
|
_initProcessor() {
|
|
90566
|
-
|
|
90567
|
-
|
|
90568
|
-
|
|
90569
|
-
|
|
90570
|
-
}
|
|
90332
|
+
const activeType = this._spec.activeType;
|
|
90333
|
+
this.processor = {};
|
|
90334
|
+
if (activeType.includes('dimension')) {
|
|
90335
|
+
this.processor.dimension = new DimensionTooltipProcessor(this);
|
|
90336
|
+
}
|
|
90337
|
+
if (activeType.includes('group')) {
|
|
90338
|
+
this.processor.group = new GroupTooltipProcessor(this);
|
|
90339
|
+
}
|
|
90340
|
+
if (activeType.includes('mark')) {
|
|
90341
|
+
this.processor.mark = new MarkTooltipProcessor(this);
|
|
90342
|
+
}
|
|
90571
90343
|
}
|
|
90572
90344
|
_initEvent() {
|
|
90573
90345
|
var _a;
|
|
@@ -91056,7 +90828,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
91056
90828
|
else {
|
|
91057
90829
|
const style = line.style || {};
|
|
91058
90830
|
const { stroke, fill, lineWidth } = style;
|
|
91059
|
-
const _d = style, { strokeOpacity, fillOpacity, opacity } = _d, restStyle = __rest$
|
|
90831
|
+
const _d = style, { strokeOpacity, fillOpacity, opacity } = _d, restStyle = __rest$e(_d, ["strokeOpacity", "fillOpacity", "opacity"]);
|
|
91060
90832
|
const isLineType = hair.type === 'line';
|
|
91061
90833
|
let finalOpacity = isLineType ? strokeOpacity : fillOpacity;
|
|
91062
90834
|
if (isNumber$1(opacity)) {
|
|
@@ -91085,7 +90857,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
91085
90857
|
if (!!label.visible) {
|
|
91086
90858
|
const labelBackground = label.labelBackground || {};
|
|
91087
90859
|
const labelStyle = label.style || {};
|
|
91088
|
-
const _e = labelBackground.style || {}, { fill: rectFill = 'rgba(47, 59, 82, 0.9)', stroke: rectStroke, outerBorder } = _e, rectStyle = __rest$
|
|
90860
|
+
const _e = labelBackground.style || {}, { fill: rectFill = 'rgba(47, 59, 82, 0.9)', stroke: rectStroke, outerBorder } = _e, rectStyle = __rest$e(_e, ["fill", "stroke", "outerBorder"]);
|
|
91089
90861
|
hair.label = {
|
|
91090
90862
|
visible: true,
|
|
91091
90863
|
formatMethod: label.formatMethod,
|
|
@@ -91778,7 +91550,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
91778
91550
|
const bandWidth = series.angleAxisHelper.getBandwidth(0);
|
|
91779
91551
|
currValueAngle.forEach((_a) => {
|
|
91780
91552
|
var _b;
|
|
91781
|
-
var { axis, value, coord } = _a, rest = __rest$
|
|
91553
|
+
var { axis, value, coord } = _a, rest = __rest$e(_a, ["axis", "value", "coord"]);
|
|
91782
91554
|
value = value !== null && value !== void 0 ? value : '';
|
|
91783
91555
|
mergeSpec(angleCrossHairInfo, rest);
|
|
91784
91556
|
const angle = series.angleAxisHelper.dataToPosition([value]);
|
|
@@ -91798,7 +91570,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
91798
91570
|
radiusCrossHairInfo.visible = !!currValueRadius.size;
|
|
91799
91571
|
currValueRadius.forEach((_a) => {
|
|
91800
91572
|
var _b;
|
|
91801
|
-
var { axis, value, coord } = _a, rest = __rest$
|
|
91573
|
+
var { axis, value, coord } = _a, rest = __rest$e(_a, ["axis", "value", "coord"]);
|
|
91802
91574
|
value = value !== null && value !== void 0 ? value : '';
|
|
91803
91575
|
const niceLabelFormatter = axis.niceLabelFormatter;
|
|
91804
91576
|
if ((_b = radiusHair.label) === null || _b === void 0 ? void 0 : _b.visible) {
|
|
@@ -92236,7 +92008,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92236
92008
|
});
|
|
92237
92009
|
let filter = null;
|
|
92238
92010
|
if (isContinuous()) {
|
|
92239
|
-
filter = (d) => d[datumField] >= newDomain[0] && d[datumField] <=
|
|
92011
|
+
filter = (d) => d[datumField] >= newDomain[0] && d[datumField] <= newDomain[1];
|
|
92240
92012
|
}
|
|
92241
92013
|
else {
|
|
92242
92014
|
filter = (d) => {
|
|
@@ -92734,15 +92506,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92734
92506
|
const domain = scale.domain();
|
|
92735
92507
|
if (isContinuous(scale.type)) {
|
|
92736
92508
|
if (this._isReverse()) {
|
|
92737
|
-
return domain[0] + (
|
|
92509
|
+
return domain[0] + (domain[1] - domain[0]) * (1 - state);
|
|
92738
92510
|
}
|
|
92739
|
-
return domain[0] + (
|
|
92511
|
+
return domain[0] + (domain[1] - domain[0]) * state;
|
|
92740
92512
|
}
|
|
92741
92513
|
let range = scale.range();
|
|
92742
92514
|
if (this._isReverse()) {
|
|
92743
92515
|
range = range.slice().reverse();
|
|
92744
92516
|
}
|
|
92745
|
-
const posInRange = range[0] + (
|
|
92517
|
+
const posInRange = range[0] + (range[1] - range[0]) * state;
|
|
92746
92518
|
return scale.invert(posInRange);
|
|
92747
92519
|
}
|
|
92748
92520
|
dataToStatePoint(data) {
|
|
@@ -92752,13 +92524,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92752
92524
|
if (!this._isHorizontal && isContinuous(scale.type)) {
|
|
92753
92525
|
range = range.slice().reverse();
|
|
92754
92526
|
}
|
|
92755
|
-
return (pos - range[0]) / (
|
|
92527
|
+
return (pos - range[0]) / (range[1] - range[0]);
|
|
92756
92528
|
}
|
|
92757
92529
|
_modeCheck(statePoint, mode) {
|
|
92758
92530
|
if (statePoint === 'start') {
|
|
92759
|
-
return (mode === 'percent' && this._spec.start) || (mode === 'value' && this._spec.startValue);
|
|
92531
|
+
return (mode === 'percent' && isValid$1(this._spec.start)) || (mode === 'value' && isValid$1(this._spec.startValue));
|
|
92760
92532
|
}
|
|
92761
|
-
return (mode === 'percent' && this._spec.end) || (mode === 'value' && this._spec.endValue);
|
|
92533
|
+
return (mode === 'percent' && isValid$1(this._spec.end)) || (mode === 'value' && isValid$1(this._spec.endValue));
|
|
92762
92534
|
}
|
|
92763
92535
|
_setStateFromSpec() {
|
|
92764
92536
|
var _a, _b;
|
|
@@ -92786,12 +92558,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92786
92558
|
this._end = end;
|
|
92787
92559
|
this._minSpan = (_a = this._spec.minSpan) !== null && _a !== void 0 ? _a : 0;
|
|
92788
92560
|
this._maxSpan = (_b = this._spec.maxSpan) !== null && _b !== void 0 ? _b : 1;
|
|
92789
|
-
if (isContinuous(this._stateScale.type) && this._stateScale.domain()[0] !==
|
|
92561
|
+
if (isContinuous(this._stateScale.type) && this._stateScale.domain()[0] !== this._stateScale.domain()[1]) {
|
|
92790
92562
|
if (this._spec.minValueSpan) {
|
|
92791
|
-
this._minSpan = this._spec.minValueSpan / (
|
|
92563
|
+
this._minSpan = this._spec.minValueSpan / (this._stateScale.domain()[1] - this._stateScale.domain()[0]);
|
|
92792
92564
|
}
|
|
92793
92565
|
if (this._spec.maxValueSpan) {
|
|
92794
|
-
this._maxSpan = this._spec.maxValueSpan / (
|
|
92566
|
+
this._maxSpan = this._spec.maxValueSpan / (this._stateScale.domain()[1] - this._stateScale.domain()[0]);
|
|
92795
92567
|
}
|
|
92796
92568
|
}
|
|
92797
92569
|
this._minSpan = Math.max(0, this._minSpan);
|
|
@@ -93263,7 +93035,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93263
93035
|
return false;
|
|
93264
93036
|
}
|
|
93265
93037
|
const domain = scale.domain();
|
|
93266
|
-
if (isContinuous(scale.type) && domain[0] ===
|
|
93038
|
+
if (isContinuous(scale.type) && domain[0] === domain[1]) {
|
|
93267
93039
|
return false;
|
|
93268
93040
|
}
|
|
93269
93041
|
if (isDiscrete(scale.type) && uniqArray(domain).length === 1) {
|
|
@@ -93742,11 +93514,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93742
93514
|
super.updateLayoutAttribute();
|
|
93743
93515
|
}
|
|
93744
93516
|
_getIndicatorAttrs() {
|
|
93517
|
+
if (this._spec.visible === false || (this._spec.fixed === false && this._activeDatum === null)) {
|
|
93518
|
+
return {
|
|
93519
|
+
visible: false
|
|
93520
|
+
};
|
|
93521
|
+
}
|
|
93745
93522
|
const region = this._regions[0];
|
|
93746
93523
|
const { width, height } = region.getLayoutRect();
|
|
93747
93524
|
const { x, y } = region.getLayoutStartPoint();
|
|
93525
|
+
const _a = this._spec, { content, offsetX, offsetY, limitRatio, title } = _a, restSpec = __rest$e(_a, ["content", "offsetX", "offsetY", "limitRatio", "title"]);
|
|
93748
93526
|
const contentComponentSpec = [];
|
|
93749
|
-
array(
|
|
93527
|
+
array(content).forEach((eachItem) => {
|
|
93750
93528
|
const contentSpec = mergeSpec({}, this._theme.content, eachItem);
|
|
93751
93529
|
contentComponentSpec.push({
|
|
93752
93530
|
visible: contentSpec.visible !== false && (contentSpec.field ? this._activeDatum !== null : true),
|
|
@@ -93758,29 +93536,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
93758
93536
|
style: Object.assign(Object.assign({}, transformIndicatorStyle(pickWithout(contentSpec.style, ['text']), this._activeDatum)), { text: this._createText(contentSpec.field, contentSpec.style.text) })
|
|
93759
93537
|
});
|
|
93760
93538
|
});
|
|
93761
|
-
return {
|
|
93762
|
-
visible: this._spec.visible !== false && (this._spec.fixed !== false || this._activeDatum !== null),
|
|
93763
|
-
size: {
|
|
93539
|
+
return Object.assign({ visible: true, size: {
|
|
93764
93540
|
width: width,
|
|
93765
93541
|
height: height
|
|
93766
|
-
},
|
|
93767
|
-
|
|
93768
|
-
|
|
93769
|
-
|
|
93770
|
-
|
|
93771
|
-
|
|
93772
|
-
|
|
93773
|
-
|
|
93774
|
-
|
|
93775
|
-
space: this._spec.title.space || this._gap,
|
|
93776
|
-
autoLimit: this._spec.title.autoLimit,
|
|
93777
|
-
autoFit: this._spec.title.autoFit,
|
|
93778
|
-
fitPercent: this._spec.title.fitPercent,
|
|
93779
|
-
fitStrategy: this._spec.title.fitStrategy,
|
|
93780
|
-
style: Object.assign(Object.assign({}, transformIndicatorStyle(pickWithout(this._spec.title.style, ['text']), this._activeDatum)), { text: this._createText(this._spec.title.field, this._spec.title.style.text) })
|
|
93781
|
-
},
|
|
93782
|
-
content: contentComponentSpec
|
|
93783
|
-
};
|
|
93542
|
+
}, zIndex: this.layoutZIndex, x: x, y: y, dx: offsetX ? getActualNumValue(offsetX, this._computeLayoutRadius()) : 0, dy: offsetY ? getActualNumValue(offsetY, this._computeLayoutRadius()) : 0, limitRatio: limitRatio || Infinity, title: {
|
|
93543
|
+
visible: title.visible !== false && (!isValid$1(title.field) || this._activeDatum !== null),
|
|
93544
|
+
space: title.space || this._gap,
|
|
93545
|
+
autoLimit: title.autoLimit,
|
|
93546
|
+
autoFit: title.autoFit,
|
|
93547
|
+
fitPercent: title.fitPercent,
|
|
93548
|
+
fitStrategy: title.fitStrategy,
|
|
93549
|
+
style: Object.assign(Object.assign({}, transformIndicatorStyle(pickWithout(title.style, ['text']), this._activeDatum)), { text: this._createText(title.field, title.style.text) })
|
|
93550
|
+
}, content: contentComponentSpec }, restSpec);
|
|
93784
93551
|
}
|
|
93785
93552
|
_createOrUpdateIndicatorComponent(attrs) {
|
|
93786
93553
|
if (this._indicatorComponent) {
|
|
@@ -94156,7 +93923,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
94156
93923
|
return { minX, maxX, minY, maxY };
|
|
94157
93924
|
}
|
|
94158
93925
|
function transformLabelAttributes(label, markerData) {
|
|
94159
|
-
const { labelBackground = {}, style, shape } = label, restLabel = __rest$
|
|
93926
|
+
const { labelBackground = {}, style, shape } = label, restLabel = __rest$e(label, ["labelBackground", "style", "shape"]);
|
|
94160
93927
|
if (label.visible !== false) {
|
|
94161
93928
|
const labelAttrs = restLabel;
|
|
94162
93929
|
if (shape === null || shape === void 0 ? void 0 : shape.visible) {
|
|
@@ -94393,7 +94160,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
94393
94160
|
function markerAggregation(_data, options) {
|
|
94394
94161
|
let markerSource;
|
|
94395
94162
|
if (options.coordinates) {
|
|
94396
|
-
const _a = options, { coordinates: coordinatesInOptions, coordinateType, getSeriesByIdOrIndex } = _a, rest = __rest$
|
|
94163
|
+
const _a = options, { coordinates: coordinatesInOptions, coordinateType, getSeriesByIdOrIndex } = _a, rest = __rest$e(_a, ["coordinates", "coordinateType", "getSeriesByIdOrIndex"]);
|
|
94397
94164
|
let coordinates;
|
|
94398
94165
|
if (isFunction$1(coordinatesInOptions)) {
|
|
94399
94166
|
const relativeSeries = options.getRelativeSeries();
|
|
@@ -96597,7 +96364,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96597
96364
|
_createMarkerComponent() {
|
|
96598
96365
|
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;
|
|
96599
96366
|
const { itemContent = {}, itemLine = {}, targetSymbol = {} } = this._spec;
|
|
96600
|
-
const { text: label = {}, symbol, image, richText } = itemContent, restItemContent = __rest$
|
|
96367
|
+
const { text: label = {}, symbol, image, richText } = itemContent, restItemContent = __rest$e(itemContent, ["text", "symbol", "image", "richText"]);
|
|
96601
96368
|
const markPointAttrs = {
|
|
96602
96369
|
zIndex: this.layoutZIndex,
|
|
96603
96370
|
interactive: (_a = this._spec.interactive) !== null && _a !== void 0 ? _a : true,
|
|
@@ -96641,7 +96408,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96641
96408
|
if (richText === null || richText === void 0 ? void 0 : richText.style) {
|
|
96642
96409
|
markPointAttrs.itemContent.richTextStyle = transformStyle(richText.style, this._markerData);
|
|
96643
96410
|
}
|
|
96644
|
-
const { visible, line = {} } = itemLine, restItemLine = __rest$
|
|
96411
|
+
const { visible, line = {} } = itemLine, restItemLine = __rest$e(itemLine, ["visible", "line"]);
|
|
96645
96412
|
if (visible !== false) {
|
|
96646
96413
|
markPointAttrs.itemLine = Object.assign(Object.assign({}, restItemLine), { visible: true, lineStyle: transformToGraphic(line.style) });
|
|
96647
96414
|
}
|
|
@@ -96985,13 +96752,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96985
96752
|
this._needDisablePickable = false;
|
|
96986
96753
|
const { operateMask } = e.detail;
|
|
96987
96754
|
this._handleBrushChange(ChartEvent.brushEnd, region, e);
|
|
96988
|
-
this.
|
|
96755
|
+
const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
96756
|
+
if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
|
|
96757
|
+
this._setAxisAndDataZoom(operateMask, region);
|
|
96758
|
+
}
|
|
96989
96759
|
this._emitEvent(ChartEvent.brushEnd, region);
|
|
96990
96760
|
});
|
|
96991
96761
|
brush.addEventListener(IOperateType.moveEnd, (e) => {
|
|
96992
96762
|
const { operateMask } = e.detail;
|
|
96993
96763
|
this._handleBrushChange(ChartEvent.brushEnd, region, e);
|
|
96994
|
-
this.
|
|
96764
|
+
const inBrushData = this._extendDataInBrush(this._inBrushElementsMap);
|
|
96765
|
+
if (!this._spec.zoomWhenEmpty && inBrushData.length > 0) {
|
|
96766
|
+
this._setAxisAndDataZoom(operateMask, region);
|
|
96767
|
+
}
|
|
96995
96768
|
this._emitEvent(ChartEvent.brushEnd, region);
|
|
96996
96769
|
});
|
|
96997
96770
|
}
|
|
@@ -97213,13 +96986,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
97213
96986
|
else {
|
|
97214
96987
|
const range = axis.getScale().range();
|
|
97215
96988
|
const rangeFactor = (_b = axis.getScale().rangeFactor()) !== null && _b !== void 0 ? _b : [0, 1];
|
|
97216
|
-
const isAxisReverse =
|
|
96989
|
+
const isAxisReverse = range[1] < range[0];
|
|
97217
96990
|
const startPosTemp = boundsStart - region.getLayoutStartPoint()[regionStartAttr];
|
|
97218
96991
|
const endPosTemp = boundsEnd - region.getLayoutStartPoint()[regionStartAttr];
|
|
97219
96992
|
const endPos = isAxisReverse ? Math.min(startPosTemp, endPosTemp) : Math.max(startPosTemp, endPosTemp);
|
|
97220
96993
|
const startPos = isAxisReverse ? Math.max(startPosTemp, endPosTemp) : Math.min(startPosTemp, endPosTemp);
|
|
97221
|
-
const start = ((startPos - range[0]) / (
|
|
97222
|
-
const end = ((endPos - range[0]) / (
|
|
96994
|
+
const start = ((startPos - range[0]) / (range[1] - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
|
|
96995
|
+
const end = ((endPos - range[0]) / (range[1] - range[0])) * (rangeFactor[1] - rangeFactor[0]) + rangeFactor[0];
|
|
97223
96996
|
const newStart = this._stateClamp(start - axisRangeExpand);
|
|
97224
96997
|
const newEnd = this._stateClamp(end + axisRangeExpand);
|
|
97225
96998
|
axis.getScale().rangeFactor([newStart, newEnd]);
|
|
@@ -98624,22 +98397,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98624
98397
|
};
|
|
98625
98398
|
const getHorizontalPositionType = (position, defaultCase) => { var _a, _b; return (_b = (_a = positionType[position]) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : defaultCase; };
|
|
98626
98399
|
const getVerticalPositionType = (position, defaultCase) => { var _a, _b; return (_b = (_a = positionType[position]) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : defaultCase; };
|
|
98627
|
-
const getCartesianCrosshairRect = (
|
|
98400
|
+
const getCartesianCrosshairRect = (dimensionData, layoutStartPoint) => {
|
|
98401
|
+
var _a;
|
|
98628
98402
|
const currValueX = new Map();
|
|
98629
98403
|
const currValueY = new Map();
|
|
98630
|
-
|
|
98631
|
-
|
|
98632
|
-
|
|
98633
|
-
|
|
98634
|
-
|
|
98635
|
-
|
|
98636
|
-
|
|
98637
|
-
|
|
98638
|
-
|
|
98639
|
-
|
|
98640
|
-
|
|
98641
|
-
|
|
98642
|
-
|
|
98404
|
+
const { series, datum } = dimensionData;
|
|
98405
|
+
const isHorizontal = series.direction === "horizontal";
|
|
98406
|
+
const axisHelper = isHorizontal
|
|
98407
|
+
? series.getYAxisHelper()
|
|
98408
|
+
: series.getXAxisHelper();
|
|
98409
|
+
const axisId = axisHelper.getAxisId();
|
|
98410
|
+
const axis = series
|
|
98411
|
+
.getChart()
|
|
98412
|
+
.getComponentsByKey('axes')
|
|
98413
|
+
.find(axis => axis.id === axisId);
|
|
98414
|
+
if (!axis) {
|
|
98415
|
+
return undefined;
|
|
98416
|
+
}
|
|
98417
|
+
(isHorizontal ? currValueY : currValueX).set(axis.getSpecIndex(), {
|
|
98418
|
+
value: (_a = series.getDatumPositionValues(datum[0], series.getDimensionField())) === null || _a === void 0 ? void 0 : _a[0],
|
|
98419
|
+
axis
|
|
98643
98420
|
});
|
|
98644
98421
|
const xHair = {
|
|
98645
98422
|
visible: !!currValueX.size,
|
|
@@ -98953,29 +98730,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98953
98730
|
return 0;
|
|
98954
98731
|
};
|
|
98955
98732
|
this._getActualTooltipPosition = (actualTooltip, params, tooltipBoxSize) => {
|
|
98956
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
98957
|
-
const event = params.event;
|
|
98733
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
98958
98734
|
const { tooltipSpec } = params;
|
|
98959
|
-
const firstDimensionInfo = (_a = params.dimensionInfo) === null || _a === void 0 ? void 0 : _a[0];
|
|
98960
98735
|
const invalidPosition = {
|
|
98961
98736
|
x: Infinity,
|
|
98962
98737
|
y: Infinity
|
|
98963
98738
|
};
|
|
98964
|
-
let { offsetX, offsetY } = this._option;
|
|
98965
98739
|
if (!tooltipSpec) {
|
|
98966
98740
|
this._cacheTooltipPosition = undefined;
|
|
98967
98741
|
return invalidPosition;
|
|
98968
98742
|
}
|
|
98743
|
+
const event = params.event;
|
|
98969
98744
|
const { activeType, data } = actualTooltip;
|
|
98970
|
-
const
|
|
98971
|
-
|
|
98972
|
-
const
|
|
98973
|
-
const
|
|
98745
|
+
const firstDim = activeType === 'dimension' ? (_b = (_a = data[0]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b[0] : data === null || data === void 0 ? void 0 : data[0];
|
|
98746
|
+
let { offsetX, offsetY } = this._option;
|
|
98747
|
+
const spec = tooltipSpec[activeType];
|
|
98748
|
+
const position = getTooltipPatternValue(spec.position, data, params);
|
|
98749
|
+
const positionMode = (_c = getTooltipPatternValue(spec.positionMode, data, params)) !== null && _c !== void 0 ? _c : (activeType === 'mark' ? 'mark' : 'pointer');
|
|
98974
98750
|
const { width: tooltipBoxWidth = 0, height: tooltipBoxHeight = 0 } = tooltipBoxSize !== null && tooltipBoxSize !== void 0 ? tooltipBoxSize : {};
|
|
98975
98751
|
const isCanvas = tooltipSpec.renderMode === 'canvas';
|
|
98976
|
-
const canvasRect = (
|
|
98977
|
-
const canvasWidth = (
|
|
98978
|
-
const canvasHeight = (
|
|
98752
|
+
const canvasRect = (_d = params === null || params === void 0 ? void 0 : params.chart) === null || _d === void 0 ? void 0 : _d.getCanvasRect();
|
|
98753
|
+
const canvasWidth = (_e = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.width) !== null && _e !== void 0 ? _e : DEFAULT_CHART_WIDTH;
|
|
98754
|
+
const canvasHeight = (_f = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.height) !== null && _f !== void 0 ? _f : DEFAULT_CHART_HEIGHT;
|
|
98979
98755
|
let isFixedPosition = false;
|
|
98980
98756
|
const containerSize = {
|
|
98981
98757
|
width: 0,
|
|
@@ -98989,8 +98765,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98989
98765
|
containerSize.width = window.innerWidth;
|
|
98990
98766
|
containerSize.height = window.innerHeight;
|
|
98991
98767
|
if (!isCanvas) {
|
|
98992
|
-
|
|
98993
|
-
|
|
98768
|
+
const tooltipParentElement = this._getParentElement(tooltipSpec);
|
|
98769
|
+
tooltipParentElementRect = (_h = (_g = tooltipParentElement === null || tooltipParentElement === void 0 ? void 0 : tooltipParentElement.getBoundingClientRect) === null || _g === void 0 ? void 0 : _g.call(tooltipParentElement)) !== null && _h !== void 0 ? _h : invalidPosition;
|
|
98770
|
+
const chartElement = ((_j = this._compiler.getCanvas()) !== null && _j !== void 0 ? _j : this._chartContainer);
|
|
98994
98771
|
const chartElementRect = chartElement === null || chartElement === void 0 ? void 0 : chartElement.getBoundingClientRect();
|
|
98995
98772
|
relativePosOffset = {
|
|
98996
98773
|
x: chartElementRect.x - tooltipParentElementRect.x,
|
|
@@ -99027,9 +98804,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
99027
98804
|
x2 = bounds.x2 + startPoint.x;
|
|
99028
98805
|
}
|
|
99029
98806
|
}
|
|
99030
|
-
else if (mode === 'crosshair' &&
|
|
98807
|
+
else if (mode === 'crosshair' &&
|
|
98808
|
+
((_a = firstDim === null || firstDim === void 0 ? void 0 : firstDim.series) === null || _a === void 0 ? void 0 : _a.coordinate) === 'cartesian' &&
|
|
98809
|
+
firstDim.datum &&
|
|
98810
|
+
firstDim.datum.length) {
|
|
99031
98811
|
isFixedPosition = true;
|
|
99032
|
-
const rect = getCartesianCrosshairRect(
|
|
98812
|
+
const rect = getCartesianCrosshairRect(firstDim, startPoint);
|
|
99033
98813
|
if (rect) {
|
|
99034
98814
|
x1 = rect.start.x;
|
|
99035
98815
|
x2 = rect.end.x;
|
|
@@ -99074,9 +98854,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
99074
98854
|
y2 = bounds.y2 + startPoint.y;
|
|
99075
98855
|
}
|
|
99076
98856
|
}
|
|
99077
|
-
else if (mode === 'crosshair' &&
|
|
98857
|
+
else if (mode === 'crosshair' &&
|
|
98858
|
+
((_a = firstDim === null || firstDim === void 0 ? void 0 : firstDim.series) === null || _a === void 0 ? void 0 : _a.coordinate) === 'cartesian' &&
|
|
98859
|
+
firstDim.datum &&
|
|
98860
|
+
firstDim.datum.length) {
|
|
99078
98861
|
isFixedPosition = true;
|
|
99079
|
-
const rect = getCartesianCrosshairRect(
|
|
98862
|
+
const rect = getCartesianCrosshairRect(firstDim, startPoint);
|
|
99080
98863
|
if (rect) {
|
|
99081
98864
|
y1 = rect.start.y;
|
|
99082
98865
|
y2 = rect.end.y;
|
|
@@ -99273,49 +99056,23 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
99273
99056
|
y = (containerHeight - tooltipParentElementRect.y) / tooltipParentElementScale - tooltipBoxHeight;
|
|
99274
99057
|
}
|
|
99275
99058
|
};
|
|
99276
|
-
|
|
99277
|
-
|
|
99278
|
-
|
|
99279
|
-
|
|
99280
|
-
if (isLeftOut()) {
|
|
99281
|
-
detectLeftFirst();
|
|
99282
|
-
detectRightLast();
|
|
99283
|
-
}
|
|
99284
|
-
else {
|
|
99285
|
-
detectRightFirst();
|
|
99286
|
-
detectLeftLast();
|
|
99287
|
-
}
|
|
99288
|
-
break;
|
|
99289
|
-
case 'left':
|
|
99290
|
-
detectLeftFirst();
|
|
99291
|
-
detectRightLast();
|
|
99292
|
-
break;
|
|
99293
|
-
case 'right':
|
|
99294
|
-
detectRightFirst();
|
|
99295
|
-
detectLeftLast();
|
|
99296
|
-
break;
|
|
99059
|
+
const horizontalType = getHorizontalPositionType(position, 'right');
|
|
99060
|
+
if (horizontalType === 'left' || (horizontalType.includes('center') && isLeftOut())) {
|
|
99061
|
+
detectLeftFirst();
|
|
99062
|
+
detectRightLast();
|
|
99297
99063
|
}
|
|
99298
|
-
|
|
99299
|
-
|
|
99300
|
-
|
|
99301
|
-
|
|
99302
|
-
|
|
99303
|
-
|
|
99304
|
-
|
|
99305
|
-
|
|
99306
|
-
|
|
99307
|
-
|
|
99308
|
-
|
|
99309
|
-
|
|
99310
|
-
break;
|
|
99311
|
-
case 'top':
|
|
99312
|
-
detectTopFirst();
|
|
99313
|
-
detectBottomLast();
|
|
99314
|
-
break;
|
|
99315
|
-
case 'bottom':
|
|
99316
|
-
detectBottomFirst();
|
|
99317
|
-
detectTopLast();
|
|
99318
|
-
break;
|
|
99064
|
+
else {
|
|
99065
|
+
detectRightFirst();
|
|
99066
|
+
detectLeftLast();
|
|
99067
|
+
}
|
|
99068
|
+
const verticalType = getVerticalPositionType(position, 'bottom');
|
|
99069
|
+
if (verticalType === 'top' || (verticalType.includes('center') && isTopOut())) {
|
|
99070
|
+
detectTopFirst();
|
|
99071
|
+
detectBottomLast();
|
|
99072
|
+
}
|
|
99073
|
+
else {
|
|
99074
|
+
detectBottomFirst();
|
|
99075
|
+
detectTopLast();
|
|
99319
99076
|
}
|
|
99320
99077
|
const result = { x, y };
|
|
99321
99078
|
this._cacheTooltipPosition = result;
|