@visactor/vchart 1.5.3-alpha.0 → 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 +187 -180
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/stack.js +1 -2
- 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/index.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/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 -41
- package/cjs/interaction/config.js.map +1 -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/series/sankey/sankey.js +6 -1
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/esm/chart/stack.js +1 -2
- 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/index.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/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 -39
- package/esm/interaction/config.js.map +1 -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/series/sankey/sankey.js +6 -1
- package/esm/series/sankey/sankey.js.map +1 -1
- package/package.json +7 -7
package/build/index.js
CHANGED
|
@@ -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);
|
|
@@ -28664,7 +28670,7 @@
|
|
|
28664
28670
|
});
|
|
28665
28671
|
}
|
|
28666
28672
|
setAttribute(key, value, forceUpdateTag) {
|
|
28667
|
-
|
|
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();
|
|
28668
28674
|
}
|
|
28669
28675
|
setAttributes(params, forceUpdateTag) {
|
|
28670
28676
|
const keys = Object.keys(params);
|
|
@@ -30706,12 +30712,32 @@
|
|
|
30706
30712
|
case "right":
|
|
30707
30713
|
case "inside-right":
|
|
30708
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;
|
|
30709
30727
|
}
|
|
30710
30728
|
anchorX += sx * rectWidth, anchorY += sy * rectHeight;
|
|
30711
30729
|
let vx = 0,
|
|
30712
30730
|
vy = 0;
|
|
30713
30731
|
const isInside = position.includes("inside");
|
|
30714
|
-
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
|
+
}
|
|
30715
30741
|
return {
|
|
30716
30742
|
x: anchorX + vx * offset + vx * width / 2,
|
|
30717
30743
|
y: anchorY + vy * offset + vy * height / 2
|
|
@@ -31940,7 +31966,7 @@
|
|
|
31940
31966
|
do {
|
|
31941
31967
|
items = reduce(items, sep);
|
|
31942
31968
|
} while (items.length >= 3 && hasOverlap$1(items, sep));
|
|
31943
|
-
items.length < 3 && !last(source).attribute.opacity &&
|
|
31969
|
+
items.length < 3 && !last(source).attribute.opacity && items.length > 1 && last(items).setAttribute("opacity", 0);
|
|
31944
31970
|
}
|
|
31945
31971
|
source.forEach(item => {
|
|
31946
31972
|
item.setAttribute("visible", !!item.attribute.opacity);
|
|
@@ -33590,7 +33616,7 @@
|
|
|
33590
33616
|
width: width,
|
|
33591
33617
|
height: (end - start) * height,
|
|
33592
33618
|
cursor: brushSelect ? "crosshair" : "move"
|
|
33593
|
-
}, 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({
|
|
33594
33620
|
x: position.x + start * width,
|
|
33595
33621
|
y: position.y + height / 2,
|
|
33596
33622
|
size: height,
|
|
@@ -33865,11 +33891,13 @@
|
|
|
33865
33891
|
}));
|
|
33866
33892
|
group = createGroup({
|
|
33867
33893
|
x: -(null !== (_a = null == limitRect ? void 0 : limitRect.x) && void 0 !== _a ? _a : 0),
|
|
33868
|
-
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
|
|
33869
33896
|
}), groupClip.add(group), this._containerClip = groupClip, this.add(groupClip);
|
|
33870
33897
|
} else group = createGroup({
|
|
33871
33898
|
x: 0,
|
|
33872
|
-
y: 0
|
|
33899
|
+
y: 0,
|
|
33900
|
+
pickable: !1
|
|
33873
33901
|
}), this.add(group);
|
|
33874
33902
|
group.name = "marker-container", this._container = group;
|
|
33875
33903
|
}
|
|
@@ -33885,9 +33913,10 @@
|
|
|
33885
33913
|
});
|
|
33886
33914
|
}
|
|
33887
33915
|
render() {
|
|
33888
|
-
var _a
|
|
33916
|
+
var _a;
|
|
33917
|
+
this.setAttribute("pickable", !1);
|
|
33889
33918
|
const markerVisible = null === (_a = this.attribute.visible) || void 0 === _a || _a;
|
|
33890
|
-
|
|
33919
|
+
!1 === this.attribute.interactive && this.setAttribute("childrenPickable", !1), markerVisible && (this._container ? (this._updateContainer(), this.updateMarker()) : (this._initContainer(), this.initMarker(this._container)));
|
|
33891
33920
|
}
|
|
33892
33921
|
}
|
|
33893
33922
|
|
|
@@ -34208,7 +34237,8 @@
|
|
|
34208
34237
|
endSymbol: endSymbol,
|
|
34209
34238
|
lineStyle: lineStyle,
|
|
34210
34239
|
mainSegmentIndex: mainSegmentIndex,
|
|
34211
|
-
multiSegment: multiSegment
|
|
34240
|
+
multiSegment: multiSegment,
|
|
34241
|
+
pickable: !1
|
|
34212
34242
|
});
|
|
34213
34243
|
line.name = "mark-line-line", this._line = line, container.add(line);
|
|
34214
34244
|
const markLabel = new Tag(Object.assign({}, label));
|
|
@@ -34464,7 +34494,8 @@
|
|
|
34464
34494
|
y: position.y + ((null == itemContent ? void 0 : itemContent.offsetY) || 0)
|
|
34465
34495
|
},
|
|
34466
34496
|
line = new Segment({
|
|
34467
|
-
points: []
|
|
34497
|
+
points: [],
|
|
34498
|
+
pickable: !1
|
|
34468
34499
|
});
|
|
34469
34500
|
line.name = "mark-point-line", this._line = line, container.add(line);
|
|
34470
34501
|
const decorativeLine = createLine({
|
|
@@ -58340,7 +58371,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
58340
58371
|
};
|
|
58341
58372
|
registerVChartCore();
|
|
58342
58373
|
|
|
58343
|
-
const version = "1.5.3
|
|
58374
|
+
const version = "1.5.3";
|
|
58344
58375
|
|
|
58345
58376
|
class ChartData {
|
|
58346
58377
|
get dataList() {
|
|
@@ -59883,63 +59914,35 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
59883
59914
|
return data;
|
|
59884
59915
|
};
|
|
59885
59916
|
|
|
59886
|
-
|
|
59887
|
-
[exports.RenderModeEnum['desktop-miniApp']
|
|
59888
|
-
|
|
59889
|
-
|
|
59890
|
-
|
|
59891
|
-
|
|
59892
|
-
|
|
59893
|
-
|
|
59894
|
-
|
|
59895
|
-
|
|
59896
|
-
|
|
59897
|
-
|
|
59898
|
-
|
|
59899
|
-
hover: {
|
|
59900
|
-
enable: true,
|
|
59901
|
-
trigger: 'pointermove',
|
|
59902
|
-
triggerOff: ['pointermove', 'pointerleave']
|
|
59903
|
-
},
|
|
59904
|
-
select: {
|
|
59905
|
-
enable: true,
|
|
59906
|
-
trigger: 'pointertap'
|
|
59907
|
-
}
|
|
59908
|
-
},
|
|
59909
|
-
[exports.RenderModeEnum['mobile-browser']]: {
|
|
59910
|
-
hover: {
|
|
59911
|
-
enable: true,
|
|
59912
|
-
trigger: 'pointerover',
|
|
59913
|
-
triggerOff: 'pointerout'
|
|
59914
|
-
},
|
|
59915
|
-
select: {
|
|
59916
|
-
enable: true,
|
|
59917
|
-
trigger: 'tap'
|
|
59918
|
-
}
|
|
59919
|
-
},
|
|
59920
|
-
[exports.RenderModeEnum.miniApp]: {
|
|
59921
|
-
hover: {
|
|
59922
|
-
enable: true,
|
|
59923
|
-
trigger: 'pointerover',
|
|
59924
|
-
triggerOff: 'pointerout'
|
|
59925
|
-
},
|
|
59926
|
-
select: {
|
|
59927
|
-
enable: true,
|
|
59928
|
-
trigger: 'tap'
|
|
59929
|
-
}
|
|
59930
|
-
},
|
|
59931
|
-
[exports.RenderModeEnum.lynx]: {
|
|
59932
|
-
hover: {
|
|
59933
|
-
enable: true,
|
|
59934
|
-
trigger: 'pointerover',
|
|
59935
|
-
triggerOff: 'pointerout'
|
|
59936
|
-
},
|
|
59937
|
-
select: {
|
|
59938
|
-
enable: true,
|
|
59939
|
-
trigger: 'tap'
|
|
59940
|
-
}
|
|
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
|
+
};
|
|
59941
59930
|
}
|
|
59942
|
-
|
|
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
|
+
}
|
|
59943
59946
|
|
|
59944
59947
|
class Trigger {
|
|
59945
59948
|
get hover() {
|
|
@@ -60032,7 +60035,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
60032
60035
|
this.event.release();
|
|
60033
60036
|
}
|
|
60034
60037
|
initConfig(mode) {
|
|
60035
|
-
const defaultConfig =
|
|
60038
|
+
const defaultConfig = getDefaultInteractionConfigByMode(mode);
|
|
60036
60039
|
this._hover = Object.assign({}, defaultConfig === null || defaultConfig === void 0 ? void 0 : defaultConfig.hover);
|
|
60037
60040
|
this._select = Object.assign({}, defaultConfig === null || defaultConfig === void 0 ? void 0 : defaultConfig.select);
|
|
60038
60041
|
const hoverSpec = this._spec.hover;
|
|
@@ -64408,56 +64411,32 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64408
64411
|
}
|
|
64409
64412
|
}
|
|
64410
64413
|
|
|
64411
|
-
|
|
64412
|
-
|
|
64413
|
-
|
|
64414
|
-
|
|
64415
|
-
|
|
64416
|
-
|
|
64417
|
-
|
|
64418
|
-
|
|
64419
|
-
|
|
64420
|
-
|
|
64421
|
-
|
|
64422
|
-
start: 'pointerdown',
|
|
64423
|
-
move: 'pointermove',
|
|
64424
|
-
end: 'pointerup',
|
|
64425
|
-
zoom: 'wheel',
|
|
64426
|
-
zoomEnd: 'pointerup',
|
|
64427
|
-
scroll: 'wheel',
|
|
64428
|
-
trigger: DeskTopTrigger
|
|
64429
|
-
},
|
|
64430
|
-
[exports.RenderModeEnum['mobile-browser']]: {
|
|
64431
|
-
start: 'pointerdown',
|
|
64432
|
-
move: 'pointermove',
|
|
64433
|
-
end: 'pointerup',
|
|
64434
|
-
zoom: 'pinch',
|
|
64435
|
-
zoomEnd: 'pinchend',
|
|
64436
|
-
scroll: 'pan',
|
|
64437
|
-
scrollEnd: 'panend',
|
|
64438
|
-
trigger: MobileTrigger
|
|
64439
|
-
},
|
|
64440
|
-
[exports.RenderModeEnum.miniApp]: {
|
|
64441
|
-
start: 'pointerdown',
|
|
64442
|
-
move: 'pointermove',
|
|
64443
|
-
end: 'pointerup',
|
|
64444
|
-
zoom: 'pinch',
|
|
64445
|
-
zoomEnd: 'pinchend',
|
|
64446
|
-
scroll: 'pan',
|
|
64447
|
-
scrollEnd: 'panend',
|
|
64448
|
-
trigger: MobileTrigger
|
|
64449
|
-
},
|
|
64450
|
-
[exports.RenderModeEnum.lynx]: {
|
|
64451
|
-
start: 'pointerdown',
|
|
64452
|
-
move: 'pointermove',
|
|
64453
|
-
end: 'pointerup',
|
|
64454
|
-
zoom: 'pinch',
|
|
64455
|
-
zoomEnd: 'pinchend',
|
|
64456
|
-
scroll: 'pan',
|
|
64457
|
-
scrollEnd: 'panend',
|
|
64458
|
-
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
|
+
};
|
|
64459
64425
|
}
|
|
64460
|
-
|
|
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
|
+
}
|
|
64461
64440
|
|
|
64462
64441
|
const delayMap = {
|
|
64463
64442
|
debounce: debounce,
|
|
@@ -64467,13 +64446,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64467
64446
|
initZoomable(evt, mode = exports.RenderModeEnum['desktop-browser']) {
|
|
64468
64447
|
this._eventObj = evt;
|
|
64469
64448
|
this._renderMode = mode;
|
|
64470
|
-
if (
|
|
64449
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64471
64450
|
this._clickEnable = true;
|
|
64472
64451
|
this._zoomableTrigger = new (this._getTriggerEvent('trigger'))();
|
|
64473
64452
|
}
|
|
64474
64453
|
}
|
|
64475
64454
|
_getTriggerEvent(type) {
|
|
64476
|
-
return
|
|
64455
|
+
return getDefaultTriggerEventByMode(this._renderMode)[type];
|
|
64477
64456
|
}
|
|
64478
64457
|
_zoomEventDispatch(params, regionOrSeries, callback) {
|
|
64479
64458
|
if (!params.event) {
|
|
@@ -64513,12 +64492,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64513
64492
|
}, delayTime));
|
|
64514
64493
|
}
|
|
64515
64494
|
initZoomEventOfSeries(s, callback, option) {
|
|
64516
|
-
if (
|
|
64495
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64517
64496
|
this._bindZoomEventAsRegion(s.event, s, callback, option);
|
|
64518
64497
|
}
|
|
64519
64498
|
}
|
|
64520
64499
|
initZoomEventOfRegions(regions, filter, callback, option) {
|
|
64521
|
-
if (
|
|
64500
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64522
64501
|
regions.forEach(r => {
|
|
64523
64502
|
if (filter) {
|
|
64524
64503
|
r.getSeries().forEach(s => {
|
|
@@ -64571,12 +64550,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64571
64550
|
}, delayTime));
|
|
64572
64551
|
}
|
|
64573
64552
|
initScrollEventOfSeries(s, callback, option) {
|
|
64574
|
-
if (
|
|
64553
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64575
64554
|
this._bindScrollEventAsRegion(s.event, s, callback, option);
|
|
64576
64555
|
}
|
|
64577
64556
|
}
|
|
64578
64557
|
initScrollEventOfRegions(regions, filter, callback, option) {
|
|
64579
|
-
if (
|
|
64558
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64580
64559
|
regions.forEach(r => {
|
|
64581
64560
|
if (filter) {
|
|
64582
64561
|
r.getSeries().forEach(s => {
|
|
@@ -64610,14 +64589,14 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64610
64589
|
});
|
|
64611
64590
|
}
|
|
64612
64591
|
initDragEventOfSeries(s, callback, option) {
|
|
64613
|
-
if (
|
|
64592
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64614
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 => {
|
|
64615
64594
|
this._handleDrag(params, callback, option);
|
|
64616
64595
|
});
|
|
64617
64596
|
}
|
|
64618
64597
|
}
|
|
64619
64598
|
initDragEventOfRegions(regions, filter, callback, option) {
|
|
64620
|
-
if (
|
|
64599
|
+
if (getDefaultTriggerEventByMode(this._renderMode)) {
|
|
64621
64600
|
regions.forEach(r => {
|
|
64622
64601
|
if (filter) {
|
|
64623
64602
|
r.getSeries().forEach(s => {
|
|
@@ -74115,7 +74094,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
74115
74094
|
_getTriggerEvent(type) {
|
|
74116
74095
|
var _a;
|
|
74117
74096
|
const { mode } = this._drillParams;
|
|
74118
|
-
return (_a =
|
|
74097
|
+
return (_a = getDefaultTriggerEventByMode(mode)) === null || _a === void 0 ? void 0 : _a[type];
|
|
74119
74098
|
}
|
|
74120
74099
|
_hideTooltip() {
|
|
74121
74100
|
const tooltip = this
|
|
@@ -77085,7 +77064,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77085
77064
|
};
|
|
77086
77065
|
|
|
77087
77066
|
const sankey = (data, op) => {
|
|
77088
|
-
var _a;
|
|
77067
|
+
var _a, _b, _c;
|
|
77089
77068
|
if (!data || !(op === null || op === void 0 ? void 0 : op.view) || !isArray$1(data)) {
|
|
77090
77069
|
return data;
|
|
77091
77070
|
}
|
|
@@ -77118,7 +77097,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77118
77097
|
data = data[0];
|
|
77119
77098
|
}
|
|
77120
77099
|
}
|
|
77121
|
-
if (op.sourceField !== 'source' || op.targetField !== 'target') {
|
|
77100
|
+
if (op.sourceField !== 'source' || op.targetField !== 'target' || op.valueField !== 'value') {
|
|
77122
77101
|
for (const key in data) {
|
|
77123
77102
|
if (key === 'links') {
|
|
77124
77103
|
const updatedData = [];
|
|
@@ -77131,6 +77110,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77131
77110
|
else if (key === op.targetField) {
|
|
77132
77111
|
updatedDatum.target = datum[op.targetField];
|
|
77133
77112
|
}
|
|
77113
|
+
else if (key === op.valueField) {
|
|
77114
|
+
updatedDatum.value = datum[op.valueField];
|
|
77115
|
+
}
|
|
77134
77116
|
else {
|
|
77135
77117
|
updatedDatum[key] = datum[key];
|
|
77136
77118
|
}
|
|
@@ -77141,6 +77123,37 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77141
77123
|
}
|
|
77142
77124
|
}
|
|
77143
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
|
+
}
|
|
77144
77157
|
const layout = new SankeyLayout(op);
|
|
77145
77158
|
const result = [];
|
|
77146
77159
|
result.push(layout.layout(data, view));
|
|
@@ -77325,12 +77338,20 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77325
77338
|
return;
|
|
77326
77339
|
}
|
|
77327
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;
|
|
77328
77346
|
allNodeElements.forEach(el => {
|
|
77329
77347
|
el.clearStates();
|
|
77330
77348
|
});
|
|
77331
77349
|
allLinkElements.forEach(el => {
|
|
77332
77350
|
el.clearStates();
|
|
77333
77351
|
});
|
|
77352
|
+
allLabelElements.forEach(el => {
|
|
77353
|
+
el.clearStates();
|
|
77354
|
+
});
|
|
77334
77355
|
};
|
|
77335
77356
|
this._handleNodeAdjacencyClick = (element) => {
|
|
77336
77357
|
const nodeDatum = element.getDatum();
|
|
@@ -77874,6 +77895,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
77874
77895
|
},
|
|
77875
77896
|
sourceField: this._spec.sourceField,
|
|
77876
77897
|
targetField: this._spec.targetField,
|
|
77898
|
+
valueField: this._spec.valueField,
|
|
77877
77899
|
direction: this._spec.direction,
|
|
77878
77900
|
nodeAlign: (_a = this._spec.nodeAlign) !== null && _a !== void 0 ? _a : 'justify',
|
|
77879
77901
|
nodeGap: (_b = this._spec.nodeGap) !== null && _b !== void 0 ? _b : 8,
|
|
@@ -84957,38 +84979,25 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
84957
84979
|
Factory.registerComponent(Tooltip.type, Tooltip);
|
|
84958
84980
|
};
|
|
84959
84981
|
|
|
84960
|
-
|
|
84961
|
-
|
|
84962
|
-
|
|
84963
|
-
|
|
84964
|
-
|
|
84965
|
-
|
|
84966
|
-
|
|
84967
|
-
|
|
84968
|
-
click: 'pointertap',
|
|
84969
|
-
hover: 'pointermove',
|
|
84970
|
-
hoverOut: 'pointerleave',
|
|
84971
|
-
clickOut: 'pointerleave'
|
|
84972
|
-
},
|
|
84973
|
-
[exports.RenderModeEnum['mobile-browser']]: {
|
|
84974
|
-
click: 'tap',
|
|
84975
|
-
hover: ['pointerdown', 'pointermove'],
|
|
84976
|
-
hoverOut: 'pointerleave',
|
|
84977
|
-
clickOut: 'pointerleave'
|
|
84978
|
-
},
|
|
84979
|
-
[exports.RenderModeEnum.miniApp]: {
|
|
84980
|
-
click: 'tap',
|
|
84981
|
-
hover: ['pointerdown', 'pointermove'],
|
|
84982
|
-
hoverOut: 'pointerleave',
|
|
84983
|
-
clickOut: 'pointerleave'
|
|
84984
|
-
},
|
|
84985
|
-
[exports.RenderModeEnum.lynx]: {
|
|
84986
|
-
click: 'tap',
|
|
84987
|
-
hover: ['pointerdown', 'pointermove'],
|
|
84988
|
-
hoverOut: 'pointerleave',
|
|
84989
|
-
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
|
+
};
|
|
84990
84990
|
}
|
|
84991
|
-
|
|
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
|
+
}
|
|
84992
85001
|
|
|
84993
85002
|
const ORIENT_MAP = {
|
|
84994
85003
|
x: ['top', 'bottom'],
|
|
@@ -85051,14 +85060,10 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85051
85060
|
return result;
|
|
85052
85061
|
}
|
|
85053
85062
|
_initEvent() {
|
|
85054
|
-
|
|
85055
|
-
|
|
85056
|
-
|
|
85057
|
-
|
|
85058
|
-
}
|
|
85059
|
-
else {
|
|
85060
|
-
this._registerEvent(triggerEvent, outTriggerEvent);
|
|
85061
|
-
}
|
|
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));
|
|
85062
85067
|
}
|
|
85063
85068
|
}
|
|
85064
85069
|
_registerEvent(inEventName, outEventName) {
|
|
@@ -85079,15 +85084,16 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85079
85084
|
}
|
|
85080
85085
|
_getTriggerEvent() {
|
|
85081
85086
|
const { mode = exports.RenderModeEnum['desktop-browser'] } = this._option;
|
|
85082
|
-
|
|
85087
|
+
const triggerConfig = getDefaultCrosshairTriggerEventByMode(mode);
|
|
85088
|
+
if (triggerConfig) {
|
|
85083
85089
|
const trigger = this.trigger || 'hover';
|
|
85084
85090
|
const outTrigger = (trigger) => (trigger === 'click' ? 'clickOut' : 'hoverOut');
|
|
85085
85091
|
if (isArray$1(trigger)) {
|
|
85086
85092
|
let inResult = [];
|
|
85087
85093
|
let outResult = [];
|
|
85088
85094
|
trigger.forEach(item => {
|
|
85089
|
-
inResult = inResult.concat(
|
|
85090
|
-
outResult = outResult.concat(
|
|
85095
|
+
inResult = inResult.concat(triggerConfig[item]);
|
|
85096
|
+
outResult = outResult.concat(triggerConfig[outTrigger(item)]);
|
|
85091
85097
|
});
|
|
85092
85098
|
return {
|
|
85093
85099
|
in: inResult,
|
|
@@ -85095,8 +85101,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85095
85101
|
};
|
|
85096
85102
|
}
|
|
85097
85103
|
return {
|
|
85098
|
-
in:
|
|
85099
|
-
out:
|
|
85104
|
+
in: triggerConfig[trigger],
|
|
85105
|
+
out: triggerConfig[outTrigger(trigger)]
|
|
85100
85106
|
};
|
|
85101
85107
|
}
|
|
85102
85108
|
return null;
|
|
@@ -85152,8 +85158,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85152
85158
|
onRender(ctx) {
|
|
85153
85159
|
}
|
|
85154
85160
|
_releaseEvent() {
|
|
85155
|
-
|
|
85156
|
-
|
|
85161
|
+
const triggerConfig = this._getTriggerEvent();
|
|
85162
|
+
if (triggerConfig) {
|
|
85163
|
+
const { in: triggerEvent, out: outTriggerEvent } = triggerConfig;
|
|
85157
85164
|
if (isArray$1(triggerEvent)) {
|
|
85158
85165
|
triggerEvent.forEach(eachTriggerEvent => this._eventOff(eachTriggerEvent));
|
|
85159
85166
|
}
|