@visactor/vchart 1.2.0-beta.3 → 1.2.0-beta.5
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/index.js +547 -240
- package/build/index.min.js +1 -1
- package/cjs/chart/bar/bar-3d.d.ts +1 -0
- package/cjs/chart/bar/bar-3d.js +8 -0
- package/cjs/chart/bar/bar-3d.js.map +1 -1
- package/cjs/chart/bar/bar.js +2 -1
- package/cjs/chart/bar/bar.js.map +1 -1
- package/cjs/chart/base-chart.js +5 -4
- package/cjs/chart/base-chart.js.map +1 -1
- package/cjs/chart/range-column/range-column-3d.js +3 -1
- package/cjs/chart/range-column/range-column-3d.js.map +1 -1
- package/cjs/chart/range-column/range-column.js +3 -1
- package/cjs/chart/range-column/range-column.js.map +1 -1
- package/cjs/chart/waterfall/waterfall.js +1 -0
- package/cjs/chart/waterfall/waterfall.js.map +1 -1
- package/cjs/component/axis/cartesian/axis.js +4 -3
- package/cjs/component/axis/cartesian/axis.js.map +1 -1
- package/cjs/component/axis/cartesian/band-axis.d.ts +1 -0
- package/cjs/component/axis/cartesian/band-axis.js +2 -1
- package/cjs/component/axis/cartesian/band-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/index.d.ts +1 -0
- package/cjs/component/axis/cartesian/index.js +1 -1
- package/cjs/component/axis/cartesian/index.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/common.d.ts +1 -0
- package/cjs/component/axis/cartesian/interface/common.js.map +1 -1
- package/cjs/component/axis/cartesian/interface/spec.d.ts +4 -1
- package/cjs/component/axis/cartesian/interface/spec.js.map +1 -1
- package/cjs/component/axis/cartesian/linear-axis.d.ts +3 -2
- package/cjs/component/axis/cartesian/linear-axis.js.map +1 -1
- package/cjs/component/axis/cartesian/log-axis.d.ts +15 -0
- package/cjs/component/axis/cartesian/log-axis.js +23 -0
- package/cjs/component/axis/cartesian/log-axis.js.map +1 -0
- package/cjs/component/axis/interface.js.map +1 -1
- package/cjs/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.d.ts +2 -0
- package/cjs/component/axis/mixin/linear-axis-mixin.js +13 -1
- package/cjs/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/cjs/component/base/util.js +3 -0
- package/cjs/component/base/util.js.map +1 -1
- package/cjs/component/data-zoom/data-filter-base-component.js +2 -3
- package/cjs/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/cjs/component/data-zoom/data-zoom/data-zoom.js +6 -6
- package/cjs/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/cjs/component/geo/geo-coordinate.js +4 -2
- package/cjs/component/geo/geo-coordinate.js.map +1 -1
- package/cjs/component/index.d.ts +4 -4
- package/cjs/component/index.js +6 -1
- package/cjs/component/index.js.map +1 -1
- package/cjs/component/interface/type.d.ts +1 -0
- package/cjs/component/interface/type.js +12 -12
- package/cjs/component/interface/type.js.map +1 -1
- package/cjs/component/label/bar.js +13 -5
- package/cjs/component/label/bar.js.map +1 -1
- package/cjs/component/marker/base-marker.d.ts +3 -3
- package/cjs/component/marker/base-marker.js +4 -2
- package/cjs/component/marker/base-marker.js.map +1 -1
- package/cjs/component/marker/interface.d.ts +3 -2
- package/cjs/component/marker/interface.js.map +1 -1
- package/cjs/component/marker/mark-area/interface/spec.d.ts +9 -9
- package/cjs/component/marker/mark-area/interface/spec.js.map +1 -1
- package/cjs/component/marker/mark-area/mark-area.js +7 -3
- package/cjs/component/marker/mark-area/mark-area.js.map +1 -1
- package/cjs/component/marker/mark-line/interface/spec.d.ts +5 -5
- package/cjs/component/marker/mark-line/interface/spec.js.map +1 -1
- package/cjs/component/marker/mark-line/mark-line.js +7 -3
- package/cjs/component/marker/mark-line/mark-line.js.map +1 -1
- package/cjs/component/marker/mark-point/mark-point.js +9 -3
- package/cjs/component/marker/mark-point/mark-point.js.map +1 -1
- package/cjs/component/title/interface/theme.d.ts +1 -1
- package/cjs/component/title/interface/theme.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/data/transforms/sankey.js +10 -2
- package/cjs/data/transforms/sankey.js.map +1 -1
- package/cjs/data/transforms/tick-data/continuous.js +2 -0
- package/cjs/data/transforms/tick-data/continuous.js.map +1 -1
- package/cjs/data/transforms/tick-data/discrete/linear.js +26 -2
- package/cjs/data/transforms/tick-data/discrete/linear.js.map +1 -1
- package/cjs/series/bar/bar.d.ts +3 -2
- package/cjs/series/bar/bar.js +29 -16
- package/cjs/series/bar/bar.js.map +1 -1
- package/cjs/series/bar/interface.d.ts +5 -3
- package/cjs/series/bar/interface.js.map +1 -1
- package/cjs/series/base/base-series.d.ts +1 -0
- package/cjs/series/base/base-series.js +28 -18
- package/cjs/series/base/base-series.js.map +1 -1
- package/cjs/series/circle-packing/circle-packing.d.ts +2 -0
- package/cjs/series/circle-packing/circle-packing.js +1 -0
- package/cjs/series/circle-packing/circle-packing.js.map +1 -1
- package/cjs/series/geo/geo.js +4 -3
- package/cjs/series/geo/geo.js.map +1 -1
- package/cjs/series/map/map.js +2 -2
- package/cjs/series/map/map.js.map +1 -1
- package/cjs/series/pie/pie.d.ts +3 -0
- package/cjs/series/pie/pie.js +28 -23
- package/cjs/series/pie/pie.js.map +1 -1
- package/cjs/series/radar/radar.js +2 -2
- package/cjs/series/radar/radar.js.map +1 -1
- package/cjs/series/range-column/range-column.js +15 -29
- package/cjs/series/range-column/range-column.js.map +1 -1
- package/cjs/series/sankey/sankey.d.ts +2 -0
- package/cjs/series/sankey/sankey.js +1 -0
- package/cjs/series/sankey/sankey.js.map +1 -1
- package/cjs/series/sunburst/sunburst.d.ts +2 -0
- package/cjs/series/sunburst/sunburst.js +1 -0
- package/cjs/series/sunburst/sunburst.js.map +1 -1
- package/cjs/series/word-cloud/base.d.ts +1 -0
- package/cjs/series/word-cloud/base.js +35 -32
- package/cjs/series/word-cloud/base.js.map +1 -1
- package/cjs/series/word-cloud/word-cloud-3d.js +33 -33
- package/cjs/series/word-cloud/word-cloud-3d.js.map +1 -1
- package/cjs/theme/buildin-theme/light/component/axis/log-axis.d.ts +2 -0
- package/cjs/theme/buildin-theme/light/component/axis/log-axis.js +22 -0
- package/cjs/theme/buildin-theme/light/component/axis/log-axis.js.map +1 -0
- package/cjs/theme/buildin-theme/light/component/title.js +2 -2
- package/cjs/theme/buildin-theme/light/component/title.js.map +1 -1
- package/cjs/theme/buildin-theme/light/index.js +2 -1
- package/cjs/theme/buildin-theme/light/index.js.map +1 -1
- package/cjs/theme/interface.d.ts +1 -0
- package/cjs/theme/interface.js.map +1 -1
- package/cjs/typings/spec/common.d.ts +2 -0
- package/cjs/typings/spec/common.js.map +1 -1
- package/cjs/vchart-all.js +1 -1
- package/cjs/vchart-all.js.map +1 -1
- package/esm/chart/bar/bar-3d.d.ts +1 -0
- package/esm/chart/bar/bar-3d.js +8 -0
- package/esm/chart/bar/bar-3d.js.map +1 -1
- package/esm/chart/bar/bar.js +2 -1
- package/esm/chart/bar/bar.js.map +1 -1
- package/esm/chart/base-chart.js +5 -4
- package/esm/chart/base-chart.js.map +1 -1
- package/esm/chart/range-column/range-column-3d.js +3 -1
- package/esm/chart/range-column/range-column-3d.js.map +1 -1
- package/esm/chart/range-column/range-column.js +3 -1
- package/esm/chart/range-column/range-column.js.map +1 -1
- package/esm/chart/waterfall/waterfall.js +1 -0
- package/esm/chart/waterfall/waterfall.js.map +1 -1
- package/esm/component/axis/cartesian/axis.js +4 -3
- package/esm/component/axis/cartesian/axis.js.map +1 -1
- package/esm/component/axis/cartesian/band-axis.d.ts +1 -0
- package/esm/component/axis/cartesian/band-axis.js +2 -1
- package/esm/component/axis/cartesian/band-axis.js.map +1 -1
- package/esm/component/axis/cartesian/index.d.ts +1 -0
- package/esm/component/axis/cartesian/index.js +2 -0
- package/esm/component/axis/cartesian/index.js.map +1 -1
- package/esm/component/axis/cartesian/interface/common.d.ts +1 -0
- package/esm/component/axis/cartesian/interface/common.js.map +1 -1
- package/esm/component/axis/cartesian/interface/spec.d.ts +4 -1
- package/esm/component/axis/cartesian/interface/spec.js.map +1 -1
- package/esm/component/axis/cartesian/linear-axis.d.ts +3 -2
- package/esm/component/axis/cartesian/linear-axis.js.map +1 -1
- package/esm/component/axis/cartesian/log-axis.d.ts +15 -0
- package/esm/component/axis/cartesian/log-axis.js +24 -0
- package/esm/component/axis/cartesian/log-axis.js.map +1 -0
- package/esm/component/axis/interface.js.map +1 -1
- package/esm/component/axis/mixin/band-axis-mixin.js.map +1 -1
- package/esm/component/axis/mixin/linear-axis-mixin.d.ts +2 -0
- package/esm/component/axis/mixin/linear-axis-mixin.js +8 -1
- package/esm/component/axis/mixin/linear-axis-mixin.js.map +1 -1
- package/esm/component/base/util.js +3 -0
- package/esm/component/base/util.js.map +1 -1
- package/esm/component/data-zoom/data-filter-base-component.js +2 -3
- package/esm/component/data-zoom/data-filter-base-component.js.map +1 -1
- package/esm/component/data-zoom/data-zoom/data-zoom.js +6 -6
- package/esm/component/data-zoom/data-zoom/data-zoom.js.map +1 -1
- package/esm/component/geo/geo-coordinate.js +4 -2
- package/esm/component/geo/geo-coordinate.js.map +1 -1
- package/esm/component/index.d.ts +4 -4
- package/esm/component/index.js +2 -2
- package/esm/component/index.js.map +1 -1
- package/esm/component/interface/type.d.ts +1 -0
- package/esm/component/interface/type.js +12 -12
- package/esm/component/interface/type.js.map +1 -1
- package/esm/component/label/bar.js +13 -5
- package/esm/component/label/bar.js.map +1 -1
- package/esm/component/marker/base-marker.d.ts +3 -3
- package/esm/component/marker/base-marker.js +5 -3
- package/esm/component/marker/base-marker.js.map +1 -1
- package/esm/component/marker/interface.d.ts +3 -2
- package/esm/component/marker/interface.js.map +1 -1
- package/esm/component/marker/mark-area/interface/spec.d.ts +9 -9
- package/esm/component/marker/mark-area/interface/spec.js.map +1 -1
- package/esm/component/marker/mark-area/mark-area.js +7 -3
- package/esm/component/marker/mark-area/mark-area.js.map +1 -1
- package/esm/component/marker/mark-line/interface/spec.d.ts +5 -5
- package/esm/component/marker/mark-line/interface/spec.js.map +1 -1
- package/esm/component/marker/mark-line/mark-line.js +7 -3
- package/esm/component/marker/mark-line/mark-line.js.map +1 -1
- package/esm/component/marker/mark-point/mark-point.js +9 -3
- package/esm/component/marker/mark-point/mark-point.js.map +1 -1
- package/esm/component/title/interface/theme.d.ts +1 -1
- package/esm/component/title/interface/theme.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/data/transforms/sankey.js +10 -2
- package/esm/data/transforms/sankey.js.map +1 -1
- package/esm/data/transforms/tick-data/continuous.js +2 -0
- package/esm/data/transforms/tick-data/continuous.js.map +1 -1
- package/esm/data/transforms/tick-data/discrete/linear.js +24 -2
- package/esm/data/transforms/tick-data/discrete/linear.js.map +1 -1
- package/esm/series/bar/bar.d.ts +3 -2
- package/esm/series/bar/bar.js +27 -13
- package/esm/series/bar/bar.js.map +1 -1
- package/esm/series/bar/interface.d.ts +5 -3
- package/esm/series/bar/interface.js.map +1 -1
- package/esm/series/base/base-series.d.ts +1 -0
- package/esm/series/base/base-series.js +28 -18
- package/esm/series/base/base-series.js.map +1 -1
- package/esm/series/circle-packing/circle-packing.d.ts +2 -0
- package/esm/series/circle-packing/circle-packing.js +1 -0
- package/esm/series/circle-packing/circle-packing.js.map +1 -1
- package/esm/series/geo/geo.js +4 -3
- package/esm/series/geo/geo.js.map +1 -1
- package/esm/series/map/map.js +2 -2
- package/esm/series/map/map.js.map +1 -1
- package/esm/series/pie/pie.d.ts +3 -0
- package/esm/series/pie/pie.js +27 -23
- package/esm/series/pie/pie.js.map +1 -1
- package/esm/series/radar/radar.js +2 -2
- package/esm/series/radar/radar.js.map +1 -1
- package/esm/series/range-column/range-column.js +14 -27
- package/esm/series/range-column/range-column.js.map +1 -1
- package/esm/series/sankey/sankey.d.ts +2 -0
- package/esm/series/sankey/sankey.js +1 -0
- package/esm/series/sankey/sankey.js.map +1 -1
- package/esm/series/sunburst/sunburst.d.ts +2 -0
- package/esm/series/sunburst/sunburst.js +1 -0
- package/esm/series/sunburst/sunburst.js.map +1 -1
- package/esm/series/word-cloud/base.d.ts +1 -0
- package/esm/series/word-cloud/base.js +35 -32
- package/esm/series/word-cloud/base.js.map +1 -1
- package/esm/series/word-cloud/word-cloud-3d.js +33 -33
- package/esm/series/word-cloud/word-cloud-3d.js.map +1 -1
- package/esm/theme/buildin-theme/light/component/axis/log-axis.d.ts +2 -0
- package/esm/theme/buildin-theme/light/component/axis/log-axis.js +18 -0
- package/esm/theme/buildin-theme/light/component/axis/log-axis.js.map +1 -0
- package/esm/theme/buildin-theme/light/component/title.js +2 -2
- package/esm/theme/buildin-theme/light/component/title.js.map +1 -1
- package/esm/theme/buildin-theme/light/index.js +2 -1
- package/esm/theme/buildin-theme/light/index.js.map +1 -1
- package/esm/theme/interface.d.ts +1 -0
- package/esm/theme/interface.js.map +1 -1
- package/esm/typings/spec/common.d.ts +2 -0
- package/esm/typings/spec/common.js.map +1 -1
- package/esm/vchart-all.js +2 -2
- package/esm/vchart-all.js.map +1 -1
- package/package.json +4 -4
package/build/index.js
CHANGED
|
@@ -870,7 +870,7 @@
|
|
|
870
870
|
const max$3 = Math.max;
|
|
871
871
|
const min$3 = Math.min;
|
|
872
872
|
const sin$1 = Math.sin;
|
|
873
|
-
const sqrt$
|
|
873
|
+
const sqrt$3 = Math.sqrt;
|
|
874
874
|
const pow$1 = Math.pow;
|
|
875
875
|
function acos$1(x) {
|
|
876
876
|
return x > 1 ? 0 : x < -1 ? pi$1 : Math.acos(x);
|
|
@@ -924,13 +924,13 @@
|
|
|
924
924
|
}
|
|
925
925
|
class PointService {
|
|
926
926
|
static distancePP(p1, p2) {
|
|
927
|
-
return sqrt$
|
|
927
|
+
return sqrt$3(pow$1(p1.x - p2.x, 2) + pow$1(p1.y - p2.y, 2));
|
|
928
928
|
}
|
|
929
929
|
static distanceNN(x, y, x1, y1) {
|
|
930
|
-
return sqrt$
|
|
930
|
+
return sqrt$3(pow$1(x - x1, 2) + pow$1(y - y1, 2));
|
|
931
931
|
}
|
|
932
932
|
static distancePN(point, x, y) {
|
|
933
|
-
return sqrt$
|
|
933
|
+
return sqrt$3(pow$1(x - point.x, 2) + pow$1(y - point.y, 2));
|
|
934
934
|
}
|
|
935
935
|
static pointAtPP(p1, p2, t) {
|
|
936
936
|
return new Point((p2.x - p1.x) * t + p1.x, (p2.y - p1.y) * t + p1.y);
|
|
@@ -2588,6 +2588,7 @@
|
|
|
2588
2588
|
ComponentTypeEnum["cartesianBandAxis"] = "cartesianAxis-band";
|
|
2589
2589
|
ComponentTypeEnum["cartesianLinearAxis"] = "cartesianAxis-linear";
|
|
2590
2590
|
ComponentTypeEnum["cartesianTimeAxis"] = "cartesianAxis-time";
|
|
2591
|
+
ComponentTypeEnum["cartesianLogAxis"] = "cartesianAxis-log";
|
|
2591
2592
|
ComponentTypeEnum["polarAxis"] = "polarAxis";
|
|
2592
2593
|
ComponentTypeEnum["polarBandAxis"] = "polarAxis-band";
|
|
2593
2594
|
ComponentTypeEnum["polarLinearAxis"] = "polarAxis-linear";
|
|
@@ -2681,7 +2682,7 @@
|
|
|
2681
2682
|
var sign$1 = Math.sign || function (x) {
|
|
2682
2683
|
return x > 0 ? 1 : x < 0 ? -1 : 0;
|
|
2683
2684
|
};
|
|
2684
|
-
var sqrt$
|
|
2685
|
+
var sqrt$2 = Math.sqrt;
|
|
2685
2686
|
var tan = Math.tan;
|
|
2686
2687
|
function acos(x) {
|
|
2687
2688
|
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
|
@@ -2796,7 +2797,7 @@
|
|
|
2796
2797
|
|
|
2797
2798
|
// TODO return d
|
|
2798
2799
|
function cartesianNormalizeInPlace(d) {
|
|
2799
|
-
var l = sqrt$
|
|
2800
|
+
var l = sqrt$2(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
|
|
2800
2801
|
d[0] /= l, d[1] /= l, d[2] /= l;
|
|
2801
2802
|
}
|
|
2802
2803
|
|
|
@@ -3451,7 +3452,7 @@
|
|
|
3451
3452
|
uu = cartesianDot(u, u),
|
|
3452
3453
|
t2 = w * w - uu * (cartesianDot(A, A) - 1);
|
|
3453
3454
|
if (t2 < 0) return;
|
|
3454
|
-
var t = sqrt$
|
|
3455
|
+
var t = sqrt$2(t2),
|
|
3455
3456
|
q = cartesianScale(u, (-w - t) / uu);
|
|
3456
3457
|
cartesianAddInPlace(q, A);
|
|
3457
3458
|
q = spherical(q);
|
|
@@ -3813,7 +3814,7 @@
|
|
|
3813
3814
|
function centroidPointLine(x, y) {
|
|
3814
3815
|
var dx = x - x0$1,
|
|
3815
3816
|
dy = y - y0$1,
|
|
3816
|
-
z = sqrt$
|
|
3817
|
+
z = sqrt$2(dx * dx + dy * dy);
|
|
3817
3818
|
X1 += z * (x0$1 + x) / 2;
|
|
3818
3819
|
Y1 += z * (y0$1 + y) / 2;
|
|
3819
3820
|
Z1 += z;
|
|
@@ -3835,7 +3836,7 @@
|
|
|
3835
3836
|
function centroidPointRing(x, y) {
|
|
3836
3837
|
var dx = x - x0$1,
|
|
3837
3838
|
dy = y - y0$1,
|
|
3838
|
-
z = sqrt$
|
|
3839
|
+
z = sqrt$2(dx * dx + dy * dy);
|
|
3839
3840
|
X1 += z * (x0$1 + x) / 2;
|
|
3840
3841
|
Y1 += z * (y0$1 + y) / 2;
|
|
3841
3842
|
Z1 += z;
|
|
@@ -3925,7 +3926,7 @@
|
|
|
3925
3926
|
}
|
|
3926
3927
|
function lengthPoint(x, y) {
|
|
3927
3928
|
x0 -= x, y0 -= y;
|
|
3928
|
-
lengthSum.add(sqrt$
|
|
3929
|
+
lengthSum.add(sqrt$2(x0 * x0 + y0 * y0));
|
|
3929
3930
|
x0 = x, y0 = y;
|
|
3930
3931
|
}
|
|
3931
3932
|
var pathMeasure = lengthStream;
|
|
@@ -4128,7 +4129,7 @@
|
|
|
4128
4129
|
var a = a0 + a1,
|
|
4129
4130
|
b = b0 + b1,
|
|
4130
4131
|
c = c0 + c1,
|
|
4131
|
-
m = sqrt$
|
|
4132
|
+
m = sqrt$2(a * a + b * b + c * c),
|
|
4132
4133
|
phi2 = asin(c /= m),
|
|
4133
4134
|
lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),
|
|
4134
4135
|
p = project(lambda2, phi2),
|
|
@@ -4331,7 +4332,7 @@
|
|
|
4331
4332
|
return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;
|
|
4332
4333
|
};
|
|
4333
4334
|
projection.precision = function (_) {
|
|
4334
|
-
return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt$
|
|
4335
|
+
return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt$2(delta2);
|
|
4335
4336
|
};
|
|
4336
4337
|
projection.fitExtent = function (extent, object) {
|
|
4337
4338
|
return fitExtent(projection, extent, object);
|
|
@@ -4394,9 +4395,9 @@
|
|
|
4394
4395
|
// Are the parallels symmetrical around the Equator?
|
|
4395
4396
|
if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);
|
|
4396
4397
|
var c = 1 + sy0 * (2 * n - sy0),
|
|
4397
|
-
r0 = sqrt$
|
|
4398
|
+
r0 = sqrt$2(c) / n;
|
|
4398
4399
|
function project(x, y) {
|
|
4399
|
-
var r = sqrt$
|
|
4400
|
+
var r = sqrt$2(c - 2 * n * sin(y)) / n;
|
|
4400
4401
|
return [r * sin(x *= n), r0 - r * cos(x)];
|
|
4401
4402
|
}
|
|
4402
4403
|
project.invert = function (x, y) {
|
|
@@ -4533,7 +4534,7 @@
|
|
|
4533
4534
|
}
|
|
4534
4535
|
function azimuthalInvert(angle) {
|
|
4535
4536
|
return function (x, y) {
|
|
4536
|
-
var z = sqrt$
|
|
4537
|
+
var z = sqrt$2(x * x + y * y),
|
|
4537
4538
|
c = angle(z),
|
|
4538
4539
|
sc = sin(c),
|
|
4539
4540
|
cc = cos(c);
|
|
@@ -4542,7 +4543,7 @@
|
|
|
4542
4543
|
}
|
|
4543
4544
|
|
|
4544
4545
|
var azimuthalEqualAreaRaw = azimuthalRaw(function (cxcy) {
|
|
4545
|
-
return sqrt$
|
|
4546
|
+
return sqrt$2(2 / (1 + cxcy));
|
|
4546
4547
|
});
|
|
4547
4548
|
azimuthalEqualAreaRaw.invert = azimuthalInvert(function (z) {
|
|
4548
4549
|
return 2 * asin(z / 2);
|
|
@@ -4620,7 +4621,7 @@
|
|
|
4620
4621
|
}
|
|
4621
4622
|
project.invert = function (x, y) {
|
|
4622
4623
|
var fy = f - y,
|
|
4623
|
-
r = sign$1(n) * sqrt$
|
|
4624
|
+
r = sign$1(n) * sqrt$2(x * x + fy * fy),
|
|
4624
4625
|
l = atan2(x, abs(fy)) * sign$1(fy);
|
|
4625
4626
|
if (fy * n < 0) l -= pi * sign$1(x) * sign$1(fy);
|
|
4626
4627
|
return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi$1];
|
|
@@ -4653,7 +4654,7 @@
|
|
|
4653
4654
|
var gy = g - y,
|
|
4654
4655
|
l = atan2(x, abs(gy)) * sign$1(gy);
|
|
4655
4656
|
if (gy * n < 0) l -= pi * sign$1(x) * sign$1(gy);
|
|
4656
|
-
return [l / n, g - sign$1(n) * sqrt$
|
|
4657
|
+
return [l / n, g - sign$1(n) * sqrt$2(x * x + gy * gy)];
|
|
4657
4658
|
};
|
|
4658
4659
|
return project;
|
|
4659
4660
|
}
|
|
@@ -4665,7 +4666,7 @@
|
|
|
4665
4666
|
A2 = -0.081106,
|
|
4666
4667
|
A3 = 0.000893,
|
|
4667
4668
|
A4 = 0.003796,
|
|
4668
|
-
M = sqrt$
|
|
4669
|
+
M = sqrt$2(3) / 2,
|
|
4669
4670
|
iterations = 12;
|
|
4670
4671
|
function equalEarthRaw(lambda, phi) {
|
|
4671
4672
|
var l = asin(M * sin(phi)),
|
|
@@ -8657,7 +8658,7 @@
|
|
|
8657
8658
|
return x;
|
|
8658
8659
|
}
|
|
8659
8660
|
const generatePow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
|
|
8660
|
-
const sqrt = x => x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);
|
|
8661
|
+
const sqrt$1 = x => x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);
|
|
8661
8662
|
const square$3 = x => x < 0 ? -x * x : x * x;
|
|
8662
8663
|
const logNegative = x => -Math.log(-x);
|
|
8663
8664
|
const expNegative = x => -Math.exp(-x);
|
|
@@ -9126,7 +9127,7 @@
|
|
|
9126
9127
|
return new PowScale().domain(this._domain, !0).range(this._range, !0).unknown(this._unknown).clamp(this.clamp(), null, !0).interpolate(this._interpolate, !0).exponent(this._exponent);
|
|
9127
9128
|
}
|
|
9128
9129
|
rescale(slience) {
|
|
9129
|
-
return slience || (1 === this._exponent ? (this.transformer = identity$1, this.untransformer = identity$1) : .5 === this._exponent ? (this.transformer = sqrt, this.untransformer = square$3) : (this.transformer = generatePow(this._exponent), this.untransformer = generatePow(1 / this._exponent)), super.rescale()), this;
|
|
9130
|
+
return slience || (1 === this._exponent ? (this.transformer = identity$1, this.untransformer = identity$1) : .5 === this._exponent ? (this.transformer = sqrt$1, this.untransformer = square$3) : (this.transformer = generatePow(this._exponent), this.untransformer = generatePow(1 / this._exponent)), super.rescale()), this;
|
|
9130
9131
|
}
|
|
9131
9132
|
exponent(_, slience) {
|
|
9132
9133
|
return arguments.length ? (this._exponent = _, this.rescale(slience)) : this._exponent;
|
|
@@ -9248,7 +9249,7 @@
|
|
|
9248
9249
|
|
|
9249
9250
|
class SqrtScale extends LinearScale {
|
|
9250
9251
|
constructor() {
|
|
9251
|
-
super(sqrt, square$3), this.type = ScaleEnum.Sqrt;
|
|
9252
|
+
super(sqrt$1, square$3), this.type = ScaleEnum.Sqrt;
|
|
9252
9253
|
}
|
|
9253
9254
|
clone() {
|
|
9254
9255
|
return new SqrtScale().domain(this._domain, !0).range(this._range, !0).unknown(this._unknown).clamp(this.clamp(), null, !0).interpolate(this._interpolate);
|
|
@@ -17830,11 +17831,13 @@
|
|
|
17830
17831
|
return console.error("暂不支持该函数"), nodes;
|
|
17831
17832
|
}
|
|
17832
17833
|
insertBefore(newNode, referenceNode) {
|
|
17834
|
+
if (!referenceNode) return this.appendChild(newNode);
|
|
17833
17835
|
if (this._uid === newNode._uid) return null;
|
|
17834
17836
|
if (newNode.isAncestorsOf(this)) throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");
|
|
17835
17837
|
return referenceNode.parent !== this ? null : (newNode.parent && newNode.parent.removeChild(newNode), newNode.parent = this, newNode._prev = referenceNode._prev, referenceNode._prev ? referenceNode._prev._next = newNode : this._firstChild = newNode, referenceNode._prev = newNode, newNode._next = referenceNode, this._idMap || (this._idMap = new Map()), this._idMap.set(newNode._uid, newNode), this._structEdit = !0, this.setCount(newNode.count), newNode);
|
|
17836
17838
|
}
|
|
17837
17839
|
insertAfter(newNode, referenceNode) {
|
|
17840
|
+
if (!referenceNode) return this.appendChild(newNode);
|
|
17838
17841
|
if (this._uid === newNode._uid) return null;
|
|
17839
17842
|
if (newNode.isAncestorsOf(this)) throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");
|
|
17840
17843
|
return referenceNode.parent !== this ? null : (newNode.parent && newNode.parent.removeChild(newNode), newNode.parent = this, referenceNode._next ? (referenceNode._next._prev = newNode, newNode._next = referenceNode._next) : this._lastChild = newNode, referenceNode._next = newNode, newNode._prev = referenceNode, this._idMap || (this._idMap = new Map()), this._idMap.set(newNode._uid, newNode), this._structEdit = !0, this.setCount(newNode.count), newNode);
|
|
@@ -19653,6 +19656,24 @@
|
|
|
19653
19656
|
}
|
|
19654
19657
|
return attr[key];
|
|
19655
19658
|
}
|
|
19659
|
+
class RafBasedSTO {
|
|
19660
|
+
constructor() {
|
|
19661
|
+
this.durations = [], this.timeout = RafBasedSTO.TimeOut, this.lastDate = 0, this.durationsListThreshold = 30;
|
|
19662
|
+
}
|
|
19663
|
+
call(cb) {
|
|
19664
|
+
return this.lastDate = Date.now(), setTimeout(() => {
|
|
19665
|
+
this.appendDuration(Date.now() - this.lastDate), cb(0);
|
|
19666
|
+
}, this.timeout, !0);
|
|
19667
|
+
}
|
|
19668
|
+
clear(h) {
|
|
19669
|
+
clearTimeout(h);
|
|
19670
|
+
}
|
|
19671
|
+
appendDuration(d) {
|
|
19672
|
+
this.durations.push(d), this.durations.length > this.durationsListThreshold && this.durations.shift(), this.timeout = Math.max(this.durations.reduce((a, b) => a + b, 0) / this.durations.length, 1e3 / 60);
|
|
19673
|
+
}
|
|
19674
|
+
}
|
|
19675
|
+
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
19676
|
+
const rafBasedSto = new RafBasedSTO();
|
|
19656
19677
|
|
|
19657
19678
|
class IncreaseCount extends ACustomAnimate {
|
|
19658
19679
|
constructor(from, to, duration, easing, params) {
|
|
@@ -22447,8 +22468,8 @@
|
|
|
22447
22468
|
ay = yors - oc[1],
|
|
22448
22469
|
bx = xore - oc[0],
|
|
22449
22470
|
by = yore - oc[1],
|
|
22450
|
-
kc = 1 / sin$1(acos$1((ax * bx + ay * by) / (sqrt$
|
|
22451
|
-
lc = sqrt$
|
|
22471
|
+
kc = 1 / sin$1(acos$1((ax * bx + ay * by) / (sqrt$3(ax * ax + ay * ay) * sqrt$3(bx * bx + by * by))) / 2),
|
|
22472
|
+
lc = sqrt$3(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
22452
22473
|
limitedIcr = min$3(maxInnerCornerRadius, (innerRadius - lc) / (kc - 1)), limitedOcr = min$3(maxOuterCornerRadius, (outerRadius - lc) / (kc + 1));
|
|
22453
22474
|
}
|
|
22454
22475
|
}
|
|
@@ -22666,8 +22687,8 @@
|
|
|
22666
22687
|
ay = yors - oc[1],
|
|
22667
22688
|
bx = xore - oc[0],
|
|
22668
22689
|
by = yore - oc[1],
|
|
22669
|
-
kc = 1 / sin$1(acos$1((ax * bx + ay * by) / (sqrt$
|
|
22670
|
-
lc = sqrt$
|
|
22690
|
+
kc = 1 / sin$1(acos$1((ax * bx + ay * by) / (sqrt$3(ax * ax + ay * ay) * sqrt$3(bx * bx + by * by))) / 2),
|
|
22691
|
+
lc = sqrt$3(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
22671
22692
|
limitedIcr = min$3(maxInnerCornerRadius, (innerRadius - lc) / (kc - 1)), limitedOcr = min$3(maxOuterCornerRadius, (outerRadius - lc) / (kc + 1));
|
|
22672
22693
|
}
|
|
22673
22694
|
}
|
|
@@ -23367,7 +23388,7 @@
|
|
|
23367
23388
|
}
|
|
23368
23389
|
var star$2 = new StarSymbol();
|
|
23369
23390
|
|
|
23370
|
-
const sqrt3$1 = sqrt$
|
|
23391
|
+
const sqrt3$1 = sqrt$3(3);
|
|
23371
23392
|
function arrow(ctx, r, transX, transY) {
|
|
23372
23393
|
const triangleH = r,
|
|
23373
23394
|
trangleBottomSide = triangleH / sqrt3$1,
|
|
@@ -23434,8 +23455,8 @@
|
|
|
23434
23455
|
var stroke$1 = new StrokeSymbol();
|
|
23435
23456
|
|
|
23436
23457
|
const c$1 = -.5,
|
|
23437
|
-
s = sqrt$
|
|
23438
|
-
k = 1 / sqrt$
|
|
23458
|
+
s = sqrt$3(3) / 2,
|
|
23459
|
+
k = 1 / sqrt$3(12);
|
|
23439
23460
|
function wye(ctx, r, transX, transY) {
|
|
23440
23461
|
const x0 = r / 2,
|
|
23441
23462
|
y0 = r * k,
|
|
@@ -23531,7 +23552,7 @@
|
|
|
23531
23552
|
}
|
|
23532
23553
|
var triangleDown = new TriangleDownSymbol();
|
|
23533
23554
|
|
|
23534
|
-
const sqrt3 = sqrt$
|
|
23555
|
+
const sqrt3 = sqrt$3(3);
|
|
23535
23556
|
function thinTriangle(ctx, r, x, y) {
|
|
23536
23557
|
const h = r * sqrt3;
|
|
23537
23558
|
return ctx.moveTo(x, y + -h / 3 * 2), ctx.lineTo(r + x, y + h), ctx.lineTo(x - r, y + h), ctx.closePath(), !0;
|
|
@@ -24955,7 +24976,7 @@
|
|
|
24955
24976
|
padAngle = arcTheme.padAngle
|
|
24956
24977
|
} = this.attribute,
|
|
24957
24978
|
{
|
|
24958
|
-
padRadius = sqrt$
|
|
24979
|
+
padRadius = sqrt$3(outerRadius * outerRadius + innerRadius * innerRadius)
|
|
24959
24980
|
} = this.attribute,
|
|
24960
24981
|
deltaAngle = abs$1(endAngle - startAngle);
|
|
24961
24982
|
let outerStartAngle = startAngle,
|
|
@@ -29790,12 +29811,12 @@
|
|
|
29790
29811
|
}
|
|
29791
29812
|
getRequestAnimationFrame() {
|
|
29792
29813
|
return function (callback) {
|
|
29793
|
-
return
|
|
29814
|
+
return rafBasedSto.call(callback);
|
|
29794
29815
|
};
|
|
29795
29816
|
}
|
|
29796
29817
|
getCancelAnimationFrame() {
|
|
29797
29818
|
return h => {
|
|
29798
|
-
|
|
29819
|
+
rafBasedSto.clear(h);
|
|
29799
29820
|
};
|
|
29800
29821
|
}
|
|
29801
29822
|
addEventListener(type, listener, options) {
|
|
@@ -30050,12 +30071,12 @@
|
|
|
30050
30071
|
}
|
|
30051
30072
|
getRequestAnimationFrame() {
|
|
30052
30073
|
return function (callback) {
|
|
30053
|
-
return
|
|
30074
|
+
return rafBasedSto.call(callback);
|
|
30054
30075
|
};
|
|
30055
30076
|
}
|
|
30056
30077
|
getCancelAnimationFrame() {
|
|
30057
30078
|
return h => {
|
|
30058
|
-
|
|
30079
|
+
rafBasedSto.clear(h);
|
|
30059
30080
|
};
|
|
30060
30081
|
}
|
|
30061
30082
|
addEventListener(type, listener, options) {
|
|
@@ -30146,12 +30167,12 @@
|
|
|
30146
30167
|
}
|
|
30147
30168
|
getRequestAnimationFrame() {
|
|
30148
30169
|
return function (callback) {
|
|
30149
|
-
return
|
|
30170
|
+
return rafBasedSto.call(callback);
|
|
30150
30171
|
};
|
|
30151
30172
|
}
|
|
30152
30173
|
getCancelAnimationFrame() {
|
|
30153
30174
|
return h => {
|
|
30154
|
-
|
|
30175
|
+
rafBasedSto.clear(h);
|
|
30155
30176
|
};
|
|
30156
30177
|
}
|
|
30157
30178
|
addEventListener(type, listener, options) {}
|
|
@@ -30257,12 +30278,12 @@
|
|
|
30257
30278
|
}
|
|
30258
30279
|
getRequestAnimationFrame() {
|
|
30259
30280
|
return function (callback) {
|
|
30260
|
-
return
|
|
30281
|
+
return rafBasedSto.call(callback);
|
|
30261
30282
|
};
|
|
30262
30283
|
}
|
|
30263
30284
|
getCancelAnimationFrame() {
|
|
30264
30285
|
return h => {
|
|
30265
|
-
|
|
30286
|
+
rafBasedSto.clear(h);
|
|
30266
30287
|
};
|
|
30267
30288
|
}
|
|
30268
30289
|
addEventListener(type, listener, options) {
|
|
@@ -34607,7 +34628,7 @@
|
|
|
34607
34628
|
constructor(dir, color) {
|
|
34608
34629
|
let ambient = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .8;
|
|
34609
34630
|
this.dir = dir, this.color = color, this.colorRgb = colorString.get(color).value, this.colorRgb[0] /= 255, this.colorRgb[1] /= 255, this.colorRgb[2] /= 255, this.ambient = ambient;
|
|
34610
|
-
const length = sqrt$
|
|
34631
|
+
const length = sqrt$3(dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2]);
|
|
34611
34632
|
this.formatedDir = [dir[0] / length, dir[1] / length, dir[2] / length];
|
|
34612
34633
|
}
|
|
34613
34634
|
computeColor(normal, color) {
|
|
@@ -35659,10 +35680,12 @@
|
|
|
35659
35680
|
};
|
|
35660
35681
|
|
|
35661
35682
|
const transform$9 = (options, upstreamData) => {
|
|
35683
|
+
var _a;
|
|
35662
35684
|
const positiveValues = new Map(),
|
|
35663
35685
|
negativeValues = new Map(),
|
|
35664
35686
|
needSum = options.asPercentStack || options.asPrevPercentStack || options.asPercent || options.asSum,
|
|
35665
|
-
|
|
35687
|
+
orient = null !== (_a = options.orient) && void 0 !== _a ? _a : "positive",
|
|
35688
|
+
data = "negative" === orient ? upstreamData.slice().reverse() : upstreamData,
|
|
35666
35689
|
defaultDimValue = Symbol("dim");
|
|
35667
35690
|
let stackedValues = data.map(datum => {
|
|
35668
35691
|
var _a, _b, _c;
|
|
@@ -35693,7 +35716,7 @@
|
|
|
35693
35716
|
newDatum = Object.assign({}, datum),
|
|
35694
35717
|
sum = null !== (_a = (value >= 0 ? positiveValues : negativeValues).get(dimension)) && void 0 !== _a ? _a : 0;
|
|
35695
35718
|
return options.asSum && (newDatum[options.asSum] = sum), options.asPercent && (newDatum[options.asPercent] = 0 === sum ? 0 : value / sum), options.asPercentStack && (newDatum[options.asPercentStack] = 0 === sum ? 0 : stack / sum), options.asPrevPercentStack && (newDatum[options.asPrevPercentStack] = 0 === sum ? 0 : prevStack / sum), options.asPrevStack && (newDatum[options.asPrevStack] = prevStack), newDatum[null !== (_b = options.asStack) && void 0 !== _b ? _b : options.stackField] = stack, newDatum;
|
|
35696
|
-
})), "negative" ===
|
|
35719
|
+
})), "negative" === orient ? stackedValues.reverse() : stackedValues;
|
|
35697
35720
|
};
|
|
35698
35721
|
|
|
35699
35722
|
const transform$8 = (options, upstreamData) => {
|
|
@@ -36164,9 +36187,9 @@
|
|
|
36164
36187
|
}
|
|
36165
36188
|
}],
|
|
36166
36189
|
[GrammarMarkType.area]: [{
|
|
36167
|
-
channels: ["x", "y", "x1", "y1"
|
|
36190
|
+
channels: ["x", "y", "x1", "y1"],
|
|
36168
36191
|
transform: (graphicAttributes, nextAttrs, storedAttrs) => {
|
|
36169
|
-
graphicAttributes.x = 0, graphicAttributes.y = 0;
|
|
36192
|
+
graphicAttributes.x = 0, graphicAttributes.y = 0, graphicAttributes.x1 = 0, graphicAttributes.y1 = 0;
|
|
36170
36193
|
}
|
|
36171
36194
|
}],
|
|
36172
36195
|
[GrammarMarkType.line]: [{
|
|
@@ -37996,7 +38019,7 @@
|
|
|
37996
38019
|
y: y
|
|
37997
38020
|
}
|
|
37998
38021
|
};
|
|
37999
|
-
return isValidNumber(min) && (animateAttributes.to.min = center, animateAttributes.from.min = min), isValidNumber(max) && (animateAttributes.to.max = center, animateAttributes.from.max = max), isValidNumber(q1) && (animateAttributes.to.q1 = center, animateAttributes.from.q1 = q1), isValidNumber(q3) && (animateAttributes.to.q3 = center, animateAttributes.from.q3 = q3), isValidNumber(median) && (animateAttributes.to.median = center, animateAttributes.from.median =
|
|
38022
|
+
return isValidNumber(min) && (animateAttributes.to.min = center, animateAttributes.from.min = min), isValidNumber(max) && (animateAttributes.to.max = center, animateAttributes.from.max = max), isValidNumber(q1) && (animateAttributes.to.q1 = center, animateAttributes.from.q1 = q1), isValidNumber(q3) && (animateAttributes.to.q3 = center, animateAttributes.from.q3 = q3), isValidNumber(median) && (animateAttributes.to.median = center, animateAttributes.from.median = median), animateAttributes;
|
|
38000
38023
|
},
|
|
38001
38024
|
computeBoxplotCenter = (glyphElement, direction, options) => {
|
|
38002
38025
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
@@ -38082,6 +38105,8 @@
|
|
|
38082
38105
|
x1: x + width / 2
|
|
38083
38106
|
}))), attributes;
|
|
38084
38107
|
};
|
|
38108
|
+
const boxplotScaleIn = scaleIn(computeBoxplotCenter);
|
|
38109
|
+
const boxplotScaleOut = scaleOut(computeBoxplotCenter);
|
|
38085
38110
|
function registerBoxplotGlyph() {
|
|
38086
38111
|
registerGlyph("boxplot", {
|
|
38087
38112
|
shaft: "rule",
|
|
@@ -38199,7 +38224,7 @@
|
|
|
38199
38224
|
median: {
|
|
38200
38225
|
visible: !1
|
|
38201
38226
|
}
|
|
38202
|
-
})), registerAnimationType("boxplotScaleIn",
|
|
38227
|
+
})), registerAnimationType("boxplotScaleIn", boxplotScaleIn), registerAnimationType("boxplotScaleOut", boxplotScaleOut);
|
|
38203
38228
|
}
|
|
38204
38229
|
const computeBarBoxplotCenter = (glyphElement, direction, options) => {
|
|
38205
38230
|
var _a, _b, _c, _d;
|
|
@@ -38277,6 +38302,8 @@
|
|
|
38277
38302
|
x1: x + width / 2
|
|
38278
38303
|
}))), attributes;
|
|
38279
38304
|
};
|
|
38305
|
+
const barBoxplotScaleIn = scaleIn(computeBarBoxplotCenter);
|
|
38306
|
+
const barBoxplotScaleOut = scaleOut(computeBarBoxplotCenter);
|
|
38280
38307
|
function registerBarBoxplotGlyph() {
|
|
38281
38308
|
registerGlyph("barBoxplot", {
|
|
38282
38309
|
minMaxBox: "rect",
|
|
@@ -38371,7 +38398,7 @@
|
|
|
38371
38398
|
median: {
|
|
38372
38399
|
visible: !1
|
|
38373
38400
|
}
|
|
38374
|
-
})), registerAnimationType("barBoxplotScaleIn",
|
|
38401
|
+
})), registerAnimationType("barBoxplotScaleIn", barBoxplotScaleIn), registerAnimationType("barBoxplotScaleOut", barBoxplotScaleOut);
|
|
38375
38402
|
}
|
|
38376
38403
|
|
|
38377
38404
|
const getHorizontalPath = (options, ratio) => {
|
|
@@ -38622,7 +38649,7 @@
|
|
|
38622
38649
|
Object.keys(from).forEach(channel => {
|
|
38623
38650
|
isNil(from[channel]) && delete from[channel];
|
|
38624
38651
|
});
|
|
38625
|
-
const computePoints = isValidPointsChannel(Object.keys(from), element.mark.markType);
|
|
38652
|
+
const computePoints = isValidPointsChannel(Object.keys(from), element.mark.markType) && !isValid(from.segments);
|
|
38626
38653
|
if (computePoints) {
|
|
38627
38654
|
const items = element.items.map(item => Object.assign({}, item, {
|
|
38628
38655
|
nextAttrs: from
|
|
@@ -38635,7 +38662,7 @@
|
|
|
38635
38662
|
Object.keys(to).forEach(channel => {
|
|
38636
38663
|
isNil(to[channel]) && delete to[channel];
|
|
38637
38664
|
});
|
|
38638
|
-
const computePoints = isValidPointsChannel(Object.keys(to), element.mark.markType);
|
|
38665
|
+
const computePoints = isValidPointsChannel(Object.keys(to), element.mark.markType) && !isValid(to.segments);
|
|
38639
38666
|
if (computePoints) {
|
|
38640
38667
|
const items = element.items.map(item => Object.assign({}, item, {
|
|
38641
38668
|
nextAttrs: to
|
|
@@ -39445,10 +39472,11 @@
|
|
|
39445
39472
|
});
|
|
39446
39473
|
}
|
|
39447
39474
|
encodeCustom(nextAttrs) {
|
|
39475
|
+
var _a;
|
|
39448
39476
|
let customEncodeValues = {};
|
|
39449
39477
|
const channelEncoder = this.glyphMeta.getChannelEncoder(),
|
|
39450
39478
|
functionEncoder = this.glyphMeta.getFunctionEncoder();
|
|
39451
|
-
if (functionEncoder && (customEncodeValues = functionEncoder.call(null, nextAttrs, this.getDatum(), this, this.mark.getGlyphConfig())), channelEncoder) {
|
|
39479
|
+
if (functionEncoder && (customEncodeValues = functionEncoder.call(null, Object.assign({}, null === (_a = this.graphicItem) || void 0 === _a ? void 0 : _a.attribute, nextAttrs), this.getDatum(), this, this.mark.getGlyphConfig())), channelEncoder) {
|
|
39452
39480
|
let allAttrs;
|
|
39453
39481
|
Object.keys(channelEncoder).forEach(channel => {
|
|
39454
39482
|
var _a;
|
|
@@ -39834,7 +39862,7 @@
|
|
|
39834
39862
|
}
|
|
39835
39863
|
getScalesByChannel() {
|
|
39836
39864
|
const encoders = this.spec.encode;
|
|
39837
|
-
if (!encoders) return;
|
|
39865
|
+
if (!encoders) return {};
|
|
39838
39866
|
const res = {},
|
|
39839
39867
|
params = this.parameters();
|
|
39840
39868
|
return Object.keys(encoders).forEach(state => {
|
|
@@ -40575,8 +40603,7 @@
|
|
|
40575
40603
|
maxWidth: maxWidth,
|
|
40576
40604
|
padding = 4,
|
|
40577
40605
|
visible: visible,
|
|
40578
|
-
state: state
|
|
40579
|
-
formatMethod: formatMethod
|
|
40606
|
+
state: state
|
|
40580
40607
|
} = this.attribute,
|
|
40581
40608
|
parsedPadding = normalizePadding$1(padding),
|
|
40582
40609
|
group = this.createOrUpdateChild("tag-content", {
|
|
@@ -40608,7 +40635,7 @@
|
|
|
40608
40635
|
}
|
|
40609
40636
|
tagWidth += symbolPlaceWidth, textX += symbolPlaceWidth;
|
|
40610
40637
|
const textAttrs = Object.assign(Object.assign({
|
|
40611
|
-
text:
|
|
40638
|
+
text: text,
|
|
40612
40639
|
visible: isValid(text) && !1 !== visible,
|
|
40613
40640
|
lineHeight: null == textStyle ? void 0 : textStyle.fontSize
|
|
40614
40641
|
}, textStyle), {
|
|
@@ -41275,6 +41302,7 @@
|
|
|
41275
41302
|
x2: x2,
|
|
41276
41303
|
y2: y2
|
|
41277
41304
|
} = _ref;
|
|
41305
|
+
if (x2 < 0 || y2 < 0 || x1 > w || y1 > h) return !0;
|
|
41278
41306
|
let start,
|
|
41279
41307
|
end,
|
|
41280
41308
|
indexStart,
|
|
@@ -41296,6 +41324,7 @@
|
|
|
41296
41324
|
x2: x2,
|
|
41297
41325
|
y2: y2
|
|
41298
41326
|
} = _ref2;
|
|
41327
|
+
if (x2 < 0 || y2 < 0 || x1 > w || y1 > h) return;
|
|
41299
41328
|
let start, end, indexStart, indexEnd, i;
|
|
41300
41329
|
for (; y1 <= y2; ++y1) if (start = y1 * w + x1, end = y1 * w + x2, indexStart = start >>> 5, indexEnd = end >>> 5, indexStart === indexEnd) _set(indexStart, RIGHT0[31 & start] & RIGHT1[1 + (31 & end)]);else for (_set(indexStart, RIGHT0[31 & start]), _set(indexEnd, RIGHT1[1 + (31 & end)]), i = indexStart + 1; i < indexEnd; ++i) _set(i, 4294967295);
|
|
41301
41330
|
},
|
|
@@ -41415,6 +41444,24 @@
|
|
|
41415
41444
|
function defaultLabelPosition(type) {
|
|
41416
41445
|
return "rect" === type ? DefaultRectPositions : DefaultPositions;
|
|
41417
41446
|
}
|
|
41447
|
+
function clampText(text, width, height) {
|
|
41448
|
+
const {
|
|
41449
|
+
x1: x1,
|
|
41450
|
+
x2: x2,
|
|
41451
|
+
y1: y1,
|
|
41452
|
+
y2: y2
|
|
41453
|
+
} = text.AABBBounds,
|
|
41454
|
+
minX = Math.min(x1, x2),
|
|
41455
|
+
maxX = Math.max(x1, x2),
|
|
41456
|
+
minY = Math.min(y1, y2),
|
|
41457
|
+
maxY = Math.max(y1, y2);
|
|
41458
|
+
let dx = 0,
|
|
41459
|
+
dy = 0;
|
|
41460
|
+
return minX < 0 && maxX - minX <= width ? dx = -minX : maxX > width && minX - (maxX - width) >= 0 && (dx = width - maxX), minY < 0 && maxY - minY <= height ? dy = -minY : maxY > height && minY - (maxY - height) >= 0 && (dy = height - maxY), {
|
|
41461
|
+
dx: dx,
|
|
41462
|
+
dy: dy
|
|
41463
|
+
};
|
|
41464
|
+
}
|
|
41418
41465
|
|
|
41419
41466
|
const fadeIn = function () {
|
|
41420
41467
|
let textAttribute = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -41493,9 +41540,17 @@
|
|
|
41493
41540
|
this._bmpTool = bmpTool;
|
|
41494
41541
|
}
|
|
41495
41542
|
render() {
|
|
41496
|
-
|
|
41497
|
-
|
|
41498
|
-
|
|
41543
|
+
this._prepare();
|
|
41544
|
+
const {
|
|
41545
|
+
overlap: overlap,
|
|
41546
|
+
smartInvert: smartInvert,
|
|
41547
|
+
dataFilter: dataFilter,
|
|
41548
|
+
customLayoutFunc: customLayoutFunc,
|
|
41549
|
+
customOverlapFunc: customOverlapFunc
|
|
41550
|
+
} = this.attribute;
|
|
41551
|
+
let labels,
|
|
41552
|
+
data = this.attribute.data;
|
|
41553
|
+
isFunction(dataFilter) && (data = dataFilter(data)), isFunction(customLayoutFunc) ? labels = customLayoutFunc(data, d => this._idToGraphic.get(d.id)) : (labels = this.layout(data), isFunction(customOverlapFunc) ? labels = customOverlapFunc(labels, d => this._idToGraphic.get(d.id)) : !1 !== overlap && (labels = this._overlapping(labels))), !1 !== smartInvert && this._smartInvert(labels), this._renderLabels(labels);
|
|
41499
41554
|
}
|
|
41500
41555
|
_bindEvent(target) {
|
|
41501
41556
|
if (!target) return;
|
|
@@ -41514,52 +41569,53 @@
|
|
|
41514
41569
|
const text = createText(attributes);
|
|
41515
41570
|
return this._bindEvent(text), this._setStates(text), text;
|
|
41516
41571
|
}
|
|
41517
|
-
|
|
41572
|
+
_prepare() {
|
|
41518
41573
|
var _a;
|
|
41519
41574
|
const baseMarks = this.getBaseMarks(),
|
|
41520
41575
|
currentBaseMarks = [];
|
|
41521
|
-
|
|
41576
|
+
if (baseMarks.forEach(mark => {
|
|
41522
41577
|
"willRelease" !== mark.releaseStatus && currentBaseMarks.push(mark);
|
|
41523
|
-
}),
|
|
41524
|
-
}
|
|
41525
|
-
layout(currentMarks) {
|
|
41578
|
+
}), null === (_a = this._idToGraphic) || void 0 === _a || _a.clear(), this._baseMarks = currentBaseMarks, !currentBaseMarks || 0 === currentBaseMarks.length) return;
|
|
41526
41579
|
const {
|
|
41527
|
-
textStyle: textStyle,
|
|
41528
|
-
position: position,
|
|
41529
|
-
offset: offset
|
|
41530
|
-
} = this.attribute;
|
|
41531
|
-
let {
|
|
41532
41580
|
data: data
|
|
41533
41581
|
} = this.attribute;
|
|
41534
|
-
if (
|
|
41535
|
-
|
|
41536
|
-
|
|
41582
|
+
if (data && 0 !== data.length) {
|
|
41583
|
+
this._idToGraphic || (this._idToGraphic = new Map());
|
|
41584
|
+
for (let i = 0; i < currentBaseMarks.length; i++) {
|
|
41585
|
+
const textData = data[i],
|
|
41586
|
+
baseMark = currentBaseMarks[i];
|
|
41587
|
+
textData && baseMark && (isValid(textData.id) || (textData.id = `vrender-component-${this.name}-${i}`), this._idToGraphic.set(textData.id, baseMark));
|
|
41588
|
+
}
|
|
41589
|
+
}
|
|
41590
|
+
}
|
|
41591
|
+
layout() {
|
|
41592
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
41593
|
+
const {
|
|
41594
|
+
textStyle = {},
|
|
41595
|
+
position: position,
|
|
41596
|
+
offset: offset
|
|
41597
|
+
} = this.attribute,
|
|
41598
|
+
labels = [];
|
|
41537
41599
|
for (let i = 0; i < data.length; i++) {
|
|
41538
41600
|
const textData = data[i],
|
|
41539
|
-
baseMark =
|
|
41540
|
-
labelAttribute = Object.assign(Object.assign(
|
|
41541
|
-
|
|
41542
|
-
|
|
41543
|
-
|
|
41544
|
-
|
|
41545
|
-
|
|
41546
|
-
|
|
41547
|
-
|
|
41548
|
-
|
|
41549
|
-
y: textData.y
|
|
41550
|
-
}),
|
|
41551
|
-
textAttributes = this.labeling(textBounds, graphicBounds, isFunction(position) ? position(textData) : position, offset);
|
|
41552
|
-
if (!textAttributes) continue;
|
|
41553
|
-
labelAttribute.x = textAttributes.x, labelAttribute.y = textAttributes.y, labels.push(labelAttribute);
|
|
41554
|
-
}
|
|
41601
|
+
baseMark = this._idToGraphic.get(textData.id),
|
|
41602
|
+
labelAttribute = Object.assign(Object.assign({}, textStyle), textData),
|
|
41603
|
+
text = this._createLabelText(labelAttribute),
|
|
41604
|
+
textBounds = this.getGraphicBounds(text),
|
|
41605
|
+
graphicBounds = this.getGraphicBounds(baseMark, {
|
|
41606
|
+
x: textData.x,
|
|
41607
|
+
y: textData.y
|
|
41608
|
+
}),
|
|
41609
|
+
textLocation = this.labeling(textBounds, graphicBounds, isFunction(position) ? position(textData) : position, offset);
|
|
41610
|
+
textLocation && (labelAttribute.x = textLocation.x, labelAttribute.y = textLocation.y, text.setAttributes(textLocation), labels.push(text));
|
|
41555
41611
|
}
|
|
41556
|
-
return
|
|
41612
|
+
return labels;
|
|
41557
41613
|
}
|
|
41558
|
-
|
|
41559
|
-
|
|
41560
|
-
var _a, _b, _c, _d, _e;
|
|
41614
|
+
_overlapping(labels) {
|
|
41615
|
+
var _a, _b, _c, _d;
|
|
41561
41616
|
if (0 === labels.length) return [];
|
|
41562
|
-
const
|
|
41617
|
+
const option = this.attribute.overlap,
|
|
41618
|
+
result = [],
|
|
41563
41619
|
baseMarkGroup = this.getBaseMarkGroup(),
|
|
41564
41620
|
size = null !== (_a = option.size) && void 0 !== _a ? _a : {
|
|
41565
41621
|
width: null !== (_b = null == baseMarkGroup ? void 0 : baseMarkGroup.AABBBounds.width()) && void 0 !== _b ? _b : 0,
|
|
@@ -41580,27 +41636,45 @@
|
|
|
41580
41636
|
}));
|
|
41581
41637
|
for (let i = 0; i < labels.length; i++) {
|
|
41582
41638
|
if (!1 === labels[i].visible) continue;
|
|
41583
|
-
const text =
|
|
41584
|
-
baseMark =
|
|
41639
|
+
const text = labels[i],
|
|
41640
|
+
baseMark = this._idToGraphic.get(text.attribute.id);
|
|
41585
41641
|
if (text.update(), canPlace(bmpTool, bitmap, text.AABBBounds, clampForce)) {
|
|
41586
41642
|
if (!checkBounds) {
|
|
41587
|
-
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(
|
|
41643
|
+
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
41588
41644
|
continue;
|
|
41589
41645
|
}
|
|
41590
41646
|
if (checkBounds && (null == baseMark ? void 0 : baseMark.AABBBounds) && canPlaceInside(text.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds)) {
|
|
41591
|
-
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(
|
|
41647
|
+
bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
41592
41648
|
continue;
|
|
41593
41649
|
}
|
|
41594
41650
|
}
|
|
41595
41651
|
let hasPlace = !1;
|
|
41596
41652
|
for (let j = 0; j < strategy.length; j++) if (hasPlace = place$2(bmpTool, bitmap, strategy[j], this.attribute, text, this.getGraphicBounds(baseMark, labels[i]), this.labeling), !1 !== hasPlace) {
|
|
41597
|
-
|
|
41653
|
+
text.setAttributes({
|
|
41598
41654
|
x: hasPlace.x,
|
|
41599
41655
|
y: hasPlace.y
|
|
41600
|
-
}));
|
|
41656
|
+
}), result.push(text);
|
|
41601
41657
|
break;
|
|
41602
41658
|
}
|
|
41603
|
-
|
|
41659
|
+
if (clampForce) {
|
|
41660
|
+
const {
|
|
41661
|
+
dx = 0,
|
|
41662
|
+
dy = 0
|
|
41663
|
+
} = clampText(text, bmpTool.width, bmpTool.height);
|
|
41664
|
+
if ((0 !== dx || 0 !== dy) && canPlace(bmpTool, bitmap, {
|
|
41665
|
+
x1: text.AABBBounds.x1 + dx,
|
|
41666
|
+
x2: text.AABBBounds.x2 + dx,
|
|
41667
|
+
y1: text.AABBBounds.y1 + dy,
|
|
41668
|
+
y2: text.AABBBounds.y2 + dy
|
|
41669
|
+
})) {
|
|
41670
|
+
text.setAttributes({
|
|
41671
|
+
x: text.attribute.x + dx,
|
|
41672
|
+
y: text.attribute.y + dy
|
|
41673
|
+
}), bitmap.setRange(boundToRange(bmpTool, text.AABBBounds, !0)), result.push(text);
|
|
41674
|
+
continue;
|
|
41675
|
+
}
|
|
41676
|
+
}
|
|
41677
|
+
!hasPlace && !hideOnHit && result.push(text);
|
|
41604
41678
|
}
|
|
41605
41679
|
return isFunction(this.onAfterLabelOverlap) && this.onAfterLabelOverlap(bitmap), result;
|
|
41606
41680
|
}
|
|
@@ -41632,17 +41706,16 @@
|
|
|
41632
41706
|
easing = null !== (_d = animationConfig.easing) && void 0 !== _d ? _d : DefaultLabelAnimation.easing,
|
|
41633
41707
|
delay = null !== (_e = animationConfig.delay) && void 0 !== _e ? _e : 0,
|
|
41634
41708
|
currentTextMap = new Map(),
|
|
41635
|
-
prevTextMap = this.
|
|
41709
|
+
prevTextMap = this._graphicToText || new Map(),
|
|
41636
41710
|
texts = [];
|
|
41637
|
-
labels.forEach((
|
|
41638
|
-
const
|
|
41639
|
-
relatedGraphic = this._relationMap.get(label._relatedIndex),
|
|
41711
|
+
labels.forEach((text, index) => {
|
|
41712
|
+
const relatedGraphic = this._idToGraphic.get(text.attribute.id),
|
|
41640
41713
|
state = (null == prevTextMap ? void 0 : prevTextMap.get(relatedGraphic)) ? "update" : "enter";
|
|
41641
41714
|
if ("enter" === state) if (texts.push(text), currentTextMap.set(relatedGraphic, text), !disableAnimation && relatedGraphic) {
|
|
41642
41715
|
const {
|
|
41643
41716
|
from: from,
|
|
41644
41717
|
to: to
|
|
41645
|
-
} = getAnimationAttributes(
|
|
41718
|
+
} = getAnimationAttributes(text.attribute, "fadeIn");
|
|
41646
41719
|
this.add(text), relatedGraphic.onAnimateBind = () => {
|
|
41647
41720
|
text.setAttributes(from);
|
|
41648
41721
|
const listener = this._afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, {
|
|
@@ -41667,7 +41740,7 @@
|
|
|
41667
41740
|
disableAnimation ? this.removeChild(label) : null == label || label.animate().to(getAnimationAttributes(label.attribute, "fadeOut").to, duration, easing).onEnd(() => {
|
|
41668
41741
|
this.removeChild(label);
|
|
41669
41742
|
});
|
|
41670
|
-
}), this.
|
|
41743
|
+
}), this._graphicToText = currentTextMap;
|
|
41671
41744
|
}
|
|
41672
41745
|
_afterRelatedGraphicAttributeUpdate(text, texts, index, relatedGraphic, _ref) {
|
|
41673
41746
|
let {
|
|
@@ -41710,21 +41783,32 @@
|
|
|
41710
41783
|
return listener;
|
|
41711
41784
|
}
|
|
41712
41785
|
_smartInvert(labels) {
|
|
41713
|
-
|
|
41714
|
-
|
|
41715
|
-
|
|
41786
|
+
const option = this.attribute.smartInvert || {},
|
|
41787
|
+
{
|
|
41788
|
+
textType: textType,
|
|
41789
|
+
contrastRatiosThreshold: contrastRatiosThreshold,
|
|
41790
|
+
alternativeColors: alternativeColors
|
|
41791
|
+
} = option;
|
|
41792
|
+
for (let i = 0; i < labels.length; i++) {
|
|
41793
|
+
const label = labels[i];
|
|
41716
41794
|
if (!label) continue;
|
|
41717
|
-
const
|
|
41718
|
-
|
|
41719
|
-
|
|
41720
|
-
|
|
41721
|
-
|
|
41722
|
-
|
|
41723
|
-
|
|
41724
|
-
label.
|
|
41725
|
-
|
|
41726
|
-
|
|
41727
|
-
|
|
41795
|
+
const baseMark = this._idToGraphic.get(label.attribute.id),
|
|
41796
|
+
isInside = canPlaceInside(label.AABBBounds, null == baseMark ? void 0 : baseMark.AABBBounds);
|
|
41797
|
+
if (label.attribute.stroke && label.attribute.lineWidth > 0) label.setAttributes({
|
|
41798
|
+
fill: labelSmartInvert(label.attribute.fill, label.attribute.stroke, textType, contrastRatiosThreshold, alternativeColors)
|
|
41799
|
+
});else if (isInside) {
|
|
41800
|
+
const backgroundColor = baseMark.attribute.fill,
|
|
41801
|
+
foregroundColor = label.attribute.fill;
|
|
41802
|
+
label.setAttributes({
|
|
41803
|
+
fill: labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors)
|
|
41804
|
+
});
|
|
41805
|
+
} else if (label.attribute.lineWidth > 0) {
|
|
41806
|
+
const backgroundColor = label.attribute.stroke,
|
|
41807
|
+
foregroundColor = label.attribute.fill;
|
|
41808
|
+
label.setAttributes({
|
|
41809
|
+
stroke: baseMark.attribute.fill,
|
|
41810
|
+
fill: labelSmartInvert(foregroundColor, backgroundColor, textType, contrastRatiosThreshold, alternativeColors)
|
|
41811
|
+
});
|
|
41728
41812
|
}
|
|
41729
41813
|
}
|
|
41730
41814
|
}
|
|
@@ -42107,6 +42191,9 @@
|
|
|
42107
42191
|
line.name = "line", line.id = this._getNodeId("line"), isEmpty(null == state ? void 0 : state.line) || (line.states = state.line), this.line = line, this.add(line);
|
|
42108
42192
|
}
|
|
42109
42193
|
renderSymbol(attribute, dim) {
|
|
42194
|
+
const {
|
|
42195
|
+
autoRotate = !0
|
|
42196
|
+
} = attribute;
|
|
42110
42197
|
let symbol;
|
|
42111
42198
|
if (null == attribute ? void 0 : attribute.visible) {
|
|
42112
42199
|
const startAngle = this._startAngle,
|
|
@@ -42135,7 +42222,7 @@
|
|
|
42135
42222
|
}, rotate = endAngle + Math.PI / 2), symbol = createSymbol(Object.assign(Object.assign(Object.assign({}, position), {
|
|
42136
42223
|
symbolType: symbolType,
|
|
42137
42224
|
size: size,
|
|
42138
|
-
angle: rotate + refAngle,
|
|
42225
|
+
angle: autoRotate ? rotate + refAngle : 0,
|
|
42139
42226
|
strokeBoundsBuffer: 0
|
|
42140
42227
|
}), style)), symbol.name = `${dim}-symbol`, symbol.id = this._getNodeId(`${dim}-symbol`), isEmpty(null == state ? void 0 : state.symbol) || (symbol.states = state.symbol), this.add(symbol);
|
|
42141
42228
|
}
|
|
@@ -42156,6 +42243,7 @@
|
|
|
42156
42243
|
},
|
|
42157
42244
|
startSymbol: {
|
|
42158
42245
|
visible: !1,
|
|
42246
|
+
autoRotate: !0,
|
|
42159
42247
|
symbolType: "triangle",
|
|
42160
42248
|
size: 12,
|
|
42161
42249
|
refX: 0,
|
|
@@ -42168,6 +42256,7 @@
|
|
|
42168
42256
|
},
|
|
42169
42257
|
endSymbol: {
|
|
42170
42258
|
visible: !1,
|
|
42259
|
+
autoRotate: !0,
|
|
42171
42260
|
symbolType: "triangle",
|
|
42172
42261
|
size: 12,
|
|
42173
42262
|
refX: 0,
|
|
@@ -47840,7 +47929,7 @@
|
|
|
47840
47929
|
super(view, ComponentEnum.axis, group), this.spec.componentType = ComponentEnum.axis, this.spec.axisType = "line", this.mode = mode;
|
|
47841
47930
|
}
|
|
47842
47931
|
parseAddition(spec) {
|
|
47843
|
-
return super.parseAddition(spec), this.tickCount(spec.tickCount), this.inside(spec.inside), this.baseValue(spec.baseValue), this;
|
|
47932
|
+
return super.parseAddition(spec), this.axisType(spec.axisType), this.tickCount(spec.tickCount), this.inside(spec.inside), this.baseValue(spec.baseValue), this;
|
|
47844
47933
|
}
|
|
47845
47934
|
axisType(axisType) {
|
|
47846
47935
|
return this.spec.axisType = axisType, this._axisComponentType = null, this._prepareRejoin(), this.commit(), this;
|
|
@@ -49617,7 +49706,7 @@
|
|
|
49617
49706
|
isSub = rangeSpec.isSubshaft,
|
|
49618
49707
|
reversed = rangeSpec.reversed,
|
|
49619
49708
|
coordinate = this.parameters()[coord];
|
|
49620
|
-
return null == coordinate ? void 0 : coordinate.
|
|
49709
|
+
return null == coordinate ? void 0 : coordinate.getVisualPositionByDimension(dim, isSub, reversed);
|
|
49621
49710
|
}
|
|
49622
49711
|
return null;
|
|
49623
49712
|
}
|
|
@@ -50052,7 +50141,7 @@
|
|
|
50052
50141
|
res = this.isMainDimension(dim) ? [start.x, end.x] : [end.y, start.y];
|
|
50053
50142
|
return reversed ? [res[1], res[0]] : res;
|
|
50054
50143
|
}
|
|
50055
|
-
|
|
50144
|
+
getVisualPositionByDimension(dim, isSubshaft, reversed) {
|
|
50056
50145
|
return this.isMainDimension(dim) ? isSubshaft ? "top" : "bottom" : isSubshaft ? "right" : "left";
|
|
50057
50146
|
}
|
|
50058
50147
|
getAxisPointsByDimension(dim, isSubshaft, reversed, baseValue) {
|
|
@@ -50199,7 +50288,7 @@
|
|
|
50199
50288
|
const res = this.isMainDimension(dim) ? [this.startAngle, this.endAngle] : [this.innerRadius, this.outerRadius];
|
|
50200
50289
|
return reversed ? [res[1], res[0]] : res;
|
|
50201
50290
|
}
|
|
50202
|
-
|
|
50291
|
+
getVisualPositionByDimension(dim, isSubshaft, reversed) {
|
|
50203
50292
|
return this.isMainDimension(dim) ? isSubshaft ? "inside" : "outside" : isSubshaft ? "end" : "start";
|
|
50204
50293
|
}
|
|
50205
50294
|
getAxisPointsByDimension(dim, isSubshaft, reversed, baseValue) {
|
|
@@ -52716,12 +52805,12 @@
|
|
|
52716
52805
|
},
|
|
52717
52806
|
textStyle: {
|
|
52718
52807
|
fontSize: THEME_CONSTANTS.TITLE_FONT_SIZE,
|
|
52719
|
-
|
|
52808
|
+
fill: { type: 'palette', key: 'titleFontColor' }
|
|
52720
52809
|
},
|
|
52721
52810
|
subtextStyle: {
|
|
52722
52811
|
fontSize: THEME_CONSTANTS.LABEL_FONT_SIZE,
|
|
52723
52812
|
lineHeight: THEME_CONSTANTS.TITLE_FONT_SIZE,
|
|
52724
|
-
|
|
52813
|
+
fill: { type: 'palette', key: 'labelFontColor' }
|
|
52725
52814
|
}
|
|
52726
52815
|
};
|
|
52727
52816
|
|
|
@@ -52844,7 +52933,8 @@
|
|
|
52844
52933
|
mark: markByType,
|
|
52845
52934
|
markByName,
|
|
52846
52935
|
series,
|
|
52847
|
-
component
|
|
52936
|
+
component,
|
|
52937
|
+
animationThreshold: 2000
|
|
52848
52938
|
};
|
|
52849
52939
|
|
|
52850
52940
|
const buildinThemeMap = new Map([
|
|
@@ -58170,7 +58260,7 @@
|
|
|
58170
58260
|
VChart.useMark([ComponentMark, GroupMark, ImageMark]);
|
|
58171
58261
|
Factory.registerRegion('region', Region);
|
|
58172
58262
|
Factory.registerLayout('base', Layout);
|
|
58173
|
-
const version = "1.2.0-beta.
|
|
58263
|
+
const version = "1.2.0-beta.5";
|
|
58174
58264
|
Logger.getInstance(LoggerLevel.Error);
|
|
58175
58265
|
|
|
58176
58266
|
var SeriesMarkNameEnum;
|
|
@@ -58756,12 +58846,12 @@
|
|
|
58756
58846
|
init(options = {}) {
|
|
58757
58847
|
this.initRegion();
|
|
58758
58848
|
this.initSeries();
|
|
58759
|
-
this.updateGlobalScaleDomain();
|
|
58760
58849
|
this.initComponent();
|
|
58761
58850
|
this.initEvent();
|
|
58762
58851
|
this._stack.init();
|
|
58763
58852
|
this._series.forEach(s => s.getRawData()?.markRunning());
|
|
58764
58853
|
this._series.forEach(s => s.fillData());
|
|
58854
|
+
this.updateGlobalScaleDomain();
|
|
58765
58855
|
}
|
|
58766
58856
|
onResize(width, height) {
|
|
58767
58857
|
const canvasRect = {
|
|
@@ -59362,6 +59452,7 @@
|
|
|
59362
59452
|
label: spec.label,
|
|
59363
59453
|
seriesStyle: spec.seriesStyle,
|
|
59364
59454
|
animation: spec.animation,
|
|
59455
|
+
animationThreshold: spec.animationThreshold ?? this._theme.animationThreshold,
|
|
59365
59456
|
animationAppear: spec.animationAppear,
|
|
59366
59457
|
animationDisappear: spec.animationDisappear,
|
|
59367
59458
|
animationEnter: spec.animationEnter,
|
|
@@ -61139,6 +61230,7 @@
|
|
|
61139
61230
|
}
|
|
61140
61231
|
initData() {
|
|
61141
61232
|
this._rawData = this._spec.data;
|
|
61233
|
+
this._rawData?.target.addListener('change', this.rawDataUpdate.bind(this));
|
|
61142
61234
|
this._addDataIndexAndKey();
|
|
61143
61235
|
if (this._rawData) {
|
|
61144
61236
|
this._viewDataFilter = dataViewFromDataView(this._rawData, this._dataSet, {
|
|
@@ -61184,7 +61276,6 @@
|
|
|
61184
61276
|
const rawDataName = `${PREFIX}_series_${this.id}_rawDataStatic`;
|
|
61185
61277
|
this._rawDataStatistics = this.createStatisticalData(rawDataName, this._rawData, this._option.globalScale.getStatisticalFields);
|
|
61186
61278
|
this._rawData.target.removeListener('change', this._rawDataStatistics.reRunAllTransform);
|
|
61187
|
-
this._rawDataStatistics.reRunAllTransform();
|
|
61188
61279
|
}
|
|
61189
61280
|
_statisticViewData() {
|
|
61190
61281
|
const viewDataName = `${PREFIX}_series_${this.id}_viewDataStatic`;
|
|
@@ -61235,8 +61326,17 @@
|
|
|
61235
61326
|
}
|
|
61236
61327
|
}, false);
|
|
61237
61328
|
}
|
|
61329
|
+
_noAnimationDataKey(datum, index, context) {
|
|
61330
|
+
return index;
|
|
61331
|
+
}
|
|
61238
61332
|
generateDefaultDataKey(dataKey, datum, index, context) {
|
|
61239
61333
|
if (isNil(dataKey)) {
|
|
61334
|
+
if (this._spec.animation === false) {
|
|
61335
|
+
const v = this._noAnimationDataKey(datum, index, context);
|
|
61336
|
+
if (v !== undefined) {
|
|
61337
|
+
return v;
|
|
61338
|
+
}
|
|
61339
|
+
}
|
|
61240
61340
|
const { keyMap } = context;
|
|
61241
61341
|
const seriesDataKey = this._getSeriesDataKey(datum);
|
|
61242
61342
|
if (keyMap.get(seriesDataKey) === undefined) {
|
|
@@ -61277,8 +61377,8 @@
|
|
|
61277
61377
|
this._rawData.updateRawData(d);
|
|
61278
61378
|
}
|
|
61279
61379
|
rawDataUpdate(d) {
|
|
61280
|
-
this.event.emit(ChartEvent.rawDataUpdate, { model: this });
|
|
61281
61380
|
this._rawDataStatistics?.reRunAllTransform();
|
|
61381
|
+
this.event.emit(ChartEvent.rawDataUpdate, { model: this });
|
|
61282
61382
|
}
|
|
61283
61383
|
rawDataStatisticsUpdate(d) {
|
|
61284
61384
|
this.event.emit(ChartEvent.rawDataStatisticsUpdate, { model: this });
|
|
@@ -61419,13 +61519,25 @@
|
|
|
61419
61519
|
}
|
|
61420
61520
|
afterInitMark() {
|
|
61421
61521
|
this.event.emit(ChartEvent.afterInitMark, { model: this });
|
|
61422
|
-
this._rawDataStatistics?.reRunAllTransform();
|
|
61423
61522
|
this.setSeriesField(this._spec.seriesField);
|
|
61523
|
+
let animationThreshold = this._spec.animationThreshold ?? Number.MAX_SAFE_INTEGER;
|
|
61424
61524
|
this.getMarks().forEach(m => {
|
|
61425
61525
|
if (m.stateStyle?.normal?.lineWidth) {
|
|
61426
61526
|
m.setAttribute('stroke', this.getColorAttribute(), 'normal', AttributeLevel.Base_Series);
|
|
61427
61527
|
}
|
|
61528
|
+
const config = m.getProgressiveConfig();
|
|
61529
|
+
if (config) {
|
|
61530
|
+
if (config.large && config.largeThreshold) {
|
|
61531
|
+
animationThreshold = Math.min(animationThreshold, config.largeThreshold);
|
|
61532
|
+
}
|
|
61533
|
+
if (config.progressiveThreshold) {
|
|
61534
|
+
animationThreshold = Math.min(animationThreshold, config.progressiveThreshold);
|
|
61535
|
+
}
|
|
61536
|
+
}
|
|
61428
61537
|
});
|
|
61538
|
+
if (this._rawData?.latestData?.length >= animationThreshold) {
|
|
61539
|
+
this._spec.animation = false;
|
|
61540
|
+
}
|
|
61429
61541
|
}
|
|
61430
61542
|
getMarksWithoutRoot() {
|
|
61431
61543
|
return this.getMarks().filter(m => !m.name.includes('seriesGroup'));
|
|
@@ -61441,7 +61553,6 @@
|
|
|
61441
61553
|
}
|
|
61442
61554
|
initEvent() {
|
|
61443
61555
|
this._trigger.init();
|
|
61444
|
-
this._rawData?.target.addListener('change', this.rawDataUpdate.bind(this));
|
|
61445
61556
|
this._data?.getDataView()?.target.addListener('change', this.viewDataUpdate.bind(this));
|
|
61446
61557
|
this._viewDataStatistics?.target.addListener('change', this.viewDataStatisticsUpdate.bind(this));
|
|
61447
61558
|
this._rawDataStatistics?.target.addListener('change', this.rawDataStatisticsUpdate.bind(this));
|
|
@@ -61526,8 +61637,7 @@
|
|
|
61526
61637
|
});
|
|
61527
61638
|
}
|
|
61528
61639
|
getSeriesInfoInField(field) {
|
|
61529
|
-
|
|
61530
|
-
return this._getSeriesInfo(field, keys);
|
|
61640
|
+
return this._getSeriesInfo(field, this._rawDataStatistics.latestData[field]?.values ?? []);
|
|
61531
61641
|
}
|
|
61532
61642
|
getSeriesInfoList() {
|
|
61533
61643
|
return this._getSeriesInfo(this._seriesField ?? DEFAULT_DATA_SERIES_FIELD, this.getSeriesKeys());
|
|
@@ -63115,7 +63225,7 @@
|
|
|
63115
63225
|
}
|
|
63116
63226
|
|
|
63117
63227
|
VChart.useMark([RectMark, TextMark]);
|
|
63118
|
-
const DefaultBandWidth$
|
|
63228
|
+
const DefaultBandWidth$2 = 6;
|
|
63119
63229
|
class BarSeries extends CartesianSeries {
|
|
63120
63230
|
static type = SeriesTypeEnum.bar;
|
|
63121
63231
|
type = SeriesTypeEnum.bar;
|
|
@@ -63186,31 +63296,17 @@
|
|
|
63186
63296
|
this.setMarkStyle(this._rectMark, {
|
|
63187
63297
|
x: (datum) => valueInScaleRange(this.dataToPositionX(datum), xScale),
|
|
63188
63298
|
x1: (datum) => valueInScaleRange(this.dataToPositionX1(datum), xScale),
|
|
63189
|
-
y: (datum) =>
|
|
63190
|
-
|
|
63191
|
-
DefaultBandWidth$3;
|
|
63192
|
-
const continuous = isContinuous(yScale.type || 'band');
|
|
63193
|
-
const pos = this.dataToPositionY(datum);
|
|
63194
|
-
const width = this._rectMark.getAttribute('height', datum);
|
|
63195
|
-
return pos + (bandWidth - width) * 0.5 + (continuous ? -bandWidth / 2 : 0);
|
|
63196
|
-
},
|
|
63197
|
-
height: () => this.getBarWidth(this._yAxisHelper)
|
|
63299
|
+
y: (datum) => this._getPosition(this.direction, datum),
|
|
63300
|
+
height: () => this._getBarWidth(this._yAxisHelper)
|
|
63198
63301
|
}, 'normal', AttributeLevel.Series);
|
|
63199
63302
|
}
|
|
63200
63303
|
else {
|
|
63201
63304
|
this.setMarkStyle(this._rectMark, {
|
|
63202
|
-
x: (datum) =>
|
|
63203
|
-
const bandWidth = this.getXAxisHelper().getBandwidth?.(this._groups ? this._groups.fields.length - 1 : 0) ??
|
|
63204
|
-
DefaultBandWidth$3;
|
|
63205
|
-
const width = this._rectMark.getAttribute('width', datum);
|
|
63206
|
-
const continuous = isContinuous(this.getXAxisHelper().getScale?.(0).type || 'band');
|
|
63207
|
-
const pos = this.dataToPositionX(datum);
|
|
63208
|
-
return pos + (bandWidth - width) / 2 + (continuous ? -bandWidth / 2 : 0);
|
|
63209
|
-
},
|
|
63305
|
+
x: (datum) => this._getPosition(this.direction, datum),
|
|
63210
63306
|
y: (datum) => valueInScaleRange(this.dataToPositionY(datum), yScale),
|
|
63211
63307
|
y1: (datum) => valueInScaleRange(this.dataToPositionY1(datum), yScale),
|
|
63212
63308
|
width: () => {
|
|
63213
|
-
return this.
|
|
63309
|
+
return this._getBarWidth(this._xAxisHelper);
|
|
63214
63310
|
}
|
|
63215
63311
|
}, 'normal', AttributeLevel.Series);
|
|
63216
63312
|
}
|
|
@@ -63242,9 +63338,9 @@
|
|
|
63242
63338
|
};
|
|
63243
63339
|
this._rectMark.setAnimationConfig(animationConfig(DEFAULT_MARK_ANIMATION.bar(animationParams, appearPreset), userAnimationConfig(this._barMarkName, this._spec), { dataIndex }));
|
|
63244
63340
|
}
|
|
63245
|
-
|
|
63341
|
+
_getBarWidth(axisHelper) {
|
|
63246
63342
|
const hasBarWidth = this._spec.barWidth !== undefined;
|
|
63247
|
-
const bandWidth = axisHelper.getBandwidth?.(this._groups ? this._groups.fields.length - 1 : 0) ?? DefaultBandWidth$
|
|
63343
|
+
const bandWidth = axisHelper.getBandwidth?.(this._groups ? this._groups.fields.length - 1 : 0) ?? DefaultBandWidth$2;
|
|
63248
63344
|
if (hasBarWidth) {
|
|
63249
63345
|
return getActualNumValue(this._spec.barWidth, bandWidth);
|
|
63250
63346
|
}
|
|
@@ -63259,6 +63355,50 @@
|
|
|
63259
63355
|
}
|
|
63260
63356
|
return width;
|
|
63261
63357
|
}
|
|
63358
|
+
_getPosition(direction, datum) {
|
|
63359
|
+
let axisHelper;
|
|
63360
|
+
let sizeAttribute;
|
|
63361
|
+
let dataToPosition;
|
|
63362
|
+
if (direction === Direction$2.horizontal) {
|
|
63363
|
+
axisHelper = this.getYAxisHelper();
|
|
63364
|
+
sizeAttribute = 'height';
|
|
63365
|
+
dataToPosition = this.dataToPositionY.bind(this);
|
|
63366
|
+
}
|
|
63367
|
+
else {
|
|
63368
|
+
axisHelper = this.getXAxisHelper();
|
|
63369
|
+
sizeAttribute = 'width';
|
|
63370
|
+
dataToPosition = this.dataToPositionX.bind(this);
|
|
63371
|
+
}
|
|
63372
|
+
const scale = axisHelper.getScale(0);
|
|
63373
|
+
const size = this._rectMark.getAttribute(sizeAttribute, datum);
|
|
63374
|
+
const bandWidth = axisHelper.getBandwidth?.(this._groups ? this._groups.fields.length - 1 : 0) ?? DefaultBandWidth$2;
|
|
63375
|
+
if (this._groups?.fields?.length > 1 && isValid(this._spec.barGapInGroup)) {
|
|
63376
|
+
const groupFields = this._groups.fields;
|
|
63377
|
+
const barInGroup = array(this._spec.barGapInGroup);
|
|
63378
|
+
let totalWidth = 0;
|
|
63379
|
+
let offSet = 0;
|
|
63380
|
+
for (let index = groupFields.length - 1; index >= 1; index--) {
|
|
63381
|
+
const groupField = groupFields[index];
|
|
63382
|
+
const groupValues = this.getViewDataStatistics()?.latestData?.[groupField]?.values ?? [];
|
|
63383
|
+
const groupCount = groupValues.length;
|
|
63384
|
+
const gap = getActualNumValue(barInGroup[index - 1] ?? last(barInGroup), bandWidth);
|
|
63385
|
+
const i = groupValues.indexOf(datum[groupField]);
|
|
63386
|
+
if (index === groupFields.length - 1) {
|
|
63387
|
+
totalWidth += groupCount * size + (groupCount - 1) * gap;
|
|
63388
|
+
offSet += i * (size + gap);
|
|
63389
|
+
}
|
|
63390
|
+
else {
|
|
63391
|
+
offSet += i * (totalWidth + gap);
|
|
63392
|
+
totalWidth += totalWidth + (groupCount - 1) * gap;
|
|
63393
|
+
}
|
|
63394
|
+
}
|
|
63395
|
+
const center = scale.scale(datum[groupFields[0]]) + axisHelper.getBandwidth(0) / 2;
|
|
63396
|
+
return center - totalWidth / 2 + offSet;
|
|
63397
|
+
}
|
|
63398
|
+
const continuous = isContinuous(scale.type || 'band');
|
|
63399
|
+
const pos = dataToPosition(datum);
|
|
63400
|
+
return pos + (bandWidth - size) * 0.5 + (continuous ? -bandWidth / 2 : 0);
|
|
63401
|
+
}
|
|
63262
63402
|
updateSpec(spec) {
|
|
63263
63403
|
const { direction } = this._spec;
|
|
63264
63404
|
const result = super.updateSpec(spec);
|
|
@@ -64511,7 +64651,6 @@
|
|
|
64511
64651
|
}
|
|
64512
64652
|
}
|
|
64513
64653
|
|
|
64514
|
-
const DefaultBandWidth$2 = 6;
|
|
64515
64654
|
class RangeColumnSeries extends BarSeries {
|
|
64516
64655
|
static type = SeriesTypeEnum.rangeColumn;
|
|
64517
64656
|
type = SeriesTypeEnum.rangeColumn;
|
|
@@ -64548,14 +64687,7 @@
|
|
|
64548
64687
|
}
|
|
64549
64688
|
}
|
|
64550
64689
|
initMarkStyle() {
|
|
64551
|
-
|
|
64552
|
-
if (rectMark) {
|
|
64553
|
-
this.setMarkStyle(rectMark, {
|
|
64554
|
-
fill: this.getColorAttribute()
|
|
64555
|
-
}, 'normal', AttributeLevel.Series);
|
|
64556
|
-
this._trigger.registerMark(rectMark);
|
|
64557
|
-
this._tooltipHelper?.activeTriggerSet.mark.add(rectMark);
|
|
64558
|
-
}
|
|
64690
|
+
super.initMarkStyle();
|
|
64559
64691
|
const minLabelMark = this._minLabelMark;
|
|
64560
64692
|
const minLabelSpec = this._spec.label?.minLabel;
|
|
64561
64693
|
if (minLabelMark) {
|
|
@@ -64647,27 +64779,13 @@
|
|
|
64647
64779
|
x1: (datum) => valueInScaleRange(dataToPosition(this.getDatumPositionValues(datum, this._spec.xField[1]), {
|
|
64648
64780
|
bandPosition: this._bandPosition
|
|
64649
64781
|
}), xScale),
|
|
64650
|
-
y: (datum) =>
|
|
64651
|
-
|
|
64652
|
-
DefaultBandWidth$2;
|
|
64653
|
-
const continuous = isContinuous(yScale.type || 'band');
|
|
64654
|
-
const pos = this.dataToPositionY(datum);
|
|
64655
|
-
const width = this._rectMark.getAttribute('height', datum);
|
|
64656
|
-
return pos + (bandWidth - width) * 0.5 + (continuous ? -bandWidth / 2 : 0);
|
|
64657
|
-
},
|
|
64658
|
-
height: () => this.getBarWidth(this._yAxisHelper)
|
|
64782
|
+
y: (datum) => this._getPosition(this.direction, datum),
|
|
64783
|
+
height: () => this._getBarWidth(this._yAxisHelper)
|
|
64659
64784
|
}, 'normal', AttributeLevel.Series);
|
|
64660
64785
|
}
|
|
64661
64786
|
else {
|
|
64662
64787
|
this.setMarkStyle(this._rectMark, {
|
|
64663
|
-
x: (datum) =>
|
|
64664
|
-
const bandWidth = this.getXAxisHelper().getBandwidth?.(this._groups ? this._groups.fields.length - 1 : 0) ??
|
|
64665
|
-
DefaultBandWidth$2;
|
|
64666
|
-
const width = this._rectMark.getAttribute('width', datum);
|
|
64667
|
-
const continuous = isContinuous(this.getXAxisHelper().getScale?.(0).type || 'band');
|
|
64668
|
-
const pos = this.dataToPositionX(datum);
|
|
64669
|
-
return pos + (bandWidth - width) / 2 + (continuous ? -bandWidth / 2 : 0);
|
|
64670
|
-
},
|
|
64788
|
+
x: (datum) => this._getPosition(this.direction, datum),
|
|
64671
64789
|
y: (datum) => valueInScaleRange(dataToPosition(this.getDatumPositionValues(datum, this._spec.yField[0]), {
|
|
64672
64790
|
bandPosition: this._bandPosition
|
|
64673
64791
|
}), yScale),
|
|
@@ -64675,7 +64793,7 @@
|
|
|
64675
64793
|
bandPosition: this._bandPosition
|
|
64676
64794
|
}), yScale),
|
|
64677
64795
|
width: () => {
|
|
64678
|
-
return this.
|
|
64796
|
+
return this._getBarWidth(this._xAxisHelper);
|
|
64679
64797
|
}
|
|
64680
64798
|
}, 'normal', AttributeLevel.Series);
|
|
64681
64799
|
}
|
|
@@ -65118,7 +65236,7 @@
|
|
|
65118
65236
|
coordinate = 'geo';
|
|
65119
65237
|
_mapViewData;
|
|
65120
65238
|
getMapViewData() {
|
|
65121
|
-
return this._mapViewData
|
|
65239
|
+
return this._mapViewData?.getDataView();
|
|
65122
65240
|
}
|
|
65123
65241
|
_mapViewDataStatistics;
|
|
65124
65242
|
_nameField;
|
|
@@ -65250,8 +65368,8 @@
|
|
|
65250
65368
|
}
|
|
65251
65369
|
getSeriesKeys() {
|
|
65252
65370
|
if (this._seriesField) {
|
|
65253
|
-
return (this.
|
|
65254
|
-
this.
|
|
65371
|
+
return (this._rawDataStatistics?.latestData?.[this._seriesField]?.values ??
|
|
65372
|
+
this._mapViewDataStatistics?.latestData[this._seriesField]?.values ??
|
|
65255
65373
|
[]);
|
|
65256
65374
|
}
|
|
65257
65375
|
if (this.name) {
|
|
@@ -65471,7 +65589,9 @@
|
|
|
65471
65589
|
spec?.nameMap !== nameMap ||
|
|
65472
65590
|
spec?.valueField !== valueField ||
|
|
65473
65591
|
spec?.nameProperty !== nameProperty) {
|
|
65592
|
+
result.change = true;
|
|
65474
65593
|
result.reRender = true;
|
|
65594
|
+
result.reMake = true;
|
|
65475
65595
|
}
|
|
65476
65596
|
return result;
|
|
65477
65597
|
}
|
|
@@ -66724,12 +66844,6 @@
|
|
|
66724
66844
|
padAngle: this._padAngle,
|
|
66725
66845
|
centerOffset: this._centerOffset
|
|
66726
66846
|
}, 'normal', AttributeLevel.Series);
|
|
66727
|
-
const pieSpec = this.getSpec()[pieMark.name];
|
|
66728
|
-
if (pieSpec) {
|
|
66729
|
-
for (const state in pieSpec.state || {}) {
|
|
66730
|
-
this.setMarkStyle(pieMark, this.generateRadiusStyle(pieSpec.state[state]), state, AttributeLevel.User_Mark);
|
|
66731
|
-
}
|
|
66732
|
-
}
|
|
66733
66847
|
this._trigger.registerMark(pieMark);
|
|
66734
66848
|
this._tooltipHelper?.activeTriggerSet.mark.add(pieMark);
|
|
66735
66849
|
}
|
|
@@ -66764,6 +66878,17 @@
|
|
|
66764
66878
|
this._trigger.registerMark(labelLineMark);
|
|
66765
66879
|
}
|
|
66766
66880
|
}
|
|
66881
|
+
initMarkStyleWithSpec(mark, spec, key) {
|
|
66882
|
+
super.initMarkStyleWithSpec(mark, spec, key);
|
|
66883
|
+
if (mark.name === this._pieMarkName) {
|
|
66884
|
+
const pieSpec = this.getSpec()[mark.name];
|
|
66885
|
+
if (pieSpec) {
|
|
66886
|
+
for (const state in pieSpec.state || {}) {
|
|
66887
|
+
this.setMarkStyle(mark, this.generateRadiusStyle(pieSpec.state[state]), state, AttributeLevel.User_Mark);
|
|
66888
|
+
}
|
|
66889
|
+
}
|
|
66890
|
+
}
|
|
66891
|
+
}
|
|
66767
66892
|
afterInitMark() {
|
|
66768
66893
|
super.afterInitMark();
|
|
66769
66894
|
this._trigger.setStateKeys([this._seriesField, ...this._radiusField]);
|
|
@@ -66962,6 +67087,9 @@
|
|
|
66962
67087
|
}
|
|
66963
67088
|
setValueFieldToPercent() {
|
|
66964
67089
|
}
|
|
67090
|
+
_noAnimationDataKey(datum, index) {
|
|
67091
|
+
return index;
|
|
67092
|
+
}
|
|
66965
67093
|
}
|
|
66966
67094
|
class PieSeries extends BasePieSeries {
|
|
66967
67095
|
static type = SeriesTypeEnum.pie;
|
|
@@ -67491,13 +67619,13 @@
|
|
|
67491
67619
|
if (!datum || !this.angleAxisHelper || !this.radiusAxisHelper) {
|
|
67492
67620
|
return Number.NaN;
|
|
67493
67621
|
}
|
|
67494
|
-
return this.valueToPosition(this.getDatumPositionValues(datum, this._angleField), this._stack ? this.getDatumPositionValues(datum, this._innerRadiusField) : 0).x;
|
|
67622
|
+
return this.valueToPosition(this.getDatumPositionValues(datum, this._angleField), this._stack ? this.getDatumPositionValues(datum, this._innerRadiusField) : this.radiusScale.domain()[0]).x;
|
|
67495
67623
|
},
|
|
67496
67624
|
y1: (datum) => {
|
|
67497
67625
|
if (!datum || !this.angleAxisHelper || !this.radiusAxisHelper) {
|
|
67498
67626
|
return Number.NaN;
|
|
67499
67627
|
}
|
|
67500
|
-
const value = this.valueToPosition(this.getDatumPositionValues(datum, this._angleField), this._stack ? this.getDatumPositionValues(datum, this._innerRadiusField) : 0).y;
|
|
67628
|
+
const value = this.valueToPosition(this.getDatumPositionValues(datum, this._angleField), this._stack ? this.getDatumPositionValues(datum, this._innerRadiusField) : this.radiusScale.domain()[0]).y;
|
|
67501
67629
|
return value;
|
|
67502
67630
|
},
|
|
67503
67631
|
fill: this.getColorAttribute(),
|
|
@@ -69007,7 +69135,7 @@
|
|
|
69007
69135
|
for (this.data = data; i < n;) {
|
|
69008
69136
|
if (this.layoutWord(i) && i++, this.progressiveIndex = i, this.exceedTime()) break;
|
|
69009
69137
|
}
|
|
69010
|
-
if (!this.options.clip && this.options.enlarge && this.shrinkBoard(this._bounds), ["cardioid", "triangle", "triangle-upright"].includes(this.options.shape)) {
|
|
69138
|
+
if (!this.options.clip && this.options.enlarge && this._bounds && this.shrinkBoard(this._bounds), this._bounds && ["cardioid", "triangle", "triangle-upright"].includes(this.options.shape)) {
|
|
69011
69139
|
const currentCenterY = (this._bounds[0].y + this._bounds[1].y) / 2;
|
|
69012
69140
|
this._dy = -(currentCenterY - this._size[1] / 2);
|
|
69013
69141
|
}
|
|
@@ -69532,8 +69660,9 @@
|
|
|
69532
69660
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
69533
69661
|
if (options.size && (!options.size[0] || !options.size[1])) return upstreamData;
|
|
69534
69662
|
const data = upstreamData,
|
|
69535
|
-
canvasSize = null !== (_a = options.size) && void 0 !== _a ? _a : [500, 500]
|
|
69536
|
-
|
|
69663
|
+
canvasSize = (null !== (_a = options.size) && void 0 !== _a ? _a : [500, 500]).slice();
|
|
69664
|
+
canvasSize[0] = Math.floor(canvasSize[0]), canvasSize[1] = Math.floor(canvasSize[1]);
|
|
69665
|
+
const fontFamily = options.fontFamily ? field$1(options.fontFamily) : "sans-serif",
|
|
69537
69666
|
fontStyle = options.fontStyle ? field$1(options.fontStyle) : "normal",
|
|
69538
69667
|
fontWeight = options.fontWeight ? field$1(options.fontWeight) : "normal",
|
|
69539
69668
|
rotate = options.rotate ? field$1(options.rotate) : 0,
|
|
@@ -69552,8 +69681,9 @@
|
|
|
69552
69681
|
let fontSize = options.fontSize ? field$1(options.fontSize) : 14;
|
|
69553
69682
|
const fontSizeRange = options.fontSizeRange;
|
|
69554
69683
|
if (fontSizeRange && !isNumber(fontSize)) {
|
|
69555
|
-
const fsize = fontSize
|
|
69556
|
-
|
|
69684
|
+
const fsize = fontSize,
|
|
69685
|
+
fontSizeSqrtScale = generateSqrtScale(extent$1(fsize, data), fontSizeRange);
|
|
69686
|
+
fontSize = datum => fontSizeSqrtScale(fsize(datum));
|
|
69557
69687
|
}
|
|
69558
69688
|
let Layout = CloudLayout;
|
|
69559
69689
|
"fast" === options.layoutType ? Layout = FastLayout : "grid" === options.layoutType && (Layout = GridLayout$1);
|
|
@@ -69589,7 +69719,15 @@
|
|
|
69589
69719
|
} : layout.output();
|
|
69590
69720
|
};
|
|
69591
69721
|
const field$1 = option => isString(option) || isNumber(option) || isFunction(option) ? option : datum => datum[option.field],
|
|
69592
|
-
|
|
69722
|
+
sqrt = x => x < 0 ? -Math.sqrt(-x) : Math.sqrt(x),
|
|
69723
|
+
generateSqrtScale = (domain, range) => {
|
|
69724
|
+
if (domain[0] === domain[1]) return datum => range[0];
|
|
69725
|
+
const s0 = sqrt(domain[0]),
|
|
69726
|
+
s1 = sqrt(domain[1]),
|
|
69727
|
+
min = Math.min(s0, s1),
|
|
69728
|
+
max = Math.max(s0, s1);
|
|
69729
|
+
return datum => (sqrt(datum) - min) / (max - min) * (range[1] - range[0]) + range[0];
|
|
69730
|
+
},
|
|
69593
69731
|
extent$1 = (field, data) => {
|
|
69594
69732
|
let min = 1 / 0,
|
|
69595
69733
|
max = -1 / 0;
|
|
@@ -70879,15 +71017,11 @@
|
|
|
70879
71017
|
});
|
|
70880
71018
|
}
|
|
70881
71019
|
const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;
|
|
70882
|
-
const srView = this.getCompiler().getVGrammarView();
|
|
70883
71020
|
if (!this._isWordCloudShape) {
|
|
70884
71021
|
wordCloudTransforms.push({
|
|
70885
71022
|
type: 'wordcloud',
|
|
70886
71023
|
layoutType: !isTrueBrowser(this._option.mode) ? 'fast' : this._wordCloudConfig.layoutMode,
|
|
70887
|
-
size: [
|
|
70888
|
-
srView.width() - this._padding?.left || 0 - this._padding?.right || 0,
|
|
70889
|
-
srView.height() - this._padding?.top || 0 - this._padding?.bottom || 0
|
|
70890
|
-
],
|
|
71024
|
+
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
70891
71025
|
shape: this._maskShape,
|
|
70892
71026
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
70893
71027
|
text: { field: textField },
|
|
@@ -70912,7 +71046,7 @@
|
|
|
70912
71046
|
wordCloudTransforms.push({
|
|
70913
71047
|
type: 'wordcloudShape',
|
|
70914
71048
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
70915
|
-
size: [
|
|
71049
|
+
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
70916
71050
|
shape: this._maskShape,
|
|
70917
71051
|
text: { field: this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField },
|
|
70918
71052
|
fontSize: valueField ? { field: valueField } : this._fontSizeRange[0],
|
|
@@ -70987,6 +71121,10 @@
|
|
|
70987
71121
|
}
|
|
70988
71122
|
setValueFieldToPercent() {
|
|
70989
71123
|
}
|
|
71124
|
+
onLayoutEnd(ctx) {
|
|
71125
|
+
super.onLayoutEnd(ctx);
|
|
71126
|
+
this.compile();
|
|
71127
|
+
}
|
|
70990
71128
|
updateSpec(spec) {
|
|
70991
71129
|
const originalSpec = this._originalSpec;
|
|
70992
71130
|
const result = super.updateSpec(spec);
|
|
@@ -71052,15 +71190,11 @@
|
|
|
71052
71190
|
});
|
|
71053
71191
|
}
|
|
71054
71192
|
const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;
|
|
71055
|
-
const srView = this.getCompiler().getVGrammarView();
|
|
71056
71193
|
if (!this._isWordCloudShape) {
|
|
71057
71194
|
wordCloudTransforms.push({
|
|
71058
71195
|
type: 'wordcloud',
|
|
71059
71196
|
layoutType: this._wordCloudConfig.layoutMode,
|
|
71060
|
-
size: [
|
|
71061
|
-
srView.width() - this._padding?.left || 0 - this._padding?.right || 0,
|
|
71062
|
-
srView.height() - this._padding?.top || 0 - this._padding?.bottom || 0
|
|
71063
|
-
],
|
|
71197
|
+
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
71064
71198
|
shape: this._maskShape,
|
|
71065
71199
|
postProjection: this._spec.postProjection ?? 'StereographicProjection',
|
|
71066
71200
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
@@ -71086,7 +71220,7 @@
|
|
|
71086
71220
|
else {
|
|
71087
71221
|
wordCloudTransforms.push({
|
|
71088
71222
|
type: 'wordcloudShape',
|
|
71089
|
-
size: [
|
|
71223
|
+
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
71090
71224
|
shape: this._maskShape,
|
|
71091
71225
|
postProjection: this._spec.postProjection ?? 'StereographicProjection',
|
|
71092
71226
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
@@ -73281,6 +73415,9 @@
|
|
|
73281
73415
|
setValueFieldToPercent() {
|
|
73282
73416
|
return;
|
|
73283
73417
|
}
|
|
73418
|
+
_noAnimationDataKey(datum, index) {
|
|
73419
|
+
return undefined;
|
|
73420
|
+
}
|
|
73284
73421
|
}
|
|
73285
73422
|
mixin(SunburstSeries, Drillable);
|
|
73286
73423
|
|
|
@@ -73507,6 +73644,9 @@
|
|
|
73507
73644
|
super.onLayoutEnd(ctx);
|
|
73508
73645
|
this._rawData.reRunAllTransform();
|
|
73509
73646
|
}
|
|
73647
|
+
_noAnimationDataKey(datum, index) {
|
|
73648
|
+
return undefined;
|
|
73649
|
+
}
|
|
73510
73650
|
}
|
|
73511
73651
|
mixin(CirclePackingSeries, Drillable);
|
|
73512
73652
|
|
|
@@ -74006,11 +74146,25 @@
|
|
|
74006
74146
|
view.y1 - view.y0 === Infinity) {
|
|
74007
74147
|
return data;
|
|
74008
74148
|
}
|
|
74009
|
-
if (data
|
|
74010
|
-
|
|
74149
|
+
if (data.length > 1) {
|
|
74150
|
+
const updateData = {
|
|
74151
|
+
links: [],
|
|
74152
|
+
nodes: []
|
|
74153
|
+
};
|
|
74154
|
+
data.forEach((datum) => {
|
|
74155
|
+
if (datum.id === 'links' || datum.id === 'nodes') {
|
|
74156
|
+
updateData[datum.id] = datum.values;
|
|
74157
|
+
}
|
|
74158
|
+
});
|
|
74159
|
+
data = updateData;
|
|
74011
74160
|
}
|
|
74012
74161
|
else {
|
|
74013
|
-
|
|
74162
|
+
if (data[0]?.latestData) {
|
|
74163
|
+
data = data[0].latestData[0];
|
|
74164
|
+
}
|
|
74165
|
+
else {
|
|
74166
|
+
data = data[0];
|
|
74167
|
+
}
|
|
74014
74168
|
}
|
|
74015
74169
|
if (op.sourceField !== 'source' || op.targetField !== 'target') {
|
|
74016
74170
|
for (const key in data) {
|
|
@@ -74929,6 +75083,9 @@
|
|
|
74929
75083
|
getDefaultShapeType() {
|
|
74930
75084
|
return 'square';
|
|
74931
75085
|
}
|
|
75086
|
+
_noAnimationDataKey(datum, index) {
|
|
75087
|
+
return undefined;
|
|
75088
|
+
}
|
|
74932
75089
|
}
|
|
74933
75090
|
|
|
74934
75091
|
const treemap = (data, op) => {
|
|
@@ -76021,7 +76178,8 @@
|
|
|
76021
76178
|
...super._getDefaultSeriesSpec(spec),
|
|
76022
76179
|
barWidth: spec.barWidth,
|
|
76023
76180
|
barMaxWidth: spec.barMaxWidth,
|
|
76024
|
-
barMinWidth: spec.barMinWidth
|
|
76181
|
+
barMinWidth: spec.barMinWidth,
|
|
76182
|
+
barGapInGroup: spec.barGapInGroup
|
|
76025
76183
|
};
|
|
76026
76184
|
}
|
|
76027
76185
|
transformSpec(spec) {
|
|
@@ -76036,6 +76194,15 @@
|
|
|
76036
76194
|
static view = 'singleDefault';
|
|
76037
76195
|
type = ChartTypeEnum.bar3d;
|
|
76038
76196
|
seriesType = SeriesTypeEnum.bar3d;
|
|
76197
|
+
_getDefaultSeriesSpec(spec) {
|
|
76198
|
+
return {
|
|
76199
|
+
...super._getDefaultSeriesSpec(spec),
|
|
76200
|
+
barWidth: spec.barWidth,
|
|
76201
|
+
barMaxWidth: spec.barMaxWidth,
|
|
76202
|
+
barMinWidth: spec.barMinWidth,
|
|
76203
|
+
barGapInGroup: spec.barGapInGroup
|
|
76204
|
+
};
|
|
76205
|
+
}
|
|
76039
76206
|
}
|
|
76040
76207
|
|
|
76041
76208
|
VChart.useSeries([BoxPlotSeries]);
|
|
@@ -76899,7 +77066,8 @@
|
|
|
76899
77066
|
seriesType = SeriesTypeEnum.rangeColumn;
|
|
76900
77067
|
_getDefaultSeriesSpec(spec) {
|
|
76901
77068
|
const series = {
|
|
76902
|
-
...super._getDefaultSeriesSpec(spec)
|
|
77069
|
+
...super._getDefaultSeriesSpec(spec),
|
|
77070
|
+
barGapInGroup: spec.barGapInGroup
|
|
76903
77071
|
};
|
|
76904
77072
|
series.bar = spec.bar;
|
|
76905
77073
|
if (spec.direction === Direction$2.horizontal) {
|
|
@@ -76924,7 +77092,8 @@
|
|
|
76924
77092
|
seriesType = SeriesTypeEnum.rangeColumn3d;
|
|
76925
77093
|
_getDefaultSeriesSpec(spec) {
|
|
76926
77094
|
const series = {
|
|
76927
|
-
...super._getDefaultSeriesSpec(spec)
|
|
77095
|
+
...super._getDefaultSeriesSpec(spec),
|
|
77096
|
+
barGapInGroup: spec.barGapInGroup
|
|
76928
77097
|
};
|
|
76929
77098
|
series.bar3d = spec.bar3d;
|
|
76930
77099
|
if (spec.direction === Direction$2.horizontal) {
|
|
@@ -77400,6 +77569,7 @@
|
|
|
77400
77569
|
_getDefaultSeriesSpec(spec) {
|
|
77401
77570
|
return {
|
|
77402
77571
|
...super._getDefaultSeriesSpec(spec),
|
|
77572
|
+
bar: spec.bar,
|
|
77403
77573
|
stackLabel: spec.stackLabel,
|
|
77404
77574
|
leaderLine: spec.leaderLine,
|
|
77405
77575
|
total: spec.total
|
|
@@ -77595,6 +77765,8 @@
|
|
|
77595
77765
|
return getCartesianAxisTheme(getOrient(componentSpec), 'band', theme);
|
|
77596
77766
|
case ComponentTypeEnum.cartesianLinearAxis:
|
|
77597
77767
|
return getCartesianAxisTheme(getOrient(componentSpec), 'linear', theme);
|
|
77768
|
+
case ComponentTypeEnum.cartesianLogAxis:
|
|
77769
|
+
return getCartesianAxisTheme(getOrient(componentSpec), 'log', theme);
|
|
77598
77770
|
case ComponentTypeEnum.cartesianAxis:
|
|
77599
77771
|
case ComponentTypeEnum.cartesianTimeAxis:
|
|
77600
77772
|
return getCartesianAxisTheme(getOrient(componentSpec), undefined, theme);
|
|
@@ -78147,9 +78319,6 @@
|
|
|
78147
78319
|
return allDomain.slice(Math.min(startIndex, endIndex), Math.max(startIndex, endIndex) + 1);
|
|
78148
78320
|
}
|
|
78149
78321
|
_handleStateChange = (startValue, endValue) => {
|
|
78150
|
-
if (startValue === this._startValue && endValue === this._endValue) {
|
|
78151
|
-
return false;
|
|
78152
|
-
}
|
|
78153
78322
|
this._startValue = startValue;
|
|
78154
78323
|
this._endValue = endValue;
|
|
78155
78324
|
this._newDomain = this._parseDomainFromState(this._startValue, this._endValue);
|
|
@@ -78396,12 +78565,12 @@
|
|
|
78396
78565
|
this._middleHandlerSize = this._computeMiddleHandlerSize();
|
|
78397
78566
|
this._width = this._computeWidth();
|
|
78398
78567
|
this._height = this._computeHeight();
|
|
78399
|
-
if (this._originalSpec
|
|
78568
|
+
if (isNil(this._originalSpec?.startHandler?.style?.size)) {
|
|
78400
78569
|
this._spec.startHandler.style.size = this._isHorizontal
|
|
78401
78570
|
? this._height - this._middleHandlerSize
|
|
78402
78571
|
: this._width - this._middleHandlerSize;
|
|
78403
78572
|
}
|
|
78404
|
-
if (this._originalSpec
|
|
78573
|
+
if (isNil(this._originalSpec?.startHandler?.style?.size)) {
|
|
78405
78574
|
this._spec.endHandler.style.size = this._isHorizontal
|
|
78406
78575
|
? this._height - this._middleHandlerSize
|
|
78407
78576
|
: this._width - this._middleHandlerSize;
|
|
@@ -78484,7 +78653,8 @@
|
|
|
78484
78653
|
const offsetLeft = this._orient === 'left' ? this._middleHandlerSize : 0;
|
|
78485
78654
|
const offsetHandler = this._isHorizontal ? this._startHandlerSize / 2 : 0;
|
|
78486
78655
|
const xScale = this._isHorizontal ? this._stateScale : this._valueScale;
|
|
78487
|
-
|
|
78656
|
+
const xField = this._isHorizontal ? this._stateField : this._valueField;
|
|
78657
|
+
return xScale.scale(datum[xField]) + this.getLayoutStartPoint().x + offsetLeft + offsetHandler;
|
|
78488
78658
|
};
|
|
78489
78659
|
_dataToPositionX2 = (datum) => {
|
|
78490
78660
|
const offsetLeft = this._orient === 'left' ? this._middleHandlerSize : 0;
|
|
@@ -78497,7 +78667,8 @@
|
|
|
78497
78667
|
const offsetTop = this._isHorizontal ? this._middleHandlerSize : 0;
|
|
78498
78668
|
const offsetHandler = this._isHorizontal ? 0 : this._startHandlerSize / 2;
|
|
78499
78669
|
const yScale = this._isHorizontal ? this._valueScale : this._stateScale;
|
|
78500
|
-
|
|
78670
|
+
const yField = this._isHorizontal ? this._valueField : this._stateField;
|
|
78671
|
+
return yScale.scale(datum[yField]) + this.getLayoutStartPoint().y + offsetTop + offsetHandler;
|
|
78501
78672
|
};
|
|
78502
78673
|
_dataToPositionY2 = (datum) => {
|
|
78503
78674
|
const offsetTop = this._isHorizontal ? this._middleHandlerSize : 0;
|
|
@@ -80080,6 +80251,11 @@
|
|
|
80080
80251
|
if (!isContinuous(scale.type)) {
|
|
80081
80252
|
return convertDomainToTickData(scale.domain());
|
|
80082
80253
|
}
|
|
80254
|
+
const range = scale.range();
|
|
80255
|
+
const rangeSize = Math.abs(range[range.length - 1] - range[0]);
|
|
80256
|
+
if (rangeSize < 2) {
|
|
80257
|
+
return convertDomainToTickData([scale.domain()[0]]);
|
|
80258
|
+
}
|
|
80083
80259
|
const { tickCount, forceTickCount, tickStep } = op;
|
|
80084
80260
|
let scaleTicks;
|
|
80085
80261
|
if (isValid(tickStep)) {
|
|
@@ -80132,8 +80308,20 @@
|
|
|
80132
80308
|
};
|
|
80133
80309
|
|
|
80134
80310
|
const linearDiscreteTicks = (scale, op) => {
|
|
80311
|
+
const domain = scale.domain();
|
|
80312
|
+
if (!domain.length) {
|
|
80313
|
+
return [];
|
|
80314
|
+
}
|
|
80135
80315
|
const { tickCount, forceTickCount, tickStep, labelGap = 4, axisOrientType } = op;
|
|
80136
80316
|
const isHorizontal = ['bottom', 'top'].includes(axisOrientType);
|
|
80317
|
+
const range = scale.range();
|
|
80318
|
+
const rangeSize = Math.abs(range[range.length - 1] - range[0]);
|
|
80319
|
+
if (rangeSize < 2) {
|
|
80320
|
+
if (op.labelLastVisible) {
|
|
80321
|
+
return convertDomainToTickData([domain[domain.length - 1]]);
|
|
80322
|
+
}
|
|
80323
|
+
return convertDomainToTickData([domain[0]]);
|
|
80324
|
+
}
|
|
80137
80325
|
let scaleTicks;
|
|
80138
80326
|
if (isValid(tickStep)) {
|
|
80139
80327
|
scaleTicks = scale.stepTicks(tickStep);
|
|
@@ -80145,9 +80333,47 @@
|
|
|
80145
80333
|
scaleTicks = scale.ticks(tickCount);
|
|
80146
80334
|
}
|
|
80147
80335
|
else if (op.sampling) {
|
|
80148
|
-
|
|
80149
|
-
const
|
|
80150
|
-
|
|
80336
|
+
let labelBoundsList;
|
|
80337
|
+
const fontSize = (op.labelStyle.fontSize ?? 12) + 2;
|
|
80338
|
+
if (domain.length <= rangeSize / fontSize) {
|
|
80339
|
+
labelBoundsList = getCartesianLabelBounds(scale, domain, op);
|
|
80340
|
+
}
|
|
80341
|
+
else {
|
|
80342
|
+
const tempDomain = [domain[0], domain[Math.floor(domain.length / 2)], domain[domain.length - 1]];
|
|
80343
|
+
const tempList = getCartesianLabelBounds(scale, tempDomain, op);
|
|
80344
|
+
let maxBounds = null;
|
|
80345
|
+
let maxBoundsIndex = 0;
|
|
80346
|
+
tempList.forEach((current, index) => {
|
|
80347
|
+
if (!maxBounds) {
|
|
80348
|
+
maxBounds = current;
|
|
80349
|
+
maxBoundsIndex = index;
|
|
80350
|
+
return;
|
|
80351
|
+
}
|
|
80352
|
+
if (isHorizontal) {
|
|
80353
|
+
if (maxBounds.width() < current.width()) {
|
|
80354
|
+
maxBounds = current;
|
|
80355
|
+
maxBoundsIndex = index;
|
|
80356
|
+
}
|
|
80357
|
+
}
|
|
80358
|
+
else if (maxBounds.height() < current.height()) {
|
|
80359
|
+
maxBounds = current;
|
|
80360
|
+
maxBoundsIndex = index;
|
|
80361
|
+
}
|
|
80362
|
+
});
|
|
80363
|
+
const maxBoundsDomainIndex = maxBoundsIndex === 0 ? 0 : maxBoundsIndex === 2 ? domain.length - 1 : Math.floor(domain.length / 2);
|
|
80364
|
+
const maxBoundsPos = scale.scale(domain[maxBoundsDomainIndex]);
|
|
80365
|
+
labelBoundsList = new Array(domain.length);
|
|
80366
|
+
for (let i = 0; i < labelBoundsList.length; i++) {
|
|
80367
|
+
labelBoundsList[i] = maxBounds.clone();
|
|
80368
|
+
const currentPos = scale.scale(domain[i]);
|
|
80369
|
+
if (isHorizontal) {
|
|
80370
|
+
labelBoundsList[i].translate(currentPos - maxBoundsPos, 0);
|
|
80371
|
+
}
|
|
80372
|
+
else {
|
|
80373
|
+
labelBoundsList[i].translate(0, currentPos - maxBoundsPos);
|
|
80374
|
+
}
|
|
80375
|
+
}
|
|
80376
|
+
}
|
|
80151
80377
|
const domainLengthList = labelBoundsList.map(b => {
|
|
80152
80378
|
return isHorizontal ? b.width() : b.height();
|
|
80153
80379
|
});
|
|
@@ -80880,7 +81106,8 @@
|
|
|
80880
81106
|
getScale,
|
|
80881
81107
|
getStatisticsDomain: () => this.getStatisticsDomain(),
|
|
80882
81108
|
getAxisType: () => this.type,
|
|
80883
|
-
getAxisId: () => this.id
|
|
81109
|
+
getAxisId: () => this.id,
|
|
81110
|
+
isInverse: () => this._spec.inverse === true
|
|
80884
81111
|
};
|
|
80885
81112
|
}
|
|
80886
81113
|
afterCompile() {
|
|
@@ -81085,7 +81312,7 @@
|
|
|
81085
81312
|
}
|
|
81086
81313
|
_getTitleLimit(isX) {
|
|
81087
81314
|
if (this._spec.title.visible && isNil(this._spec.title.style?.maxLineWidth)) {
|
|
81088
|
-
const angle = this._spec.title.style?.angle
|
|
81315
|
+
const angle = this._axisStyle.title?.angle ?? this._spec.title.style?.angle ?? 0;
|
|
81089
81316
|
if (isX) {
|
|
81090
81317
|
const width = this.getLayoutRect().width;
|
|
81091
81318
|
const cosValue = Math.abs(Math.cos(angle));
|
|
@@ -81254,7 +81481,7 @@
|
|
|
81254
81481
|
transformScaleDomain() {
|
|
81255
81482
|
this.setScaleNice();
|
|
81256
81483
|
}
|
|
81257
|
-
|
|
81484
|
+
setLinearScaleNice() {
|
|
81258
81485
|
let tickCount = this._spec.tick?.forceTickCount ?? this._spec.tick?.tickCount ?? 10;
|
|
81259
81486
|
if (this._spec.niceType === 'accurateFirst') {
|
|
81260
81487
|
tickCount = Math.max(10, tickCount);
|
|
@@ -81269,6 +81496,25 @@
|
|
|
81269
81496
|
this._nice && this._scale.niceMin(tickCount);
|
|
81270
81497
|
}
|
|
81271
81498
|
}
|
|
81499
|
+
setLogScaleNice() {
|
|
81500
|
+
if (isNil(this._domain?.min) && isNil(this._domain?.max)) {
|
|
81501
|
+
this._nice && this._scale.nice();
|
|
81502
|
+
}
|
|
81503
|
+
else if (isValid(this._domain?.min) && isNil(this._domain?.max)) {
|
|
81504
|
+
this._nice && this._scale.niceMax();
|
|
81505
|
+
}
|
|
81506
|
+
else if (isNil(this._domain?.min) && isValid(this._domain?.max)) {
|
|
81507
|
+
this._nice && this._scale.niceMin();
|
|
81508
|
+
}
|
|
81509
|
+
}
|
|
81510
|
+
setScaleNice() {
|
|
81511
|
+
if (this._spec.type === 'log') {
|
|
81512
|
+
this.setLogScaleNice();
|
|
81513
|
+
}
|
|
81514
|
+
else {
|
|
81515
|
+
this.setLinearScaleNice();
|
|
81516
|
+
}
|
|
81517
|
+
}
|
|
81272
81518
|
dataToPosition(values, cfg) {
|
|
81273
81519
|
return this.valueToPosition(values[0]);
|
|
81274
81520
|
}
|
|
@@ -81570,7 +81816,8 @@
|
|
|
81570
81816
|
getBandwidth,
|
|
81571
81817
|
getStatisticsDomain: () => this.getStatisticsDomain(),
|
|
81572
81818
|
getAxisType: () => this.type,
|
|
81573
|
-
getAxisId: () => this.id
|
|
81819
|
+
getAxisId: () => this.id,
|
|
81820
|
+
isInverse: () => this._spec.inverse
|
|
81574
81821
|
};
|
|
81575
81822
|
}
|
|
81576
81823
|
dataToPosition(values, cfg = {}) {
|
|
@@ -81692,6 +81939,20 @@
|
|
|
81692
81939
|
}
|
|
81693
81940
|
}
|
|
81694
81941
|
|
|
81942
|
+
class CartesianLogAxis extends CartesianLinearAxis {
|
|
81943
|
+
static type = ComponentTypeEnum.cartesianLogAxis;
|
|
81944
|
+
type = ComponentTypeEnum.cartesianLogAxis;
|
|
81945
|
+
_zero = false;
|
|
81946
|
+
_scale = new LogScale();
|
|
81947
|
+
initScales() {
|
|
81948
|
+
super.initScales();
|
|
81949
|
+
this._scale.base(this._spec.base ?? 10);
|
|
81950
|
+
}
|
|
81951
|
+
transformScaleDomain() {
|
|
81952
|
+
}
|
|
81953
|
+
}
|
|
81954
|
+
mixin(CartesianLogAxis, LinearAxisMixin);
|
|
81955
|
+
|
|
81695
81956
|
class PolarAxis extends AxisComponent {
|
|
81696
81957
|
static type = ComponentTypeEnum.polarAxis;
|
|
81697
81958
|
type = ComponentTypeEnum.polarAxis;
|
|
@@ -83422,7 +83683,8 @@
|
|
|
83422
83683
|
return this.dataToLongitude(values[0]);
|
|
83423
83684
|
},
|
|
83424
83685
|
getAxisType: () => this.type,
|
|
83425
|
-
getAxisId: () => this.id
|
|
83686
|
+
getAxisId: () => this.id,
|
|
83687
|
+
isInverse: () => false
|
|
83426
83688
|
});
|
|
83427
83689
|
s.setYAxisHelper({
|
|
83428
83690
|
...helper,
|
|
@@ -83430,7 +83692,8 @@
|
|
|
83430
83692
|
return this.dataToLatitude(values[0]);
|
|
83431
83693
|
},
|
|
83432
83694
|
getAxisType: () => this.type,
|
|
83433
|
-
getAxisId: () => this.id
|
|
83695
|
+
getAxisId: () => this.id,
|
|
83696
|
+
isInverse: () => false
|
|
83434
83697
|
});
|
|
83435
83698
|
this._longitudeField && s.setFieldX(this._longitudeField);
|
|
83436
83699
|
this._latitudeField && s.setFieldY(this._latitudeField);
|
|
@@ -85376,6 +85639,9 @@
|
|
|
85376
85639
|
_processSpecX(specX) {
|
|
85377
85640
|
const relativeSeries = this._relativeSeries;
|
|
85378
85641
|
let processType;
|
|
85642
|
+
if (isFunction(specX)) {
|
|
85643
|
+
specX = specX(this._relativeSeries.getData().getLatestData(), this._startRelativeSeries.getData().getLatestData(), this._endRelativeSeries.getData().getLatestData());
|
|
85644
|
+
}
|
|
85379
85645
|
if (this._isSpecAggrOrRege(specX)) {
|
|
85380
85646
|
processType = specX;
|
|
85381
85647
|
return {
|
|
@@ -85390,6 +85656,9 @@
|
|
|
85390
85656
|
_processSpecY(specY) {
|
|
85391
85657
|
const relativeSeries = this._relativeSeries;
|
|
85392
85658
|
let processType;
|
|
85659
|
+
if (isFunction(specY)) {
|
|
85660
|
+
specY = specY(this._relativeSeries.getData().getLatestData(), this._startRelativeSeries.getData().getLatestData(), this._endRelativeSeries.getData().getLatestData());
|
|
85661
|
+
}
|
|
85393
85662
|
if (this._isSpecAggrOrRege(specY)) {
|
|
85394
85663
|
processType = specY;
|
|
85395
85664
|
return {
|
|
@@ -85573,8 +85842,15 @@
|
|
|
85573
85842
|
else if (isPositionLayout) {
|
|
85574
85843
|
points = spec.positions;
|
|
85575
85844
|
}
|
|
85845
|
+
const dataPoints = data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
|
|
85576
85846
|
this._markerComponent?.setAttributes({
|
|
85577
|
-
points: points
|
|
85847
|
+
points: points,
|
|
85848
|
+
label: {
|
|
85849
|
+
...this._markerComponent.attribute?.label,
|
|
85850
|
+
text: this._spec.label.formatMethod
|
|
85851
|
+
? this._spec.label.formatMethod(dataPoints)
|
|
85852
|
+
: this._markerComponent.attribute?.label?.text
|
|
85853
|
+
}
|
|
85578
85854
|
});
|
|
85579
85855
|
}
|
|
85580
85856
|
_initDataView() {
|
|
@@ -85730,8 +86006,15 @@
|
|
|
85730
86006
|
else if (isPositionLayout) {
|
|
85731
86007
|
points = spec.positions;
|
|
85732
86008
|
}
|
|
86009
|
+
const dataPoints = data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
|
|
85733
86010
|
this._markerComponent?.setAttributes({
|
|
85734
|
-
points: points
|
|
86011
|
+
points: points,
|
|
86012
|
+
label: {
|
|
86013
|
+
...this._markerComponent.attribute?.label,
|
|
86014
|
+
text: this._spec.label.formatMethod
|
|
86015
|
+
? this._spec.label.formatMethod(dataPoints)
|
|
86016
|
+
: this._markerComponent.attribute?.label?.text
|
|
86017
|
+
}
|
|
85735
86018
|
});
|
|
85736
86019
|
}
|
|
85737
86020
|
_initDataView() {
|
|
@@ -85840,8 +86123,18 @@
|
|
|
85840
86123
|
else if (isPositionLayout) {
|
|
85841
86124
|
point = spec.position;
|
|
85842
86125
|
}
|
|
86126
|
+
const dataPoints = data.latestData[0].latestData ? data.latestData[0].latestData : data.latestData;
|
|
85843
86127
|
this._markerComponent?.setAttributes({
|
|
85844
|
-
position: point
|
|
86128
|
+
position: point,
|
|
86129
|
+
itemContent: {
|
|
86130
|
+
...this._markerComponent.attribute?.itemContent,
|
|
86131
|
+
textStyle: {
|
|
86132
|
+
...this._markerComponent.attribute?.itemContent?.textStyle,
|
|
86133
|
+
text: this._spec.itemContent.text?.formatMethod
|
|
86134
|
+
? this._spec.itemContent.text.formatMethod(dataPoints)
|
|
86135
|
+
: this._markerComponent.attribute?.itemContent?.textStyle?.text
|
|
86136
|
+
}
|
|
86137
|
+
}
|
|
85845
86138
|
});
|
|
85846
86139
|
}
|
|
85847
86140
|
_initDataView() {
|
|
@@ -88265,16 +88558,19 @@
|
|
|
88265
88558
|
const { series, baseMark } = labelInfo;
|
|
88266
88559
|
const labelSpec = baseMark.getLabelSpec() ?? {};
|
|
88267
88560
|
const labelPosition = labelSpec.position ?? 'outside';
|
|
88561
|
+
const direction = series.direction ?? 'vertical';
|
|
88562
|
+
const isInverse = series.direction === 'horizontal'
|
|
88563
|
+
? series.getXAxisHelper()?.isInverse()
|
|
88564
|
+
: series.getYAxisHelper()?.isInverse();
|
|
88268
88565
|
let position = labelPosition;
|
|
88269
88566
|
if (position !== 'inside') {
|
|
88270
88567
|
position = (data) => {
|
|
88271
88568
|
const { data: datum } = data;
|
|
88272
88569
|
const dataField = series.getMeasureField()[0];
|
|
88273
88570
|
if (labelPosition === 'outside') {
|
|
88274
|
-
|
|
88275
|
-
|
|
88276
|
-
|
|
88277
|
-
return datum?.[dataField] >= 0 ? 'top' : 'bottom';
|
|
88571
|
+
const positionMap = { vertical: ['top', 'bottom'], horizontal: ['right', 'left'] };
|
|
88572
|
+
const index = (datum?.[dataField] >= 0 && isInverse) || (datum?.[dataField] < 0 && !isInverse) ? 1 : 0;
|
|
88573
|
+
return positionMap[direction][index];
|
|
88278
88574
|
}
|
|
88279
88575
|
if (labelPosition === 'inside-bottom') {
|
|
88280
88576
|
return series.direction === 'horizontal' ? 'inside-left' : 'inside-bottom';
|
|
@@ -88307,6 +88603,15 @@
|
|
|
88307
88603
|
position: (data) => {
|
|
88308
88604
|
const { data: datum } = data;
|
|
88309
88605
|
const dataField = series.getMeasureField()[0];
|
|
88606
|
+
const isInverse = series.direction === 'horizontal'
|
|
88607
|
+
? series.getXAxisHelper()?.isInverse()
|
|
88608
|
+
: series.getYAxisHelper()?.isInverse();
|
|
88609
|
+
if (isInverse) {
|
|
88610
|
+
if (datum?.[dataField] >= 0) {
|
|
88611
|
+
return series.direction === 'horizontal' ? ['left', 'inside-left'] : ['bottom', 'inside-bottom'];
|
|
88612
|
+
}
|
|
88613
|
+
return series.direction === 'horizontal' ? ['right', 'inside-right'] : ['top', 'inside-top'];
|
|
88614
|
+
}
|
|
88310
88615
|
if (datum?.[dataField] >= 0) {
|
|
88311
88616
|
return series.direction === 'horizontal' ? ['right', 'inside-right'] : ['top', 'inside-top'];
|
|
88312
88617
|
}
|
|
@@ -89051,6 +89356,7 @@
|
|
|
89051
89356
|
CartesianLinearAxis,
|
|
89052
89357
|
CartesianBandAxis,
|
|
89053
89358
|
CartesianTimeAxis,
|
|
89359
|
+
CartesianLogAxis,
|
|
89054
89360
|
PolarBandAxis,
|
|
89055
89361
|
PolarLinearAxis,
|
|
89056
89362
|
DiscreteLegend,
|
|
@@ -89096,6 +89402,7 @@
|
|
|
89096
89402
|
exports.CartesianChart = CartesianChart;
|
|
89097
89403
|
exports.CartesianCrossHair = CartesianCrossHair;
|
|
89098
89404
|
exports.CartesianLinearAxis = CartesianLinearAxis;
|
|
89405
|
+
exports.CartesianLogAxis = CartesianLogAxis;
|
|
89099
89406
|
exports.CartesianSeries = CartesianSeries;
|
|
89100
89407
|
exports.CartesianTimeAxis = CartesianTimeAxis;
|
|
89101
89408
|
exports.CellMark = CellMark;
|