@visactor/vtable 0.23.1 → 0.23.2
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/cjs/ListTable.js +6 -5
- package/cjs/ListTable.js.map +1 -1
- package/cjs/PivotChart.js +61 -58
- package/cjs/PivotChart.js.map +1 -1
- package/cjs/PivotTable.js +5 -3
- package/cjs/PivotTable.js.map +1 -1
- package/cjs/body-helper/body-helper.d.ts +1 -0
- package/cjs/body-helper/body-helper.js +3 -0
- package/cjs/body-helper/body-helper.js.map +1 -1
- package/cjs/core/BaseTable.d.ts +1 -0
- package/cjs/core/BaseTable.js +13 -8
- package/cjs/core/BaseTable.js.map +1 -1
- package/cjs/core/FouseInput.js +1 -2
- package/cjs/core/row-series-number-helper.js +2 -1
- package/cjs/core/tableHelper.d.ts +1 -0
- package/cjs/core/tableHelper.js +29 -2
- package/cjs/core/tableHelper.js.map +1 -1
- package/cjs/dataset/dataset.js +6 -2
- package/cjs/dataset/dataset.js.map +1 -1
- package/cjs/event/listener/container-dom.js +2 -2
- package/cjs/event/listener/container-dom.js.map +1 -1
- package/cjs/event/listener/table-group.js +7 -3
- package/cjs/event/listener/table-group.js.map +1 -1
- package/cjs/header-helper/header-helper.d.ts +1 -0
- package/cjs/header-helper/header-helper.js +3 -0
- package/cjs/header-helper/header-helper.js.map +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/layout/chart-helper/get-axis-config.d.ts +2 -0
- package/cjs/layout/chart-helper/get-axis-config.js +9 -6
- package/cjs/layout/chart-helper/get-axis-config.js.map +1 -1
- package/cjs/layout/pivot-header-layout.d.ts +1 -0
- package/cjs/layout/pivot-header-layout.js +3 -2
- package/cjs/layout/pivot-header-layout.js.map +1 -1
- package/cjs/layout/simple-header-layout.d.ts +1 -0
- package/cjs/layout/simple-header-layout.js +1 -1
- package/cjs/layout/simple-header-layout.js.map +1 -1
- package/cjs/layout/tree-helper.js +0 -1
- package/cjs/plugins/themes.js +2 -1
- package/cjs/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-helper.js +6 -6
- package/cjs/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js +13 -5
- package/cjs/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js +2 -2
- package/cjs/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js +1 -1
- package/cjs/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js +1 -1
- package/cjs/scenegraph/group-creater/column-helper.js.map +1 -1
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js +10 -6
- package/cjs/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/cjs/scenegraph/layout/update-height.js +2 -2
- package/cjs/scenegraph/layout/update-height.js.map +1 -1
- package/cjs/scenegraph/layout/update-row.js +59 -14
- package/cjs/scenegraph/layout/update-row.js.map +1 -1
- package/cjs/scenegraph/layout/update-width.js +12 -12
- package/cjs/scenegraph/layout/update-width.js.map +1 -1
- package/cjs/scenegraph/scenegraph.js +3 -2
- package/cjs/scenegraph/scenegraph.js.map +1 -1
- package/cjs/scenegraph/style/corner-cell.js +1 -1
- package/cjs/scenegraph/style/corner-cell.js.map +1 -1
- package/cjs/scenegraph/style/frame-border.js +1 -1
- package/cjs/scenegraph/style/frame-border.js.map +1 -1
- package/cjs/scenegraph/utils/get-hierarchy-offset.js +5 -3
- package/cjs/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/cjs/state/state.js +16 -14
- package/cjs/state/state.js.map +1 -1
- package/cjs/tools/global.d.ts +2 -2
- package/cjs/tools/global.js +2 -2
- package/cjs/tools/global.js.map +1 -1
- package/cjs/ts-types/base-table.d.ts +1 -0
- package/cjs/ts-types/base-table.js.map +1 -1
- package/cjs/ts-types/new-data-set.d.ts +1 -0
- package/cjs/ts-types/new-data-set.js.map +1 -1
- package/cjs/ts-types/table-engine.d.ts +2 -0
- package/cjs/ts-types/table-engine.js.map +1 -1
- package/cjs/vrender.js.map +1 -1
- package/dist/vtable.js +640 -785
- package/dist/vtable.min.js +2 -2
- package/es/ListTable.js +6 -5
- package/es/ListTable.js.map +1 -1
- package/es/PivotChart.js +63 -57
- package/es/PivotChart.js.map +1 -1
- package/es/PivotTable.js +5 -2
- package/es/PivotTable.js.map +1 -1
- package/es/body-helper/body-helper.d.ts +1 -0
- package/es/body-helper/body-helper.js +3 -0
- package/es/body-helper/body-helper.js.map +1 -1
- package/es/core/BaseTable.d.ts +1 -0
- package/es/core/BaseTable.js +13 -8
- package/es/core/BaseTable.js.map +1 -1
- package/es/core/FouseInput.js +1 -2
- package/es/core/row-series-number-helper.js +2 -1
- package/es/core/tableHelper.d.ts +1 -0
- package/es/core/tableHelper.js +26 -0
- package/es/core/tableHelper.js.map +1 -1
- package/es/dataset/dataset.js +6 -2
- package/es/dataset/dataset.js.map +1 -1
- package/es/event/listener/container-dom.js +2 -2
- package/es/event/listener/container-dom.js.map +1 -1
- package/es/event/listener/table-group.js +7 -3
- package/es/event/listener/table-group.js.map +1 -1
- package/es/header-helper/header-helper.d.ts +1 -0
- package/es/header-helper/header-helper.js +3 -0
- package/es/header-helper/header-helper.js.map +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/es/layout/chart-helper/get-axis-config.d.ts +2 -0
- package/es/layout/chart-helper/get-axis-config.js +9 -6
- package/es/layout/chart-helper/get-axis-config.js.map +1 -1
- package/es/layout/pivot-header-layout.d.ts +1 -0
- package/es/layout/pivot-header-layout.js +3 -2
- package/es/layout/pivot-header-layout.js.map +1 -1
- package/es/layout/simple-header-layout.d.ts +1 -0
- package/es/layout/simple-header-layout.js +1 -1
- package/es/layout/simple-header-layout.js.map +1 -1
- package/es/layout/tree-helper.js +1 -2
- package/es/plugins/themes.js +2 -1
- package/es/scenegraph/graphic/contributions/group-contribution-render.js.map +1 -1
- package/es/scenegraph/group-creater/cell-helper.js +6 -6
- package/es/scenegraph/group-creater/cell-helper.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/chart-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js +2 -2
- package/es/scenegraph/group-creater/cell-type/checkbox-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/image-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js +13 -4
- package/es/scenegraph/group-creater/cell-type/progress-bar-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/spark-line-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/text-cell.js +2 -2
- package/es/scenegraph/group-creater/cell-type/text-cell.js.map +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js +1 -1
- package/es/scenegraph/group-creater/cell-type/video-cell.js.map +1 -1
- package/es/scenegraph/group-creater/column-helper.js +1 -1
- package/es/scenegraph/group-creater/column-helper.js.map +1 -1
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js +5 -3
- package/es/scenegraph/group-creater/progress/update-position/update-auto-row.js.map +1 -1
- package/es/scenegraph/layout/update-height.js +2 -2
- package/es/scenegraph/layout/update-height.js.map +1 -1
- package/es/scenegraph/layout/update-row.js +59 -15
- package/es/scenegraph/layout/update-row.js.map +1 -1
- package/es/scenegraph/layout/update-width.js +12 -12
- package/es/scenegraph/layout/update-width.js.map +1 -1
- package/es/scenegraph/scenegraph.js +3 -2
- package/es/scenegraph/scenegraph.js.map +1 -1
- package/es/scenegraph/style/corner-cell.js +1 -1
- package/es/scenegraph/style/corner-cell.js.map +1 -1
- package/es/scenegraph/style/frame-border.js +1 -1
- package/es/scenegraph/style/frame-border.js.map +1 -1
- package/es/scenegraph/utils/get-hierarchy-offset.js +6 -2
- package/es/scenegraph/utils/get-hierarchy-offset.js.map +1 -1
- package/es/state/state.js +16 -14
- package/es/state/state.js.map +1 -1
- package/es/tools/global.d.ts +2 -2
- package/es/tools/global.js +2 -2
- package/es/tools/global.js.map +1 -1
- package/es/ts-types/base-table.d.ts +1 -0
- package/es/ts-types/base-table.js.map +1 -1
- package/es/ts-types/new-data-set.d.ts +1 -0
- package/es/ts-types/new-data-set.js.map +1 -1
- package/es/ts-types/table-engine.d.ts +2 -0
- package/es/ts-types/table-engine.js.map +1 -1
- package/es/vrender.js.map +1 -1
- package/package.json +5 -5
package/dist/vtable.js
CHANGED
|
@@ -1281,8 +1281,8 @@
|
|
|
1281
1281
|
};
|
|
1282
1282
|
var isBoolean$2 = isBoolean$1;
|
|
1283
1283
|
|
|
1284
|
-
const isFunction
|
|
1285
|
-
var isFunction$
|
|
1284
|
+
const isFunction = value => "function" == typeof value;
|
|
1285
|
+
var isFunction$1 = isFunction;
|
|
1286
1286
|
|
|
1287
1287
|
const isNil$2 = value => null == value;
|
|
1288
1288
|
var isNil$3 = isNil$2;
|
|
@@ -1311,20 +1311,20 @@
|
|
|
1311
1311
|
const isUndefined = value => void 0 === value;
|
|
1312
1312
|
var isUndefined$1 = isUndefined;
|
|
1313
1313
|
|
|
1314
|
-
const isString$
|
|
1314
|
+
const isString$1 = function (value) {
|
|
1315
1315
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
1316
1316
|
const type = typeof value;
|
|
1317
1317
|
return fuzzy ? "string" === type : "string" === type || isType$3(value, "String");
|
|
1318
1318
|
};
|
|
1319
|
-
var isString$
|
|
1319
|
+
var isString$2 = isString$1;
|
|
1320
1320
|
|
|
1321
1321
|
const isArray$2 = value => Array.isArray ? Array.isArray(value) : isType$3(value, "Array");
|
|
1322
1322
|
var isArray$3 = isArray$2;
|
|
1323
1323
|
|
|
1324
|
-
const isArrayLike
|
|
1324
|
+
const isArrayLike = function (value) {
|
|
1325
1325
|
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
1326
1326
|
};
|
|
1327
|
-
var isArrayLike$
|
|
1327
|
+
var isArrayLike$1 = isArrayLike;
|
|
1328
1328
|
|
|
1329
1329
|
const isDate = value => isType$3(value, "Date");
|
|
1330
1330
|
var isDate$1 = isDate;
|
|
@@ -1358,7 +1358,7 @@
|
|
|
1358
1358
|
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
1359
1359
|
function isEmpty(value) {
|
|
1360
1360
|
if (isNil$3(value)) return !0;
|
|
1361
|
-
if (isArrayLike$
|
|
1361
|
+
if (isArrayLike$1(value)) return !value.length;
|
|
1362
1362
|
const type = getType$1(value);
|
|
1363
1363
|
if ("Map" === type || "Set" === type) return !value.size;
|
|
1364
1364
|
if (isPrototype$1(value)) return !Object.keys(value).length;
|
|
@@ -1367,7 +1367,7 @@
|
|
|
1367
1367
|
}
|
|
1368
1368
|
|
|
1369
1369
|
const get$4 = (obj, path, defaultValue) => {
|
|
1370
|
-
const paths = isString$
|
|
1370
|
+
const paths = isString$2(path) ? path.split(".") : path;
|
|
1371
1371
|
for (let p = 0; p < paths.length; p++) obj = obj ? obj[paths[p]] : void 0;
|
|
1372
1372
|
return void 0 === obj ? defaultValue : obj;
|
|
1373
1373
|
};
|
|
@@ -1382,7 +1382,7 @@
|
|
|
1382
1382
|
if (!isValid$3(value) || "object" != typeof value) return value;
|
|
1383
1383
|
const isArr = isArray$3(value),
|
|
1384
1384
|
length = value.length;
|
|
1385
|
-
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$2(value) || isNumber$4(value) || isString$
|
|
1385
|
+
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$2(value) || isNumber$4(value) || isString$2(value) ? value : isDate$1(value) ? new Date(+value) : void 0;
|
|
1386
1386
|
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
1387
1387
|
let index = -1;
|
|
1388
1388
|
if (result) for (; ++index < (props || value).length;) {
|
|
@@ -1419,7 +1419,7 @@
|
|
|
1419
1419
|
let newValue = source[key],
|
|
1420
1420
|
isCommon = !0;
|
|
1421
1421
|
if (isArray$3(srcValue)) {
|
|
1422
|
-
if (shallowArray) newValue = [];else if (isArray$3(objValue)) newValue = objValue;else if (isArrayLike$
|
|
1422
|
+
if (shallowArray) newValue = [];else if (isArray$3(objValue)) newValue = objValue;else if (isArrayLike$1(objValue)) {
|
|
1423
1423
|
newValue = new Array(objValue.length);
|
|
1424
1424
|
let index = -1;
|
|
1425
1425
|
const length = objValue.length;
|
|
@@ -1450,7 +1450,7 @@
|
|
|
1450
1450
|
const v = obj[k];
|
|
1451
1451
|
let match = !1;
|
|
1452
1452
|
keys.forEach(itKey => {
|
|
1453
|
-
(isString$
|
|
1453
|
+
(isString$2(itKey) && itKey === k || itKey instanceof RegExp && k.match(itKey)) && (match = !0);
|
|
1454
1454
|
}), match || (result[k] = v);
|
|
1455
1455
|
}), result;
|
|
1456
1456
|
}
|
|
@@ -1467,7 +1467,7 @@
|
|
|
1467
1467
|
if (null == a || null == b) return !1;
|
|
1468
1468
|
if (Number.isNaN(a) && Number.isNaN(b)) return !0;
|
|
1469
1469
|
if (objToString(a) !== objToString(b)) return !1;
|
|
1470
|
-
if (isFunction$
|
|
1470
|
+
if (isFunction$1(a)) return !!(null == options ? void 0 : options.skipFunction);
|
|
1471
1471
|
if ("object" != typeof a) return !1;
|
|
1472
1472
|
if (isArray$3(a)) {
|
|
1473
1473
|
if (a.length !== b.length) return !1;
|
|
@@ -1516,12 +1516,12 @@
|
|
|
1516
1516
|
function array$1(arr) {
|
|
1517
1517
|
return isValid$3(arr) ? isArray$3(arr) ? arr : [arr] : [];
|
|
1518
1518
|
}
|
|
1519
|
-
function last
|
|
1520
|
-
if (isArrayLike$
|
|
1519
|
+
function last(val) {
|
|
1520
|
+
if (isArrayLike$1(val)) {
|
|
1521
1521
|
return val[val.length - 1];
|
|
1522
1522
|
}
|
|
1523
1523
|
}
|
|
1524
|
-
const maxInArray
|
|
1524
|
+
const maxInArray = (arr, compareFn) => {
|
|
1525
1525
|
var _a;
|
|
1526
1526
|
if (0 === arr.length) return;
|
|
1527
1527
|
let max = arr[0];
|
|
@@ -1531,7 +1531,7 @@
|
|
|
1531
1531
|
}
|
|
1532
1532
|
return max;
|
|
1533
1533
|
};
|
|
1534
|
-
const minInArray
|
|
1534
|
+
const minInArray = (arr, compareFn) => {
|
|
1535
1535
|
var _a;
|
|
1536
1536
|
if (0 === arr.length) return;
|
|
1537
1537
|
let min = arr[0];
|
|
@@ -1794,7 +1794,7 @@
|
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
1796
1796
|
|
|
1797
|
-
function transformBoundsWithMatrix
|
|
1797
|
+
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
1798
1798
|
const {
|
|
1799
1799
|
x1: x1,
|
|
1800
1800
|
y1: y1,
|
|
@@ -1803,7 +1803,7 @@
|
|
|
1803
1803
|
} = bounds;
|
|
1804
1804
|
return matrix.onlyTranslate() ? (out !== bounds && out.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2), out.translate(matrix.e, matrix.f), bounds) : (out.clear(), out.add(matrix.a * x1 + matrix.c * y1 + matrix.e, matrix.b * x1 + matrix.d * y1 + matrix.f), out.add(matrix.a * x2 + matrix.c * y1 + matrix.e, matrix.b * x2 + matrix.d * y1 + matrix.f), out.add(matrix.a * x2 + matrix.c * y2 + matrix.e, matrix.b * x2 + matrix.d * y2 + matrix.f), out.add(matrix.a * x1 + matrix.c * y2 + matrix.e, matrix.b * x1 + matrix.d * y2 + matrix.f), bounds);
|
|
1805
1805
|
}
|
|
1806
|
-
|
|
1806
|
+
class Bounds {
|
|
1807
1807
|
constructor(bounds) {
|
|
1808
1808
|
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
1809
1809
|
}
|
|
@@ -1903,7 +1903,7 @@
|
|
|
1903
1903
|
return this.y1 *= s, this.y2 *= s, this;
|
|
1904
1904
|
}
|
|
1905
1905
|
transformWithMatrix(matrix) {
|
|
1906
|
-
return transformBoundsWithMatrix
|
|
1906
|
+
return transformBoundsWithMatrix(this, this, matrix), this;
|
|
1907
1907
|
}
|
|
1908
1908
|
copy(b) {
|
|
1909
1909
|
return this.x1 = b.x1, this.y1 = b.y1, this.x2 = b.x2, this.y2 = b.y2, this;
|
|
@@ -1930,21 +1930,27 @@
|
|
|
1930
1930
|
} = this;
|
|
1931
1931
|
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
1932
1932
|
}
|
|
1933
|
-
}
|
|
1934
|
-
|
|
1933
|
+
}
|
|
1934
|
+
class AABBBounds extends Bounds {}
|
|
1935
1935
|
|
|
1936
|
-
function degreeToRadian
|
|
1936
|
+
function degreeToRadian(degree) {
|
|
1937
1937
|
return degree * (Math.PI / 180);
|
|
1938
1938
|
}
|
|
1939
1939
|
function radianToDegree(radian) {
|
|
1940
1940
|
return 180 * radian / Math.PI;
|
|
1941
1941
|
}
|
|
1942
|
-
const clampRadian = function () {
|
|
1942
|
+
const clampRadian$1 = function () {
|
|
1943
1943
|
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
1944
1944
|
if (angle < 0) for (; angle < -tau;) angle += tau;else if (angle > 0) for (; angle > tau;) angle -= tau;
|
|
1945
1945
|
return angle;
|
|
1946
1946
|
};
|
|
1947
|
-
const clampAngleByRadian = clampRadian;
|
|
1947
|
+
const clampAngleByRadian = clampRadian$1;
|
|
1948
|
+
function polarToCartesian(center, radius, angleInRadian) {
|
|
1949
|
+
return {
|
|
1950
|
+
x: center.x + radius * Math.cos(angleInRadian),
|
|
1951
|
+
y: center.y + radius * Math.sin(angleInRadian)
|
|
1952
|
+
};
|
|
1953
|
+
}
|
|
1948
1954
|
|
|
1949
1955
|
class Matrix {
|
|
1950
1956
|
constructor() {
|
|
@@ -2689,14 +2695,14 @@
|
|
|
2689
2695
|
return isCover((box1.x2 - box1.x1) / 2, deg11, A1B1, B1C1) && isCover((box1.y2 - box1.y1) / 2, deg12, A1B1, B1C1) && isCover((box2.x2 - box2.x1) / 2, deg21, AB, BC) && isCover((box2.y2 - box2.y1) / 2, deg22, AB, BC);
|
|
2690
2696
|
}
|
|
2691
2697
|
|
|
2692
|
-
const eastAsianCharacterInfo
|
|
2698
|
+
const eastAsianCharacterInfo = character => {
|
|
2693
2699
|
let x = character.charCodeAt(0),
|
|
2694
2700
|
y = 2 === character.length ? character.charCodeAt(1) : 0,
|
|
2695
2701
|
codePoint = x;
|
|
2696
2702
|
return 55296 <= x && x <= 56319 && 56320 <= y && y <= 57343 && (x &= 1023, y &= 1023, codePoint = x << 10 | y, codePoint += 65536), 12288 === codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 ? "F" : 8361 === codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518 ? "H" : 4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141 ? "W" : 32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 === codePoint || 175 === codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630 ? "Na" : 161 === codePoint || 164 === codePoint || 167 <= codePoint && codePoint <= 168 || 170 === codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 === codePoint || 208 === codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 === codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 === codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 === codePoint || 254 === codePoint || 257 === codePoint || 273 === codePoint || 275 === codePoint || 283 === codePoint || 294 <= codePoint && codePoint <= 295 || 299 === codePoint || 305 <= codePoint && codePoint <= 307 || 312 === codePoint || 319 <= codePoint && codePoint <= 322 || 324 === codePoint || 328 <= codePoint && codePoint <= 331 || 333 === codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 === codePoint || 462 === codePoint || 464 === codePoint || 466 === codePoint || 468 === codePoint || 470 === codePoint || 472 === codePoint || 474 === codePoint || 476 === codePoint || 593 === codePoint || 609 === codePoint || 708 === codePoint || 711 === codePoint || 713 <= codePoint && codePoint <= 715 || 717 === codePoint || 720 === codePoint || 728 <= codePoint && codePoint <= 731 || 733 === codePoint || 735 === codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 === codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 === codePoint || 8208 === codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 === codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 === codePoint || 8251 === codePoint || 8254 === codePoint || 8308 === codePoint || 8319 === codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 === codePoint || 8451 === codePoint || 8453 === codePoint || 8457 === codePoint || 8467 === codePoint || 8470 === codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 === codePoint || 8491 === codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 === codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 === codePoint || 8660 === codePoint || 8679 === codePoint || 8704 === codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 === codePoint || 8719 === codePoint || 8721 === codePoint || 8725 === codePoint || 8730 === codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 === codePoint || 8741 === codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 === codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 === codePoint || 8780 === codePoint || 8786 === codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 === codePoint || 8857 === codePoint || 8869 === codePoint || 8895 === codePoint || 8978 === codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 === codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 === codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 === codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 === codePoint || 9758 === codePoint || 9792 === codePoint || 9794 === codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 === codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 === codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 === codePoint || 10071 === codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 === codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109 ? "A" : "N";
|
|
2697
2703
|
};
|
|
2698
2704
|
|
|
2699
|
-
function getContextFont$
|
|
2705
|
+
function getContextFont$1(text) {
|
|
2700
2706
|
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2701
2707
|
const {
|
|
2702
2708
|
fontStyle = defaultAttr.fontStyle,
|
|
@@ -2708,7 +2714,7 @@
|
|
|
2708
2714
|
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize + "px " + (fontFamily || "sans-serif");
|
|
2709
2715
|
}
|
|
2710
2716
|
|
|
2711
|
-
|
|
2717
|
+
class TextMeasure {
|
|
2712
2718
|
constructor(option, textSpec) {
|
|
2713
2719
|
this._numberCharSize = null, this._fullCharSize = null, this._letterCharSize = null, this._specialCharSizeMap = {}, this._canvas = null, this._context = null, this._contextSaved = !1, this._notSupportCanvas = !1, this._notSupportVRender = !1, this._userSpec = {}, this.specialCharSet = "-/: .,@%'\"~", this._option = option, this._userSpec = null != textSpec ? textSpec : {}, this.textSpec = this._initSpec(), isValid$3(option.specialCharSet) && (this.specialCharSet = option.specialCharSet), this._standardMethod = isValid$3(option.getTextBounds) ? this.fullMeasure.bind(this) : this.measureWithNaiveCanvas.bind(this);
|
|
2714
2720
|
}
|
|
@@ -2716,7 +2722,7 @@
|
|
|
2716
2722
|
if (this._notSupportCanvas) return !1;
|
|
2717
2723
|
if (isNil$3(this._canvas) && (isValid$3(this._option.getCanvasForMeasure) && (this._canvas = this._option.getCanvasForMeasure()), isNil$3(this._canvas) && "undefined" != typeof window && void 0 !== window.document && globalThis && isValid$3(globalThis.document) && (this._canvas = globalThis.document.createElement("canvas"))), isNil$3(this._context) && isValid$3(this._canvas)) {
|
|
2718
2724
|
const context = this._canvas.getContext("2d");
|
|
2719
|
-
isValid$3(context) && (context.save(), context.font = getContextFont$
|
|
2725
|
+
isValid$3(context) && (context.save(), context.font = getContextFont$1(this.textSpec), this._contextSaved = !0, this._context = context);
|
|
2720
2726
|
}
|
|
2721
2727
|
return !isNil$3(this._context) || (this._notSupportCanvas = !0, !1);
|
|
2722
2728
|
}
|
|
@@ -2741,7 +2747,7 @@
|
|
|
2741
2747
|
let {
|
|
2742
2748
|
lineHeight = fontSize
|
|
2743
2749
|
} = this._userSpec;
|
|
2744
|
-
if (isString$
|
|
2750
|
+
if (isString$2(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
2745
2751
|
const scale = Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100;
|
|
2746
2752
|
lineHeight = fontSize * scale;
|
|
2747
2753
|
}
|
|
@@ -2836,7 +2842,7 @@
|
|
|
2836
2842
|
for (let i = 0; i < text.length; i++) {
|
|
2837
2843
|
const char = text[i];
|
|
2838
2844
|
let size = this._measureSpecialChar(char);
|
|
2839
|
-
isNil$3(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$3(size) && ["F", "W"].includes(eastAsianCharacterInfo
|
|
2845
|
+
isNil$3(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$3(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$3(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height);
|
|
2840
2846
|
}
|
|
2841
2847
|
return totalSize;
|
|
2842
2848
|
}
|
|
@@ -2855,7 +2861,7 @@
|
|
|
2855
2861
|
} = this.textSpec;
|
|
2856
2862
|
for (let i = 0; i < text.length; i++) {
|
|
2857
2863
|
const char = text[i],
|
|
2858
|
-
size = ["F", "W"].includes(eastAsianCharacterInfo
|
|
2864
|
+
size = ["F", "W"].includes(eastAsianCharacterInfo(char)) ? 1 : .53;
|
|
2859
2865
|
totalSize.width += size * fontSize;
|
|
2860
2866
|
}
|
|
2861
2867
|
return totalSize.height = null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize, totalSize;
|
|
@@ -2909,8 +2915,8 @@
|
|
|
2909
2915
|
release() {
|
|
2910
2916
|
isValid$3(this._canvas) && (this._canvas = null), isValid$3(this._context) && (this._contextSaved && (this._context.restore(), this._contextSaved = !1), this._context = null);
|
|
2911
2917
|
}
|
|
2912
|
-
}
|
|
2913
|
-
TextMeasure
|
|
2918
|
+
}
|
|
2919
|
+
TextMeasure.ALPHABET_CHAR_SET = "abcdefghijklmnopqrstuvwxyz", TextMeasure.NUMBERS_CHAR_SET = "0123456789", TextMeasure.FULL_SIZE_CHAR = "字";
|
|
2914
2920
|
|
|
2915
2921
|
const hasConsole = "undefined" != typeof console;
|
|
2916
2922
|
function log(method, level, input) {
|
|
@@ -3079,7 +3085,7 @@
|
|
|
3079
3085
|
|
|
3080
3086
|
class CurvePath {
|
|
3081
3087
|
constructor() {
|
|
3082
|
-
this.curves = [], this.bounds = new AABBBounds
|
|
3088
|
+
this.curves = [], this.bounds = new AABBBounds();
|
|
3083
3089
|
}
|
|
3084
3090
|
getCurveLengths() {
|
|
3085
3091
|
return this.curves.map(curve => curve.getLength());
|
|
@@ -3189,7 +3195,7 @@
|
|
|
3189
3195
|
}(BaseRenderContributionTime || (BaseRenderContributionTime = {}));
|
|
3190
3196
|
|
|
3191
3197
|
function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {
|
|
3192
|
-
const th = degreeToRadian
|
|
3198
|
+
const th = degreeToRadian(rotateX),
|
|
3193
3199
|
sin_th = Math.sin(th),
|
|
3194
3200
|
cos_th = Math.cos(th),
|
|
3195
3201
|
px = cos_th * (ox - x) * .5 + sin_th * (oy - y) * .5,
|
|
@@ -3918,7 +3924,7 @@
|
|
|
3918
3924
|
controlX = 0,
|
|
3919
3925
|
controlY = 0;
|
|
3920
3926
|
for (let i = 0, len = commandStrList.length; i < len; ++i) {
|
|
3921
|
-
switch (current = commandStrList[i], 1 === sX && 1 === sY || (current = scale$
|
|
3927
|
+
switch (current = commandStrList[i], 1 === sX && 1 === sY || (current = scale$3(current, sX, sY)), current[0]) {
|
|
3922
3928
|
case "l":
|
|
3923
3929
|
x += current[1], y += current[2], this.lineTo(x + l, y + t);
|
|
3924
3930
|
break;
|
|
@@ -4062,7 +4068,7 @@
|
|
|
4062
4068
|
}
|
|
4063
4069
|
}
|
|
4064
4070
|
const temp = ["l", 0, 0, 0, 0, 0, 0, 0];
|
|
4065
|
-
function scale$
|
|
4071
|
+
function scale$3(current, sX, sY) {
|
|
4066
4072
|
const c = temp[0] = current[0];
|
|
4067
4073
|
if ("a" === c || "A" === c) temp[1] = sX * current[1], temp[2] = sY * current[2], temp[3] = current[3], temp[4] = current[4], temp[5] = current[5], temp[6] = sX * current[6], temp[7] = sY * current[7];else if ("h" === c || "H" === c) temp[1] = sX * current[1];else if ("v" === c || "V" === c) temp[1] = sY * current[1];else for (let i = 1, n = current.length; i < n; ++i) temp[i] = (i % 2 == 1 ? sX : sY) * current[i];
|
|
4068
4074
|
return temp;
|
|
@@ -4947,14 +4953,14 @@
|
|
|
4947
4953
|
return this.global.measureTextMethod = m, data;
|
|
4948
4954
|
}
|
|
4949
4955
|
createTextMeasureInstance(textSpec, option, getCanvasForMeasure) {
|
|
4950
|
-
return this.configure(this.global, this.global.env), new TextMeasure
|
|
4956
|
+
return this.configure(this.global, this.global.env), new TextMeasure(Object.assign({
|
|
4951
4957
|
defaultFontParams: {
|
|
4952
4958
|
fontFamily: DefaultTextStyle.fontFamily,
|
|
4953
4959
|
fontSize: DefaultTextStyle.fontSize
|
|
4954
4960
|
},
|
|
4955
4961
|
getCanvasForMeasure: getCanvasForMeasure || (() => this.canvas),
|
|
4956
4962
|
getTextBounds: void 0,
|
|
4957
|
-
specialCharSet: "-/: .,@%'\"~" + TextMeasure
|
|
4963
|
+
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
4958
4964
|
}, null != option ? option : {}), textSpec);
|
|
4959
4965
|
}
|
|
4960
4966
|
drawGraphicToCanvas(graphic, stage, canvas) {
|
|
@@ -5464,16 +5470,16 @@
|
|
|
5464
5470
|
addEventListener(type, listener, options) {
|
|
5465
5471
|
const capture = isBoolean$2(options, !0) && options || isObject$4(options) && options.capture,
|
|
5466
5472
|
once = isObject$4(options) && options.once,
|
|
5467
|
-
context = isFunction$
|
|
5468
|
-
return type = capture ? `${type}capture` : type, listener = isFunction$
|
|
5473
|
+
context = isFunction$1(listener) ? void 0 : listener;
|
|
5474
|
+
return type = capture ? `${type}capture` : type, listener = isFunction$1(listener) ? listener : listener.handleEvent, once ? super.once(type, listener, context) : super.on(type, listener, context), this;
|
|
5469
5475
|
}
|
|
5470
5476
|
on(type, listener, options) {
|
|
5471
5477
|
return this.addEventListener(type, listener, options);
|
|
5472
5478
|
}
|
|
5473
5479
|
removeEventListener(type, listener, options) {
|
|
5474
5480
|
const capture = isBoolean$2(options, !0) && options || isObject$4(options) && options.capture,
|
|
5475
|
-
context = isFunction$
|
|
5476
|
-
type = capture ? `${type}capture` : type, listener = isFunction$
|
|
5481
|
+
context = isFunction$1(listener) ? void 0 : listener;
|
|
5482
|
+
type = capture ? `${type}capture` : type, listener = isFunction$1(listener) ? listener : listener.handleEvent;
|
|
5477
5483
|
const once = isObject$4(options) && options.once;
|
|
5478
5484
|
return super.off(type, listener, context, once), this;
|
|
5479
5485
|
}
|
|
@@ -5997,7 +6003,7 @@
|
|
|
5997
6003
|
if (this.currentCursor === mode) return;
|
|
5998
6004
|
this.currentCursor = mode;
|
|
5999
6005
|
const style = this.cursorStyles[mode];
|
|
6000
|
-
style ? "string" == typeof style && applyStyles ? domElement.style.cursor = style : "function" == typeof style ? style(mode) : "object" == typeof style && applyStyles && Object.assign(domElement.style, style) : applyStyles && isString$
|
|
6006
|
+
style ? "string" == typeof style && applyStyles ? domElement.style.cursor = style : "function" == typeof style ? style(mode) : "object" == typeof style && applyStyles && Object.assign(domElement.style, style) : applyStyles && isString$2(mode) && !has$1(this.cursorStyles, mode) && (domElement.style.cursor = mode);
|
|
6001
6007
|
}
|
|
6002
6008
|
setTargetElement(element) {
|
|
6003
6009
|
this.removeEvents(), this.domElement = element, this.addEvents();
|
|
@@ -6902,7 +6908,7 @@
|
|
|
6902
6908
|
RafBasedSTO.TimeOut = 1e3 / 60;
|
|
6903
6909
|
const rafBasedSto = new RafBasedSTO();
|
|
6904
6910
|
const calculateLineHeight = (lineHeight, fontSize) => {
|
|
6905
|
-
if (isString$
|
|
6911
|
+
if (isString$2(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
6906
6912
|
return fontSize * (Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100);
|
|
6907
6913
|
}
|
|
6908
6914
|
return lineHeight;
|
|
@@ -7140,7 +7146,7 @@
|
|
|
7140
7146
|
ResourceLoader.cache = new Map(), ResourceLoader.isLoading = !1, ResourceLoader.toLoadAueue = [];
|
|
7141
7147
|
|
|
7142
7148
|
const tempMatrix = new Matrix(),
|
|
7143
|
-
tempBounds$1 = new AABBBounds
|
|
7149
|
+
tempBounds$1 = new AABBBounds();
|
|
7144
7150
|
const GRAPHIC_UPDATE_TAG_KEY = ["lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible"];
|
|
7145
7151
|
const tempConstantXYKey = ["x", "y"],
|
|
7146
7152
|
tempConstantScaleXYKey = ["scaleX", "scaleY"],
|
|
@@ -7202,7 +7208,7 @@
|
|
|
7202
7208
|
constructor() {
|
|
7203
7209
|
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7204
7210
|
var _a;
|
|
7205
|
-
super(), this._AABBBounds = new AABBBounds
|
|
7211
|
+
super(), this._AABBBounds = new AABBBounds(), this._updateTag = UpdateTag.INIT, this.attribute = params, this.valid = this.isValid(), params.background && this.loadImage(null !== (_a = params.background.background) && void 0 !== _a ? _a : params.background, !0);
|
|
7206
7212
|
}
|
|
7207
7213
|
setMode(mode) {
|
|
7208
7214
|
"3d" === mode ? this.set3dMode() : this.set2dMode();
|
|
@@ -7744,7 +7750,7 @@
|
|
|
7744
7750
|
};
|
|
7745
7751
|
}
|
|
7746
7752
|
createPathProxy(path) {
|
|
7747
|
-
return isString$
|
|
7753
|
+
return isString$2(path, !0) ? this.pathProxy = new CustomPath2D().fromString(path) : this.pathProxy = new CustomPath2D(), this.pathProxy;
|
|
7748
7754
|
}
|
|
7749
7755
|
loadImage(image) {
|
|
7750
7756
|
let background = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
@@ -8822,7 +8828,7 @@
|
|
|
8822
8828
|
return new Circle$1(attributes);
|
|
8823
8829
|
}
|
|
8824
8830
|
|
|
8825
|
-
function getContextFont
|
|
8831
|
+
function getContextFont(text) {
|
|
8826
8832
|
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8827
8833
|
let fontSizeScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
8828
8834
|
fontSizeScale || (fontSizeScale = 1);
|
|
@@ -8937,7 +8943,7 @@
|
|
|
8937
8943
|
let Text$1 = class Text extends Graphic {
|
|
8938
8944
|
get font() {
|
|
8939
8945
|
const textTheme = getTheme(this).text;
|
|
8940
|
-
return this._font || (this._font = getContextFont
|
|
8946
|
+
return this._font || (this._font = getContextFont(this.attribute, textTheme)), this._font;
|
|
8941
8947
|
}
|
|
8942
8948
|
get clipedText() {
|
|
8943
8949
|
var _a;
|
|
@@ -9980,7 +9986,7 @@
|
|
|
9980
9986
|
}
|
|
9981
9987
|
var rect = new RectSymbol();
|
|
9982
9988
|
|
|
9983
|
-
const tempBounds = new AABBBounds
|
|
9989
|
+
const tempBounds = new AABBBounds();
|
|
9984
9990
|
class CustomSymbolClass {
|
|
9985
9991
|
constructor(type, path) {
|
|
9986
9992
|
let isSvg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
|
|
@@ -10022,7 +10028,7 @@
|
|
|
10022
10028
|
roundLine: "M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"
|
|
10023
10029
|
};
|
|
10024
10030
|
|
|
10025
|
-
const _tempBounds$1 = new AABBBounds
|
|
10031
|
+
const _tempBounds$1 = new AABBBounds(),
|
|
10026
10032
|
SYMBOL_UPDATE_TAG_KEY = ["symbolType", "size", ...GRAPHIC_UPDATE_TAG_KEY];
|
|
10027
10033
|
let Symbol$1 = class Symbol extends Graphic {
|
|
10028
10034
|
constructor() {
|
|
@@ -11146,7 +11152,7 @@
|
|
|
11146
11152
|
}
|
|
11147
11153
|
doUpdatePathShape() {
|
|
11148
11154
|
const attribute = this.attribute;
|
|
11149
|
-
isString$
|
|
11155
|
+
isString$2(attribute.path, !0) ? this.cache = new CustomPath2D().fromString(attribute.path) : attribute.customPath && (this.cache = new CustomPath2D(), attribute.customPath(this.cache, this));
|
|
11150
11156
|
}
|
|
11151
11157
|
tryUpdateOBBBounds() {
|
|
11152
11158
|
throw new Error("暂不支持");
|
|
@@ -11810,7 +11816,7 @@
|
|
|
11810
11816
|
function mat3Tomat4(out, b) {
|
|
11811
11817
|
out[0] = b.a, out[1] = b.b, out[2] = 0, out[3] = 0, out[4] = b.c, out[5] = b.d, out[6] = 0, out[7] = 0, out[8] = 0, out[9] = 0, out[10] = 1, out[11] = 0, out[12] = b.e, out[13] = b.f, out[14] = 0, out[15] = 1;
|
|
11812
11818
|
}
|
|
11813
|
-
function scale$
|
|
11819
|
+
function scale$2(out, a, v) {
|
|
11814
11820
|
const x = v[0],
|
|
11815
11821
|
y = v[1],
|
|
11816
11822
|
z = v[2];
|
|
@@ -11871,7 +11877,7 @@
|
|
|
11871
11877
|
} else _anchor[1] = anchor3d[1];
|
|
11872
11878
|
_anchor[2] = null !== (_a = anchor3d[2]) && void 0 !== _a ? _a : 0;
|
|
11873
11879
|
}
|
|
11874
|
-
if (identity$2(out), translate(out, out, [x + dx, y + dy, z + dz]), translate(out, out, [_anchor[0], _anchor[1], _anchor[2]]), rotateX(out, out, beta), rotateY(out, out, alpha), translate(out, out, [-_anchor[0], -_anchor[1], _anchor[2]]), scale$
|
|
11880
|
+
if (identity$2(out), translate(out, out, [x + dx, y + dy, z + dz]), translate(out, out, [_anchor[0], _anchor[1], _anchor[2]]), rotateX(out, out, beta), rotateY(out, out, alpha), translate(out, out, [-_anchor[0], -_anchor[1], _anchor[2]]), scale$2(out, out, [scaleX, scaleY, scaleZ]), angle) {
|
|
11875
11881
|
const m = mat4Allocate.allocate(),
|
|
11876
11882
|
_anchor = [0, 0];
|
|
11877
11883
|
if (anchor) {
|
|
@@ -11907,7 +11913,7 @@
|
|
|
11907
11913
|
onClearIncremental: new SyncHook(["graphic", "group", "stage"]),
|
|
11908
11914
|
beforeUpdateAABBBounds: new SyncHook(["graphic", "stage", "willUpdate", "aabbBounds"]),
|
|
11909
11915
|
afterUpdateAABBBounds: new SyncHook(["graphic", "stage", "aabbBounds", "globalAABBBounds", "selfChange"])
|
|
11910
|
-
}, this.tempAABBBounds1 = new AABBBounds
|
|
11916
|
+
}, this.tempAABBBounds1 = new AABBBounds(), this.tempAABBBounds2 = new AABBBounds(), this._rectBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._symbolBoundsContribitions = [new DefaultSymbolOuterBorderBoundsContribution()], this._circleBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._arcBoundsContribitions = [new DefaultOuterBorderBoundsContribution()], this._pathBoundsContribitions = [new DefaultOuterBorderBoundsContribution()];
|
|
11911
11917
|
}
|
|
11912
11918
|
onAttributeUpdate(graphic) {
|
|
11913
11919
|
this.hooks.onAttributeUpdate.taps.length && this.hooks.onAttributeUpdate.call(graphic);
|
|
@@ -12049,7 +12055,7 @@
|
|
|
12049
12055
|
const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);
|
|
12050
12056
|
boundStroke(tb1, shadowBlurHalfWidth, !0, strokeBoundsBuffer), aabbBounds.union(tb1);
|
|
12051
12057
|
}
|
|
12052
|
-
return this.combindShadowAABBBounds(aabbBounds, graphic), transformBoundsWithMatrix
|
|
12058
|
+
return this.combindShadowAABBBounds(aabbBounds, graphic), transformBoundsWithMatrix(aabbBounds, aabbBounds, graphic.transMatrix), aabbBounds;
|
|
12053
12059
|
}
|
|
12054
12060
|
updatePathAABBBounds(attribute, pathTheme, aabbBounds, graphic) {
|
|
12055
12061
|
if (!this._validCheck(attribute, pathTheme, aabbBounds, graphic)) return aabbBounds;
|
|
@@ -12327,7 +12333,7 @@
|
|
|
12327
12333
|
if (this.combindShadowAABBBounds(aabbBounds, graphic), aabbBounds.empty()) return;
|
|
12328
12334
|
let updateMatrix = !0;
|
|
12329
12335
|
const m = graphic.transMatrix;
|
|
12330
|
-
graphic && graphic.isContainer && (updateMatrix = !(1 === m.a && 0 === m.b && 0 === m.c && 1 === m.d && 0 === m.e && 0 === m.f)), updateMatrix && transformBoundsWithMatrix
|
|
12336
|
+
graphic && graphic.isContainer && (updateMatrix = !(1 === m.a && 0 === m.b && 0 === m.c && 1 === m.d && 0 === m.e && 0 === m.f)), updateMatrix && transformBoundsWithMatrix(aabbBounds, aabbBounds, m);
|
|
12331
12337
|
}
|
|
12332
12338
|
_validCheck(attribute, theme, aabbBounds, graphic) {
|
|
12333
12339
|
if (!graphic) return !0;
|
|
@@ -14529,15 +14535,15 @@
|
|
|
14529
14535
|
class DefaultBoundsAllocate {
|
|
14530
14536
|
constructor() {
|
|
14531
14537
|
this.pools = [];
|
|
14532
|
-
for (let i = 0; i < 10; i++) this.pools.push(new AABBBounds
|
|
14538
|
+
for (let i = 0; i < 10; i++) this.pools.push(new AABBBounds());
|
|
14533
14539
|
}
|
|
14534
14540
|
allocate(x1, y1, x2, y2) {
|
|
14535
|
-
if (!this.pools.length) return new AABBBounds
|
|
14541
|
+
if (!this.pools.length) return new AABBBounds().setValue(x1, y1, x2, y2);
|
|
14536
14542
|
const b = this.pools.pop();
|
|
14537
14543
|
return b.x1 = x1, b.y1 = y1, b.x2 = x2, b.y2 = y2, b;
|
|
14538
14544
|
}
|
|
14539
14545
|
allocateByObj(b) {
|
|
14540
|
-
if (!this.pools.length) return new AABBBounds
|
|
14546
|
+
if (!this.pools.length) return new AABBBounds(b);
|
|
14541
14547
|
const _b = this.pools.pop();
|
|
14542
14548
|
return _b.x1 = b.x1, _b.y1 = b.y1, _b.x2 = b.x2, _b.y2 = b.y2, _b;
|
|
14543
14549
|
}
|
|
@@ -14973,7 +14979,7 @@
|
|
|
14973
14979
|
} = image.attribute;
|
|
14974
14980
|
if (!url || !image.resources) return;
|
|
14975
14981
|
const res = image.resources.get(url);
|
|
14976
|
-
if ("loading" === res.state && isString$
|
|
14982
|
+
if ("loading" === res.state && isString$2(url)) return void ResourceLoader.improveImageLoading(url);
|
|
14977
14983
|
if ("success" !== res.state) return;
|
|
14978
14984
|
const {
|
|
14979
14985
|
context: context
|
|
@@ -15016,7 +15022,7 @@
|
|
|
15016
15022
|
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
|
|
15017
15023
|
};
|
|
15018
15024
|
const DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
|
|
15019
|
-
const tempDirtyBounds = new AABBBounds
|
|
15025
|
+
const tempDirtyBounds = new AABBBounds();
|
|
15020
15026
|
class ShadowRootDrawItemInterceptorContribution {
|
|
15021
15027
|
constructor() {
|
|
15022
15028
|
this.order = 1;
|
|
@@ -15766,7 +15772,7 @@
|
|
|
15766
15772
|
};
|
|
15767
15773
|
let DefaultDrawContribution = class {
|
|
15768
15774
|
constructor(contributions, drawItemInterceptorContributions) {
|
|
15769
|
-
this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds
|
|
15775
|
+
this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions, this.currentRenderMap = new Map(), this.defaultRenderMap = new Map(), this.styleRenderMap = new Map(), this.dirtyBounds = new Bounds(), this.backupDirtyBounds = new Bounds(), this.global = application.global, this.layerService = application.layerService, this.init();
|
|
15770
15776
|
}
|
|
15771
15777
|
init() {
|
|
15772
15778
|
this.contributions.forEach(item => {
|
|
@@ -16507,7 +16513,7 @@
|
|
|
16507
16513
|
}
|
|
16508
16514
|
}
|
|
16509
16515
|
|
|
16510
|
-
const globalBounds = new AABBBounds
|
|
16516
|
+
const globalBounds = new AABBBounds();
|
|
16511
16517
|
class DirtyBoundsPlugin {
|
|
16512
16518
|
constructor() {
|
|
16513
16519
|
this.name = "DirtyBoundsPlugin", this.activeEvent = "onRegister", this._uid = Generator.GenAutoIncrementId(), this.key = this.name + this._uid;
|
|
@@ -16529,10 +16535,10 @@
|
|
|
16529
16535
|
}
|
|
16530
16536
|
}
|
|
16531
16537
|
|
|
16532
|
-
const _tempBounds = new AABBBounds
|
|
16538
|
+
const _tempBounds = new AABBBounds();
|
|
16533
16539
|
class FlexLayoutPlugin {
|
|
16534
16540
|
constructor() {
|
|
16535
|
-
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds
|
|
16541
|
+
this.name = "FlexLayoutPlugin", this.activeEvent = "onRegister", this.id = Generator.GenAutoIncrementId(), this.key = this.name + this.id, this.tempBounds = new AABBBounds();
|
|
16536
16542
|
}
|
|
16537
16543
|
pauseLayout(p) {
|
|
16538
16544
|
this.pause = p;
|
|
@@ -16809,7 +16815,7 @@
|
|
|
16809
16815
|
const lightDir = this.formatedDir,
|
|
16810
16816
|
brightness = min(max((normal[0] * lightDir[0] + normal[1] * lightDir[1] + normal[2] * lightDir[2]) * (1 - this.ambient / 2), 0) + this.ambient, 1);
|
|
16811
16817
|
let colorArray;
|
|
16812
|
-
colorArray = isString$
|
|
16818
|
+
colorArray = isString$2(color) ? ColorStore.Get(color, ColorType.Color1) : color;
|
|
16813
16819
|
const lightColorArray = this.colorRgb;
|
|
16814
16820
|
return `rgb(${lightColorArray[0] * colorArray[0] * brightness}, ${lightColorArray[1] * colorArray[1] * brightness}, ${lightColorArray[2] * colorArray[2] * brightness})`;
|
|
16815
16821
|
}
|
|
@@ -17039,9 +17045,9 @@
|
|
|
17039
17045
|
canvasControled: !1 !== params.canvasControled,
|
|
17040
17046
|
title: params.title || "",
|
|
17041
17047
|
canvas: params.canvas
|
|
17042
|
-
}), this._viewBox = new AABBBounds
|
|
17048
|
+
}), this._viewBox = new AABBBounds(), params.viewBox ? this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2) : this._viewBox.setValue(0, 0, this.width, this.height), this.state = "normal", this.renderCount = 0, this.tryInitEventSystem(), this._subView = !(this._viewBox.width() === this.width && this._viewBox.height() === this.height), this._background = null !== (_a = params.background) && void 0 !== _a ? _a : DefaultConfig$1.BACKGROUND, this.appendChild(this.layerService.createLayer(this, {
|
|
17043
17049
|
main: !0
|
|
17044
|
-
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$
|
|
17050
|
+
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$2(this._background) && this._background.includes("/") && this.setAttributes({
|
|
17045
17051
|
background: this._background
|
|
17046
17052
|
});
|
|
17047
17053
|
}
|
|
@@ -17185,7 +17191,7 @@
|
|
|
17185
17191
|
}
|
|
17186
17192
|
enableDirtyBounds() {
|
|
17187
17193
|
if (this.dirtyBounds) return;
|
|
17188
|
-
this.dirtyBounds = new Bounds
|
|
17194
|
+
this.dirtyBounds = new Bounds();
|
|
17189
17195
|
let plugin = this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];
|
|
17190
17196
|
plugin ? plugin.activate(this.pluginService) : (plugin = new DirtyBoundsPlugin(), this.pluginService.register(plugin));
|
|
17191
17197
|
}
|
|
@@ -17524,7 +17530,7 @@
|
|
|
17524
17530
|
service.env === this.type && service.setActiveEnvContribution(this);
|
|
17525
17531
|
}
|
|
17526
17532
|
getNativeAABBBounds(dom) {
|
|
17527
|
-
return new AABBBounds
|
|
17533
|
+
return new AABBBounds();
|
|
17528
17534
|
}
|
|
17529
17535
|
removeDom(dom) {
|
|
17530
17536
|
return !1;
|
|
@@ -18469,7 +18475,7 @@
|
|
|
18469
18475
|
} = _a,
|
|
18470
18476
|
props = __rest$4(_a, ["key", "name", "id", "attribute", "stateProxy"]);
|
|
18471
18477
|
let c = type;
|
|
18472
|
-
isString$
|
|
18478
|
+
isString$2(type) && (c = graphicCreator$1[type]);
|
|
18473
18479
|
const childrenList = [];
|
|
18474
18480
|
for (var _len = arguments.length, children = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
18475
18481
|
children[_key - 2] = arguments[_key];
|
|
@@ -19200,7 +19206,7 @@
|
|
|
19200
19206
|
const {
|
|
19201
19207
|
scaleIn3d = defaultParams.scaleIn3d
|
|
19202
19208
|
} = params;
|
|
19203
|
-
params.font ? _context.font = params.font : _context.font = getContextFont
|
|
19209
|
+
params.font ? _context.font = params.font : _context.font = getContextFont(params, defaultParams, scaleIn3d && this.camera && this.camera.getProjectionScale(z));
|
|
19204
19210
|
const {
|
|
19205
19211
|
fontFamily = defaultParams.fontFamily,
|
|
19206
19212
|
fontSize = defaultParams.fontSize
|
|
@@ -19210,7 +19216,7 @@
|
|
|
19210
19216
|
setTextStyle(params, defaultParams, z) {
|
|
19211
19217
|
var _a, _b;
|
|
19212
19218
|
const _context = this.nativeContext;
|
|
19213
|
-
defaultParams || (defaultParams = this.textAttributes), params.font ? _context.font = params.font : _context.font = getContextFont
|
|
19219
|
+
defaultParams || (defaultParams = this.textAttributes), params.font ? _context.font = params.font : _context.font = getContextFont(params, defaultParams, this.camera && this.camera.getProjectionScale(z));
|
|
19214
19220
|
const {
|
|
19215
19221
|
fontFamily = defaultParams.fontFamily,
|
|
19216
19222
|
fontSize = defaultParams.fontSize
|
|
@@ -19688,7 +19694,7 @@
|
|
|
19688
19694
|
const b = dom.getBoundingClientRect();
|
|
19689
19695
|
return new DynamicB(b);
|
|
19690
19696
|
}
|
|
19691
|
-
return new AABBBounds
|
|
19697
|
+
return new AABBBounds();
|
|
19692
19698
|
}
|
|
19693
19699
|
removeDom(dom) {
|
|
19694
19700
|
return dom.parentElement.removeChild(dom), !0;
|
|
@@ -19702,10 +19708,10 @@
|
|
|
19702
19708
|
parent: parent
|
|
19703
19709
|
} = params,
|
|
19704
19710
|
element = document.createElement(tagName);
|
|
19705
|
-
if (style && (isString$
|
|
19711
|
+
if (style && (isString$2(style) ? element.setAttribute("style", style) : Object.keys(style).forEach(k => {
|
|
19706
19712
|
element.setAttribute(k, style[k]);
|
|
19707
19713
|
})), null != width && (element.style.width = `${width}px`), null != height && (element.style.height = `${height}px`), parent) {
|
|
19708
|
-
const pd = isString$
|
|
19714
|
+
const pd = isString$2(parent) ? this.getElementById(parent) : parent;
|
|
19709
19715
|
pd && pd.appendChild && pd.appendChild(element);
|
|
19710
19716
|
}
|
|
19711
19717
|
return element;
|
|
@@ -19846,7 +19852,7 @@
|
|
|
19846
19852
|
this._context = new NodeContext2d(this, this._dpr), this.nativeCanvas.width = this._pixelWidth, this.nativeCanvas.height = this._pixelHeight;
|
|
19847
19853
|
}
|
|
19848
19854
|
release() {
|
|
19849
|
-
this._nativeCanvas.release && isFunction$
|
|
19855
|
+
this._nativeCanvas.release && isFunction$1(this._nativeCanvas.release) && this._nativeCanvas.release();
|
|
19850
19856
|
}
|
|
19851
19857
|
};
|
|
19852
19858
|
NodeCanvas.env = "node", NodeCanvas = __decorate$w([injectable(), __metadata$o("design:paramtypes", [Object])], NodeCanvas);
|
|
@@ -20175,7 +20181,7 @@
|
|
|
20175
20181
|
decorator(target, key, paramIndex);
|
|
20176
20182
|
};
|
|
20177
20183
|
};
|
|
20178
|
-
const _bounds$1 = new AABBBounds
|
|
20184
|
+
const _bounds$1 = new AABBBounds();
|
|
20179
20185
|
let DefaultCanvasRectPicker = class {
|
|
20180
20186
|
constructor(canvasRenderer) {
|
|
20181
20187
|
this.canvasRenderer = canvasRenderer, this.type = "rect", this.numberType = RECT_NUMBER_TYPE;
|
|
@@ -20243,7 +20249,7 @@
|
|
|
20243
20249
|
decorator(target, key, paramIndex);
|
|
20244
20250
|
};
|
|
20245
20251
|
};
|
|
20246
|
-
const _bounds = new AABBBounds
|
|
20252
|
+
const _bounds = new AABBBounds();
|
|
20247
20253
|
let DefaultMathRectPicker = class {
|
|
20248
20254
|
constructor(canvasRenderer) {
|
|
20249
20255
|
this.canvasRenderer = canvasRenderer, this.type = "rect", this.numberType = RECT_NUMBER_TYPE;
|
|
@@ -21221,7 +21227,7 @@
|
|
|
21221
21227
|
decorator(target, key, paramIndex);
|
|
21222
21228
|
};
|
|
21223
21229
|
};
|
|
21224
|
-
new AABBBounds
|
|
21230
|
+
new AABBBounds();
|
|
21225
21231
|
let DefaultCanvasRect3dPicker = class extends BasePicker {
|
|
21226
21232
|
constructor(canvasRenderer) {
|
|
21227
21233
|
super(), this.canvasRenderer = canvasRenderer, this.type = "rect3d", this.numberType = RECT3D_NUMBER_TYPE;
|
|
@@ -22662,7 +22668,7 @@
|
|
|
22662
22668
|
};
|
|
22663
22669
|
const isIt$1 = (v, type) => judgeType$1(v) === type;
|
|
22664
22670
|
const isObject$2 = (v) => isIt$1(v, 'object');
|
|
22665
|
-
const isString
|
|
22671
|
+
const isString = (v) => isIt$1(v, 'string');
|
|
22666
22672
|
const isNumber$2 = (v) => isIt$1(v, 'number');
|
|
22667
22673
|
const isBoolean = (v) => isIt$1(v, 'boolean');
|
|
22668
22674
|
function ingoreNoneValueMerge(target, ...sources) {
|
|
@@ -22773,7 +22779,7 @@
|
|
|
22773
22779
|
].join('');
|
|
22774
22780
|
}
|
|
22775
22781
|
function validToString(v) {
|
|
22776
|
-
if (isString
|
|
22782
|
+
if (isString(v) || isNumber$2(v) || isBoolean(v)) {
|
|
22777
22783
|
return v.toString();
|
|
22778
22784
|
}
|
|
22779
22785
|
return '';
|
|
@@ -23593,7 +23599,7 @@
|
|
|
23593
23599
|
let Rect$1 = class Rect {
|
|
23594
23600
|
bounds;
|
|
23595
23601
|
constructor(left, top, width, height) {
|
|
23596
|
-
this.bounds = new Bounds
|
|
23602
|
+
this.bounds = new Bounds();
|
|
23597
23603
|
this.bounds.set(left, top, left + width, top + height);
|
|
23598
23604
|
}
|
|
23599
23605
|
static bounds(left, top, right, bottom) {
|
|
@@ -24068,8 +24074,8 @@
|
|
|
24068
24074
|
const regUrl = /^(https?|ftp|file):\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]/;
|
|
24069
24075
|
const ResizeColumnHotSpotSize = 16;
|
|
24070
24076
|
const IndicatorDimensionKeyPlaceholder = '$$indicator$$';
|
|
24071
|
-
const DrillDown = `<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path
|
|
24072
|
-
const DrillUp = `<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>`;
|
|
24077
|
+
const DrillDown = `<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM549.333333 288a5.333333 5.333333 0 0 1 5.333334 5.333333V469.333333h176a5.333333 5.333333 0 0 1 5.333333 5.333334v74.666666a5.333333 5.333333 0 0 1-5.333333 5.333334H554.666667v176a5.333333 5.333333 0 0 1-5.333334 5.333333h-74.666666a5.333333 5.333333 0 0 1-5.333334-5.333333V554.666667H293.333333a5.333333 5.333333 0 0 1-5.333333-5.333334v-74.666666a5.333333 5.333333 0 0 1 5.333333-5.333334H469.333333V293.333333a5.333333 5.333333 0 0 1 5.333334-5.333333h74.666666z"></path></svg>`;
|
|
24078
|
+
const DrillUp = `<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><rect x="0" y="0" width="1024" height="1024" rx="20%" ry="20%" fill="#ffffff" /><path d="M810.666667 85.333333c70.688 0 128 57.312 128 128v597.333334c0 70.688-57.312 128-128 128H213.333333c-70.688 0-128-57.312-128-128V213.333333c0-70.688 57.312-128 128-128h597.333334z m0 85.333334H213.333333a42.666667 42.666667 0 0 0-42.613333 40.533333L170.666667 213.333333v597.333334a42.666667 42.666667 0 0 0 40.533333 42.613333L213.333333 853.333333h597.333334a42.666667 42.666667 0 0 0 42.613333-40.533333L853.333333 810.666667V213.333333a42.666667 42.666667 0 0 0-40.533333-42.613333L810.666667 170.666667zM693.333333 469.333333a42.666667 42.666667 0 1 1 0 85.333334H330.666667a42.666667 42.666667 0 1 1 0-85.333334h362.666666z"></path></svg>`;
|
|
24073
24079
|
const DefaultSparklineSpec = {
|
|
24074
24080
|
type: 'line'
|
|
24075
24081
|
};
|
|
@@ -24844,7 +24850,7 @@
|
|
|
24844
24850
|
});
|
|
24845
24851
|
}
|
|
24846
24852
|
setAttribute(key, value, forceUpdateTag) {
|
|
24847
|
-
isPlainObject$1(this.attribute[key]) && isPlainObject$1(value) && !isFunction$
|
|
24853
|
+
isPlainObject$1(this.attribute[key]) && isPlainObject$1(value) && !isFunction$1(this.attribute[key]) && !isFunction$1(value) ? merge(this.attribute[key], value) : this.attribute[key] = value, GROUP_ATTRIBUTES.includes(key) || this.render(), this.valid = this.isValid(), this.updateShapeAndBoundsTagSetted() || !forceUpdateTag && !this.needUpdateTag(key) ? this.addUpdateBoundTag() : this.addUpdateShapeAndBoundsTag(), this.addUpdatePositionTag(), this.onAttributeUpdate();
|
|
24848
24854
|
}
|
|
24849
24855
|
setAttributes(params, forceUpdateTag) {
|
|
24850
24856
|
const keys = Object.keys(params);
|
|
@@ -24854,7 +24860,7 @@
|
|
|
24854
24860
|
isNil$3(keys) && (keys = Object.keys(params));
|
|
24855
24861
|
for (let i = 0; i < keys.length; i++) {
|
|
24856
24862
|
const key = keys[i];
|
|
24857
|
-
!isPlainObject$1(this.attribute[key]) || isFunction$
|
|
24863
|
+
!isPlainObject$1(this.attribute[key]) || isFunction$1(this.attribute[key]) || isFunction$1(params[key]) ? this.attribute[key] = params[key] : merge(this.attribute[key], params[key]);
|
|
24858
24864
|
}
|
|
24859
24865
|
}
|
|
24860
24866
|
bindEvents() {}
|
|
@@ -25127,7 +25133,7 @@
|
|
|
25127
25133
|
});
|
|
25128
25134
|
}
|
|
25129
25135
|
|
|
25130
|
-
function scale(vector, scale) {
|
|
25136
|
+
function scale$1(vector, scale) {
|
|
25131
25137
|
return [vector[0] * scale, vector[1] * scale];
|
|
25132
25138
|
}
|
|
25133
25139
|
function normalize$2(vector) {
|
|
@@ -25402,7 +25408,7 @@
|
|
|
25402
25408
|
}
|
|
25403
25409
|
return t;
|
|
25404
25410
|
};
|
|
25405
|
-
const _tBounds = new AABBBounds
|
|
25411
|
+
const _tBounds = new AABBBounds();
|
|
25406
25412
|
loadPoptipComponent();
|
|
25407
25413
|
class PopTip extends AbstractComponent {
|
|
25408
25414
|
constructor(attributes, options) {
|
|
@@ -25539,7 +25545,7 @@
|
|
|
25539
25545
|
{
|
|
25540
25546
|
_tBounds.setValue(0, 0, popTipWidth, poptipHeight).transformWithMatrix(group.globalTransMatrix);
|
|
25541
25547
|
const b = _tBounds,
|
|
25542
|
-
stageBounds = new Bounds
|
|
25548
|
+
stageBounds = new Bounds().setValue(0, 0, range[0], range[1]);
|
|
25543
25549
|
if (rectInsideAnotherRect(b, stageBounds, !1)) break;
|
|
25544
25550
|
{
|
|
25545
25551
|
const bbox = getRectIntersect(b, stageBounds, !1),
|
|
@@ -26138,7 +26144,7 @@
|
|
|
26138
26144
|
const data = this.data[index],
|
|
26139
26145
|
tickLineState = merge({}, DEFAULT_STATES$2, this.attribute.tick.state);
|
|
26140
26146
|
Object.keys(tickLineState).forEach(key => {
|
|
26141
|
-
isFunction$
|
|
26147
|
+
isFunction$1(tickLineState[key]) && (tickLineState[key] = tickLineState[key](data.rawValue, index, data, this.data));
|
|
26142
26148
|
}), line.states = tickLineState;
|
|
26143
26149
|
}
|
|
26144
26150
|
tickLineGroup.add(line);
|
|
@@ -26153,7 +26159,7 @@
|
|
|
26153
26159
|
if (line.name = AXIS_ELEMENT_NAME.subTick, line.id = this._getNodeId(`${index}`), isEmpty(subTick.state)) line.states = DEFAULT_STATES$2;else {
|
|
26154
26160
|
const subTickLineState = merge({}, DEFAULT_STATES$2, subTick.state);
|
|
26155
26161
|
Object.keys(subTickLineState).forEach(key => {
|
|
26156
|
-
isFunction$
|
|
26162
|
+
isFunction$1(subTickLineState[key]) && (subTickLineState[key] = subTickLineState[key](item.value, index, item, tickLineItems));
|
|
26157
26163
|
}), line.states = subTickLineState;
|
|
26158
26164
|
}
|
|
26159
26165
|
tickLineGroup.add(line);
|
|
@@ -26164,7 +26170,7 @@
|
|
|
26164
26170
|
const {
|
|
26165
26171
|
dataFilter: dataFilter
|
|
26166
26172
|
} = this.attribute.label;
|
|
26167
|
-
dataFilter && isFunction$
|
|
26173
|
+
dataFilter && isFunction$1(dataFilter) && (items = dataFilter(items, layer));
|
|
26168
26174
|
const data = this._transformItems(items),
|
|
26169
26175
|
labelGroup = graphicCreator$1.group({
|
|
26170
26176
|
x: 0,
|
|
@@ -26178,7 +26184,7 @@
|
|
|
26178
26184
|
if (text = isRichText(labelStyle) ? graphicCreator$1.richtext(richTextAttributeTransform(labelStyle)) : graphicCreator$1.text(labelStyle), text.name = AXIS_ELEMENT_NAME.label, text.id = this._getNodeId(`layer${layer}-label-${item.id}`), isEmpty(null === (_a = this.attribute.label) || void 0 === _a ? void 0 : _a.state)) text.states = DEFAULT_STATES$2;else {
|
|
26179
26185
|
const labelState = merge({}, DEFAULT_STATES$2, this.attribute.label.state);
|
|
26180
26186
|
Object.keys(labelState).forEach(key => {
|
|
26181
|
-
isFunction$
|
|
26187
|
+
isFunction$1(labelState[key]) && (labelState[key] = labelState[key](item, index, data, layer));
|
|
26182
26188
|
}), text.states = labelState;
|
|
26183
26189
|
}
|
|
26184
26190
|
labelGroup.add(text);
|
|
@@ -26213,7 +26219,7 @@
|
|
|
26213
26219
|
dataFilter: dataFilter
|
|
26214
26220
|
} = tick;
|
|
26215
26221
|
let tickSegment = 1;
|
|
26216
|
-
return data.length >= 2 && (tickSegment = data[1].value - data[0].value), (dataFilter && isFunction$
|
|
26222
|
+
return data.length >= 2 && (tickSegment = data[1].value - data[0].value), (dataFilter && isFunction$1(dataFilter) ? dataFilter(data) : data).forEach(item => {
|
|
26217
26223
|
let point = item.point,
|
|
26218
26224
|
tickValue = item.value;
|
|
26219
26225
|
if (!alignWithLabel) {
|
|
@@ -26276,7 +26282,7 @@
|
|
|
26276
26282
|
_getTickLineAttribute(type, tickItem, index, tickItems) {
|
|
26277
26283
|
let style = get$5(this.attribute, `${type}.style`);
|
|
26278
26284
|
const data = this.data[index];
|
|
26279
|
-
style = isFunction$
|
|
26285
|
+
style = isFunction$1(style) ? merge({}, get$5(DEFAULT_AXIS_THEME, `${type}.style`), "tick" === type ? style(data.rawValue, index, data, this.data) : style(tickItem.value, index, tickItem, tickItems)) : style;
|
|
26280
26286
|
const {
|
|
26281
26287
|
start: start,
|
|
26282
26288
|
end: end,
|
|
@@ -26311,9 +26317,9 @@
|
|
|
26311
26317
|
let {
|
|
26312
26318
|
style: textStyle
|
|
26313
26319
|
} = this.attribute.label;
|
|
26314
|
-
textStyle = isFunction$
|
|
26320
|
+
textStyle = isFunction$1(textStyle) ? merge({}, DEFAULT_AXIS_THEME.label.style, textStyle(tickDatum, index, tickData, layer)) : textStyle;
|
|
26315
26321
|
const labelAlign = this.getLabelAlign(vector, inside, textStyle.angle);
|
|
26316
|
-
return textStyle = merge(labelAlign, textStyle), isFunction$
|
|
26322
|
+
return textStyle = merge(labelAlign, textStyle), isFunction$1(textStyle.text) && (textStyle.text = textStyle.text({
|
|
26317
26323
|
label: tickDatum.label,
|
|
26318
26324
|
value: tickDatum.rawValue,
|
|
26319
26325
|
index: tickDatum.index,
|
|
@@ -26405,13 +26411,13 @@
|
|
|
26405
26411
|
method = "parity",
|
|
26406
26412
|
separation: sep = 0
|
|
26407
26413
|
} = config,
|
|
26408
|
-
reduce = isFunction$
|
|
26414
|
+
reduce = isFunction$1(method) ? method : methods$1[method] || methods$1.parity;
|
|
26409
26415
|
if (items.length >= 3 && hasOverlap$1(items, sep)) {
|
|
26410
26416
|
do {
|
|
26411
26417
|
items = reduce(items, sep);
|
|
26412
26418
|
} while (items.length >= 3 && hasOverlap$1(items, sep));
|
|
26413
26419
|
if (items.length < 3 || config.lastVisible) {
|
|
26414
|
-
const lastSourceItem = last
|
|
26420
|
+
const lastSourceItem = last(source);
|
|
26415
26421
|
if (!lastSourceItem.attribute.opacity) {
|
|
26416
26422
|
const remainLength = items.length;
|
|
26417
26423
|
if (remainLength > 1) {
|
|
@@ -26438,7 +26444,7 @@
|
|
|
26438
26444
|
for (labelRotateAngle && labelRotateAngle.length > 0 && (n = labelRotateAngle.length); i < n;) {
|
|
26439
26445
|
const angle = labelRotateAngle[i++];
|
|
26440
26446
|
if (items.forEach(item => {
|
|
26441
|
-
item.attribute.angle = degreeToRadian
|
|
26447
|
+
item.attribute.angle = degreeToRadian(angle);
|
|
26442
26448
|
}), tryRotate(orient, items), !hasIntersect(items)) break;
|
|
26443
26449
|
}
|
|
26444
26450
|
}
|
|
@@ -26599,7 +26605,7 @@
|
|
|
26599
26605
|
axisVector = this.getRelativeVector(),
|
|
26600
26606
|
normalizedAxisVector = normalize$2(axisVector),
|
|
26601
26607
|
verticalVector = [normalizedAxisVector[1], -1 * normalizedAxisVector[0]];
|
|
26602
|
-
return scale(verticalVector, offset * (inside ? 1 : -1) * verticalFactor);
|
|
26608
|
+
return scale$1(verticalVector, offset * (inside ? 1 : -1) * verticalFactor);
|
|
26603
26609
|
}
|
|
26604
26610
|
}
|
|
26605
26611
|
|
|
@@ -26784,11 +26790,11 @@
|
|
|
26784
26790
|
} = this.attribute,
|
|
26785
26791
|
isX = "bottom" === orient || "top" === orient,
|
|
26786
26792
|
first = labelShapes[0],
|
|
26787
|
-
last = last
|
|
26788
|
-
isInverse = isX ? first.attribute.x > last.attribute.x : first.attribute.y < last.attribute.y;
|
|
26793
|
+
last$1 = last(labelShapes),
|
|
26794
|
+
isInverse = isX ? first.attribute.x > last$1.attribute.x : first.attribute.y < last$1.attribute.y;
|
|
26789
26795
|
if (isX) {
|
|
26790
|
-
const leftMostLabel = isInverse ? last : first,
|
|
26791
|
-
rightMostLabel = isInverse ? first : last,
|
|
26796
|
+
const leftMostLabel = isInverse ? last$1 : first,
|
|
26797
|
+
rightMostLabel = isInverse ? first : last$1,
|
|
26792
26798
|
left = axisStart.x,
|
|
26793
26799
|
right = axisEnd.x,
|
|
26794
26800
|
leftBound = leftMostLabel.AABBBounds.x1,
|
|
@@ -26810,8 +26816,8 @@
|
|
|
26810
26816
|
});
|
|
26811
26817
|
}
|
|
26812
26818
|
} else {
|
|
26813
|
-
const bottomMostLabel = isInverse ? last : first,
|
|
26814
|
-
topMostLabel = isInverse ? first : last,
|
|
26819
|
+
const bottomMostLabel = isInverse ? last$1 : first,
|
|
26820
|
+
topMostLabel = isInverse ? first : last$1,
|
|
26815
26821
|
bottomBound = bottomMostLabel.AABBBounds.y2,
|
|
26816
26822
|
topBound = topMostLabel.AABBBounds.y1,
|
|
26817
26823
|
top = axisStart.y,
|
|
@@ -26854,7 +26860,7 @@
|
|
|
26854
26860
|
autoHideSeparation: autoHideSeparation,
|
|
26855
26861
|
lastVisible: lastVisible
|
|
26856
26862
|
} = label;
|
|
26857
|
-
if (isFunction$
|
|
26863
|
+
if (isFunction$1(layoutFunc)) layoutFunc(labelShapes, labelData, layer, this);else {
|
|
26858
26864
|
if (autoRotate$1 && autoRotate(labelShapes, {
|
|
26859
26865
|
labelRotateAngle: autoRotateAngle,
|
|
26860
26866
|
orient: orient
|
|
@@ -27061,7 +27067,7 @@
|
|
|
27061
27067
|
const {
|
|
27062
27068
|
pageFormatter: pageFormatter
|
|
27063
27069
|
} = this.attribute;
|
|
27064
|
-
return pageFormatter ? isFunction$
|
|
27070
|
+
return pageFormatter ? isFunction$1(pageFormatter) ? pageFormatter(current, this._total) : `${pageFormatter}`.replace("{current}", `${current}`).replace("{total}", `${this._total}`) : `${current}/${this._total}`;
|
|
27065
27071
|
}
|
|
27066
27072
|
setTotal(total) {
|
|
27067
27073
|
total !== this.attribute.total && (this._total = total, 1 !== this._current && this._current <= total ? this.setAttributes({
|
|
@@ -27321,7 +27327,7 @@
|
|
|
27321
27327
|
height: itemHeight
|
|
27322
27328
|
} = item,
|
|
27323
27329
|
widthsOptions = [];
|
|
27324
|
-
isValid$3(maxItemWidth) && widthsOptions.push(maxItemWidth), isValid$3(itemWidth) && widthsOptions.push(itemWidth), widthsOptions.length && (isValid$3(maxWidth) && widthsOptions.push(maxWidth), this._itemWidthByUser = minInArray
|
|
27330
|
+
isValid$3(maxItemWidth) && widthsOptions.push(maxItemWidth), isValid$3(itemWidth) && widthsOptions.push(itemWidth), widthsOptions.length && (isValid$3(maxWidth) && widthsOptions.push(maxWidth), this._itemWidthByUser = minInArray(widthsOptions)), isValid$3(itemHeight) && (this._itemHeightByUser = itemHeight), this._itemContext = {
|
|
27325
27331
|
currentPage: this.attribute.pager && this.attribute.pager.defaultCurrent || 1,
|
|
27326
27332
|
doWrap: !1,
|
|
27327
27333
|
maxWidthInCol: 0,
|
|
@@ -27707,8 +27713,8 @@
|
|
|
27707
27713
|
}
|
|
27708
27714
|
_handleStyle(config, item, isSelected, index, items) {
|
|
27709
27715
|
const newConfig = {};
|
|
27710
|
-
return config.style && (isFunction$
|
|
27711
|
-
config.state[key] && (isFunction$
|
|
27716
|
+
return config.style && (isFunction$1(config.style) ? newConfig.style = config.style(item, isSelected, index, items) : newConfig.style = config.style), config.state && (newConfig.state = {}, Object.keys(config.state).forEach(key => {
|
|
27717
|
+
config.state[key] && (isFunction$1(config.state[key]) ? newConfig.state[key] = config.state[key](item, isSelected, index, items) : newConfig.state[key] = config.state[key]);
|
|
27712
27718
|
})), newConfig;
|
|
27713
27719
|
}
|
|
27714
27720
|
}
|
|
@@ -27805,30 +27811,15 @@
|
|
|
27805
27811
|
const isType = (value, type) => Object.prototype.toString.call(value) === `[object ${type}]`;
|
|
27806
27812
|
var isType$1 = isType;
|
|
27807
27813
|
|
|
27808
|
-
const isFunction = value => "function" == typeof value;
|
|
27809
|
-
var isFunction$1 = isFunction;
|
|
27810
|
-
|
|
27811
27814
|
const isNil = value => null == value;
|
|
27812
27815
|
var isNil$1 = isNil;
|
|
27813
27816
|
|
|
27814
27817
|
const isValid = value => null != value;
|
|
27815
27818
|
var isValid$1 = isValid;
|
|
27816
27819
|
|
|
27817
|
-
const isString = function (value) {
|
|
27818
|
-
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
27819
|
-
const type = typeof value;
|
|
27820
|
-
return fuzzy ? "string" === type : "string" === type || isType$1(value, "String");
|
|
27821
|
-
};
|
|
27822
|
-
var isString$1 = isString;
|
|
27823
|
-
|
|
27824
27820
|
const isArray = value => Array.isArray ? Array.isArray(value) : isType$1(value, "Array");
|
|
27825
27821
|
var isArray$1 = isArray;
|
|
27826
27822
|
|
|
27827
|
-
const isArrayLike = function (value) {
|
|
27828
|
-
return null !== value && "function" != typeof value && Number.isFinite(value.length);
|
|
27829
|
-
};
|
|
27830
|
-
var isArrayLike$1 = isArrayLike;
|
|
27831
|
-
|
|
27832
27823
|
const isNumber = function (value) {
|
|
27833
27824
|
let fuzzy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
|
|
27834
27825
|
const type = typeof value;
|
|
@@ -27836,32 +27827,6 @@
|
|
|
27836
27827
|
};
|
|
27837
27828
|
var isNumber$1 = isNumber;
|
|
27838
27829
|
|
|
27839
|
-
function last(val) {
|
|
27840
|
-
if (isArrayLike$1(val)) {
|
|
27841
|
-
return val[val.length - 1];
|
|
27842
|
-
}
|
|
27843
|
-
}
|
|
27844
|
-
const maxInArray = (arr, compareFn) => {
|
|
27845
|
-
var _a;
|
|
27846
|
-
if (0 === arr.length) return;
|
|
27847
|
-
let max = arr[0];
|
|
27848
|
-
for (let i = 1; i < arr.length; i++) {
|
|
27849
|
-
const value = arr[i];
|
|
27850
|
-
(null !== (_a = null == compareFn ? void 0 : compareFn(value, max)) && void 0 !== _a ? _a : value - max > 0) && (max = value);
|
|
27851
|
-
}
|
|
27852
|
-
return max;
|
|
27853
|
-
};
|
|
27854
|
-
const minInArray = (arr, compareFn) => {
|
|
27855
|
-
var _a;
|
|
27856
|
-
if (0 === arr.length) return;
|
|
27857
|
-
let min = arr[0];
|
|
27858
|
-
for (let i = 1; i < arr.length; i++) {
|
|
27859
|
-
const value = arr[i];
|
|
27860
|
-
(null !== (_a = null == compareFn ? void 0 : compareFn(value, min)) && void 0 !== _a ? _a : value - min < 0) && (min = value);
|
|
27861
|
-
}
|
|
27862
|
-
return min;
|
|
27863
|
-
};
|
|
27864
|
-
|
|
27865
27830
|
function range(start, stop, step) {
|
|
27866
27831
|
isValid$1(stop) || (stop = start, start = 0), isValid$1(step) || (step = 1);
|
|
27867
27832
|
let i = -1;
|
|
@@ -27925,155 +27890,6 @@
|
|
|
27925
27890
|
return t => (d.setTime(aVal * (1 - t) + bVal * t), d);
|
|
27926
27891
|
}
|
|
27927
27892
|
|
|
27928
|
-
function transformBoundsWithMatrix(out, bounds, matrix) {
|
|
27929
|
-
const {
|
|
27930
|
-
x1: x1,
|
|
27931
|
-
y1: y1,
|
|
27932
|
-
x2: x2,
|
|
27933
|
-
y2: y2
|
|
27934
|
-
} = bounds;
|
|
27935
|
-
return matrix.onlyTranslate() ? (out !== bounds && out.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2), out.translate(matrix.e, matrix.f), bounds) : (out.clear(), out.add(matrix.a * x1 + matrix.c * y1 + matrix.e, matrix.b * x1 + matrix.d * y1 + matrix.f), out.add(matrix.a * x2 + matrix.c * y1 + matrix.e, matrix.b * x2 + matrix.d * y1 + matrix.f), out.add(matrix.a * x2 + matrix.c * y2 + matrix.e, matrix.b * x2 + matrix.d * y2 + matrix.f), out.add(matrix.a * x1 + matrix.c * y2 + matrix.e, matrix.b * x1 + matrix.d * y2 + matrix.f), bounds);
|
|
27936
|
-
}
|
|
27937
|
-
class Bounds {
|
|
27938
|
-
constructor(bounds) {
|
|
27939
|
-
bounds ? this.setValue(bounds.x1, bounds.y1, bounds.x2, bounds.y2) : this.clear();
|
|
27940
|
-
}
|
|
27941
|
-
clone() {
|
|
27942
|
-
return new Bounds(this);
|
|
27943
|
-
}
|
|
27944
|
-
clear() {
|
|
27945
|
-
return this.x1 = +Number.MAX_VALUE, this.y1 = +Number.MAX_VALUE, this.x2 = -Number.MAX_VALUE, this.y2 = -Number.MAX_VALUE, this;
|
|
27946
|
-
}
|
|
27947
|
-
empty() {
|
|
27948
|
-
return this.x1 === +Number.MAX_VALUE && this.y1 === +Number.MAX_VALUE && this.x2 === -Number.MAX_VALUE && this.y2 === -Number.MAX_VALUE;
|
|
27949
|
-
}
|
|
27950
|
-
equals(b) {
|
|
27951
|
-
return this.x1 === b.x1 && this.y1 === b.y1 && this.x2 === b.x2 && this.y2 === b.y2;
|
|
27952
|
-
}
|
|
27953
|
-
setValue() {
|
|
27954
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27955
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
27956
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
27957
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
27958
|
-
return this.x1 = x1, this.y1 = y1, this.x2 = x2, this.y2 = y2, this;
|
|
27959
|
-
}
|
|
27960
|
-
set() {
|
|
27961
|
-
let x1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27962
|
-
let y1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
27963
|
-
let x2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
27964
|
-
let y2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
27965
|
-
return x2 < x1 ? (this.x2 = x1, this.x1 = x2) : (this.x1 = x1, this.x2 = x2), y2 < y1 ? (this.y2 = y1, this.y1 = y2) : (this.y1 = y1, this.y2 = y2), this;
|
|
27966
|
-
}
|
|
27967
|
-
add() {
|
|
27968
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27969
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
27970
|
-
return x < this.x1 && (this.x1 = x), y < this.y1 && (this.y1 = y), x > this.x2 && (this.x2 = x), y > this.y2 && (this.y2 = y), this;
|
|
27971
|
-
}
|
|
27972
|
-
expand() {
|
|
27973
|
-
let d = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27974
|
-
return isArray$1(d) ? (this.y1 -= d[0], this.x2 += d[1], this.y2 += d[2], this.x1 -= d[3]) : (this.x1 -= d, this.y1 -= d, this.x2 += d, this.y2 += d), this;
|
|
27975
|
-
}
|
|
27976
|
-
round() {
|
|
27977
|
-
return this.x1 = Math.floor(this.x1), this.y1 = Math.floor(this.y1), this.x2 = Math.ceil(this.x2), this.y2 = Math.ceil(this.y2), this;
|
|
27978
|
-
}
|
|
27979
|
-
translate() {
|
|
27980
|
-
let dx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27981
|
-
let dy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
27982
|
-
return this.x1 += dx, this.x2 += dx, this.y1 += dy, this.y2 += dy, this;
|
|
27983
|
-
}
|
|
27984
|
-
rotate() {
|
|
27985
|
-
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27986
|
-
let x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
27987
|
-
let y = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
27988
|
-
const p = this.rotatedPoints(angle, x, y);
|
|
27989
|
-
return this.clear().add(p[0], p[1]).add(p[2], p[3]).add(p[4], p[5]).add(p[6], p[7]);
|
|
27990
|
-
}
|
|
27991
|
-
scale() {
|
|
27992
|
-
let sx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
27993
|
-
let sy = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
27994
|
-
let x = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
27995
|
-
let y = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
27996
|
-
const p = this.scalePoints(sx, sy, x, y);
|
|
27997
|
-
return this.clear().add(p[0], p[1]).add(p[2], p[3]);
|
|
27998
|
-
}
|
|
27999
|
-
union(b) {
|
|
28000
|
-
return b.x1 < this.x1 && (this.x1 = b.x1), b.y1 < this.y1 && (this.y1 = b.y1), b.x2 > this.x2 && (this.x2 = b.x2), b.y2 > this.y2 && (this.y2 = b.y2), this;
|
|
28001
|
-
}
|
|
28002
|
-
intersect(b) {
|
|
28003
|
-
return b.x1 > this.x1 && (this.x1 = b.x1), b.y1 > this.y1 && (this.y1 = b.y1), b.x2 < this.x2 && (this.x2 = b.x2), b.y2 < this.y2 && (this.y2 = b.y2), this;
|
|
28004
|
-
}
|
|
28005
|
-
encloses(b) {
|
|
28006
|
-
return b && this.x1 <= b.x1 && this.x2 >= b.x2 && this.y1 <= b.y1 && this.y2 >= b.y2;
|
|
28007
|
-
}
|
|
28008
|
-
alignsWith(b) {
|
|
28009
|
-
return b && (this.x1 === b.x1 || this.x2 === b.x2 || this.y1 === b.y1 || this.y2 === b.y2);
|
|
28010
|
-
}
|
|
28011
|
-
intersects(b) {
|
|
28012
|
-
return b && !(this.x2 < b.x1 || this.x1 > b.x2 || this.y2 < b.y1 || this.y1 > b.y2);
|
|
28013
|
-
}
|
|
28014
|
-
contains() {
|
|
28015
|
-
let x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28016
|
-
let y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
28017
|
-
return !(x < this.x1 || x > this.x2 || y < this.y1 || y > this.y2);
|
|
28018
|
-
}
|
|
28019
|
-
containsPoint(p) {
|
|
28020
|
-
return !(p.x < this.x1 || p.x > this.x2 || p.y < this.y1 || p.y > this.y2);
|
|
28021
|
-
}
|
|
28022
|
-
width() {
|
|
28023
|
-
return this.empty() ? 0 : this.x2 - this.x1;
|
|
28024
|
-
}
|
|
28025
|
-
height() {
|
|
28026
|
-
return this.empty() ? 0 : this.y2 - this.y1;
|
|
28027
|
-
}
|
|
28028
|
-
scaleX() {
|
|
28029
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28030
|
-
return this.x1 *= s, this.x2 *= s, this;
|
|
28031
|
-
}
|
|
28032
|
-
scaleY() {
|
|
28033
|
-
let s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
28034
|
-
return this.y1 *= s, this.y2 *= s, this;
|
|
28035
|
-
}
|
|
28036
|
-
transformWithMatrix(matrix) {
|
|
28037
|
-
return transformBoundsWithMatrix(this, this, matrix), this;
|
|
28038
|
-
}
|
|
28039
|
-
copy(b) {
|
|
28040
|
-
return this.x1 = b.x1, this.y1 = b.y1, this.x2 = b.x2, this.y2 = b.y2, this;
|
|
28041
|
-
}
|
|
28042
|
-
rotatedPoints(angle, x, y) {
|
|
28043
|
-
const {
|
|
28044
|
-
x1: x1,
|
|
28045
|
-
y1: y1,
|
|
28046
|
-
x2: x2,
|
|
28047
|
-
y2: y2
|
|
28048
|
-
} = this,
|
|
28049
|
-
cos = Math.cos(angle),
|
|
28050
|
-
sin = Math.sin(angle),
|
|
28051
|
-
cx = x - x * cos + y * sin,
|
|
28052
|
-
cy = y - x * sin - y * cos;
|
|
28053
|
-
return [cos * x1 - sin * y1 + cx, sin * x1 + cos * y1 + cy, cos * x1 - sin * y2 + cx, sin * x1 + cos * y2 + cy, cos * x2 - sin * y1 + cx, sin * x2 + cos * y1 + cy, cos * x2 - sin * y2 + cx, sin * x2 + cos * y2 + cy];
|
|
28054
|
-
}
|
|
28055
|
-
scalePoints(sx, sy, x, y) {
|
|
28056
|
-
const {
|
|
28057
|
-
x1: x1,
|
|
28058
|
-
y1: y1,
|
|
28059
|
-
x2: x2,
|
|
28060
|
-
y2: y2
|
|
28061
|
-
} = this;
|
|
28062
|
-
return [sx * x1 + (1 - sx) * x, sy * y1 + (1 - sy) * y, sx * x2 + (1 - sx) * x, sy * y2 + (1 - sy) * y];
|
|
28063
|
-
}
|
|
28064
|
-
}
|
|
28065
|
-
class AABBBounds extends Bounds {}
|
|
28066
|
-
|
|
28067
|
-
function degreeToRadian(degree) {
|
|
28068
|
-
return degree * (Math.PI / 180);
|
|
28069
|
-
}
|
|
28070
|
-
function polarToCartesian(center, radius, angleInRadian) {
|
|
28071
|
-
return {
|
|
28072
|
-
x: center.x + radius * Math.cos(angleInRadian),
|
|
28073
|
-
y: center.y + radius * Math.sin(angleInRadian)
|
|
28074
|
-
};
|
|
28075
|
-
}
|
|
28076
|
-
|
|
28077
27893
|
function hslToRgb(h, s, l) {
|
|
28078
27894
|
s /= 100, l /= 100;
|
|
28079
27895
|
const c = (1 - Math.abs(2 * l - 1)) * s,
|
|
@@ -28502,258 +28318,12 @@
|
|
|
28502
28318
|
rgbToHsl: rgbToHsl
|
|
28503
28319
|
});
|
|
28504
28320
|
|
|
28505
|
-
const eastAsianCharacterInfo = character => {
|
|
28506
|
-
let x = character.charCodeAt(0),
|
|
28507
|
-
y = 2 === character.length ? character.charCodeAt(1) : 0,
|
|
28508
|
-
codePoint = x;
|
|
28509
|
-
return 55296 <= x && x <= 56319 && 56320 <= y && y <= 57343 && (x &= 1023, y &= 1023, codePoint = x << 10 | y, codePoint += 65536), 12288 === codePoint || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 ? "F" : 8361 === codePoint || 65377 <= codePoint && codePoint <= 65470 || 65474 <= codePoint && codePoint <= 65479 || 65482 <= codePoint && codePoint <= 65487 || 65490 <= codePoint && codePoint <= 65495 || 65498 <= codePoint && codePoint <= 65500 || 65512 <= codePoint && codePoint <= 65518 ? "H" : 4352 <= codePoint && codePoint <= 4447 || 4515 <= codePoint && codePoint <= 4519 || 4602 <= codePoint && codePoint <= 4607 || 9001 <= codePoint && codePoint <= 9002 || 11904 <= codePoint && codePoint <= 11929 || 11931 <= codePoint && codePoint <= 12019 || 12032 <= codePoint && codePoint <= 12245 || 12272 <= codePoint && codePoint <= 12283 || 12289 <= codePoint && codePoint <= 12350 || 12353 <= codePoint && codePoint <= 12438 || 12441 <= codePoint && codePoint <= 12543 || 12549 <= codePoint && codePoint <= 12589 || 12593 <= codePoint && codePoint <= 12686 || 12688 <= codePoint && codePoint <= 12730 || 12736 <= codePoint && codePoint <= 12771 || 12784 <= codePoint && codePoint <= 12830 || 12832 <= codePoint && codePoint <= 12871 || 12880 <= codePoint && codePoint <= 13054 || 13056 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42124 || 42128 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 55216 <= codePoint && codePoint <= 55238 || 55243 <= codePoint && codePoint <= 55291 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65106 || 65108 <= codePoint && codePoint <= 65126 || 65128 <= codePoint && codePoint <= 65131 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127490 || 127504 <= codePoint && codePoint <= 127546 || 127552 <= codePoint && codePoint <= 127560 || 127568 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 194367 || 177984 <= codePoint && codePoint <= 196605 || 196608 <= codePoint && codePoint <= 262141 ? "W" : 32 <= codePoint && codePoint <= 126 || 162 <= codePoint && codePoint <= 163 || 165 <= codePoint && codePoint <= 166 || 172 === codePoint || 175 === codePoint || 10214 <= codePoint && codePoint <= 10221 || 10629 <= codePoint && codePoint <= 10630 ? "Na" : 161 === codePoint || 164 === codePoint || 167 <= codePoint && codePoint <= 168 || 170 === codePoint || 173 <= codePoint && codePoint <= 174 || 176 <= codePoint && codePoint <= 180 || 182 <= codePoint && codePoint <= 186 || 188 <= codePoint && codePoint <= 191 || 198 === codePoint || 208 === codePoint || 215 <= codePoint && codePoint <= 216 || 222 <= codePoint && codePoint <= 225 || 230 === codePoint || 232 <= codePoint && codePoint <= 234 || 236 <= codePoint && codePoint <= 237 || 240 === codePoint || 242 <= codePoint && codePoint <= 243 || 247 <= codePoint && codePoint <= 250 || 252 === codePoint || 254 === codePoint || 257 === codePoint || 273 === codePoint || 275 === codePoint || 283 === codePoint || 294 <= codePoint && codePoint <= 295 || 299 === codePoint || 305 <= codePoint && codePoint <= 307 || 312 === codePoint || 319 <= codePoint && codePoint <= 322 || 324 === codePoint || 328 <= codePoint && codePoint <= 331 || 333 === codePoint || 338 <= codePoint && codePoint <= 339 || 358 <= codePoint && codePoint <= 359 || 363 === codePoint || 462 === codePoint || 464 === codePoint || 466 === codePoint || 468 === codePoint || 470 === codePoint || 472 === codePoint || 474 === codePoint || 476 === codePoint || 593 === codePoint || 609 === codePoint || 708 === codePoint || 711 === codePoint || 713 <= codePoint && codePoint <= 715 || 717 === codePoint || 720 === codePoint || 728 <= codePoint && codePoint <= 731 || 733 === codePoint || 735 === codePoint || 768 <= codePoint && codePoint <= 879 || 913 <= codePoint && codePoint <= 929 || 931 <= codePoint && codePoint <= 937 || 945 <= codePoint && codePoint <= 961 || 963 <= codePoint && codePoint <= 969 || 1025 === codePoint || 1040 <= codePoint && codePoint <= 1103 || 1105 === codePoint || 8208 === codePoint || 8211 <= codePoint && codePoint <= 8214 || 8216 <= codePoint && codePoint <= 8217 || 8220 <= codePoint && codePoint <= 8221 || 8224 <= codePoint && codePoint <= 8226 || 8228 <= codePoint && codePoint <= 8231 || 8240 === codePoint || 8242 <= codePoint && codePoint <= 8243 || 8245 === codePoint || 8251 === codePoint || 8254 === codePoint || 8308 === codePoint || 8319 === codePoint || 8321 <= codePoint && codePoint <= 8324 || 8364 === codePoint || 8451 === codePoint || 8453 === codePoint || 8457 === codePoint || 8467 === codePoint || 8470 === codePoint || 8481 <= codePoint && codePoint <= 8482 || 8486 === codePoint || 8491 === codePoint || 8531 <= codePoint && codePoint <= 8532 || 8539 <= codePoint && codePoint <= 8542 || 8544 <= codePoint && codePoint <= 8555 || 8560 <= codePoint && codePoint <= 8569 || 8585 === codePoint || 8592 <= codePoint && codePoint <= 8601 || 8632 <= codePoint && codePoint <= 8633 || 8658 === codePoint || 8660 === codePoint || 8679 === codePoint || 8704 === codePoint || 8706 <= codePoint && codePoint <= 8707 || 8711 <= codePoint && codePoint <= 8712 || 8715 === codePoint || 8719 === codePoint || 8721 === codePoint || 8725 === codePoint || 8730 === codePoint || 8733 <= codePoint && codePoint <= 8736 || 8739 === codePoint || 8741 === codePoint || 8743 <= codePoint && codePoint <= 8748 || 8750 === codePoint || 8756 <= codePoint && codePoint <= 8759 || 8764 <= codePoint && codePoint <= 8765 || 8776 === codePoint || 8780 === codePoint || 8786 === codePoint || 8800 <= codePoint && codePoint <= 8801 || 8804 <= codePoint && codePoint <= 8807 || 8810 <= codePoint && codePoint <= 8811 || 8814 <= codePoint && codePoint <= 8815 || 8834 <= codePoint && codePoint <= 8835 || 8838 <= codePoint && codePoint <= 8839 || 8853 === codePoint || 8857 === codePoint || 8869 === codePoint || 8895 === codePoint || 8978 === codePoint || 9312 <= codePoint && codePoint <= 9449 || 9451 <= codePoint && codePoint <= 9547 || 9552 <= codePoint && codePoint <= 9587 || 9600 <= codePoint && codePoint <= 9615 || 9618 <= codePoint && codePoint <= 9621 || 9632 <= codePoint && codePoint <= 9633 || 9635 <= codePoint && codePoint <= 9641 || 9650 <= codePoint && codePoint <= 9651 || 9654 <= codePoint && codePoint <= 9655 || 9660 <= codePoint && codePoint <= 9661 || 9664 <= codePoint && codePoint <= 9665 || 9670 <= codePoint && codePoint <= 9672 || 9675 === codePoint || 9678 <= codePoint && codePoint <= 9681 || 9698 <= codePoint && codePoint <= 9701 || 9711 === codePoint || 9733 <= codePoint && codePoint <= 9734 || 9737 === codePoint || 9742 <= codePoint && codePoint <= 9743 || 9748 <= codePoint && codePoint <= 9749 || 9756 === codePoint || 9758 === codePoint || 9792 === codePoint || 9794 === codePoint || 9824 <= codePoint && codePoint <= 9825 || 9827 <= codePoint && codePoint <= 9829 || 9831 <= codePoint && codePoint <= 9834 || 9836 <= codePoint && codePoint <= 9837 || 9839 === codePoint || 9886 <= codePoint && codePoint <= 9887 || 9918 <= codePoint && codePoint <= 9919 || 9924 <= codePoint && codePoint <= 9933 || 9935 <= codePoint && codePoint <= 9953 || 9955 === codePoint || 9960 <= codePoint && codePoint <= 9983 || 10045 === codePoint || 10071 === codePoint || 10102 <= codePoint && codePoint <= 10111 || 11093 <= codePoint && codePoint <= 11097 || 12872 <= codePoint && codePoint <= 12879 || 57344 <= codePoint && codePoint <= 63743 || 65024 <= codePoint && codePoint <= 65039 || 65533 === codePoint || 127232 <= codePoint && codePoint <= 127242 || 127248 <= codePoint && codePoint <= 127277 || 127280 <= codePoint && codePoint <= 127337 || 127344 <= codePoint && codePoint <= 127386 || 917760 <= codePoint && codePoint <= 917999 || 983040 <= codePoint && codePoint <= 1048573 || 1048576 <= codePoint && codePoint <= 1114109 ? "A" : "N";
|
|
28510
|
-
};
|
|
28511
|
-
|
|
28512
|
-
function getContextFont(text) {
|
|
28513
|
-
let defaultAttr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
28514
|
-
const {
|
|
28515
|
-
fontStyle = defaultAttr.fontStyle,
|
|
28516
|
-
fontVariant = defaultAttr.fontVariant,
|
|
28517
|
-
fontWeight = defaultAttr.fontWeight,
|
|
28518
|
-
fontSize = defaultAttr.fontSize,
|
|
28519
|
-
fontFamily = defaultAttr.fontFamily
|
|
28520
|
-
} = text;
|
|
28521
|
-
return (fontStyle ? fontStyle + " " : "") + (fontVariant ? fontVariant + " " : "") + (fontWeight ? fontWeight + " " : "") + fontSize + "px " + (fontFamily || "sans-serif");
|
|
28522
|
-
}
|
|
28523
|
-
|
|
28524
|
-
class TextMeasure {
|
|
28525
|
-
constructor(option, textSpec) {
|
|
28526
|
-
this._numberCharSize = null, this._fullCharSize = null, this._letterCharSize = null, this._specialCharSizeMap = {}, this._canvas = null, this._context = null, this._contextSaved = !1, this._notSupportCanvas = !1, this._notSupportVRender = !1, this._userSpec = {}, this.specialCharSet = "-/: .,@%'\"~", this._option = option, this._userSpec = null != textSpec ? textSpec : {}, this.textSpec = this._initSpec(), isValid$1(option.specialCharSet) && (this.specialCharSet = option.specialCharSet), this._standardMethod = isValid$1(option.getTextBounds) ? this.fullMeasure.bind(this) : this.measureWithNaiveCanvas.bind(this);
|
|
28527
|
-
}
|
|
28528
|
-
initContext() {
|
|
28529
|
-
if (this._notSupportCanvas) return !1;
|
|
28530
|
-
if (isNil$1(this._canvas) && (isValid$1(this._option.getCanvasForMeasure) && (this._canvas = this._option.getCanvasForMeasure()), isNil$1(this._canvas) && "undefined" != typeof window && void 0 !== window.document && globalThis && isValid$1(globalThis.document) && (this._canvas = globalThis.document.createElement("canvas"))), isNil$1(this._context) && isValid$1(this._canvas)) {
|
|
28531
|
-
const context = this._canvas.getContext("2d");
|
|
28532
|
-
isValid$1(context) && (context.save(), context.font = getContextFont(this.textSpec), this._contextSaved = !0, this._context = context);
|
|
28533
|
-
}
|
|
28534
|
-
return !isNil$1(this._context) || (this._notSupportCanvas = !0, !1);
|
|
28535
|
-
}
|
|
28536
|
-
_initSpec() {
|
|
28537
|
-
var _a, _b, _c;
|
|
28538
|
-
const {
|
|
28539
|
-
defaultFontParams = {}
|
|
28540
|
-
} = this._option,
|
|
28541
|
-
{
|
|
28542
|
-
fontStyle = defaultFontParams.fontStyle,
|
|
28543
|
-
fontVariant = defaultFontParams.fontVariant,
|
|
28544
|
-
fontWeight = null !== (_a = defaultFontParams.fontWeight) && void 0 !== _a ? _a : "normal",
|
|
28545
|
-
fontSize = null !== (_b = defaultFontParams.fontSize) && void 0 !== _b ? _b : 12,
|
|
28546
|
-
fontFamily = null !== (_c = defaultFontParams.fontFamily) && void 0 !== _c ? _c : "sans-serif",
|
|
28547
|
-
align: align,
|
|
28548
|
-
textAlign = null != align ? align : "center",
|
|
28549
|
-
baseline: baseline,
|
|
28550
|
-
textBaseline = null != baseline ? baseline : "middle",
|
|
28551
|
-
ellipsis: ellipsis,
|
|
28552
|
-
limit: limit
|
|
28553
|
-
} = this._userSpec;
|
|
28554
|
-
let {
|
|
28555
|
-
lineHeight = fontSize
|
|
28556
|
-
} = this._userSpec;
|
|
28557
|
-
if (isString$1(lineHeight) && "%" === lineHeight[lineHeight.length - 1]) {
|
|
28558
|
-
const scale = Number.parseFloat(lineHeight.substring(0, lineHeight.length - 1)) / 100;
|
|
28559
|
-
lineHeight = fontSize * scale;
|
|
28560
|
-
}
|
|
28561
|
-
return {
|
|
28562
|
-
fontStyle: fontStyle,
|
|
28563
|
-
fontVariant: fontVariant,
|
|
28564
|
-
fontFamily: fontFamily,
|
|
28565
|
-
fontSize: fontSize,
|
|
28566
|
-
fontWeight: fontWeight,
|
|
28567
|
-
textAlign: textAlign,
|
|
28568
|
-
textBaseline: textBaseline,
|
|
28569
|
-
ellipsis: ellipsis,
|
|
28570
|
-
limit: limit,
|
|
28571
|
-
lineHeight: lineHeight
|
|
28572
|
-
};
|
|
28573
|
-
}
|
|
28574
|
-
measure(text, method) {
|
|
28575
|
-
switch (method) {
|
|
28576
|
-
case "vrender":
|
|
28577
|
-
case "canopus":
|
|
28578
|
-
return this.fullMeasure(text);
|
|
28579
|
-
case "canvas":
|
|
28580
|
-
return this.measureWithNaiveCanvas(text);
|
|
28581
|
-
case "simple":
|
|
28582
|
-
return this.quickMeasureWithoutCanvas(text);
|
|
28583
|
-
default:
|
|
28584
|
-
return this.quickMeasure(text);
|
|
28585
|
-
}
|
|
28586
|
-
}
|
|
28587
|
-
fullMeasure(text) {
|
|
28588
|
-
if (isNil$1(text)) return {
|
|
28589
|
-
width: 0,
|
|
28590
|
-
height: 0
|
|
28591
|
-
};
|
|
28592
|
-
if (isNil$1(this._option.getTextBounds) || !this._notSupportVRender) return this.measureWithNaiveCanvas(text);
|
|
28593
|
-
const {
|
|
28594
|
-
fontFamily: fontFamily,
|
|
28595
|
-
fontSize: fontSize,
|
|
28596
|
-
fontWeight: fontWeight,
|
|
28597
|
-
textAlign: textAlign,
|
|
28598
|
-
textBaseline: textBaseline,
|
|
28599
|
-
ellipsis: ellipsis,
|
|
28600
|
-
limit: limit,
|
|
28601
|
-
lineHeight: lineHeight
|
|
28602
|
-
} = this.textSpec;
|
|
28603
|
-
let size;
|
|
28604
|
-
try {
|
|
28605
|
-
const bounds = this._option.getTextBounds({
|
|
28606
|
-
text: text,
|
|
28607
|
-
fontFamily: fontFamily,
|
|
28608
|
-
fontSize: fontSize,
|
|
28609
|
-
fontWeight: fontWeight,
|
|
28610
|
-
textAlign: textAlign,
|
|
28611
|
-
textBaseline: textBaseline,
|
|
28612
|
-
ellipsis: !!ellipsis,
|
|
28613
|
-
maxLineWidth: limit || 1 / 0,
|
|
28614
|
-
lineHeight: lineHeight
|
|
28615
|
-
});
|
|
28616
|
-
size = {
|
|
28617
|
-
width: bounds.width(),
|
|
28618
|
-
height: bounds.height()
|
|
28619
|
-
};
|
|
28620
|
-
} catch (e) {
|
|
28621
|
-
this._notSupportVRender = !0, size = this.measureWithNaiveCanvas(text);
|
|
28622
|
-
}
|
|
28623
|
-
return size;
|
|
28624
|
-
}
|
|
28625
|
-
measureWithNaiveCanvas(text) {
|
|
28626
|
-
return this._measureReduce(text, this._measureWithNaiveCanvas.bind(this));
|
|
28627
|
-
}
|
|
28628
|
-
_measureWithNaiveCanvas(text) {
|
|
28629
|
-
var _a;
|
|
28630
|
-
if (!this.initContext()) return this._quickMeasureWithoutCanvas(text);
|
|
28631
|
-
const metrics = this._context.measureText(text),
|
|
28632
|
-
{
|
|
28633
|
-
fontSize: fontSize,
|
|
28634
|
-
lineHeight: lineHeight
|
|
28635
|
-
} = this.textSpec;
|
|
28636
|
-
return {
|
|
28637
|
-
width: metrics.width,
|
|
28638
|
-
height: null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize
|
|
28639
|
-
};
|
|
28640
|
-
}
|
|
28641
|
-
quickMeasure(text) {
|
|
28642
|
-
return this._measureReduce(text, this._quickMeasure.bind(this));
|
|
28643
|
-
}
|
|
28644
|
-
_quickMeasure(text) {
|
|
28645
|
-
const totalSize = {
|
|
28646
|
-
width: 0,
|
|
28647
|
-
height: 0
|
|
28648
|
-
};
|
|
28649
|
-
for (let i = 0; i < text.length; i++) {
|
|
28650
|
-
const char = text[i];
|
|
28651
|
-
let size = this._measureSpecialChar(char);
|
|
28652
|
-
isNil$1(size) && TextMeasure.NUMBERS_CHAR_SET.includes(char) && (size = this._measureNumberChar()), isNil$1(size) && ["F", "W"].includes(eastAsianCharacterInfo(char)) && (size = this._measureFullSizeChar()), isNil$1(size) && (size = this._measureLetterChar()), totalSize.width += size.width, totalSize.height = Math.max(totalSize.height, size.height);
|
|
28653
|
-
}
|
|
28654
|
-
return totalSize;
|
|
28655
|
-
}
|
|
28656
|
-
quickMeasureWithoutCanvas(text) {
|
|
28657
|
-
return this._measureReduce(text, this._quickMeasureWithoutCanvas.bind(this));
|
|
28658
|
-
}
|
|
28659
|
-
_quickMeasureWithoutCanvas(text) {
|
|
28660
|
-
var _a;
|
|
28661
|
-
const totalSize = {
|
|
28662
|
-
width: 0,
|
|
28663
|
-
height: 0
|
|
28664
|
-
},
|
|
28665
|
-
{
|
|
28666
|
-
fontSize: fontSize,
|
|
28667
|
-
lineHeight: lineHeight
|
|
28668
|
-
} = this.textSpec;
|
|
28669
|
-
for (let i = 0; i < text.length; i++) {
|
|
28670
|
-
const char = text[i],
|
|
28671
|
-
size = ["F", "W"].includes(eastAsianCharacterInfo(char)) ? 1 : .53;
|
|
28672
|
-
totalSize.width += size * fontSize;
|
|
28673
|
-
}
|
|
28674
|
-
return totalSize.height = null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize, totalSize;
|
|
28675
|
-
}
|
|
28676
|
-
_measureReduce(text, processor) {
|
|
28677
|
-
var _a;
|
|
28678
|
-
const {
|
|
28679
|
-
fontSize: fontSize,
|
|
28680
|
-
lineHeight: lineHeight
|
|
28681
|
-
} = this.textSpec,
|
|
28682
|
-
defaultResult = {
|
|
28683
|
-
width: 0,
|
|
28684
|
-
height: 0
|
|
28685
|
-
};
|
|
28686
|
-
if (isNil$1(text)) return defaultResult;
|
|
28687
|
-
if (isArray$1(text)) {
|
|
28688
|
-
const textArr = text.filter(isValid$1).map(s => s.toString());
|
|
28689
|
-
return 0 === textArr.length ? defaultResult : 1 === textArr.length ? processor(textArr[0]) : {
|
|
28690
|
-
width: textArr.reduce((maxWidth, cur) => Math.max(maxWidth, processor(cur).width), 0),
|
|
28691
|
-
height: textArr.length * ((null !== (_a = lineHeight) && void 0 !== _a ? _a : fontSize) + 1) + 1
|
|
28692
|
-
};
|
|
28693
|
-
}
|
|
28694
|
-
return processor(text.toString());
|
|
28695
|
-
}
|
|
28696
|
-
_measureNumberChar() {
|
|
28697
|
-
if (isNil$1(this._numberCharSize)) {
|
|
28698
|
-
const numberBounds = this._standardMethod(TextMeasure.NUMBERS_CHAR_SET);
|
|
28699
|
-
this._numberCharSize = {
|
|
28700
|
-
width: numberBounds.width / TextMeasure.NUMBERS_CHAR_SET.length,
|
|
28701
|
-
height: numberBounds.height
|
|
28702
|
-
};
|
|
28703
|
-
}
|
|
28704
|
-
return this._numberCharSize;
|
|
28705
|
-
}
|
|
28706
|
-
_measureFullSizeChar() {
|
|
28707
|
-
return isNil$1(this._fullCharSize) && (this._fullCharSize = this._standardMethod(TextMeasure.FULL_SIZE_CHAR)), this._fullCharSize;
|
|
28708
|
-
}
|
|
28709
|
-
_measureLetterChar() {
|
|
28710
|
-
if (isNil$1(this._letterCharSize)) {
|
|
28711
|
-
const alphabetBounds = this._standardMethod(TextMeasure.ALPHABET_CHAR_SET);
|
|
28712
|
-
this._letterCharSize = {
|
|
28713
|
-
width: alphabetBounds.width / TextMeasure.ALPHABET_CHAR_SET.length,
|
|
28714
|
-
height: alphabetBounds.height
|
|
28715
|
-
};
|
|
28716
|
-
}
|
|
28717
|
-
return this._letterCharSize;
|
|
28718
|
-
}
|
|
28719
|
-
_measureSpecialChar(char) {
|
|
28720
|
-
return isValid$1(this._specialCharSizeMap[char]) ? this._specialCharSizeMap[char] : this.specialCharSet.includes(char) ? (this._specialCharSizeMap[char] = this._standardMethod(char), this._specialCharSizeMap[char]) : null;
|
|
28721
|
-
}
|
|
28722
|
-
release() {
|
|
28723
|
-
isValid$1(this._canvas) && (this._canvas = null), isValid$1(this._context) && (this._contextSaved && (this._context.restore(), this._contextSaved = !1), this._context = null);
|
|
28724
|
-
}
|
|
28725
|
-
}
|
|
28726
|
-
TextMeasure.ALPHABET_CHAR_SET = "abcdefghijklmnopqrstuvwxyz", TextMeasure.NUMBERS_CHAR_SET = "0123456789", TextMeasure.FULL_SIZE_CHAR = "字";
|
|
28727
|
-
|
|
28728
28321
|
var ScaleEnum$1;
|
|
28729
28322
|
!function (ScaleEnum) {
|
|
28730
28323
|
ScaleEnum.Identity = "identity", ScaleEnum.Linear = "linear", ScaleEnum.Log = "log", ScaleEnum.Pow = "pow", ScaleEnum.Sqrt = "sqrt", ScaleEnum.Symlog = "symlog", ScaleEnum.Time = "time", ScaleEnum.Quantile = "quantile", ScaleEnum.Quantize = "quantize", ScaleEnum.Threshold = "threshold", ScaleEnum.Ordinal = "ordinal", ScaleEnum.Point = "point", ScaleEnum.Band = "band";
|
|
28731
28324
|
}(ScaleEnum$1 || (ScaleEnum$1 = {}));
|
|
28732
28325
|
Object.values(ScaleEnum$1).forEach(v => {
|
|
28733
28326
|
});
|
|
28734
|
-
function isContinuous(type) {
|
|
28735
|
-
switch (type) {
|
|
28736
|
-
case ScaleEnum$1.Linear:
|
|
28737
|
-
case ScaleEnum$1.Log:
|
|
28738
|
-
case ScaleEnum$1.Pow:
|
|
28739
|
-
case ScaleEnum$1.Sqrt:
|
|
28740
|
-
case ScaleEnum$1.Symlog:
|
|
28741
|
-
case ScaleEnum$1.Time:
|
|
28742
|
-
return !0;
|
|
28743
|
-
default:
|
|
28744
|
-
return !1;
|
|
28745
|
-
}
|
|
28746
|
-
}
|
|
28747
|
-
function isDiscrete(type) {
|
|
28748
|
-
switch (type) {
|
|
28749
|
-
case ScaleEnum$1.Ordinal:
|
|
28750
|
-
case ScaleEnum$1.Point:
|
|
28751
|
-
case ScaleEnum$1.Band:
|
|
28752
|
-
return !0;
|
|
28753
|
-
default:
|
|
28754
|
-
return !1;
|
|
28755
|
-
}
|
|
28756
|
-
}
|
|
28757
28327
|
|
|
28758
28328
|
function identity$1(x) {
|
|
28759
28329
|
return x;
|
|
@@ -30368,7 +29938,7 @@
|
|
|
30368
29938
|
return style;
|
|
30369
29939
|
}
|
|
30370
29940
|
if (style.angle) {
|
|
30371
|
-
style.angle = degreeToRadian
|
|
29941
|
+
style.angle = degreeToRadian(style.angle);
|
|
30372
29942
|
}
|
|
30373
29943
|
return style;
|
|
30374
29944
|
}
|
|
@@ -30578,7 +30148,7 @@
|
|
|
30578
30148
|
position: spec.title.position,
|
|
30579
30149
|
space: spec.title.space,
|
|
30580
30150
|
autoRotate: false,
|
|
30581
|
-
angle: titleAngle ? degreeToRadian
|
|
30151
|
+
angle: titleAngle ? degreeToRadian(titleAngle) : null,
|
|
30582
30152
|
textStyle: merge({}, titleTextStyle, transformToGraphic(spec.title.style)),
|
|
30583
30153
|
padding: spec.title.padding,
|
|
30584
30154
|
shape: {
|
|
@@ -30617,6 +30187,29 @@
|
|
|
30617
30187
|
}(ScaleEnum || (ScaleEnum = {}));
|
|
30618
30188
|
Object.values(ScaleEnum).forEach(v => {
|
|
30619
30189
|
});
|
|
30190
|
+
function isContinuous(type) {
|
|
30191
|
+
switch (type) {
|
|
30192
|
+
case ScaleEnum.Linear:
|
|
30193
|
+
case ScaleEnum.Log:
|
|
30194
|
+
case ScaleEnum.Pow:
|
|
30195
|
+
case ScaleEnum.Sqrt:
|
|
30196
|
+
case ScaleEnum.Symlog:
|
|
30197
|
+
case ScaleEnum.Time:
|
|
30198
|
+
return !0;
|
|
30199
|
+
default:
|
|
30200
|
+
return !1;
|
|
30201
|
+
}
|
|
30202
|
+
}
|
|
30203
|
+
function isDiscrete(type) {
|
|
30204
|
+
switch (type) {
|
|
30205
|
+
case ScaleEnum.Ordinal:
|
|
30206
|
+
case ScaleEnum.Point:
|
|
30207
|
+
case ScaleEnum.Band:
|
|
30208
|
+
return !0;
|
|
30209
|
+
default:
|
|
30210
|
+
return !1;
|
|
30211
|
+
}
|
|
30212
|
+
}
|
|
30620
30213
|
|
|
30621
30214
|
function identity(x) {
|
|
30622
30215
|
return x;
|
|
@@ -31950,19 +31543,66 @@
|
|
|
31950
31543
|
specialCharSet: "-/: .,@%'\"~" + TextMeasure.ALPHABET_CHAR_SET + TextMeasure.ALPHABET_CHAR_SET.toUpperCase()
|
|
31951
31544
|
}, null != option ? option : {}), textSpec);
|
|
31952
31545
|
|
|
31953
|
-
function
|
|
31954
|
-
|
|
31955
|
-
|
|
31546
|
+
function scale(vector, scale) {
|
|
31547
|
+
return [vector[0] * scale, vector[1] * scale];
|
|
31548
|
+
}
|
|
31549
|
+
function length(vector) {
|
|
31550
|
+
const [x, y] = vector;
|
|
31551
|
+
return Math.sqrt(x * x + y * y);
|
|
31552
|
+
}
|
|
31553
|
+
|
|
31554
|
+
const clampRadian = function () {
|
|
31555
|
+
let angle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
31556
|
+
if (angle < 0) for (; angle < 0;) angle += tau;else if (angle > 0) for (; angle > tau;) angle -= tau;
|
|
31956
31557
|
return angle;
|
|
31558
|
+
};
|
|
31559
|
+
function isInRange(a, min, max) {
|
|
31560
|
+
return !isLess(a, min, 0, 1e-6) && !isGreater(a, max, 0, 1e-6);
|
|
31957
31561
|
}
|
|
31958
|
-
function
|
|
31959
|
-
|
|
31960
|
-
|
|
31961
|
-
|
|
31962
|
-
|
|
31963
|
-
|
|
31562
|
+
function getCircleLabelPosition(tickPosition, tickVector, text, style) {
|
|
31563
|
+
const labelBounds = getTextBounds(Object.assign({
|
|
31564
|
+
text: text
|
|
31565
|
+
}, style)),
|
|
31566
|
+
width = labelBounds.width(),
|
|
31567
|
+
height = labelBounds.height(),
|
|
31568
|
+
angle = clampRadian(Math.atan2(tickVector[1], tickVector[0])) - Math.PI,
|
|
31569
|
+
PI_3_4 = 3 * Math.PI / 4,
|
|
31570
|
+
PI_1_4 = Math.PI / 4,
|
|
31571
|
+
PI_1_2 = Math.PI / 2,
|
|
31572
|
+
baseX = tickPosition.x;
|
|
31573
|
+
let dx = 0;
|
|
31574
|
+
dx = isInRange(angle, -PI_3_4, -PI_1_4) ? ((angle + PI_3_4) / PI_1_2 - .5) * width : isInRange(angle, PI_1_4, PI_3_4) ? (.5 - (angle - PI_1_4) / PI_1_2) * width : Math.cos(angle) >= 0 ? .5 * width : .5 * -width;
|
|
31575
|
+
const x = baseX - dx,
|
|
31576
|
+
baseY = tickPosition.y;
|
|
31577
|
+
let dy = 0;
|
|
31578
|
+
dy = isInRange(angle, -PI_3_4, -PI_1_4) ? .5 * -height : isInRange(angle, PI_1_4, PI_3_4) ? .5 * height : Math.cos(angle) >= 0 ? (.5 - (PI_1_4 - angle) / PI_1_2) * height : (.5 - clampRadian(angle - PI_3_4) / PI_1_2) * height;
|
|
31579
|
+
return {
|
|
31580
|
+
x: x,
|
|
31581
|
+
y: baseY - dy
|
|
31964
31582
|
};
|
|
31965
31583
|
}
|
|
31584
|
+
function getVerticalCoord(point, vector) {
|
|
31585
|
+
return {
|
|
31586
|
+
x: point.x + vector[0],
|
|
31587
|
+
y: point.y + vector[1]
|
|
31588
|
+
};
|
|
31589
|
+
}
|
|
31590
|
+
function getCircleVerticalVector(offset, point, center) {
|
|
31591
|
+
let inside = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
|
31592
|
+
let axisInside = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : !1;
|
|
31593
|
+
const vector = [point.x - center.x, point.y - center.y];
|
|
31594
|
+
return scale(vector, (inside ? -1 : 1) * (axisInside ? -1 : 1) * offset / length(vector));
|
|
31595
|
+
}
|
|
31596
|
+
|
|
31597
|
+
function getLabelPosition(angle, center, radius, labelOffset, inside, text, style) {
|
|
31598
|
+
const point = polarToCartesian({
|
|
31599
|
+
x: 0,
|
|
31600
|
+
y: 0
|
|
31601
|
+
}, radius, angle),
|
|
31602
|
+
labelPoint = getVerticalCoord(point, getCircleVerticalVector(labelOffset, point, center, inside)),
|
|
31603
|
+
vector = getCircleVerticalVector(labelOffset || 1, labelPoint, center, inside);
|
|
31604
|
+
return getCircleLabelPosition(labelPoint, vector, text, style);
|
|
31605
|
+
}
|
|
31966
31606
|
|
|
31967
31607
|
const convertDomainToTickData = domain => domain.map((t, index) => ({
|
|
31968
31608
|
index: index,
|
|
@@ -32026,33 +31666,37 @@
|
|
|
32026
31666
|
labelStyle: labelStyle,
|
|
32027
31667
|
getRadius: getRadius,
|
|
32028
31668
|
labelOffset: labelOffset,
|
|
32029
|
-
labelFormatter: labelFormatter
|
|
31669
|
+
labelFormatter: labelFormatter,
|
|
31670
|
+
inside: inside
|
|
32030
31671
|
} = op,
|
|
32031
31672
|
radius = null == getRadius ? void 0 : getRadius(),
|
|
32032
31673
|
labelAngle = null !== (_a = labelStyle.angle) && void 0 !== _a ? _a : 0,
|
|
32033
|
-
textMeasure = initTextMeasure$1(labelStyle)
|
|
32034
|
-
|
|
32035
|
-
|
|
32036
|
-
{
|
|
32037
|
-
|
|
32038
|
-
|
|
32039
|
-
|
|
32040
|
-
|
|
32041
|
-
|
|
32042
|
-
|
|
32043
|
-
|
|
32044
|
-
|
|
32045
|
-
|
|
32046
|
-
|
|
32047
|
-
|
|
32048
|
-
|
|
32049
|
-
|
|
32050
|
-
|
|
32051
|
-
|
|
32052
|
-
|
|
32053
|
-
|
|
32054
|
-
|
|
32055
|
-
|
|
31674
|
+
textMeasure = initTextMeasure$1(labelStyle),
|
|
31675
|
+
labelBoundsList = domain.map(v => {
|
|
31676
|
+
var _a, _b;
|
|
31677
|
+
const str = labelFormatter ? labelFormatter(v) : `${v}`,
|
|
31678
|
+
{
|
|
31679
|
+
width: width,
|
|
31680
|
+
height: height
|
|
31681
|
+
} = textMeasure.quickMeasure(str),
|
|
31682
|
+
textWidth = Math.max(width, 12),
|
|
31683
|
+
textHeight = Math.max(height, 12),
|
|
31684
|
+
angle = scale.scale(v);
|
|
31685
|
+
let textX = 0,
|
|
31686
|
+
textY = 0;
|
|
31687
|
+
const orient_align = null !== (_a = labelStyle.textAlign) && void 0 !== _a ? _a : "center",
|
|
31688
|
+
orient_baseline = null !== (_b = labelStyle.textBaseline) && void 0 !== _b ? _b : "middle",
|
|
31689
|
+
{
|
|
31690
|
+
x: x,
|
|
31691
|
+
y: y
|
|
31692
|
+
} = getLabelPosition(angle, {
|
|
31693
|
+
x: 0,
|
|
31694
|
+
y: 0
|
|
31695
|
+
}, radius, labelOffset, inside, str, labelStyle);
|
|
31696
|
+
textX = x + ("right" === orient_align ? -textWidth : "center" === orient_align ? -textWidth / 2 : 0), textY = y + ("bottom" === orient_baseline ? -textHeight : "middle" === orient_baseline ? -textHeight / 2 : 0);
|
|
31697
|
+
return new AABBBounds().set(textX, textY, textX + textWidth, textY + textHeight).rotate(labelAngle, textX + textWidth / 2, textY + textHeight / 2);
|
|
31698
|
+
});
|
|
31699
|
+
return labelBoundsList;
|
|
32056
31700
|
};
|
|
32057
31701
|
const isAxisHorizontal = axisOrientType => ["bottom", "top", "z"].includes(axisOrientType);
|
|
32058
31702
|
|
|
@@ -32069,7 +31713,7 @@
|
|
|
32069
31713
|
labelStyle: labelStyle
|
|
32070
31714
|
} = op;
|
|
32071
31715
|
let scaleTicks;
|
|
32072
|
-
if (isValid$
|
|
31716
|
+
if (isValid$3(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$3(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if ("d3" === op.tickMode) {
|
|
32073
31717
|
const count = isFunction$1(tickCount) ? tickCount({
|
|
32074
31718
|
axisLength: rangeSize,
|
|
32075
31719
|
labelStyle: labelStyle
|
|
@@ -32144,7 +31788,7 @@
|
|
|
32144
31788
|
rangeSize = scale.calculateWholeRangeSize();
|
|
32145
31789
|
if (rangeSize < 2) return op.labelLastVisible ? convertDomainToTickData([domain[domain.length - 1]]) : convertDomainToTickData([domain[0]]);
|
|
32146
31790
|
let scaleTicks;
|
|
32147
|
-
if (isValid$
|
|
31791
|
+
if (isValid$3(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$3(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$3(tickCount)) {
|
|
32148
31792
|
const count = isFunction$1(tickCount) ? tickCount({
|
|
32149
31793
|
axisLength: rangeSize,
|
|
32150
31794
|
labelStyle: labelStyle
|
|
@@ -32241,7 +31885,7 @@
|
|
|
32241
31885
|
radius = null == getRadius ? void 0 : getRadius();
|
|
32242
31886
|
if (!radius) return convertDomainToTickData(scale.domain());
|
|
32243
31887
|
let scaleTicks;
|
|
32244
|
-
if (isValid$
|
|
31888
|
+
if (isValid$3(tickStep)) scaleTicks = scale.stepTicks(tickStep);else if (isValid$3(forceTickCount)) scaleTicks = scale.forceTicks(forceTickCount);else if (isValid$3(tickCount)) {
|
|
32245
31889
|
const range = scale.range(),
|
|
32246
31890
|
rangeSize = Math.abs(range[range.length - 1] - range[0]),
|
|
32247
31891
|
count = isFunction$1(tickCount) ? tickCount({
|
|
@@ -32295,6 +31939,38 @@
|
|
|
32295
31939
|
return convertDomainToTickData(scale.domain());
|
|
32296
31940
|
};
|
|
32297
31941
|
|
|
31942
|
+
function isDataView(obj) {
|
|
31943
|
+
return obj instanceof DataView;
|
|
31944
|
+
}
|
|
31945
|
+
function isHTMLElement(obj) {
|
|
31946
|
+
try {
|
|
31947
|
+
return obj instanceof Element;
|
|
31948
|
+
} catch (_a) {
|
|
31949
|
+
const htmlElementKeys = ["children", "innerHTML", "classList", "setAttribute", "tagName", "getBoundingClientRect"],
|
|
31950
|
+
keys = Object.keys(obj);
|
|
31951
|
+
return htmlElementKeys.every(key => keys.includes(key));
|
|
31952
|
+
}
|
|
31953
|
+
}
|
|
31954
|
+
|
|
31955
|
+
function cloneDeepSpec(spec) {
|
|
31956
|
+
let excludeKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ["data"];
|
|
31957
|
+
const value = spec;
|
|
31958
|
+
let result;
|
|
31959
|
+
if (!isValid$3(value) || "object" != typeof value) return value;
|
|
31960
|
+
if (isDataView(value) || isHTMLElement(value)) return value;
|
|
31961
|
+
const isArr = isArray$3(value),
|
|
31962
|
+
length = value.length;
|
|
31963
|
+
result = isArr ? new Array(length) : "object" == typeof value ? {} : isBoolean$2(value) || isNumber$4(value) || isString$2(value) ? value : isDate$1(value) ? new Date(+value) : void 0;
|
|
31964
|
+
const props = isArr ? void 0 : Object.keys(Object(value));
|
|
31965
|
+
let index = -1;
|
|
31966
|
+
if (result) for (; ++index < (props || value).length;) {
|
|
31967
|
+
const key = props ? props[index] : index,
|
|
31968
|
+
subValue = value[key];
|
|
31969
|
+
(null == excludeKeys ? void 0 : excludeKeys.includes(key.toString())) ? result[key] = subValue : result[key] = cloneDeepSpec(subValue, excludeKeys);
|
|
31970
|
+
}
|
|
31971
|
+
return result;
|
|
31972
|
+
}
|
|
31973
|
+
|
|
32298
31974
|
const e10 = Math.sqrt(50);
|
|
32299
31975
|
const e5 = Math.sqrt(10);
|
|
32300
31976
|
const e2 = Math.sqrt(2);
|
|
@@ -32417,7 +32093,7 @@
|
|
|
32417
32093
|
if (isValid$3(domain[0]) || isValid$3(domain[1]) || this.type !== 'linear') {
|
|
32418
32094
|
return domain;
|
|
32419
32095
|
}
|
|
32420
|
-
if (Math.abs(minInArray
|
|
32096
|
+
if (Math.abs(minInArray(domain) - maxInArray(domain)) <= 1e-12) {
|
|
32421
32097
|
let num = domain[0];
|
|
32422
32098
|
const flag = num >= 0 ? 1 : -1;
|
|
32423
32099
|
num = Math.abs(num);
|
|
@@ -32542,13 +32218,13 @@
|
|
|
32542
32218
|
const isX = isXAxis(axis.orient);
|
|
32543
32219
|
const isInverse = axis.option.inverse === true;
|
|
32544
32220
|
const first = axisLabels[0];
|
|
32545
|
-
const last = last
|
|
32221
|
+
const last$1 = last(axisLabels);
|
|
32546
32222
|
if (isX) {
|
|
32547
32223
|
if (isInverse) {
|
|
32548
32224
|
const start = width;
|
|
32549
32225
|
const end = 0;
|
|
32550
32226
|
const startBound = first.AABBBounds.x2;
|
|
32551
|
-
const endBound = last.AABBBounds.x1;
|
|
32227
|
+
const endBound = last$1.AABBBounds.x1;
|
|
32552
32228
|
if (startBound > start) {
|
|
32553
32229
|
first.setAttributes({
|
|
32554
32230
|
x: start,
|
|
@@ -32556,7 +32232,7 @@
|
|
|
32556
32232
|
});
|
|
32557
32233
|
}
|
|
32558
32234
|
if (endBound < end) {
|
|
32559
|
-
last.setAttributes({
|
|
32235
|
+
last$1.setAttributes({
|
|
32560
32236
|
x: end,
|
|
32561
32237
|
textAlign: 'left'
|
|
32562
32238
|
});
|
|
@@ -32566,7 +32242,7 @@
|
|
|
32566
32242
|
const start = 0;
|
|
32567
32243
|
const end = width;
|
|
32568
32244
|
const startBound = first.AABBBounds.x1;
|
|
32569
|
-
const endBound = last.AABBBounds.x2;
|
|
32245
|
+
const endBound = last$1.AABBBounds.x2;
|
|
32570
32246
|
if (startBound < start) {
|
|
32571
32247
|
first.setAttributes({
|
|
32572
32248
|
x: start,
|
|
@@ -32574,7 +32250,7 @@
|
|
|
32574
32250
|
});
|
|
32575
32251
|
}
|
|
32576
32252
|
if (endBound > end) {
|
|
32577
|
-
last.setAttributes({
|
|
32253
|
+
last$1.setAttributes({
|
|
32578
32254
|
x: end,
|
|
32579
32255
|
textAlign: 'right'
|
|
32580
32256
|
});
|
|
@@ -32584,7 +32260,7 @@
|
|
|
32584
32260
|
else {
|
|
32585
32261
|
if (isInverse) {
|
|
32586
32262
|
const startBound = first.AABBBounds.y1;
|
|
32587
|
-
const endBound = last.AABBBounds.y2;
|
|
32263
|
+
const endBound = last$1.AABBBounds.y2;
|
|
32588
32264
|
const start = 0;
|
|
32589
32265
|
const end = height;
|
|
32590
32266
|
if (startBound < start) {
|
|
@@ -32594,7 +32270,7 @@
|
|
|
32594
32270
|
});
|
|
32595
32271
|
}
|
|
32596
32272
|
if (endBound > end) {
|
|
32597
|
-
last.setAttributes({
|
|
32273
|
+
last$1.setAttributes({
|
|
32598
32274
|
y: end,
|
|
32599
32275
|
textBaseline: 'bottom'
|
|
32600
32276
|
});
|
|
@@ -32604,7 +32280,7 @@
|
|
|
32604
32280
|
const start = height;
|
|
32605
32281
|
const end = 0;
|
|
32606
32282
|
const startBound = first.AABBBounds.y2;
|
|
32607
|
-
const endBound = last.AABBBounds.y1;
|
|
32283
|
+
const endBound = last$1.AABBBounds.y1;
|
|
32608
32284
|
if (startBound > start) {
|
|
32609
32285
|
first.setAttributes({
|
|
32610
32286
|
y: start,
|
|
@@ -32612,7 +32288,7 @@
|
|
|
32612
32288
|
});
|
|
32613
32289
|
}
|
|
32614
32290
|
if (endBound < end) {
|
|
32615
|
-
last.setAttributes({
|
|
32291
|
+
last$1.setAttributes({
|
|
32616
32292
|
y: end,
|
|
32617
32293
|
textBaseline: 'top'
|
|
32618
32294
|
});
|
|
@@ -32843,11 +32519,11 @@
|
|
|
32843
32519
|
}
|
|
32844
32520
|
if (isX) {
|
|
32845
32521
|
const width = this.getLayoutRect().width;
|
|
32846
|
-
const cosValue = Math.abs(Math.cos(degreeToRadian
|
|
32522
|
+
const cosValue = Math.abs(Math.cos(degreeToRadian(angle)));
|
|
32847
32523
|
return cosValue < 1e-6 ? Infinity : width / cosValue;
|
|
32848
32524
|
}
|
|
32849
32525
|
const height = this.getLayoutRect().height;
|
|
32850
|
-
const sinValue = Math.abs(Math.sin(degreeToRadian
|
|
32526
|
+
const sinValue = Math.abs(Math.sin(degreeToRadian(angle)));
|
|
32851
32527
|
return sinValue < 1e-6 ? Infinity : height / sinValue;
|
|
32852
32528
|
}
|
|
32853
32529
|
return null;
|
|
@@ -34657,7 +34333,7 @@
|
|
|
34657
34333
|
}
|
|
34658
34334
|
|
|
34659
34335
|
function getQuadProps(paddingOrigin) {
|
|
34660
|
-
if (isNumber$4(paddingOrigin) || isString$
|
|
34336
|
+
if (isNumber$4(paddingOrigin) || isString$2(paddingOrigin) || isArray$3(paddingOrigin)) {
|
|
34661
34337
|
let padding = parsePadding(paddingOrigin);
|
|
34662
34338
|
if (typeof padding === 'number' || typeof padding === 'string') {
|
|
34663
34339
|
padding = [padding, padding, padding, padding];
|
|
@@ -34929,7 +34605,7 @@
|
|
|
34929
34605
|
return +v === +v;
|
|
34930
34606
|
}
|
|
34931
34607
|
function isPercent(v) {
|
|
34932
|
-
if (!isString$
|
|
34608
|
+
if (!isString$2(v)) {
|
|
34933
34609
|
return false;
|
|
34934
34610
|
}
|
|
34935
34611
|
if (!v.endsWith('%')) {
|
|
@@ -35210,6 +34886,63 @@
|
|
|
35210
34886
|
}
|
|
35211
34887
|
return 0;
|
|
35212
34888
|
}
|
|
34889
|
+
function parseMarkLineGetExtendRange(markLine) {
|
|
34890
|
+
if (markLine) {
|
|
34891
|
+
if (Array.isArray(markLine)) {
|
|
34892
|
+
let extendRange;
|
|
34893
|
+
for (let i = 0; i < markLine.length; i++) {
|
|
34894
|
+
if (markLine[i].autoRange) {
|
|
34895
|
+
if (markLine[i].y === 'sum' ||
|
|
34896
|
+
markLine[i].x === 'sum' ||
|
|
34897
|
+
markLine[i].y1 === 'sum' ||
|
|
34898
|
+
markLine[i].x1 === 'sum') {
|
|
34899
|
+
return 'sum';
|
|
34900
|
+
}
|
|
34901
|
+
if (markLine[i].y === 'max' ||
|
|
34902
|
+
markLine[i].x === 'max' ||
|
|
34903
|
+
markLine[i].y1 === 'max' ||
|
|
34904
|
+
markLine[i].x1 === 'max') {
|
|
34905
|
+
extendRange = 'max';
|
|
34906
|
+
}
|
|
34907
|
+
if (typeof markLine[i].y === 'number' && typeof (extendRange ?? 0) === 'number') {
|
|
34908
|
+
extendRange = Math.max(extendRange ?? 0, markLine[i].y);
|
|
34909
|
+
}
|
|
34910
|
+
if (typeof markLine[i].x === 'number' && typeof (extendRange ?? 0) === 'number') {
|
|
34911
|
+
extendRange = Math.max(extendRange ?? 0, markLine[i].x);
|
|
34912
|
+
}
|
|
34913
|
+
if (typeof markLine[i].y1 === 'number' && typeof (extendRange ?? 0) === 'number') {
|
|
34914
|
+
extendRange = Math.max(extendRange ?? 0, markLine[i].y1);
|
|
34915
|
+
}
|
|
34916
|
+
if (typeof markLine[i].x1 === 'number' && typeof (extendRange ?? 0) === 'number') {
|
|
34917
|
+
extendRange = Math.max(extendRange ?? 0, markLine[i].x1);
|
|
34918
|
+
}
|
|
34919
|
+
}
|
|
34920
|
+
}
|
|
34921
|
+
return extendRange;
|
|
34922
|
+
}
|
|
34923
|
+
else if (markLine.autoRange) {
|
|
34924
|
+
if (markLine.y === 'sum' || markLine.x === 'sum' || markLine.y1 === 'sum' || markLine.x1 === 'sum') {
|
|
34925
|
+
return 'sum';
|
|
34926
|
+
}
|
|
34927
|
+
if (markLine.y === 'max' || markLine.x === 'max' || markLine.y1 === 'max' || markLine.x1 === 'max') {
|
|
34928
|
+
return 'max';
|
|
34929
|
+
}
|
|
34930
|
+
if (typeof markLine.y === 'number') {
|
|
34931
|
+
return markLine.y;
|
|
34932
|
+
}
|
|
34933
|
+
if (typeof markLine.x === 'number') {
|
|
34934
|
+
return markLine.x;
|
|
34935
|
+
}
|
|
34936
|
+
if (typeof markLine.y1 === 'number') {
|
|
34937
|
+
return markLine.y1;
|
|
34938
|
+
}
|
|
34939
|
+
if (typeof markLine.x1 === 'number') {
|
|
34940
|
+
return markLine.x1;
|
|
34941
|
+
}
|
|
34942
|
+
}
|
|
34943
|
+
}
|
|
34944
|
+
return undefined;
|
|
34945
|
+
}
|
|
35213
34946
|
|
|
35214
34947
|
let Icon$1 = class Icon extends Image$2 {
|
|
35215
34948
|
role;
|
|
@@ -35464,47 +35197,47 @@
|
|
|
35464
35197
|
const originalElement = originalElements[i];
|
|
35465
35198
|
const element = Object.assign({}, originalElement);
|
|
35466
35199
|
for (const name in element) {
|
|
35467
|
-
if (element.hasOwnProperty(name) && isFunction$
|
|
35200
|
+
if (element.hasOwnProperty(name) && isFunction$1(element[name])) {
|
|
35468
35201
|
element[name] = element[name](value);
|
|
35469
35202
|
}
|
|
35470
35203
|
}
|
|
35471
35204
|
const rect = element;
|
|
35472
35205
|
if (isValid$3(rect.x)) {
|
|
35473
|
-
rect.x = isString$
|
|
35206
|
+
rect.x = isString$2(rect.x)
|
|
35474
35207
|
? transformString(rect.x, width - borderLineWidths[1])
|
|
35475
35208
|
: Number(rect.x);
|
|
35476
35209
|
}
|
|
35477
35210
|
if (isValid$3(rect.y)) {
|
|
35478
|
-
rect.y = isString$
|
|
35211
|
+
rect.y = isString$2(rect.y)
|
|
35479
35212
|
? transformString(rect.y, height - borderLineWidths[2])
|
|
35480
35213
|
: Number(rect.y);
|
|
35481
35214
|
}
|
|
35482
35215
|
if ('width' in element) {
|
|
35483
|
-
element.width = isString$
|
|
35216
|
+
element.width = isString$2(element.width)
|
|
35484
35217
|
? transformString(element.width, width - borderLineWidths[1])
|
|
35485
35218
|
: Number(element.width);
|
|
35486
35219
|
}
|
|
35487
35220
|
if ('height' in element) {
|
|
35488
|
-
element.height = isString$
|
|
35221
|
+
element.height = isString$2(element.height)
|
|
35489
35222
|
? transformString(element.height, height - borderLineWidths[2])
|
|
35490
35223
|
: Number(element.height);
|
|
35491
35224
|
}
|
|
35492
35225
|
if ('radius' in element) {
|
|
35493
|
-
element.radius = isString$
|
|
35226
|
+
element.radius = isString$2(element.radius)
|
|
35494
35227
|
? transformString(element.radius, Math.min(width - borderLineWidths[1], height - borderLineWidths[2]))
|
|
35495
35228
|
: Number(element.radius);
|
|
35496
35229
|
}
|
|
35497
35230
|
if ('hover' in element) {
|
|
35498
|
-
element.hover.x = isString$
|
|
35231
|
+
element.hover.x = isString$2(element.hover.x)
|
|
35499
35232
|
? transformString(element.hover.x, width - borderLineWidths[1])
|
|
35500
35233
|
: Number(element.hover.x);
|
|
35501
|
-
element.hover.y = isString$
|
|
35234
|
+
element.hover.y = isString$2(element.hover.y)
|
|
35502
35235
|
? transformString(element.hover.y, height - borderLineWidths[2])
|
|
35503
35236
|
: Number(element.hover.y);
|
|
35504
|
-
element.hover.width = isString$
|
|
35237
|
+
element.hover.width = isString$2(element.hover.width)
|
|
35505
35238
|
? transformString(element.hover.width, width - borderLineWidths[1])
|
|
35506
35239
|
: Number(element.hover.width);
|
|
35507
|
-
element.hover.height = isString$
|
|
35240
|
+
element.hover.height = isString$2(element.hover.height)
|
|
35508
35241
|
? transformString(element.hover.height, height - borderLineWidths[2])
|
|
35509
35242
|
: Number(element.hover.height);
|
|
35510
35243
|
element.hover.x += left;
|
|
@@ -36278,7 +36011,7 @@
|
|
|
36278
36011
|
strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
|
|
36279
36012
|
cursor: cellTheme?.group?.cursor ?? undefined,
|
|
36280
36013
|
lineDash: cellTheme?.group?.lineDash ?? undefined,
|
|
36281
|
-
lineCap: '
|
|
36014
|
+
lineCap: 'butt',
|
|
36282
36015
|
clip: true,
|
|
36283
36016
|
cornerRadius: cellTheme.group.cornerRadius
|
|
36284
36017
|
});
|
|
@@ -36578,7 +36311,7 @@
|
|
|
36578
36311
|
const barPaddingLeft = Math.max(barPadding[3], Math.ceil(borderWidth[3] / 2));
|
|
36579
36312
|
contentWidth -= barPaddingRight + barPaddingLeft;
|
|
36580
36313
|
contentHeight -= barPaddingBottom + barPaddingTop;
|
|
36581
|
-
if (row === table.rowCount - 1) {
|
|
36314
|
+
if (row === table.rowCount - 1 && [0, '0'].includes(barBottom)) {
|
|
36582
36315
|
contentHeight -= 1;
|
|
36583
36316
|
}
|
|
36584
36317
|
const top = barPaddingTop;
|
|
@@ -36623,8 +36356,11 @@
|
|
|
36623
36356
|
: (num - progressBarDefine.min) / (progressBarDefine.max - progressBarDefine.min);
|
|
36624
36357
|
const barMaxWidth = contentWidth;
|
|
36625
36358
|
const barTop = top + contentHeight - barHeight - barBottom;
|
|
36626
|
-
|
|
36359
|
+
let barSize = Math.min(barMaxWidth * percentile, barMaxWidth);
|
|
36627
36360
|
const barLeft = barRightToLeft ? left + right - barSize : left;
|
|
36361
|
+
if (col === table.colCount - 1 && percentile === 1) {
|
|
36362
|
+
barSize -= 1;
|
|
36363
|
+
}
|
|
36628
36364
|
const bgFillColor = getOrApply(barBgColor, {
|
|
36629
36365
|
col,
|
|
36630
36366
|
row,
|
|
@@ -36723,7 +36459,10 @@
|
|
|
36723
36459
|
fill: barNagiFillColor
|
|
36724
36460
|
});
|
|
36725
36461
|
percentCompleteBarGroup.addChild(barNega);
|
|
36726
|
-
|
|
36462
|
+
let barSizePosi = Math.min(barMaxWidth * positiveFactor * positiveRate, barMaxWidth);
|
|
36463
|
+
if (col === table.colCount - 1 && positiveRate === 1) {
|
|
36464
|
+
barSizePosi -= 1;
|
|
36465
|
+
}
|
|
36727
36466
|
const barRectPosi = barRightToLeft
|
|
36728
36467
|
? {
|
|
36729
36468
|
left: barLeft + positiveLeft - barSizePosi,
|
|
@@ -36846,7 +36585,10 @@
|
|
|
36846
36585
|
const range = Math.max(_negativeRange, _positiveRange);
|
|
36847
36586
|
const percentile = range === 0 ? 0 : Math.abs(num) / range;
|
|
36848
36587
|
const barMaxWidth = contentWidth;
|
|
36849
|
-
|
|
36588
|
+
let barSize = Math.min(barMaxWidth * percentile, barMaxWidth);
|
|
36589
|
+
if (col === table.colCount - 1 && percentile === 1) {
|
|
36590
|
+
barSize -= 1;
|
|
36591
|
+
}
|
|
36850
36592
|
const barTop = top + contentHeight - barHeight - barBottom;
|
|
36851
36593
|
const barLeft = barRightToLeft ? left + right - barSize : left;
|
|
36852
36594
|
const bgFillColor = getOrApply(barBgColor, {
|
|
@@ -36983,7 +36725,7 @@
|
|
|
36983
36725
|
strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
|
|
36984
36726
|
cursor: cellTheme?.group?.cursor ?? undefined,
|
|
36985
36727
|
lineDash: cellTheme?.group?.lineDash ?? undefined,
|
|
36986
|
-
lineCap: '
|
|
36728
|
+
lineCap: 'butt',
|
|
36987
36729
|
clip: true,
|
|
36988
36730
|
cornerRadius: cellTheme.group.cornerRadius
|
|
36989
36731
|
});
|
|
@@ -37310,7 +37052,7 @@
|
|
|
37310
37052
|
}
|
|
37311
37053
|
function getTableBounds(col, row, table) {
|
|
37312
37054
|
const { layoutMap } = table.internalProps;
|
|
37313
|
-
const bodyBound = new Bounds
|
|
37055
|
+
const bodyBound = new Bounds();
|
|
37314
37056
|
const tableBound = table.scenegraph.tableGroup.globalAABBBounds;
|
|
37315
37057
|
bodyBound.x1 = tableBound.x1;
|
|
37316
37058
|
bodyBound.x2 = tableBound.x2;
|
|
@@ -37367,7 +37109,7 @@
|
|
|
37367
37109
|
strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
|
|
37368
37110
|
cursor: cellTheme?.group?.cursor ?? undefined,
|
|
37369
37111
|
lineDash: cellTheme?.group?.lineDash ?? undefined,
|
|
37370
|
-
lineCap: '
|
|
37112
|
+
lineCap: 'butt',
|
|
37371
37113
|
clip: true,
|
|
37372
37114
|
cornerRadius: cellTheme.group.cornerRadius
|
|
37373
37115
|
});
|
|
@@ -37576,8 +37318,12 @@
|
|
|
37576
37318
|
const layoutMap = table.internalProps.layoutMap;
|
|
37577
37319
|
if (layoutMap.isHeader(col, row)) {
|
|
37578
37320
|
const hd = layoutMap.getHeader(col, row);
|
|
37579
|
-
if (hd?.hierarchyLevel) {
|
|
37321
|
+
if (isValid$3(hd?.hierarchyLevel)) {
|
|
37580
37322
|
cellHierarchyIndent = (hd.hierarchyLevel ?? 0) * (layoutMap.rowHierarchyIndent ?? 0);
|
|
37323
|
+
if (layoutMap.rowHierarchyTextStartAlignment &&
|
|
37324
|
+
!table.internalProps.headerHelper.getHierarchyIcon(col, row)) {
|
|
37325
|
+
cellHierarchyIndent += table.internalProps.headerHelper.getHierarchyIconWidth();
|
|
37326
|
+
}
|
|
37581
37327
|
}
|
|
37582
37328
|
}
|
|
37583
37329
|
else {
|
|
@@ -37588,6 +37334,10 @@
|
|
|
37588
37334
|
Array.isArray(indexArr) && table.getHierarchyState(col, row) !== HierarchyState.none
|
|
37589
37335
|
? (indexArr.length - 1) * (layoutMap.hierarchyIndent ?? 0)
|
|
37590
37336
|
: 0;
|
|
37337
|
+
if (layoutMap.hierarchyTextStartAlignment &&
|
|
37338
|
+
!table.internalProps.bodyHelper.getHierarchyIcon(col, row)) {
|
|
37339
|
+
cellHierarchyIndent += table.internalProps.bodyHelper.getHierarchyIconWidth();
|
|
37340
|
+
}
|
|
37591
37341
|
}
|
|
37592
37342
|
}
|
|
37593
37343
|
return cellHierarchyIndent;
|
|
@@ -38108,7 +37858,7 @@
|
|
|
38108
37858
|
if (cellTheme?.text?.textBaseline) {
|
|
38109
37859
|
textBaseline = cellTheme?.text?.textBaseline;
|
|
38110
37860
|
}
|
|
38111
|
-
const autoRowHeight = table.
|
|
37861
|
+
const autoRowHeight = table.isAutoRowHeight(row);
|
|
38112
37862
|
const autoColWidth = colWidth === 'auto';
|
|
38113
37863
|
const autoWrapText = headerStyle.autoWrapText ?? table.internalProps.autoWrapText;
|
|
38114
37864
|
const lineClamp = headerStyle.lineClamp;
|
|
@@ -38125,7 +37875,7 @@
|
|
|
38125
37875
|
strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
|
|
38126
37876
|
cursor: cellTheme?.group?.cursor ?? undefined,
|
|
38127
37877
|
lineDash: cellTheme?.group?.lineDash ?? undefined,
|
|
38128
|
-
lineCap: '
|
|
37878
|
+
lineCap: 'butt',
|
|
38129
37879
|
clip: true,
|
|
38130
37880
|
cornerRadius: cellTheme.group.cornerRadius
|
|
38131
37881
|
});
|
|
@@ -38198,7 +37948,7 @@
|
|
|
38198
37948
|
strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
|
|
38199
37949
|
cursor: cellTheme?.group?.cursor ?? undefined,
|
|
38200
37950
|
lineDash: cellTheme?.group?.lineDash ?? undefined,
|
|
38201
|
-
lineCap: '
|
|
37951
|
+
lineCap: 'butt',
|
|
38202
37952
|
clip: true,
|
|
38203
37953
|
cornerRadius: cellTheme.group.cornerRadius
|
|
38204
37954
|
});
|
|
@@ -38300,7 +38050,7 @@
|
|
|
38300
38050
|
strokeArrayColor: cellTheme?.group?.strokeArrayColor ?? undefined,
|
|
38301
38051
|
cursor: cellTheme?.group?.cursor ?? undefined,
|
|
38302
38052
|
lineDash: cellTheme?.group?.lineDash ?? undefined,
|
|
38303
|
-
lineCap: '
|
|
38053
|
+
lineCap: 'butt',
|
|
38304
38054
|
clip: true,
|
|
38305
38055
|
cornerRadius: cellTheme.group.cornerRadius
|
|
38306
38056
|
});
|
|
@@ -38389,7 +38139,7 @@
|
|
|
38389
38139
|
dataValue
|
|
38390
38140
|
});
|
|
38391
38141
|
const autoColWidth = colWidth === 'auto';
|
|
38392
|
-
const autoRowHeight = table.
|
|
38142
|
+
const autoRowHeight = table.isAutoRowHeight(row);
|
|
38393
38143
|
const attribute = {
|
|
38394
38144
|
text: text.length === 1 ? text[0] : text,
|
|
38395
38145
|
maxLineWidth: autoColWidth
|
|
@@ -38490,7 +38240,7 @@
|
|
|
38490
38240
|
customLayout = define?.customLayout;
|
|
38491
38241
|
}
|
|
38492
38242
|
if (customLayout || customRender) {
|
|
38493
|
-
const customResult = dealWithCustom(customLayout, customRender, col, row, cellWidth, cellHeight, false, table.
|
|
38243
|
+
const customResult = dealWithCustom(customLayout, customRender, col, row, cellWidth, cellHeight, false, table.isAutoRowHeight(row), padding, table);
|
|
38494
38244
|
customElementsGroup = customResult.elementsGroup;
|
|
38495
38245
|
renderDefault = customResult.renderDefault;
|
|
38496
38246
|
}
|
|
@@ -38568,7 +38318,7 @@
|
|
|
38568
38318
|
cellTheme.group.cornerRadius = getCellCornerRadius(col, row, table);
|
|
38569
38319
|
}
|
|
38570
38320
|
if (customLayout || customRender) {
|
|
38571
|
-
customResult = dealWithCustom(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.
|
|
38321
|
+
customResult = dealWithCustom(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.isAutoRowHeight(row), [0, 0, 0, 0], table);
|
|
38572
38322
|
}
|
|
38573
38323
|
}
|
|
38574
38324
|
}
|
|
@@ -38721,7 +38471,7 @@
|
|
|
38721
38471
|
const define = table.getBodyColumnDefine(col, row);
|
|
38722
38472
|
const mayHaveIcon = !!define?.icon || !!define?.tree || define?.dragOrder;
|
|
38723
38473
|
const cellType = table.getBodyColumnType(col, row);
|
|
38724
|
-
const autoRowHeight = table.
|
|
38474
|
+
const autoRowHeight = table.isAutoRowHeight(row);
|
|
38725
38475
|
const value = table.getCellValue(col, row);
|
|
38726
38476
|
if (!table.isHeader(col, row) &&
|
|
38727
38477
|
oldCellGroup.role === 'cell' &&
|
|
@@ -38740,10 +38490,10 @@
|
|
|
38740
38490
|
for (let row = range.start.row; row <= range.end.row; row++) {
|
|
38741
38491
|
const cellGroup = table.scenegraph.getCell(col, row, true);
|
|
38742
38492
|
if (cellGroup.role === 'cell' && range.start.row !== range.end.row && cellGroup.contentWidth !== cellWidth) {
|
|
38743
|
-
updateCellContentHeight(cellGroup, cellHeight, cellHeight, table.
|
|
38493
|
+
updateCellContentHeight(cellGroup, cellHeight, cellHeight, table.isAutoRowHeight(row), padding, textAlign, textBaseline);
|
|
38744
38494
|
}
|
|
38745
38495
|
if (cellGroup.role === 'cell' && range.start.col !== range.end.col && cellGroup.contentHeight !== cellHeight) {
|
|
38746
|
-
updateCellContentWidth(cellGroup, cellWidth, cellHeight, 0, table.
|
|
38496
|
+
updateCellContentWidth(cellGroup, cellWidth, cellHeight, 0, table.isAutoRowHeight(row), padding, textAlign, textBaseline, table.scenegraph);
|
|
38747
38497
|
}
|
|
38748
38498
|
cellGroup.contentWidth = cellWidth;
|
|
38749
38499
|
cellGroup.contentHeight = cellHeight;
|
|
@@ -38818,7 +38568,7 @@
|
|
|
38818
38568
|
if (customMerge) {
|
|
38819
38569
|
const { range: customMergeRange, text: customMergeText, style: customMergeStyle, customLayout: customMergeLayout, customRender: customMergeRender } = customMerge;
|
|
38820
38570
|
if (customMergeLayout || customMergeRender) {
|
|
38821
|
-
const customResult = dealWithCustom(customMergeLayout, customMergeRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.
|
|
38571
|
+
const customResult = dealWithCustom(customMergeLayout, customMergeRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.isAutoRowHeight(row), [0, 0, 0, 0], table);
|
|
38822
38572
|
const customElementsGroup = customResult.elementsGroup;
|
|
38823
38573
|
if (cellGroup.childrenCount > 0 && customElementsGroup) {
|
|
38824
38574
|
cellGroup.insertBefore(customElementsGroup, cellGroup.firstChild);
|
|
@@ -38888,7 +38638,7 @@
|
|
|
38888
38638
|
scale.domain([min, max], !!axisOption?.nice);
|
|
38889
38639
|
if (axisOption?.nice) {
|
|
38890
38640
|
let tickCount = axisOption.tick?.forceTickCount ?? axisOption.tick?.tickCount ?? 10;
|
|
38891
|
-
if (isFunction$
|
|
38641
|
+
if (isFunction$1(tickCount)) {
|
|
38892
38642
|
tickCount = tickCount({
|
|
38893
38643
|
axisLength,
|
|
38894
38644
|
labelStyle: axisOption?.label?.style ?? {
|
|
@@ -39236,12 +38986,12 @@
|
|
|
39236
38986
|
const data = layout.dataset.collectedValues[rowDimensionKey] ?? [];
|
|
39237
38987
|
const rowPath = layout.getRowKeysPath(col, row);
|
|
39238
38988
|
const domain = data[rowPath ?? ''] ?? [];
|
|
39239
|
-
const { axisOption,
|
|
38989
|
+
const { axisOption, theme, chartType } = getAxisOption(col + 1, row, 'left', layout);
|
|
39240
38990
|
if (axisOption?.visible === false) {
|
|
39241
38991
|
return;
|
|
39242
38992
|
}
|
|
39243
38993
|
return merge({
|
|
39244
|
-
domain: Array.from(domain).reverse(),
|
|
38994
|
+
domain: chartType === 'common' ? Array.from(domain) : Array.from(domain).reverse(),
|
|
39245
38995
|
title: {
|
|
39246
38996
|
autoRotate: true
|
|
39247
38997
|
}
|
|
@@ -39400,7 +39150,8 @@
|
|
|
39400
39150
|
isPercent: spec.percent,
|
|
39401
39151
|
isZeroAlign: checkZeroAlign(spec, orient, layout),
|
|
39402
39152
|
seriesIndice,
|
|
39403
|
-
theme: spec.theme
|
|
39153
|
+
theme: spec.theme,
|
|
39154
|
+
chartType: spec.type
|
|
39404
39155
|
};
|
|
39405
39156
|
}
|
|
39406
39157
|
}
|
|
@@ -39411,7 +39162,8 @@
|
|
|
39411
39162
|
axisOption,
|
|
39412
39163
|
isPercent: false,
|
|
39413
39164
|
isZeroAlign: checkZeroAlign(spec, orient, layout),
|
|
39414
|
-
theme: spec.theme
|
|
39165
|
+
theme: spec.theme,
|
|
39166
|
+
chartType: spec.type
|
|
39415
39167
|
};
|
|
39416
39168
|
}
|
|
39417
39169
|
function checkZeroAlign(spec, orient, layout) {
|
|
@@ -39491,7 +39243,7 @@
|
|
|
39491
39243
|
return range;
|
|
39492
39244
|
}
|
|
39493
39245
|
function getRange$1(position, colForAxisOption, rowForAxisOption, colForIndicatorKey, rowForIndicatorKey, col, row, defaultSeriesIndice, layout) {
|
|
39494
|
-
const { axisOption, isPercent, isZeroAlign, seriesIndice, theme } = getAxisOption(colForAxisOption, rowForAxisOption, position, layout);
|
|
39246
|
+
const { axisOption, isPercent, isZeroAlign, seriesIndice, theme, chartType } = getAxisOption(colForAxisOption, rowForAxisOption, position, layout);
|
|
39495
39247
|
if (axisOption?.visible === false) {
|
|
39496
39248
|
return undefined;
|
|
39497
39249
|
}
|
|
@@ -39531,7 +39283,8 @@
|
|
|
39531
39283
|
isZeroAlign,
|
|
39532
39284
|
range,
|
|
39533
39285
|
ticks,
|
|
39534
|
-
theme
|
|
39286
|
+
theme,
|
|
39287
|
+
chartType
|
|
39535
39288
|
};
|
|
39536
39289
|
}
|
|
39537
39290
|
function isTopOrBottomAxis(col, row, layout) {
|
|
@@ -40506,7 +40259,7 @@
|
|
|
40506
40259
|
width = scene.table.getColsWidth(cell.mergeStartCol, cell.mergeEndCol);
|
|
40507
40260
|
height = scene.table.getRowsHeight(cell.mergeStartRow, cell.mergeEndRow);
|
|
40508
40261
|
}
|
|
40509
|
-
const customResult = dealWithCustom(customLayout, customRender, col, row, width, height, false, scene.table.
|
|
40262
|
+
const customResult = dealWithCustom(customLayout, customRender, col, row, width, height, false, scene.table.isAutoRowHeight(row), padding, scene.table);
|
|
40510
40263
|
customElementsGroup = customResult.elementsGroup;
|
|
40511
40264
|
renderDefault = customResult.renderDefault;
|
|
40512
40265
|
}
|
|
@@ -40518,7 +40271,7 @@
|
|
|
40518
40271
|
}
|
|
40519
40272
|
}
|
|
40520
40273
|
}
|
|
40521
|
-
updateMergeCellContentHeight(cell, distHeight, detaY, scene.table.
|
|
40274
|
+
updateMergeCellContentHeight(cell, distHeight, detaY, scene.table.isAutoRowHeight(row), renderDefault, scene.table);
|
|
40522
40275
|
}
|
|
40523
40276
|
}
|
|
40524
40277
|
function updateMergeCellContentHeight(cellGroup, distHeight, detaY, autoRowHeight, renderDefault, table) {
|
|
@@ -40570,30 +40323,29 @@
|
|
|
40570
40323
|
if (!skipTableWidthMap) {
|
|
40571
40324
|
scene.table._setColWidth(col, scene.table.getColWidth(col) + detaX, true);
|
|
40572
40325
|
}
|
|
40573
|
-
const autoRowHeight = scene.table.heightMode === 'autoHeight';
|
|
40574
40326
|
const colOrCornerHeaderColumn = scene.getColGroup(col, true);
|
|
40575
40327
|
const rightTopColumn = scene.getColGroupInRightTopCorner(col);
|
|
40576
40328
|
if (colOrCornerHeaderColumn && !rightTopColumn) {
|
|
40577
|
-
updateColunmWidth(colOrCornerHeaderColumn, detaX,
|
|
40329
|
+
updateColunmWidth(colOrCornerHeaderColumn, detaX, 'col-corner', scene);
|
|
40578
40330
|
}
|
|
40579
40331
|
if (rightTopColumn) {
|
|
40580
|
-
updateColunmWidth(rightTopColumn, detaX,
|
|
40332
|
+
updateColunmWidth(rightTopColumn, detaX, 'right-top', scene);
|
|
40581
40333
|
}
|
|
40582
40334
|
const rowHeaderOrBodyColumn = scene.getColGroup(col);
|
|
40583
40335
|
if (rowHeaderOrBodyColumn) {
|
|
40584
|
-
updateColunmWidth(rowHeaderOrBodyColumn, detaX,
|
|
40336
|
+
updateColunmWidth(rowHeaderOrBodyColumn, detaX, 'row-body', scene);
|
|
40585
40337
|
}
|
|
40586
40338
|
const leftBottomColumn = scene.getColGroupInLeftBottomCorner(col);
|
|
40587
40339
|
if (leftBottomColumn) {
|
|
40588
|
-
updateColunmWidth(leftBottomColumn, detaX,
|
|
40340
|
+
updateColunmWidth(leftBottomColumn, detaX, 'left-bottom', scene);
|
|
40589
40341
|
}
|
|
40590
40342
|
const bottomColumn = scene.getColGroupInBottom(col);
|
|
40591
40343
|
if (bottomColumn) {
|
|
40592
|
-
updateColunmWidth(bottomColumn, detaX,
|
|
40344
|
+
updateColunmWidth(bottomColumn, detaX, 'bottom', scene);
|
|
40593
40345
|
}
|
|
40594
40346
|
const rightBottomColumn = scene.getColGroupInRightBottomCorner(col);
|
|
40595
40347
|
if (rightBottomColumn) {
|
|
40596
|
-
updateColunmWidth(rightBottomColumn, detaX,
|
|
40348
|
+
updateColunmWidth(rightBottomColumn, detaX, 'right-bottom', scene);
|
|
40597
40349
|
}
|
|
40598
40350
|
if (col < scene.frozenColCount) {
|
|
40599
40351
|
scene.cornerHeaderGroup.forEachChildrenSkipChild((column, index) => {
|
|
@@ -40641,12 +40393,12 @@
|
|
|
40641
40393
|
});
|
|
40642
40394
|
}
|
|
40643
40395
|
}
|
|
40644
|
-
function updateColunmWidth(columnGroup, detaX,
|
|
40396
|
+
function updateColunmWidth(columnGroup, detaX, mode, scene) {
|
|
40645
40397
|
let needRerangeRow = false;
|
|
40646
40398
|
const oldColumnWidth = columnGroup?.attribute.width ?? 0;
|
|
40647
40399
|
columnGroup?.setAttribute('width', oldColumnWidth + detaX);
|
|
40648
40400
|
columnGroup?.forEachChildren((cell, index) => {
|
|
40649
|
-
const isHeightChange = updateCellWidth(scene, cell, cell.col, cell.row, oldColumnWidth, oldColumnWidth + detaX, detaX, mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true,
|
|
40401
|
+
const isHeightChange = updateCellWidth(scene, cell, cell.col, cell.row, oldColumnWidth, oldColumnWidth + detaX, detaX, mode === 'row-body' ? cell.col < scene.table.rowHeaderLevelCount : true, scene.table.internalProps.autoWrapText);
|
|
40650
40402
|
if (isHeightChange) {
|
|
40651
40403
|
const mergeInfo = getCellMergeInfo(scene.table, cell.col, cell.row);
|
|
40652
40404
|
if (mergeInfo && mergeInfo.end.row - mergeInfo.start.row) {
|
|
@@ -40733,7 +40485,7 @@
|
|
|
40733
40485
|
}
|
|
40734
40486
|
}
|
|
40735
40487
|
}
|
|
40736
|
-
function updateCellWidth(scene, cell, col, row, oldWidth, distWidth, detaX, isHeader,
|
|
40488
|
+
function updateCellWidth(scene, cell, col, row, oldWidth, distWidth, detaX, isHeader, autoWrapText) {
|
|
40737
40489
|
if (cell.attribute.width === distWidth && !cell.needUpdateWidth) {
|
|
40738
40490
|
return false;
|
|
40739
40491
|
}
|
|
@@ -40743,6 +40495,7 @@
|
|
|
40743
40495
|
if (!cellGroup) {
|
|
40744
40496
|
return false;
|
|
40745
40497
|
}
|
|
40498
|
+
const autoRowHeight = scene.table.isAutoRowHeight(row);
|
|
40746
40499
|
const type = scene.table.isHeader(col, row)
|
|
40747
40500
|
? scene.table._getHeaderLayoutMap(col, row).headerType
|
|
40748
40501
|
: scene.table.getBodyColumnType(col, row);
|
|
@@ -40813,7 +40566,7 @@
|
|
|
40813
40566
|
width = scene.table.getColsWidth(cellGroup.mergeStartCol, cellGroup.mergeEndCol);
|
|
40814
40567
|
height = scene.table.getRowsHeight(cellGroup.mergeStartRow, cellGroup.mergeEndRow);
|
|
40815
40568
|
}
|
|
40816
|
-
const customResult = dealWithCustom(customLayout, customRender, col, row, width, height, false, scene.table.
|
|
40569
|
+
const customResult = dealWithCustom(customLayout, customRender, col, row, width, height, false, scene.table.isAutoRowHeight(row), padding, scene.table);
|
|
40817
40570
|
customElementsGroup = customResult.elementsGroup;
|
|
40818
40571
|
renderDefault = customResult.renderDefault;
|
|
40819
40572
|
isHeightChange = true;
|
|
@@ -41891,7 +41644,7 @@
|
|
|
41891
41644
|
rectAttributes.stroke = getStroke(borderColor, strokeArray);
|
|
41892
41645
|
rectAttributes.lineWidth = borderLineWidth;
|
|
41893
41646
|
borderLineDash && (rectAttributes.lineDash = borderLineDash);
|
|
41894
|
-
rectAttributes.lineCap = '
|
|
41647
|
+
rectAttributes.lineCap = 'butt';
|
|
41895
41648
|
}
|
|
41896
41649
|
if (Array.isArray(borderColor)) {
|
|
41897
41650
|
rectAttributes.strokeArrayColor = getQuadProps(borderColor);
|
|
@@ -42238,7 +41991,7 @@
|
|
|
42238
41991
|
const endY = startY + cacheCanvasSizeLimit > viewHeight ? viewHeight : startY + cacheCanvasSizeLimit;
|
|
42239
41992
|
const width = endX - startX;
|
|
42240
41993
|
const height = endY - startY;
|
|
42241
|
-
const bounds = new Bounds
|
|
41994
|
+
const bounds = new Bounds();
|
|
42242
41995
|
bounds.setValue(startX, startY, endX, endY);
|
|
42243
41996
|
const canvas = stage.toCanvas(false, bounds);
|
|
42244
41997
|
cacheCanvas.push({
|
|
@@ -43209,13 +42962,13 @@
|
|
|
43209
42962
|
}
|
|
43210
42963
|
});
|
|
43211
42964
|
const initTextMeasure = (textSpec, option, useNaiveCanvas) => {
|
|
43212
|
-
return new TextMeasure
|
|
42965
|
+
return new TextMeasure({
|
|
43213
42966
|
defaultFontParams: {
|
|
43214
42967
|
fontFamily: DefaultTextStyle.fontFamily,
|
|
43215
42968
|
fontSize: DefaultTextStyle.fontSize
|
|
43216
42969
|
},
|
|
43217
42970
|
getTextBounds: useNaiveCanvas ? undefined : getTextBounds$1,
|
|
43218
|
-
specialCharSet: `{}()//&-/: .,@%'"~…=${TextMeasure
|
|
42971
|
+
specialCharSet: `{}()//&-/: .,@%'"~…=${TextMeasure.ALPHABET_CHAR_SET}${TextMeasure.ALPHABET_CHAR_SET.toUpperCase()}0123456789${customAlphabetCharSet}`,
|
|
43219
42972
|
...(option ?? {})
|
|
43220
42973
|
}, textSpec);
|
|
43221
42974
|
};
|
|
@@ -43359,7 +43112,7 @@
|
|
|
43359
43112
|
if (!isEmpty) {
|
|
43360
43113
|
return;
|
|
43361
43114
|
}
|
|
43362
|
-
const textStr = isString$
|
|
43115
|
+
const textStr = isString$2(ellipsis) ? ellipsis : '...';
|
|
43363
43116
|
const lineHeight = calculateLineHeight(text.attribute.lineHeight, fontSize) ?? fontSize;
|
|
43364
43117
|
let dy = 0;
|
|
43365
43118
|
if (lineHeight !== fontSize) {
|
|
@@ -43923,7 +43676,7 @@
|
|
|
43923
43676
|
value = customMergeText;
|
|
43924
43677
|
customStyle = customMergeStyle;
|
|
43925
43678
|
if (customLayout || customRender) {
|
|
43926
|
-
customResult = dealWithCustom(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.
|
|
43679
|
+
customResult = dealWithCustom(customLayout, customRender, customMergeRange.start.col, customMergeRange.start.row, table.getColsWidth(customMergeRange.start.col, customMergeRange.end.col), table.getRowsHeight(customMergeRange.start.row, customMergeRange.end.row), false, table.isAutoRowHeight(row), [0, 0, 0, 0], table);
|
|
43927
43680
|
}
|
|
43928
43681
|
}
|
|
43929
43682
|
}
|
|
@@ -44444,14 +44197,18 @@
|
|
|
44444
44197
|
else if (part) {
|
|
44445
44198
|
const baseCellGroup = table.scenegraph.highPerformanceGetCell(col, rowEnd + 1, true);
|
|
44446
44199
|
y = baseCellGroup.attribute.y;
|
|
44447
|
-
|
|
44448
|
-
|
|
44200
|
+
if (isValid$3(y)) {
|
|
44201
|
+
for (let r = rowStart; r <= rowEnd; r++) {
|
|
44202
|
+
y -= table.getRowHeight(r);
|
|
44203
|
+
}
|
|
44449
44204
|
}
|
|
44450
44205
|
}
|
|
44451
44206
|
else {
|
|
44452
44207
|
y = table.getRowsHeight(table.columnHeaderLevelCount, cellGroup.row - 1);
|
|
44453
44208
|
}
|
|
44454
|
-
|
|
44209
|
+
if (isValid$3(y)) {
|
|
44210
|
+
cellGroup.setAttribute('y', y);
|
|
44211
|
+
}
|
|
44455
44212
|
}
|
|
44456
44213
|
}
|
|
44457
44214
|
}
|
|
@@ -45927,6 +45684,24 @@
|
|
|
45927
45684
|
const removeRows = deduplication$1(removeCells.map(cell => cell.row)).sort((a, b) => b - a);
|
|
45928
45685
|
const addRows = deduplication$1(addCells.map(cell => cell.row)).sort((a, b) => a - b);
|
|
45929
45686
|
const updateRows = deduplication$1(updateCells.map(cell => cell.row)).sort((a, b) => a - b);
|
|
45687
|
+
let rowUpdatePos;
|
|
45688
|
+
if (updateRows.length) {
|
|
45689
|
+
const beforeRow = updateRows[0] - 1;
|
|
45690
|
+
const afterRow = updateRows[updateRows.length - 1] + 1;
|
|
45691
|
+
rowUpdatePos = _getUpdateRowIndexUseCellNode(beforeRow, afterRow, scene);
|
|
45692
|
+
}
|
|
45693
|
+
if (addRows.length) {
|
|
45694
|
+
const beforeRow = addRows[0] - 1;
|
|
45695
|
+
const afterRow = addRows[addRows.length - 1] + 1;
|
|
45696
|
+
const pos = _getUpdateRowIndexUseCellNode(beforeRow, afterRow, scene);
|
|
45697
|
+
rowUpdatePos = isValid$3(rowUpdatePos) ? (isValid$3(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos) : pos;
|
|
45698
|
+
}
|
|
45699
|
+
if (removeRows.length) {
|
|
45700
|
+
const beforeRow = removeRows[0] - 1;
|
|
45701
|
+
const afterRow = removeRows[removeRows.length - 1] + 1;
|
|
45702
|
+
const pos = _getUpdateRowIndexUseCellNode(beforeRow, afterRow, scene);
|
|
45703
|
+
rowUpdatePos = isValid$3(rowUpdatePos) ? (isValid$3(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos) : pos;
|
|
45704
|
+
}
|
|
45930
45705
|
removeRows.forEach(row => {
|
|
45931
45706
|
removeRow(row, scene);
|
|
45932
45707
|
});
|
|
@@ -45938,8 +45713,8 @@
|
|
|
45938
45713
|
resetRowNumber(scene);
|
|
45939
45714
|
const beforeRow = removeRows[removeRows.length - 1] - 1;
|
|
45940
45715
|
const afterRow = removeRows[0] - removeRows.length + 1;
|
|
45941
|
-
const
|
|
45942
|
-
|
|
45716
|
+
const pos = _getUpdateRowIndex(beforeRow, afterRow, scene);
|
|
45717
|
+
rowUpdatePos = isValid$3(rowUpdatePos) ? (isValid$3(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos) : pos;
|
|
45943
45718
|
}
|
|
45944
45719
|
scene.table._clearRowRangeHeightsMap();
|
|
45945
45720
|
let updateAfter;
|
|
@@ -45952,8 +45727,8 @@
|
|
|
45952
45727
|
if (addRows.length) {
|
|
45953
45728
|
const beforeRow = addRows[0] - 1;
|
|
45954
45729
|
const afterRow = addRows[addRows.length - 1] + 1;
|
|
45955
|
-
const
|
|
45956
|
-
|
|
45730
|
+
const pos = _getUpdateRowIndex(beforeRow, afterRow, scene);
|
|
45731
|
+
rowUpdatePos = isValid$3(rowUpdatePos) ? (isValid$3(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos) : pos;
|
|
45957
45732
|
}
|
|
45958
45733
|
for (let col = 0; col < table.colCount; col++) {
|
|
45959
45734
|
updateRows.forEach(r => {
|
|
@@ -45973,8 +45748,8 @@
|
|
|
45973
45748
|
if (updateRows.length) {
|
|
45974
45749
|
const beforeRow = updateRows[0] - 1;
|
|
45975
45750
|
const afterRow = updateRows[updateRows.length - 1] + 1;
|
|
45976
|
-
const
|
|
45977
|
-
|
|
45751
|
+
const pos = _getUpdateRowIndex(beforeRow, afterRow, scene);
|
|
45752
|
+
rowUpdatePos = isValid$3(rowUpdatePos) ? (isValid$3(pos) ? Math.min(rowUpdatePos, pos) : rowUpdatePos) : pos;
|
|
45978
45753
|
}
|
|
45979
45754
|
if (isNumber$4(updateAfter)) {
|
|
45980
45755
|
for (let col = 0; col < table.colCount; col++) {
|
|
@@ -45983,8 +45758,13 @@
|
|
|
45983
45758
|
cellGroup && (cellGroup.needUpdate = true);
|
|
45984
45759
|
}
|
|
45985
45760
|
}
|
|
45986
|
-
|
|
45761
|
+
rowUpdatePos = isValid$3(rowUpdatePos)
|
|
45762
|
+
? isValid$3(updateAfter)
|
|
45763
|
+
? Math.min(rowUpdatePos, updateAfter)
|
|
45764
|
+
: rowUpdatePos
|
|
45765
|
+
: updateAfter;
|
|
45987
45766
|
}
|
|
45767
|
+
isNumber$4(rowUpdatePos) && (scene.proxy.rowUpdatePos = Math.min(scene.proxy.rowUpdatePos, rowUpdatePos));
|
|
45988
45768
|
if (addRows.length) {
|
|
45989
45769
|
if (!isNumber$4(updateAfter)) {
|
|
45990
45770
|
const minRow = Math.min(...addRows);
|
|
@@ -46246,23 +46026,65 @@
|
|
|
46246
46026
|
}
|
|
46247
46027
|
}
|
|
46248
46028
|
}
|
|
46249
|
-
function
|
|
46029
|
+
function _getUpdateRowIndex(beforeRow, afterRow, scene) {
|
|
46250
46030
|
let updateRow;
|
|
46251
46031
|
for (let col = 0; col < scene.table.colCount; col++) {
|
|
46252
46032
|
const rangeBefore = scene.table.getCellRange(col, beforeRow);
|
|
46033
|
+
let row;
|
|
46253
46034
|
if (rangeBefore.start.row <= beforeRow + 1 && rangeBefore.end.row >= beforeRow + 1) {
|
|
46254
|
-
|
|
46255
|
-
|
|
46035
|
+
addNeedUpdateTag(rangeBefore, scene);
|
|
46036
|
+
row = rangeBefore.start.row;
|
|
46256
46037
|
}
|
|
46257
46038
|
const rangeAfter = scene.table.getCellRange(col, afterRow);
|
|
46258
|
-
if (rangeAfter.start.row <= afterRow
|
|
46259
|
-
|
|
46260
|
-
|
|
46039
|
+
if (rangeAfter.start.row <= afterRow + 1 && rangeAfter.end.row >= afterRow + 1) {
|
|
46040
|
+
addNeedUpdateTag(rangeAfter, scene);
|
|
46041
|
+
row = rangeAfter.start.row;
|
|
46042
|
+
}
|
|
46043
|
+
if (isValid$3(row)) {
|
|
46044
|
+
updateRow = isValid$3(updateRow) ? Math.min(updateRow, row) : row;
|
|
46261
46045
|
}
|
|
46262
46046
|
}
|
|
46263
46047
|
return updateRow;
|
|
46264
46048
|
}
|
|
46265
|
-
function
|
|
46049
|
+
function _getUpdateRowIndexUseCellNode(beforeRow, afterRow, scene) {
|
|
46050
|
+
let updateRow;
|
|
46051
|
+
for (let col = 0; col < scene.table.colCount; col++) {
|
|
46052
|
+
let row;
|
|
46053
|
+
const beforeCell = scene.highPerformanceGetCell(col, beforeRow);
|
|
46054
|
+
if (beforeCell.mergeStartRow && beforeCell.mergeEndRow && beforeCell.mergeEndRow > beforeRow) {
|
|
46055
|
+
addNeedUpdateTag({
|
|
46056
|
+
start: {
|
|
46057
|
+
row: beforeCell.mergeStartRow,
|
|
46058
|
+
col: scene.table.heightMode === 'autoHeight' ? 0 : beforeCell.mergeStartCol
|
|
46059
|
+
},
|
|
46060
|
+
end: {
|
|
46061
|
+
row: beforeCell.mergeEndRow,
|
|
46062
|
+
col: scene.table.heightMode === 'autoHeight' ? scene.table.colCount - 1 : beforeCell.mergeEndCol
|
|
46063
|
+
}
|
|
46064
|
+
}, scene);
|
|
46065
|
+
row = beforeCell.mergeStartRow;
|
|
46066
|
+
}
|
|
46067
|
+
const afterCell = scene.highPerformanceGetCell(col, afterRow);
|
|
46068
|
+
if (afterCell.mergeStartRow && afterCell.mergeEndRow && afterCell.mergeStartRow < afterRow) {
|
|
46069
|
+
addNeedUpdateTag({
|
|
46070
|
+
start: {
|
|
46071
|
+
row: afterCell.mergeStartRow,
|
|
46072
|
+
col: scene.table.heightMode === 'autoHeight' ? 0 : afterCell.mergeStartCol
|
|
46073
|
+
},
|
|
46074
|
+
end: {
|
|
46075
|
+
row: afterCell.mergeEndRow,
|
|
46076
|
+
col: scene.table.heightMode === 'autoHeight' ? scene.table.colCount - 1 : afterCell.mergeEndCol
|
|
46077
|
+
}
|
|
46078
|
+
}, scene);
|
|
46079
|
+
row = afterCell.mergeStartRow;
|
|
46080
|
+
}
|
|
46081
|
+
if (isValid$3(row)) {
|
|
46082
|
+
updateRow = isValid$3(updateRow) ? Math.min(updateRow, row) : row;
|
|
46083
|
+
}
|
|
46084
|
+
}
|
|
46085
|
+
return updateRow;
|
|
46086
|
+
}
|
|
46087
|
+
function addNeedUpdateTag(range, scene) {
|
|
46266
46088
|
const { start, end } = range;
|
|
46267
46089
|
for (let col = start.col; col <= end.col; col++) {
|
|
46268
46090
|
for (let row = start.row; row <= end.row; row++) {
|
|
@@ -47345,7 +47167,7 @@
|
|
|
47345
47167
|
rectAttributes.stroke = getStroke(borderColor, undefined);
|
|
47346
47168
|
rectAttributes.lineWidth = borderLineWidth;
|
|
47347
47169
|
borderLineDash && (rectAttributes.lineDash = borderLineDash);
|
|
47348
|
-
rectAttributes.lineCap = '
|
|
47170
|
+
rectAttributes.lineCap = 'butt';
|
|
47349
47171
|
if (Array.isArray(borderColor)) {
|
|
47350
47172
|
rectAttributes.strokeArrayColor = getQuadProps(borderColor);
|
|
47351
47173
|
}
|
|
@@ -48711,12 +48533,13 @@
|
|
|
48711
48533
|
}
|
|
48712
48534
|
createFrameBorder() {
|
|
48713
48535
|
this.updateTableSize();
|
|
48714
|
-
const isListTableWithFrozen = !this.isPivot;
|
|
48536
|
+
const isListTableWithFrozen = !this.isPivot && !this.table.internalProps.transpose;
|
|
48715
48537
|
createFrameBorder(this.bodyGroup, this.table.theme.bodyStyle.frameStyle, this.bodyGroup.role, isListTableWithFrozen ? [true, true, true, false] : undefined);
|
|
48716
48538
|
createFrameBorder(this.rowHeaderGroup, this.isPivot
|
|
48717
48539
|
? this.table.theme.rowHeaderStyle.frameStyle
|
|
48718
|
-
:
|
|
48719
|
-
this.table.theme.
|
|
48540
|
+
: this.table.internalProps.transpose
|
|
48541
|
+
? this.table.theme.rowHeaderStyle.frameStyle
|
|
48542
|
+
: this.table.theme.bodyStyle.frameStyle, this.rowHeaderGroup.role, isListTableWithFrozen ? [true, false, true, true] : undefined);
|
|
48720
48543
|
createFrameBorder(this.colHeaderGroup, this.table.theme.headerStyle.frameStyle, this.colHeaderGroup.role, isListTableWithFrozen ? [true, true, true, false] : undefined);
|
|
48721
48544
|
createFrameBorder(this.cornerHeaderGroup, this.isPivot ? this.table.theme.cornerHeaderStyle.frameStyle : this.table.theme.headerStyle.frameStyle, this.cornerHeaderGroup.role, isListTableWithFrozen ? [true, false, true, true] : undefined);
|
|
48722
48545
|
createFrameBorder(this.tableGroup, this.table.theme.frameStyle, this.tableGroup.role, undefined);
|
|
@@ -48817,7 +48640,7 @@
|
|
|
48817
48640
|
? text.attribute.text.join('')
|
|
48818
48641
|
: text.attribute.text;
|
|
48819
48642
|
let cacheStr = '';
|
|
48820
|
-
if (isString$
|
|
48643
|
+
if (isString$2(text.cache.clipedText)) {
|
|
48821
48644
|
cacheStr = text.cache.clipedText;
|
|
48822
48645
|
}
|
|
48823
48646
|
else {
|
|
@@ -48856,6 +48679,7 @@
|
|
|
48856
48679
|
this.stage.enableDirtyBounds();
|
|
48857
48680
|
}
|
|
48858
48681
|
updateRow(removeCells, addCells, updateCells = []) {
|
|
48682
|
+
this.table.internalProps.layoutMap.clearCellRangeMap();
|
|
48859
48683
|
const addRows = deduplication$1(addCells.map(cell => cell.row)).sort((a, b) => a - b);
|
|
48860
48684
|
const updateRows = deduplication$1(updateCells.map(cell => cell.row)).sort((a, b) => a - b);
|
|
48861
48685
|
const isNotFillHeight = this.table.getAllRowsHeight() -
|
|
@@ -50052,7 +49876,7 @@
|
|
|
50052
49876
|
y: -1,
|
|
50053
49877
|
isShow: false,
|
|
50054
49878
|
itemList: [],
|
|
50055
|
-
bounds: new Bounds
|
|
49879
|
+
bounds: new Bounds(),
|
|
50056
49880
|
highlightIndex: -1,
|
|
50057
49881
|
dropDownMenuHighlight: []
|
|
50058
49882
|
};
|
|
@@ -50124,7 +49948,7 @@
|
|
|
50124
49948
|
y: -1,
|
|
50125
49949
|
isShow: false,
|
|
50126
49950
|
itemList: [],
|
|
50127
|
-
bounds: new Bounds
|
|
49951
|
+
bounds: new Bounds(),
|
|
50128
49952
|
highlightIndex: -1,
|
|
50129
49953
|
dropDownMenuHighlight: []
|
|
50130
49954
|
};
|
|
@@ -50242,7 +50066,7 @@
|
|
|
50242
50066
|
return checkMultiCellInSelect(cellPosStart, cellPosEnd, this.select.ranges, this.select.highlightScope);
|
|
50243
50067
|
}
|
|
50244
50068
|
updateHoverIcon(col, row, target, cellGroup, event) {
|
|
50245
|
-
if (target === this.residentHoverIcon?.icon) {
|
|
50069
|
+
if (this.residentHoverIcon?.icon && target === this.residentHoverIcon?.icon) {
|
|
50246
50070
|
return;
|
|
50247
50071
|
}
|
|
50248
50072
|
const iconInfo = getIconAndPositionFromTarget(target);
|
|
@@ -50272,7 +50096,7 @@
|
|
|
50272
50096
|
rect: iconInfo.position,
|
|
50273
50097
|
placement: inlineIcon.attribute.tooltip.placement
|
|
50274
50098
|
},
|
|
50275
|
-
style: Object.assign({}, this.table.internalProps.theme?.tooltipStyle, inlineIcon.tooltip?.style)
|
|
50099
|
+
style: Object.assign({}, this.table.internalProps.theme?.tooltipStyle, inlineIcon.tooltip?.style, inlineIcon.attribute?.tooltip?.style)
|
|
50276
50100
|
};
|
|
50277
50101
|
if (!this.table.internalProps.tooltipHandler.isBinded(tooltipOptions)) {
|
|
50278
50102
|
this.table.showTooltip(col, row, tooltipOptions);
|
|
@@ -50303,19 +50127,21 @@
|
|
|
50303
50127
|
return this.select.selecting;
|
|
50304
50128
|
}
|
|
50305
50129
|
endSelectCells(fireListener = true) {
|
|
50306
|
-
this.select.selecting
|
|
50307
|
-
|
|
50308
|
-
|
|
50130
|
+
if (this.select.selecting) {
|
|
50131
|
+
this.select.selecting = false;
|
|
50132
|
+
if (this.select.ranges.length === 0) {
|
|
50133
|
+
return;
|
|
50134
|
+
}
|
|
50135
|
+
selectEnd(this.table.scenegraph);
|
|
50136
|
+
const lastCol = this.select.ranges[this.select.ranges.length - 1].end.col;
|
|
50137
|
+
const lastRow = this.select.ranges[this.select.ranges.length - 1].end.row;
|
|
50138
|
+
fireListener &&
|
|
50139
|
+
this.table.fireListeners(TABLE_EVENT_TYPE.SELECTED_CELL, {
|
|
50140
|
+
ranges: this.select.ranges,
|
|
50141
|
+
col: lastCol,
|
|
50142
|
+
row: lastRow
|
|
50143
|
+
});
|
|
50309
50144
|
}
|
|
50310
|
-
selectEnd(this.table.scenegraph);
|
|
50311
|
-
const lastCol = this.select.ranges[this.select.ranges.length - 1].end.col;
|
|
50312
|
-
const lastRow = this.select.ranges[this.select.ranges.length - 1].end.row;
|
|
50313
|
-
fireListener &&
|
|
50314
|
-
this.table.fireListeners(TABLE_EVENT_TYPE.SELECTED_CELL, {
|
|
50315
|
-
ranges: this.select.ranges,
|
|
50316
|
-
col: lastCol,
|
|
50317
|
-
row: lastRow
|
|
50318
|
-
});
|
|
50319
50145
|
}
|
|
50320
50146
|
endResizeCol() {
|
|
50321
50147
|
setTimeout(() => {
|
|
@@ -50704,7 +50530,7 @@
|
|
|
50704
50530
|
if (isObject$4(item) && (item.menuKey || item.text) === (menuKey || '') && i === index) {
|
|
50705
50531
|
return true;
|
|
50706
50532
|
}
|
|
50707
|
-
else if (isString$
|
|
50533
|
+
else if (isString$2(item) && item === menuKey && i === index) {
|
|
50708
50534
|
return true;
|
|
50709
50535
|
}
|
|
50710
50536
|
}
|
|
@@ -51174,7 +51000,7 @@
|
|
|
51174
51000
|
}
|
|
51175
51001
|
return;
|
|
51176
51002
|
}
|
|
51177
|
-
else if (table.eventManager.isDraging) {
|
|
51003
|
+
else if (table.eventManager.isDraging && stateManager.isSelecting()) {
|
|
51178
51004
|
eventManager.dealTableSelect(eventArgsSet, true);
|
|
51179
51005
|
}
|
|
51180
51006
|
if (stateManager.isResizeCol() || eventManager.checkColumnResize(eventArgsSet)) {
|
|
@@ -51293,11 +51119,21 @@
|
|
|
51293
51119
|
}
|
|
51294
51120
|
}
|
|
51295
51121
|
});
|
|
51122
|
+
table.scenegraph.tableGroup.addEventListener('pointerenter', (e) => {
|
|
51123
|
+
if (table.theme.scrollStyle.visible === 'focus') {
|
|
51124
|
+
stateManager.showHorizontalScrollBar();
|
|
51125
|
+
stateManager.showVerticalScrollBar();
|
|
51126
|
+
}
|
|
51127
|
+
});
|
|
51296
51128
|
table.scenegraph.tableGroup.addEventListener('pointerleave', (e) => {
|
|
51297
51129
|
if (!stateManager.isResizeCol() && !stateManager.isMoveCol() && !stateManager.isSelecting()) {
|
|
51298
51130
|
stateManager.updateInteractionState(InteractionState.default);
|
|
51299
51131
|
stateManager.updateCursor();
|
|
51300
51132
|
}
|
|
51133
|
+
if (table.theme.scrollStyle.visible === 'focus') {
|
|
51134
|
+
stateManager.hideHorizontalScrollBar();
|
|
51135
|
+
stateManager.hideVerticalScrollBar();
|
|
51136
|
+
}
|
|
51301
51137
|
if (table.hasListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL)) {
|
|
51302
51138
|
if (table.stateManager.hover.cellPos.col !== -1 && table.stateManager.hover.cellPos.row !== -1) {
|
|
51303
51139
|
table.fireListeners(TABLE_EVENT_TYPE.MOUSELEAVE_CELL, {
|
|
@@ -51618,7 +51454,7 @@
|
|
|
51618
51454
|
stateManager.updateCursor();
|
|
51619
51455
|
table.scenegraph.updateChartState(null);
|
|
51620
51456
|
}
|
|
51621
|
-
else if (table.eventManager.isDraging) {
|
|
51457
|
+
else if (table.eventManager.isDraging && stateManager.isSelecting()) {
|
|
51622
51458
|
stateManager.endSelectCells();
|
|
51623
51459
|
}
|
|
51624
51460
|
});
|
|
@@ -52369,7 +52205,7 @@
|
|
|
52369
52205
|
}
|
|
52370
52206
|
}
|
|
52371
52207
|
const isSelecting = table.stateManager.isSelecting();
|
|
52372
|
-
if (eventManager.isDraging && isSelecting) {
|
|
52208
|
+
if (eventManager.isDraging && isSelecting && table.stateManager.select.ranges?.length > 0) {
|
|
52373
52209
|
const drawRange = table.getDrawRange();
|
|
52374
52210
|
const topFrozenRowHeight = table.getFrozenRowsHeight();
|
|
52375
52211
|
const bottomFrozenRowHeight = table.getBottomFrozenRowsHeight();
|
|
@@ -53323,6 +53159,9 @@
|
|
|
53323
53159
|
}
|
|
53324
53160
|
return undefined;
|
|
53325
53161
|
}
|
|
53162
|
+
getHierarchyIconWidth() {
|
|
53163
|
+
return this.expandIcon.width + this.expandIcon.marginLeft + this.expandIcon.marginRight;
|
|
53164
|
+
}
|
|
53326
53165
|
}
|
|
53327
53166
|
|
|
53328
53167
|
function createElement(tagName, classNames) {
|
|
@@ -54204,6 +54043,9 @@
|
|
|
54204
54043
|
}
|
|
54205
54044
|
return undefined;
|
|
54206
54045
|
}
|
|
54046
|
+
getHierarchyIconWidth() {
|
|
54047
|
+
return this.expandIcon.width + this.expandIcon.marginLeft + this.expandIcon.marginRight;
|
|
54048
|
+
}
|
|
54207
54049
|
checkDropDownIcon(_table, col, row) {
|
|
54208
54050
|
if (_table.isPivotTable()) {
|
|
54209
54051
|
const headerC = _table._getHeaderLayoutMap(col, row);
|
|
@@ -56250,7 +56092,7 @@
|
|
|
56250
56092
|
return TABLE_EVENT_TYPE;
|
|
56251
56093
|
}
|
|
56252
56094
|
options;
|
|
56253
|
-
version = "0.23.
|
|
56095
|
+
version = "0.23.2";
|
|
56254
56096
|
pagination;
|
|
56255
56097
|
id = `VTable${Date.now()}`;
|
|
56256
56098
|
headerStyleCache;
|
|
@@ -56803,6 +56645,15 @@
|
|
|
56803
56645
|
const width = this.getColWidthDefined(col);
|
|
56804
56646
|
return this._adjustColWidth(col, this._colWidthDefineToPxWidth(width));
|
|
56805
56647
|
}
|
|
56648
|
+
isAutoRowHeight(row) {
|
|
56649
|
+
if (this.heightMode === 'autoHeight') {
|
|
56650
|
+
return true;
|
|
56651
|
+
}
|
|
56652
|
+
else if (row >= 0 && row < this.columnHeaderLevelCount) {
|
|
56653
|
+
return this.getDefaultRowHeight(row) === 'auto';
|
|
56654
|
+
}
|
|
56655
|
+
return false;
|
|
56656
|
+
}
|
|
56806
56657
|
getColWidth(col) {
|
|
56807
56658
|
const width = this.colWidthsMap.get(col) ?? this.getDefaultColumnWidth(col);
|
|
56808
56659
|
if ((this.widthMode === 'adaptive' && typeof width === 'number') ||
|
|
@@ -57373,6 +57224,7 @@
|
|
|
57373
57224
|
if (Env.mode !== 'node') {
|
|
57374
57225
|
updateRootElementPadding(internalProps.element, this.padding);
|
|
57375
57226
|
}
|
|
57227
|
+
this.columnWidthComputeMode = options.columnWidthComputeMode ?? 'normal';
|
|
57376
57228
|
internalProps.frozenColCount = frozenColCount;
|
|
57377
57229
|
internalProps.defaultRowHeight = defaultRowHeight;
|
|
57378
57230
|
internalProps.defaultHeaderRowHeight = defaultHeaderRowHeight ?? defaultRowHeight;
|
|
@@ -57442,6 +57294,7 @@
|
|
|
57442
57294
|
this.clearCellStyleCache();
|
|
57443
57295
|
this.clearColWidthCache();
|
|
57444
57296
|
this.clearRowHeightCache();
|
|
57297
|
+
this.customCellStylePlugin = new CustomCellStylePlugin(this, options.customCellStyle ?? [], options.customCellStyleArrangement ?? []);
|
|
57445
57298
|
}
|
|
57446
57299
|
renderWithRecreateCells() {
|
|
57447
57300
|
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
@@ -58125,7 +57978,7 @@
|
|
|
58125
57978
|
if (bgColorFunc) {
|
|
58126
57979
|
cacheStyle = mergeStyle(cacheStyle, { bgColor: bgColorFunc });
|
|
58127
57980
|
}
|
|
58128
|
-
if (!isFunction$
|
|
57981
|
+
if (!isFunction$1(style)) {
|
|
58129
57982
|
if (layoutMap.isBottomFrozenRow(row)) {
|
|
58130
57983
|
this.bodyBottomStyleCache.set(cacheKey, cacheStyle);
|
|
58131
57984
|
}
|
|
@@ -58625,7 +58478,7 @@
|
|
|
58625
58478
|
const { col: hoverCol, row: hoverRow } = this.stateManager.hover.cellPos;
|
|
58626
58479
|
this.stateManager.updateHoverPos(-1, -1);
|
|
58627
58480
|
this.scenegraph.renderSceneGraph();
|
|
58628
|
-
const c = this.scenegraph.stage.toCanvas(false, new AABBBounds
|
|
58481
|
+
const c = this.scenegraph.stage.toCanvas(false, new AABBBounds().set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX, cellRect.bottom + this.tableY));
|
|
58629
58482
|
if (!isInView) {
|
|
58630
58483
|
this.setScrollTop(scrollTop);
|
|
58631
58484
|
this.setScrollLeft(scrollLeft);
|
|
@@ -58651,7 +58504,7 @@
|
|
|
58651
58504
|
start: { col: minCol, row: minRow },
|
|
58652
58505
|
end: { col: maxCol, row: maxRow }
|
|
58653
58506
|
});
|
|
58654
|
-
const c = this.scenegraph.stage.toCanvas(false, new AABBBounds
|
|
58507
|
+
const c = this.scenegraph.stage.toCanvas(false, new AABBBounds().set(cellRect.left + this.tableX + 1, cellRect.top + this.tableY + 1, cellRect.right + this.tableX, cellRect.bottom + this.tableY));
|
|
58655
58508
|
const base64Image = c.toDataURL();
|
|
58656
58509
|
if (!isInView || !isMaxCellInView) {
|
|
58657
58510
|
this.setScrollTop(scrollTop);
|
|
@@ -58677,7 +58530,7 @@
|
|
|
58677
58530
|
const buffer = stage.window.getImageBuffer(type);
|
|
58678
58531
|
return buffer;
|
|
58679
58532
|
}
|
|
58680
|
-
const newCanvas = this.scenegraph.stage.toCanvas(false, new AABBBounds
|
|
58533
|
+
const newCanvas = this.scenegraph.stage.toCanvas(false, new AABBBounds().set(0, 0, Math.min(this.canvasWidth, contentWidth), Math.min(this.canvasHeight, contentHeight)));
|
|
58681
58534
|
const buffer = newCanvas.toBuffer(type);
|
|
58682
58535
|
return buffer;
|
|
58683
58536
|
}
|
|
@@ -59677,6 +59530,7 @@
|
|
|
59677
59530
|
columnTree;
|
|
59678
59531
|
bodyRowSpanCount = 1;
|
|
59679
59532
|
hierarchyIndent;
|
|
59533
|
+
hierarchyTextStartAlignment;
|
|
59680
59534
|
_transpose = false;
|
|
59681
59535
|
_showHeader = true;
|
|
59682
59536
|
_recordsCount = 0;
|
|
@@ -59693,6 +59547,7 @@
|
|
|
59693
59547
|
this._columns = [];
|
|
59694
59548
|
this._headerCellIds = [];
|
|
59695
59549
|
this.hierarchyIndent = hierarchyIndent ?? 20;
|
|
59550
|
+
this.hierarchyTextStartAlignment = table.options.hierarchyTextStartAlignment;
|
|
59696
59551
|
this.columnTree = new DimensionTree(columns, { seqId: 0 });
|
|
59697
59552
|
this._headerObjects = this._addHeaders(0, columns, []);
|
|
59698
59553
|
this._headerObjectMap = this._headerObjects.reduce((o, e) => {
|
|
@@ -61216,9 +61071,9 @@
|
|
|
61216
61071
|
internalProps.sortState = options.sortState;
|
|
61217
61072
|
internalProps.dataConfig = {};
|
|
61218
61073
|
internalProps.columns = options.columns
|
|
61219
|
-
?
|
|
61074
|
+
? cloneDeepSpec(options.columns)
|
|
61220
61075
|
: options.header
|
|
61221
|
-
?
|
|
61076
|
+
? cloneDeepSpec(options.header)
|
|
61222
61077
|
: [];
|
|
61223
61078
|
options.columns?.forEach((colDefine, index) => {
|
|
61224
61079
|
if (colDefine.editor) {
|
|
@@ -61268,7 +61123,7 @@
|
|
|
61268
61123
|
}
|
|
61269
61124
|
updateColumns(columns) {
|
|
61270
61125
|
const oldHoverState = { col: this.stateManager.hover.cellPos.col, row: this.stateManager.hover.cellPos.row };
|
|
61271
|
-
this.internalProps.columns =
|
|
61126
|
+
this.internalProps.columns = cloneDeepSpec(columns);
|
|
61272
61127
|
columns.forEach((colDefine, index) => {
|
|
61273
61128
|
if (colDefine.editor) {
|
|
61274
61129
|
this.internalProps.columns[index].editor = colDefine.editor;
|
|
@@ -61454,9 +61309,9 @@
|
|
|
61454
61309
|
internalProps.dataConfig = {};
|
|
61455
61310
|
this.showHeader = options.showHeader ?? true;
|
|
61456
61311
|
internalProps.columns = options.columns
|
|
61457
|
-
?
|
|
61312
|
+
? cloneDeepSpec(options.columns)
|
|
61458
61313
|
: options.header
|
|
61459
|
-
?
|
|
61314
|
+
? cloneDeepSpec(options.header)
|
|
61460
61315
|
: [];
|
|
61461
61316
|
options.columns.forEach((colDefine, index) => {
|
|
61462
61317
|
if (colDefine.editor) {
|
|
@@ -61703,6 +61558,7 @@
|
|
|
61703
61558
|
return this.dataSource.getHierarchyState(index);
|
|
61704
61559
|
}
|
|
61705
61560
|
toggleHierarchyState(col, row) {
|
|
61561
|
+
this.stateManager.updateHoverIcon(col, row, undefined, undefined);
|
|
61706
61562
|
const hierarchyState = this.getHierarchyState(col, row);
|
|
61707
61563
|
if (hierarchyState === HierarchyState.expand) {
|
|
61708
61564
|
this._refreshHierarchyState(col, row);
|
|
@@ -62551,6 +62407,7 @@
|
|
|
62551
62407
|
rowHierarchyType;
|
|
62552
62408
|
rowExpandLevel;
|
|
62553
62409
|
rowHierarchyIndent;
|
|
62410
|
+
rowHierarchyTextStartAlignment = false;
|
|
62554
62411
|
rowDimensionKeys = [];
|
|
62555
62412
|
colDimensionKeys = [];
|
|
62556
62413
|
indicatorKeys = [];
|
|
@@ -62604,6 +62461,7 @@
|
|
|
62604
62461
|
this.rowHierarchyType = table.options.rowHierarchyType ?? 'grid';
|
|
62605
62462
|
this.rowExpandLevel = table.options.rowExpandLevel ?? 1;
|
|
62606
62463
|
this.rowHierarchyIndent = table.options.rowHierarchyIndent ?? 20;
|
|
62464
|
+
this.rowHierarchyTextStartAlignment = table.options.rowHierarchyTextStartAlignment;
|
|
62607
62465
|
this.cornerSetting = table.options.corner ?? { titleOnDimension: 'column' };
|
|
62608
62466
|
if (dataset) {
|
|
62609
62467
|
this.rowTree = dataset.rowHeaderTree;
|
|
@@ -65229,9 +65087,24 @@
|
|
|
65229
65087
|
for (const field in this.collectedValues) {
|
|
65230
65088
|
if (this.collectValuesBy[field]?.sumBy) {
|
|
65231
65089
|
for (const byKeys in this.collectedValues[field]) {
|
|
65232
|
-
|
|
65233
|
-
|
|
65234
|
-
|
|
65090
|
+
let max;
|
|
65091
|
+
if (this.collectValuesBy[field]?.extendRange === 'sum') {
|
|
65092
|
+
max = Object.values(this.collectedValues[field][byKeys]).reduce((acc, cur) => {
|
|
65093
|
+
return acc + cur.value();
|
|
65094
|
+
}, 0);
|
|
65095
|
+
max += Math.round(max / 20);
|
|
65096
|
+
}
|
|
65097
|
+
else {
|
|
65098
|
+
max = Object.values(this.collectedValues[field][byKeys]).reduce((acc, cur) => {
|
|
65099
|
+
return cur.value() > acc ? cur.value() : acc;
|
|
65100
|
+
}, Number.MIN_SAFE_INTEGER);
|
|
65101
|
+
if (this.collectValuesBy[field]?.extendRange === 'max') {
|
|
65102
|
+
max += Math.round(max / 20);
|
|
65103
|
+
}
|
|
65104
|
+
else if (typeof this.collectValuesBy[field]?.extendRange === 'number') {
|
|
65105
|
+
max = Math.max(max, this.collectValuesBy[field]?.extendRange);
|
|
65106
|
+
}
|
|
65107
|
+
}
|
|
65235
65108
|
const min = Object.values(this.collectedValues[field][byKeys]).reduce((acc, cur) => {
|
|
65236
65109
|
return cur.value() < acc ? cur.value() : acc;
|
|
65237
65110
|
}, Number.MAX_SAFE_INTEGER);
|
|
@@ -66161,7 +66034,7 @@
|
|
|
66161
66034
|
}
|
|
66162
66035
|
this.internalProps.columns = cloneDeep(options.columns);
|
|
66163
66036
|
this.internalProps.rows = cloneDeep(options.rows);
|
|
66164
|
-
this.internalProps.indicators =
|
|
66037
|
+
this.internalProps.indicators = cloneDeepSpec(options.indicators);
|
|
66165
66038
|
options.indicators?.forEach((indicatorDefine, index) => {
|
|
66166
66039
|
if (typeof indicatorDefine === 'object' && indicatorDefine?.editor) {
|
|
66167
66040
|
this.internalProps.indicators[index].editor = indicatorDefine.editor;
|
|
@@ -66278,7 +66151,7 @@
|
|
|
66278
66151
|
super.updateOption(options);
|
|
66279
66152
|
this.internalProps.columns = cloneDeep(options.columns);
|
|
66280
66153
|
this.internalProps.rows = cloneDeep(options.rows);
|
|
66281
|
-
this.internalProps.indicators = !options.indicators?.length ? [] :
|
|
66154
|
+
this.internalProps.indicators = !options.indicators?.length ? [] : cloneDeepSpec(options.indicators);
|
|
66282
66155
|
options.indicators?.forEach((indicatorDefine, index) => {
|
|
66283
66156
|
if (typeof indicatorDefine === 'object' && indicatorDefine?.editor) {
|
|
66284
66157
|
this.internalProps.indicators[index].editor = indicatorDefine.editor;
|
|
@@ -66743,6 +66616,7 @@
|
|
|
66743
66616
|
toggleHierarchyState(col, row) {
|
|
66744
66617
|
let notFillWidth = false;
|
|
66745
66618
|
let notFillHeight = false;
|
|
66619
|
+
this.stateManager.updateHoverIcon(col, row, undefined, undefined);
|
|
66746
66620
|
const checkHasChart = this.internalProps.layoutMap.checkHasChart();
|
|
66747
66621
|
if (checkHasChart) {
|
|
66748
66622
|
if (this.autoFillWidth) {
|
|
@@ -67115,7 +66989,7 @@
|
|
|
67115
66989
|
}
|
|
67116
66990
|
this.internalProps.columns = cloneDeep(options.columns);
|
|
67117
66991
|
this.internalProps.rows = cloneDeep(options.rows);
|
|
67118
|
-
this.internalProps.indicators =
|
|
66992
|
+
this.internalProps.indicators = cloneDeepSpec(options.indicators);
|
|
67119
66993
|
this.internalProps.columnTree =
|
|
67120
66994
|
options.indicatorsAsCol && !options.columns?.length && !options.columnTree ? [] : cloneDeep(options.columnTree);
|
|
67121
66995
|
this.internalProps.rowTree =
|
|
@@ -67202,7 +67076,7 @@
|
|
|
67202
67076
|
super.updateOption(options);
|
|
67203
67077
|
this.internalProps.columns = cloneDeep(options.columns);
|
|
67204
67078
|
this.internalProps.rows = cloneDeep(options.rows);
|
|
67205
|
-
this.internalProps.indicators = !options.indicators?.length ? [] :
|
|
67079
|
+
this.internalProps.indicators = !options.indicators?.length ? [] : cloneDeepSpec(options.indicators);
|
|
67206
67080
|
this.internalProps.columnTree =
|
|
67207
67081
|
options.indicatorsAsCol && !options.columns?.length && !options.columnTree ? [] : cloneDeep(options.columnTree);
|
|
67208
67082
|
this.internalProps.rowTree =
|
|
@@ -67565,28 +67439,26 @@
|
|
|
67565
67439
|
if (indicators[i].chartSpec?.type === 'pie') {
|
|
67566
67440
|
continue;
|
|
67567
67441
|
}
|
|
67442
|
+
const indicatorDefine = indicators[i];
|
|
67443
|
+
const indicatorSpec = indicatorDefine.chartSpec;
|
|
67568
67444
|
if (this.options.indicatorsAsCol === false) {
|
|
67569
|
-
|
|
67570
|
-
|
|
67571
|
-
(
|
|
67572
|
-
indicatorDefine.chartSpec?.type === 'area') &&
|
|
67573
|
-
(indicatorDefine.chartSpec.stack = true);
|
|
67445
|
+
indicatorSpec?.stack !== false &&
|
|
67446
|
+
(indicatorSpec?.type === 'bar' || indicatorSpec?.type === 'area') &&
|
|
67447
|
+
(indicatorSpec.stack = true);
|
|
67574
67448
|
collectValuesBy[indicatorDefine.indicatorKey] = {
|
|
67575
67449
|
by: rowKeys,
|
|
67576
67450
|
range: true,
|
|
67577
|
-
sumBy:
|
|
67578
|
-
columnKeys.concat(indicatorDefine.chartSpec?.xField)
|
|
67451
|
+
sumBy: indicatorSpec?.stack && columnKeys.concat(indicatorSpec?.xField)
|
|
67579
67452
|
};
|
|
67580
|
-
if (
|
|
67581
|
-
|
|
67453
|
+
if (indicatorSpec.series) {
|
|
67454
|
+
indicatorSpec.series.forEach((chartSeries) => {
|
|
67582
67455
|
const xField = typeof chartSeries.xField === 'string' ? chartSeries.xField : chartSeries.xField[0];
|
|
67583
67456
|
collectValuesBy[xField] = {
|
|
67584
67457
|
by: columnKeys,
|
|
67585
67458
|
type: chartSeries.direction !== 'horizontal' ? 'xField' : undefined,
|
|
67586
67459
|
range: chartSeries.direction === 'horizontal',
|
|
67587
67460
|
sortBy: chartSeries.direction !== 'horizontal'
|
|
67588
|
-
? chartSeries?.data?.fields?.[xField]?.domain ??
|
|
67589
|
-
indicatorDefine.chartSpec?.data?.fields?.[xField]?.domain
|
|
67461
|
+
? chartSeries?.data?.fields?.[xField]?.domain ?? indicatorSpec?.data?.fields?.[xField]?.domain
|
|
67590
67462
|
: undefined
|
|
67591
67463
|
};
|
|
67592
67464
|
const yField = chartSeries.yField;
|
|
@@ -67598,62 +67470,52 @@
|
|
|
67598
67470
|
range: chartSeries.direction !== 'horizontal',
|
|
67599
67471
|
sumBy: chartSeries.stack && columnKeys.concat(chartSeries?.xField),
|
|
67600
67472
|
sortBy: chartSeries.direction === 'horizontal'
|
|
67601
|
-
? chartSeries?.data?.fields?.[yField]?.domain ??
|
|
67602
|
-
|
|
67603
|
-
|
|
67473
|
+
? chartSeries?.data?.fields?.[yField]?.domain ?? indicatorSpec?.data?.fields?.[yField]?.domain
|
|
67474
|
+
: undefined,
|
|
67475
|
+
extendRange: parseMarkLineGetExtendRange(indicatorSpec.markLine)
|
|
67604
67476
|
};
|
|
67605
67477
|
});
|
|
67606
67478
|
}
|
|
67607
67479
|
else {
|
|
67608
|
-
const xField = typeof
|
|
67609
|
-
? indicatorDefine.chartSpec.xField
|
|
67610
|
-
: indicatorDefine.chartSpec.xField[0];
|
|
67480
|
+
const xField = typeof indicatorSpec.xField === 'string' ? indicatorSpec.xField : indicatorSpec.xField[0];
|
|
67611
67481
|
collectValuesBy[xField] = {
|
|
67612
67482
|
by: columnKeys,
|
|
67613
|
-
type:
|
|
67614
|
-
range:
|
|
67615
|
-
sortBy:
|
|
67616
|
-
? indicatorDefine.chartSpec?.data?.fields?.[xField]?.domain
|
|
67617
|
-
: undefined
|
|
67483
|
+
type: indicatorSpec.direction !== 'horizontal' ? 'xField' : undefined,
|
|
67484
|
+
range: indicatorSpec.direction === 'horizontal',
|
|
67485
|
+
sortBy: indicatorSpec.direction !== 'horizontal' ? indicatorSpec?.data?.fields?.[xField]?.domain : undefined
|
|
67618
67486
|
};
|
|
67619
|
-
|
|
67620
|
-
(
|
|
67621
|
-
|
|
67622
|
-
|
|
67623
|
-
const yField = indicatorDefine.chartSpec.yField;
|
|
67487
|
+
indicatorSpec?.stack !== false &&
|
|
67488
|
+
(indicatorSpec?.type === 'bar' || indicatorSpec?.type === 'area') &&
|
|
67489
|
+
(indicatorSpec.stack = true);
|
|
67490
|
+
const yField = indicatorSpec.yField;
|
|
67624
67491
|
collectValuesBy[yField] = {
|
|
67625
67492
|
by: rowKeys,
|
|
67626
|
-
range:
|
|
67627
|
-
sumBy:
|
|
67628
|
-
|
|
67629
|
-
|
|
67630
|
-
? indicatorDefine.chartSpec?.data?.fields?.[yField]?.domain
|
|
67631
|
-
: undefined
|
|
67493
|
+
range: indicatorSpec.direction !== 'horizontal',
|
|
67494
|
+
sumBy: indicatorSpec.stack && columnKeys.concat(indicatorSpec?.xField),
|
|
67495
|
+
sortBy: indicatorSpec.direction === 'horizontal' ? indicatorSpec?.data?.fields?.[yField]?.domain : undefined,
|
|
67496
|
+
extendRange: parseMarkLineGetExtendRange(indicatorSpec.markLine)
|
|
67632
67497
|
};
|
|
67633
67498
|
}
|
|
67634
67499
|
}
|
|
67635
67500
|
else {
|
|
67636
67501
|
const indicatorDefine = indicators[i];
|
|
67637
|
-
|
|
67638
|
-
(
|
|
67639
|
-
|
|
67640
|
-
(indicatorDefine.chartSpec.stack = true);
|
|
67502
|
+
indicatorSpec?.stack !== false &&
|
|
67503
|
+
(indicatorSpec?.type === 'bar' || indicatorSpec?.type === 'area') &&
|
|
67504
|
+
(indicatorSpec.stack = true);
|
|
67641
67505
|
collectValuesBy[indicatorDefine.indicatorKey] = {
|
|
67642
67506
|
by: columnKeys,
|
|
67643
67507
|
range: true,
|
|
67644
|
-
sumBy:
|
|
67645
|
-
rowKeys.concat(indicatorDefine.chartSpec?.yField)
|
|
67508
|
+
sumBy: indicatorSpec?.stack && rowKeys.concat(indicatorSpec?.yField)
|
|
67646
67509
|
};
|
|
67647
|
-
if (
|
|
67648
|
-
|
|
67510
|
+
if (indicatorSpec.series) {
|
|
67511
|
+
indicatorSpec.series.forEach((chartSeries) => {
|
|
67649
67512
|
const yField = typeof chartSeries.yField === 'string' ? chartSeries.yField : chartSeries.yField[0];
|
|
67650
67513
|
collectValuesBy[yField] = {
|
|
67651
67514
|
by: rowKeys,
|
|
67652
67515
|
type: chartSeries.direction === 'horizontal' ? 'yField' : undefined,
|
|
67653
67516
|
range: chartSeries.direction !== 'horizontal',
|
|
67654
67517
|
sortBy: chartSeries.direction === 'horizontal'
|
|
67655
|
-
? chartSeries?.data?.fields?.[yField]?.domain ??
|
|
67656
|
-
indicatorDefine.chartSpec?.data?.fields?.[yField]?.domain
|
|
67518
|
+
? chartSeries?.data?.fields?.[yField]?.domain ?? indicatorSpec?.data?.fields?.[yField]?.domain
|
|
67657
67519
|
: undefined
|
|
67658
67520
|
};
|
|
67659
67521
|
const xField = chartSeries.xField;
|
|
@@ -67665,37 +67527,30 @@
|
|
|
67665
67527
|
range: chartSeries.direction === 'horizontal',
|
|
67666
67528
|
sumBy: chartSeries.stack && rowKeys.concat(chartSeries?.yField),
|
|
67667
67529
|
sortBy: chartSeries.direction !== 'horizontal'
|
|
67668
|
-
? chartSeries?.data?.fields?.[xField]?.domain ??
|
|
67669
|
-
|
|
67670
|
-
|
|
67530
|
+
? chartSeries?.data?.fields?.[xField]?.domain ?? indicatorSpec?.data?.fields?.[xField]?.domain
|
|
67531
|
+
: undefined,
|
|
67532
|
+
extendRange: parseMarkLineGetExtendRange(indicatorSpec.markLine)
|
|
67671
67533
|
};
|
|
67672
67534
|
});
|
|
67673
67535
|
}
|
|
67674
67536
|
else {
|
|
67675
|
-
const yField = typeof
|
|
67676
|
-
? indicatorDefine.chartSpec.yField
|
|
67677
|
-
: indicatorDefine.chartSpec.yField[0];
|
|
67537
|
+
const yField = typeof indicatorSpec.yField === 'string' ? indicatorSpec.yField : indicatorSpec.yField[0];
|
|
67678
67538
|
collectValuesBy[yField] = {
|
|
67679
67539
|
by: rowKeys,
|
|
67680
|
-
type:
|
|
67681
|
-
range:
|
|
67682
|
-
sortBy:
|
|
67683
|
-
? indicatorDefine.chartSpec?.data?.fields?.[yField]?.domain
|
|
67684
|
-
: undefined
|
|
67540
|
+
type: indicatorSpec.direction === 'horizontal' ? 'yField' : undefined,
|
|
67541
|
+
range: indicatorSpec.direction !== 'horizontal',
|
|
67542
|
+
sortBy: indicatorSpec.direction === 'horizontal' ? indicatorSpec?.data?.fields?.[yField]?.domain : undefined
|
|
67685
67543
|
};
|
|
67686
|
-
|
|
67687
|
-
(
|
|
67688
|
-
|
|
67689
|
-
|
|
67690
|
-
const xField = indicatorDefine.chartSpec.xField;
|
|
67544
|
+
indicatorSpec?.stack !== false &&
|
|
67545
|
+
(indicatorSpec?.type === 'bar' || indicatorSpec?.type === 'area') &&
|
|
67546
|
+
(indicatorSpec.stack = true);
|
|
67547
|
+
const xField = indicatorSpec.xField;
|
|
67691
67548
|
collectValuesBy[xField] = {
|
|
67692
67549
|
by: columnKeys,
|
|
67693
|
-
range:
|
|
67694
|
-
sumBy:
|
|
67695
|
-
|
|
67696
|
-
|
|
67697
|
-
? indicatorDefine.chartSpec?.data?.fields?.[xField]?.domain
|
|
67698
|
-
: undefined
|
|
67550
|
+
range: indicatorSpec.direction === 'horizontal',
|
|
67551
|
+
sumBy: indicatorSpec.stack && rowKeys.concat(indicatorSpec?.yField),
|
|
67552
|
+
sortBy: indicatorSpec.direction !== 'horizontal' ? indicatorSpec?.data?.fields?.[xField]?.domain : undefined,
|
|
67553
|
+
extendRange: parseMarkLineGetExtendRange(indicatorSpec.markLine)
|
|
67699
67554
|
};
|
|
67700
67555
|
}
|
|
67701
67556
|
}
|
|
@@ -68062,7 +67917,7 @@
|
|
|
68062
67917
|
cache;
|
|
68063
67918
|
constructor(options) {
|
|
68064
67919
|
let cache;
|
|
68065
|
-
if (isString$
|
|
67920
|
+
if (isString$2(options.iconName)) {
|
|
68066
67921
|
const regedIcons = get$2();
|
|
68067
67922
|
cache = regedIcons[options.iconName];
|
|
68068
67923
|
if (cache) {
|
|
@@ -68488,7 +68343,7 @@
|
|
|
68488
68343
|
}
|
|
68489
68344
|
|
|
68490
68345
|
registerForVrender();
|
|
68491
|
-
const version = "0.23.
|
|
68346
|
+
const version = "0.23.2";
|
|
68492
68347
|
function getIcons() {
|
|
68493
68348
|
return get$2();
|
|
68494
68349
|
}
|