@visactor/vchart 1.12.8 → 1.12.9-alpha.1
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 +438 -157
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/chart-meta/data.js.map +1 -1
- package/cjs/component/label/label.js +6 -3
- package/cjs/component/label/label.js.map +1 -1
- package/cjs/component/label/util.d.ts +4 -4
- package/cjs/component/tooltip/interface/spec.d.ts +3 -1
- package/cjs/component/tooltip/interface/spec.js.map +1 -1
- package/cjs/component/tooltip/processor/mark-tooltip.js +29 -3
- package/cjs/component/tooltip/processor/mark-tooltip.js.map +1 -1
- package/cjs/component/tooltip/tooltip.d.ts +2 -0
- package/cjs/component/tooltip/tooltip.js +27 -17
- package/cjs/component/tooltip/tooltip.js.map +1 -1
- package/cjs/component/tooltip/utils/common.js +3 -1
- package/cjs/component/tooltip/utils/common.js.map +1 -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/plugin/components/tooltip-handler/base.d.ts +0 -3
- package/cjs/plugin/components/tooltip-handler/base.js +3 -10
- package/cjs/plugin/components/tooltip-handler/base.js.map +1 -1
- package/cjs/series/box-plot/box-plot.d.ts +1 -0
- package/cjs/series/box-plot/box-plot.js +4 -0
- package/cjs/series/box-plot/box-plot.js.map +1 -1
- package/cjs/series/correlation/correlation.d.ts +1 -0
- package/cjs/series/correlation/correlation.js +4 -0
- package/cjs/series/correlation/correlation.js.map +1 -1
- package/cjs/series/funnel/funnel.d.ts +1 -0
- package/cjs/series/funnel/funnel.js +13 -9
- package/cjs/series/funnel/funnel.js.map +1 -1
- package/cjs/series/map/map.d.ts +1 -0
- package/cjs/series/map/map.js +4 -0
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/pie/pie.d.ts +1 -0
- package/cjs/series/pie/pie.js +4 -0
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/sankey/sankey.d.ts +1 -0
- package/cjs/series/sankey/sankey.js +5 -0
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/series/waterfall/waterfall.d.ts +1 -0
- package/cjs/series/waterfall/waterfall.js +4 -0
- package/cjs/series/waterfall/waterfall.js.map +1 -1
- package/esm/chart/chart-meta/data.js.map +1 -1
- package/esm/component/label/label.js +7 -4
- package/esm/component/label/label.js.map +1 -1
- package/esm/component/label/util.d.ts +4 -4
- package/esm/component/tooltip/interface/spec.d.ts +3 -1
- package/esm/component/tooltip/interface/spec.js.map +1 -1
- package/esm/component/tooltip/processor/mark-tooltip.js +30 -2
- package/esm/component/tooltip/processor/mark-tooltip.js.map +1 -1
- package/esm/component/tooltip/tooltip.d.ts +2 -0
- package/esm/component/tooltip/tooltip.js +27 -18
- package/esm/component/tooltip/tooltip.js.map +1 -1
- package/esm/component/tooltip/utils/common.js +3 -1
- package/esm/component/tooltip/utils/common.js.map +1 -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/plugin/components/tooltip-handler/base.d.ts +0 -3
- package/esm/plugin/components/tooltip-handler/base.js +4 -11
- package/esm/plugin/components/tooltip-handler/base.js.map +1 -1
- package/esm/series/box-plot/box-plot.d.ts +1 -0
- package/esm/series/box-plot/box-plot.js +4 -0
- package/esm/series/box-plot/box-plot.js.map +1 -1
- package/esm/series/correlation/correlation.d.ts +1 -0
- package/esm/series/correlation/correlation.js +4 -0
- package/esm/series/correlation/correlation.js.map +1 -1
- package/esm/series/funnel/funnel.d.ts +1 -0
- package/esm/series/funnel/funnel.js +13 -9
- package/esm/series/funnel/funnel.js.map +1 -1
- package/esm/series/map/map.d.ts +1 -0
- package/esm/series/map/map.js +4 -0
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/pie/pie.d.ts +1 -0
- package/esm/series/pie/pie.js +4 -0
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/sankey/sankey.d.ts +1 -0
- package/esm/series/sankey/sankey.js +5 -0
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/series/waterfall/waterfall.d.ts +1 -0
- package/esm/series/waterfall/waterfall.js +4 -0
- package/esm/series/waterfall/waterfall.js.map +1 -1
- package/package.json +15 -15
package/build/index.js
CHANGED
|
@@ -7979,11 +7979,12 @@
|
|
|
7979
7979
|
for (let i = 0, len = paths.length; i < len; i++) if (currPath = paths[i], coordsStr = currPath.slice(1), commandChar = currPath[0], currCommandData = [commandChar], coordsStrArr = coordsStr.match(rePathCommand), null !== coordsStrArr) {
|
|
7980
7980
|
for (let i = 0, len = coordsStrArr.length; i < len; i++) coordStr = coordsStrArr[i], coordNumber = parseFloat(coordStr), Number.isNaN(coordNumber) || currCommandData.push(coordNumber);
|
|
7981
7981
|
if (standardCommandLen = commandLengths[commandChar], currCommandData.length - 1 > standardCommandLen) {
|
|
7982
|
-
let subCommand
|
|
7982
|
+
let subCommand,
|
|
7983
|
+
bestCommandChar = commandChar;
|
|
7983
7984
|
for (let i = 1, len = currCommandData.length; i < len; i += standardCommandLen) {
|
|
7984
|
-
subCommand = [
|
|
7985
|
+
subCommand = [bestCommandChar];
|
|
7985
7986
|
for (let j = i, subLen = i + standardCommandLen; j < subLen; j++) subCommand.push(currCommandData[j]);
|
|
7986
|
-
result.push(subCommand);
|
|
7987
|
+
result.push(subCommand), "m" === bestCommandChar ? bestCommandChar = "l" : "M" === bestCommandChar && (bestCommandChar = "L");
|
|
7987
7988
|
}
|
|
7988
7989
|
} else result.push(currCommandData);
|
|
7989
7990
|
} else result.push(currCommandData);
|
|
@@ -9194,6 +9195,7 @@
|
|
|
9194
9195
|
zIndex: 0,
|
|
9195
9196
|
layout: null,
|
|
9196
9197
|
boundsPadding: 0,
|
|
9198
|
+
fillStrokeOrder: 0,
|
|
9197
9199
|
renderStyle: "default",
|
|
9198
9200
|
pickMode: "accurate",
|
|
9199
9201
|
customPickShape: null,
|
|
@@ -9264,6 +9266,7 @@
|
|
|
9264
9266
|
});
|
|
9265
9267
|
const DefaultPathAttribute = Object.assign(Object.assign({}, DefaultAttribute), {
|
|
9266
9268
|
path: new CustomPath2D(),
|
|
9269
|
+
fillStrokeOrder: 1,
|
|
9267
9270
|
customPath: () => {
|
|
9268
9271
|
Logger.getInstance().warn("空函数");
|
|
9269
9272
|
}
|
|
@@ -10286,7 +10289,7 @@
|
|
|
10286
10289
|
}
|
|
10287
10290
|
hasSubView() {
|
|
10288
10291
|
const viewBox = this._handler.getViewBox();
|
|
10289
|
-
return !(0 === viewBox.x1 && 0 === viewBox.y1 && this.width
|
|
10292
|
+
return !(0 === viewBox.x1 && 0 === viewBox.y1 && isNumberClose(this.width, viewBox.width()) && isNumberClose(this.height, viewBox.height()));
|
|
10290
10293
|
}
|
|
10291
10294
|
isVisible(bbox) {
|
|
10292
10295
|
return this._handler.isVisible(bbox);
|
|
@@ -17037,7 +17040,8 @@
|
|
|
17037
17040
|
fill = arcAttribute.fill,
|
|
17038
17041
|
stroke = arcAttribute.stroke,
|
|
17039
17042
|
x: originX = arcAttribute.x,
|
|
17040
|
-
y: originY = arcAttribute.y
|
|
17043
|
+
y: originY = arcAttribute.y,
|
|
17044
|
+
fillStrokeOrder = arcAttribute.fillStrokeOrder
|
|
17041
17045
|
} = arc.attribute,
|
|
17042
17046
|
data = this.valid(arc, arcAttribute, fillCb, strokeCb);
|
|
17043
17047
|
if (!data) return;
|
|
@@ -17073,7 +17077,17 @@
|
|
|
17073
17077
|
isFullStroke: isFullStroke,
|
|
17074
17078
|
stroke: arrayStroke
|
|
17075
17079
|
} = parseStroke(stroke);
|
|
17076
|
-
if (
|
|
17080
|
+
if (doFill || isFullStroke) {
|
|
17081
|
+
context.beginPath(), drawArcPath$1(arc, context, x, y, outerRadius, innerRadius), beforeRenderContribitionsRuned = !0, context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute), this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
|
|
17082
|
+
const _runFill = () => {
|
|
17083
|
+
doFill && (fillCb ? fillCb(context, arc.attribute, arcAttribute) : fVisible && (context.setCommonStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.fill()));
|
|
17084
|
+
},
|
|
17085
|
+
_runStroke = () => {
|
|
17086
|
+
doStroke && isFullStroke && (strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, originX - x, originY - y, arcAttribute), context.stroke()));
|
|
17087
|
+
};
|
|
17088
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
|
|
17089
|
+
}
|
|
17090
|
+
if (!isFullStroke && doStroke) {
|
|
17077
17091
|
context.beginPath();
|
|
17078
17092
|
drawArcPath$1(arc, context, x, y, outerRadius, innerRadius, arrayStroke);
|
|
17079
17093
|
beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), strokeCb ? strokeCb(context, arc.attribute, arcAttribute) : sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke());
|
|
@@ -17091,14 +17105,20 @@
|
|
|
17091
17105
|
fill = arcAttribute.fill
|
|
17092
17106
|
} = arc.attribute,
|
|
17093
17107
|
startAngle = endAngle;
|
|
17094
|
-
|
|
17095
|
-
|
|
17096
|
-
|
|
17097
|
-
|
|
17098
|
-
|
|
17099
|
-
|
|
17100
|
-
|
|
17101
|
-
|
|
17108
|
+
this.drawArcTailCapPath(arc, context, x, y, outerRadius, innerRadius, startAngle, startAngle + capAngle), beforeRenderContribitionsRuned || this.beforeRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb);
|
|
17109
|
+
const _runFill = () => {
|
|
17110
|
+
if (doFill) {
|
|
17111
|
+
const color = fill;
|
|
17112
|
+
if ("conical" === color.gradient) {
|
|
17113
|
+
const lastColor = getConicGradientAt(0, 0, endAngle, color);
|
|
17114
|
+
fillCb || fillVisible && (context.setCommonStyle(arc, arc.attribute, x, y, arcAttribute), context.fillStyle = lastColor, context.fill());
|
|
17115
|
+
}
|
|
17116
|
+
}
|
|
17117
|
+
},
|
|
17118
|
+
_runStroke = () => {
|
|
17119
|
+
doStroke && (strokeCb || sVisible && (context.setStrokeStyle(arc, arc.attribute, x, y, arcAttribute), context.stroke()));
|
|
17120
|
+
};
|
|
17121
|
+
_runFill(), _runStroke();
|
|
17102
17122
|
}
|
|
17103
17123
|
}
|
|
17104
17124
|
this.afterRenderStep(arc, context, x, y, doFill, doStroke, fVisible, sVisible, arcAttribute, drawContext, fillCb, strokeCb), tempChangeConicalColor && (fill.startAngle += conicalOffset, fill.endAngle += conicalOffset);
|
|
@@ -17136,7 +17156,8 @@
|
|
|
17136
17156
|
startAngle = circleAttribute.startAngle,
|
|
17137
17157
|
endAngle = circleAttribute.endAngle,
|
|
17138
17158
|
x: originX = circleAttribute.x,
|
|
17139
|
-
y: originY = circleAttribute.y
|
|
17159
|
+
y: originY = circleAttribute.y,
|
|
17160
|
+
fillStrokeOrder = circleAttribute.fillStrokeOrder
|
|
17140
17161
|
} = circle.attribute,
|
|
17141
17162
|
data = this.valid(circle, circleAttribute, fillCb, strokeCb);
|
|
17142
17163
|
if (!data) return;
|
|
@@ -17146,7 +17167,14 @@
|
|
|
17146
17167
|
doFill: doFill,
|
|
17147
17168
|
doStroke: doStroke
|
|
17148
17169
|
} = data;
|
|
17149
|
-
context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb)
|
|
17170
|
+
context.beginPath(), context.arc(x, y, radius, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), this.beforeRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
|
|
17171
|
+
const _runFill = () => {
|
|
17172
|
+
doFill && (fillCb ? fillCb(context, circle.attribute, circleAttribute) : fVisible && (context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.fill()));
|
|
17173
|
+
},
|
|
17174
|
+
_runStroke = () => {
|
|
17175
|
+
doStroke && (strokeCb ? strokeCb(context, circle.attribute, circleAttribute) : sVisible && (context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute), context.stroke()));
|
|
17176
|
+
};
|
|
17177
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(circle, context, x, y, doFill, doStroke, fVisible, sVisible, circleAttribute, drawContext, fillCb, strokeCb);
|
|
17150
17178
|
}
|
|
17151
17179
|
draw(circle, renderService, drawContext, params) {
|
|
17152
17180
|
const circleAttribute = getTheme$1(circle, null == params ? void 0 : params.theme).circle;
|
|
@@ -17587,7 +17615,7 @@
|
|
|
17587
17615
|
super(), this.areaRenderContribitions = areaRenderContribitions, this.numberType = AREA_NUMBER_TYPE, this.builtinContributions = [defaultAreaTextureRenderContribution, defaultAreaBackgroundRenderContribution], this.init(areaRenderContribitions);
|
|
17588
17616
|
}
|
|
17589
17617
|
drawLinearAreaHighPerformance(area, context, fill, stroke, fillOpacity, strokeOpacity, offsetX, offsetY, areaAttribute, drawContext, params, fillCb, strokeCb) {
|
|
17590
|
-
var _a, _b, _c
|
|
17618
|
+
var _a, _b, _c;
|
|
17591
17619
|
const {
|
|
17592
17620
|
points: points
|
|
17593
17621
|
} = area.attribute;
|
|
@@ -17611,28 +17639,31 @@
|
|
|
17611
17639
|
x: originX = 0,
|
|
17612
17640
|
x: originY = 0
|
|
17613
17641
|
} = area.attribute;
|
|
17614
|
-
|
|
17642
|
+
!1 !== fill && (fillCb ? fillCb(context, area.attribute, areaAttribute) : fillOpacity && (context.setCommonStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, areaAttribute, drawContext, fillCb, null, {
|
|
17615
17643
|
attribute: area.attribute
|
|
17616
|
-
}),
|
|
17617
|
-
|
|
17618
|
-
|
|
17619
|
-
|
|
17620
|
-
|
|
17621
|
-
|
|
17622
|
-
|
|
17623
|
-
|
|
17624
|
-
|
|
17625
|
-
|
|
17626
|
-
|
|
17627
|
-
|
|
17628
|
-
|
|
17629
|
-
|
|
17630
|
-
|
|
17631
|
-
|
|
17644
|
+
}), (() => {
|
|
17645
|
+
var _a, _b;
|
|
17646
|
+
if (stroke) {
|
|
17647
|
+
const {
|
|
17648
|
+
stroke = areaAttribute && areaAttribute.stroke
|
|
17649
|
+
} = area.attribute;
|
|
17650
|
+
if (isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1]) if (context.beginPath(), stroke[0]) {
|
|
17651
|
+
context.moveTo(startP.x + offsetX, startP.y + offsetY, z);
|
|
17652
|
+
for (let i = 1; i < points.length; i++) {
|
|
17653
|
+
const p = points[i];
|
|
17654
|
+
context.lineTo(p.x + offsetX, p.y + offsetY, z);
|
|
17655
|
+
}
|
|
17656
|
+
} else if (stroke[2]) {
|
|
17657
|
+
const endP = points[points.length - 1];
|
|
17658
|
+
context.moveTo(endP.x + offsetX, endP.y + offsetY, z);
|
|
17659
|
+
for (let i = points.length - 2; i >= 0; i--) {
|
|
17660
|
+
const p = points[i];
|
|
17661
|
+
context.lineTo((null !== (_a = p.x1) && void 0 !== _a ? _a : p.x) + offsetX, (null !== (_b = p.y1) && void 0 !== _b ? _b : p.y) + offsetY, z);
|
|
17662
|
+
}
|
|
17632
17663
|
}
|
|
17664
|
+
strokeCb ? strokeCb(context, area.attribute, areaAttribute) : (context.setStrokeStyle(area, area.attribute, originX - offsetX, originY - offsetY, areaAttribute), context.stroke());
|
|
17633
17665
|
}
|
|
17634
|
-
|
|
17635
|
-
}
|
|
17666
|
+
})();
|
|
17636
17667
|
}
|
|
17637
17668
|
drawShape(area, context, x, y, drawContext, params, fillCb, strokeCb) {
|
|
17638
17669
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -17797,23 +17828,24 @@
|
|
|
17797
17828
|
x: originX = 0,
|
|
17798
17829
|
x: originY = 0
|
|
17799
17830
|
} = attribute;
|
|
17800
|
-
|
|
17831
|
+
return !1 !== fill && (fillCb ? fillCb(context, attribute, defaultAttribute) : fillOpacity && (context.setCommonStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.fill())), this.afterRenderStep(area, context, offsetX, offsetY, !!fillOpacity, !1, fill, !1, defaultAttribute, drawContext, fillCb, null, {
|
|
17801
17832
|
attribute: attribute
|
|
17802
|
-
}),
|
|
17803
|
-
|
|
17804
|
-
|
|
17805
|
-
|
|
17806
|
-
|
|
17807
|
-
|
|
17808
|
-
|
|
17809
|
-
|
|
17810
|
-
|
|
17811
|
-
|
|
17812
|
-
|
|
17813
|
-
|
|
17814
|
-
|
|
17815
|
-
|
|
17816
|
-
|
|
17833
|
+
}), (() => {
|
|
17834
|
+
if (!1 !== stroke) if (strokeCb) strokeCb(context, attribute, defaultAttribute);else {
|
|
17835
|
+
const {
|
|
17836
|
+
stroke = defaultAttribute && defaultAttribute[1] && defaultAttribute[1].stroke
|
|
17837
|
+
} = attribute;
|
|
17838
|
+
isArray$1(stroke) && (stroke[0] || stroke[2]) && !1 === stroke[1] && (context.beginPath(), drawSegments(context.camera ? context : context.nativeContext, stroke[0] ? cache.top : cache.bottom, clipRange, direction === Direction$1.ROW ? "x" : "y", {
|
|
17839
|
+
offsetX: offsetX,
|
|
17840
|
+
offsetY: offsetY,
|
|
17841
|
+
offsetZ: offsetZ,
|
|
17842
|
+
drawConnect: connect,
|
|
17843
|
+
mode: connectedType,
|
|
17844
|
+
zeroX: connectedX,
|
|
17845
|
+
zeroY: connectedY
|
|
17846
|
+
})), context.setStrokeStyle(area, connect ? connectedStyle : attribute, originX - offsetX, originY - offsetY, connect ? da : defaultAttribute), context.stroke();
|
|
17847
|
+
}
|
|
17848
|
+
})(), !1;
|
|
17817
17849
|
}
|
|
17818
17850
|
};
|
|
17819
17851
|
DefaultCanvasAreaRender = __decorate$1o([injectable(), __param$I(0, inject(ContributionProvider)), __param$I(0, named(AreaRenderContribution)), __metadata$13("design:paramtypes", [Object])], DefaultCanvasAreaRender);
|
|
@@ -17845,7 +17877,8 @@
|
|
|
17845
17877
|
const pathAttribute = null !== (_a = this.tempTheme) && void 0 !== _a ? _a : getTheme$1(path, null == params ? void 0 : params.theme).path,
|
|
17846
17878
|
{
|
|
17847
17879
|
x: originX = pathAttribute.x,
|
|
17848
|
-
y: originY = pathAttribute.y
|
|
17880
|
+
y: originY = pathAttribute.y,
|
|
17881
|
+
fillStrokeOrder = pathAttribute.fillStrokeOrder
|
|
17849
17882
|
} = path.attribute,
|
|
17850
17883
|
z = null !== (_b = this.z) && void 0 !== _b ? _b : 0,
|
|
17851
17884
|
data = this.valid(path, pathAttribute, fillCb, strokeCb);
|
|
@@ -17860,7 +17893,14 @@
|
|
|
17860
17893
|
const path2D = null !== (_c = path.attribute.path) && void 0 !== _c ? _c : pathAttribute.path;
|
|
17861
17894
|
renderCommandList(path2D.commandList, context, x, y, 1, 1, z);
|
|
17862
17895
|
}
|
|
17863
|
-
context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute), this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb)
|
|
17896
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute), this.beforeRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
|
|
17897
|
+
const _runStroke = () => {
|
|
17898
|
+
doStroke && (strokeCb ? strokeCb(context, path.attribute, pathAttribute) : sVisible && (context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.stroke()));
|
|
17899
|
+
},
|
|
17900
|
+
_runFill = () => {
|
|
17901
|
+
doFill && (fillCb ? fillCb(context, path.attribute, pathAttribute) : fVisible && (context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute), context.fill()));
|
|
17902
|
+
};
|
|
17903
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(path, context, x, y, doFill, doStroke, fVisible, sVisible, pathAttribute, drawContext, fillCb, strokeCb);
|
|
17864
17904
|
}
|
|
17865
17905
|
draw(path, renderService, drawContext, params) {
|
|
17866
17906
|
const pathAttribute = getTheme$1(path, null == params ? void 0 : params.theme).path;
|
|
@@ -17904,7 +17944,8 @@
|
|
|
17904
17944
|
x1: x1,
|
|
17905
17945
|
y1: y1,
|
|
17906
17946
|
x: originX = rectAttribute.x,
|
|
17907
|
-
y: originY = rectAttribute.y
|
|
17947
|
+
y: originY = rectAttribute.y,
|
|
17948
|
+
fillStrokeOrder = rectAttribute.fillStrokeOrder
|
|
17908
17949
|
} = rect.attribute;
|
|
17909
17950
|
let {
|
|
17910
17951
|
width: width,
|
|
@@ -17923,7 +17964,14 @@
|
|
|
17923
17964
|
doFill: doFill,
|
|
17924
17965
|
doStroke: doStroke
|
|
17925
17966
|
};
|
|
17926
|
-
context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke)
|
|
17967
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute), this.beforeRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
|
|
17968
|
+
const _runFill = () => {
|
|
17969
|
+
doFillOrStroke.doFill && (fillCb ? fillCb(context, rect.attribute, rectAttribute) : fVisible && (context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.fill()));
|
|
17970
|
+
},
|
|
17971
|
+
_runStroke = () => {
|
|
17972
|
+
doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, rect.attribute, rectAttribute) : sVisible && (context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute), context.stroke()));
|
|
17973
|
+
};
|
|
17974
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
|
|
17927
17975
|
}
|
|
17928
17976
|
draw(rect, renderService, drawContext, params) {
|
|
17929
17977
|
const rectAttribute = getTheme$1(rect, null == params ? void 0 : params.theme).rect;
|
|
@@ -17959,7 +18007,8 @@
|
|
|
17959
18007
|
x: originX = symbolAttribute.x,
|
|
17960
18008
|
y: originY = symbolAttribute.y,
|
|
17961
18009
|
scaleX = symbolAttribute.scaleX,
|
|
17962
|
-
scaleY = symbolAttribute.scaleY
|
|
18010
|
+
scaleY = symbolAttribute.scaleY,
|
|
18011
|
+
fillStrokeOrder = symbolAttribute.fillStrokeOrder
|
|
17963
18012
|
} = symbol.attribute,
|
|
17964
18013
|
data = this.valid(symbol, symbolAttribute, fillCb, strokeCb);
|
|
17965
18014
|
if (!data) return;
|
|
@@ -17982,14 +18031,27 @@
|
|
|
17982
18031
|
const obj = Object.assign({}, a);
|
|
17983
18032
|
obj.fill = null !== (_a = a.fill) && void 0 !== _a ? _a : symbol.attribute.fill, obj.opacity = null !== (_b = a.opacity) && void 0 !== _b ? _b : symbol.attribute.opacity, obj.fillOpacity = symbol.attribute.fillOpacity, obj.stroke = null !== (_c = a.stroke) && void 0 !== _c ? _c : symbol.attribute.stroke, a = obj;
|
|
17984
18033
|
}
|
|
17985
|
-
|
|
18034
|
+
const _runFill = () => {
|
|
18035
|
+
a.fill && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : (context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute), context.fill()));
|
|
18036
|
+
},
|
|
18037
|
+
_runStroke = () => {
|
|
18038
|
+
a.stroke && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : (context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
|
|
18039
|
+
};
|
|
18040
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke());
|
|
17986
18041
|
};
|
|
17987
18042
|
if (keepDirIn3d && context.camera && context.project) {
|
|
17988
18043
|
const p = context.project(x, y, z),
|
|
17989
18044
|
camera = context.camera;
|
|
17990
18045
|
context.camera = null, !1 === parsedPath.draw(context, isArray$1(size) ? [size[0] * scaleX, size[1] * scaleY] : size * scaleX, p.x, p.y, void 0, callback) && context.closePath(), context.camera = camera;
|
|
17991
18046
|
} else !1 === parsedPath.draw(context, size, x, y, z, callback) && context.closePath();
|
|
17992
|
-
context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb)
|
|
18047
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), this.beforeRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
|
|
18048
|
+
const _runFill = () => {
|
|
18049
|
+
doFill && !parsedPath.isSvg && (fillCb ? fillCb(context, symbol.attribute, symbolAttribute) : fVisible && (context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute), context.fill()));
|
|
18050
|
+
},
|
|
18051
|
+
_runStroke = () => {
|
|
18052
|
+
doStroke && !parsedPath.isSvg && (strokeCb ? strokeCb(context, symbol.attribute, symbolAttribute) : sVisible && (context.setStrokeStyle(symbol, symbol.attribute, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute), context.stroke()));
|
|
18053
|
+
};
|
|
18054
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb);
|
|
17993
18055
|
}
|
|
17994
18056
|
draw(symbol, renderService, drawContext, params) {
|
|
17995
18057
|
const symbolAttribute = getTheme$1(symbol, null == params ? void 0 : params.theme).symbol;
|
|
@@ -18366,7 +18428,8 @@
|
|
|
18366
18428
|
cornerRadius = polygonAttribute.cornerRadius,
|
|
18367
18429
|
x: originX = polygonAttribute.x,
|
|
18368
18430
|
y: originY = polygonAttribute.y,
|
|
18369
|
-
closePath = polygonAttribute.closePath
|
|
18431
|
+
closePath = polygonAttribute.closePath,
|
|
18432
|
+
fillStrokeOrder = polygonAttribute.fillStrokeOrder
|
|
18370
18433
|
} = polygon.attribute,
|
|
18371
18434
|
data = this.valid(polygon, polygonAttribute, fillCb, strokeCb);
|
|
18372
18435
|
if (!data) return;
|
|
@@ -18376,7 +18439,14 @@
|
|
|
18376
18439
|
doFill: doFill,
|
|
18377
18440
|
doStroke: doStroke
|
|
18378
18441
|
} = data;
|
|
18379
|
-
context.beginPath(), cornerRadius <= 0 || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath), closePath && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute), this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb)
|
|
18442
|
+
context.beginPath(), cornerRadius <= 0 || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) ? drawPolygon(context.camera ? context : context.nativeContext, points, x, y) : drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath), closePath && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute), this.beforeRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
|
|
18443
|
+
const _runFill = () => {
|
|
18444
|
+
doFill && (fillCb ? fillCb(context, polygon.attribute, polygonAttribute) : fVisible && (context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.fill()));
|
|
18445
|
+
},
|
|
18446
|
+
_runStroke = () => {
|
|
18447
|
+
doStroke && (strokeCb ? strokeCb(context, polygon.attribute, polygonAttribute) : sVisible && (context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute), context.stroke()));
|
|
18448
|
+
};
|
|
18449
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(polygon, context, x, y, doFill, doStroke, fVisible, sVisible, polygonAttribute, drawContext, fillCb, strokeCb);
|
|
18380
18450
|
}
|
|
18381
18451
|
draw(polygon, renderService, drawContext, params) {
|
|
18382
18452
|
const polygonAttribute = getTheme$1(polygon, null == params ? void 0 : params.theme).polygon;
|
|
@@ -18419,7 +18489,8 @@
|
|
|
18419
18489
|
cornerRadius = groupAttribute.cornerRadius,
|
|
18420
18490
|
path = groupAttribute.path,
|
|
18421
18491
|
lineWidth = groupAttribute.lineWidth,
|
|
18422
|
-
visible = groupAttribute.visible
|
|
18492
|
+
visible = groupAttribute.visible,
|
|
18493
|
+
fillStrokeOrder = groupAttribute.fillStrokeOrder
|
|
18423
18494
|
} = group.attribute,
|
|
18424
18495
|
fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill),
|
|
18425
18496
|
sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height),
|
|
@@ -18445,7 +18516,14 @@
|
|
|
18445
18516
|
};
|
|
18446
18517
|
this._groupRenderContribitions.forEach(c => {
|
|
18447
18518
|
c.time === BaseRenderContributionTime.beforeFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb, doFillOrStroke);
|
|
18448
|
-
}), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute)
|
|
18519
|
+
}), clip && context.clip(), context.setShadowBlendStyle && context.setShadowBlendStyle(group, group.attribute, groupAttribute);
|
|
18520
|
+
const _runFill = () => {
|
|
18521
|
+
doFillOrStroke.doFill && (fillCb ? fillCb(context, group.attribute, groupAttribute) : fVisible && (context.setCommonStyle(group, group.attribute, x, y, groupAttribute), context.fill()));
|
|
18522
|
+
},
|
|
18523
|
+
_runStroke = () => {
|
|
18524
|
+
doFillOrStroke.doStroke && (strokeCb ? strokeCb(context, group.attribute, groupAttribute) : sVisible && (context.setStrokeStyle(group, group.attribute, x, y, groupAttribute), context.stroke()));
|
|
18525
|
+
};
|
|
18526
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this._groupRenderContribitions.forEach(c => {
|
|
18449
18527
|
c.time === BaseRenderContributionTime.afterFillStroke && c.drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb);
|
|
18450
18528
|
});
|
|
18451
18529
|
}
|
|
@@ -18511,6 +18589,7 @@
|
|
|
18511
18589
|
x: originX = imageAttribute.x,
|
|
18512
18590
|
y: originY = imageAttribute.y,
|
|
18513
18591
|
cornerRadius = imageAttribute.cornerRadius,
|
|
18592
|
+
fillStrokeOrder = imageAttribute.fillStrokeOrder,
|
|
18514
18593
|
image: url
|
|
18515
18594
|
} = image.attribute,
|
|
18516
18595
|
data = this.valid(image, imageAttribute, fillCb);
|
|
@@ -18521,20 +18600,26 @@
|
|
|
18521
18600
|
doFill: doFill,
|
|
18522
18601
|
doStroke: doStroke
|
|
18523
18602
|
} = data;
|
|
18524
|
-
|
|
18525
|
-
|
|
18526
|
-
|
|
18527
|
-
|
|
18528
|
-
|
|
18529
|
-
|
|
18530
|
-
|
|
18531
|
-
|
|
18532
|
-
|
|
18533
|
-
|
|
18534
|
-
|
|
18535
|
-
|
|
18536
|
-
|
|
18537
|
-
|
|
18603
|
+
context.setShadowBlendStyle && context.setShadowBlendStyle(image, imageAttribute), this.beforeRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
|
|
18604
|
+
const _runFill = () => {
|
|
18605
|
+
if (doFill) if (fillCb) fillCb(context, image.attribute, imageAttribute);else if (fVisible) {
|
|
18606
|
+
if (!url || !image.resources) return;
|
|
18607
|
+
const res = image.resources.get(url);
|
|
18608
|
+
if ("success" !== res.state) return;
|
|
18609
|
+
let needRestore = !1;
|
|
18610
|
+
0 === cornerRadius || isArray$1(cornerRadius) && cornerRadius.every(num => 0 === num) || (context.beginPath(), createRectPath(context, x, y, width, height, cornerRadius), context.save(), context.clip(), needRestore = !0), context.setCommonStyle(image, image.attribute, x, y, imageAttribute);
|
|
18611
|
+
let repeat = 0;
|
|
18612
|
+
if ("repeat" === repeatX && (repeat |= 1), "repeat" === repeatY && (repeat |= 2), repeat) {
|
|
18613
|
+
const pattern = context.createPattern(res.data, repeatStr[repeat]);
|
|
18614
|
+
context.fillStyle = pattern, context.translate(x, y, !0), context.fillRect(0, 0, width, height), context.translate(-x, -y, !0);
|
|
18615
|
+
} else context.drawImage(res.data, x, y, width, height);
|
|
18616
|
+
needRestore && context.restore();
|
|
18617
|
+
}
|
|
18618
|
+
},
|
|
18619
|
+
_runStroke = () => {
|
|
18620
|
+
doStroke && (strokeCb ? strokeCb(context, image.attribute, imageAttribute) : sVisible && (context.setStrokeStyle(image, image.attribute, originX - x, originY - y, imageAttribute), context.stroke()));
|
|
18621
|
+
};
|
|
18622
|
+
fillStrokeOrder ? (_runStroke(), _runFill()) : (_runFill(), _runStroke()), this.afterRenderStep(image, context, x, y, doFill, !1, fVisible, !1, imageAttribute, drawContext, fillCb);
|
|
18538
18623
|
}
|
|
18539
18624
|
draw(image, renderService, drawContext) {
|
|
18540
18625
|
const {
|
|
@@ -31535,27 +31620,27 @@
|
|
|
31535
31620
|
scale = _ => ~~(_ / ratio);
|
|
31536
31621
|
return scale.bitmap = () => bitmap(w, h), scale.x = _ => ~~((_ + left) / ratio), scale.y = _ => ~~((_ + top) / ratio), scale.ratio = ratio, scale.padding = padding, scale.width = width, scale.height = height, scale;
|
|
31537
31622
|
}
|
|
31623
|
+
function clampRangeByBitmap($, range) {
|
|
31624
|
+
const {
|
|
31625
|
+
x1: x1,
|
|
31626
|
+
x2: x2,
|
|
31627
|
+
y1: y1,
|
|
31628
|
+
y2: y2
|
|
31629
|
+
} = range,
|
|
31630
|
+
_x1 = clamp$1(x1, 0, $.width),
|
|
31631
|
+
_x2 = clamp$1(x2, 0, $.width),
|
|
31632
|
+
_y1 = clamp$1(y1, 0, $.height),
|
|
31633
|
+
_y2 = clamp$1(y2, 0, $.height);
|
|
31634
|
+
return {
|
|
31635
|
+
x1: $.x(_x1),
|
|
31636
|
+
x2: $.x(_x2),
|
|
31637
|
+
y1: $.y(_y1),
|
|
31638
|
+
y2: $.y(_y2)
|
|
31639
|
+
};
|
|
31640
|
+
}
|
|
31538
31641
|
function boundToRange($, bound) {
|
|
31539
31642
|
let clamp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
31540
|
-
|
|
31541
|
-
const {
|
|
31542
|
-
x1: x1,
|
|
31543
|
-
x2: x2,
|
|
31544
|
-
y1: y1,
|
|
31545
|
-
y2: y2
|
|
31546
|
-
} = bound,
|
|
31547
|
-
_x1 = clamp$1(x1, 0, $.width),
|
|
31548
|
-
_x2 = clamp$1(x2, 0, $.width),
|
|
31549
|
-
_y1 = clamp$1(y1, 0, $.height),
|
|
31550
|
-
_y2 = clamp$1(y2, 0, $.height);
|
|
31551
|
-
return {
|
|
31552
|
-
x1: $.x(_x1),
|
|
31553
|
-
x2: $.x(_x2),
|
|
31554
|
-
y1: $.y(_y1),
|
|
31555
|
-
y2: $.y(_y2)
|
|
31556
|
-
};
|
|
31557
|
-
}
|
|
31558
|
-
return {
|
|
31643
|
+
return clamp ? clampRangeByBitmap($, bound) : {
|
|
31559
31644
|
x1: $.x(bound.x1),
|
|
31560
31645
|
x2: $.x(bound.x2),
|
|
31561
31646
|
y1: $.y(bound.y1),
|
|
@@ -31573,7 +31658,8 @@
|
|
|
31573
31658
|
y1: bound.y1 - pad,
|
|
31574
31659
|
y2: bound.y2 + pad
|
|
31575
31660
|
}), range = boundToRange($, range);
|
|
31576
|
-
|
|
31661
|
+
const outOfBounds = bitmap.outOfBounds(range);
|
|
31662
|
+
return (!checkBound || !outOfBounds) && (outOfBounds && (range = clampRangeByBitmap($, range)), !bitmap.getRange(range));
|
|
31577
31663
|
}
|
|
31578
31664
|
function placeToCandidates($, bitmap, text) {
|
|
31579
31665
|
let candidates = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
@@ -31926,6 +32012,73 @@
|
|
|
31926
32012
|
registerGroup(), registerText(), registerRichtext(), registerLine();
|
|
31927
32013
|
}
|
|
31928
32014
|
|
|
32015
|
+
function shiftY(texts) {
|
|
32016
|
+
let option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
32017
|
+
const {
|
|
32018
|
+
maxIterations = 10,
|
|
32019
|
+
maxError = .1,
|
|
32020
|
+
padding = 1,
|
|
32021
|
+
maxY = Number.MAX_VALUE
|
|
32022
|
+
} = option,
|
|
32023
|
+
n = texts.length;
|
|
32024
|
+
if (n <= 1) return texts;
|
|
32025
|
+
const isIntersect = (_ref, _ref2) => {
|
|
32026
|
+
let [a, b] = _ref;
|
|
32027
|
+
let [c, d] = _ref2;
|
|
32028
|
+
return d > a && b > c;
|
|
32029
|
+
},
|
|
32030
|
+
textInformation = new Map(),
|
|
32031
|
+
getY0 = text => textInformation.get(text).y0,
|
|
32032
|
+
getY = text => textInformation.get(text).y,
|
|
32033
|
+
getHeight = text => textInformation.get(text).height,
|
|
32034
|
+
getX1 = text => textInformation.get(text).x1,
|
|
32035
|
+
getX2 = text => textInformation.get(text).x2,
|
|
32036
|
+
setY = (text, y) => {
|
|
32037
|
+
textInformation.get(text).y = y;
|
|
32038
|
+
};
|
|
32039
|
+
for (const text of texts) {
|
|
32040
|
+
const {
|
|
32041
|
+
y1: y1,
|
|
32042
|
+
y2: y2,
|
|
32043
|
+
x1: x1,
|
|
32044
|
+
x2: x2
|
|
32045
|
+
} = text.AABBBounds;
|
|
32046
|
+
textInformation.set(text, {
|
|
32047
|
+
y0: y1,
|
|
32048
|
+
y: y1,
|
|
32049
|
+
height: y2 - y1,
|
|
32050
|
+
x1: x1,
|
|
32051
|
+
x2: x2
|
|
32052
|
+
});
|
|
32053
|
+
}
|
|
32054
|
+
for (let iter = 0; iter < maxIterations; iter++) {
|
|
32055
|
+
texts.sort((a, b) => getY(a) - getY(b));
|
|
32056
|
+
let error = 0;
|
|
32057
|
+
for (let i = 0; i < n - 1; i++) {
|
|
32058
|
+
const curText = texts[i];
|
|
32059
|
+
let nextText,
|
|
32060
|
+
j = i + 1;
|
|
32061
|
+
for (; (nextText = texts[j]) && !isIntersect([getX1(curText), getX2(curText)], [getX1(nextText), getX2(nextText)]);) j += 1;
|
|
32062
|
+
if (nextText) {
|
|
32063
|
+
const y0 = getY(curText),
|
|
32064
|
+
h0 = getHeight(curText),
|
|
32065
|
+
y1 = getY(nextText),
|
|
32066
|
+
delta = y1 - (y0 + h0);
|
|
32067
|
+
if (delta < padding) {
|
|
32068
|
+
const newDelta = (padding - delta) / 2;
|
|
32069
|
+
error = Math.max(error, newDelta), y1 + newDelta + getHeight(nextText) > maxY ? setY(curText, y0 - (padding - delta)) : y0 - newDelta < 0 ? setY(nextText, y1 + (padding - delta)) : (setY(curText, y0 - newDelta), setY(nextText, y1 + newDelta));
|
|
32070
|
+
}
|
|
32071
|
+
}
|
|
32072
|
+
}
|
|
32073
|
+
if (error < maxError) break;
|
|
32074
|
+
}
|
|
32075
|
+
for (const text of texts) {
|
|
32076
|
+
const finalY = text.attribute.y + getY(text) - getY0(text);
|
|
32077
|
+
text.setAttribute("y", finalY);
|
|
32078
|
+
}
|
|
32079
|
+
return texts;
|
|
32080
|
+
}
|
|
32081
|
+
|
|
31929
32082
|
var __rest$b = undefined && undefined.__rest || function (s, e) {
|
|
31930
32083
|
var t = {};
|
|
31931
32084
|
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]);
|
|
@@ -32132,16 +32285,57 @@
|
|
|
32132
32285
|
return texts;
|
|
32133
32286
|
}
|
|
32134
32287
|
_overlapping(labels) {
|
|
32135
|
-
var _a, _b, _c
|
|
32288
|
+
var _a, _b, _c;
|
|
32136
32289
|
if (0 === labels.length) return [];
|
|
32137
32290
|
const option = isObject$2(this.attribute.overlap) ? this.attribute.overlap : {},
|
|
32138
|
-
result = [],
|
|
32139
32291
|
baseMarkGroup = this.getBaseMarkGroup(),
|
|
32140
32292
|
size = null !== (_a = option.size) && void 0 !== _a ? _a : {
|
|
32141
32293
|
width: null !== (_b = null == baseMarkGroup ? void 0 : baseMarkGroup.AABBBounds.width()) && void 0 !== _b ? _b : 0,
|
|
32142
32294
|
height: null !== (_c = null == baseMarkGroup ? void 0 : baseMarkGroup.AABBBounds.height()) && void 0 !== _c ? _c : 0
|
|
32143
32295
|
};
|
|
32144
32296
|
if (0 === size.width || 0 === size.height) return labels;
|
|
32297
|
+
const {
|
|
32298
|
+
strategy: strategy,
|
|
32299
|
+
priority: priority
|
|
32300
|
+
} = option,
|
|
32301
|
+
bmpTool = this._bmpTool || bitmapTool(size.width, size.height),
|
|
32302
|
+
bitmap = this._bitmap || bmpTool.bitmap();
|
|
32303
|
+
return priority && (labels = labels.sort((a, b) => priority(b.attribute.data) - priority(a.attribute.data))), "shiftY" === (null == strategy ? void 0 : strategy.type) ? this._overlapGlobal(labels, option, bmpTool, bitmap) : this._overlapByStrategy(labels, option, bmpTool, bitmap);
|
|
32304
|
+
}
|
|
32305
|
+
_overlapGlobal(labels, option, bmpTool, bitmap) {
|
|
32306
|
+
let result = labels.filter(label => label.attribute.visible && 0 !== label.attribute.opacity);
|
|
32307
|
+
const {
|
|
32308
|
+
clampForce = !0,
|
|
32309
|
+
hideOnHit = !0,
|
|
32310
|
+
overlapPadding: overlapPadding,
|
|
32311
|
+
strategy: strategy
|
|
32312
|
+
} = option;
|
|
32313
|
+
if (clampForce) for (let i = 0; i < result.length; i++) {
|
|
32314
|
+
const text = labels[i],
|
|
32315
|
+
{
|
|
32316
|
+
dx = 0,
|
|
32317
|
+
dy = 0
|
|
32318
|
+
} = clampText(text, bmpTool.width, bmpTool.height);
|
|
32319
|
+
0 === dx && 0 === dy || text.setAttributes({
|
|
32320
|
+
x: text.attribute.x + dx,
|
|
32321
|
+
y: text.attribute.y + dy
|
|
32322
|
+
});
|
|
32323
|
+
}
|
|
32324
|
+
result = shiftY(result, Object.assign({
|
|
32325
|
+
maxY: bmpTool.height
|
|
32326
|
+
}, strategy));
|
|
32327
|
+
for (let i = 0; i < result.length; i++) {
|
|
32328
|
+
const text = result[i],
|
|
32329
|
+
bounds = text.AABBBounds,
|
|
32330
|
+
range = boundToRange(bmpTool, bounds, !0);
|
|
32331
|
+
canPlace(bmpTool, bitmap, bounds, clampForce, overlapPadding) ? bitmap.setRange(range) : hideOnHit ? text.setAttributes({
|
|
32332
|
+
visible: !1
|
|
32333
|
+
}) : bitmap.setRange(range);
|
|
32334
|
+
}
|
|
32335
|
+
return result;
|
|
32336
|
+
}
|
|
32337
|
+
_overlapByStrategy(labels, option, bmpTool, bitmap) {
|
|
32338
|
+
var _a;
|
|
32145
32339
|
const {
|
|
32146
32340
|
avoidBaseMark: avoidBaseMark,
|
|
32147
32341
|
strategy = [],
|
|
@@ -32150,10 +32344,9 @@
|
|
|
32150
32344
|
avoidMarks = [],
|
|
32151
32345
|
overlapPadding: overlapPadding
|
|
32152
32346
|
} = option,
|
|
32153
|
-
|
|
32154
|
-
bitmap = this._bitmap || bmpTool.bitmap(),
|
|
32347
|
+
result = [],
|
|
32155
32348
|
checkBounds = strategy.some(s => "bound" === s.type);
|
|
32156
|
-
avoidBaseMark && (null === (
|
|
32349
|
+
avoidBaseMark && (null === (_a = this._baseMarks) || void 0 === _a || _a.forEach(mark => {
|
|
32157
32350
|
mark.AABBBounds && bitmap.setRange(boundToRange(bmpTool, mark.AABBBounds, !0));
|
|
32158
32351
|
})), avoidMarks.length > 0 && avoidMarks.forEach(avoid => {
|
|
32159
32352
|
isString$1(avoid) ? getNoneGroupMarksByName(this.getRootNode(), avoid).forEach(avoidMark => {
|
|
@@ -32161,7 +32354,7 @@
|
|
|
32161
32354
|
}) : avoid.AABBBounds && bitmap.setRange(boundToRange(bmpTool, avoid.AABBBounds, !0));
|
|
32162
32355
|
});
|
|
32163
32356
|
for (let i = 0; i < labels.length; i++) {
|
|
32164
|
-
if (!1 === labels[i].visible) continue;
|
|
32357
|
+
if (!1 === labels[i].attribute.visible) continue;
|
|
32165
32358
|
const text = labels[i],
|
|
32166
32359
|
baseMark = this.getRelatedGraphic(text.attribute);
|
|
32167
32360
|
if (text.update(), !isRectIntersect(baseMark.AABBBounds, {
|
|
@@ -34042,12 +34235,15 @@
|
|
|
34042
34235
|
do {
|
|
34043
34236
|
items = reduce(items, sep);
|
|
34044
34237
|
} while (items.length >= 3 && hasOverlap$1(items, sep));
|
|
34045
|
-
const shouldCheck = (length, visibility)
|
|
34046
|
-
|
|
34238
|
+
const shouldCheck = function (length, visibility) {
|
|
34239
|
+
let checkLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
|
|
34240
|
+
return checkLength && length < 3 || visibility;
|
|
34241
|
+
},
|
|
34242
|
+
checkFirst = shouldCheck(items.length, config.firstVisible, !1);
|
|
34047
34243
|
let checkLast = shouldCheck(items.length, config.lastVisible);
|
|
34048
34244
|
const firstSourceItem = source[0],
|
|
34049
34245
|
lastSourceItem = last(source);
|
|
34050
|
-
textIntersect(firstSourceItem, lastSourceItem, sep) && (lastSourceItem.setAttribute("opacity", 0), checkLast = !1), forceItemVisible$1(firstSourceItem, items, checkFirst, item => textIntersect(item, firstSourceItem, sep)), forceItemVisible$1(lastSourceItem, items, checkLast, item => textIntersect(item, lastSourceItem, sep) || !(!checkFirst || item === firstSourceItem) && textIntersect(item, firstSourceItem, sep), !0);
|
|
34246
|
+
textIntersect(firstSourceItem, lastSourceItem, sep) && checkFirst && checkLast && (lastSourceItem.setAttribute("opacity", 0), checkLast = !1), forceItemVisible$1(firstSourceItem, items, checkFirst, item => textIntersect(item, firstSourceItem, sep)), forceItemVisible$1(lastSourceItem, items, checkLast, item => textIntersect(item, lastSourceItem, sep) || !(!checkFirst || item === firstSourceItem) && textIntersect(item, firstSourceItem, sep), !0);
|
|
34051
34247
|
}
|
|
34052
34248
|
source.forEach(item => {
|
|
34053
34249
|
item.setAttribute("visible", !!item.attribute.opacity);
|
|
@@ -36271,10 +36467,9 @@
|
|
|
36271
36467
|
lastSourceItem = last(source),
|
|
36272
36468
|
samplingMethod = breakData && breakData() ? methods$1.greedy : methods$1.parity;
|
|
36273
36469
|
for (; items.length >= 3 && hasOverlap$1(items, labelGap);) items = samplingMethod(items, labelGap);
|
|
36274
|
-
const
|
|
36275
|
-
|
|
36276
|
-
|
|
36277
|
-
textIntersect(firstSourceItem, lastSourceItem, labelGap) && items.includes(lastSourceItem) && items.length > 1 && (items.splice(items.indexOf(lastSourceItem), 1), checkLast = !1), forceItemVisible(firstSourceItem, items, checkFirst, item => textIntersect(item, firstSourceItem, labelGap)), forceItemVisible(lastSourceItem, items, checkLast, item => textIntersect(item, lastSourceItem, labelGap) || !(!checkFirst || item === firstSourceItem) && textIntersect(item, firstSourceItem, labelGap), !0);
|
|
36470
|
+
const checkFirst = op.labelFirstVisible;
|
|
36471
|
+
let checkLast = op.labelLastVisible;
|
|
36472
|
+
textIntersect(firstSourceItem, lastSourceItem, labelGap) && items.includes(lastSourceItem) && items.length > 1 && checkFirst && checkLast && (items.splice(items.indexOf(lastSourceItem), 1), checkLast = !1), forceItemVisible(firstSourceItem, items, checkFirst, item => textIntersect(item, firstSourceItem, labelGap)), forceItemVisible(lastSourceItem, items, checkLast, item => textIntersect(item, lastSourceItem, labelGap) || !(!checkFirst || item === firstSourceItem) && textIntersect(item, firstSourceItem, labelGap), !0);
|
|
36278
36473
|
const ticks = items.map(item => item.value);
|
|
36279
36474
|
ticks.length < 3 && labelFlush && (ticks.length > 1 && ticks.pop(), last(ticks) !== last(scaleTicks) && ticks.push(last(scaleTicks))), scaleTicks = ticks;
|
|
36280
36475
|
}
|
|
@@ -47310,7 +47505,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
47310
47505
|
Object.keys(nextGraphicAttributes).forEach(channel => {
|
|
47311
47506
|
prevGraphicAttributes[channel] = this.getGraphicAttribute(channel), finalGraphicAttributes[channel] = nextGraphicAttributes[channel];
|
|
47312
47507
|
}), this.setNextGraphicAttributes(nextGraphicAttributes), this.setPrevGraphicAttributes(prevGraphicAttributes), this.setFinalGraphicAttributes(finalGraphicAttributes);
|
|
47313
|
-
const
|
|
47508
|
+
const currentAnimators = null === (_c = this.mark.animate) || void 0 === _c ? void 0 : _c.getElementAnimators(this).filter(animator => {
|
|
47509
|
+
var _a;
|
|
47510
|
+
return !(null === (_a = animator.animationOptions.timeline.controlOptions) || void 0 === _a ? void 0 : _a.ignoreLoopFinalAttributes) || !animator.animationOptions.timeline.loop;
|
|
47511
|
+
}),
|
|
47512
|
+
animateGraphicAttributes = (currentAnimators || []).reduce((attributes, animator) => Object.assign(attributes, animator.getEndAttributes()), {}),
|
|
47314
47513
|
currentGraphicAttributes = Object.assign({}, animateGraphicAttributes, finalGraphicAttributes);
|
|
47315
47514
|
this.graphicItem.setAttributes(currentGraphicAttributes);
|
|
47316
47515
|
} else this.graphicItem.setAttributes(graphicAttributes);
|
|
@@ -61446,7 +61645,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61446
61645
|
};
|
|
61447
61646
|
registerVChartCore();
|
|
61448
61647
|
|
|
61449
|
-
const version = "1.12.
|
|
61648
|
+
const version = "1.12.9-alpha.1";
|
|
61450
61649
|
|
|
61451
61650
|
const addVChartProperty = (data, op) => {
|
|
61452
61651
|
const context = op.beforeCall();
|
|
@@ -61572,7 +61771,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
61572
61771
|
function addContentLine(result, contentSpec, defaultContent, shapeAttrs, datum, params) {
|
|
61573
61772
|
const addByDatum = (spec) => {
|
|
61574
61773
|
if (spec) {
|
|
61575
|
-
const res = {};
|
|
61774
|
+
const res = { datum };
|
|
61576
61775
|
const finalSpec = isNil$1(spec.key) && isNil$1(spec.value) && !isEmpty(spec)
|
|
61577
61776
|
? Object.assign(Object.assign(Object.assign({}, shapeAttrs), defaultContent), spec) : Object.assign(Object.assign({}, shapeAttrs), spec);
|
|
61578
61777
|
Object.keys(finalSpec).forEach(k => {
|
|
@@ -72164,6 +72363,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
72164
72363
|
(_b = this._data) === null || _b === void 0 ? void 0 : _b.getDataView().target.addListener('change', mapData.reRunAllTransform);
|
|
72165
72364
|
this._mapViewData = new SeriesData(this._option, mapData);
|
|
72166
72365
|
}
|
|
72366
|
+
compileData() {
|
|
72367
|
+
var _a;
|
|
72368
|
+
super.compileData();
|
|
72369
|
+
(_a = this._mapViewData) === null || _a === void 0 ? void 0 : _a.compile();
|
|
72370
|
+
}
|
|
72167
72371
|
initMark() {
|
|
72168
72372
|
this._pathMark = this._createMark(MapSeries.mark.area, {
|
|
72169
72373
|
morph: shouldMarkDoMorph(this._spec, MapSeries.mark.area.name),
|
|
@@ -73165,6 +73369,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
73165
73369
|
}
|
|
73166
73370
|
}, false);
|
|
73167
73371
|
}
|
|
73372
|
+
compileData() {
|
|
73373
|
+
var _a;
|
|
73374
|
+
super.compileData();
|
|
73375
|
+
(_a = this._totalData) === null || _a === void 0 ? void 0 : _a.compile();
|
|
73376
|
+
}
|
|
73168
73377
|
initAnimation() {
|
|
73169
73378
|
var _a, _b, _c, _e;
|
|
73170
73379
|
const waterfallAnimationParams = {
|
|
@@ -73704,6 +73913,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
73704
73913
|
}, false);
|
|
73705
73914
|
this._outlierDataView = new SeriesData(this._option, outlierDataView);
|
|
73706
73915
|
}
|
|
73916
|
+
compileData() {
|
|
73917
|
+
var _a;
|
|
73918
|
+
super.compileData();
|
|
73919
|
+
(_a = this._outlierDataView) === null || _a === void 0 ? void 0 : _a.compile();
|
|
73920
|
+
}
|
|
73707
73921
|
init(option) {
|
|
73708
73922
|
super.init(option);
|
|
73709
73923
|
this.initBoxPlotMarkStyle();
|
|
@@ -74989,6 +75203,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
74989
75203
|
});
|
|
74990
75204
|
this._viewDataLabel = new SeriesData(this._option, viewDataLabel);
|
|
74991
75205
|
}
|
|
75206
|
+
compileData() {
|
|
75207
|
+
var _a;
|
|
75208
|
+
super.compileData();
|
|
75209
|
+
(_a = this._viewDataLabel) === null || _a === void 0 ? void 0 : _a.compile();
|
|
75210
|
+
}
|
|
74992
75211
|
initMark() {
|
|
74993
75212
|
var _a, _b;
|
|
74994
75213
|
this._pieMark = this._createMark(Object.assign(Object.assign({}, BasePieSeries.mark.pie), { name: this._pieMarkName, type: this._pieMarkType }), {
|
|
@@ -80362,6 +80581,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80362
80581
|
});
|
|
80363
80582
|
this._viewDataTransform = new SeriesData(this._option, viewDataTransform);
|
|
80364
80583
|
}
|
|
80584
|
+
compileData() {
|
|
80585
|
+
var _a;
|
|
80586
|
+
super.compileData();
|
|
80587
|
+
(_a = this._viewDataTransform) === null || _a === void 0 ? void 0 : _a.compile();
|
|
80588
|
+
}
|
|
80365
80589
|
getStatisticFields() {
|
|
80366
80590
|
const fields = [];
|
|
80367
80591
|
fields.push({ key: this._categoryField, operations: ['values'] });
|
|
@@ -80834,40 +81058,40 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80834
81058
|
return { x, y, align: textAlign, textBaseline };
|
|
80835
81059
|
}
|
|
80836
81060
|
_computeOuterLabelLimit(datum) {
|
|
80837
|
-
var _a, _b, _c, _d, _e;
|
|
81061
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
80838
81062
|
if (this._isHorizontal()) {
|
|
80839
81063
|
return this._getMainAxisLength(this.isTransformLevel(datum));
|
|
80840
81064
|
}
|
|
80841
81065
|
const points = this.getPoints(datum);
|
|
80842
81066
|
const shapeMiddleWidth = (Math.abs(points[0].x - points[1].x) + Math.abs(points[2].x - points[3].x)) / 2;
|
|
80843
81067
|
const categoryField = this.getCategoryField();
|
|
80844
|
-
const funnelLabelBounds = (_c = (_b = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent()) === null || _b === void 0 ? void 0 : _b.getProduct().getGroupGraphicItem().find(({ attribute, type }) => {
|
|
81068
|
+
const funnelLabelBounds = (_e = (_d = (_c = (_b = (_a = this._labelMark) === null || _a === void 0 ? void 0 : _a.getComponent()) === null || _b === void 0 ? void 0 : _b.getProduct()) === null || _c === void 0 ? void 0 : _c.getGroupGraphicItem()) === null || _d === void 0 ? void 0 : _d.find(({ attribute, type }) => {
|
|
80845
81069
|
var _a;
|
|
80846
81070
|
return type === 'text' && ((_a = attribute.data) === null || _a === void 0 ? void 0 : _a[categoryField]) === datum[categoryField];
|
|
80847
|
-
}, true)) === null ||
|
|
81071
|
+
}, true)) === null || _e === void 0 ? void 0 : _e.AABBBounds;
|
|
80848
81072
|
const funnelLabelWidth = funnelLabelBounds ? funnelLabelBounds.x2 - funnelLabelBounds.x1 : 0;
|
|
80849
81073
|
const outerLineSpace = this._funnelOuterLabelMark.line ? this._minLabelLineWidth : 0;
|
|
80850
81074
|
let space = this.getLayoutRect().width - Math.max(shapeMiddleWidth, funnelLabelWidth);
|
|
80851
81075
|
if (this._funnelAlign === 'center') {
|
|
80852
81076
|
space /= 2;
|
|
80853
81077
|
}
|
|
80854
|
-
return space - outerLineSpace - ((
|
|
81078
|
+
return space - outerLineSpace - ((_g = (_f = this._spec.outerLabel) === null || _f === void 0 ? void 0 : _f.spaceWidth) !== null && _g !== void 0 ? _g : FUNNEL_LABEL_SPACE_WIDTH);
|
|
80855
81079
|
}
|
|
80856
81080
|
_computeOuterLabelLinePosition(datum) {
|
|
80857
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
81081
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
80858
81082
|
const categoryField = this.getCategoryField();
|
|
80859
81083
|
const outerLabelMarkBounds = (_e = (_d = (_c = (_b = (_a = this._funnelOuterLabelMark) === null || _a === void 0 ? void 0 : _a.label) === null || _b === void 0 ? void 0 : _b.getProduct()) === null || _c === void 0 ? void 0 : _c.elements) === null || _d === void 0 ? void 0 : _d.find((el) => { var _a; return ((_a = el.data[0]) === null || _a === void 0 ? void 0 : _a[categoryField]) === datum[categoryField]; })) === null || _e === void 0 ? void 0 : _e.getBounds();
|
|
80860
|
-
const labelMarkBounds = (_h = (_g = (_f = this._labelMark) === null || _f === void 0 ? void 0 : _f.getComponent()) === null || _g === void 0 ? void 0 : _g.getProduct().getGroupGraphicItem().find(({ attribute, type }) => {
|
|
81084
|
+
const labelMarkBounds = (_k = (_j = (_h = (_g = (_f = this._labelMark) === null || _f === void 0 ? void 0 : _f.getComponent()) === null || _g === void 0 ? void 0 : _g.getProduct()) === null || _h === void 0 ? void 0 : _h.getGroupGraphicItem()) === null || _j === void 0 ? void 0 : _j.find(({ attribute, type }) => {
|
|
80861
81085
|
var _a;
|
|
80862
81086
|
return type === 'text' && ((_a = attribute.data) === null || _a === void 0 ? void 0 : _a[categoryField]) === datum[categoryField];
|
|
80863
|
-
}, true)) === null ||
|
|
80864
|
-
const outerLabelSpec = (
|
|
81087
|
+
}, true)) === null || _k === void 0 ? void 0 : _k.AABBBounds;
|
|
81088
|
+
const outerLabelSpec = (_l = this._spec.outerLabel) !== null && _l !== void 0 ? _l : {};
|
|
80865
81089
|
let x1;
|
|
80866
81090
|
let x2;
|
|
80867
81091
|
let y1;
|
|
80868
81092
|
let y2;
|
|
80869
81093
|
if (this._isHorizontal()) {
|
|
80870
|
-
const spaceWidth = (
|
|
81094
|
+
const spaceWidth = (_m = outerLabelSpec.spaceWidth) !== null && _m !== void 0 ? _m : FUNNEL_LABEL_SPACE_WIDTH;
|
|
80871
81095
|
const points = this.getPoints(datum);
|
|
80872
81096
|
const shapeMiddleHeight = (Math.abs(points[0].y - points[1].y) + Math.abs(points[2].y - points[3].y)) / 2;
|
|
80873
81097
|
if (this._spec.outerLabel.position === 'top' || this._funnelAlign === 'bottom') {
|
|
@@ -80889,7 +81113,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
80889
81113
|
const points = this.getPoints(datum);
|
|
80890
81114
|
const shapeMiddleWidth = (Math.abs(points[0].x - points[1].x) + Math.abs(points[2].x - points[3].x)) / 2;
|
|
80891
81115
|
const labelWidth = (labelMarkBounds === null || labelMarkBounds === void 0 ? void 0 : labelMarkBounds.x2) - (labelMarkBounds === null || labelMarkBounds === void 0 ? void 0 : labelMarkBounds.x1) || 0;
|
|
80892
|
-
const spaceWidth = (
|
|
81116
|
+
const spaceWidth = (_o = outerLabelSpec.spaceWidth) !== null && _o !== void 0 ? _o : FUNNEL_LABEL_SPACE_WIDTH;
|
|
80893
81117
|
if (this._spec.outerLabel.position === 'right' || this._funnelAlign === 'left') {
|
|
80894
81118
|
x1 = this._getPolygonCenter(points).x + Math.max(labelWidth / 2, shapeMiddleWidth / 2) + spaceWidth;
|
|
80895
81119
|
x2 = outerLabelSpec.alignLabel !== false ? (outerLabelMarkBounds === null || outerLabelMarkBounds === void 0 ? void 0 : outerLabelMarkBounds.x1) - spaceWidth : x1 + spaceWidth;
|
|
@@ -83975,6 +84199,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
83975
84199
|
this._linksSeriesData = new SeriesData(this._option, linksDataView);
|
|
83976
84200
|
}
|
|
83977
84201
|
}
|
|
84202
|
+
compileData() {
|
|
84203
|
+
var _a, _b;
|
|
84204
|
+
super.compileData();
|
|
84205
|
+
(_a = this._linksSeriesData) === null || _a === void 0 ? void 0 : _a.compile();
|
|
84206
|
+
(_b = this._nodesSeriesData) === null || _b === void 0 ? void 0 : _b.compile();
|
|
84207
|
+
}
|
|
83978
84208
|
initMark() {
|
|
83979
84209
|
var _a, _b, _c, _d;
|
|
83980
84210
|
const nodeMark = this._createMark(SankeySeries.mark.node, {
|
|
@@ -85647,6 +85877,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
85647
85877
|
});
|
|
85648
85878
|
this._centerSeriesData = new SeriesData(this._option, centerDataView);
|
|
85649
85879
|
}
|
|
85880
|
+
compileData() {
|
|
85881
|
+
var _a;
|
|
85882
|
+
super.compileData();
|
|
85883
|
+
(_a = this._centerSeriesData) === null || _a === void 0 ? void 0 : _a.compile();
|
|
85884
|
+
}
|
|
85650
85885
|
_statisticViewData() {
|
|
85651
85886
|
super._statisticViewData();
|
|
85652
85887
|
this._data.getDataView().transform({
|
|
@@ -90282,9 +90517,44 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90282
90517
|
this.activeType = 'mark';
|
|
90283
90518
|
}
|
|
90284
90519
|
showTooltip(info, params, changePositionOnly) {
|
|
90520
|
+
var _a, _b, _c;
|
|
90285
90521
|
const { datum, series } = info;
|
|
90522
|
+
const tooltipSpec = this.component.getSpec();
|
|
90286
90523
|
const tooltipData = [{ datum: [datum], series }];
|
|
90524
|
+
const helper = series.tooltipHelper;
|
|
90525
|
+
const seriesSpec = (_a = series.getSpec()) === null || _a === void 0 ? void 0 : _a.tooltip;
|
|
90526
|
+
const seriesCheckOverlap = (_b = seriesSpec === null || seriesSpec === void 0 ? void 0 : seriesSpec.mark) === null || _b === void 0 ? void 0 : _b.checkOverlap;
|
|
90527
|
+
let checkOverlap = false;
|
|
90528
|
+
if (seriesCheckOverlap === true || (((_c = tooltipSpec.mark) === null || _c === void 0 ? void 0 : _c.checkOverlap) === true && seriesCheckOverlap !== false)) {
|
|
90529
|
+
const activeTriggers = helper === null || helper === void 0 ? void 0 : helper.activeTriggerSet.mark;
|
|
90530
|
+
if (activeTriggers) {
|
|
90531
|
+
checkOverlap = true;
|
|
90532
|
+
const chart = this.component.getChart();
|
|
90533
|
+
const layer = chart.getCompiler().getStage().getLayer(undefined);
|
|
90534
|
+
const point = { x: params.event.viewX, y: params.event.viewY };
|
|
90535
|
+
layer.globalTransMatrix.transformPoint({ x: params.event.viewX, y: params.event.viewY }, point);
|
|
90536
|
+
activeTriggers.forEach(mark => {
|
|
90537
|
+
mark.getProductElements().forEach(el => {
|
|
90538
|
+
const graphic = el.getGraphicItem();
|
|
90539
|
+
if (el !== params.item &&
|
|
90540
|
+
graphic &&
|
|
90541
|
+
graphic.containsPoint(point.x, point.y, IContainPointMode.GLOBAL, graphic.stage.getPickerService())) {
|
|
90542
|
+
tooltipData[0].datum.push(el.getDatum());
|
|
90543
|
+
}
|
|
90544
|
+
});
|
|
90545
|
+
});
|
|
90546
|
+
}
|
|
90547
|
+
}
|
|
90287
90548
|
const newParams = Object.assign(Object.assign({}, params), { changePositionOnly, tooltip: this.component });
|
|
90549
|
+
if (changePositionOnly && checkOverlap) {
|
|
90550
|
+
const cacheData = this._cacheActiveSpec && this._cacheActiveSpec.data;
|
|
90551
|
+
if (!cacheData ||
|
|
90552
|
+
cacheData[0].series !== tooltipData[0].series ||
|
|
90553
|
+
cacheData[0].datum.length !== tooltipData[0].datum.length ||
|
|
90554
|
+
cacheData[0].datum.some((d, index) => d !== tooltipData[0].datum[index])) {
|
|
90555
|
+
newParams.changePositionOnly = false;
|
|
90556
|
+
}
|
|
90557
|
+
}
|
|
90288
90558
|
return this._showTooltipByHandler(tooltipData, newParams);
|
|
90289
90559
|
}
|
|
90290
90560
|
getMouseEventData(params) {
|
|
@@ -90415,6 +90685,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90415
90685
|
this.layoutType = 'none';
|
|
90416
90686
|
this._alwaysShow = false;
|
|
90417
90687
|
this._eventList = [];
|
|
90688
|
+
this._isTooltipShown = false;
|
|
90418
90689
|
this._clickLock = false;
|
|
90419
90690
|
this._mountEvent = (eType, query, callback) => {
|
|
90420
90691
|
this.event.on(eType, query, callback);
|
|
@@ -90437,7 +90708,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90437
90708
|
if (this._alwaysShow || this._clickLock) {
|
|
90438
90709
|
return;
|
|
90439
90710
|
}
|
|
90440
|
-
if (!((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
|
|
90711
|
+
if (!this._isTooltipShown && !((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
|
|
90441
90712
|
return;
|
|
90442
90713
|
}
|
|
90443
90714
|
const browserEnv = isTrueBrowser((_c = this._option) === null || _c === void 0 ? void 0 : _c.mode);
|
|
@@ -90450,6 +90721,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90450
90721
|
this._handleChartMouseOut(params);
|
|
90451
90722
|
}, (_d = this._spec.showDelay) !== null && _d !== void 0 ? _d : DEFAULT_SHOW_DELAY);
|
|
90452
90723
|
}
|
|
90724
|
+
else {
|
|
90725
|
+
this._handleChartMouseOut(params);
|
|
90726
|
+
}
|
|
90453
90727
|
};
|
|
90454
90728
|
this._handleChartMouseOut = (params) => {
|
|
90455
90729
|
if (this._alwaysShow) {
|
|
@@ -90464,7 +90738,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90464
90738
|
}
|
|
90465
90739
|
};
|
|
90466
90740
|
this._getMouseMoveHandler = (isClick) => (params) => {
|
|
90467
|
-
var _a;
|
|
90741
|
+
var _a, _b, _c;
|
|
90468
90742
|
if (this._outTimer) {
|
|
90469
90743
|
clearTimeout(this._outTimer);
|
|
90470
90744
|
this._outTimer = null;
|
|
@@ -90485,13 +90759,13 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90485
90759
|
}
|
|
90486
90760
|
return;
|
|
90487
90761
|
}
|
|
90488
|
-
if (!isClick && this._enterable && this.isTooltipShown()) {
|
|
90762
|
+
if (!isClick && this._enterable && ((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
|
|
90489
90763
|
if (this._showTimer) {
|
|
90490
90764
|
clearTimeout(this._showTimer);
|
|
90491
90765
|
}
|
|
90492
90766
|
this._showTimer = setTimeout(() => {
|
|
90493
90767
|
this._handleChartMouseMove(params, isClick);
|
|
90494
|
-
}, (
|
|
90768
|
+
}, (_c = this._spec.showDelay) !== null && _c !== void 0 ? _c : DEFAULT_SHOW_DELAY);
|
|
90495
90769
|
}
|
|
90496
90770
|
else {
|
|
90497
90771
|
this._handleChartMouseMove(params, isClick);
|
|
@@ -90552,6 +90826,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90552
90826
|
}
|
|
90553
90827
|
}
|
|
90554
90828
|
if (success) {
|
|
90829
|
+
this._isTooltipShown = true;
|
|
90555
90830
|
if (isClick && this._spec.lockAfterClick && !this._clickLock) {
|
|
90556
90831
|
this._clickLock = true;
|
|
90557
90832
|
}
|
|
@@ -90581,7 +90856,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90581
90856
|
};
|
|
90582
90857
|
this._hideTooltipByHandler = (params) => {
|
|
90583
90858
|
var _a, _b, _c;
|
|
90584
|
-
if (!((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
|
|
90859
|
+
if (!this._isTooltipShown && !((_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a))) {
|
|
90585
90860
|
return 0;
|
|
90586
90861
|
}
|
|
90587
90862
|
this.event.emit(ChartEvent.tooltipHide, Object.assign(Object.assign({}, params), { source: Event_Source_Type.chart, tooltip: this }));
|
|
@@ -90590,7 +90865,11 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90590
90865
|
});
|
|
90591
90866
|
const handler = (_c = this._spec.handler) !== null && _c !== void 0 ? _c : this.tooltipHandler;
|
|
90592
90867
|
if (handler.hideTooltip) {
|
|
90593
|
-
|
|
90868
|
+
const result = handler.hideTooltip.call(handler, params);
|
|
90869
|
+
if (!result) {
|
|
90870
|
+
this._isTooltipShown = false;
|
|
90871
|
+
}
|
|
90872
|
+
return result;
|
|
90594
90873
|
}
|
|
90595
90874
|
return 1;
|
|
90596
90875
|
};
|
|
@@ -90607,8 +90886,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90607
90886
|
};
|
|
90608
90887
|
}
|
|
90609
90888
|
isTooltipShown() {
|
|
90610
|
-
|
|
90611
|
-
return (_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.isTooltipShown) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
90889
|
+
return this._isTooltipShown;
|
|
90612
90890
|
}
|
|
90613
90891
|
changeRegions(regions) {
|
|
90614
90892
|
}
|
|
@@ -90641,6 +90919,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90641
90919
|
});
|
|
90642
90920
|
this._eventList = [];
|
|
90643
90921
|
(_b = (_a = this.tooltipHandler) === null || _a === void 0 ? void 0 : _a.release) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
90922
|
+
this._isTooltipShown = false;
|
|
90644
90923
|
}
|
|
90645
90924
|
beforeRelease() {
|
|
90646
90925
|
this.event.emit(ChartEvent.tooltipHide, {
|
|
@@ -90687,7 +90966,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90687
90966
|
const container = (_b = (_a = this.tooltipHandler).getTooltipContainer) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
90688
90967
|
const element = container === null || container === void 0 ? void 0 : container.firstChild;
|
|
90689
90968
|
if (element) {
|
|
90690
|
-
element.addEventListener('
|
|
90969
|
+
element.addEventListener('pointerenter', () => {
|
|
90691
90970
|
var _a;
|
|
90692
90971
|
const rect = (_a = element.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(element);
|
|
90693
90972
|
if (rect) {
|
|
@@ -90702,7 +90981,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90702
90981
|
this._showTimer = null;
|
|
90703
90982
|
}
|
|
90704
90983
|
});
|
|
90705
|
-
element.addEventListener('
|
|
90984
|
+
element.addEventListener('pointerleave', () => {
|
|
90706
90985
|
var _a, _b;
|
|
90707
90986
|
if (this._cacheEnterableRect) {
|
|
90708
90987
|
const newRect = (_a = element.getBoundingClientRect) === null || _a === void 0 ? void 0 : _a.call(element);
|
|
@@ -90737,12 +91016,12 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90737
91016
|
const trigger = array((_a = this._spec.trigger) !== null && _a !== void 0 ? _a : 'hover');
|
|
90738
91017
|
const mode = this._option.mode;
|
|
90739
91018
|
if (trigger.includes('hover')) {
|
|
90740
|
-
this._mountEvent('pointermove', { source: 'chart' }, this._getMouseMoveHandler(false));
|
|
91019
|
+
this._mountEvent('pointermove', { source: 'chart' }, this._throttle(this._getMouseMoveHandler(false)));
|
|
90741
91020
|
if (isMobileLikeMode(mode) || isMiniAppLikeMode(mode)) {
|
|
90742
91021
|
this._mountEvent('pointerdown', { source: 'chart' }, this._getMouseMoveHandler(false));
|
|
90743
91022
|
this._mountEvent('pointerup', { source: 'window' }, this._getMouseOutHandler(true));
|
|
90744
91023
|
}
|
|
90745
|
-
this._mountEvent('
|
|
91024
|
+
this._mountEvent('pointerout', { source: 'canvas' }, this._getMouseOutHandler(false));
|
|
90746
91025
|
}
|
|
90747
91026
|
if (trigger.includes('click')) {
|
|
90748
91027
|
this._mountEvent('pointertap', { source: 'chart' }, this._getMouseMoveHandler(true));
|
|
@@ -90752,6 +91031,21 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
90752
91031
|
this._mountEvent('pointertap', { source: 'chart' }, this._handleClickToLock);
|
|
90753
91032
|
}
|
|
90754
91033
|
}
|
|
91034
|
+
_throttle(callback) {
|
|
91035
|
+
let wait;
|
|
91036
|
+
if (isNumber$1(this._spec.throttleInterval)) {
|
|
91037
|
+
wait = this._spec.throttleInterval;
|
|
91038
|
+
}
|
|
91039
|
+
else {
|
|
91040
|
+
if (this._spec.renderMode !== 'html' || !this._spec.transitionDuration) {
|
|
91041
|
+
wait = 10;
|
|
91042
|
+
}
|
|
91043
|
+
else {
|
|
91044
|
+
wait = 50;
|
|
91045
|
+
}
|
|
91046
|
+
}
|
|
91047
|
+
return throttle(callback, wait);
|
|
91048
|
+
}
|
|
90755
91049
|
reInit(spec) {
|
|
90756
91050
|
var _a, _b;
|
|
90757
91051
|
super.reInit(spec);
|
|
@@ -96220,13 +96514,18 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
96220
96514
|
this._labelComponentMap.set(component, () => {
|
|
96221
96515
|
return this._labelInfoMap.get(region)[i];
|
|
96222
96516
|
});
|
|
96223
|
-
labelInfo.labelMark.setComponent(component);
|
|
96224
96517
|
}
|
|
96225
96518
|
});
|
|
96226
96519
|
}
|
|
96227
96520
|
});
|
|
96228
96521
|
}
|
|
96229
96522
|
_initTextMarkStyle() {
|
|
96523
|
+
this._labelComponentMap.forEach((labelInfoCb, labelComponent) => {
|
|
96524
|
+
const labelInfoArray = array(labelInfoCb());
|
|
96525
|
+
labelInfoArray.forEach(({ labelMark }) => {
|
|
96526
|
+
labelMark.setComponent(labelComponent);
|
|
96527
|
+
});
|
|
96528
|
+
});
|
|
96230
96529
|
this._labelInfoMap.forEach(labelInfos => {
|
|
96231
96530
|
labelInfos.forEach(info => {
|
|
96232
96531
|
var _a, _b;
|
|
@@ -98782,7 +99081,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98782
99081
|
}
|
|
98783
99082
|
return this.changeTooltip(true, params, data);
|
|
98784
99083
|
};
|
|
98785
|
-
this.
|
|
99084
|
+
this.changeTooltip = (visible, params, data) => {
|
|
98786
99085
|
if (this._isReleased) {
|
|
98787
99086
|
return 1;
|
|
98788
99087
|
}
|
|
@@ -98790,9 +99089,9 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
98790
99089
|
this._updateTooltip(false, params);
|
|
98791
99090
|
return 0;
|
|
98792
99091
|
}
|
|
98793
|
-
return this.
|
|
99092
|
+
return this.changeTooltipPosition(params, data);
|
|
98794
99093
|
};
|
|
98795
|
-
this.
|
|
99094
|
+
this.changeTooltipPosition = (params, data) => {
|
|
98796
99095
|
var _a, _b, _c, _d, _e;
|
|
98797
99096
|
if (this._isReleased) {
|
|
98798
99097
|
return 1;
|
|
@@ -99047,22 +99346,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
99047
99346
|
this._removeTooltip();
|
|
99048
99347
|
this._isReleased = true;
|
|
99049
99348
|
}
|
|
99050
|
-
_throttle(callback) {
|
|
99051
|
-
const tooltipSpec = this._component.getSpec();
|
|
99052
|
-
let wait;
|
|
99053
|
-
if (isNumber$1(tooltipSpec.throttleInterval)) {
|
|
99054
|
-
wait = tooltipSpec.throttleInterval;
|
|
99055
|
-
}
|
|
99056
|
-
else {
|
|
99057
|
-
if (tooltipSpec.renderMode !== 'html' || !tooltipSpec.transitionDuration) {
|
|
99058
|
-
wait = 10;
|
|
99059
|
-
}
|
|
99060
|
-
else {
|
|
99061
|
-
wait = 50;
|
|
99062
|
-
}
|
|
99063
|
-
}
|
|
99064
|
-
return throttle(callback, wait);
|
|
99065
|
-
}
|
|
99066
99349
|
_getDefaultOption() {
|
|
99067
99350
|
var _a, _b;
|
|
99068
99351
|
const { offset } = this._component.getSpec();
|
|
@@ -99089,8 +99372,6 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
99089
99372
|
}
|
|
99090
99373
|
_initFromSpec() {
|
|
99091
99374
|
this._option = this._getDefaultOption();
|
|
99092
|
-
this.changeTooltip = this._throttle(this._changeTooltip);
|
|
99093
|
-
this.changeTooltipPosition = this._throttle(this._changeTooltipPosition);
|
|
99094
99375
|
}
|
|
99095
99376
|
reInit() {
|
|
99096
99377
|
this._initFromSpec();
|