@visactor/vchart 1.1.3 → 1.1.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +58 -53
- package/build/index.min.js +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/series/radar/radar.js +2 -2
- package/cjs/series/radar/radar.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/esm/core/index.d.ts +1 -1
- package/esm/core/index.js +1 -1
- package/esm/core/index.js.map +1 -1
- package/esm/series/radar/radar.js +2 -2
- package/esm/series/radar/radar.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/package.json +1 -1
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);
|
|
@@ -2681,7 +2681,7 @@
|
|
|
2681
2681
|
var sign$1 = Math.sign || function (x) {
|
|
2682
2682
|
return x > 0 ? 1 : x < 0 ? -1 : 0;
|
|
2683
2683
|
};
|
|
2684
|
-
var sqrt$
|
|
2684
|
+
var sqrt$2 = Math.sqrt;
|
|
2685
2685
|
var tan = Math.tan;
|
|
2686
2686
|
function acos(x) {
|
|
2687
2687
|
return x > 1 ? 0 : x < -1 ? pi : Math.acos(x);
|
|
@@ -2796,7 +2796,7 @@
|
|
|
2796
2796
|
|
|
2797
2797
|
// TODO return d
|
|
2798
2798
|
function cartesianNormalizeInPlace(d) {
|
|
2799
|
-
var l = sqrt$
|
|
2799
|
+
var l = sqrt$2(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
|
|
2800
2800
|
d[0] /= l, d[1] /= l, d[2] /= l;
|
|
2801
2801
|
}
|
|
2802
2802
|
|
|
@@ -3451,7 +3451,7 @@
|
|
|
3451
3451
|
uu = cartesianDot(u, u),
|
|
3452
3452
|
t2 = w * w - uu * (cartesianDot(A, A) - 1);
|
|
3453
3453
|
if (t2 < 0) return;
|
|
3454
|
-
var t = sqrt$
|
|
3454
|
+
var t = sqrt$2(t2),
|
|
3455
3455
|
q = cartesianScale(u, (-w - t) / uu);
|
|
3456
3456
|
cartesianAddInPlace(q, A);
|
|
3457
3457
|
q = spherical(q);
|
|
@@ -3813,7 +3813,7 @@
|
|
|
3813
3813
|
function centroidPointLine(x, y) {
|
|
3814
3814
|
var dx = x - x0$1,
|
|
3815
3815
|
dy = y - y0$1,
|
|
3816
|
-
z = sqrt$
|
|
3816
|
+
z = sqrt$2(dx * dx + dy * dy);
|
|
3817
3817
|
X1 += z * (x0$1 + x) / 2;
|
|
3818
3818
|
Y1 += z * (y0$1 + y) / 2;
|
|
3819
3819
|
Z1 += z;
|
|
@@ -3835,7 +3835,7 @@
|
|
|
3835
3835
|
function centroidPointRing(x, y) {
|
|
3836
3836
|
var dx = x - x0$1,
|
|
3837
3837
|
dy = y - y0$1,
|
|
3838
|
-
z = sqrt$
|
|
3838
|
+
z = sqrt$2(dx * dx + dy * dy);
|
|
3839
3839
|
X1 += z * (x0$1 + x) / 2;
|
|
3840
3840
|
Y1 += z * (y0$1 + y) / 2;
|
|
3841
3841
|
Z1 += z;
|
|
@@ -3925,7 +3925,7 @@
|
|
|
3925
3925
|
}
|
|
3926
3926
|
function lengthPoint(x, y) {
|
|
3927
3927
|
x0 -= x, y0 -= y;
|
|
3928
|
-
lengthSum.add(sqrt$
|
|
3928
|
+
lengthSum.add(sqrt$2(x0 * x0 + y0 * y0));
|
|
3929
3929
|
x0 = x, y0 = y;
|
|
3930
3930
|
}
|
|
3931
3931
|
var pathMeasure = lengthStream;
|
|
@@ -4128,7 +4128,7 @@
|
|
|
4128
4128
|
var a = a0 + a1,
|
|
4129
4129
|
b = b0 + b1,
|
|
4130
4130
|
c = c0 + c1,
|
|
4131
|
-
m = sqrt$
|
|
4131
|
+
m = sqrt$2(a * a + b * b + c * c),
|
|
4132
4132
|
phi2 = asin(c /= m),
|
|
4133
4133
|
lambda2 = abs(abs(c) - 1) < epsilon || abs(lambda0 - lambda1) < epsilon ? (lambda0 + lambda1) / 2 : atan2(b, a),
|
|
4134
4134
|
p = project(lambda2, phi2),
|
|
@@ -4331,7 +4331,7 @@
|
|
|
4331
4331
|
return arguments.length ? (sy = _ ? -1 : 1, recenter()) : sy < 0;
|
|
4332
4332
|
};
|
|
4333
4333
|
projection.precision = function (_) {
|
|
4334
|
-
return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt$
|
|
4334
|
+
return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt$2(delta2);
|
|
4335
4335
|
};
|
|
4336
4336
|
projection.fitExtent = function (extent, object) {
|
|
4337
4337
|
return fitExtent(projection, extent, object);
|
|
@@ -4394,9 +4394,9 @@
|
|
|
4394
4394
|
// Are the parallels symmetrical around the Equator?
|
|
4395
4395
|
if (abs(n) < epsilon) return cylindricalEqualAreaRaw(y0);
|
|
4396
4396
|
var c = 1 + sy0 * (2 * n - sy0),
|
|
4397
|
-
r0 = sqrt$
|
|
4397
|
+
r0 = sqrt$2(c) / n;
|
|
4398
4398
|
function project(x, y) {
|
|
4399
|
-
var r = sqrt$
|
|
4399
|
+
var r = sqrt$2(c - 2 * n * sin(y)) / n;
|
|
4400
4400
|
return [r * sin(x *= n), r0 - r * cos(x)];
|
|
4401
4401
|
}
|
|
4402
4402
|
project.invert = function (x, y) {
|
|
@@ -4533,7 +4533,7 @@
|
|
|
4533
4533
|
}
|
|
4534
4534
|
function azimuthalInvert(angle) {
|
|
4535
4535
|
return function (x, y) {
|
|
4536
|
-
var z = sqrt$
|
|
4536
|
+
var z = sqrt$2(x * x + y * y),
|
|
4537
4537
|
c = angle(z),
|
|
4538
4538
|
sc = sin(c),
|
|
4539
4539
|
cc = cos(c);
|
|
@@ -4542,7 +4542,7 @@
|
|
|
4542
4542
|
}
|
|
4543
4543
|
|
|
4544
4544
|
var azimuthalEqualAreaRaw = azimuthalRaw(function (cxcy) {
|
|
4545
|
-
return sqrt$
|
|
4545
|
+
return sqrt$2(2 / (1 + cxcy));
|
|
4546
4546
|
});
|
|
4547
4547
|
azimuthalEqualAreaRaw.invert = azimuthalInvert(function (z) {
|
|
4548
4548
|
return 2 * asin(z / 2);
|
|
@@ -4620,7 +4620,7 @@
|
|
|
4620
4620
|
}
|
|
4621
4621
|
project.invert = function (x, y) {
|
|
4622
4622
|
var fy = f - y,
|
|
4623
|
-
r = sign$1(n) * sqrt$
|
|
4623
|
+
r = sign$1(n) * sqrt$2(x * x + fy * fy),
|
|
4624
4624
|
l = atan2(x, abs(fy)) * sign$1(fy);
|
|
4625
4625
|
if (fy * n < 0) l -= pi * sign$1(x) * sign$1(fy);
|
|
4626
4626
|
return [l / n, 2 * atan(pow(f / r, 1 / n)) - halfPi$1];
|
|
@@ -4653,7 +4653,7 @@
|
|
|
4653
4653
|
var gy = g - y,
|
|
4654
4654
|
l = atan2(x, abs(gy)) * sign$1(gy);
|
|
4655
4655
|
if (gy * n < 0) l -= pi * sign$1(x) * sign$1(gy);
|
|
4656
|
-
return [l / n, g - sign$1(n) * sqrt$
|
|
4656
|
+
return [l / n, g - sign$1(n) * sqrt$2(x * x + gy * gy)];
|
|
4657
4657
|
};
|
|
4658
4658
|
return project;
|
|
4659
4659
|
}
|
|
@@ -4665,7 +4665,7 @@
|
|
|
4665
4665
|
A2 = -0.081106,
|
|
4666
4666
|
A3 = 0.000893,
|
|
4667
4667
|
A4 = 0.003796,
|
|
4668
|
-
M = sqrt$
|
|
4668
|
+
M = sqrt$2(3) / 2,
|
|
4669
4669
|
iterations = 12;
|
|
4670
4670
|
function equalEarthRaw(lambda, phi) {
|
|
4671
4671
|
var l = asin(M * sin(phi)),
|
|
@@ -8652,7 +8652,7 @@
|
|
|
8652
8652
|
return x;
|
|
8653
8653
|
}
|
|
8654
8654
|
const generatePow = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
|
|
8655
|
-
const sqrt = x => x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);
|
|
8655
|
+
const sqrt$1 = x => x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);
|
|
8656
8656
|
const square$3 = x => x < 0 ? -x * x : x * x;
|
|
8657
8657
|
const logNegative = x => -Math.log(-x);
|
|
8658
8658
|
const expNegative = x => -Math.exp(-x);
|
|
@@ -9121,7 +9121,7 @@
|
|
|
9121
9121
|
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);
|
|
9122
9122
|
}
|
|
9123
9123
|
rescale(slience) {
|
|
9124
|
-
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;
|
|
9124
|
+
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;
|
|
9125
9125
|
}
|
|
9126
9126
|
exponent(_, slience) {
|
|
9127
9127
|
return arguments.length ? (this._exponent = _, this.rescale(slience)) : this._exponent;
|
|
@@ -9243,7 +9243,7 @@
|
|
|
9243
9243
|
|
|
9244
9244
|
class SqrtScale extends LinearScale {
|
|
9245
9245
|
constructor() {
|
|
9246
|
-
super(sqrt, square$3), this.type = ScaleEnum.Sqrt;
|
|
9246
|
+
super(sqrt$1, square$3), this.type = ScaleEnum.Sqrt;
|
|
9247
9247
|
}
|
|
9248
9248
|
clone() {
|
|
9249
9249
|
return new SqrtScale().domain(this._domain, !0).range(this._range, !0).unknown(this._unknown).clamp(this.clamp(), null, !0).interpolate(this._interpolate);
|
|
@@ -22427,8 +22427,8 @@
|
|
|
22427
22427
|
ay = yors - oc[1],
|
|
22428
22428
|
bx = xore - oc[0],
|
|
22429
22429
|
by = yore - oc[1],
|
|
22430
|
-
kc = 1 / sin$1(acos$1((ax * bx + ay * by) / (sqrt$
|
|
22431
|
-
lc = sqrt$
|
|
22430
|
+
kc = 1 / sin$1(acos$1((ax * bx + ay * by) / (sqrt$3(ax * ax + ay * ay) * sqrt$3(bx * bx + by * by))) / 2),
|
|
22431
|
+
lc = sqrt$3(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
22432
22432
|
limitedIcr = min$3(maxInnerCornerRadius, (innerRadius - lc) / (kc - 1)), limitedOcr = min$3(maxOuterCornerRadius, (outerRadius - lc) / (kc + 1));
|
|
22433
22433
|
}
|
|
22434
22434
|
}
|
|
@@ -22646,8 +22646,8 @@
|
|
|
22646
22646
|
ay = yors - oc[1],
|
|
22647
22647
|
bx = xore - oc[0],
|
|
22648
22648
|
by = yore - oc[1],
|
|
22649
|
-
kc = 1 / sin$1(acos$1((ax * bx + ay * by) / (sqrt$
|
|
22650
|
-
lc = sqrt$
|
|
22649
|
+
kc = 1 / sin$1(acos$1((ax * bx + ay * by) / (sqrt$3(ax * ax + ay * ay) * sqrt$3(bx * bx + by * by))) / 2),
|
|
22650
|
+
lc = sqrt$3(oc[0] * oc[0] + oc[1] * oc[1]);
|
|
22651
22651
|
limitedIcr = min$3(maxInnerCornerRadius, (innerRadius - lc) / (kc - 1)), limitedOcr = min$3(maxOuterCornerRadius, (outerRadius - lc) / (kc + 1));
|
|
22652
22652
|
}
|
|
22653
22653
|
}
|
|
@@ -23347,7 +23347,7 @@
|
|
|
23347
23347
|
}
|
|
23348
23348
|
var star$2 = new StarSymbol();
|
|
23349
23349
|
|
|
23350
|
-
const sqrt3$1 = sqrt$
|
|
23350
|
+
const sqrt3$1 = sqrt$3(3);
|
|
23351
23351
|
function arrow(ctx, r, transX, transY) {
|
|
23352
23352
|
const triangleH = r,
|
|
23353
23353
|
trangleBottomSide = triangleH / sqrt3$1,
|
|
@@ -23414,8 +23414,8 @@
|
|
|
23414
23414
|
var stroke$1 = new StrokeSymbol();
|
|
23415
23415
|
|
|
23416
23416
|
const c$1 = -.5,
|
|
23417
|
-
s = sqrt$
|
|
23418
|
-
k = 1 / sqrt$
|
|
23417
|
+
s = sqrt$3(3) / 2,
|
|
23418
|
+
k = 1 / sqrt$3(12);
|
|
23419
23419
|
function wye(ctx, r, transX, transY) {
|
|
23420
23420
|
const x0 = r / 2,
|
|
23421
23421
|
y0 = r * k,
|
|
@@ -23511,7 +23511,7 @@
|
|
|
23511
23511
|
}
|
|
23512
23512
|
var triangleDown = new TriangleDownSymbol();
|
|
23513
23513
|
|
|
23514
|
-
const sqrt3 = sqrt$
|
|
23514
|
+
const sqrt3 = sqrt$3(3);
|
|
23515
23515
|
function thinTriangle(ctx, r, x, y) {
|
|
23516
23516
|
const h = r * sqrt3;
|
|
23517
23517
|
return ctx.moveTo(x, y + -h / 3 * 2), ctx.lineTo(r + x, y + h), ctx.lineTo(x - r, y + h), ctx.closePath(), !0;
|
|
@@ -24935,7 +24935,7 @@
|
|
|
24935
24935
|
padAngle = arcTheme.padAngle
|
|
24936
24936
|
} = this.attribute,
|
|
24937
24937
|
{
|
|
24938
|
-
padRadius = sqrt$
|
|
24938
|
+
padRadius = sqrt$3(outerRadius * outerRadius + innerRadius * innerRadius)
|
|
24939
24939
|
} = this.attribute,
|
|
24940
24940
|
deltaAngle = abs$1(endAngle - startAngle);
|
|
24941
24941
|
let outerStartAngle = startAngle,
|
|
@@ -34587,7 +34587,7 @@
|
|
|
34587
34587
|
constructor(dir, color) {
|
|
34588
34588
|
let ambient = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : .8;
|
|
34589
34589
|
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;
|
|
34590
|
-
const length = sqrt$
|
|
34590
|
+
const length = sqrt$3(dir[0] * dir[0] + dir[1] * dir[1] + dir[2] * dir[2]);
|
|
34591
34591
|
this.formatedDir = [dir[0] / length, dir[1] / length, dir[2] / length];
|
|
34592
34592
|
}
|
|
34593
34593
|
computeColor(normal, color) {
|
|
@@ -49648,7 +49648,7 @@
|
|
|
49648
49648
|
isSub = rangeSpec.isSubshaft,
|
|
49649
49649
|
reversed = rangeSpec.reversed,
|
|
49650
49650
|
coordinate = this.parameters()[coord];
|
|
49651
|
-
return null == coordinate ? void 0 : coordinate.
|
|
49651
|
+
return null == coordinate ? void 0 : coordinate.getVisualPositionByDimension(dim, isSub, reversed);
|
|
49652
49652
|
}
|
|
49653
49653
|
return null;
|
|
49654
49654
|
}
|
|
@@ -50083,7 +50083,7 @@
|
|
|
50083
50083
|
res = this.isMainDimension(dim) ? [start.x, end.x] : [end.y, start.y];
|
|
50084
50084
|
return reversed ? [res[1], res[0]] : res;
|
|
50085
50085
|
}
|
|
50086
|
-
|
|
50086
|
+
getVisualPositionByDimension(dim, isSubshaft, reversed) {
|
|
50087
50087
|
return this.isMainDimension(dim) ? isSubshaft ? "top" : "bottom" : isSubshaft ? "right" : "left";
|
|
50088
50088
|
}
|
|
50089
50089
|
getAxisPointsByDimension(dim, isSubshaft, reversed, baseValue) {
|
|
@@ -50230,7 +50230,7 @@
|
|
|
50230
50230
|
const res = this.isMainDimension(dim) ? [this.startAngle, this.endAngle] : [this.innerRadius, this.outerRadius];
|
|
50231
50231
|
return reversed ? [res[1], res[0]] : res;
|
|
50232
50232
|
}
|
|
50233
|
-
|
|
50233
|
+
getVisualPositionByDimension(dim, isSubshaft, reversed) {
|
|
50234
50234
|
return this.isMainDimension(dim) ? isSubshaft ? "inside" : "outside" : isSubshaft ? "end" : "start";
|
|
50235
50235
|
}
|
|
50236
50236
|
getAxisPointsByDimension(dim, isSubshaft, reversed, baseValue) {
|
|
@@ -58110,7 +58110,7 @@
|
|
|
58110
58110
|
VChart.useMark([ComponentMark, GroupMark, ImageMark]);
|
|
58111
58111
|
Factory.registerRegion('region', Region);
|
|
58112
58112
|
Factory.registerLayout('base', Layout);
|
|
58113
|
-
const version = "1.1.
|
|
58113
|
+
const version = "1.1.4-beta.1";
|
|
58114
58114
|
Logger.getInstance(LoggerLevel.Error);
|
|
58115
58115
|
|
|
58116
58116
|
var SeriesMarkNameEnum;
|
|
@@ -67366,13 +67366,13 @@
|
|
|
67366
67366
|
if (!datum || !this.angleAxisHelper || !this.radiusAxisHelper) {
|
|
67367
67367
|
return Number.NaN;
|
|
67368
67368
|
}
|
|
67369
|
-
return this.valueToPosition(this.getDatumPositionValues(datum, this._angleField), this._stack ? this.getDatumPositionValues(datum, this._innerRadiusField) : 0).x;
|
|
67369
|
+
return this.valueToPosition(this.getDatumPositionValues(datum, this._angleField), this._stack ? this.getDatumPositionValues(datum, this._innerRadiusField) : this.radiusScale.domain()[0]).x;
|
|
67370
67370
|
},
|
|
67371
67371
|
y1: (datum) => {
|
|
67372
67372
|
if (!datum || !this.angleAxisHelper || !this.radiusAxisHelper) {
|
|
67373
67373
|
return Number.NaN;
|
|
67374
67374
|
}
|
|
67375
|
-
const value = this.valueToPosition(this.getDatumPositionValues(datum, this._angleField), this._stack ? this.getDatumPositionValues(datum, this._innerRadiusField) : 0).y;
|
|
67375
|
+
const value = this.valueToPosition(this.getDatumPositionValues(datum, this._angleField), this._stack ? this.getDatumPositionValues(datum, this._innerRadiusField) : this.radiusScale.domain()[0]).y;
|
|
67376
67376
|
return value;
|
|
67377
67377
|
},
|
|
67378
67378
|
fill: this.getColorAttribute(),
|
|
@@ -69428,8 +69428,9 @@
|
|
|
69428
69428
|
let fontSize = options.fontSize ? field$1(options.fontSize) : 14;
|
|
69429
69429
|
const fontSizeRange = options.fontSizeRange;
|
|
69430
69430
|
if (fontSizeRange && !isNumber(fontSize)) {
|
|
69431
|
-
const fsize = fontSize
|
|
69432
|
-
|
|
69431
|
+
const fsize = fontSize,
|
|
69432
|
+
fontSizeSqrtScale = generateSqrtScale(extent$1(fsize, data), fontSizeRange);
|
|
69433
|
+
fontSize = datum => fontSizeSqrtScale(fsize(datum));
|
|
69433
69434
|
}
|
|
69434
69435
|
let Layout = CloudLayout;
|
|
69435
69436
|
"fast" === options.layoutType ? Layout = FastLayout : "grid" === options.layoutType && (Layout = GridLayout$1);
|
|
@@ -69465,7 +69466,15 @@
|
|
|
69465
69466
|
} : layout.output();
|
|
69466
69467
|
};
|
|
69467
69468
|
const field$1 = option => isString(option) || isNumber(option) || isFunction(option) ? option : datum => datum[option.field],
|
|
69468
|
-
|
|
69469
|
+
sqrt = x => x < 0 ? -Math.sqrt(-x) : Math.sqrt(x),
|
|
69470
|
+
generateSqrtScale = (domain, range) => {
|
|
69471
|
+
if (domain[0] === domain[1]) return datum => range[0];
|
|
69472
|
+
const s0 = sqrt(domain[0]),
|
|
69473
|
+
s1 = sqrt(domain[1]),
|
|
69474
|
+
min = Math.min(s0, s1),
|
|
69475
|
+
max = Math.max(s0, s1);
|
|
69476
|
+
return datum => (sqrt(datum) - min) / (max - min) * (range[1] - range[0]) + range[0];
|
|
69477
|
+
},
|
|
69469
69478
|
extent$1 = (field, data) => {
|
|
69470
69479
|
let min = 1 / 0,
|
|
69471
69480
|
max = -1 / 0;
|
|
@@ -70755,15 +70764,11 @@
|
|
|
70755
70764
|
});
|
|
70756
70765
|
}
|
|
70757
70766
|
const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;
|
|
70758
|
-
const srView = this.getCompiler().getVGrammarView();
|
|
70759
70767
|
if (!this._isWordCloudShape) {
|
|
70760
70768
|
wordCloudTransforms.push({
|
|
70761
70769
|
type: 'wordcloud',
|
|
70762
70770
|
layoutType: !isTrueBrowser(this._option.mode) ? 'fast' : this._wordCloudConfig.layoutMode,
|
|
70763
|
-
size: [
|
|
70764
|
-
srView.width() - this._padding?.left || 0 - this._padding?.right || 0,
|
|
70765
|
-
srView.height() - this._padding?.top || 0 - this._padding?.bottom || 0
|
|
70766
|
-
],
|
|
70771
|
+
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
70767
70772
|
shape: this._maskShape,
|
|
70768
70773
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
70769
70774
|
text: { field: textField },
|
|
@@ -70788,7 +70793,7 @@
|
|
|
70788
70793
|
wordCloudTransforms.push({
|
|
70789
70794
|
type: 'wordcloudShape',
|
|
70790
70795
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
70791
|
-
size: [
|
|
70796
|
+
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
70792
70797
|
shape: this._maskShape,
|
|
70793
70798
|
text: { field: this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField },
|
|
70794
70799
|
fontSize: valueField ? { field: valueField } : this._fontSizeRange[0],
|
|
@@ -70863,6 +70868,10 @@
|
|
|
70863
70868
|
}
|
|
70864
70869
|
setValueFieldToPercent() {
|
|
70865
70870
|
}
|
|
70871
|
+
onLayoutEnd(ctx) {
|
|
70872
|
+
super.onLayoutEnd(ctx);
|
|
70873
|
+
this.compile();
|
|
70874
|
+
}
|
|
70866
70875
|
updateSpec(spec) {
|
|
70867
70876
|
const originalSpec = this._originalSpec;
|
|
70868
70877
|
const result = super.updateSpec(spec);
|
|
@@ -70928,15 +70937,11 @@
|
|
|
70928
70937
|
});
|
|
70929
70938
|
}
|
|
70930
70939
|
const textField = this._spec.word?.formatMethod ? WORD_CLOUD_TEXT : this._nameField;
|
|
70931
|
-
const srView = this.getCompiler().getVGrammarView();
|
|
70932
70940
|
if (!this._isWordCloudShape) {
|
|
70933
70941
|
wordCloudTransforms.push({
|
|
70934
70942
|
type: 'wordcloud',
|
|
70935
70943
|
layoutType: this._wordCloudConfig.layoutMode,
|
|
70936
|
-
size: [
|
|
70937
|
-
srView.width() - this._padding?.left || 0 - this._padding?.right || 0,
|
|
70938
|
-
srView.height() - this._padding?.top || 0 - this._padding?.bottom || 0
|
|
70939
|
-
],
|
|
70944
|
+
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
70940
70945
|
shape: this._maskShape,
|
|
70941
70946
|
postProjection: this._spec.postProjection ?? 'StereographicProjection',
|
|
70942
70947
|
dataIndexKey: DEFAULT_DATA_KEY,
|
|
@@ -70962,7 +70967,7 @@
|
|
|
70962
70967
|
else {
|
|
70963
70968
|
wordCloudTransforms.push({
|
|
70964
70969
|
type: 'wordcloudShape',
|
|
70965
|
-
size: [
|
|
70970
|
+
size: [this._region.getLayoutRect().width, this._region.getLayoutRect().height],
|
|
70966
70971
|
shape: this._maskShape,
|
|
70967
70972
|
postProjection: this._spec.postProjection ?? 'StereographicProjection',
|
|
70968
70973
|
dataIndexKey: DEFAULT_DATA_KEY,
|