@visactor/vchart 1.13.16 → 1.13.18
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.es.js +31 -15
- package/build/index.js +31 -15
- package/build/index.min.js +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/cjs/chart/range-area/range-area-transformer.js +2 -1
- package/cjs/chart/range-area/range-area-transformer.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/esm/chart/range-area/range-area-transformer.js +2 -1
- package/esm/chart/range-area/range-area-transformer.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/package.json +16 -16
package/build/index.es.js
CHANGED
|
@@ -37743,19 +37743,22 @@ class LabelBase extends AbstractComponent {
|
|
|
37743
37743
|
const {
|
|
37744
37744
|
clampForce = !0,
|
|
37745
37745
|
hideOnHit = !0,
|
|
37746
|
+
hideOnOverflow = !1,
|
|
37746
37747
|
overlapPadding: overlapPadding,
|
|
37747
37748
|
strategy: strategy
|
|
37748
37749
|
} = option;
|
|
37749
|
-
if (clampForce) for (let i = 0; i < result.length; i++) {
|
|
37750
|
+
if (clampForce || hideOnOverflow) for (let i = 0; i < result.length; i++) {
|
|
37750
37751
|
const text = labels[i],
|
|
37751
37752
|
{
|
|
37752
37753
|
dx = 0,
|
|
37753
37754
|
dy = 0
|
|
37754
37755
|
} = clampText(text, bmpTool.width, bmpTool.height, bmpTool.padding);
|
|
37755
|
-
0 === dx && 0 === dy || (text.setAttributes({
|
|
37756
|
+
0 === dx && 0 === dy || (hideOnOverflow ? text.setAttributes({
|
|
37757
|
+
visible: !1
|
|
37758
|
+
}) : (text.setAttributes({
|
|
37756
37759
|
x: text.attribute.x + dx,
|
|
37757
37760
|
y: text.attribute.y + dy
|
|
37758
|
-
}), text._isClamped = !0);
|
|
37761
|
+
}), text._isClamped = !0));
|
|
37759
37762
|
}
|
|
37760
37763
|
result = shiftY(result, Object.assign(Object.assign({
|
|
37761
37764
|
maxY: bmpTool.height
|
|
@@ -37771,9 +37774,9 @@ class LabelBase extends AbstractComponent {
|
|
|
37771
37774
|
bounds = text.AABBBounds,
|
|
37772
37775
|
range = boundToRange(bmpTool, bounds, !0);
|
|
37773
37776
|
if (canPlace(bmpTool, bitmap, bounds, clampForce, overlapPadding)) bitmap.setRange(range);else {
|
|
37774
|
-
if (
|
|
37775
|
-
if (this.
|
|
37776
|
-
}
|
|
37777
|
+
if (hideOnOverflow) {
|
|
37778
|
+
if (this._processHideOnOverflow(text, bmpTool)) continue;
|
|
37779
|
+
} else if (clampForce && this._processClampForce(text, bmpTool, bitmap, overlapPadding)) continue;
|
|
37777
37780
|
hideOnHit ? text.setAttributes({
|
|
37778
37781
|
visible: !1
|
|
37779
37782
|
}) : bitmap.setRange(range);
|
|
@@ -37781,6 +37784,15 @@ class LabelBase extends AbstractComponent {
|
|
|
37781
37784
|
}
|
|
37782
37785
|
return result;
|
|
37783
37786
|
}
|
|
37787
|
+
_processHideOnOverflow(text, bmpTool) {
|
|
37788
|
+
const {
|
|
37789
|
+
dy = 0,
|
|
37790
|
+
dx = 0
|
|
37791
|
+
} = clampText(text, bmpTool.width, bmpTool.height, bmpTool.padding);
|
|
37792
|
+
return 0 === dx && 0 === dy || (text.setAttributes({
|
|
37793
|
+
visible: !1
|
|
37794
|
+
}), !1);
|
|
37795
|
+
}
|
|
37784
37796
|
_processClampForce(text, bmpTool, bitmap) {
|
|
37785
37797
|
let overlapPadding = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
37786
37798
|
const {
|
|
@@ -37808,7 +37820,8 @@ class LabelBase extends AbstractComponent {
|
|
|
37808
37820
|
hideOnHit = !0,
|
|
37809
37821
|
clampForce = !0,
|
|
37810
37822
|
avoidMarks = [],
|
|
37811
|
-
overlapPadding: overlapPadding
|
|
37823
|
+
overlapPadding: overlapPadding,
|
|
37824
|
+
hideOnOverflow = !1
|
|
37812
37825
|
} = option,
|
|
37813
37826
|
result = [],
|
|
37814
37827
|
checkBounds = strategy.some(s => "bound" === s.type);
|
|
@@ -37835,15 +37848,16 @@ class LabelBase extends AbstractComponent {
|
|
|
37835
37848
|
}
|
|
37836
37849
|
}
|
|
37837
37850
|
let hasPlace = !1;
|
|
37838
|
-
for (let j = 0; j < strategy.length; j++) if (hasPlace = place$2(bmpTool, bitmap, strategy[j], this.attribute, text, this._isCollectionBase ? this.getGraphicBounds(null, this._idToPoint.get(labels[i].attribute.id)) : this.getGraphicBounds(baseMark, labels[i].attribute), this.labeling), !1 !== hasPlace
|
|
37839
|
-
|
|
37840
|
-
|
|
37841
|
-
|
|
37842
|
-
|
|
37851
|
+
for (let j = 0; j < strategy.length; j++) if (hasPlace = place$2(bmpTool, bitmap, strategy[j], this.attribute, text, this._isCollectionBase ? this.getGraphicBounds(null, this._idToPoint.get(labels[i].attribute.id)) : this.getGraphicBounds(baseMark, labels[i].attribute), this.labeling), !1 !== hasPlace && (text.setAttributes({
|
|
37852
|
+
x: hasPlace.x,
|
|
37853
|
+
y: hasPlace.y
|
|
37854
|
+
}), !hideOnOverflow || this._processHideOnOverflow(text, bmpTool))) {
|
|
37855
|
+
result.push(text);
|
|
37843
37856
|
break;
|
|
37844
37857
|
}
|
|
37845
|
-
if (!hasPlace
|
|
37846
|
-
if (this.
|
|
37858
|
+
if (!hasPlace) {
|
|
37859
|
+
if (hideOnOverflow && !this._processHideOnOverflow(text, bmpTool)) continue;
|
|
37860
|
+
if (clampForce && this._processClampForce(text, bmpTool, bitmap, overlapPadding)) {
|
|
37847
37861
|
result.push(text);
|
|
37848
37862
|
continue;
|
|
37849
37863
|
}
|
|
@@ -64241,7 +64255,7 @@ const registerVChartCore = () => {
|
|
|
64241
64255
|
};
|
|
64242
64256
|
registerVChartCore();
|
|
64243
64257
|
|
|
64244
|
-
const version = "1.13.
|
|
64258
|
+
const version = "1.13.18";
|
|
64245
64259
|
|
|
64246
64260
|
const addVChartProperty = (data, op) => {
|
|
64247
64261
|
const context = op.beforeCall();
|
|
@@ -92738,6 +92752,8 @@ class RangeAreaChartSpecTransformer extends CartesianChartSpecTransformer {
|
|
|
92738
92752
|
var _a, _b;
|
|
92739
92753
|
const series = super._getDefaultSeriesSpec(spec);
|
|
92740
92754
|
series.area = spec.area;
|
|
92755
|
+
series.point = spec.point;
|
|
92756
|
+
series.line = spec.line;
|
|
92741
92757
|
if (spec.direction === "horizontal") {
|
|
92742
92758
|
series.xField = (_a = spec.xField) !== null && _a !== void 0 ? _a : [spec.minField, spec.maxField];
|
|
92743
92759
|
}
|
package/build/index.js
CHANGED
|
@@ -37749,19 +37749,22 @@
|
|
|
37749
37749
|
const {
|
|
37750
37750
|
clampForce = !0,
|
|
37751
37751
|
hideOnHit = !0,
|
|
37752
|
+
hideOnOverflow = !1,
|
|
37752
37753
|
overlapPadding: overlapPadding,
|
|
37753
37754
|
strategy: strategy
|
|
37754
37755
|
} = option;
|
|
37755
|
-
if (clampForce) for (let i = 0; i < result.length; i++) {
|
|
37756
|
+
if (clampForce || hideOnOverflow) for (let i = 0; i < result.length; i++) {
|
|
37756
37757
|
const text = labels[i],
|
|
37757
37758
|
{
|
|
37758
37759
|
dx = 0,
|
|
37759
37760
|
dy = 0
|
|
37760
37761
|
} = clampText(text, bmpTool.width, bmpTool.height, bmpTool.padding);
|
|
37761
|
-
0 === dx && 0 === dy || (text.setAttributes({
|
|
37762
|
+
0 === dx && 0 === dy || (hideOnOverflow ? text.setAttributes({
|
|
37763
|
+
visible: !1
|
|
37764
|
+
}) : (text.setAttributes({
|
|
37762
37765
|
x: text.attribute.x + dx,
|
|
37763
37766
|
y: text.attribute.y + dy
|
|
37764
|
-
}), text._isClamped = !0);
|
|
37767
|
+
}), text._isClamped = !0));
|
|
37765
37768
|
}
|
|
37766
37769
|
result = shiftY(result, Object.assign(Object.assign({
|
|
37767
37770
|
maxY: bmpTool.height
|
|
@@ -37777,9 +37780,9 @@
|
|
|
37777
37780
|
bounds = text.AABBBounds,
|
|
37778
37781
|
range = boundToRange(bmpTool, bounds, !0);
|
|
37779
37782
|
if (canPlace(bmpTool, bitmap, bounds, clampForce, overlapPadding)) bitmap.setRange(range);else {
|
|
37780
|
-
if (
|
|
37781
|
-
if (this.
|
|
37782
|
-
}
|
|
37783
|
+
if (hideOnOverflow) {
|
|
37784
|
+
if (this._processHideOnOverflow(text, bmpTool)) continue;
|
|
37785
|
+
} else if (clampForce && this._processClampForce(text, bmpTool, bitmap, overlapPadding)) continue;
|
|
37783
37786
|
hideOnHit ? text.setAttributes({
|
|
37784
37787
|
visible: !1
|
|
37785
37788
|
}) : bitmap.setRange(range);
|
|
@@ -37787,6 +37790,15 @@
|
|
|
37787
37790
|
}
|
|
37788
37791
|
return result;
|
|
37789
37792
|
}
|
|
37793
|
+
_processHideOnOverflow(text, bmpTool) {
|
|
37794
|
+
const {
|
|
37795
|
+
dy = 0,
|
|
37796
|
+
dx = 0
|
|
37797
|
+
} = clampText(text, bmpTool.width, bmpTool.height, bmpTool.padding);
|
|
37798
|
+
return 0 === dx && 0 === dy || (text.setAttributes({
|
|
37799
|
+
visible: !1
|
|
37800
|
+
}), !1);
|
|
37801
|
+
}
|
|
37790
37802
|
_processClampForce(text, bmpTool, bitmap) {
|
|
37791
37803
|
let overlapPadding = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
37792
37804
|
const {
|
|
@@ -37814,7 +37826,8 @@
|
|
|
37814
37826
|
hideOnHit = !0,
|
|
37815
37827
|
clampForce = !0,
|
|
37816
37828
|
avoidMarks = [],
|
|
37817
|
-
overlapPadding: overlapPadding
|
|
37829
|
+
overlapPadding: overlapPadding,
|
|
37830
|
+
hideOnOverflow = !1
|
|
37818
37831
|
} = option,
|
|
37819
37832
|
result = [],
|
|
37820
37833
|
checkBounds = strategy.some(s => "bound" === s.type);
|
|
@@ -37841,15 +37854,16 @@
|
|
|
37841
37854
|
}
|
|
37842
37855
|
}
|
|
37843
37856
|
let hasPlace = !1;
|
|
37844
|
-
for (let j = 0; j < strategy.length; j++) if (hasPlace = place$2(bmpTool, bitmap, strategy[j], this.attribute, text, this._isCollectionBase ? this.getGraphicBounds(null, this._idToPoint.get(labels[i].attribute.id)) : this.getGraphicBounds(baseMark, labels[i].attribute), this.labeling), !1 !== hasPlace
|
|
37845
|
-
|
|
37846
|
-
|
|
37847
|
-
|
|
37848
|
-
|
|
37857
|
+
for (let j = 0; j < strategy.length; j++) if (hasPlace = place$2(bmpTool, bitmap, strategy[j], this.attribute, text, this._isCollectionBase ? this.getGraphicBounds(null, this._idToPoint.get(labels[i].attribute.id)) : this.getGraphicBounds(baseMark, labels[i].attribute), this.labeling), !1 !== hasPlace && (text.setAttributes({
|
|
37858
|
+
x: hasPlace.x,
|
|
37859
|
+
y: hasPlace.y
|
|
37860
|
+
}), !hideOnOverflow || this._processHideOnOverflow(text, bmpTool))) {
|
|
37861
|
+
result.push(text);
|
|
37849
37862
|
break;
|
|
37850
37863
|
}
|
|
37851
|
-
if (!hasPlace
|
|
37852
|
-
if (this.
|
|
37864
|
+
if (!hasPlace) {
|
|
37865
|
+
if (hideOnOverflow && !this._processHideOnOverflow(text, bmpTool)) continue;
|
|
37866
|
+
if (clampForce && this._processClampForce(text, bmpTool, bitmap, overlapPadding)) {
|
|
37853
37867
|
result.push(text);
|
|
37854
37868
|
continue;
|
|
37855
37869
|
}
|
|
@@ -64247,7 +64261,7 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
64247
64261
|
};
|
|
64248
64262
|
registerVChartCore();
|
|
64249
64263
|
|
|
64250
|
-
const version = "1.13.
|
|
64264
|
+
const version = "1.13.18";
|
|
64251
64265
|
|
|
64252
64266
|
const addVChartProperty = (data, op) => {
|
|
64253
64267
|
const context = op.beforeCall();
|
|
@@ -92744,6 +92758,8 @@ C0.3-1.4,0.3-1.4,0.3-1.4z;`;
|
|
|
92744
92758
|
var _a, _b;
|
|
92745
92759
|
const series = super._getDefaultSeriesSpec(spec);
|
|
92746
92760
|
series.area = spec.area;
|
|
92761
|
+
series.point = spec.point;
|
|
92762
|
+
series.line = spec.line;
|
|
92747
92763
|
if (spec.direction === "horizontal") {
|
|
92748
92764
|
series.xField = (_a = spec.xField) !== null && _a !== void 0 ? _a : [spec.minField, spec.maxField];
|
|
92749
92765
|
}
|