@visactor/vchart 1.5.2 → 1.5.3
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 +655 -504
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/base-chart.d.ts +4 -6
- package/cjs/chart/base-chart.js +44 -45
- package/cjs/chart/base-chart.js.map +1 -1
- package/cjs/chart/gauge/gauge.js +3 -2
- package/cjs/chart/gauge/gauge.js.map +1 -1
- package/cjs/chart/interface/chart.d.ts +3 -3
- package/cjs/chart/interface/chart.js.map +1 -1
- package/cjs/chart/sequence/sequence.js +0 -1
- package/cjs/chart/sequence/sequence.js.map +1 -1
- package/cjs/chart/stack.js +1 -2
- package/cjs/component/axis/cartesian/linear-axis.js.map +1 -1
- package/cjs/component/axis/polar/interface/common.d.ts +1 -0
- package/cjs/component/axis/polar/interface/common.js.map +1 -1
- package/cjs/component/axis/util.d.ts +3 -3
- package/cjs/component/axis/util.js +14 -10
- package/cjs/component/axis/util.js.map +1 -1
- package/cjs/component/base/base-component.d.ts +1 -2
- package/cjs/component/base/base-component.js +2 -39
- package/cjs/component/base/base-component.js.map +1 -1
- package/cjs/component/base/util.d.ts +2 -3
- package/cjs/component/base/util.js +16 -19
- package/cjs/component/base/util.js.map +1 -1
- package/cjs/component/brush/brush.js +1 -1
- package/cjs/component/brush/brush.js.map +1 -1
- package/cjs/component/common/trigger/config.d.ts +19 -49
- package/cjs/component/common/trigger/config.js +9 -37
- package/cjs/component/common/trigger/config.js.map +1 -1
- package/cjs/component/crosshair/base.js +14 -11
- package/cjs/component/crosshair/base.js.map +1 -1
- package/cjs/component/crosshair/config.d.ts +11 -31
- package/cjs/component/crosshair/config.js +9 -26
- package/cjs/component/crosshair/config.js.map +1 -1
- package/cjs/component/crosshair/util.d.ts +3 -3
- package/cjs/component/crosshair/util.js +7 -5
- package/cjs/component/crosshair/util.js.map +1 -1
- package/cjs/component/index.js +2 -1
- package/cjs/component/tooltip/handler/base.js +6 -6
- package/cjs/component/tooltip/handler/base.js.map +1 -1
- package/cjs/component/tooltip/handler/utils/attribute.d.ts +3 -3
- package/cjs/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/cjs/component/util.d.ts +4 -0
- package/cjs/component/util.js +14 -0
- package/cjs/component/util.js.map +1 -0
- package/cjs/constant/waterfall.js +1 -2
- package/cjs/constant/word-cloud.js +2 -1
- 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/core/interface.d.ts +7 -1
- package/cjs/core/interface.js.map +1 -1
- package/cjs/core/vchart.d.ts +3 -2
- package/cjs/core/vchart.js +52 -47
- package/cjs/core/vchart.js.map +1 -1
- package/cjs/data/transforms/sankey.d.ts +1 -0
- package/cjs/data/transforms/sankey.js +16 -3
- package/cjs/data/transforms/sankey.js.map +1 -1
- package/cjs/interaction/config.d.ts +17 -52
- package/cjs/interaction/config.js +9 -42
- package/cjs/interaction/config.js.map +1 -1
- package/cjs/interaction/dimension-trigger.js +2 -1
- package/cjs/interaction/drill/drillable.js +1 -1
- package/cjs/interaction/drill/drillable.js.map +1 -1
- package/cjs/interaction/trigger.js +1 -1
- package/cjs/interaction/trigger.js.map +1 -1
- package/cjs/interaction/zoom/zoomable.js +8 -8
- package/cjs/interaction/zoom/zoomable.js.map +1 -1
- package/cjs/layout/base-layout.js +1 -1
- package/cjs/layout/index.js +1 -1
- package/cjs/layout/interface.js +1 -1
- package/cjs/mark/arc-3d.js +1 -1
- package/cjs/mark/arc.js +1 -1
- package/cjs/mark/area.js +1 -1
- package/cjs/mark/base/base-mark.js +4 -5
- package/cjs/mark/base/base-mark.js.map +1 -1
- package/cjs/mark/box-plot.js +1 -1
- package/cjs/model/base-model.d.ts +4 -2
- package/cjs/model/base-model.js +51 -11
- package/cjs/model/base-model.js.map +1 -1
- package/cjs/model/interface.d.ts +10 -3
- package/cjs/model/interface.js.map +1 -1
- package/cjs/series/area/area.d.ts +1 -1
- package/cjs/series/area/area.js +1 -1
- package/cjs/series/area/area.js.map +1 -1
- package/cjs/series/bar/bar.d.ts +1 -1
- package/cjs/series/bar/bar.js +1 -1
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/base/base-series.d.ts +4 -3
- package/cjs/series/base/base-series.js +12 -46
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/cartesian/cartesian.d.ts +3 -0
- package/cjs/series/cartesian/cartesian.js +5 -2
- package/cjs/series/cartesian/cartesian.js.map +1 -1
- package/cjs/series/dot/dot.js +3 -4
- package/cjs/series/dot/dot.js.map +1 -1
- package/cjs/series/gauge/gauge-pointer.d.ts +1 -0
- package/cjs/series/gauge/gauge-pointer.js +1 -1
- package/cjs/series/gauge/gauge-pointer.js.map +1 -1
- package/cjs/series/heatmap/heatmap.js +1 -1
- package/cjs/series/heatmap/heatmap.js.map +1 -1
- package/cjs/series/interface/theme.d.ts +2 -0
- package/cjs/series/interface/theme.js +3 -2
- package/cjs/series/interface/theme.js.map +1 -1
- package/cjs/series/link/link.js +1 -1
- package/cjs/series/link/link.js.map +1 -1
- package/cjs/series/map/map.js +1 -1
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/polar/polar.d.ts +1 -0
- package/cjs/series/polar/polar.js +3 -1
- package/cjs/series/polar/polar.js.map +1 -1
- package/cjs/series/polar/progress-like/progress-like.d.ts +1 -1
- package/cjs/series/polar/progress-like/progress-like.js +2 -3
- package/cjs/series/polar/progress-like/progress-like.js.map +1 -1
- package/cjs/series/progress/circular/circular.js +4 -4
- package/cjs/series/progress/circular/circular.js.map +1 -1
- package/cjs/series/range-area/interface.d.ts +2 -1
- package/cjs/series/range-area/interface.js.map +1 -1
- package/cjs/series/rose/rose.d.ts +1 -1
- package/cjs/series/rose/rose.js +2 -2
- package/cjs/series/rose/rose.js.map +1 -1
- package/cjs/series/sankey/sankey.js +20 -17
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/series/scatter/scatter.d.ts +1 -2
- package/cjs/series/scatter/scatter.js +1 -3
- package/cjs/series/scatter/scatter.js.map +1 -1
- package/cjs/series/waterfall/waterfall.d.ts +1 -1
- package/cjs/series/waterfall/waterfall.js +3 -3
- package/cjs/series/waterfall/waterfall.js.map +1 -1
- package/cjs/series/word-cloud/base.js +34 -35
- package/cjs/series/word-cloud/base.js.map +1 -1
- package/cjs/series/word-cloud/word-cloud-3d.js +32 -32
- package/cjs/series/word-cloud/word-cloud-3d.js.map +1 -1
- package/cjs/theme/builtin/index.d.ts +4 -1
- package/cjs/theme/builtin/index.js +13 -8
- package/cjs/theme/builtin/index.js.map +1 -1
- package/cjs/theme/color-scheme/util.js +2 -1
- package/cjs/theme/color-scheme/util.js.map +1 -1
- package/cjs/theme/theme-manager.js +4 -3
- package/cjs/theme/theme-manager.js.map +1 -1
- package/cjs/theme/util.d.ts +5 -0
- package/cjs/theme/util.js +34 -0
- package/cjs/theme/util.js.map +1 -0
- package/cjs/util/spec/merge-theme.d.ts +4 -1
- package/cjs/util/spec/merge-theme.js +22 -13
- package/cjs/util/spec/merge-theme.js.map +1 -1
- package/cjs/util/spec/preprocess.js +1 -0
- package/cjs/util/spec/preprocess.js.map +1 -1
- package/esm/chart/base-chart.d.ts +4 -6
- package/esm/chart/base-chart.js +42 -42
- package/esm/chart/base-chart.js.map +1 -1
- package/esm/chart/gauge/gauge.js +3 -2
- package/esm/chart/gauge/gauge.js.map +1 -1
- package/esm/chart/interface/chart.d.ts +3 -3
- package/esm/chart/interface/chart.js.map +1 -1
- package/esm/chart/sequence/sequence.js +0 -1
- package/esm/chart/sequence/sequence.js.map +1 -1
- package/esm/chart/stack.js +1 -2
- package/esm/component/axis/cartesian/linear-axis.js.map +1 -1
- package/esm/component/axis/polar/interface/common.d.ts +1 -0
- package/esm/component/axis/polar/interface/common.js.map +1 -1
- package/esm/component/axis/util.d.ts +3 -3
- package/esm/component/axis/util.js +10 -8
- package/esm/component/axis/util.js.map +1 -1
- package/esm/component/base/base-component.d.ts +1 -2
- package/esm/component/base/base-component.js +3 -40
- package/esm/component/base/base-component.js.map +1 -1
- package/esm/component/base/util.d.ts +2 -3
- package/esm/component/base/util.js +19 -16
- package/esm/component/base/util.js.map +1 -1
- package/esm/component/brush/brush.js +1 -1
- package/esm/component/brush/brush.js.map +1 -1
- package/esm/component/common/trigger/config.d.ts +19 -49
- package/esm/component/common/trigger/config.js +7 -35
- package/esm/component/common/trigger/config.js.map +1 -1
- package/esm/component/crosshair/base.js +14 -12
- package/esm/component/crosshair/base.js.map +1 -1
- package/esm/component/crosshair/config.d.ts +11 -31
- package/esm/component/crosshair/config.js +8 -25
- package/esm/component/crosshair/config.js.map +1 -1
- package/esm/component/crosshair/util.d.ts +3 -3
- package/esm/component/crosshair/util.js +8 -4
- package/esm/component/crosshair/util.js.map +1 -1
- package/esm/component/index.js +2 -1
- package/esm/component/tooltip/handler/base.js +7 -5
- package/esm/component/tooltip/handler/base.js.map +1 -1
- package/esm/component/tooltip/handler/utils/attribute.d.ts +3 -3
- package/esm/component/tooltip/handler/utils/attribute.js.map +1 -1
- package/esm/component/util.d.ts +4 -0
- package/esm/component/util.js +6 -0
- package/esm/component/util.js.map +1 -0
- package/esm/constant/waterfall.js +1 -2
- package/esm/constant/word-cloud.js +2 -1
- 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/core/interface.d.ts +7 -1
- package/esm/core/interface.js.map +1 -1
- package/esm/core/vchart.d.ts +3 -2
- package/esm/core/vchart.js +53 -42
- package/esm/core/vchart.js.map +1 -1
- package/esm/data/transforms/sankey.d.ts +1 -0
- package/esm/data/transforms/sankey.js +17 -4
- package/esm/data/transforms/sankey.js.map +1 -1
- package/esm/interaction/config.d.ts +17 -52
- package/esm/interaction/config.js +7 -40
- package/esm/interaction/config.js.map +1 -1
- package/esm/interaction/dimension-trigger.js +2 -1
- package/esm/interaction/drill/drillable.js +2 -2
- package/esm/interaction/drill/drillable.js.map +1 -1
- package/esm/interaction/trigger.js +2 -2
- package/esm/interaction/trigger.js.map +1 -1
- package/esm/interaction/zoom/zoomable.js +9 -9
- package/esm/interaction/zoom/zoomable.js.map +1 -1
- package/esm/layout/base-layout.js +1 -1
- package/esm/layout/index.js +1 -1
- package/esm/layout/interface.js +1 -1
- package/esm/mark/arc-3d.js +1 -1
- package/esm/mark/arc.js +1 -1
- package/esm/mark/area.js +1 -1
- package/esm/mark/base/base-mark.js +4 -5
- package/esm/mark/base/base-mark.js.map +1 -1
- package/esm/mark/box-plot.js +1 -1
- package/esm/model/base-model.d.ts +4 -2
- package/esm/model/base-model.js +53 -10
- package/esm/model/base-model.js.map +1 -1
- package/esm/model/interface.d.ts +10 -3
- package/esm/model/interface.js.map +1 -1
- package/esm/series/area/area.d.ts +1 -1
- package/esm/series/area/area.js +1 -1
- package/esm/series/area/area.js.map +1 -1
- package/esm/series/bar/bar.d.ts +1 -1
- package/esm/series/bar/bar.js +1 -1
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/base/base-series.d.ts +4 -3
- package/esm/series/base/base-series.js +14 -46
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/cartesian/cartesian.d.ts +3 -0
- package/esm/series/cartesian/cartesian.js +4 -3
- package/esm/series/cartesian/cartesian.js.map +1 -1
- package/esm/series/dot/dot.js +2 -4
- package/esm/series/dot/dot.js.map +1 -1
- package/esm/series/gauge/gauge-pointer.d.ts +1 -0
- package/esm/series/gauge/gauge-pointer.js +1 -1
- package/esm/series/gauge/gauge-pointer.js.map +1 -1
- package/esm/series/heatmap/heatmap.js +1 -1
- package/esm/series/heatmap/heatmap.js.map +1 -1
- package/esm/series/interface/theme.d.ts +2 -0
- package/esm/series/interface/theme.js +4 -1
- package/esm/series/interface/theme.js.map +1 -1
- package/esm/series/link/link.js +1 -1
- package/esm/series/link/link.js.map +1 -1
- package/esm/series/map/map.js +1 -1
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/polar/polar.d.ts +1 -0
- package/esm/series/polar/polar.js +3 -2
- package/esm/series/polar/polar.js.map +1 -1
- package/esm/series/polar/progress-like/progress-like.d.ts +1 -1
- package/esm/series/polar/progress-like/progress-like.js +2 -3
- package/esm/series/polar/progress-like/progress-like.js.map +1 -1
- package/esm/series/progress/circular/circular.js +4 -4
- package/esm/series/progress/circular/circular.js.map +1 -1
- package/esm/series/range-area/interface.d.ts +2 -1
- package/esm/series/range-area/interface.js.map +1 -1
- package/esm/series/rose/rose.d.ts +1 -1
- package/esm/series/rose/rose.js +1 -1
- package/esm/series/rose/rose.js.map +1 -1
- package/esm/series/sankey/sankey.js +12 -9
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/series/scatter/scatter.d.ts +1 -2
- package/esm/series/scatter/scatter.js +2 -3
- package/esm/series/scatter/scatter.js.map +1 -1
- package/esm/series/waterfall/waterfall.d.ts +1 -1
- package/esm/series/waterfall/waterfall.js +3 -3
- package/esm/series/waterfall/waterfall.js.map +1 -1
- package/esm/series/word-cloud/base.js +33 -35
- package/esm/series/word-cloud/base.js.map +1 -1
- package/esm/series/word-cloud/word-cloud-3d.js +32 -32
- package/esm/series/word-cloud/word-cloud-3d.js.map +1 -1
- package/esm/theme/builtin/index.d.ts +4 -1
- package/esm/theme/builtin/index.js +15 -6
- package/esm/theme/builtin/index.js.map +1 -1
- package/esm/theme/color-scheme/util.js +1 -1
- package/esm/theme/color-scheme/util.js.map +1 -1
- package/esm/theme/theme-manager.js +5 -4
- package/esm/theme/theme-manager.js.map +1 -1
- package/esm/theme/util.d.ts +5 -0
- package/esm/theme/util.js +34 -0
- package/esm/theme/util.js.map +1 -0
- package/esm/util/spec/merge-theme.d.ts +4 -1
- package/esm/util/spec/merge-theme.js +18 -10
- package/esm/util/spec/merge-theme.js.map +1 -1
- package/esm/util/spec/preprocess.js +2 -1
- package/esm/util/spec/preprocess.js.map +1 -1
- package/package.json +17 -17
package/build/index.js
CHANGED
|
@@ -500,7 +500,7 @@
|
|
|
500
500
|
const isRegExp = value => isType$1(value, "RegExp");
|
|
501
501
|
var isRegExp$1 = isRegExp;
|
|
502
502
|
|
|
503
|
-
const isBase64 = value => new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(value);
|
|
503
|
+
const isBase64 = value => new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(value);
|
|
504
504
|
var isBase64$1 = isBase64;
|
|
505
505
|
|
|
506
506
|
const getType = value => ({}).toString.call(value).replace(/^\[object /, "").replace(/]$/, "");
|
|
@@ -15238,9 +15238,7 @@
|
|
|
15238
15238
|
let data = ResourceLoader.cache.get(url);
|
|
15239
15239
|
data ? "fail" === data.loadState ? application.global.getRequestAnimationFrame()(() => {
|
|
15240
15240
|
mark.imageLoadFail(url);
|
|
15241
|
-
}) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark &&
|
|
15242
|
-
mark.imageLoadSuccess(url, data.data);
|
|
15243
|
-
}) : (data = {
|
|
15241
|
+
}) : "init" === data.loadState || "loading" === data.loadState ? null === (_a = data.waitingMark) || void 0 === _a || _a.push(mark) : mark && mark.imageLoadSuccess(url, data.data) : (data = {
|
|
15244
15242
|
type: "image",
|
|
15245
15243
|
loadState: "init"
|
|
15246
15244
|
}, ResourceLoader.cache.set(url, data), data.dataPromise = application.global.loadImage(url), data.dataPromise ? (data.waitingMark = [mark], data.dataPromise.then(res => {
|
|
@@ -15892,7 +15890,7 @@
|
|
|
15892
15890
|
data: "init",
|
|
15893
15891
|
state: null
|
|
15894
15892
|
};
|
|
15895
|
-
this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading",
|
|
15893
|
+
this.resources.set(url, cache), "string" == typeof image ? (cache.state = "loading", image.startsWith("<svg") ? (ResourceLoader.GetSvg(image, this), this.backgroundImg = this.backgroundImg || background) : (isValidUrl$1(image) || image.includes("/") || isBase64$1(image)) && (ResourceLoader.GetImage(image, this), this.backgroundImg = this.backgroundImg || background)) : (cache.state = "success", cache.data = image, this.backgroundImg = this.backgroundImg || background);
|
|
15896
15894
|
}
|
|
15897
15895
|
imageLoadSuccess(url, image, cb) {
|
|
15898
15896
|
if (!this.resources) return;
|
|
@@ -23758,6 +23756,7 @@
|
|
|
23758
23756
|
return this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
|
|
23759
23757
|
}
|
|
23760
23758
|
clearScreen(renderService, context, drawContext) {
|
|
23759
|
+
var _a;
|
|
23761
23760
|
const {
|
|
23762
23761
|
clear: clear
|
|
23763
23762
|
} = drawContext;
|
|
@@ -23769,7 +23768,12 @@
|
|
|
23769
23768
|
} = drawContext,
|
|
23770
23769
|
x = 0,
|
|
23771
23770
|
y = 0;
|
|
23772
|
-
context.clearRect(x, y, width, height)
|
|
23771
|
+
context.clearRect(x, y, width, height);
|
|
23772
|
+
const stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
|
|
23773
|
+
if (stage && stage.backgroundImg && stage.resources) {
|
|
23774
|
+
const res = stage.resources.get(clear);
|
|
23775
|
+
res && "success" === res.state && res.data && context.drawImage(res.data, x, y, width, height);
|
|
23776
|
+
} else context.fillStyle = createColor(context, clear, {
|
|
23773
23777
|
AABBBounds: {
|
|
23774
23778
|
x1: x,
|
|
23775
23779
|
y1: y,
|
|
@@ -25333,7 +25337,9 @@
|
|
|
25333
25337
|
return this.viewBox.height();
|
|
25334
25338
|
}
|
|
25335
25339
|
}
|
|
25336
|
-
})), params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), this.optmize(params.optimize)
|
|
25340
|
+
})), params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), this.optmize(params.optimize), this._background && isString$1(this._background) && this.setAttributes({
|
|
25341
|
+
background: this._background
|
|
25342
|
+
});
|
|
25337
25343
|
}
|
|
25338
25344
|
optmize(params) {
|
|
25339
25345
|
this.optmizeRender(null == params ? void 0 : params.skipRenderWithOutRange);
|
|
@@ -26874,7 +26880,7 @@
|
|
|
26874
26880
|
return isObject$2(obj) && obj.type === 'palette' && !!obj.key;
|
|
26875
26881
|
}
|
|
26876
26882
|
function isProgressiveDataColorScheme(obj) {
|
|
26877
|
-
if (!isArray$1(obj)) {
|
|
26883
|
+
if (!isArray$1(obj) || obj.length === 0) {
|
|
26878
26884
|
return false;
|
|
26879
26885
|
}
|
|
26880
26886
|
return obj.every(item => {
|
|
@@ -28408,11 +28414,10 @@
|
|
|
28408
28414
|
}, this.graphicItem.setAttributes(this.graphicItem.attribute), this.clearGraphicAttributes(), this.mark.needAnimate() && (this.setPrevGraphicAttributes({}), this.setNextGraphicAttributes(attributes), this.setFinalGraphicAttributes(attributes)));
|
|
28409
28415
|
}
|
|
28410
28416
|
updateGraphicItem(config) {
|
|
28411
|
-
var _a;
|
|
28412
28417
|
if (!this.graphicItem) return;
|
|
28413
28418
|
isNil$1(config.clip) || this.graphicItem.setAttribute("clip", config.clip), isNil$1(config.interactive) || this.graphicItem.setAttribute("pickable", config.interactive), isNil$1(config.zIndex) || this.graphicItem.setAttribute("zIndex", config.zIndex), this.diffState === DiffState.exit ? this.graphicItem.releaseStatus = "willRelease" : this.graphicItem.releaseStatus = void 0;
|
|
28414
|
-
const
|
|
28415
|
-
|
|
28419
|
+
const stateAnimation = this.mark.animate.getAnimationConfigs("state");
|
|
28420
|
+
0 !== stateAnimation.length && (this.graphicItem.stateAnimateConfig = stateAnimation[0].originConfig);
|
|
28416
28421
|
}
|
|
28417
28422
|
getGraphicItem() {
|
|
28418
28423
|
return this.graphicItem;
|
|
@@ -28487,9 +28492,8 @@
|
|
|
28487
28492
|
});
|
|
28488
28493
|
}
|
|
28489
28494
|
clearStates(hasAnimation) {
|
|
28490
|
-
|
|
28491
|
-
|
|
28492
|
-
this.states = [], this.graphicItem && this.graphicItem.clearStates(stateAnimation), this.runtimeStatesEncoder && (this.runtimeStatesEncoder = {});
|
|
28495
|
+
const stateAnimationEnable = isBoolean$1(hasAnimation) ? hasAnimation : 0 !== this.mark.animate.getAnimationConfigs("state").length;
|
|
28496
|
+
this.states = [], this.graphicItem && this.graphicItem.clearStates(stateAnimationEnable), this.runtimeStatesEncoder && (this.runtimeStatesEncoder = {});
|
|
28493
28497
|
}
|
|
28494
28498
|
_updateRuntimeStates(state, attrs) {
|
|
28495
28499
|
this.runtimeStatesEncoder || (this.runtimeStatesEncoder = {}), this.runtimeStatesEncoder[state] = attrs;
|
|
@@ -28511,15 +28515,15 @@
|
|
|
28511
28515
|
}), this.useStates(nextStates));
|
|
28512
28516
|
}
|
|
28513
28517
|
useStates(states, hasAnimation) {
|
|
28514
|
-
var _a
|
|
28518
|
+
var _a;
|
|
28515
28519
|
if (!this.graphicItem) return;
|
|
28516
28520
|
this.mark.emit(HOOK_EVENT.BEFORE_ELEMENT_STATE, {
|
|
28517
28521
|
states: states
|
|
28518
28522
|
}, this), this.states = states.slice();
|
|
28519
28523
|
const stateSort = null === (_a = this.mark.getSpec()) || void 0 === _a ? void 0 : _a.stateSort;
|
|
28520
28524
|
stateSort && this.states.sort(stateSort);
|
|
28521
|
-
const
|
|
28522
|
-
this.graphicItem.stateProxy = this.getStateAttrs, this.graphicItem.useStates(this.states,
|
|
28525
|
+
const stateAnimationEnable = isBoolean$1(hasAnimation) ? hasAnimation : 0 !== this.mark.animate.getAnimationConfigs("state").length;
|
|
28526
|
+
this.graphicItem.stateProxy = this.getStateAttrs, this.graphicItem.useStates(this.states, stateAnimationEnable), this.mark.emit(HOOK_EVENT.AFTER_ELEMENT_STATE, {
|
|
28523
28527
|
states: states
|
|
28524
28528
|
}, this);
|
|
28525
28529
|
}
|
|
@@ -28666,7 +28670,7 @@
|
|
|
28666
28670
|
});
|
|
28667
28671
|
}
|
|
28668
28672
|
setAttribute(key, value, forceUpdateTag) {
|
|
28669
|
-
|
|
28673
|
+
isPlainObject$1(this.attribute[key]) && isPlainObject$1(value) && !isFunction$1(this.attribute[key]) && !isFunction$1(value) ? merge$1(this.attribute[key], value) : this.attribute[key] = value, GROUP_ATTRIBUTES.includes(key) || this.render(), this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.onAttributeUpdate();
|
|
28670
28674
|
}
|
|
28671
28675
|
setAttributes(params, forceUpdateTag) {
|
|
28672
28676
|
const keys = Object.keys(params);
|
|
@@ -30708,12 +30712,32 @@
|
|
|
30708
30712
|
case "right":
|
|
30709
30713
|
case "inside-right":
|
|
30710
30714
|
sx = .5;
|
|
30715
|
+
break;
|
|
30716
|
+
case "top-right":
|
|
30717
|
+
sx = .5, sy = -.5;
|
|
30718
|
+
break;
|
|
30719
|
+
case "top-left":
|
|
30720
|
+
sx = -.5, sy = -.5;
|
|
30721
|
+
break;
|
|
30722
|
+
case "bottom-right":
|
|
30723
|
+
sx = .5, sy = .5;
|
|
30724
|
+
break;
|
|
30725
|
+
case "bottom-left":
|
|
30726
|
+
sx = -.5, sy = .5;
|
|
30711
30727
|
}
|
|
30712
30728
|
anchorX += sx * rectWidth, anchorY += sy * rectHeight;
|
|
30713
30729
|
let vx = 0,
|
|
30714
30730
|
vy = 0;
|
|
30715
30731
|
const isInside = position.includes("inside");
|
|
30716
|
-
position.includes("top") ? vy = isInside ? 1 : -1 : position.includes("bottom") ? vy = isInside ? -1 : 1 : position.includes("left") ? vx = isInside ? 1 : -1 : position.includes("right") && (vx = isInside ? -1 : 1)
|
|
30732
|
+
switch (position.includes("top") ? vy = isInside ? 1 : -1 : position.includes("bottom") ? vy = isInside ? -1 : 1 : position.includes("left") ? vx = isInside ? 1 : -1 : position.includes("right") && (vx = isInside ? -1 : 1), position) {
|
|
30733
|
+
case "top-right":
|
|
30734
|
+
case "bottom-right":
|
|
30735
|
+
vx = -1;
|
|
30736
|
+
break;
|
|
30737
|
+
case "top-left":
|
|
30738
|
+
case "bottom-left":
|
|
30739
|
+
vx = 1;
|
|
30740
|
+
}
|
|
30717
30741
|
return {
|
|
30718
30742
|
x: anchorX + vx * offset + vx * width / 2,
|
|
30719
30743
|
y: anchorY + vy * offset + vy * height / 2
|
|
@@ -31942,7 +31966,7 @@
|
|
|
31942
31966
|
do {
|
|
31943
31967
|
items = reduce(items, sep);
|
|
31944
31968
|
} while (items.length >= 3 && hasOverlap$1(items, sep));
|
|
31945
|
-
items.length < 3 && !last(source).attribute.opacity &&
|
|
31969
|
+
items.length < 3 && !last(source).attribute.opacity && items.length > 1 && last(items).setAttribute("opacity", 0);
|
|
31946
31970
|
}
|
|
31947
31971
|
source.forEach(item => {
|
|
31948
31972
|
item.setAttribute("visible", !!item.attribute.opacity);
|
|
@@ -33592,7 +33616,7 @@
|
|
|
33592
33616
|
width: width,
|
|
33593
33617
|
height: (end - start) * height,
|
|
33594
33618
|
cursor: brushSelect ? "crosshair" : "move"
|
|
33595
|
-
}, selectedBackgroundStyle), "rect"), (null === (_c = null == selectedBackgroundChartStyle ? void 0 : selectedBackgroundChartStyle.line) || void 0 === _c ? void 0 : _c.visible) && this.setSelectedPreviewAttributes("line", group), (null === (_d = null == selectedBackgroundChartStyle ? void 0 : selectedBackgroundChartStyle.area) || void 0 === _d ? void 0 : _d.visible) && this.setSelectedPreviewAttributes("area", group), this.renderText(), this._isHorizontal ? (this._startHandler = group.createOrUpdateChild("startHandler", Object.assign({
|
|
33619
|
+
}, selectedBackgroundStyle), "rect"), (null === (_c = null == selectedBackgroundChartStyle ? void 0 : selectedBackgroundChartStyle.line) || void 0 === _c ? void 0 : _c.visible) && this.setSelectedPreviewAttributes("line", group), (null === (_d = null == selectedBackgroundChartStyle ? void 0 : selectedBackgroundChartStyle.area) || void 0 === _d ? void 0 : _d.visible) && this.setSelectedPreviewAttributes("area", group), this._showText && this.renderText(), this._isHorizontal ? (this._startHandler = group.createOrUpdateChild("startHandler", Object.assign({
|
|
33596
33620
|
x: position.x + start * width,
|
|
33597
33621
|
y: position.y + height / 2,
|
|
33598
33622
|
size: height,
|
|
@@ -33867,11 +33891,13 @@
|
|
|
33867
33891
|
}));
|
|
33868
33892
|
group = createGroup({
|
|
33869
33893
|
x: -(null !== (_a = null == limitRect ? void 0 : limitRect.x) && void 0 !== _a ? _a : 0),
|
|
33870
|
-
y: -(null !== (_b = null == limitRect ? void 0 : limitRect.y) && void 0 !== _b ? _b : 0)
|
|
33894
|
+
y: -(null !== (_b = null == limitRect ? void 0 : limitRect.y) && void 0 !== _b ? _b : 0),
|
|
33895
|
+
pickable: !1
|
|
33871
33896
|
}), groupClip.add(group), this._containerClip = groupClip, this.add(groupClip);
|
|
33872
33897
|
} else group = createGroup({
|
|
33873
33898
|
x: 0,
|
|
33874
|
-
y: 0
|
|
33899
|
+
y: 0,
|
|
33900
|
+
pickable: !1
|
|
33875
33901
|
}), this.add(group);
|
|
33876
33902
|
group.name = "marker-container", this._container = group;
|
|
33877
33903
|
}
|
|
@@ -33887,9 +33913,10 @@
|
|
|
33887
33913
|
});
|
|
33888
33914
|
}
|
|
33889
33915
|
render() {
|
|
33890
|
-
var _a
|
|
33916
|
+
var _a;
|
|
33917
|
+
this.setAttribute("pickable", !1);
|
|
33891
33918
|
const markerVisible = null === (_a = this.attribute.visible) || void 0 === _a || _a;
|
|
33892
|
-
|
|
33919
|
+
!1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1), markerVisible && (this._container ? (this._updateContainer(), this.updateMarker()) : (this._initContainer(), this.initMarker(this._container)));
|
|
33893
33920
|
}
|
|
33894
33921
|
}
|
|
33895
33922
|
|
|
@@ -34210,7 +34237,8 @@
|
|
|
34210
34237
|
endSymbol: endSymbol,
|
|
34211
34238
|
lineStyle: lineStyle,
|
|
34212
34239
|
mainSegmentIndex: mainSegmentIndex,
|
|
34213
|
-
multiSegment: multiSegment
|
|
34240
|
+
multiSegment: multiSegment,
|
|
34241
|
+
pickable: !1
|
|
34214
34242
|
});
|
|
34215
34243
|
line.name = "mark-line-line", this._line = line, container.add(line);
|
|
34216
34244
|
const markLabel = new Tag(Object.assign({}, label));
|
|
@@ -34466,7 +34494,8 @@
|
|
|
34466
34494
|
y: position.y + ((null == itemContent ? void 0 : itemContent.offsetY) || 0)
|
|
34467
34495
|
},
|
|
34468
34496
|
line = new Segment({
|
|
34469
|
-
points: []
|
|
34497
|
+
points: [],
|
|
34498
|
+
pickable: !1
|
|
34470
34499
|
});
|
|
34471
34500
|
line.name = "mark-point-line", this._line = line, container.add(line);
|
|
34472
34501
|
const decorativeLine = createLine({
|
|
@@ -38031,7 +38060,10 @@
|
|
|
38031
38060
|
count = 0;
|
|
38032
38061
|
this.logger.canLogInfo() && (dt = Date.now(), this.logger.debug(`-- START PROPAGATION (${this._updateCounter}) -----`)), this._beforeEvaluate();
|
|
38033
38062
|
try {
|
|
38034
|
-
for (; this._heap.size() > 0;) grammar = this._heap.pop(), grammar.rank === grammar.qrank
|
|
38063
|
+
for (; this._heap.size() > 0;) if (grammar = this._heap.pop(), grammar.rank === grammar.qrank) {
|
|
38064
|
+
if (next = grammar.run(), next && next.then && (next = yield next), !this._isRunning) return !1;
|
|
38065
|
+
this._logGrammarRunInfo(grammar), this._enqueueTargets(grammar), count += 1;
|
|
38066
|
+
} else this._enqueue(grammar);
|
|
38035
38067
|
} catch (err) {
|
|
38036
38068
|
this._heap.clear(), error = err;
|
|
38037
38069
|
}
|
|
@@ -38047,6 +38079,9 @@
|
|
|
38047
38079
|
for (this.logger.canLogInfo() && (dt = Date.now(), this.logger.debug(`-- START PROPAGATION (${this._updateCounter}) -----`)), this._beforeEvaluate(); this._heap.size() > 0;) grammar = this._heap.pop(), grammar.rank === grammar.qrank ? (grammar.runSync(), this._logGrammarRunInfo(grammar), this._enqueueTargets(grammar), count += 1) : this._enqueue(grammar);
|
|
38048
38080
|
return this._isRunning = !1, this.logger.canLogInfo() && (dt = Date.now() - dt, this.logger.info(`> ${count} grammars updated; ${dt} ms`)), this._afterRunner && this._afterRunner(this), this._finishFirstRender = !0, !0;
|
|
38049
38081
|
}
|
|
38082
|
+
stop() {
|
|
38083
|
+
this._isRunning && (this._isRunning = !1);
|
|
38084
|
+
}
|
|
38050
38085
|
runBefore(callback) {
|
|
38051
38086
|
this._beforeRunner = callback;
|
|
38052
38087
|
}
|
|
@@ -38054,7 +38089,7 @@
|
|
|
38054
38089
|
this._afterRunner = callback;
|
|
38055
38090
|
}
|
|
38056
38091
|
release() {
|
|
38057
|
-
this._heap && (this._heap.clear(), this._heap = null), this.logger = null, this._committed = null;
|
|
38092
|
+
this.stop(), this._heap && (this._heap.clear(), this._heap = null), this.logger = null, this._committed = null;
|
|
38058
38093
|
}
|
|
38059
38094
|
}
|
|
38060
38095
|
|
|
@@ -42979,13 +43014,12 @@
|
|
|
42979
43014
|
}), this.clearGraphicAttributes();
|
|
42980
43015
|
}
|
|
42981
43016
|
useStates(states, hasAnimation) {
|
|
42982
|
-
var _a;
|
|
42983
43017
|
if (!this.graphicItem) return;
|
|
42984
43018
|
this.mark.emit(HOOK_EVENT.BEFORE_ELEMENT_STATE, {
|
|
42985
43019
|
states: states
|
|
42986
43020
|
}, this), this.states = states.slice();
|
|
42987
|
-
const
|
|
42988
|
-
this.graphicItem.glyphStateProxy = this.getStateAttrs, this.graphicItem.useStates(this.states,
|
|
43021
|
+
const stateAnimationEnable = isBoolean$1(hasAnimation) ? hasAnimation : 0 !== this.mark.animate.getAnimationConfigs("state").length;
|
|
43022
|
+
this.graphicItem.glyphStateProxy = this.getStateAttrs, this.graphicItem.useStates(this.states, stateAnimationEnable), this.mark.emit(HOOK_EVENT.AFTER_ELEMENT_STATE, {
|
|
42989
43023
|
states: states
|
|
42990
43024
|
}, this);
|
|
42991
43025
|
}
|
|
@@ -43543,6 +43577,10 @@
|
|
|
43543
43577
|
constructor(mark, config) {
|
|
43544
43578
|
this.state = null, this.immediateConfigs = [], this.isEnabled = !0, this.disabledStates = [], this.animators = new Map(), this.elementRecorder = new WeakMap(), this.timelineCount = {}, this.mark = mark, this.configs = normalizeAnimationConfig(null != config ? config : {});
|
|
43545
43579
|
}
|
|
43580
|
+
getAnimationConfigs(animationState) {
|
|
43581
|
+
var _a;
|
|
43582
|
+
return this.isEnabled ? (null !== (_a = this.configs) && void 0 !== _a ? _a : []).filter(config => config.state === animationState) : [];
|
|
43583
|
+
}
|
|
43546
43584
|
updateConfig(config) {
|
|
43547
43585
|
this.configs = normalizeAnimationConfig(null != config ? config : {});
|
|
43548
43586
|
}
|
|
@@ -45841,6 +45879,18 @@
|
|
|
45841
45879
|
},
|
|
45842
45880
|
dataLabels: []
|
|
45843
45881
|
};
|
|
45882
|
+
const lineDataLabel = {
|
|
45883
|
+
type: "line-data",
|
|
45884
|
+
data: [{
|
|
45885
|
+
text: ""
|
|
45886
|
+
}],
|
|
45887
|
+
position: "top",
|
|
45888
|
+
overlap: {
|
|
45889
|
+
avoidBaseMark: !1,
|
|
45890
|
+
clampForce: !1
|
|
45891
|
+
},
|
|
45892
|
+
smartInvert: !1
|
|
45893
|
+
};
|
|
45844
45894
|
const lineLabel = {
|
|
45845
45895
|
type: "line",
|
|
45846
45896
|
data: [{
|
|
@@ -45983,6 +46033,7 @@
|
|
|
45983
46033
|
rectLabel: rectLabel,
|
|
45984
46034
|
symbolLabel: symbolLabel$1,
|
|
45985
46035
|
arcLabel: arcLabel,
|
|
46036
|
+
lineDataLabel: lineDataLabel,
|
|
45986
46037
|
datazoom: datazoom,
|
|
45987
46038
|
continuousPlayer: continuousPlayer,
|
|
45988
46039
|
discretePlayer: discretePlayer,
|
|
@@ -46400,7 +46451,7 @@
|
|
|
46400
46451
|
this.event(eventConfig);
|
|
46401
46452
|
}), (null === (_j = spec.interactions) || void 0 === _j ? void 0 : _j.length) && spec.interactions.forEach(interaction => {
|
|
46402
46453
|
this.interaction(interaction.type, interaction);
|
|
46403
|
-
}), this.emit(HOOK_EVENT.AFTER_PARSE_VIEW), this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before, this;
|
|
46454
|
+
}), !1 === spec.animation ? this.animate.disable() : this.animate.enable(), this.emit(HOOK_EVENT.AFTER_PARSE_VIEW), this._needBuildLayoutTree = !0, this._layoutState = LayoutState.before, this;
|
|
46404
46455
|
}
|
|
46405
46456
|
updateSpec(spec) {
|
|
46406
46457
|
return this.removeAllInteractions(), this.removeAllGrammars(), this.parseSpec(spec);
|
|
@@ -47642,14 +47693,15 @@
|
|
|
47642
47693
|
var _a;
|
|
47643
47694
|
const labelTheme = null === (_a = null == theme ? void 0 : theme.components) || void 0 === _a ? void 0 : _a.dataLabel,
|
|
47644
47695
|
dataLabels = marks.map((mark, index) => {
|
|
47645
|
-
var _a, _b, _c, _d, _e, _f;
|
|
47696
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
47646
47697
|
const labelParameters = Object.assign(Object.assign({}, parameters), {
|
|
47647
47698
|
labelIndex: index
|
|
47648
47699
|
});
|
|
47649
47700
|
let currentTheme = {};
|
|
47650
47701
|
switch (mark.markType) {
|
|
47651
47702
|
case GrammarMarkType.line:
|
|
47652
|
-
|
|
47703
|
+
case GrammarMarkType.area:
|
|
47704
|
+
currentTheme = null === (_a = null == theme ? void 0 : theme.components) || void 0 === _a ? void 0 : _a.lineDataLabel;
|
|
47653
47705
|
break;
|
|
47654
47706
|
case GrammarMarkType.rect:
|
|
47655
47707
|
case GrammarMarkType.interval:
|
|
@@ -47669,17 +47721,22 @@
|
|
|
47669
47721
|
default:
|
|
47670
47722
|
currentTheme = null === (_e = null == theme ? void 0 : theme.components) || void 0 === _e ? void 0 : _e.pointLabel;
|
|
47671
47723
|
}
|
|
47672
|
-
const data = []
|
|
47724
|
+
const data = [],
|
|
47725
|
+
themeDatum = null !== (_g = null === (_f = null == currentTheme ? void 0 : currentTheme.data) || void 0 === _f ? void 0 : _f[0]) && void 0 !== _g ? _g : {};
|
|
47673
47726
|
mark.elements.forEach(element => {
|
|
47674
|
-
|
|
47675
|
-
|
|
47727
|
+
if ("willRelease" !== element.getGraphicItem().releaseStatus) if (mark.isCollectionMark()) {
|
|
47728
|
+
element.getDatum().forEach(entry => {
|
|
47729
|
+
const attributes = invokeEncoder(encoder, entry, element, labelParameters);
|
|
47730
|
+
data.push(merge$1({}, themeDatum, attributes));
|
|
47731
|
+
});
|
|
47732
|
+
} else {
|
|
47676
47733
|
const attributes = invokeEncoder(encoder, element.getDatum(), element, labelParameters),
|
|
47677
|
-
datum = merge$1({},
|
|
47734
|
+
datum = merge$1({}, themeDatum, attributes);
|
|
47678
47735
|
data.push(datum);
|
|
47679
47736
|
}
|
|
47680
47737
|
});
|
|
47681
47738
|
const addition = invokeFunctionType(labelStyle, labelParameters, mark),
|
|
47682
|
-
graphicItemName = null === (
|
|
47739
|
+
graphicItemName = null === (_h = mark.graphicItem) || void 0 === _h ? void 0 : _h.name;
|
|
47683
47740
|
return merge$1({}, currentTheme, {
|
|
47684
47741
|
data: data,
|
|
47685
47742
|
baseMarkGroupName: graphicItemName,
|
|
@@ -50510,6 +50567,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
50510
50567
|
|
|
50511
50568
|
const correlationSeriesMark = Object.assign(Object.assign({}, baseSeriesMark), { [SeriesMarkNameEnum.nodePoint]: { name: SeriesMarkNameEnum.nodePoint, type: MarkTypeEnum.symbol }, [SeriesMarkNameEnum.ripplePoint]: { name: SeriesMarkNameEnum.ripplePoint, type: MarkTypeEnum.ripple }, [SeriesMarkNameEnum.centerPoint]: { name: SeriesMarkNameEnum.centerPoint, type: MarkTypeEnum.symbol }, [SeriesMarkNameEnum.centerLabel]: { name: SeriesMarkNameEnum.centerLabel, type: MarkTypeEnum.text } });
|
|
50512
50569
|
|
|
50570
|
+
const rangeAreaSeriesMark = Object.assign({}, areaSeriesMark);
|
|
50571
|
+
|
|
50513
50572
|
const seriesMarkInfoMap = {
|
|
50514
50573
|
[SeriesTypeEnum.bar]: barSeriesMark,
|
|
50515
50574
|
[SeriesTypeEnum.bar3d]: bar3dSeriesMark,
|
|
@@ -50539,7 +50598,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
50539
50598
|
[SeriesTypeEnum.rangeColumn]: rangeColumnSeriesMark,
|
|
50540
50599
|
[SeriesTypeEnum.circlePacking]: circlePackingSeriesMark,
|
|
50541
50600
|
[SeriesTypeEnum.heatmap]: heatmapSeriesMark,
|
|
50542
|
-
[SeriesTypeEnum.correlation]: correlationSeriesMark
|
|
50601
|
+
[SeriesTypeEnum.correlation]: correlationSeriesMark,
|
|
50602
|
+
[SeriesTypeEnum.rangeArea]: rangeAreaSeriesMark
|
|
50543
50603
|
};
|
|
50544
50604
|
|
|
50545
50605
|
function baseMerge(target, source, shallowArray = false) {
|
|
@@ -50656,32 +50716,37 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
50656
50716
|
if (!theme) {
|
|
50657
50717
|
return theme;
|
|
50658
50718
|
}
|
|
50659
|
-
|
|
50660
|
-
if (colorScheme) {
|
|
50661
|
-
colorScheme = Object.keys(colorScheme).reduce((scheme, key) => {
|
|
50662
|
-
const value = colorScheme[key];
|
|
50663
|
-
scheme[key] = transformColorSchemeToStandardStruct(value);
|
|
50664
|
-
return scheme;
|
|
50665
|
-
}, {});
|
|
50666
|
-
}
|
|
50719
|
+
const colorScheme = transformColorSchemeToMerge(theme.colorScheme);
|
|
50667
50720
|
let { series } = theme;
|
|
50668
50721
|
const { mark: markByType, markByName } = theme;
|
|
50669
50722
|
if (markByType || markByName) {
|
|
50670
50723
|
series = Object.keys(seriesMarkInfoMap).reduce((newSeriesTheme, key) => {
|
|
50671
50724
|
var _a;
|
|
50672
50725
|
const value = (_a = series === null || series === void 0 ? void 0 : series[key]) !== null && _a !== void 0 ? _a : {};
|
|
50673
|
-
|
|
50674
|
-
Object.values(seriesMarkInfoMap[key]).forEach(({ type, name }) => {
|
|
50675
|
-
var _a, _b;
|
|
50676
|
-
newValue[name] = mergeSpec({}, (_a = markByType === null || markByType === void 0 ? void 0 : markByType[array(type)[0]]) !== null && _a !== void 0 ? _a : {}, (_b = markByName === null || markByName === void 0 ? void 0 : markByName[name]) !== null && _b !== void 0 ? _b : {}, value[name]);
|
|
50677
|
-
});
|
|
50678
|
-
newSeriesTheme[key] = Object.assign(Object.assign({}, value), newValue);
|
|
50726
|
+
newSeriesTheme[key] = transformSeriesThemeToMerge(value, key, markByType, markByName);
|
|
50679
50727
|
return newSeriesTheme;
|
|
50680
50728
|
}, {});
|
|
50681
50729
|
}
|
|
50682
50730
|
return Object.assign(Object.assign({}, theme), { colorScheme,
|
|
50683
50731
|
series });
|
|
50684
50732
|
}
|
|
50733
|
+
function transformColorSchemeToMerge(colorScheme) {
|
|
50734
|
+
if (colorScheme) {
|
|
50735
|
+
colorScheme = Object.keys(colorScheme).reduce((scheme, key) => {
|
|
50736
|
+
const value = colorScheme[key];
|
|
50737
|
+
scheme[key] = transformColorSchemeToStandardStruct(value);
|
|
50738
|
+
return scheme;
|
|
50739
|
+
}, {});
|
|
50740
|
+
}
|
|
50741
|
+
return colorScheme;
|
|
50742
|
+
}
|
|
50743
|
+
function transformSeriesThemeToMerge(seriesTheme, seriesType, markByType, markByName) {
|
|
50744
|
+
const newTheme = {};
|
|
50745
|
+
Object.values(seriesMarkInfoMap[seriesType]).forEach(({ type, name }) => {
|
|
50746
|
+
newTheme[name] = mergeSpec({}, markByType === null || markByType === void 0 ? void 0 : markByType[array(type)[0]], markByName === null || markByName === void 0 ? void 0 : markByName[name], seriesTheme === null || seriesTheme === void 0 ? void 0 : seriesTheme[name]);
|
|
50747
|
+
});
|
|
50748
|
+
return Object.assign(Object.assign({}, seriesTheme), newTheme);
|
|
50749
|
+
}
|
|
50685
50750
|
|
|
50686
50751
|
const colorScheme = {
|
|
50687
50752
|
default: {
|
|
@@ -50728,18 +50793,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
50728
50793
|
}
|
|
50729
50794
|
};
|
|
50730
50795
|
|
|
50731
|
-
const
|
|
50732
|
-
[lightTheme.name
|
|
50733
|
-
[darkTheme.name
|
|
50734
|
-
|
|
50796
|
+
const builtinThemes = {
|
|
50797
|
+
[lightTheme.name]: lightTheme,
|
|
50798
|
+
[darkTheme.name]: darkTheme
|
|
50799
|
+
};
|
|
50735
50800
|
const defaultThemeName = lightTheme.name;
|
|
50736
|
-
const themes = new Map([
|
|
50737
|
-
const
|
|
50738
|
-
|
|
50739
|
-
|
|
50740
|
-
|
|
50741
|
-
|
|
50742
|
-
|
|
50801
|
+
const themes = new Map(Object.keys(builtinThemes).map(key => [key, builtinThemes[key]]));
|
|
50802
|
+
const hasThemeMerged = new Map(Object.keys(builtinThemes).map(key => [key, key === defaultThemeName]));
|
|
50803
|
+
const getMergedTheme = (theme) => mergeTheme({}, themes.get(defaultThemeName), theme);
|
|
50804
|
+
const defaultChartLevelTheme = {
|
|
50805
|
+
background: getActualColor(builtinThemes[defaultThemeName].background, builtinThemes[defaultThemeName].colorScheme),
|
|
50806
|
+
fontFamily: builtinThemes[defaultThemeName].fontFamily,
|
|
50807
|
+
colorScheme: builtinThemes[defaultThemeName].colorScheme
|
|
50808
|
+
};
|
|
50743
50809
|
|
|
50744
50810
|
class InstanceManager {
|
|
50745
50811
|
static registerInstance(instance) {
|
|
@@ -50772,12 +50838,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
50772
50838
|
return;
|
|
50773
50839
|
}
|
|
50774
50840
|
ThemeManager.themes.set(name, getMergedTheme(theme));
|
|
50841
|
+
hasThemeMerged.set(name, true);
|
|
50775
50842
|
}
|
|
50776
50843
|
static getTheme(name) {
|
|
50844
|
+
if (hasThemeMerged.has(name) && !hasThemeMerged.get(name)) {
|
|
50845
|
+
ThemeManager.registerTheme(name, ThemeManager.themes.get(name));
|
|
50846
|
+
}
|
|
50777
50847
|
return ThemeManager.themes.get(name) || ThemeManager.getDefaultTheme();
|
|
50778
50848
|
}
|
|
50779
50849
|
static removeTheme(name) {
|
|
50780
|
-
return ThemeManager.themes.delete(name);
|
|
50850
|
+
return ThemeManager.themes.delete(name) && hasThemeMerged.delete(name);
|
|
50781
50851
|
}
|
|
50782
50852
|
static themeExist(name) {
|
|
50783
50853
|
if (!isString$1(name)) {
|
|
@@ -50877,6 +50947,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
50877
50947
|
}
|
|
50878
50948
|
|
|
50879
50949
|
function preprocessSpecOrTheme(type, obj, colorScheme, seriesType) {
|
|
50950
|
+
if (isNil$1(obj)) {
|
|
50951
|
+
return obj;
|
|
50952
|
+
}
|
|
50880
50953
|
if (isArray$1(obj)) {
|
|
50881
50954
|
return obj.map(element => {
|
|
50882
50955
|
if (isObject$2(element) && !isFunction$1(element)) {
|
|
@@ -53709,6 +53782,55 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
53709
53782
|
}
|
|
53710
53783
|
}
|
|
53711
53784
|
|
|
53785
|
+
const mergeThemeAndGet = (path, currentThemeName, optionTheme, specTheme, colorScheme) => {
|
|
53786
|
+
if (isString$1(specTheme) && ThemeManager.themeExist(specTheme)) {
|
|
53787
|
+
return getMergedValue(getThemeValue(path, specTheme, colorScheme));
|
|
53788
|
+
}
|
|
53789
|
+
else if (isString$1(optionTheme) && ThemeManager.themeExist(optionTheme)) {
|
|
53790
|
+
return getMergedValue(getThemeValue(path, optionTheme, colorScheme), getThemeValue(path, specTheme, colorScheme));
|
|
53791
|
+
}
|
|
53792
|
+
return getMergedValue(getThemeValue(path, currentThemeName, colorScheme), getThemeValue(path, optionTheme, colorScheme), getThemeValue(path, specTheme, colorScheme));
|
|
53793
|
+
};
|
|
53794
|
+
const getThemeValue = (path, theme, colorScheme) => {
|
|
53795
|
+
let themeObject;
|
|
53796
|
+
if (isString$1(theme) && ThemeManager.themeExist(theme)) {
|
|
53797
|
+
themeObject = ThemeManager.getTheme(theme);
|
|
53798
|
+
}
|
|
53799
|
+
else if (isObject$2(theme)) {
|
|
53800
|
+
themeObject = theme;
|
|
53801
|
+
}
|
|
53802
|
+
if (isNil$1(themeObject)) {
|
|
53803
|
+
return undefined;
|
|
53804
|
+
}
|
|
53805
|
+
const paths = path.split('.');
|
|
53806
|
+
const colorSchemePath = 'colorScheme';
|
|
53807
|
+
if (path === colorSchemePath) {
|
|
53808
|
+
return transformColorSchemeToMerge(themeObject.colorScheme);
|
|
53809
|
+
}
|
|
53810
|
+
const backgroundPath = 'background';
|
|
53811
|
+
if (path === backgroundPath) {
|
|
53812
|
+
return getActualColor(themeObject.background, colorScheme);
|
|
53813
|
+
}
|
|
53814
|
+
const seriesPath = 'series';
|
|
53815
|
+
if (paths.length === 2 && paths[0] === seriesPath) {
|
|
53816
|
+
const { markByName, mark } = themeObject;
|
|
53817
|
+
return transformSeriesThemeToMerge(get$1(themeObject, paths), paths[1], mark, markByName);
|
|
53818
|
+
}
|
|
53819
|
+
return get$1(themeObject, paths);
|
|
53820
|
+
};
|
|
53821
|
+
const getMergedValue = (...sources) => {
|
|
53822
|
+
const tmpKey = '__TMP_KEY__';
|
|
53823
|
+
const obj = mergeSpec({}, ...sources.map(source => ({
|
|
53824
|
+
[tmpKey]: source
|
|
53825
|
+
})));
|
|
53826
|
+
return obj[tmpKey];
|
|
53827
|
+
};
|
|
53828
|
+
const getThemeFromOption = (path, option) => {
|
|
53829
|
+
var _a, _b;
|
|
53830
|
+
const { globalTheme = defaultThemeName, optionTheme, specTheme, chartLevelTheme = defaultChartLevelTheme } = (_b = (_a = option.getThemeConfig) === null || _a === void 0 ? void 0 : _a.call(option)) !== null && _b !== void 0 ? _b : {};
|
|
53831
|
+
return mergeThemeAndGet(path, globalTheme, optionTheme, specTheme, chartLevelTheme === null || chartLevelTheme === void 0 ? void 0 : chartLevelTheme.colorScheme);
|
|
53832
|
+
};
|
|
53833
|
+
|
|
53712
53834
|
class BaseModel extends LayoutItem {
|
|
53713
53835
|
getData() {
|
|
53714
53836
|
return this._data;
|
|
@@ -53848,19 +53970,26 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
53848
53970
|
this.setAttrFromSpec();
|
|
53849
53971
|
}
|
|
53850
53972
|
_initTheme(theme) {
|
|
53851
|
-
|
|
53973
|
+
if (theme) {
|
|
53974
|
+
this._theme = theme;
|
|
53975
|
+
}
|
|
53976
|
+
else {
|
|
53977
|
+
this._theme = this._getTheme();
|
|
53978
|
+
}
|
|
53852
53979
|
this._mergeMarkTheme();
|
|
53980
|
+
this._mergeThemeToSpec();
|
|
53853
53981
|
}
|
|
53854
|
-
|
|
53855
|
-
|
|
53982
|
+
_getTheme() {
|
|
53983
|
+
return undefined;
|
|
53856
53984
|
}
|
|
53857
53985
|
_mergeMarkTheme() {
|
|
53858
53986
|
var _a, _b;
|
|
53859
|
-
const
|
|
53860
|
-
if (isNil$1(
|
|
53987
|
+
const config = (_b = (_a = this._option).getThemeConfig) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
53988
|
+
if (isNil$1(config) || isNil$1(this._theme)) {
|
|
53861
53989
|
return;
|
|
53862
53990
|
}
|
|
53863
|
-
const
|
|
53991
|
+
const markThemeByType = getThemeFromOption('mark', this._option);
|
|
53992
|
+
const markThemeByName = getThemeFromOption('markByName', this._option);
|
|
53864
53993
|
this.getMarkInfoList().forEach(({ type, name }) => {
|
|
53865
53994
|
var _a, _b;
|
|
53866
53995
|
this._theme[name] = mergeSpec({}, (_a = markThemeByType === null || markThemeByType === void 0 ? void 0 : markThemeByType[array(type)[0]]) !== null && _a !== void 0 ? _a : {}, (_b = markThemeByName === null || markThemeByName === void 0 ? void 0 : markThemeByName[name]) !== null && _b !== void 0 ? _b : {}, this._theme[name]);
|
|
@@ -53890,17 +54019,28 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
53890
54019
|
return obj;
|
|
53891
54020
|
}
|
|
53892
54021
|
_prepareSpecAfterMergingTheme(obj) {
|
|
53893
|
-
var _a, _b, _c;
|
|
53894
54022
|
if (!arguments.length) {
|
|
53895
54023
|
obj = this._spec;
|
|
53896
54024
|
}
|
|
53897
|
-
const newObj = preprocessSpecOrTheme('spec', obj,
|
|
54025
|
+
const newObj = preprocessSpecOrTheme('spec', obj, this.getColorScheme(), this.modelType === 'series' ? this.type : undefined);
|
|
53898
54026
|
if (!arguments.length) {
|
|
53899
54027
|
this._spec = newObj;
|
|
53900
54028
|
}
|
|
53901
54029
|
return newObj;
|
|
53902
54030
|
}
|
|
53903
|
-
setCurrentTheme(
|
|
54031
|
+
setCurrentTheme(noRender) {
|
|
54032
|
+
return __awaiter$h(this, void 0, void 0, function* () {
|
|
54033
|
+
const modifyConfig = () => {
|
|
54034
|
+
this.reInit(this._getTheme());
|
|
54035
|
+
return { change: true, reMake: false };
|
|
54036
|
+
};
|
|
54037
|
+
if (noRender) {
|
|
54038
|
+
modifyConfig();
|
|
54039
|
+
}
|
|
54040
|
+
else {
|
|
54041
|
+
yield this._option.globalInstance.updateCustomConfigAndRerender(modifyConfig);
|
|
54042
|
+
}
|
|
54043
|
+
});
|
|
53904
54044
|
}
|
|
53905
54045
|
updateLayoutAttribute() {
|
|
53906
54046
|
}
|
|
@@ -53970,6 +54110,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
53970
54110
|
_getDataIdKey() {
|
|
53971
54111
|
return undefined;
|
|
53972
54112
|
}
|
|
54113
|
+
getColorScheme() {
|
|
54114
|
+
var _a, _b, _c;
|
|
54115
|
+
return ((_c = (_b = (_a = this._option).getThemeConfig) === null || _b === void 0 ? void 0 : _b.call(_a).chartLevelTheme) !== null && _c !== void 0 ? _c : defaultChartLevelTheme).colorScheme;
|
|
54116
|
+
}
|
|
54117
|
+
_getChartLevelTheme() {
|
|
54118
|
+
var _a, _b, _c;
|
|
54119
|
+
return (_c = (_b = (_a = this._option).getThemeConfig) === null || _b === void 0 ? void 0 : _b.call(_a).chartLevelTheme) !== null && _c !== void 0 ? _c : defaultChartLevelTheme;
|
|
54120
|
+
}
|
|
53973
54121
|
}
|
|
53974
54122
|
|
|
53975
54123
|
function isStateAttrChangeable(key, stateStyle, facetField) {
|
|
@@ -56484,7 +56632,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56484
56632
|
}
|
|
56485
56633
|
}
|
|
56486
56634
|
_computeGradientAttr(gradientStyle, data, opt) {
|
|
56487
|
-
var _a, _b;
|
|
56488
56635
|
const { gradient, scale, field } = gradientStyle, rest = __rest$8(gradientStyle, ["gradient", "scale", "field"]);
|
|
56489
56636
|
const markData = this.getDataView();
|
|
56490
56637
|
let colorScale = scale;
|
|
@@ -56498,7 +56645,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56498
56645
|
colorField = globalField;
|
|
56499
56646
|
}
|
|
56500
56647
|
}
|
|
56501
|
-
const themeColor = computeActualDataScheme(getDataScheme(
|
|
56648
|
+
const themeColor = computeActualDataScheme(getDataScheme(this.model.getColorScheme(), this.model.modelType === 'series' ? this.model.type : undefined), this.model.getDefaultColorDomain());
|
|
56502
56649
|
const computeStyle = {};
|
|
56503
56650
|
const mergedStyle = Object.assign(Object.assign({}, DEFAULT_GRADIENT_CONFIG[gradient]), rest);
|
|
56504
56651
|
Object.keys(mergedStyle).forEach(key => {
|
|
@@ -56530,7 +56677,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56530
56677
|
return computeStyle;
|
|
56531
56678
|
}
|
|
56532
56679
|
_computeBorderAttr(borderStyle, data, opt) {
|
|
56533
|
-
var _a
|
|
56680
|
+
var _a;
|
|
56534
56681
|
const { scale, field } = borderStyle, mergedStyle = __rest$8(borderStyle, ["scale", "field"]);
|
|
56535
56682
|
const computeStyle = {};
|
|
56536
56683
|
Object.keys(mergedStyle).forEach(key => {
|
|
@@ -56543,7 +56690,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56543
56690
|
}
|
|
56544
56691
|
});
|
|
56545
56692
|
if (!('stroke' in computeStyle)) {
|
|
56546
|
-
const themeColor = computeActualDataScheme(getDataScheme(
|
|
56693
|
+
const themeColor = computeActualDataScheme(getDataScheme(this.model.getColorScheme(), this.model.modelType === 'series' ? this.model.type : undefined), this.model.getDefaultColorDomain());
|
|
56547
56694
|
let colorScale = scale;
|
|
56548
56695
|
let colorField = field;
|
|
56549
56696
|
if ((!scale || !field) && this.model.modelType === 'series') {
|
|
@@ -56557,7 +56704,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
56557
56704
|
computeStyle.stroke = (colorScale === null || colorScale === void 0 ? void 0 : colorScale.scale(data[colorField])) || themeColor[0];
|
|
56558
56705
|
}
|
|
56559
56706
|
}
|
|
56560
|
-
else if (GradientType.includes((
|
|
56707
|
+
else if (GradientType.includes((_a = mergedStyle.stroke) === null || _a === void 0 ? void 0 : _a.gradient)) {
|
|
56561
56708
|
computeStyle.stroke = this._computeGradientAttr(mergedStyle.stroke, data, opt);
|
|
56562
56709
|
}
|
|
56563
56710
|
return computeStyle;
|
|
@@ -57249,13 +57396,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57249
57396
|
}
|
|
57250
57397
|
};
|
|
57251
57398
|
this._observer = null;
|
|
57399
|
+
this._currentChartLevelTheme = {};
|
|
57252
57400
|
this._context = {};
|
|
57253
57401
|
this._onResize = debounce((...args) => {
|
|
57254
|
-
|
|
57255
|
-
if (this._curSize.width !== width || this._curSize.height !== height) {
|
|
57256
|
-
this._curSize = { width, height };
|
|
57257
|
-
this.resize(width, height);
|
|
57258
|
-
}
|
|
57402
|
+
this._doResize();
|
|
57259
57403
|
}, 100);
|
|
57260
57404
|
this._option = merge$1(this._option, options);
|
|
57261
57405
|
this._onError = (_a = this._option) === null || _a === void 0 ? void 0 : _a.onError;
|
|
@@ -57292,7 +57436,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57292
57436
|
this._event = new Event$1(this._eventDispatcher, mode);
|
|
57293
57437
|
this._compiler.initView();
|
|
57294
57438
|
(_d = this.getStage()) === null || _d === void 0 ? void 0 : _d.setTheme({
|
|
57295
|
-
text: { fontFamily: this.
|
|
57439
|
+
text: { fontFamily: this._currentChartLevelTheme.fontFamily }
|
|
57296
57440
|
});
|
|
57297
57441
|
this._initDataSet(this._option.dataSet);
|
|
57298
57442
|
this._autoSize = isTrueBrowser(mode) ? (_f = (_e = spec.autoFit) !== null && _e !== void 0 ? _e : this._option.autoFit) !== null && _f !== void 0 ? _f : true : false;
|
|
@@ -57326,7 +57470,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57326
57470
|
performanceHook: this._option.performanceHook,
|
|
57327
57471
|
viewBox: this._viewBox,
|
|
57328
57472
|
animation: this._option.animation,
|
|
57329
|
-
|
|
57473
|
+
getThemeConfig: () => {
|
|
57474
|
+
var _a;
|
|
57475
|
+
return ({
|
|
57476
|
+
globalTheme: this._currentThemeName,
|
|
57477
|
+
optionTheme: this._option.theme,
|
|
57478
|
+
specTheme: (_a = this._spec) === null || _a === void 0 ? void 0 : _a.theme,
|
|
57479
|
+
chartLevelTheme: this._currentChartLevelTheme
|
|
57480
|
+
});
|
|
57481
|
+
},
|
|
57330
57482
|
layout: this._option.layout,
|
|
57331
57483
|
onError: this._onError
|
|
57332
57484
|
});
|
|
@@ -57381,6 +57533,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57381
57533
|
const { width: containerWidth, height: containerHeight } = getContainerSize(this._container, DEFAULT_CHART_WIDTH, DEFAULT_CHART_HEIGHT);
|
|
57382
57534
|
return { width: (_a = this._spec.width) !== null && _a !== void 0 ? _a : containerWidth, height: (_b = this._spec.height) !== null && _b !== void 0 ? _b : containerHeight };
|
|
57383
57535
|
}
|
|
57536
|
+
_doResize() {
|
|
57537
|
+
const { width, height } = this._getCurSize();
|
|
57538
|
+
if (this._curSize.width !== width || this._curSize.height !== height) {
|
|
57539
|
+
this._curSize = { width, height };
|
|
57540
|
+
this.resize(width, height);
|
|
57541
|
+
}
|
|
57542
|
+
}
|
|
57384
57543
|
_initDataSet(dataSet) {
|
|
57385
57544
|
if (dataSet instanceof DataSet) {
|
|
57386
57545
|
this._dataSet = dataSet;
|
|
@@ -57429,7 +57588,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57429
57588
|
(_a = this._compiler) === null || _a === void 0 ? void 0 : _a.releaseGrammar();
|
|
57430
57589
|
this._userEvents.forEach(e => { var _a; return (_a = this._event) === null || _a === void 0 ? void 0 : _a.on(e.eType, e.query, e.handler); });
|
|
57431
57590
|
if (updateResult.reSize) {
|
|
57432
|
-
this.
|
|
57591
|
+
this._doResize();
|
|
57433
57592
|
}
|
|
57434
57593
|
}
|
|
57435
57594
|
else {
|
|
@@ -57668,9 +57827,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57668
57827
|
this._spec = spec;
|
|
57669
57828
|
if (!isEqual$1(lastSpec.theme, spec.theme)) {
|
|
57670
57829
|
this._updateCurrentTheme();
|
|
57671
|
-
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.setCurrentTheme(
|
|
57830
|
+
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.setCurrentTheme();
|
|
57672
57831
|
}
|
|
57673
|
-
const reSize = this.
|
|
57832
|
+
const reSize = this._shouldChartResize(lastSpec);
|
|
57674
57833
|
(_c = (_b = this._compiler) === null || _b === void 0 ? void 0 : _b.getVGrammarView()) === null || _c === void 0 ? void 0 : _c.updateLayoutTag();
|
|
57675
57834
|
return mergeUpdateResult(this._chart.updateSpec(spec, morphConfig), {
|
|
57676
57835
|
change: reSize,
|
|
@@ -57693,13 +57852,17 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57693
57852
|
spec = mergeSpec({}, this._spec, spec);
|
|
57694
57853
|
}
|
|
57695
57854
|
this.updateCustomConfigAndRerenderSync(() => {
|
|
57696
|
-
var _a, _b, _c;
|
|
57855
|
+
var _a, _b, _c, _d;
|
|
57697
57856
|
spec = specTransform(spec);
|
|
57698
57857
|
spec.data = (_a = spec.data) !== null && _a !== void 0 ? _a : [];
|
|
57699
57858
|
const lastSpec = this._spec;
|
|
57700
57859
|
this._spec = spec;
|
|
57701
|
-
|
|
57702
|
-
|
|
57860
|
+
if (!isEqual$1(lastSpec.theme, spec.theme)) {
|
|
57861
|
+
this._updateCurrentTheme();
|
|
57862
|
+
(_b = this._chart) === null || _b === void 0 ? void 0 : _b.setCurrentTheme();
|
|
57863
|
+
}
|
|
57864
|
+
const reSize = this._shouldChartResize(lastSpec);
|
|
57865
|
+
(_d = (_c = this._compiler) === null || _c === void 0 ? void 0 : _c.getVGrammarView()) === null || _d === void 0 ? void 0 : _d.updateLayoutTag();
|
|
57703
57866
|
return mergeUpdateResult(this._chart.updateSpec(spec, morphConfig), {
|
|
57704
57867
|
change: reSize,
|
|
57705
57868
|
reMake: false,
|
|
@@ -57798,6 +57961,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57798
57961
|
}
|
|
57799
57962
|
on(eType, query, handler) {
|
|
57800
57963
|
var _a;
|
|
57964
|
+
if (!this._userEvents) {
|
|
57965
|
+
return;
|
|
57966
|
+
}
|
|
57801
57967
|
this._userEvents.push({
|
|
57802
57968
|
eType,
|
|
57803
57969
|
query: typeof query === 'function' ? null : query,
|
|
@@ -57807,6 +57973,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57807
57973
|
}
|
|
57808
57974
|
off(eType, handler) {
|
|
57809
57975
|
var _a;
|
|
57976
|
+
if (!this._userEvents || this._userEvents.length === 0) {
|
|
57977
|
+
return;
|
|
57978
|
+
}
|
|
57810
57979
|
if (handler) {
|
|
57811
57980
|
const index = this._userEvents.findIndex(e => e.eType === eType && e.handler === handler);
|
|
57812
57981
|
if (index >= 0) {
|
|
@@ -57843,39 +58012,34 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57843
58012
|
this._chart.setHovered(datum, filter, region);
|
|
57844
58013
|
}
|
|
57845
58014
|
_updateCurrentTheme(nextThemeName) {
|
|
57846
|
-
var _a, _b
|
|
57847
|
-
|
|
57848
|
-
|
|
57849
|
-
|
|
57850
|
-
if (ThemeManager.themeExist(nextThemeName)) {
|
|
57851
|
-
const newTheme = ThemeManager.getTheme(nextThemeName);
|
|
57852
|
-
optionTheme = !optionTheme || isString$1(optionTheme) ? {} : optionTheme;
|
|
57853
|
-
specTheme = !specTheme || isString$1(specTheme) ? {} : specTheme;
|
|
57854
|
-
finalTheme = mergeTheme({}, newTheme, optionTheme, specTheme);
|
|
58015
|
+
var _a, _b;
|
|
58016
|
+
const optionTheme = this._option.theme;
|
|
58017
|
+
const specTheme = (_a = this._spec) === null || _a === void 0 ? void 0 : _a.theme;
|
|
58018
|
+
if (nextThemeName) {
|
|
57855
58019
|
this._currentThemeName = nextThemeName;
|
|
57856
58020
|
}
|
|
57857
|
-
|
|
57858
|
-
|
|
57859
|
-
|
|
57860
|
-
|
|
57861
|
-
|
|
57862
|
-
|
|
57863
|
-
|
|
57864
|
-
|
|
57865
|
-
}
|
|
57866
|
-
else {
|
|
57867
|
-
const baseTheme = getThemeObject(this._currentThemeName);
|
|
57868
|
-
finalTheme = mergeTheme({}, baseTheme, getThemeObject(optionTheme), getThemeObject(specTheme));
|
|
57869
|
-
}
|
|
57870
|
-
}
|
|
57871
|
-
this._currentTheme = preprocessSpecOrTheme('theme', finalTheme, finalTheme.colorScheme);
|
|
57872
|
-
setPoptipTheme(preprocessSpecOrTheme('mark-theme', mergeSpec({}, (_b = this._currentTheme.component) === null || _b === void 0 ? void 0 : _b.poptip)));
|
|
57873
|
-
(_c = this._compiler) === null || _c === void 0 ? void 0 : _c.setBackground(this._getBackground());
|
|
58021
|
+
const colorScheme = mergeThemeAndGet('colorScheme', this._currentThemeName, optionTheme, specTheme);
|
|
58022
|
+
this._currentChartLevelTheme = {
|
|
58023
|
+
colorScheme,
|
|
58024
|
+
background: mergeThemeAndGet('background', this._currentThemeName, optionTheme, specTheme, colorScheme),
|
|
58025
|
+
fontFamily: mergeThemeAndGet('fontFamily', this._currentThemeName, optionTheme, specTheme, colorScheme)
|
|
58026
|
+
};
|
|
58027
|
+
setPoptipTheme(preprocessSpecOrTheme('mark-theme', mergeThemeAndGet('component.poptip', this._currentThemeName, optionTheme, specTheme, colorScheme), colorScheme));
|
|
58028
|
+
(_b = this._compiler) === null || _b === void 0 ? void 0 : _b.setBackground(this._getBackground());
|
|
57874
58029
|
}
|
|
57875
|
-
|
|
58030
|
+
_shouldChartResize(oldSpec) {
|
|
57876
58031
|
var _a, _b;
|
|
57877
58032
|
let resize = false;
|
|
57878
|
-
if (this._spec.width
|
|
58033
|
+
if (isNil$1(this._spec.width)) {
|
|
58034
|
+
this._spec.width = oldSpec.width;
|
|
58035
|
+
}
|
|
58036
|
+
else if (this._spec.width !== oldSpec.width) {
|
|
58037
|
+
resize = true;
|
|
58038
|
+
}
|
|
58039
|
+
if (isNil$1(this._spec.height)) {
|
|
58040
|
+
this._spec.height = oldSpec.height;
|
|
58041
|
+
}
|
|
58042
|
+
else if (this._spec.height !== oldSpec.height) {
|
|
57879
58043
|
resize = true;
|
|
57880
58044
|
}
|
|
57881
58045
|
const lasAutoSize = this._autoSize;
|
|
@@ -57883,15 +58047,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57883
58047
|
if (this._autoSize !== lasAutoSize) {
|
|
57884
58048
|
resize = true;
|
|
57885
58049
|
}
|
|
57886
|
-
this._updateCurrentTheme();
|
|
57887
58050
|
return resize;
|
|
57888
58051
|
}
|
|
57889
58052
|
_getBackground() {
|
|
57890
58053
|
const specBackground = typeof this._spec.background === 'string' ? this._spec.background : null;
|
|
57891
|
-
return specBackground || this.
|
|
58054
|
+
return specBackground || this._currentChartLevelTheme.background || this._option.background;
|
|
57892
58055
|
}
|
|
57893
58056
|
getCurrentTheme() {
|
|
57894
|
-
return this.
|
|
58057
|
+
return getThemeObject(this._currentThemeName);
|
|
57895
58058
|
}
|
|
57896
58059
|
getCurrentThemeName() {
|
|
57897
58060
|
return this._currentThemeName;
|
|
@@ -57904,7 +58067,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57904
58067
|
yield this.updateCustomConfigAndRerender(() => {
|
|
57905
58068
|
var _a;
|
|
57906
58069
|
this._updateCurrentTheme(name);
|
|
57907
|
-
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.setCurrentTheme(
|
|
58070
|
+
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.setCurrentTheme(true);
|
|
57908
58071
|
return { change: true, reMake: false };
|
|
57909
58072
|
});
|
|
57910
58073
|
return this;
|
|
@@ -57917,7 +58080,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
57917
58080
|
this.updateCustomConfigAndRerenderSync(() => {
|
|
57918
58081
|
var _a;
|
|
57919
58082
|
this._updateCurrentTheme(name);
|
|
57920
|
-
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.setCurrentTheme(
|
|
58083
|
+
(_a = this._chart) === null || _a === void 0 ? void 0 : _a.setCurrentTheme(true);
|
|
57921
58084
|
return { change: true, reMake: false };
|
|
57922
58085
|
});
|
|
57923
58086
|
return this;
|
|
@@ -58208,7 +58371,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58208
58371
|
};
|
|
58209
58372
|
registerVChartCore();
|
|
58210
58373
|
|
|
58211
|
-
const version = "1.5.
|
|
58374
|
+
const version = "1.5.3";
|
|
58212
58375
|
|
|
58213
58376
|
class ChartData {
|
|
58214
58377
|
get dataList() {
|
|
@@ -58646,7 +58809,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58646
58809
|
return this._chartData;
|
|
58647
58810
|
}
|
|
58648
58811
|
constructor(spec, option) {
|
|
58649
|
-
var _a, _b, _c
|
|
58812
|
+
var _a, _b, _c;
|
|
58650
58813
|
super(option);
|
|
58651
58814
|
this.type = 'chart';
|
|
58652
58815
|
this.id = createID();
|
|
@@ -58770,12 +58933,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58770
58933
|
}
|
|
58771
58934
|
return undefined;
|
|
58772
58935
|
};
|
|
58773
|
-
this.
|
|
58774
|
-
this._paddingSpec = normalizeLayoutPaddingSpec((_a = spec.padding) !== null && _a !== void 0 ? _a : (_b = this._theme) === null || _b === void 0 ? void 0 : _b.padding);
|
|
58936
|
+
this._paddingSpec = normalizeLayoutPaddingSpec((_a = spec.padding) !== null && _a !== void 0 ? _a : getThemeFromOption('padding', this._option));
|
|
58775
58937
|
this._event = new Event$1(option.eventDispatcher, option.mode);
|
|
58776
58938
|
this._dataSet = option.dataSet;
|
|
58777
|
-
this._chartData = new ChartData(this._dataSet, (
|
|
58778
|
-
this._modelOption = Object.assign(Object.assign({}, option), { mode: this._option.mode, map: this._idMap, getChartLayoutRect: () => this._layoutRect, getChartViewRect: () => this._viewRect, getChart: () => this, globalScale: this._globalScale, onError: (
|
|
58939
|
+
this._chartData = new ChartData(this._dataSet, (_b = this._option) === null || _b === void 0 ? void 0 : _b.onError);
|
|
58940
|
+
this._modelOption = Object.assign(Object.assign({}, option), { mode: this._option.mode, map: this._idMap, getChartLayoutRect: () => this._layoutRect, getChartViewRect: () => this._viewRect, getChart: () => this, globalScale: this._globalScale, onError: (_c = this._option) === null || _c === void 0 ? void 0 : _c.onError });
|
|
58779
58941
|
this._stack = new Stack(this);
|
|
58780
58942
|
this._spec = spec;
|
|
58781
58943
|
}
|
|
@@ -58885,7 +59047,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58885
59047
|
if (!region) {
|
|
58886
59048
|
return;
|
|
58887
59049
|
}
|
|
58888
|
-
const series = Factory.createSeries(spec.type, spec, Object.assign(Object.assign({}, this._modelOption), { region, specIndex: index, specKey: 'series',
|
|
59050
|
+
const series = Factory.createSeries(spec.type, spec, Object.assign(Object.assign({}, this._modelOption), { region, specIndex: index, specKey: 'series', globalScale: this._globalScale, getSeriesData: this._chartData.getSeriesData.bind(this._chartData), sourceDataList: this._chartData.dataList }));
|
|
58889
59051
|
if (series) {
|
|
58890
59052
|
series.created();
|
|
58891
59053
|
this._series.push(series);
|
|
@@ -58900,7 +59062,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58900
59062
|
return this._series.find(x => x.id === id);
|
|
58901
59063
|
}
|
|
58902
59064
|
_createComponent(Component, spec) {
|
|
58903
|
-
const component = Component.createComponent(spec, Object.assign(Object.assign({}, this._modelOption), { getAllRegions: this.getAllRegions, getRegionsInIndex: this.getRegionsInIndex, getRegionsInIds: this.getRegionsInIds, getRegionsInUserIdOrIndex: this.getRegionsInUserIdOrIndex,
|
|
59065
|
+
const component = Component.createComponent(spec, Object.assign(Object.assign({}, this._modelOption), { getAllRegions: this.getAllRegions, getRegionsInIndex: this.getRegionsInIndex, getRegionsInIds: this.getRegionsInIds, getRegionsInUserIdOrIndex: this.getRegionsInUserIdOrIndex, getAllSeries: this.getAllSeries, getSeriesInIndex: this.getSeriesInIndex, getSeriesInIds: this.getSeriesInIds, getSeriesInUserIdOrIndex: this.getSeriesInUserIdOrIndex, getAllComponents: this.getComponents, getComponentByIndex: this.getComponentByIndex, getComponentByUserId: this.getComponentByUserId, getComponentsByKey: this.getComponentsByKey }));
|
|
58904
59066
|
if (!component) {
|
|
58905
59067
|
return;
|
|
58906
59068
|
}
|
|
@@ -58979,10 +59141,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58979
59141
|
if (this._spec.zField || (this._spec.series && this._spec.series.some((s) => s.zField))) {
|
|
58980
59142
|
use3dLayout = true;
|
|
58981
59143
|
}
|
|
58982
|
-
const
|
|
58983
|
-
|
|
58984
|
-
|
|
58985
|
-
|
|
59144
|
+
const constructor = Factory.getLayoutInKey((_b = (_a = this._spec.layout) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : (use3dLayout ? 'layout3d' : 'base'));
|
|
59145
|
+
if (constructor) {
|
|
59146
|
+
const layout = new constructor(this._spec.layout, {
|
|
59147
|
+
onError: (_c = this._option) === null || _c === void 0 ? void 0 : _c.onError
|
|
59148
|
+
});
|
|
59149
|
+
this._layoutFunc = layout.layoutItems.bind(layout);
|
|
59150
|
+
}
|
|
58986
59151
|
}
|
|
58987
59152
|
}
|
|
58988
59153
|
layout(params) {
|
|
@@ -59093,9 +59258,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59093
59258
|
return this._chartData.getSeriesData(id, index);
|
|
59094
59259
|
}
|
|
59095
59260
|
_transformSpecScale() {
|
|
59096
|
-
var _a, _b
|
|
59261
|
+
var _a, _b;
|
|
59097
59262
|
const scales = (_a = this._spec.scales) !== null && _a !== void 0 ? _a : [];
|
|
59098
59263
|
let colorScaleSpec = scales.find(s => s.id === 'color');
|
|
59264
|
+
const colorScheme = this.getColorScheme();
|
|
59099
59265
|
if (!colorScaleSpec) {
|
|
59100
59266
|
colorScaleSpec = {
|
|
59101
59267
|
type: 'ordinal',
|
|
@@ -59107,12 +59273,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59107
59273
|
if (this._spec.color) {
|
|
59108
59274
|
const colorSpec = this._spec.color;
|
|
59109
59275
|
if (isArray$1(colorSpec)) {
|
|
59110
|
-
colorScaleSpec.range = colorSpec.map(color =>
|
|
59276
|
+
colorScaleSpec.range = colorSpec.map(color => getActualColor(color, colorScheme));
|
|
59111
59277
|
}
|
|
59112
59278
|
else {
|
|
59113
59279
|
const tempSpec = colorSpec;
|
|
59114
59280
|
if (tempSpec.range) {
|
|
59115
|
-
tempSpec.range = tempSpec.range.map(color =>
|
|
59281
|
+
tempSpec.range = tempSpec.range.map(color => getActualColor(color, colorScheme));
|
|
59116
59282
|
}
|
|
59117
59283
|
Object.prototype.hasOwnProperty.call(tempSpec, 'type') && (colorScaleSpec.type = tempSpec.type);
|
|
59118
59284
|
Object.prototype.hasOwnProperty.call(tempSpec, 'domain') && (colorScaleSpec.domain = tempSpec.domain);
|
|
@@ -59123,7 +59289,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59123
59289
|
}
|
|
59124
59290
|
}
|
|
59125
59291
|
if (!((_b = colorScaleSpec.range) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
59126
|
-
colorScaleSpec.range = getDataScheme(
|
|
59292
|
+
colorScaleSpec.range = getDataScheme(colorScheme);
|
|
59127
59293
|
colorScaleSpec.rangeTheme = true;
|
|
59128
59294
|
}
|
|
59129
59295
|
return scales;
|
|
@@ -59145,10 +59311,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59145
59311
|
mergeUpdateResult(result, this._globalScale.updateSpec(this._transformSpecScale()));
|
|
59146
59312
|
}
|
|
59147
59313
|
updateGlobalScaleTheme() {
|
|
59148
|
-
var _a;
|
|
59149
59314
|
const colorSpec = this._globalScale.getScaleSpec('color');
|
|
59315
|
+
const colorScheme = this.getColorScheme();
|
|
59150
59316
|
if (colorSpec.rangeTheme) {
|
|
59151
|
-
colorSpec.range = getDataScheme(
|
|
59317
|
+
colorSpec.range = getDataScheme(colorScheme);
|
|
59152
59318
|
this._globalScale.getScale('color').range(colorSpec.range);
|
|
59153
59319
|
}
|
|
59154
59320
|
}
|
|
@@ -59202,8 +59368,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59202
59368
|
return result;
|
|
59203
59369
|
}
|
|
59204
59370
|
updateChartConfig(result, oldSpec) {
|
|
59205
|
-
var _a
|
|
59206
|
-
this._paddingSpec = normalizeLayoutPaddingSpec((_a = this._spec.padding) !== null && _a !== void 0 ? _a : (
|
|
59371
|
+
var _a;
|
|
59372
|
+
this._paddingSpec = normalizeLayoutPaddingSpec((_a = this._spec.padding) !== null && _a !== void 0 ? _a : getThemeFromOption('padding', this._option));
|
|
59207
59373
|
this._updateLayoutRect(this._viewBox);
|
|
59208
59374
|
if (!isEqual$1(this._spec.background, oldSpec.background)) {
|
|
59209
59375
|
result.reMake = true;
|
|
@@ -59280,7 +59446,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59280
59446
|
label: spec.label,
|
|
59281
59447
|
seriesStyle: spec.seriesStyle,
|
|
59282
59448
|
animation: spec.animation,
|
|
59283
|
-
animationThreshold: (_a = spec.animationThreshold) !== null && _a !== void 0 ? _a : this.
|
|
59449
|
+
animationThreshold: (_a = spec.animationThreshold) !== null && _a !== void 0 ? _a : getThemeFromOption('animationThreshold', this._option),
|
|
59284
59450
|
animationAppear: spec.animationAppear,
|
|
59285
59451
|
animationDisappear: spec.animationDisappear,
|
|
59286
59452
|
animationEnter: spec.animationEnter,
|
|
@@ -59320,31 +59486,27 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59320
59486
|
this._layoutRect.y = this.padding.top;
|
|
59321
59487
|
this._event.emit(ChartEvent.layoutRectUpdate, {});
|
|
59322
59488
|
}
|
|
59323
|
-
|
|
59324
|
-
return this._theme;
|
|
59325
|
-
}
|
|
59326
|
-
setCurrentTheme(theme, reInit = true) {
|
|
59327
|
-
this._theme = theme;
|
|
59489
|
+
setCurrentTheme(reInit = true) {
|
|
59328
59490
|
this.setLayoutTag(true);
|
|
59329
59491
|
this.transformSpec(this._spec);
|
|
59330
59492
|
this.updateGlobalScaleTheme();
|
|
59331
59493
|
this.setRegionTheme(reInit);
|
|
59332
|
-
this.setComponentTheme(
|
|
59333
|
-
this.setSeriesTheme(
|
|
59494
|
+
this.setComponentTheme(reInit);
|
|
59495
|
+
this.setSeriesTheme(reInit);
|
|
59334
59496
|
}
|
|
59335
59497
|
setRegionTheme(reInit = true) {
|
|
59336
|
-
this._regions.forEach(r => {
|
|
59337
|
-
|
|
59338
|
-
});
|
|
59498
|
+
this._regions.forEach((r) => __awaiter$h(this, void 0, void 0, function* () {
|
|
59499
|
+
yield r.setCurrentTheme(reInit);
|
|
59500
|
+
}));
|
|
59339
59501
|
}
|
|
59340
|
-
setComponentTheme(
|
|
59341
|
-
this._components.forEach(c => {
|
|
59342
|
-
|
|
59343
|
-
});
|
|
59502
|
+
setComponentTheme(reInit = true) {
|
|
59503
|
+
this._components.forEach((c) => __awaiter$h(this, void 0, void 0, function* () {
|
|
59504
|
+
yield c.setCurrentTheme(reInit);
|
|
59505
|
+
}));
|
|
59344
59506
|
}
|
|
59345
|
-
setSeriesTheme(
|
|
59507
|
+
setSeriesTheme(reInit = true) {
|
|
59346
59508
|
this._series.forEach((s) => __awaiter$h(this, void 0, void 0, function* () {
|
|
59347
|
-
|
|
59509
|
+
yield s.setCurrentTheme(reInit);
|
|
59348
59510
|
}));
|
|
59349
59511
|
}
|
|
59350
59512
|
clear() {
|
|
@@ -59628,6 +59790,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59628
59790
|
}
|
|
59629
59791
|
}
|
|
59630
59792
|
}
|
|
59793
|
+
getColorScheme() {
|
|
59794
|
+
var _a, _b, _c;
|
|
59795
|
+
return ((_c = (_b = (_a = this._option).getThemeConfig) === null || _b === void 0 ? void 0 : _b.call(_a).chartLevelTheme) !== null && _c !== void 0 ? _c : defaultChartLevelTheme).colorScheme;
|
|
59796
|
+
}
|
|
59631
59797
|
}
|
|
59632
59798
|
|
|
59633
59799
|
class CartesianChart extends BaseChart {
|
|
@@ -59748,63 +59914,35 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59748
59914
|
return data;
|
|
59749
59915
|
};
|
|
59750
59916
|
|
|
59751
|
-
|
|
59752
|
-
[exports.RenderModeEnum['desktop-miniApp']
|
|
59753
|
-
|
|
59754
|
-
|
|
59755
|
-
|
|
59756
|
-
|
|
59757
|
-
|
|
59758
|
-
|
|
59759
|
-
|
|
59760
|
-
|
|
59761
|
-
|
|
59762
|
-
|
|
59763
|
-
|
|
59764
|
-
hover: {
|
|
59765
|
-
enable: true,
|
|
59766
|
-
trigger: 'pointermove',
|
|
59767
|
-
triggerOff: ['pointermove', 'pointerleave']
|
|
59768
|
-
},
|
|
59769
|
-
select: {
|
|
59770
|
-
enable: true,
|
|
59771
|
-
trigger: 'pointertap'
|
|
59772
|
-
}
|
|
59773
|
-
},
|
|
59774
|
-
[exports.RenderModeEnum['mobile-browser']]: {
|
|
59775
|
-
hover: {
|
|
59776
|
-
enable: true,
|
|
59777
|
-
trigger: 'pointerover',
|
|
59778
|
-
triggerOff: 'pointerout'
|
|
59779
|
-
},
|
|
59780
|
-
select: {
|
|
59781
|
-
enable: true,
|
|
59782
|
-
trigger: 'tap'
|
|
59783
|
-
}
|
|
59784
|
-
},
|
|
59785
|
-
[exports.RenderModeEnum.miniApp]: {
|
|
59786
|
-
hover: {
|
|
59787
|
-
enable: true,
|
|
59788
|
-
trigger: 'pointerover',
|
|
59789
|
-
triggerOff: 'pointerout'
|
|
59790
|
-
},
|
|
59791
|
-
select: {
|
|
59792
|
-
enable: true,
|
|
59793
|
-
trigger: 'tap'
|
|
59794
|
-
}
|
|
59795
|
-
},
|
|
59796
|
-
[exports.RenderModeEnum.lynx]: {
|
|
59797
|
-
hover: {
|
|
59798
|
-
enable: true,
|
|
59799
|
-
trigger: 'pointerover',
|
|
59800
|
-
triggerOff: 'pointerout'
|
|
59801
|
-
},
|
|
59802
|
-
select: {
|
|
59803
|
-
enable: true,
|
|
59804
|
-
trigger: 'tap'
|
|
59805
|
-
}
|
|
59917
|
+
function getDefaultInteractionConfigByMode(mode) {
|
|
59918
|
+
if (mode === exports.RenderModeEnum['desktop-browser'] || mode === exports.RenderModeEnum['desktop-miniApp']) {
|
|
59919
|
+
return {
|
|
59920
|
+
hover: {
|
|
59921
|
+
enable: true,
|
|
59922
|
+
trigger: 'pointermove',
|
|
59923
|
+
triggerOff: ['pointermove', 'pointerleave']
|
|
59924
|
+
},
|
|
59925
|
+
select: {
|
|
59926
|
+
enable: true,
|
|
59927
|
+
trigger: 'pointertap'
|
|
59928
|
+
}
|
|
59929
|
+
};
|
|
59806
59930
|
}
|
|
59807
|
-
|
|
59931
|
+
if (isMobileLikeMode(mode) || isMiniAppLikeMode(mode)) {
|
|
59932
|
+
return {
|
|
59933
|
+
hover: {
|
|
59934
|
+
enable: true,
|
|
59935
|
+
trigger: 'pointerover',
|
|
59936
|
+
triggerOff: 'pointerout'
|
|
59937
|
+
},
|
|
59938
|
+
select: {
|
|
59939
|
+
enable: true,
|
|
59940
|
+
trigger: 'tap'
|
|
59941
|
+
}
|
|
59942
|
+
};
|
|
59943
|
+
}
|
|
59944
|
+
return null;
|
|
59945
|
+
}
|
|
59808
59946
|
|
|
59809
59947
|
class Trigger {
|
|
59810
59948
|
get hover() {
|
|
@@ -59897,7 +60035,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59897
60035
|
this.event.release();
|
|
59898
60036
|
}
|
|
59899
60037
|
initConfig(mode) {
|
|
59900
|
-
const defaultConfig =
|
|
60038
|
+
const defaultConfig = getDefaultInteractionConfigByMode(mode);
|
|
59901
60039
|
this._hover = Object.assign({}, defaultConfig === null || defaultConfig === void 0 ? void 0 : defaultConfig.hover);
|
|
59902
60040
|
this._select = Object.assign({}, defaultConfig === null || defaultConfig === void 0 ? void 0 : defaultConfig.select);
|
|
59903
60041
|
const hoverSpec = this._spec.hover;
|
|
@@ -60772,7 +60910,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60772
60910
|
this._viewDataMap = new Map();
|
|
60773
60911
|
this._viewDataFilter = null;
|
|
60774
60912
|
this._data = null;
|
|
60775
|
-
this._stack = false;
|
|
60776
60913
|
this._percent = false;
|
|
60777
60914
|
this._stackOffsetSilhouette = false;
|
|
60778
60915
|
this._invalidType = 'break';
|
|
@@ -60835,6 +60972,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60835
60972
|
if (isValid$1(this._spec.stackValue)) {
|
|
60836
60973
|
this._stack = true;
|
|
60837
60974
|
}
|
|
60975
|
+
if (isNil$1(this._stack) && this._supportStack && this._seriesField) {
|
|
60976
|
+
this._stack = true;
|
|
60977
|
+
}
|
|
60838
60978
|
if (isValid$1(this._spec.invalidType)) {
|
|
60839
60979
|
this._invalidType = this._spec.invalidType;
|
|
60840
60980
|
}
|
|
@@ -61400,12 +61540,15 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61400
61540
|
var _a;
|
|
61401
61541
|
return this._getSeriesInfo((_a = this._seriesField) !== null && _a !== void 0 ? _a : DEFAULT_DATA_SERIES_FIELD, this.getSeriesKeys());
|
|
61402
61542
|
}
|
|
61403
|
-
|
|
61543
|
+
_getDefaultColorScale() {
|
|
61404
61544
|
var _a, _b;
|
|
61405
61545
|
const colorDomain = this.getDefaultColorDomain();
|
|
61406
|
-
const colorRange =
|
|
61546
|
+
const colorRange = this._getDataScheme();
|
|
61407
61547
|
return (_b = (_a = new ColorOrdinalScale().domain(colorDomain)).range) === null || _b === void 0 ? void 0 : _b.call(_a, colorRange);
|
|
61408
61548
|
}
|
|
61549
|
+
_getDataScheme() {
|
|
61550
|
+
return getDataScheme(this.getColorScheme(), this.type);
|
|
61551
|
+
}
|
|
61409
61552
|
getDefaultColorDomain() {
|
|
61410
61553
|
var _a, _b;
|
|
61411
61554
|
return this._seriesField ? (_b = (_a = this._viewDataStatistics) === null || _a === void 0 ? void 0 : _a.latestData[this._seriesField]) === null || _b === void 0 ? void 0 : _b.values : [];
|
|
@@ -61413,7 +61556,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61413
61556
|
getColorAttribute() {
|
|
61414
61557
|
var _a, _b;
|
|
61415
61558
|
return {
|
|
61416
|
-
scale: (_a = this._option.globalScale.getScale('color')) !== null && _a !== void 0 ? _a : this.
|
|
61559
|
+
scale: (_a = this._option.globalScale.getScale('color')) !== null && _a !== void 0 ? _a : this._getDefaultColorScale(),
|
|
61417
61560
|
field: (_b = this._seriesField) !== null && _b !== void 0 ? _b : DEFAULT_DATA_SERIES_FIELD
|
|
61418
61561
|
};
|
|
61419
61562
|
}
|
|
@@ -61428,30 +61571,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61428
61571
|
}
|
|
61429
61572
|
onMarkTreePositionUpdate(marks) {
|
|
61430
61573
|
}
|
|
61431
|
-
|
|
61432
|
-
return
|
|
61433
|
-
const modifyConfig = () => {
|
|
61434
|
-
this.reInit(theme);
|
|
61435
|
-
return { change: true, reMake: false };
|
|
61436
|
-
};
|
|
61437
|
-
if (noRender) {
|
|
61438
|
-
modifyConfig();
|
|
61439
|
-
}
|
|
61440
|
-
else {
|
|
61441
|
-
yield this._option.globalInstance.updateCustomConfigAndRerender(modifyConfig);
|
|
61442
|
-
}
|
|
61443
|
-
});
|
|
61444
|
-
}
|
|
61445
|
-
_initTheme(theme) {
|
|
61446
|
-
var _a;
|
|
61447
|
-
const globalTheme = this._option.getTheme();
|
|
61448
|
-
if (theme) {
|
|
61449
|
-
super._initTheme(theme);
|
|
61450
|
-
}
|
|
61451
|
-
else {
|
|
61452
|
-
super._initTheme((_a = globalTheme.series[this.type]) !== null && _a !== void 0 ? _a : {});
|
|
61453
|
-
}
|
|
61454
|
-
this._mergeThemeToSpec();
|
|
61574
|
+
_getTheme() {
|
|
61575
|
+
return preprocessSpecOrTheme('theme', getThemeFromOption(`series.${this.type}`, this._option), this.getColorScheme(), this.type);
|
|
61455
61576
|
}
|
|
61456
61577
|
_createMark(markInfo, option = {}) {
|
|
61457
61578
|
var _a, _b, _c, _d;
|
|
@@ -61594,6 +61715,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61594
61715
|
};
|
|
61595
61716
|
this._direction = Direction.vertical;
|
|
61596
61717
|
this._sortDataByAxis = false;
|
|
61718
|
+
this._getInvalidDefined = (datum) => {
|
|
61719
|
+
if (this._xAxisHelper.isContinuous) {
|
|
61720
|
+
if (!couldBeValidNumber(datum[this._specXField[0]])) {
|
|
61721
|
+
return false;
|
|
61722
|
+
}
|
|
61723
|
+
}
|
|
61724
|
+
if (this._yAxisHelper.isContinuous) {
|
|
61725
|
+
if (!couldBeValidNumber(datum[this._specYField[0]])) {
|
|
61726
|
+
return false;
|
|
61727
|
+
}
|
|
61728
|
+
}
|
|
61729
|
+
return true;
|
|
61730
|
+
};
|
|
61597
61731
|
}
|
|
61598
61732
|
_buildScaleConfig() {
|
|
61599
61733
|
this._scaleConfig = {
|
|
@@ -61779,6 +61913,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61779
61913
|
this.setFieldX(this._spec.xField);
|
|
61780
61914
|
this.setFieldY(this._spec.yField);
|
|
61781
61915
|
this.setFieldZ(this._spec.zField);
|
|
61916
|
+
this._specXField = array(this._spec.xField);
|
|
61917
|
+
this._specYField = array(this._spec.yField);
|
|
61782
61918
|
if (isValid$1(this._spec.direction)) {
|
|
61783
61919
|
this._direction = this._spec.direction;
|
|
61784
61920
|
}
|
|
@@ -62392,7 +62528,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
62392
62528
|
constructor() {
|
|
62393
62529
|
super(...arguments);
|
|
62394
62530
|
this.type = SeriesTypeEnum.area;
|
|
62395
|
-
this.
|
|
62531
|
+
this._supportStack = true;
|
|
62396
62532
|
this._sortDataByAxis = false;
|
|
62397
62533
|
}
|
|
62398
62534
|
setAttrFromSpec() {
|
|
@@ -62715,7 +62851,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
62715
62851
|
this.type = SeriesTypeEnum.bar;
|
|
62716
62852
|
this._barMarkName = SeriesMarkNameEnum.bar;
|
|
62717
62853
|
this._barMarkType = MarkTypeEnum.rect;
|
|
62718
|
-
this.
|
|
62854
|
+
this._supportStack = true;
|
|
62719
62855
|
this._bandPosition = 0;
|
|
62720
62856
|
}
|
|
62721
62857
|
initMark() {
|
|
@@ -63143,7 +63279,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63143
63279
|
super(...arguments);
|
|
63144
63280
|
this.type = SeriesTypeEnum.scatter;
|
|
63145
63281
|
this._invalidType = 'zero';
|
|
63146
|
-
this._getInvalidDefined = (datum) => couldBeValidNumber(datum[this.getStackValueField()]) && couldBeValidNumber(datum[this.getDimensionField()[0]]);
|
|
63147
63282
|
}
|
|
63148
63283
|
setAttrFromSpec() {
|
|
63149
63284
|
super.setAttrFromSpec();
|
|
@@ -63870,6 +64005,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63870
64005
|
}
|
|
63871
64006
|
}
|
|
63872
64007
|
|
|
64008
|
+
function getComponentThemeFromOption(type, option) {
|
|
64009
|
+
return getThemeFromOption(`component.${type}`, option);
|
|
64010
|
+
}
|
|
64011
|
+
|
|
63873
64012
|
const DEFAULT_TITLE_STYLE = {
|
|
63874
64013
|
left: {
|
|
63875
64014
|
textAlign: 'center',
|
|
@@ -63913,19 +64052,29 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63913
64052
|
const orient = spec === null || spec === void 0 ? void 0 : spec.orient;
|
|
63914
64053
|
return orient === 'angle' || orient === 'radius';
|
|
63915
64054
|
}
|
|
63916
|
-
const getCartesianAxisTheme = (orient, type,
|
|
63917
|
-
var _a
|
|
63918
|
-
const
|
|
63919
|
-
|
|
63920
|
-
|
|
63921
|
-
|
|
63922
|
-
|
|
63923
|
-
|
|
63924
|
-
|
|
63925
|
-
|
|
63926
|
-
|
|
63927
|
-
|
|
63928
|
-
|
|
64055
|
+
const getCartesianAxisTheme = (orient, type, option) => {
|
|
64056
|
+
var _a;
|
|
64057
|
+
const axisTypeTheme = (_a = (type === 'band'
|
|
64058
|
+
? getComponentThemeFromOption('axisBand', option)
|
|
64059
|
+
: ['linear', 'log', 'symlog'].includes(type)
|
|
64060
|
+
? getComponentThemeFromOption('axisLinear', option)
|
|
64061
|
+
: {})) !== null && _a !== void 0 ? _a : {};
|
|
64062
|
+
const axisTheme = isXAxis(orient)
|
|
64063
|
+
? getComponentThemeFromOption('axisX', option)
|
|
64064
|
+
: getComponentThemeFromOption('axisY', option);
|
|
64065
|
+
return mergeSpec({}, getComponentThemeFromOption('axis', option), axisTypeTheme, axisTheme);
|
|
64066
|
+
};
|
|
64067
|
+
const getPolarAxisTheme = (orient, type, option) => {
|
|
64068
|
+
var _a;
|
|
64069
|
+
const axisTypeTheme = (_a = (type === 'band'
|
|
64070
|
+
? getComponentThemeFromOption('axisBand', option)
|
|
64071
|
+
: type === 'linear'
|
|
64072
|
+
? getComponentThemeFromOption('axisLinear', option)
|
|
64073
|
+
: {})) !== null && _a !== void 0 ? _a : {};
|
|
64074
|
+
const axisTheme = orient === 'angle'
|
|
64075
|
+
? getComponentThemeFromOption('axisAngle', option)
|
|
64076
|
+
: getComponentThemeFromOption('axisRadius', option);
|
|
64077
|
+
return mergeSpec({}, getComponentThemeFromOption('axis', option), axisTypeTheme, axisTheme);
|
|
63929
64078
|
};
|
|
63930
64079
|
|
|
63931
64080
|
function limitTagInBounds(shape, bounds) {
|
|
@@ -63971,10 +64120,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63971
64120
|
}
|
|
63972
64121
|
return null;
|
|
63973
64122
|
}
|
|
63974
|
-
const getCartesianCrosshairTheme = (
|
|
64123
|
+
const getCartesianCrosshairTheme = (option, chart) => {
|
|
63975
64124
|
var _a;
|
|
63976
64125
|
const axes = chart.getAllComponents().filter(component => component.type.includes('Axis'));
|
|
63977
|
-
const { bandField, linearField, xField, yField } = (_a =
|
|
64126
|
+
const { bandField, linearField, xField, yField } = (_a = getComponentThemeFromOption(ComponentTypeEnum.crosshair, option)) !== null && _a !== void 0 ? _a : {};
|
|
63978
64127
|
const xAxis = axes.find(axis => isXAxis(axis.getOrient()));
|
|
63979
64128
|
let newXField;
|
|
63980
64129
|
if (isValid$1(xAxis)) {
|
|
@@ -63996,10 +64145,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
63996
64145
|
yField: newYField
|
|
63997
64146
|
};
|
|
63998
64147
|
};
|
|
63999
|
-
const getPolarCrosshairTheme = (
|
|
64148
|
+
const getPolarCrosshairTheme = (option, chart) => {
|
|
64000
64149
|
var _a;
|
|
64001
64150
|
const axes = chart.getAllComponents().filter(component => component.type.includes('Axis'));
|
|
64002
|
-
const { bandField, linearField, categoryField, valueField } = (_a =
|
|
64151
|
+
const { bandField, linearField, categoryField, valueField } = (_a = getComponentThemeFromOption(ComponentTypeEnum.crosshair, option)) !== null && _a !== void 0 ? _a : {};
|
|
64003
64152
|
const angleAxis = axes.find(axis => axis.getOrient() === 'angle');
|
|
64004
64153
|
let newAngleField;
|
|
64005
64154
|
if (isValid$1(angleAxis)) {
|
|
@@ -64043,36 +64192,36 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64043
64192
|
return spec.orient === 'bottom' || spec.orient === 'top' ? 'horizontal' : 'vertical';
|
|
64044
64193
|
}
|
|
64045
64194
|
|
|
64046
|
-
function getComponentThemeFromGlobalTheme(type,
|
|
64047
|
-
var _a
|
|
64195
|
+
function getComponentThemeFromGlobalTheme(type, option, componentSpec) {
|
|
64196
|
+
var _a;
|
|
64197
|
+
const chart = (_a = option.getChart) === null || _a === void 0 ? void 0 : _a.call(option);
|
|
64048
64198
|
switch (type) {
|
|
64049
64199
|
case ComponentTypeEnum.cartesianBandAxis:
|
|
64050
|
-
return getCartesianAxisTheme(getOrient(componentSpec), 'band',
|
|
64200
|
+
return getCartesianAxisTheme(getOrient(componentSpec), 'band', option);
|
|
64051
64201
|
case ComponentTypeEnum.cartesianLinearAxis:
|
|
64052
|
-
return getCartesianAxisTheme(getOrient(componentSpec), 'linear',
|
|
64202
|
+
return getCartesianAxisTheme(getOrient(componentSpec), 'linear', option);
|
|
64053
64203
|
case ComponentTypeEnum.cartesianLogAxis:
|
|
64054
|
-
return getCartesianAxisTheme(getOrient(componentSpec), 'log',
|
|
64204
|
+
return getCartesianAxisTheme(getOrient(componentSpec), 'log', option);
|
|
64055
64205
|
case ComponentTypeEnum.cartesianSymlogAxis:
|
|
64056
|
-
return getCartesianAxisTheme(getOrient(componentSpec), 'symlog',
|
|
64206
|
+
return getCartesianAxisTheme(getOrient(componentSpec), 'symlog', option);
|
|
64057
64207
|
case ComponentTypeEnum.cartesianAxis:
|
|
64058
64208
|
case ComponentTypeEnum.cartesianTimeAxis:
|
|
64059
|
-
return getCartesianAxisTheme(getOrient(componentSpec), undefined,
|
|
64209
|
+
return getCartesianAxisTheme(getOrient(componentSpec), undefined, option);
|
|
64060
64210
|
case ComponentTypeEnum.polarBandAxis:
|
|
64061
|
-
return getPolarAxisTheme(componentSpec.orient, 'band',
|
|
64211
|
+
return getPolarAxisTheme(componentSpec.orient, 'band', option);
|
|
64062
64212
|
case ComponentTypeEnum.polarLinearAxis:
|
|
64063
|
-
return getPolarAxisTheme(componentSpec.orient, 'linear',
|
|
64213
|
+
return getPolarAxisTheme(componentSpec.orient, 'linear', option);
|
|
64064
64214
|
case ComponentTypeEnum.polarAxis:
|
|
64065
|
-
return getPolarAxisTheme(componentSpec.orient, undefined,
|
|
64215
|
+
return getPolarAxisTheme(componentSpec.orient, undefined, option);
|
|
64066
64216
|
case ComponentTypeEnum.cartesianCrosshair:
|
|
64067
|
-
return getCartesianCrosshairTheme(
|
|
64217
|
+
return getCartesianCrosshairTheme(option, chart);
|
|
64068
64218
|
case ComponentTypeEnum.polarCrosshair:
|
|
64069
|
-
return getPolarCrosshairTheme(
|
|
64219
|
+
return getPolarCrosshairTheme(option, chart);
|
|
64070
64220
|
case ComponentTypeEnum.colorLegend:
|
|
64071
|
-
return (_a = theme.component) === null || _a === void 0 ? void 0 : _a.colorLegend[getLayout(componentSpec)];
|
|
64072
64221
|
case ComponentTypeEnum.sizeLegend:
|
|
64073
|
-
return (
|
|
64222
|
+
return getThemeFromOption(`component.${type}.${getLayout(componentSpec)}`, option);
|
|
64074
64223
|
default:
|
|
64075
|
-
return (
|
|
64224
|
+
return getComponentThemeFromOption(type, option);
|
|
64076
64225
|
}
|
|
64077
64226
|
}
|
|
64078
64227
|
|
|
@@ -64120,29 +64269,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64120
64269
|
y: markEventParams.event.viewY - this.getLayoutStartPoint().y
|
|
64121
64270
|
};
|
|
64122
64271
|
}
|
|
64123
|
-
|
|
64124
|
-
return
|
|
64125
|
-
const modifyConfig = () => {
|
|
64126
|
-
this.reInit(theme);
|
|
64127
|
-
return { change: true, reMake: false };
|
|
64128
|
-
};
|
|
64129
|
-
if (noRender) {
|
|
64130
|
-
modifyConfig();
|
|
64131
|
-
}
|
|
64132
|
-
else {
|
|
64133
|
-
yield this._option.globalInstance.updateCustomConfigAndRerender(modifyConfig);
|
|
64134
|
-
}
|
|
64135
|
-
});
|
|
64136
|
-
}
|
|
64137
|
-
_initTheme(theme) {
|
|
64138
|
-
const globalTheme = this._option.getTheme();
|
|
64139
|
-
if (theme) {
|
|
64140
|
-
super._initTheme(theme);
|
|
64141
|
-
}
|
|
64142
|
-
else {
|
|
64143
|
-
super._initTheme(getComponentThemeFromGlobalTheme(this.type, globalTheme, this._originalSpec, this._option.getChart()));
|
|
64144
|
-
}
|
|
64145
|
-
this._mergeThemeToSpec();
|
|
64272
|
+
_getTheme() {
|
|
64273
|
+
return preprocessSpecOrTheme('theme', getComponentThemeFromGlobalTheme(this.type, this._option, this._originalSpec), this.getColorScheme());
|
|
64146
64274
|
}
|
|
64147
64275
|
_mergeThemeToSpec() {
|
|
64148
64276
|
super._mergeThemeToSpec();
|
|
@@ -64283,56 +64411,32 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64283
64411
|
}
|
|
64284
64412
|
}
|
|
64285
64413
|
|
|
64286
|
-
|
|
64287
|
-
|
|
64288
|
-
|
|
64289
|
-
|
|
64290
|
-
|
|
64291
|
-
|
|
64292
|
-
|
|
64293
|
-
|
|
64294
|
-
|
|
64295
|
-
|
|
64296
|
-
|
|
64297
|
-
start: 'pointerdown',
|
|
64298
|
-
move: 'pointermove',
|
|
64299
|
-
end: 'pointerup',
|
|
64300
|
-
zoom: 'wheel',
|
|
64301
|
-
zoomEnd: 'pointerup',
|
|
64302
|
-
scroll: 'wheel',
|
|
64303
|
-
trigger: DeskTopTrigger
|
|
64304
|
-
},
|
|
64305
|
-
[exports.RenderModeEnum['mobile-browser']]: {
|
|
64306
|
-
start: 'pointerdown',
|
|
64307
|
-
move: 'pointermove',
|
|
64308
|
-
end: 'pointerup',
|
|
64309
|
-
zoom: 'pinch',
|
|
64310
|
-
zoomEnd: 'pinchend',
|
|
64311
|
-
scroll: 'pan',
|
|
64312
|
-
scrollEnd: 'panend',
|
|
64313
|
-
trigger: MobileTrigger
|
|
64314
|
-
},
|
|
64315
|
-
[exports.RenderModeEnum.miniApp]: {
|
|
64316
|
-
start: 'pointerdown',
|
|
64317
|
-
move: 'pointermove',
|
|
64318
|
-
end: 'pointerup',
|
|
64319
|
-
zoom: 'pinch',
|
|
64320
|
-
zoomEnd: 'pinchend',
|
|
64321
|
-
scroll: 'pan',
|
|
64322
|
-
scrollEnd: 'panend',
|
|
64323
|
-
trigger: MobileTrigger
|
|
64324
|
-
},
|
|
64325
|
-
[exports.RenderModeEnum.lynx]: {
|
|
64326
|
-
start: 'pointerdown',
|
|
64327
|
-
move: 'pointermove',
|
|
64328
|
-
end: 'pointerup',
|
|
64329
|
-
zoom: 'pinch',
|
|
64330
|
-
zoomEnd: 'pinchend',
|
|
64331
|
-
scroll: 'pan',
|
|
64332
|
-
scrollEnd: 'panend',
|
|
64333
|
-
trigger: MobileTrigger
|
|
64414
|
+
function getDefaultTriggerEventByMode(mode) {
|
|
64415
|
+
if (mode === exports.RenderModeEnum['desktop-browser'] || mode === exports.RenderModeEnum['desktop-miniApp']) {
|
|
64416
|
+
return {
|
|
64417
|
+
start: 'pointerdown',
|
|
64418
|
+
move: 'pointermove',
|
|
64419
|
+
end: 'pointerup',
|
|
64420
|
+
zoom: 'wheel',
|
|
64421
|
+
zoomEnd: 'pointerup',
|
|
64422
|
+
scroll: 'wheel',
|
|
64423
|
+
trigger: DeskTopTrigger
|
|
64424
|
+
};
|
|
64334
64425
|
}
|
|
64335
|
-
|
|
64426
|
+
if (isMobileLikeMode(mode) || isMiniAppLikeMode(mode)) {
|
|
64427
|
+
return {
|
|
64428
|
+
start: 'pointerdown',
|
|
64429
|
+
move: 'pointermove',
|
|
64430
|
+
end: 'pointerup',
|
|
64431
|
+
zoom: 'pinch',
|
|
64432
|
+
zoomEnd: 'pinchend',
|
|
64433
|
+
scroll: 'pan',
|
|
64434
|
+
scrollEnd: 'panend',
|
|
64435
|
+
trigger: MobileTrigger
|
|
64436
|
+
};
|
|
64437
|
+
}
|
|
64438
|
+
return null;
|
|
64439
|
+
}
|
|
64336
64440
|
|
|
64337
64441
|
const delayMap = {
|
|
64338
64442
|
debounce: debounce,
|
|
@@ -64342,13 +64446,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64342
64446
|
initZoomable(evt, mode = exports.RenderModeEnum['desktop-browser']) {
|
|
64343
64447
|
this._eventObj = evt;
|
|
64344
64448
|
this._renderMode = mode;
|
|
64345
|
-
if (
|
|
64449
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64346
64450
|
this._clickEnable = true;
|
|
64347
64451
|
this._zoomableTrigger = new (this._getTriggerEvent('trigger'))();
|
|
64348
64452
|
}
|
|
64349
64453
|
}
|
|
64350
64454
|
_getTriggerEvent(type) {
|
|
64351
|
-
return
|
|
64455
|
+
return getDefaultTriggerEventByMode(this._renderMode)[type];
|
|
64352
64456
|
}
|
|
64353
64457
|
_zoomEventDispatch(params, regionOrSeries, callback) {
|
|
64354
64458
|
if (!params.event) {
|
|
@@ -64388,12 +64492,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64388
64492
|
}, delayTime));
|
|
64389
64493
|
}
|
|
64390
64494
|
initZoomEventOfSeries(s, callback, option) {
|
|
64391
|
-
if (
|
|
64495
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64392
64496
|
this._bindZoomEventAsRegion(s.event, s, callback, option);
|
|
64393
64497
|
}
|
|
64394
64498
|
}
|
|
64395
64499
|
initZoomEventOfRegions(regions, filter, callback, option) {
|
|
64396
|
-
if (
|
|
64500
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64397
64501
|
regions.forEach(r => {
|
|
64398
64502
|
if (filter) {
|
|
64399
64503
|
r.getSeries().forEach(s => {
|
|
@@ -64446,12 +64550,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64446
64550
|
}, delayTime));
|
|
64447
64551
|
}
|
|
64448
64552
|
initScrollEventOfSeries(s, callback, option) {
|
|
64449
|
-
if (
|
|
64553
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64450
64554
|
this._bindScrollEventAsRegion(s.event, s, callback, option);
|
|
64451
64555
|
}
|
|
64452
64556
|
}
|
|
64453
64557
|
initScrollEventOfRegions(regions, filter, callback, option) {
|
|
64454
|
-
if (
|
|
64558
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64455
64559
|
regions.forEach(r => {
|
|
64456
64560
|
if (filter) {
|
|
64457
64561
|
r.getSeries().forEach(s => {
|
|
@@ -64485,14 +64589,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64485
64589
|
});
|
|
64486
64590
|
}
|
|
64487
64591
|
initDragEventOfSeries(s, callback, option) {
|
|
64488
|
-
if (
|
|
64592
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64489
64593
|
s.event.on(this._getTriggerEvent('start'), { level: Event_Bubble_Level.model, filter: ({ model }) => (model === null || model === void 0 ? void 0 : model.id) === s.id }, params => {
|
|
64490
64594
|
this._handleDrag(params, callback, option);
|
|
64491
64595
|
});
|
|
64492
64596
|
}
|
|
64493
64597
|
}
|
|
64494
64598
|
initDragEventOfRegions(regions, filter, callback, option) {
|
|
64495
|
-
if (
|
|
64599
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64496
64600
|
regions.forEach(r => {
|
|
64497
64601
|
if (filter) {
|
|
64498
64602
|
r.getSeries().forEach(s => {
|
|
@@ -64977,7 +65081,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64977
65081
|
fill: (datum) => {
|
|
64978
65082
|
var _a, _b, _c, _d;
|
|
64979
65083
|
if (isValid$1(datum[(_a = this._seriesField) !== null && _a !== void 0 ? _a : DEFAULT_DATA_SERIES_FIELD])) {
|
|
64980
|
-
return ((_b = this._option.globalScale.getScale('color')) !== null && _b !== void 0 ? _b : this.
|
|
65084
|
+
return ((_b = this._option.globalScale.getScale('color')) !== null && _b !== void 0 ? _b : this._getDefaultColorScale()).scale(datum[(_c = this._seriesField) !== null && _c !== void 0 ? _c : DEFAULT_DATA_SERIES_FIELD]);
|
|
64981
65085
|
}
|
|
64982
65086
|
return (_d = this._spec) === null || _d === void 0 ? void 0 : _d.defaultFillColor;
|
|
64983
65087
|
},
|
|
@@ -65200,6 +65304,19 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
65200
65304
|
this._angleField = [];
|
|
65201
65305
|
this._radiusField = [];
|
|
65202
65306
|
this._sortDataByAxis = false;
|
|
65307
|
+
this._getInvalidDefined = (datum) => {
|
|
65308
|
+
if (this.angleAxisHelper.isContinuous) {
|
|
65309
|
+
if (!couldBeValidNumber(datum[this._angleField[0]])) {
|
|
65310
|
+
return false;
|
|
65311
|
+
}
|
|
65312
|
+
}
|
|
65313
|
+
if (this.radiusAxisHelper.isContinuous) {
|
|
65314
|
+
if (!couldBeValidNumber(datum[this._radiusField[0]])) {
|
|
65315
|
+
return false;
|
|
65316
|
+
}
|
|
65317
|
+
}
|
|
65318
|
+
return true;
|
|
65319
|
+
};
|
|
65203
65320
|
}
|
|
65204
65321
|
get outerRadius() {
|
|
65205
65322
|
return this._outerRadius;
|
|
@@ -66233,7 +66350,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
66233
66350
|
constructor() {
|
|
66234
66351
|
super(...arguments);
|
|
66235
66352
|
this.type = SeriesTypeEnum.rose;
|
|
66236
|
-
this.
|
|
66353
|
+
this._supportStack = true;
|
|
66237
66354
|
this._roseMark = null;
|
|
66238
66355
|
this._labelMark = null;
|
|
66239
66356
|
}
|
|
@@ -67121,7 +67238,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67121
67238
|
getColorAttribute() {
|
|
67122
67239
|
var _a, _b, _c;
|
|
67123
67240
|
return {
|
|
67124
|
-
scale: (_a = this._option.globalScale.getScale('color')) !== null && _a !== void 0 ? _a : this.
|
|
67241
|
+
scale: (_a = this._option.globalScale.getScale('color')) !== null && _a !== void 0 ? _a : this._getDefaultColorScale(),
|
|
67125
67242
|
field: (_c = (_b = this._dotTypeField) !== null && _b !== void 0 ? _b : this._seriesField) !== null && _c !== void 0 ? _c : DEFAULT_DATA_SERIES_FIELD
|
|
67126
67243
|
};
|
|
67127
67244
|
}
|
|
@@ -67538,7 +67655,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67538
67655
|
getColorAttribute() {
|
|
67539
67656
|
var _a, _b, _c;
|
|
67540
67657
|
return {
|
|
67541
|
-
scale: (_a = this._option.globalScale.getScale('color')) !== null && _a !== void 0 ? _a : this.
|
|
67658
|
+
scale: (_a = this._option.globalScale.getScale('color')) !== null && _a !== void 0 ? _a : this._getDefaultColorScale(),
|
|
67542
67659
|
field: (_c = (_b = this._seriesGroupField) !== null && _b !== void 0 ? _b : this._seriesField) !== null && _c !== void 0 ? _c : DEFAULT_DATA_SERIES_FIELD
|
|
67543
67660
|
};
|
|
67544
67661
|
}
|
|
@@ -67551,7 +67668,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67551
67668
|
: this._seriesField
|
|
67552
67669
|
? (_c = this._viewDataStatistics) === null || _c === void 0 ? void 0 : _c.latestData[this._seriesField].values
|
|
67553
67670
|
: [];
|
|
67554
|
-
const colorRange =
|
|
67671
|
+
const colorRange = this._getDataScheme();
|
|
67555
67672
|
return new ColorOrdinalScale().domain(colorDomain).range(colorRange);
|
|
67556
67673
|
}
|
|
67557
67674
|
getDotColorAttribute() {
|
|
@@ -67820,7 +67937,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67820
67937
|
if (!region) {
|
|
67821
67938
|
return;
|
|
67822
67939
|
}
|
|
67823
|
-
const series = Factory.createSeries(spec.type, spec, Object.assign(Object.assign({}, this._modelOption), { region, specIndex: index, specKey: 'series',
|
|
67940
|
+
const series = Factory.createSeries(spec.type, spec, Object.assign(Object.assign({}, this._modelOption), { region, specIndex: index, specKey: 'series', globalScale: this._globalScale }));
|
|
67824
67941
|
if (series) {
|
|
67825
67942
|
series.created();
|
|
67826
67943
|
this._series.push(series);
|
|
@@ -67962,7 +68079,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
67962
68079
|
class ProgressLikeSeries extends PolarSeries {
|
|
67963
68080
|
constructor() {
|
|
67964
68081
|
super(...arguments);
|
|
67965
|
-
this.
|
|
68082
|
+
this._supportStack = true;
|
|
67966
68083
|
this._arcGroupMark = null;
|
|
67967
68084
|
this._getAngleValueStart = (datum) => {
|
|
67968
68085
|
const axis = this._getAngleAxis();
|
|
@@ -68108,7 +68225,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68108
68225
|
x: 0,
|
|
68109
68226
|
y: 0,
|
|
68110
68227
|
path: () => {
|
|
68111
|
-
var _a;
|
|
68112
68228
|
const axis = this._getAngleAxis();
|
|
68113
68229
|
if (this._isTickMaskVisible(axis)) {
|
|
68114
68230
|
const { tickMask } = this._spec;
|
|
@@ -68116,7 +68232,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68116
68232
|
const subTickData = this._getAngleAxisSubTickData(axis);
|
|
68117
68233
|
const { x, y } = this.angleAxisHelper.center();
|
|
68118
68234
|
const radius = this._computeLayoutRadius();
|
|
68119
|
-
const markStyle = preprocessSpecOrTheme('mark-spec', style,
|
|
68235
|
+
const markStyle = preprocessSpecOrTheme('mark-spec', style, this.getColorScheme(), this.type);
|
|
68120
68236
|
return subTickData.map(({ value }) => {
|
|
68121
68237
|
const pos = this.angleAxisHelper.dataToPosition([value]) + degreeToRadian(offsetAngle);
|
|
68122
68238
|
const angleUnit = degreeToRadian(angle) / 2;
|
|
@@ -68306,14 +68422,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68306
68422
|
x: () => this.angleAxisHelper.center().x,
|
|
68307
68423
|
y: () => this.angleAxisHelper.center().y,
|
|
68308
68424
|
startAngle: () => {
|
|
68425
|
+
const fieldName = this._stack ? STACK_FIELD_START : this._angleField[0];
|
|
68309
68426
|
const scale = this.angleAxisHelper.getScale(0);
|
|
68310
68427
|
const domain = scale.domain();
|
|
68311
|
-
return this._getAngleValueStart({ [
|
|
68428
|
+
return this._getAngleValueStart({ [fieldName]: domain[0] });
|
|
68312
68429
|
},
|
|
68313
68430
|
endAngle: () => {
|
|
68431
|
+
const fieldName = this._stack ? STACK_FIELD_END : this._angleField[0];
|
|
68314
68432
|
const scale = this.angleAxisHelper.getScale(0);
|
|
68315
68433
|
const domain = scale.domain();
|
|
68316
|
-
return this._getAngleValueEnd({ [
|
|
68434
|
+
return this._getAngleValueEnd({ [fieldName]: domain[domain.length - 1] });
|
|
68317
68435
|
},
|
|
68318
68436
|
innerRadius: this._getRadiusValueStart,
|
|
68319
68437
|
outerRadius: this._getRadiusValueEnd,
|
|
@@ -68380,6 +68498,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68380
68498
|
this._pinMark = null;
|
|
68381
68499
|
this._pointerMark = null;
|
|
68382
68500
|
this._pinBackgroundMark = null;
|
|
68501
|
+
this._stack = false;
|
|
68383
68502
|
}
|
|
68384
68503
|
setAttrFromSpec() {
|
|
68385
68504
|
var _a;
|
|
@@ -68680,7 +68799,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68680
68799
|
return series;
|
|
68681
68800
|
}
|
|
68682
68801
|
transformSpec(spec) {
|
|
68683
|
-
var _a, _b, _c, _d;
|
|
68802
|
+
var _a, _b, _c, _d, _e;
|
|
68684
68803
|
super.transformSpec(spec);
|
|
68685
68804
|
let backgroundSeries = (_a = spec.series) === null || _a === void 0 ? void 0 : _a.find((series) => series.type === SeriesTypeEnum.gauge || series.type === SeriesTypeEnum.circularProgress);
|
|
68686
68805
|
if (isNil$1(backgroundSeries)) {
|
|
@@ -68689,6 +68808,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68689
68808
|
if (isNil$1(backgroundSeries.radiusField) && isNil$1(backgroundSeries.categoryField)) {
|
|
68690
68809
|
backgroundSeries.radiusField = (_d = (_c = spec.radiusField) !== null && _c !== void 0 ? _c : spec.categoryField) !== null && _d !== void 0 ? _d : spec.seriesField;
|
|
68691
68810
|
}
|
|
68811
|
+
if (isNil$1(backgroundSeries.valueField) && isNil$1(backgroundSeries.angleField)) {
|
|
68812
|
+
backgroundSeries.valueField = (_e = spec.valueField) !== null && _e !== void 0 ? _e : spec.angleField;
|
|
68813
|
+
}
|
|
68692
68814
|
}
|
|
68693
68815
|
if (spec.series.length === 1) {
|
|
68694
68816
|
spec.series.push(backgroundSeries);
|
|
@@ -68886,7 +69008,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68886
69008
|
}
|
|
68887
69009
|
}
|
|
68888
69010
|
initMarkStyle() {
|
|
68889
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
69011
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
68890
69012
|
const wordMark = this._wordMark;
|
|
68891
69013
|
const fillingWordMark = this._fillingWordMark;
|
|
68892
69014
|
const textField = ((_a = this._spec.word) === null || _a === void 0 ? void 0 : _a.formatMethod) ? WORD_CLOUD_TEXT : this._nameField;
|
|
@@ -68906,7 +69028,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68906
69028
|
visible: (datum) => !datum.isFillingWord
|
|
68907
69029
|
}, 'normal', AttributeLevel.Series);
|
|
68908
69030
|
this.setMarkStyle(wordMark, {
|
|
68909
|
-
fontFamily: (_d = (_c = (_b = this._spec.word) === null || _b === void 0 ? void 0 : _b.style) === null || _c === void 0 ? void 0 : _c.fontFamily) !== null && _d !== void 0 ? _d : (
|
|
69031
|
+
fontFamily: (_d = (_c = (_b = this._spec.word) === null || _b === void 0 ? void 0 : _b.style) === null || _c === void 0 ? void 0 : _c.fontFamily) !== null && _d !== void 0 ? _d : (_e = this._getChartLevelTheme()) === null || _e === void 0 ? void 0 : _e.fontFamily
|
|
68910
69032
|
}, 'normal', AttributeLevel.User_Mark);
|
|
68911
69033
|
}
|
|
68912
69034
|
if (fillingWordMark) {
|
|
@@ -68925,7 +69047,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68925
69047
|
visible: (datum) => datum.isFillingWord
|
|
68926
69048
|
}, 'normal', AttributeLevel.Series);
|
|
68927
69049
|
this.setMarkStyle(fillingWordMark, {
|
|
68928
|
-
fontFamily: (
|
|
69050
|
+
fontFamily: (_h = (_g = (_f = this._spec.word) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.fontFamily) !== null && _h !== void 0 ? _h : (_j = this._getChartLevelTheme()) === null || _j === void 0 ? void 0 : _j.fontFamily
|
|
68929
69051
|
}, 'normal', AttributeLevel.User_Mark);
|
|
68930
69052
|
}
|
|
68931
69053
|
this._trigger.registerMark(wordMark);
|
|
@@ -68952,7 +69074,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68952
69074
|
var _a, _b, _c, _d, _e;
|
|
68953
69075
|
const colorList = isFillingWord ? this._wordCloudShapeConfig.fillingColorList : this._colorList;
|
|
68954
69076
|
const colorDomain = field ? (_a = this.getViewData()) === null || _a === void 0 ? void 0 : _a.latestData.map((datum) => datum[field]) : [];
|
|
68955
|
-
const colorRange = (_c = colorList !== null && colorList !== void 0 ? colorList : (_b = this._option.globalScale.getScale('color')) === null || _b === void 0 ? void 0 : _b.range()) !== null && _c !== void 0 ? _c :
|
|
69077
|
+
const colorRange = (_c = colorList !== null && colorList !== void 0 ? colorList : (_b = this._option.globalScale.getScale('color')) === null || _b === void 0 ? void 0 : _b.range()) !== null && _c !== void 0 ? _c : this._getDataScheme();
|
|
68956
69078
|
return (_e = (_d = new ColorOrdinalScale().domain(colorDomain)).range) === null || _e === void 0 ? void 0 : _e.call(_d, colorRange);
|
|
68957
69079
|
}
|
|
68958
69080
|
getWordColorAttribute(field, isFillingWord) {
|
|
@@ -68970,7 +69092,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
68970
69092
|
return (datum) => colorList[0];
|
|
68971
69093
|
}
|
|
68972
69094
|
compile() {
|
|
68973
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29
|
|
69095
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29;
|
|
68974
69096
|
super.compile();
|
|
68975
69097
|
const { width, height } = this._region.getLayoutRect();
|
|
68976
69098
|
if (!isValidNumber$1(width) || !isValidNumber$1(height) || !(height > 0 && width > 0)) {
|
|
@@ -69031,9 +69153,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
69031
69153
|
fontSizeRange: this._fontSizeRange,
|
|
69032
69154
|
padding: this._fontPadding,
|
|
69033
69155
|
rotate: { field: WORD_CLOUD_ANGLE },
|
|
69034
|
-
fontFamily: (_g = (_d = this._fontFamilyField) !== null && _d !== void 0 ? _d : (_f = (_e = this._spec.word) === null || _e === void 0 ? void 0 : _e.style) === null || _f === void 0 ? void 0 : _f.fontFamily) !== null && _g !== void 0 ? _g : (
|
|
69156
|
+
fontFamily: (_g = (_d = this._fontFamilyField) !== null && _d !== void 0 ? _d : (_f = (_e = this._spec.word) === null || _e === void 0 ? void 0 : _e.style) === null || _f === void 0 ? void 0 : _f.fontFamily) !== null && _g !== void 0 ? _g : (_h = this._getChartLevelTheme()) === null || _h === void 0 ? void 0 : _h.fontFamily,
|
|
69035
69157
|
fontWeight: fontWeightField ? { field: fontWeightField } : valueField ? { field: WORD_CLOUD_WEIGHT } : null,
|
|
69036
|
-
fontStyle: (
|
|
69158
|
+
fontStyle: (_j = this._fontStyleField) !== null && _j !== void 0 ? _j : (_l = (_k = this._spec.word) === null || _k === void 0 ? void 0 : _k.style) === null || _l === void 0 ? void 0 : _l.fontStyle,
|
|
69037
69159
|
randomVisible: this._random,
|
|
69038
69160
|
clip: this._wordCloudConfig.drawOutOfBound === 'clip',
|
|
69039
69161
|
shrink: this._wordCloudConfig.zoomToFit.shrink,
|
|
@@ -69050,39 +69172,39 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
69050
69172
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
69051
69173
|
size: [width, height],
|
|
69052
69174
|
shape: this._maskShape,
|
|
69053
|
-
text: { field: ((
|
|
69175
|
+
text: { field: ((_m = this._spec.word) === null || _m === void 0 ? void 0 : _m.formatMethod) ? WORD_CLOUD_TEXT : this._nameField },
|
|
69054
69176
|
fontSize: valueField ? { field: valueField } : this._fontSizeRange[0],
|
|
69055
69177
|
fontSizeRange: this._fontSizeRange,
|
|
69056
69178
|
padding: this._fontPadding,
|
|
69057
69179
|
rotateList: rotateAngles,
|
|
69058
|
-
fontFamily: (
|
|
69180
|
+
fontFamily: (_r = (_o = this._fontFamilyField) !== null && _o !== void 0 ? _o : (_q = (_p = this._spec.word) === null || _p === void 0 ? void 0 : _p.style) === null || _q === void 0 ? void 0 : _q.fontFamily) !== null && _r !== void 0 ? _r : (_s = this._getChartLevelTheme()) === null || _s === void 0 ? void 0 : _s.fontFamily,
|
|
69059
69181
|
fontWeight: fontWeightField ? { field: fontWeightField } : valueField ? { field: WORD_CLOUD_WEIGHT } : null,
|
|
69060
|
-
fontStyle: (
|
|
69061
|
-
fillingFontFamily: (
|
|
69182
|
+
fontStyle: (_t = this._fontStyleField) !== null && _t !== void 0 ? _t : (_v = (_u = this._spec.word) === null || _u === void 0 ? void 0 : _u.style) === null || _v === void 0 ? void 0 : _v.fontStyle,
|
|
69183
|
+
fillingFontFamily: (_0 = (_x = (_w = this._wordCloudShapeConfig) === null || _w === void 0 ? void 0 : _w.fillingFontFamilyField) !== null && _x !== void 0 ? _x : (_z = (_y = this._spec.word) === null || _y === void 0 ? void 0 : _y.style) === null || _z === void 0 ? void 0 : _z.fontFamily) !== null && _0 !== void 0 ? _0 : (_1 = this._getChartLevelTheme()) === null || _1 === void 0 ? void 0 : _1.fontFamily,
|
|
69062
69184
|
fillingPadding: this._fillingFontPadding,
|
|
69063
|
-
fillingFontStyle: (
|
|
69064
|
-
fillingFontWeight: (
|
|
69185
|
+
fillingFontStyle: (_3 = (_2 = this._wordCloudShapeConfig) === null || _2 === void 0 ? void 0 : _2.fillingFontStyleField) !== null && _3 !== void 0 ? _3 : (_5 = (_4 = this._spec.word) === null || _4 === void 0 ? void 0 : _4.style) === null || _5 === void 0 ? void 0 : _5.fontStyle,
|
|
69186
|
+
fillingFontWeight: (_7 = (_6 = this._wordCloudShapeConfig) === null || _6 === void 0 ? void 0 : _6.fillingFontWeightField) !== null && _7 !== void 0 ? _7 : (_9 = (_8 = this._spec.word) === null || _8 === void 0 ? void 0 : _8.style) === null || _9 === void 0 ? void 0 : _9.fontWeight,
|
|
69065
69187
|
fillingRotateList: fillingRotateAngles,
|
|
69066
|
-
fillingTimes: (
|
|
69067
|
-
fillingXStep: (
|
|
69068
|
-
fillingYStep: (
|
|
69069
|
-
fillingXRatioStep: (
|
|
69070
|
-
fillingYRatioStep: (
|
|
69071
|
-
fillingInitialOpacity: (
|
|
69072
|
-
fillingDeltaOpacity: (
|
|
69073
|
-
fillingInitialFontSize: (
|
|
69074
|
-
fillingDeltaFontSize: (
|
|
69075
|
-
ratio: (
|
|
69076
|
-
fillingRatio: (
|
|
69077
|
-
removeWhiteBorder: (
|
|
69078
|
-
textLayoutTimes: (
|
|
69079
|
-
fontSizeShrinkFactor: (
|
|
69080
|
-
stepFactor: (
|
|
69081
|
-
layoutMode: (
|
|
69082
|
-
importantWordCount: (
|
|
69083
|
-
globalShinkLimit: (
|
|
69084
|
-
fontSizeEnlargeFactor: (
|
|
69085
|
-
fillingDeltaFontSizeFactor: (
|
|
69188
|
+
fillingTimes: (_10 = this._wordCloudShapeConfig) === null || _10 === void 0 ? void 0 : _10.fillingTimes,
|
|
69189
|
+
fillingXStep: (_11 = this._wordCloudShapeConfig) === null || _11 === void 0 ? void 0 : _11.fillingXStep,
|
|
69190
|
+
fillingYStep: (_12 = this._wordCloudShapeConfig) === null || _12 === void 0 ? void 0 : _12.fillingYStep,
|
|
69191
|
+
fillingXRatioStep: (_13 = this._wordCloudShapeConfig) === null || _13 === void 0 ? void 0 : _13.fillingXRatioStep,
|
|
69192
|
+
fillingYRatioStep: (_14 = this._wordCloudShapeConfig) === null || _14 === void 0 ? void 0 : _14.fillingYRatioStep,
|
|
69193
|
+
fillingInitialOpacity: (_15 = this._wordCloudShapeConfig) === null || _15 === void 0 ? void 0 : _15.fillingInitialOpacity,
|
|
69194
|
+
fillingDeltaOpacity: (_16 = this._wordCloudShapeConfig) === null || _16 === void 0 ? void 0 : _16.fillingDeltaOpacity,
|
|
69195
|
+
fillingInitialFontSize: (_17 = this._wordCloudShapeConfig) === null || _17 === void 0 ? void 0 : _17.fillingInitialFontSize,
|
|
69196
|
+
fillingDeltaFontSize: (_18 = this._wordCloudShapeConfig) === null || _18 === void 0 ? void 0 : _18.fillingDeltaFontSize,
|
|
69197
|
+
ratio: (_19 = this._wordCloudShapeConfig) === null || _19 === void 0 ? void 0 : _19.ratio,
|
|
69198
|
+
fillingRatio: (_20 = this._wordCloudShapeConfig) === null || _20 === void 0 ? void 0 : _20.fillingRatio,
|
|
69199
|
+
removeWhiteBorder: (_21 = this._wordCloudShapeConfig) === null || _21 === void 0 ? void 0 : _21.removeWhiteBorder,
|
|
69200
|
+
textLayoutTimes: (_22 = this._wordCloudShapeConfig) === null || _22 === void 0 ? void 0 : _22.textLayoutTimes,
|
|
69201
|
+
fontSizeShrinkFactor: (_23 = this._wordCloudShapeConfig) === null || _23 === void 0 ? void 0 : _23.fontSizeShrinkFactor,
|
|
69202
|
+
stepFactor: (_24 = this._wordCloudShapeConfig) === null || _24 === void 0 ? void 0 : _24.stepFactor,
|
|
69203
|
+
layoutMode: (_25 = this._wordCloudShapeConfig) === null || _25 === void 0 ? void 0 : _25.layoutMode,
|
|
69204
|
+
importantWordCount: (_26 = this._wordCloudShapeConfig) === null || _26 === void 0 ? void 0 : _26.importantWordCount,
|
|
69205
|
+
globalShinkLimit: (_27 = this._wordCloudShapeConfig) === null || _27 === void 0 ? void 0 : _27.globalShinkLimit,
|
|
69206
|
+
fontSizeEnlargeFactor: (_28 = this._wordCloudShapeConfig) === null || _28 === void 0 ? void 0 : _28.fontSizeEnlargeFactor,
|
|
69207
|
+
fillingDeltaFontSizeFactor: (_29 = this._wordCloudShapeConfig) === null || _29 === void 0 ? void 0 : _29.fillingDeltaFontSizeFactor
|
|
69086
69208
|
});
|
|
69087
69209
|
}
|
|
69088
69210
|
this._data.getProduct().transform(wordCloudTransforms);
|
|
@@ -71180,7 +71302,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
71180
71302
|
this.type = SeriesTypeEnum.wordCloud3d;
|
|
71181
71303
|
}
|
|
71182
71304
|
compile() {
|
|
71183
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30
|
|
71305
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30;
|
|
71184
71306
|
super.compile();
|
|
71185
71307
|
const wordCloudTransforms = [];
|
|
71186
71308
|
const valueField = this._valueField;
|
|
@@ -71238,9 +71360,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
71238
71360
|
fontSizeRange: this._fontSizeRange,
|
|
71239
71361
|
padding: this._fontPadding,
|
|
71240
71362
|
rotate: { field: WORD_CLOUD_ANGLE },
|
|
71241
|
-
fontFamily: (_h = (_e = this._fontFamilyField) !== null && _e !== void 0 ? _e : (_g = (_f = this._spec.word) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.fontFamily) !== null && _h !== void 0 ? _h : (
|
|
71363
|
+
fontFamily: (_h = (_e = this._fontFamilyField) !== null && _e !== void 0 ? _e : (_g = (_f = this._spec.word) === null || _f === void 0 ? void 0 : _f.style) === null || _g === void 0 ? void 0 : _g.fontFamily) !== null && _h !== void 0 ? _h : (_j = this._getChartLevelTheme()) === null || _j === void 0 ? void 0 : _j.fontFamily,
|
|
71242
71364
|
fontWeight: fontWeightField ? { field: fontWeightField } : valueField ? { field: WORD_CLOUD_WEIGHT } : null,
|
|
71243
|
-
fontStyle: (
|
|
71365
|
+
fontStyle: (_k = this._fontStyleField) !== null && _k !== void 0 ? _k : (_m = (_l = this._spec.word) === null || _l === void 0 ? void 0 : _l.style) === null || _m === void 0 ? void 0 : _m.fontStyle,
|
|
71244
71366
|
depth_3d: this._spec.depth_3d,
|
|
71245
71367
|
randomVisible: this._random,
|
|
71246
71368
|
clip: this._wordCloudConfig.drawOutOfBound === 'clip',
|
|
@@ -71257,42 +71379,42 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
71257
71379
|
type: 'wordcloudShape',
|
|
71258
71380
|
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
71259
71381
|
shape: this._maskShape,
|
|
71260
|
-
postProjection: (
|
|
71382
|
+
postProjection: (_o = this._spec.postProjection) !== null && _o !== void 0 ? _o : 'StereographicProjection',
|
|
71261
71383
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
71262
71384
|
text: { field: textField },
|
|
71263
71385
|
fontSize: valueField ? { field: valueField } : this._fontSizeRange[0],
|
|
71264
71386
|
fontSizeRange: this._fontSizeRange,
|
|
71265
71387
|
padding: this._fontPadding,
|
|
71266
71388
|
rotateList: rotateAngles,
|
|
71267
|
-
fontFamily: (
|
|
71389
|
+
fontFamily: (_s = (_p = this._fontFamilyField) !== null && _p !== void 0 ? _p : (_r = (_q = this._spec.word) === null || _q === void 0 ? void 0 : _q.style) === null || _r === void 0 ? void 0 : _r.fontFamily) !== null && _s !== void 0 ? _s : (_t = this._getChartLevelTheme()) === null || _t === void 0 ? void 0 : _t.fontFamily,
|
|
71268
71390
|
fontWeight: fontWeightField ? { field: fontWeightField } : valueField ? { field: WORD_CLOUD_WEIGHT } : null,
|
|
71269
|
-
fontStyle: (
|
|
71391
|
+
fontStyle: (_u = this._fontStyleField) !== null && _u !== void 0 ? _u : (_w = (_v = this._spec.word) === null || _v === void 0 ? void 0 : _v.style) === null || _w === void 0 ? void 0 : _w.fontStyle,
|
|
71270
71392
|
depth_3d: this._spec.depth_3d,
|
|
71271
|
-
fillingFontFamily: (
|
|
71393
|
+
fillingFontFamily: (_1 = (_y = (_x = this._wordCloudShapeConfig) === null || _x === void 0 ? void 0 : _x.fillingFontFamilyField) !== null && _y !== void 0 ? _y : (_0 = (_z = this._spec.word) === null || _z === void 0 ? void 0 : _z.style) === null || _0 === void 0 ? void 0 : _0.fontFamily) !== null && _1 !== void 0 ? _1 : (_2 = this._getChartLevelTheme()) === null || _2 === void 0 ? void 0 : _2.fontFamily,
|
|
71272
71394
|
fillingPadding: this._fillingFontPadding,
|
|
71273
|
-
fillingFontStyle: (
|
|
71274
|
-
fillingFontWeight: (
|
|
71395
|
+
fillingFontStyle: (_4 = (_3 = this._wordCloudShapeConfig) === null || _3 === void 0 ? void 0 : _3.fillingFontStyleField) !== null && _4 !== void 0 ? _4 : (_6 = (_5 = this._spec.word) === null || _5 === void 0 ? void 0 : _5.style) === null || _6 === void 0 ? void 0 : _6.fontStyle,
|
|
71396
|
+
fillingFontWeight: (_8 = (_7 = this._wordCloudShapeConfig) === null || _7 === void 0 ? void 0 : _7.fillingFontWeightField) !== null && _8 !== void 0 ? _8 : (_10 = (_9 = this._spec.word) === null || _9 === void 0 ? void 0 : _9.style) === null || _10 === void 0 ? void 0 : _10.fontWeight,
|
|
71275
71397
|
fillingRotateList: fillingRotateAngles,
|
|
71276
|
-
fillingTimes: (
|
|
71277
|
-
fillingXStep: (
|
|
71278
|
-
fillingYStep: (
|
|
71279
|
-
fillingXRatioStep: (
|
|
71280
|
-
fillingYRatioStep: (
|
|
71281
|
-
fillingInitialOpacity: (
|
|
71282
|
-
fillingDeltaOpacity: (
|
|
71283
|
-
fillingInitialFontSize: (
|
|
71284
|
-
fillingDeltaFontSize: (
|
|
71285
|
-
ratio: (
|
|
71286
|
-
fillingRatio: (
|
|
71287
|
-
removeWhiteBorder: (
|
|
71288
|
-
textLayoutTimes: (
|
|
71289
|
-
fontSizeShrinkFactor: (
|
|
71290
|
-
stepFactor: (
|
|
71291
|
-
layoutMode: (
|
|
71292
|
-
importantWordCount: (
|
|
71293
|
-
globalShinkLimit: (
|
|
71294
|
-
fontSizeEnlargeFactor: (
|
|
71295
|
-
fillingDeltaFontSizeFactor: (
|
|
71398
|
+
fillingTimes: (_11 = this._wordCloudShapeConfig) === null || _11 === void 0 ? void 0 : _11.fillingTimes,
|
|
71399
|
+
fillingXStep: (_12 = this._wordCloudShapeConfig) === null || _12 === void 0 ? void 0 : _12.fillingXStep,
|
|
71400
|
+
fillingYStep: (_13 = this._wordCloudShapeConfig) === null || _13 === void 0 ? void 0 : _13.fillingYStep,
|
|
71401
|
+
fillingXRatioStep: (_14 = this._wordCloudShapeConfig) === null || _14 === void 0 ? void 0 : _14.fillingXRatioStep,
|
|
71402
|
+
fillingYRatioStep: (_15 = this._wordCloudShapeConfig) === null || _15 === void 0 ? void 0 : _15.fillingYRatioStep,
|
|
71403
|
+
fillingInitialOpacity: (_16 = this._wordCloudShapeConfig) === null || _16 === void 0 ? void 0 : _16.fillingInitialOpacity,
|
|
71404
|
+
fillingDeltaOpacity: (_17 = this._wordCloudShapeConfig) === null || _17 === void 0 ? void 0 : _17.fillingDeltaOpacity,
|
|
71405
|
+
fillingInitialFontSize: (_18 = this._wordCloudShapeConfig) === null || _18 === void 0 ? void 0 : _18.fillingInitialFontSize,
|
|
71406
|
+
fillingDeltaFontSize: (_19 = this._wordCloudShapeConfig) === null || _19 === void 0 ? void 0 : _19.fillingDeltaFontSize,
|
|
71407
|
+
ratio: (_20 = this._wordCloudShapeConfig) === null || _20 === void 0 ? void 0 : _20.ratio,
|
|
71408
|
+
fillingRatio: (_21 = this._wordCloudShapeConfig) === null || _21 === void 0 ? void 0 : _21.fillingRatio,
|
|
71409
|
+
removeWhiteBorder: (_22 = this._wordCloudShapeConfig) === null || _22 === void 0 ? void 0 : _22.removeWhiteBorder,
|
|
71410
|
+
textLayoutTimes: (_23 = this._wordCloudShapeConfig) === null || _23 === void 0 ? void 0 : _23.textLayoutTimes,
|
|
71411
|
+
fontSizeShrinkFactor: (_24 = this._wordCloudShapeConfig) === null || _24 === void 0 ? void 0 : _24.fontSizeShrinkFactor,
|
|
71412
|
+
stepFactor: (_25 = this._wordCloudShapeConfig) === null || _25 === void 0 ? void 0 : _25.stepFactor,
|
|
71413
|
+
layoutMode: (_26 = this._wordCloudShapeConfig) === null || _26 === void 0 ? void 0 : _26.layoutMode,
|
|
71414
|
+
importantWordCount: (_27 = this._wordCloudShapeConfig) === null || _27 === void 0 ? void 0 : _27.importantWordCount,
|
|
71415
|
+
globalShinkLimit: (_28 = this._wordCloudShapeConfig) === null || _28 === void 0 ? void 0 : _28.globalShinkLimit,
|
|
71416
|
+
fontSizeEnlargeFactor: (_29 = this._wordCloudShapeConfig) === null || _29 === void 0 ? void 0 : _29.fontSizeEnlargeFactor,
|
|
71417
|
+
fillingDeltaFontSizeFactor: (_30 = this._wordCloudShapeConfig) === null || _30 === void 0 ? void 0 : _30.fillingDeltaFontSizeFactor
|
|
71296
71418
|
});
|
|
71297
71419
|
}
|
|
71298
71420
|
this._data.getProduct().transform(wordCloudTransforms);
|
|
@@ -71312,7 +71434,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
71312
71434
|
}
|
|
71313
71435
|
}
|
|
71314
71436
|
initMarkStyle() {
|
|
71315
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
71437
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
71316
71438
|
const wordMark = this._wordMark;
|
|
71317
71439
|
const fillingWordMark = this._fillingWordMark;
|
|
71318
71440
|
if (wordMark) {
|
|
@@ -71332,7 +71454,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
71332
71454
|
visible: (datum) => !datum.isFillingWord
|
|
71333
71455
|
}, 'normal', AttributeLevel.Series);
|
|
71334
71456
|
this.setMarkStyle(wordMark, {
|
|
71335
|
-
fontFamily: (_c = (_b = (_a = this._spec.word) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fontFamily) !== null && _c !== void 0 ? _c : (
|
|
71457
|
+
fontFamily: (_c = (_b = (_a = this._spec.word) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.fontFamily) !== null && _c !== void 0 ? _c : (_d = this._getChartLevelTheme()) === null || _d === void 0 ? void 0 : _d.fontFamily
|
|
71336
71458
|
}, 'normal', AttributeLevel.User_Mark);
|
|
71337
71459
|
}
|
|
71338
71460
|
if (fillingWordMark) {
|
|
@@ -71352,7 +71474,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
71352
71474
|
visible: (datum) => datum.isFillingWord
|
|
71353
71475
|
}, 'normal', AttributeLevel.Series);
|
|
71354
71476
|
this.setMarkStyle(fillingWordMark, {
|
|
71355
|
-
fontFamily: (
|
|
71477
|
+
fontFamily: (_g = (_f = (_e = this._spec.word) === null || _e === void 0 ? void 0 : _e.style) === null || _f === void 0 ? void 0 : _f.fontFamily) !== null && _g !== void 0 ? _g : (_h = this._getChartLevelTheme()) === null || _h === void 0 ? void 0 : _h.fontFamily
|
|
71356
71478
|
}, 'normal', AttributeLevel.User_Mark);
|
|
71357
71479
|
}
|
|
71358
71480
|
this._trigger.registerMark(wordMark);
|
|
@@ -73972,7 +74094,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
73972
74094
|
_getTriggerEvent(type) {
|
|
73973
74095
|
var _a;
|
|
73974
74096
|
const { mode } = this._drillParams;
|
|
73975
|
-
return (_a =
|
|
74097
|
+
return (_a = getDefaultTriggerEventByMode(mode)) === null || _a === void 0 ? void 0 : _a[type];
|
|
73976
74098
|
}
|
|
73977
74099
|
_hideTooltip() {
|
|
73978
74100
|
const tooltip = this
|
|
@@ -75672,7 +75794,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75672
75794
|
constructor() {
|
|
75673
75795
|
super(...arguments);
|
|
75674
75796
|
this.type = SeriesTypeEnum.waterfall;
|
|
75675
|
-
this._stack =
|
|
75797
|
+
this._stack = false;
|
|
75676
75798
|
this._leaderLineMark = null;
|
|
75677
75799
|
this._stackLabelMark = null;
|
|
75678
75800
|
this._labelMark = null;
|
|
@@ -75690,7 +75812,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
75690
75812
|
}
|
|
75691
75813
|
setAttrFromSpec() {
|
|
75692
75814
|
super.setAttrFromSpec();
|
|
75693
|
-
this.
|
|
75815
|
+
this.setValueFieldToStack();
|
|
75694
75816
|
this._fieldX = [this._fieldX[0]];
|
|
75695
75817
|
this._fieldY = [this._fieldY[0]];
|
|
75696
75818
|
if (isNil$1(this._seriesField)) {
|
|
@@ -76942,7 +77064,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76942
77064
|
};
|
|
76943
77065
|
|
|
76944
77066
|
const sankey = (data, op) => {
|
|
76945
|
-
var _a;
|
|
77067
|
+
var _a, _b, _c;
|
|
76946
77068
|
if (!data || !(op === null || op === void 0 ? void 0 : op.view) || !isArray$1(data)) {
|
|
76947
77069
|
return data;
|
|
76948
77070
|
}
|
|
@@ -76975,7 +77097,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76975
77097
|
data = data[0];
|
|
76976
77098
|
}
|
|
76977
77099
|
}
|
|
76978
|
-
if (op.sourceField !== 'source' || op.targetField !== 'target') {
|
|
77100
|
+
if (op.sourceField !== 'source' || op.targetField !== 'target' || op.valueField !== 'value') {
|
|
76979
77101
|
for (const key in data) {
|
|
76980
77102
|
if (key === 'links') {
|
|
76981
77103
|
const updatedData = [];
|
|
@@ -76988,6 +77110,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76988
77110
|
else if (key === op.targetField) {
|
|
76989
77111
|
updatedDatum.target = datum[op.targetField];
|
|
76990
77112
|
}
|
|
77113
|
+
else if (key === op.valueField) {
|
|
77114
|
+
updatedDatum.value = datum[op.valueField];
|
|
77115
|
+
}
|
|
76991
77116
|
else {
|
|
76992
77117
|
updatedDatum[key] = datum[key];
|
|
76993
77118
|
}
|
|
@@ -76998,6 +77123,37 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
76998
77123
|
}
|
|
76999
77124
|
}
|
|
77000
77125
|
}
|
|
77126
|
+
const convertValuesToNumbers = (data) => {
|
|
77127
|
+
data.forEach((obj) => {
|
|
77128
|
+
obj.value = isString$1(obj.value) ? +obj.value : obj.value;
|
|
77129
|
+
if (obj.children && obj.children.length > 0) {
|
|
77130
|
+
convertValuesToNumbers(obj.children);
|
|
77131
|
+
}
|
|
77132
|
+
});
|
|
77133
|
+
};
|
|
77134
|
+
for (const key in data) {
|
|
77135
|
+
if (key === 'links') {
|
|
77136
|
+
const updatedData = [];
|
|
77137
|
+
data[key].forEach((datum) => {
|
|
77138
|
+
const updatedDatum = {};
|
|
77139
|
+
for (const key in datum) {
|
|
77140
|
+
if (key === 'value') {
|
|
77141
|
+
updatedDatum.value = isString$1(datum.value) ? +datum.value : datum.value;
|
|
77142
|
+
}
|
|
77143
|
+
else {
|
|
77144
|
+
updatedDatum[key] = datum[key];
|
|
77145
|
+
}
|
|
77146
|
+
}
|
|
77147
|
+
updatedData.push(updatedDatum);
|
|
77148
|
+
});
|
|
77149
|
+
data[key] = updatedData;
|
|
77150
|
+
}
|
|
77151
|
+
else if (key === 'nodes') {
|
|
77152
|
+
if ((_c = (_b = data.nodes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.children) {
|
|
77153
|
+
convertValuesToNumbers(data.nodes);
|
|
77154
|
+
}
|
|
77155
|
+
}
|
|
77156
|
+
}
|
|
77001
77157
|
const layout = new SankeyLayout(op);
|
|
77002
77158
|
const result = [];
|
|
77003
77159
|
result.push(layout.layout(data, view));
|
|
@@ -77182,12 +77338,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77182
77338
|
return;
|
|
77183
77339
|
}
|
|
77184
77340
|
const allLinkElements = linkVGrammarMark.elements;
|
|
77341
|
+
const labelVGrammarMark = this._labelMark.getProduct();
|
|
77342
|
+
if (!labelVGrammarMark || !labelVGrammarMark.elements || !labelVGrammarMark.elements.length) {
|
|
77343
|
+
return;
|
|
77344
|
+
}
|
|
77345
|
+
const allLabelElements = labelVGrammarMark.elements;
|
|
77185
77346
|
allNodeElements.forEach(el => {
|
|
77186
77347
|
el.clearStates();
|
|
77187
77348
|
});
|
|
77188
77349
|
allLinkElements.forEach(el => {
|
|
77189
77350
|
el.clearStates();
|
|
77190
77351
|
});
|
|
77352
|
+
allLabelElements.forEach(el => {
|
|
77353
|
+
el.clearStates();
|
|
77354
|
+
});
|
|
77191
77355
|
};
|
|
77192
77356
|
this._handleNodeAdjacencyClick = (element) => {
|
|
77193
77357
|
const nodeDatum = element.getDatum();
|
|
@@ -77625,7 +77789,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77625
77789
|
return;
|
|
77626
77790
|
}
|
|
77627
77791
|
const selectedDatum = originalDatum
|
|
77628
|
-
? originalDatum.filter((entry
|
|
77792
|
+
? originalDatum.filter((entry) => {
|
|
77793
|
+
const parentKeysList = entry.parents.map((item) => item.key);
|
|
77794
|
+
return parentKeysList.includes(curLinkDatum.source) && parentKeysList.includes(curLinkDatum.target);
|
|
77795
|
+
})
|
|
77629
77796
|
: null;
|
|
77630
77797
|
if (selectedDatum && selectedDatum.length) {
|
|
77631
77798
|
if (!highlightNodes.includes(linkDatum.source)) {
|
|
@@ -77728,6 +77895,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77728
77895
|
},
|
|
77729
77896
|
sourceField: this._spec.sourceField,
|
|
77730
77897
|
targetField: this._spec.targetField,
|
|
77898
|
+
valueField: this._spec.valueField,
|
|
77731
77899
|
direction: this._spec.direction,
|
|
77732
77900
|
nodeAlign: (_a = this._spec.nodeAlign) !== null && _a !== void 0 ? _a : 'justify',
|
|
77733
77901
|
nodeGap: (_b = this._spec.nodeGap) !== null && _b !== void 0 ? _b : 8,
|
|
@@ -78115,11 +78283,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78115
78283
|
const colorDomain = !isNil$1((_g = (_f = this._option.globalScale.getScale('color')) === null || _f === void 0 ? void 0 : _f.domain()) === null || _g === void 0 ? void 0 : _g[0])
|
|
78116
78284
|
? this._option.globalScale.getScale('color').domain()
|
|
78117
78285
|
: this.getNodeList();
|
|
78118
|
-
let colorRange = (_j = (_h = this._option.globalScale.getScale('color')) === null || _h === void 0 ? void 0 : _h.range()) !== null && _j !== void 0 ? _j :
|
|
78286
|
+
let colorRange = (_j = (_h = this._option.globalScale.getScale('color')) === null || _h === void 0 ? void 0 : _h.range()) !== null && _j !== void 0 ? _j : this._getDataScheme();
|
|
78119
78287
|
if (((_k = this._option.globalScale.getScale('color')) === null || _k === void 0 ? void 0 : _k.domain().length) === 0 ||
|
|
78120
78288
|
isNil$1(this._option.globalScale.getScale('color').domain()[0])) {
|
|
78121
78289
|
if (colorDomain.length > 10) {
|
|
78122
|
-
colorRange = (_l =
|
|
78290
|
+
colorRange = (_l = this._getDataScheme()[1]) === null || _l === void 0 ? void 0 : _l.scheme;
|
|
78123
78291
|
}
|
|
78124
78292
|
}
|
|
78125
78293
|
const ordinalScale = new ColorOrdinalScale();
|
|
@@ -78303,8 +78471,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78303
78471
|
}
|
|
78304
78472
|
}
|
|
78305
78473
|
|
|
78306
|
-
const rangeAreaSeriesMark = Object.assign({}, areaSeriesMark);
|
|
78307
|
-
|
|
78308
78474
|
class RangeAreaSeries extends AreaSeries {
|
|
78309
78475
|
constructor() {
|
|
78310
78476
|
super(...arguments);
|
|
@@ -78536,7 +78702,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
78536
78702
|
getColorAttribute() {
|
|
78537
78703
|
var _a;
|
|
78538
78704
|
return {
|
|
78539
|
-
scale: (_a = this._option.globalScale.getScale('color')) !== null && _a !== void 0 ? _a : this.
|
|
78705
|
+
scale: (_a = this._option.globalScale.getScale('color')) !== null && _a !== void 0 ? _a : this._getDefaultColorScale(),
|
|
78540
78706
|
field: this.getFieldValue[0]
|
|
78541
78707
|
};
|
|
78542
78708
|
}
|
|
@@ -83356,14 +83522,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83356
83522
|
return Object.assign(Object.assign({}, DEFAULT_OPTIONS), { offsetX: (_a = offset === null || offset === void 0 ? void 0 : offset.x) !== null && _a !== void 0 ? _a : DEFAULT_OPTIONS.offsetX, offsetY: (_b = offset === null || offset === void 0 ? void 0 : offset.y) !== null && _b !== void 0 ? _b : DEFAULT_OPTIONS.offsetY });
|
|
83357
83523
|
}
|
|
83358
83524
|
_getTooltipBoxSize(actualTooltip, changePositionOnly) {
|
|
83359
|
-
var _a, _b, _c, _d, _e, _f;
|
|
83525
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
83360
83526
|
if (!changePositionOnly || isNil$1(this._attributes)) {
|
|
83361
|
-
const
|
|
83362
|
-
this._attributes = getTooltipAttributes(actualTooltip, this._component.getSpec(),
|
|
83527
|
+
const { chartLevelTheme = defaultChartLevelTheme } = (_c = (_b = (_a = this._chartOption).getThemeConfig) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : {};
|
|
83528
|
+
this._attributes = getTooltipAttributes(actualTooltip, this._component.getSpec(), chartLevelTheme);
|
|
83363
83529
|
}
|
|
83364
83530
|
return {
|
|
83365
|
-
width: (
|
|
83366
|
-
height: (
|
|
83531
|
+
width: (_e = (_d = this._attributes) === null || _d === void 0 ? void 0 : _d.panel) === null || _e === void 0 ? void 0 : _e.width,
|
|
83532
|
+
height: (_g = (_f = this._attributes) === null || _f === void 0 ? void 0 : _f.panel) === null || _g === void 0 ? void 0 : _g.height
|
|
83367
83533
|
};
|
|
83368
83534
|
}
|
|
83369
83535
|
_getParentElement(spec) {
|
|
@@ -84813,38 +84979,25 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
84813
84979
|
Factory.registerComponent(Tooltip.type, Tooltip);
|
|
84814
84980
|
};
|
|
84815
84981
|
|
|
84816
|
-
|
|
84817
|
-
|
|
84818
|
-
|
|
84819
|
-
|
|
84820
|
-
|
|
84821
|
-
|
|
84822
|
-
|
|
84823
|
-
|
|
84824
|
-
click: 'pointertap',
|
|
84825
|
-
hover: 'pointermove',
|
|
84826
|
-
hoverOut: 'pointerleave',
|
|
84827
|
-
clickOut: 'pointerleave'
|
|
84828
|
-
},
|
|
84829
|
-
[exports.RenderModeEnum['mobile-browser']]: {
|
|
84830
|
-
click: 'tap',
|
|
84831
|
-
hover: ['pointerdown', 'pointermove'],
|
|
84832
|
-
hoverOut: 'pointerleave',
|
|
84833
|
-
clickOut: 'pointerleave'
|
|
84834
|
-
},
|
|
84835
|
-
[exports.RenderModeEnum.miniApp]: {
|
|
84836
|
-
click: 'tap',
|
|
84837
|
-
hover: ['pointerdown', 'pointermove'],
|
|
84838
|
-
hoverOut: 'pointerleave',
|
|
84839
|
-
clickOut: 'pointerleave'
|
|
84840
|
-
},
|
|
84841
|
-
[exports.RenderModeEnum.lynx]: {
|
|
84842
|
-
click: 'tap',
|
|
84843
|
-
hover: ['pointerdown', 'pointermove'],
|
|
84844
|
-
hoverOut: 'pointerleave',
|
|
84845
|
-
clickOut: 'pointerleave'
|
|
84982
|
+
function getDefaultCrosshairTriggerEventByMode(mode) {
|
|
84983
|
+
if (mode === exports.RenderModeEnum['desktop-browser'] || mode === exports.RenderModeEnum['desktop-miniApp']) {
|
|
84984
|
+
return {
|
|
84985
|
+
click: 'pointertap',
|
|
84986
|
+
hover: 'pointermove',
|
|
84987
|
+
hoverOut: 'pointerleave',
|
|
84988
|
+
clickOut: 'pointerleave'
|
|
84989
|
+
};
|
|
84846
84990
|
}
|
|
84847
|
-
|
|
84991
|
+
if (isMobileLikeMode(mode) || isMiniAppLikeMode(mode)) {
|
|
84992
|
+
return {
|
|
84993
|
+
click: 'tap',
|
|
84994
|
+
hover: ['pointerdown', 'pointermove'],
|
|
84995
|
+
hoverOut: 'pointerleave',
|
|
84996
|
+
clickOut: 'pointerleave'
|
|
84997
|
+
};
|
|
84998
|
+
}
|
|
84999
|
+
return null;
|
|
85000
|
+
}
|
|
84848
85001
|
|
|
84849
85002
|
const ORIENT_MAP = {
|
|
84850
85003
|
x: ['top', 'bottom'],
|
|
@@ -84907,14 +85060,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
84907
85060
|
return result;
|
|
84908
85061
|
}
|
|
84909
85062
|
_initEvent() {
|
|
84910
|
-
|
|
84911
|
-
|
|
84912
|
-
|
|
84913
|
-
|
|
84914
|
-
}
|
|
84915
|
-
else {
|
|
84916
|
-
this._registerEvent(triggerEvent, outTriggerEvent);
|
|
84917
|
-
}
|
|
85063
|
+
const triggerConfig = this._getTriggerEvent();
|
|
85064
|
+
if (triggerConfig) {
|
|
85065
|
+
const { in: triggerEvent, out: outTriggerEvent } = triggerConfig;
|
|
85066
|
+
array(triggerEvent).forEach((eventName, index) => this._registerEvent(eventName, isArray$1(outTriggerEvent) ? outTriggerEvent[index] : outTriggerEvent));
|
|
84918
85067
|
}
|
|
84919
85068
|
}
|
|
84920
85069
|
_registerEvent(inEventName, outEventName) {
|
|
@@ -84935,15 +85084,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
84935
85084
|
}
|
|
84936
85085
|
_getTriggerEvent() {
|
|
84937
85086
|
const { mode = exports.RenderModeEnum['desktop-browser'] } = this._option;
|
|
84938
|
-
|
|
85087
|
+
const triggerConfig = getDefaultCrosshairTriggerEventByMode(mode);
|
|
85088
|
+
if (triggerConfig) {
|
|
84939
85089
|
const trigger = this.trigger || 'hover';
|
|
84940
85090
|
const outTrigger = (trigger) => (trigger === 'click' ? 'clickOut' : 'hoverOut');
|
|
84941
85091
|
if (isArray$1(trigger)) {
|
|
84942
85092
|
let inResult = [];
|
|
84943
85093
|
let outResult = [];
|
|
84944
85094
|
trigger.forEach(item => {
|
|
84945
|
-
inResult = inResult.concat(
|
|
84946
|
-
outResult = outResult.concat(
|
|
85095
|
+
inResult = inResult.concat(triggerConfig[item]);
|
|
85096
|
+
outResult = outResult.concat(triggerConfig[outTrigger(item)]);
|
|
84947
85097
|
});
|
|
84948
85098
|
return {
|
|
84949
85099
|
in: inResult,
|
|
@@ -84951,8 +85101,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
84951
85101
|
};
|
|
84952
85102
|
}
|
|
84953
85103
|
return {
|
|
84954
|
-
in:
|
|
84955
|
-
out:
|
|
85104
|
+
in: triggerConfig[trigger],
|
|
85105
|
+
out: triggerConfig[outTrigger(trigger)]
|
|
84956
85106
|
};
|
|
84957
85107
|
}
|
|
84958
85108
|
return null;
|
|
@@ -85008,8 +85158,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85008
85158
|
onRender(ctx) {
|
|
85009
85159
|
}
|
|
85010
85160
|
_releaseEvent() {
|
|
85011
|
-
|
|
85012
|
-
|
|
85161
|
+
const triggerConfig = this._getTriggerEvent();
|
|
85162
|
+
if (triggerConfig) {
|
|
85163
|
+
const { in: triggerEvent, out: outTriggerEvent } = triggerConfig;
|
|
85013
85164
|
if (isArray$1(triggerEvent)) {
|
|
85014
85165
|
triggerEvent.forEach(eachTriggerEvent => this._eventOff(eachTriggerEvent));
|
|
85015
85166
|
}
|
|
@@ -89069,7 +89220,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
89069
89220
|
this._linkedOutOfBrushElementsMap = {};
|
|
89070
89221
|
this._needInitOutState = true;
|
|
89071
89222
|
this._cacheInteractiveRangeAttrs = [];
|
|
89072
|
-
this._needEnablePickable =
|
|
89223
|
+
this._needEnablePickable = false;
|
|
89073
89224
|
}
|
|
89074
89225
|
init() {
|
|
89075
89226
|
var _a, _b;
|