@visactor/vseed 0.0.20 → 0.0.22
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/dist/builder/builder/advanced/colorItems.d.ts +1 -0
- package/dist/builder/builder/advanced/index.d.ts +1 -1
- package/dist/builder/builder/builder.d.ts +220 -118
- package/dist/index.cjs +595 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +558 -62
- package/dist/index.js.map +1 -1
- package/dist/pipeline/advanced/chart/pipes/analysis/index.d.ts +1 -0
- package/dist/pipeline/advanced/chart/pipes/analysis/sort.d.ts +4 -0
- package/dist/pipeline/advanced/chart/pipes/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/dataset/datasetPivot.d.ts +0 -1
- package/dist/pipeline/spec/chart/pipes/dataset/index.d.ts +1 -1
- package/dist/pipeline/spec/table/pipes/index.d.ts +1 -0
- package/dist/pipeline/spec/table/pipes/theme/bodyStyle.d.ts +2 -0
- package/dist/pipeline/spec/table/pipes/theme/cornerHeaderStyle.d.ts +2 -0
- package/dist/pipeline/spec/table/pipes/theme/frameStyle.d.ts +2 -0
- package/dist/pipeline/spec/table/pipes/theme/headerStyle.d.ts +2 -0
- package/dist/pipeline/spec/table/pipes/theme/index.d.ts +6 -0
- package/dist/pipeline/spec/table/pipes/theme/rowHeaderStyle.d.ts +2 -0
- package/dist/pipeline/spec/table/pipes/theme/scrollStyle.d.ts +2 -0
- package/dist/pipeline/spec/table/pipes/theme/selectionStyle.d.ts +2 -0
- package/dist/types/advancedVSeed.d.ts +58 -61
- package/dist/types/chartType/area/area.d.ts +32 -46
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +32 -46
- package/dist/types/chartType/bar/bar.d.ts +33 -46
- package/dist/types/chartType/barParallel/barParallel.d.ts +32 -46
- package/dist/types/chartType/barPercent/barPercent.d.ts +32 -46
- package/dist/types/chartType/column/column.d.ts +32 -46
- package/dist/types/chartType/columnParallel/columnParallel.d.ts +32 -46
- package/dist/types/chartType/columnPercent/columnPercent.d.ts +32 -46
- package/dist/types/chartType/donut/donut.d.ts +8 -46
- package/dist/types/chartType/dualAxis/dualAxis.d.ts +2 -2
- package/dist/types/chartType/funnel/funnel.d.ts +8 -46
- package/dist/types/chartType/line/line.d.ts +48 -46
- package/dist/types/chartType/pie/pie.d.ts +8 -46
- package/dist/types/chartType/pivotTable/pivotTable.d.ts +8 -7
- package/dist/types/chartType/rose/rose.d.ts +9 -46
- package/dist/types/chartType/roseParallel/roseParallel.d.ts +10 -47
- package/dist/types/chartType/scatter/scatter.d.ts +8 -46
- package/dist/types/chartType/table/table.d.ts +6 -44
- package/dist/types/properties/analysis/analysis.d.ts +4 -0
- package/dist/types/properties/analysis/index.d.ts +3 -0
- package/dist/types/properties/analysis/sortAxis.d.ts +39 -0
- package/dist/types/properties/analysis/sortLegend.d.ts +39 -0
- package/dist/types/properties/config/config.d.ts +50 -2
- package/dist/types/properties/dimensions/dimensions.d.ts +20 -44
- package/dist/types/properties/index.d.ts +1 -0
- package/dist/types/properties/measures/measures.d.ts +11 -87
- package/dist/types/properties/theme/customTheme.d.ts +48 -4
- package/dist/types/vseed.d.ts +117 -709
- package/dist/umd/index.js +8818 -128
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __webpack_require__ = {};
|
3
|
+
(()=>{
|
4
|
+
__webpack_require__.n = (module)=>{
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
6
|
+
__webpack_require__.d(getter, {
|
7
|
+
a: getter
|
8
|
+
});
|
9
|
+
return getter;
|
10
|
+
};
|
11
|
+
})();
|
3
12
|
(()=>{
|
4
13
|
__webpack_require__.d = (exports1, definition)=>{
|
5
14
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
@@ -41,6 +50,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
41
50
|
columnPercentAdvancedPipeline: ()=>columnPercentAdvancedPipeline,
|
42
51
|
zColumnConfig: ()=>zColumnConfig,
|
43
52
|
zAnnotation: ()=>zAnnotation,
|
53
|
+
zSortLegend: ()=>zSortLegend,
|
44
54
|
pivotTableAdvancedPipeline: ()=>pivotTableAdvancedPipeline,
|
45
55
|
zYBandAxis: ()=>zYBandAxis,
|
46
56
|
dataReshapeFor1D2M: ()=>dataReshapeFor1D2M,
|
@@ -54,6 +64,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
54
64
|
registerColumn: ()=>registerColumn,
|
55
65
|
findAllMeasures: ()=>findAllMeasures,
|
56
66
|
funnelSpecPipeline: ()=>funnelSpecPipeline,
|
67
|
+
zAnalysis: ()=>zAnalysis,
|
57
68
|
preorderTraverse: ()=>preorderTraverse,
|
58
69
|
zDimensionTree: ()=>zDimensionTree,
|
59
70
|
roseParallelSpecPipeline: ()=>roseParallelSpecPipeline,
|
@@ -67,6 +78,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
67
78
|
barPercentAdvancedPipeline: ()=>barPercentAdvancedPipeline,
|
68
79
|
findAllDimensions: ()=>findAllDimensions,
|
69
80
|
findDimensionById: ()=>findDimensionById,
|
81
|
+
zPivotTableConfig: ()=>zPivotTableConfig,
|
70
82
|
zArea: ()=>zArea,
|
71
83
|
zColumnParallel: ()=>zColumnParallel,
|
72
84
|
zDimensions: ()=>zDimensions,
|
@@ -85,6 +97,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
85
97
|
registerBarPercent: ()=>registerBarPercent,
|
86
98
|
roseSpecPipeline: ()=>roseSpecPipeline,
|
87
99
|
zPivotTable: ()=>zPivotTable,
|
100
|
+
zSortAxis: ()=>zSortAxis,
|
88
101
|
registerLightTheme: ()=>registerLightTheme,
|
89
102
|
roseAdvancedPipeline: ()=>roseAdvancedPipeline,
|
90
103
|
zBarParallel: ()=>zBarParallel,
|
@@ -146,6 +159,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
146
159
|
zColumn: ()=>zColumn,
|
147
160
|
zCustomTheme: ()=>zCustomTheme,
|
148
161
|
zLineConfig: ()=>zLineConfig,
|
162
|
+
zTableConfig: ()=>zTableConfig,
|
149
163
|
zXBandAxis: ()=>zXBandAxis,
|
150
164
|
zColumnPercentConfig: ()=>zColumnPercentConfig,
|
151
165
|
findMeasureById: ()=>findMeasureById,
|
@@ -255,7 +269,6 @@ const createNumFormatter = (format, locale = intl.getLocale())=>{
|
|
255
269
|
roundingMode,
|
256
270
|
roundingPriority
|
257
271
|
};
|
258
|
-
console.log('debug roundingMode', roundingMode);
|
259
272
|
if ((0, external_remeda_namespaceObject.isNumber)(fractionDigits)) {
|
260
273
|
if (fractionDigits >= 0) {
|
261
274
|
numFormatterOptions.minimumFractionDigits = fractionDigits;
|
@@ -946,11 +959,12 @@ const encodingXY = (advancedVSeed)=>{
|
|
946
959
|
};
|
947
960
|
const { datasetReshapeInfo, dimensions } = advancedVSeed;
|
948
961
|
if (!datasetReshapeInfo || !dimensions) return result;
|
962
|
+
const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
949
963
|
const isZeroDimension = 0 === dimensions.length;
|
950
964
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
951
965
|
const { foldInfo, unfoldInfo } = cur;
|
952
966
|
const x = [
|
953
|
-
isZeroDimension ? foldInfo.measureName :
|
967
|
+
isZeroDimension ? foldInfo.measureName : xDimension?.id
|
954
968
|
];
|
955
969
|
const y = [
|
956
970
|
foldInfo.measureValue
|
@@ -982,11 +996,12 @@ const encodingYX = (advancedVSeed)=>{
|
|
982
996
|
};
|
983
997
|
const { datasetReshapeInfo, dimensions } = advancedVSeed;
|
984
998
|
if (!datasetReshapeInfo || !dimensions) return result;
|
999
|
+
const yDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
985
1000
|
const isZeroDimension = 0 === dimensions.length;
|
986
1001
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
987
1002
|
const { foldInfo, unfoldInfo } = cur;
|
988
1003
|
const y = [
|
989
|
-
isZeroDimension ? foldInfo.measureName :
|
1004
|
+
isZeroDimension ? foldInfo.measureName : yDimension?.id
|
990
1005
|
];
|
991
1006
|
const x = [
|
992
1007
|
foldInfo.measureValue
|
@@ -1054,6 +1069,7 @@ const encodingRose = (advancedVSeed)=>{
|
|
1054
1069
|
};
|
1055
1070
|
const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
|
1056
1071
|
if (!datasetReshapeInfo || !dimensions || !measures) return result;
|
1072
|
+
const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
1057
1073
|
const is1D1M = 1 === dimensions.length && 1 === measures.length;
|
1058
1074
|
const isZeroDimension = 0 === dimensions.length;
|
1059
1075
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
@@ -1062,13 +1078,13 @@ const encodingRose = (advancedVSeed)=>{
|
|
1062
1078
|
foldInfo.measureValue
|
1063
1079
|
];
|
1064
1080
|
const angle = [
|
1065
|
-
isZeroDimension ? foldInfo.measureName :
|
1081
|
+
isZeroDimension ? foldInfo.measureName : angleDimension?.id
|
1066
1082
|
];
|
1067
1083
|
const group = [
|
1068
|
-
is1D1M ?
|
1084
|
+
is1D1M ? angleDimension?.id : unfoldInfo.groupId
|
1069
1085
|
];
|
1070
1086
|
const color = [
|
1071
|
-
is1D1M ?
|
1087
|
+
is1D1M ? angleDimension?.id : unfoldInfo.groupId
|
1072
1088
|
];
|
1073
1089
|
return [
|
1074
1090
|
...prev,
|
@@ -1288,6 +1304,81 @@ const annotation_annotation = (advancedVSeed, context)=>{
|
|
1288
1304
|
annotation
|
1289
1305
|
};
|
1290
1306
|
};
|
1307
|
+
const sortXBandAxis = (advancedVSeed, context)=>{
|
1308
|
+
const result = {
|
1309
|
+
...advancedVSeed
|
1310
|
+
};
|
1311
|
+
const { vseed } = context;
|
1312
|
+
const { sortAxis, dataset } = vseed;
|
1313
|
+
const { encoding } = advancedVSeed;
|
1314
|
+
const xField = encoding?.[0]?.x?.[0];
|
1315
|
+
if (!sortAxis || !xField) return advancedVSeed;
|
1316
|
+
if (!result.analysis) result.analysis = {};
|
1317
|
+
if (!result.analysis.orderMapping) result.analysis.orderMapping = {};
|
1318
|
+
const axisOrderResult = calcOrder(sortAxis, xField, dataset);
|
1319
|
+
result.analysis.orderMapping[xField] = axisOrderResult;
|
1320
|
+
return result;
|
1321
|
+
};
|
1322
|
+
const sortYBandAxis = (advancedVSeed, context)=>{
|
1323
|
+
const result = {
|
1324
|
+
...advancedVSeed
|
1325
|
+
};
|
1326
|
+
const { vseed } = context;
|
1327
|
+
const { sortAxis, dataset } = vseed;
|
1328
|
+
const { encoding } = advancedVSeed;
|
1329
|
+
const yField = encoding?.[0]?.y?.[0];
|
1330
|
+
if (!sortAxis || !yField) return advancedVSeed;
|
1331
|
+
if (!result.analysis) result.analysis = {};
|
1332
|
+
if (!result.analysis.orderMapping) result.analysis.orderMapping = {};
|
1333
|
+
const axisOrderResult = calcOrder(sortAxis, yField, dataset);
|
1334
|
+
result.analysis.orderMapping[yField] = axisOrderResult;
|
1335
|
+
return result;
|
1336
|
+
};
|
1337
|
+
const sort_sortLegend = (advancedVSeed, context)=>{
|
1338
|
+
const result = {
|
1339
|
+
...advancedVSeed
|
1340
|
+
};
|
1341
|
+
const { vseed } = context;
|
1342
|
+
const { sortLegend } = vseed;
|
1343
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
1344
|
+
const groupField = datasetReshapeInfo?.[0]?.unfoldInfo?.groupId;
|
1345
|
+
const colorIdMap = datasetReshapeInfo?.[0]?.unfoldInfo?.colorIdMap;
|
1346
|
+
const colorItems = datasetReshapeInfo?.[0]?.unfoldInfo?.colorItems;
|
1347
|
+
if (!sortLegend || !groupField || !colorIdMap || !colorItems) return advancedVSeed;
|
1348
|
+
if (!result.analysis) result.analysis = {};
|
1349
|
+
if (!result.analysis.orderMapping) result.analysis.orderMapping = {};
|
1350
|
+
if (sortLegend.customOrder) {
|
1351
|
+
const nameMap = Object.keys(colorIdMap).reduce((pre, cur)=>{
|
1352
|
+
pre[colorIdMap[cur]] = cur;
|
1353
|
+
return pre;
|
1354
|
+
}, {});
|
1355
|
+
const orderRes = sortLegend.customOrder.map((itemNameOrId)=>nameMap[itemNameOrId] ? nameMap[itemNameOrId] : itemNameOrId);
|
1356
|
+
result.analysis.orderMapping[groupField] = orderRes;
|
1357
|
+
return result;
|
1358
|
+
}
|
1359
|
+
const dataset = advancedVSeed.dataset?.flat(2);
|
1360
|
+
const orderRes = calcOrder(sortLegend, groupField, dataset || []);
|
1361
|
+
result.analysis.orderMapping[groupField] = orderRes;
|
1362
|
+
return result;
|
1363
|
+
};
|
1364
|
+
const calcOrder = (sortAxis, id, dataset)=>{
|
1365
|
+
if (sortAxis.customOrder) return sortAxis.customOrder;
|
1366
|
+
const order = sortAxis.order || 'asc';
|
1367
|
+
const orderBy = sortAxis.orderBy;
|
1368
|
+
const res = (0, external_remeda_namespaceObject.sort)(dataset, (a, b)=>{
|
1369
|
+
const aValue = a[orderBy || id];
|
1370
|
+
const bValue = b[orderBy || id];
|
1371
|
+
if ('asc' === order) {
|
1372
|
+
if (aValue < bValue) return -1;
|
1373
|
+
if (aValue > bValue) return 1;
|
1374
|
+
return 0;
|
1375
|
+
}
|
1376
|
+
if (aValue > bValue) return -1;
|
1377
|
+
if (aValue < bValue) return 1;
|
1378
|
+
return 0;
|
1379
|
+
});
|
1380
|
+
return (0, external_remeda_namespaceObject.unique)(res.map((item)=>item[id]));
|
1381
|
+
};
|
1291
1382
|
const lineAdvancedPipeline = [
|
1292
1383
|
initAdvancedVSeed,
|
1293
1384
|
autoMeasures,
|
@@ -1298,6 +1389,8 @@ const lineAdvancedPipeline = [
|
|
1298
1389
|
pivotReshapeTo2D1M
|
1299
1390
|
]),
|
1300
1391
|
encodingXY,
|
1392
|
+
sortXBandAxis,
|
1393
|
+
sort_sortLegend,
|
1301
1394
|
lineConfig,
|
1302
1395
|
theme_theme,
|
1303
1396
|
markStyle_markStyle,
|
@@ -1313,6 +1406,8 @@ const barAdvancedPipeline = [
|
|
1313
1406
|
pivotReshapeTo2D1M
|
1314
1407
|
]),
|
1315
1408
|
encodingYX,
|
1409
|
+
sortYBandAxis,
|
1410
|
+
sort_sortLegend,
|
1316
1411
|
barConfig,
|
1317
1412
|
theme_theme,
|
1318
1413
|
markStyle_markStyle,
|
@@ -1328,6 +1423,8 @@ const barParallelAdvancedPipeline = [
|
|
1328
1423
|
pivotReshapeTo2D1M
|
1329
1424
|
]),
|
1330
1425
|
encodingYX,
|
1426
|
+
sortYBandAxis,
|
1427
|
+
sort_sortLegend,
|
1331
1428
|
barParallelConfig,
|
1332
1429
|
theme_theme,
|
1333
1430
|
markStyle_markStyle,
|
@@ -1343,6 +1440,8 @@ const barPercentAdvancedPipeline = [
|
|
1343
1440
|
pivotReshapeTo2D1M
|
1344
1441
|
]),
|
1345
1442
|
encodingYX,
|
1443
|
+
sortYBandAxis,
|
1444
|
+
sort_sortLegend,
|
1346
1445
|
barPercentConfig,
|
1347
1446
|
theme_theme,
|
1348
1447
|
markStyle_markStyle,
|
@@ -1358,6 +1457,8 @@ const columnAdvancedPipeline = [
|
|
1358
1457
|
pivotReshapeTo2D1M
|
1359
1458
|
]),
|
1360
1459
|
encodingXY,
|
1460
|
+
sortXBandAxis,
|
1461
|
+
sort_sortLegend,
|
1361
1462
|
columnConfig,
|
1362
1463
|
theme_theme,
|
1363
1464
|
markStyle_markStyle,
|
@@ -1373,6 +1474,8 @@ const columnParallelAdvancedPipeline = [
|
|
1373
1474
|
pivotReshapeTo2D1M
|
1374
1475
|
]),
|
1375
1476
|
encodingXY,
|
1477
|
+
sortXBandAxis,
|
1478
|
+
sort_sortLegend,
|
1376
1479
|
columnParallelConfig,
|
1377
1480
|
theme_theme,
|
1378
1481
|
markStyle_markStyle,
|
@@ -1388,6 +1491,8 @@ const columnPercentAdvancedPipeline = [
|
|
1388
1491
|
pivotReshapeTo2D1M
|
1389
1492
|
]),
|
1390
1493
|
encodingXY,
|
1494
|
+
sortXBandAxis,
|
1495
|
+
sort_sortLegend,
|
1391
1496
|
columnPercentConfig,
|
1392
1497
|
theme_theme,
|
1393
1498
|
markStyle_markStyle,
|
@@ -1403,6 +1508,8 @@ const areaAdvancedPipeline = [
|
|
1403
1508
|
pivotReshapeTo2D1M
|
1404
1509
|
]),
|
1405
1510
|
encodingXY,
|
1511
|
+
sortXBandAxis,
|
1512
|
+
sort_sortLegend,
|
1406
1513
|
areaConfig,
|
1407
1514
|
theme_theme,
|
1408
1515
|
markStyle_markStyle,
|
@@ -1418,6 +1525,8 @@ const areaPercentAdvancedPipeline = [
|
|
1418
1525
|
pivotReshapeTo2D1M
|
1419
1526
|
]),
|
1420
1527
|
encodingXY,
|
1528
|
+
sortXBandAxis,
|
1529
|
+
sort_sortLegend,
|
1421
1530
|
areaPercentConfig,
|
1422
1531
|
theme_theme,
|
1423
1532
|
markStyle_markStyle,
|
@@ -1664,23 +1773,54 @@ const tableAdvancedPipeline = [
|
|
1664
1773
|
];
|
1665
1774
|
const dataset_dataset = (spec, context)=>{
|
1666
1775
|
const { advancedVSeed } = context;
|
1667
|
-
const { encoding } = advancedVSeed;
|
1776
|
+
const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
|
1777
|
+
const { orderMapping = {} } = analysis ?? {};
|
1668
1778
|
const angle = encoding[0]?.angle?.[0];
|
1669
1779
|
const x = encoding[0]?.x?.[0];
|
1780
|
+
const y = encoding[0]?.y?.[0];
|
1670
1781
|
const group = encoding[0]?.group?.[0];
|
1782
|
+
const id = datasetReshapeInfo[0].id;
|
1671
1783
|
const fields = {};
|
1672
1784
|
if (angle) fields[angle] = {
|
1673
1785
|
sortIndex: 0
|
1674
1786
|
};
|
1675
|
-
if (x)
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1787
|
+
if (x) {
|
1788
|
+
const order = orderMapping[x];
|
1789
|
+
if (order) fields[x] = {
|
1790
|
+
sortIndex: 0,
|
1791
|
+
domain: order,
|
1792
|
+
lockStatisticsByDomain: true
|
1793
|
+
};
|
1794
|
+
else fields[x] = {
|
1795
|
+
sortIndex: 0
|
1796
|
+
};
|
1797
|
+
}
|
1798
|
+
if (y) {
|
1799
|
+
const order = orderMapping[y];
|
1800
|
+
if (order) fields[y] = {
|
1801
|
+
sortIndex: 0,
|
1802
|
+
domain: order,
|
1803
|
+
lockStatisticsByDomain: true
|
1804
|
+
};
|
1805
|
+
else fields[y] = {
|
1806
|
+
sortIndex: 0
|
1807
|
+
};
|
1808
|
+
}
|
1809
|
+
if (group) {
|
1810
|
+
const order = orderMapping[group];
|
1811
|
+
if (order) fields[group] = {
|
1812
|
+
sortIndex: 0,
|
1813
|
+
domain: order,
|
1814
|
+
lockStatisticsByDomain: true
|
1815
|
+
};
|
1816
|
+
else fields[group] = {
|
1817
|
+
sortIndex: 0
|
1818
|
+
};
|
1819
|
+
}
|
1681
1820
|
return {
|
1682
1821
|
...spec,
|
1683
1822
|
data: {
|
1823
|
+
id,
|
1684
1824
|
values: advancedVSeed.dataset,
|
1685
1825
|
fields: fields
|
1686
1826
|
}
|
@@ -1702,12 +1842,6 @@ const datasetPivot = (spec, context)=>{
|
|
1702
1842
|
records: records
|
1703
1843
|
};
|
1704
1844
|
};
|
1705
|
-
const datasetPivotPlaceholder = (spec)=>({
|
1706
|
-
...spec,
|
1707
|
-
data: {
|
1708
|
-
id: 'placeholderDataId'
|
1709
|
-
}
|
1710
|
-
});
|
1711
1845
|
const initColumn = (spec, context)=>{
|
1712
1846
|
const result = {
|
1713
1847
|
...spec
|
@@ -2736,7 +2870,7 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
2736
2870
|
}), {});
|
2737
2871
|
const { legend, color } = baseConfig;
|
2738
2872
|
const { colorScheme } = color;
|
2739
|
-
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight, maxSize, border, shapeType = 'rectRound' } = legend || {};
|
2873
|
+
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400, maxSize, border, shapeType = 'rectRound' } = legend || {};
|
2740
2874
|
const orient = [
|
2741
2875
|
'bottom',
|
2742
2876
|
'bottomLeft',
|
@@ -4097,7 +4231,7 @@ const pivotLine = [
|
|
4097
4231
|
initLine,
|
4098
4232
|
color_color,
|
4099
4233
|
background_backgroundColor,
|
4100
|
-
|
4234
|
+
dataset_dataset,
|
4101
4235
|
xBand,
|
4102
4236
|
yLinear,
|
4103
4237
|
label_label,
|
@@ -4148,7 +4282,7 @@ const pivotColumn = [
|
|
4148
4282
|
stackInverse,
|
4149
4283
|
color_color,
|
4150
4284
|
background_backgroundColor,
|
4151
|
-
|
4285
|
+
dataset_dataset,
|
4152
4286
|
xBand,
|
4153
4287
|
yLinear,
|
4154
4288
|
label_label,
|
@@ -4195,7 +4329,7 @@ const pivotColumnParallel = [
|
|
4195
4329
|
stackCornerRadius_stackCornerRadius,
|
4196
4330
|
color_color,
|
4197
4331
|
background_backgroundColor,
|
4198
|
-
|
4332
|
+
dataset_dataset,
|
4199
4333
|
xBand,
|
4200
4334
|
yLinear,
|
4201
4335
|
label_label,
|
@@ -4246,7 +4380,7 @@ const pivotColumnPercent = [
|
|
4246
4380
|
color_color,
|
4247
4381
|
percent,
|
4248
4382
|
background_backgroundColor,
|
4249
|
-
|
4383
|
+
dataset_dataset,
|
4250
4384
|
xBand,
|
4251
4385
|
yLinear,
|
4252
4386
|
label_label,
|
@@ -4293,7 +4427,8 @@ const pivotBar = [
|
|
4293
4427
|
stackCornerRadius_stackCornerRadius,
|
4294
4428
|
color_color,
|
4295
4429
|
background_backgroundColor,
|
4296
|
-
|
4430
|
+
dataset_dataset,
|
4431
|
+
xLinear,
|
4297
4432
|
yBand,
|
4298
4433
|
label_label,
|
4299
4434
|
label_label,
|
@@ -4340,9 +4475,9 @@ const pivotBarParallel = [
|
|
4340
4475
|
stackCornerRadius_stackCornerRadius,
|
4341
4476
|
color_color,
|
4342
4477
|
background_backgroundColor,
|
4343
|
-
|
4344
|
-
yBand,
|
4478
|
+
dataset_dataset,
|
4345
4479
|
xLinear,
|
4480
|
+
yBand,
|
4346
4481
|
label_label,
|
4347
4482
|
tooltip_tooltip,
|
4348
4483
|
horizontalCrosshairRect,
|
@@ -4389,7 +4524,7 @@ const pivotBarPercent = [
|
|
4389
4524
|
color_color,
|
4390
4525
|
background_backgroundColor,
|
4391
4526
|
percent,
|
4392
|
-
|
4527
|
+
dataset_dataset,
|
4393
4528
|
yBand,
|
4394
4529
|
xLinear,
|
4395
4530
|
label_label,
|
@@ -4439,7 +4574,7 @@ const pivotArea = [
|
|
4439
4574
|
color_color,
|
4440
4575
|
background_backgroundColor,
|
4441
4576
|
stackInverse,
|
4442
|
-
|
4577
|
+
dataset_dataset,
|
4443
4578
|
xBand,
|
4444
4579
|
yLinear,
|
4445
4580
|
label_label,
|
@@ -4493,7 +4628,7 @@ const pivotAreaPercent = [
|
|
4493
4628
|
color_color,
|
4494
4629
|
background_backgroundColor,
|
4495
4630
|
percent,
|
4496
|
-
|
4631
|
+
dataset_dataset,
|
4497
4632
|
xBand,
|
4498
4633
|
yLinear,
|
4499
4634
|
label_label,
|
@@ -4536,7 +4671,7 @@ const pivotPie = [
|
|
4536
4671
|
initPie,
|
4537
4672
|
color_color,
|
4538
4673
|
background_backgroundColor,
|
4539
|
-
|
4674
|
+
dataset_dataset,
|
4540
4675
|
label_label,
|
4541
4676
|
tooltip_tooltip,
|
4542
4677
|
annotationPoint_annotationPoint,
|
@@ -4573,7 +4708,7 @@ const pivotDonut = [
|
|
4573
4708
|
initDonut,
|
4574
4709
|
color_color,
|
4575
4710
|
background_backgroundColor,
|
4576
|
-
|
4711
|
+
dataset_dataset,
|
4577
4712
|
label_label,
|
4578
4713
|
tooltip_tooltip,
|
4579
4714
|
annotationPoint_annotationPoint,
|
@@ -4613,7 +4748,7 @@ const pivotRose = [
|
|
4613
4748
|
stackInverse,
|
4614
4749
|
color_color,
|
4615
4750
|
background_backgroundColor,
|
4616
|
-
|
4751
|
+
dataset_dataset,
|
4617
4752
|
radiusAxis,
|
4618
4753
|
angleAxis,
|
4619
4754
|
label_label,
|
@@ -4654,7 +4789,7 @@ const pivotRoseParallel = [
|
|
4654
4789
|
stackCornerRadius_stackCornerRadius,
|
4655
4790
|
color_color,
|
4656
4791
|
background_backgroundColor,
|
4657
|
-
|
4792
|
+
dataset_dataset,
|
4658
4793
|
radiusAxis,
|
4659
4794
|
angleAxis,
|
4660
4795
|
label_label,
|
@@ -4694,7 +4829,7 @@ const pivotFunnel = [
|
|
4694
4829
|
initFunnel,
|
4695
4830
|
color_color,
|
4696
4831
|
background_backgroundColor,
|
4697
|
-
|
4832
|
+
dataset_dataset,
|
4698
4833
|
label_label,
|
4699
4834
|
tooltip_tooltip,
|
4700
4835
|
annotationPoint_annotationPoint,
|
@@ -4737,7 +4872,7 @@ const pivotScatter = [
|
|
4737
4872
|
initScatter,
|
4738
4873
|
color_color,
|
4739
4874
|
background_backgroundColor,
|
4740
|
-
|
4875
|
+
dataset_dataset,
|
4741
4876
|
xLinear,
|
4742
4877
|
yLinear,
|
4743
4878
|
label_label,
|
@@ -4768,7 +4903,57 @@ const initTable = (spec, context)=>{
|
|
4768
4903
|
heightMode: 'autoHeight',
|
4769
4904
|
autoWrapText: true,
|
4770
4905
|
columnResizeMode: 'all',
|
4771
|
-
showHeader: true
|
4906
|
+
showHeader: true,
|
4907
|
+
tooltip: {
|
4908
|
+
isShowOverflowTextTooltip: true
|
4909
|
+
},
|
4910
|
+
animationAppear: {
|
4911
|
+
duration: 300,
|
4912
|
+
delay: 250,
|
4913
|
+
type: 'one-by-one',
|
4914
|
+
direction: 'row'
|
4915
|
+
},
|
4916
|
+
hover: {
|
4917
|
+
highlightMode: 'row'
|
4918
|
+
},
|
4919
|
+
theme: {
|
4920
|
+
underlayBackgroundColor: 'transparent'
|
4921
|
+
}
|
4922
|
+
};
|
4923
|
+
};
|
4924
|
+
const initPivotTable = (spec, context)=>{
|
4925
|
+
const { advancedVSeed } = context;
|
4926
|
+
const { dataset } = advancedVSeed;
|
4927
|
+
return {
|
4928
|
+
...spec,
|
4929
|
+
records: dataset,
|
4930
|
+
widthMode: 'standard',
|
4931
|
+
heightMode: 'autoHeight',
|
4932
|
+
autoWrapText: true,
|
4933
|
+
columnResizeMode: 'all',
|
4934
|
+
columnResizeType: 'column',
|
4935
|
+
showColumnHeader: true,
|
4936
|
+
showRowHeader: true,
|
4937
|
+
select: {
|
4938
|
+
highlightMode: 'cell',
|
4939
|
+
headerSelectMode: 'inline'
|
4940
|
+
},
|
4941
|
+
hover: {
|
4942
|
+
highlightMode: 'cross'
|
4943
|
+
},
|
4944
|
+
tooltip: {
|
4945
|
+
isShowOverflowTextTooltip: true
|
4946
|
+
},
|
4947
|
+
widthAdaptiveMode: 'all',
|
4948
|
+
animationAppear: {
|
4949
|
+
duration: 300,
|
4950
|
+
delay: 250,
|
4951
|
+
type: 'one-by-one',
|
4952
|
+
direction: 'row'
|
4953
|
+
},
|
4954
|
+
theme: {
|
4955
|
+
underlayBackgroundColor: 'transparent'
|
4956
|
+
}
|
4772
4957
|
};
|
4773
4958
|
};
|
4774
4959
|
const measureTreeToColumns = (spec, context)=>{
|
@@ -4777,7 +4962,13 @@ const measureTreeToColumns = (spec, context)=>{
|
|
4777
4962
|
const result = {
|
4778
4963
|
...spec
|
4779
4964
|
};
|
4780
|
-
const
|
4965
|
+
const eachNode = (node)=>{
|
4966
|
+
if ('children' in node) return {};
|
4967
|
+
return {
|
4968
|
+
width: 'auto'
|
4969
|
+
};
|
4970
|
+
};
|
4971
|
+
const columns = treeTreeToColumns(measures, eachNode);
|
4781
4972
|
return {
|
4782
4973
|
...result,
|
4783
4974
|
columns: [
|
@@ -4792,7 +4983,13 @@ const dimensionTreeToColumns = (spec, context)=>{
|
|
4792
4983
|
const result = {
|
4793
4984
|
...spec
|
4794
4985
|
};
|
4795
|
-
const
|
4986
|
+
const eachNode = (node)=>{
|
4987
|
+
if ('children' in node) return {};
|
4988
|
+
return {
|
4989
|
+
width: 'auto'
|
4990
|
+
};
|
4991
|
+
};
|
4992
|
+
const columns = treeTreeToColumns(dimensions, eachNode);
|
4796
4993
|
return {
|
4797
4994
|
...result,
|
4798
4995
|
columns: [
|
@@ -4801,39 +4998,33 @@ const dimensionTreeToColumns = (spec, context)=>{
|
|
4801
4998
|
]
|
4802
4999
|
};
|
4803
5000
|
};
|
4804
|
-
const treeTreeToColumns = (tree
|
5001
|
+
const treeTreeToColumns = (tree, callback)=>{
|
4805
5002
|
const result = tree.map((item)=>{
|
4806
|
-
|
4807
|
-
|
4808
|
-
|
4809
|
-
|
4810
|
-
|
4811
|
-
|
4812
|
-
|
4813
|
-
|
4814
|
-
|
4815
|
-
|
4816
|
-
|
5003
|
+
if ('children' in item && Array.isArray(item.children)) {
|
5004
|
+
const groupNode = item;
|
5005
|
+
const field = groupNode.id;
|
5006
|
+
const title = groupNode.alias ?? groupNode.id;
|
5007
|
+
const props = callback?.(groupNode) || {};
|
5008
|
+
return {
|
5009
|
+
field,
|
5010
|
+
title,
|
5011
|
+
columns: treeTreeToColumns(item.children, callback),
|
5012
|
+
...props
|
5013
|
+
};
|
5014
|
+
}
|
5015
|
+
{
|
5016
|
+
const field = item.id;
|
5017
|
+
const title = item.alias ?? item.id;
|
5018
|
+
const props = callback?.(item) || {};
|
5019
|
+
return {
|
5020
|
+
field,
|
5021
|
+
title,
|
5022
|
+
...props
|
5023
|
+
};
|
5024
|
+
}
|
4817
5025
|
});
|
4818
5026
|
return result || [];
|
4819
5027
|
};
|
4820
|
-
const tableSpecPipeline = [
|
4821
|
-
initTable,
|
4822
|
-
dimensionTreeToColumns,
|
4823
|
-
measureTreeToColumns
|
4824
|
-
];
|
4825
|
-
const initPivotTable = (spec, context)=>{
|
4826
|
-
const { advancedVSeed } = context;
|
4827
|
-
const { dataset } = advancedVSeed;
|
4828
|
-
return {
|
4829
|
-
...spec,
|
4830
|
-
records: dataset,
|
4831
|
-
widthMode: 'standard',
|
4832
|
-
heightMode: 'autoHeight',
|
4833
|
-
autoWrapText: true,
|
4834
|
-
columnResizeMode: 'all'
|
4835
|
-
};
|
4836
|
-
};
|
4837
5028
|
const pivotColumns = (spec, context)=>{
|
4838
5029
|
const { advancedVSeed } = context;
|
4839
5030
|
const dimensions = advancedVSeed.dimensions;
|
@@ -4866,6 +5057,7 @@ const pivotIndicators_pivotIndicators = (spec, context)=>{
|
|
4866
5057
|
return {
|
4867
5058
|
...spec,
|
4868
5059
|
indicatorsAsCol: true,
|
5060
|
+
indicatorTitle: intl.i18n`指标名称`,
|
4869
5061
|
indicators: measures.map((item)=>({
|
4870
5062
|
cellType: 'text',
|
4871
5063
|
indicatorKey: item.id,
|
@@ -4874,11 +5066,255 @@ const pivotIndicators_pivotIndicators = (spec, context)=>{
|
|
4874
5066
|
}))
|
4875
5067
|
};
|
4876
5068
|
};
|
5069
|
+
const external_d3_color_namespaceObject = require("d3-color");
|
5070
|
+
const bodyStyle = (spec, context)=>{
|
5071
|
+
const result = {
|
5072
|
+
...spec
|
5073
|
+
};
|
5074
|
+
const { advancedVSeed } = context;
|
5075
|
+
const { customTheme, chartType } = advancedVSeed;
|
5076
|
+
const themConfig = customTheme?.config?.[chartType];
|
5077
|
+
if (!result.theme || !themConfig) return result;
|
5078
|
+
const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
|
5079
|
+
const backgroundColor = themConfig.bodyBackgroundColor || '#fff';
|
5080
|
+
const fontColor = themConfig.bodyFontColor || '#1B1F23';
|
5081
|
+
const fontSize = themConfig.bodyFontSize || 12;
|
5082
|
+
const hoverCellBgColor = themConfig.hoverBodyBackgroundColor || '#bedaff';
|
5083
|
+
const hoverInlineColor = (0, external_d3_color_namespaceObject.color)(hoverCellBgColor)?.copy({
|
5084
|
+
opacity: 0.2
|
5085
|
+
}).toString();
|
5086
|
+
result.theme.bodyStyle = {
|
5087
|
+
borderColor: borderColor,
|
5088
|
+
borderLineWidth: 1,
|
5089
|
+
padding: [
|
5090
|
+
8.6,
|
5091
|
+
12,
|
5092
|
+
8.6,
|
5093
|
+
12
|
5094
|
+
],
|
5095
|
+
textAlign: 'right',
|
5096
|
+
hover: {
|
5097
|
+
cellBgColor: hoverCellBgColor,
|
5098
|
+
inlineRowBgColor: hoverInlineColor,
|
5099
|
+
inlineColumnBgColor: hoverInlineColor
|
5100
|
+
},
|
5101
|
+
color: fontColor,
|
5102
|
+
fontSize: fontSize,
|
5103
|
+
fontStyle: 'normal',
|
5104
|
+
fontWeight: 'normal',
|
5105
|
+
fontVariant: 'normal',
|
5106
|
+
bgColor: backgroundColor,
|
5107
|
+
lineHeight: 1.5 * fontSize
|
5108
|
+
};
|
5109
|
+
return result;
|
5110
|
+
};
|
5111
|
+
const headerStyle = (spec, context)=>{
|
5112
|
+
const result = {
|
5113
|
+
...spec
|
5114
|
+
};
|
5115
|
+
const { advancedVSeed } = context;
|
5116
|
+
const { customTheme, chartType } = advancedVSeed;
|
5117
|
+
const themConfig = customTheme?.config?.[chartType];
|
5118
|
+
if (!result.theme || !themConfig) return result;
|
5119
|
+
const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
|
5120
|
+
const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
|
5121
|
+
const fontColor = themConfig.headerFontColor || '#1B1F23';
|
5122
|
+
const fontSize = themConfig.headerFontSize || 12;
|
5123
|
+
const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
|
5124
|
+
const hoverInlineColor = themConfig.hoverHeaderBackgroundColor;
|
5125
|
+
result.theme.headerStyle = {
|
5126
|
+
borderColor: borderColor,
|
5127
|
+
borderLineWidth: 1,
|
5128
|
+
padding: [
|
5129
|
+
8,
|
5130
|
+
12,
|
5131
|
+
8,
|
5132
|
+
12
|
5133
|
+
],
|
5134
|
+
textAlign: 'center',
|
5135
|
+
hover: {
|
5136
|
+
cellBgColor: (0, external_d3_color_namespaceObject.color)(hoverCellBgColor)?.copy({
|
5137
|
+
opacity: 1
|
5138
|
+
}).brighter(0.5).toString(),
|
5139
|
+
inlineRowBgColor: hoverInlineColor,
|
5140
|
+
inlineColumnBgColor: hoverInlineColor
|
5141
|
+
},
|
5142
|
+
frameStyle: {
|
5143
|
+
borderColor: [
|
5144
|
+
null,
|
5145
|
+
null,
|
5146
|
+
borderColor,
|
5147
|
+
null
|
5148
|
+
],
|
5149
|
+
borderLineWidth: 1
|
5150
|
+
},
|
5151
|
+
fontSize: fontSize,
|
5152
|
+
fontVariant: 'normal',
|
5153
|
+
fontStyle: 'normal',
|
5154
|
+
fontWeight: 'bold',
|
5155
|
+
color: fontColor,
|
5156
|
+
bgColor: backgroundColor,
|
5157
|
+
lineHeight: 1.5 * fontSize
|
5158
|
+
};
|
5159
|
+
return result;
|
5160
|
+
};
|
5161
|
+
const rowHeaderStyle = (spec, context)=>{
|
5162
|
+
const result = {
|
5163
|
+
...spec
|
5164
|
+
};
|
5165
|
+
const { advancedVSeed } = context;
|
5166
|
+
const { customTheme, chartType } = advancedVSeed;
|
5167
|
+
const themConfig = customTheme?.config?.[chartType];
|
5168
|
+
if (!result.theme || !themConfig) return result;
|
5169
|
+
const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
|
5170
|
+
const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
|
5171
|
+
const fontColor = themConfig.headerFontColor || '#1B1F23';
|
5172
|
+
const fontSize = themConfig.headerFontSize || 12;
|
5173
|
+
const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
|
5174
|
+
const hoverInlineColor = themConfig.hoverHeaderBackgroundColor;
|
5175
|
+
result.theme.rowHeaderStyle = {
|
5176
|
+
borderColor: borderColor,
|
5177
|
+
borderLineWidth: 1,
|
5178
|
+
padding: [
|
5179
|
+
8.6,
|
5180
|
+
12,
|
5181
|
+
8.6,
|
5182
|
+
12
|
5183
|
+
],
|
5184
|
+
textAlign: 'left',
|
5185
|
+
hover: {
|
5186
|
+
cellBgColor: (0, external_d3_color_namespaceObject.color)(hoverCellBgColor)?.copy({
|
5187
|
+
opacity: 1
|
5188
|
+
}).brighter(0.5).toString(),
|
5189
|
+
inlineRowBgColor: hoverInlineColor,
|
5190
|
+
inlineColumnBgColor: hoverInlineColor
|
5191
|
+
},
|
5192
|
+
frameStyle: {
|
5193
|
+
borderColor: [
|
5194
|
+
null,
|
5195
|
+
borderColor,
|
5196
|
+
null,
|
5197
|
+
null
|
5198
|
+
],
|
5199
|
+
borderLineWidth: 1
|
5200
|
+
},
|
5201
|
+
fontSize: fontSize,
|
5202
|
+
fontVariant: 'normal',
|
5203
|
+
fontStyle: 'normal',
|
5204
|
+
fontWeight: 'bold',
|
5205
|
+
color: fontColor,
|
5206
|
+
bgColor: backgroundColor,
|
5207
|
+
lineHeight: 1.5 * fontSize
|
5208
|
+
};
|
5209
|
+
return result;
|
5210
|
+
};
|
5211
|
+
const cornerHeaderStyle = (spec, context)=>{
|
5212
|
+
const result = {
|
5213
|
+
...spec
|
5214
|
+
};
|
5215
|
+
const { advancedVSeed } = context;
|
5216
|
+
const { customTheme, chartType } = advancedVSeed;
|
5217
|
+
const themConfig = customTheme?.config?.[chartType];
|
5218
|
+
if (!result.theme || !themConfig) return result;
|
5219
|
+
const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
|
5220
|
+
const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
|
5221
|
+
const fontColor = themConfig.headerFontColor || '#1B1F23';
|
5222
|
+
const fontSize = themConfig.headerFontSize || 12;
|
5223
|
+
const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
|
5224
|
+
const hoverInlineColor = themConfig.hoverHeaderBackgroundColor;
|
5225
|
+
result.theme.cornerHeaderStyle = {
|
5226
|
+
borderColor: [
|
5227
|
+
borderColor,
|
5228
|
+
borderColor
|
5229
|
+
],
|
5230
|
+
borderLineWidth: 1,
|
5231
|
+
padding: [
|
5232
|
+
8,
|
5233
|
+
12,
|
5234
|
+
8,
|
5235
|
+
12
|
5236
|
+
],
|
5237
|
+
textAlign: 'left',
|
5238
|
+
hover: {
|
5239
|
+
cellBgColor: (0, external_d3_color_namespaceObject.color)(hoverCellBgColor)?.copy({
|
5240
|
+
opacity: 1
|
5241
|
+
}).brighter(0.5).toString(),
|
5242
|
+
inlineRowBgColor: hoverInlineColor,
|
5243
|
+
inlineColumnBgColor: hoverInlineColor
|
5244
|
+
},
|
5245
|
+
frameStyle: {
|
5246
|
+
borderColor: [
|
5247
|
+
null,
|
5248
|
+
borderColor,
|
5249
|
+
borderColor,
|
5250
|
+
null
|
5251
|
+
],
|
5252
|
+
borderLineWidth: 1
|
5253
|
+
},
|
5254
|
+
fontSize: fontSize,
|
5255
|
+
fontVariant: 'normal',
|
5256
|
+
fontStyle: 'normal',
|
5257
|
+
fontWeight: 'bold',
|
5258
|
+
color: fontColor,
|
5259
|
+
bgColor: backgroundColor,
|
5260
|
+
lineHeight: 1.5 * fontSize
|
5261
|
+
};
|
5262
|
+
return result;
|
5263
|
+
};
|
5264
|
+
const frameStyle = (spec, context)=>{
|
5265
|
+
const result = {
|
5266
|
+
...spec
|
5267
|
+
};
|
5268
|
+
const { advancedVSeed } = context;
|
5269
|
+
const { customTheme, chartType } = advancedVSeed;
|
5270
|
+
const themConfig = customTheme?.config?.[chartType];
|
5271
|
+
if (!result.theme || !themConfig) return result;
|
5272
|
+
const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
|
5273
|
+
result.theme.frameStyle = {
|
5274
|
+
borderColor,
|
5275
|
+
borderLineWidth: 0,
|
5276
|
+
cornerRadius: 4
|
5277
|
+
};
|
5278
|
+
return result;
|
5279
|
+
};
|
5280
|
+
const selectionStyle = (spec, context)=>{
|
5281
|
+
const result = {
|
5282
|
+
...spec
|
5283
|
+
};
|
5284
|
+
const { advancedVSeed } = context;
|
5285
|
+
const { customTheme, chartType } = advancedVSeed;
|
5286
|
+
const themConfig = customTheme?.config?.[chartType];
|
5287
|
+
if (!result.theme || !themConfig) return result;
|
5288
|
+
const borderColor = themConfig.selectedBorderColor || 'rgb(224, 224, 224)';
|
5289
|
+
result.theme.selectionStyle = {
|
5290
|
+
cellBorderColor: borderColor,
|
5291
|
+
cellBorderLineWidth: 2,
|
5292
|
+
cellBgColor: (0, external_d3_color_namespaceObject.color)(borderColor)?.copy({
|
5293
|
+
opacity: 0.15
|
5294
|
+
}).toString()
|
5295
|
+
};
|
5296
|
+
return result;
|
5297
|
+
};
|
5298
|
+
const tableSpecPipeline = [
|
5299
|
+
initTable,
|
5300
|
+
dimensionTreeToColumns,
|
5301
|
+
measureTreeToColumns,
|
5302
|
+
bodyStyle,
|
5303
|
+
headerStyle,
|
5304
|
+
frameStyle,
|
5305
|
+
selectionStyle
|
5306
|
+
];
|
4877
5307
|
const pivotTableSpecPipeline = [
|
4878
5308
|
initPivotTable,
|
4879
5309
|
pivotColumns,
|
4880
5310
|
pivotRows,
|
4881
|
-
pivotIndicators_pivotIndicators
|
5311
|
+
pivotIndicators_pivotIndicators,
|
5312
|
+
bodyStyle,
|
5313
|
+
headerStyle,
|
5314
|
+
rowHeaderStyle,
|
5315
|
+
cornerHeaderStyle,
|
5316
|
+
frameStyle,
|
5317
|
+
selectionStyle
|
4882
5318
|
];
|
4883
5319
|
const buildAdvanced = (builder)=>{
|
4884
5320
|
const { chartType } = builder.vseed;
|
@@ -4931,6 +5367,16 @@ const getColorItems = (builder)=>{
|
|
4931
5367
|
}), {});
|
4932
5368
|
return colorItems.map((d)=>colorIdMap[d]);
|
4933
5369
|
};
|
5370
|
+
const getColorIdMap = (builder)=>{
|
5371
|
+
const advancedVSeed = builder.advancedVSeed;
|
5372
|
+
if (!advancedVSeed) return {};
|
5373
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
5374
|
+
const colorIdMap = datasetReshapeInfo.reduce((prev, cur)=>({
|
5375
|
+
...prev,
|
5376
|
+
...cur.unfoldInfo.colorIdMap
|
5377
|
+
}), {});
|
5378
|
+
return colorIdMap;
|
5379
|
+
};
|
4934
5380
|
class Builder {
|
4935
5381
|
_vseed;
|
4936
5382
|
_advancedVSeed = null;
|
@@ -4947,6 +5393,7 @@ class Builder {
|
|
4947
5393
|
getTheme = (themeKey)=>Builder._themeMap[themeKey];
|
4948
5394
|
getThemeMap = ()=>Builder._themeMap;
|
4949
5395
|
getColorItems = ()=>getColorItems(this);
|
5396
|
+
getColorIdMap = ()=>getColorIdMap(this);
|
4950
5397
|
get vseed() {
|
4951
5398
|
return this._vseed;
|
4952
5399
|
}
|
@@ -5176,8 +5623,22 @@ const lightTheme = ()=>{
|
|
5176
5623
|
labelFontWeight: 400
|
5177
5624
|
}
|
5178
5625
|
};
|
5626
|
+
const tableConfig = {
|
5627
|
+
borderColor: '#e3e5eb',
|
5628
|
+
bodyFontSize: 12,
|
5629
|
+
bodyFontColor: '#141414',
|
5630
|
+
bodyBackgroundColor: 'transparent',
|
5631
|
+
headerFontSize: 12,
|
5632
|
+
headerFontColor: '#21252c',
|
5633
|
+
headerBackgroundColor: '#f6f7f9',
|
5634
|
+
hoverBodyBackgroundColor: '#bedaff',
|
5635
|
+
hoverHeaderBackgroundColor: '#D9DDE488',
|
5636
|
+
selectedBorderColor: '#4080ff'
|
5637
|
+
};
|
5179
5638
|
return {
|
5180
5639
|
config: {
|
5640
|
+
table: tableConfig,
|
5641
|
+
pivotTable: tableConfig,
|
5181
5642
|
line: {
|
5182
5643
|
...baseConfig,
|
5183
5644
|
xAxis: bandAxis,
|
@@ -5455,8 +5916,22 @@ const darkTheme = ()=>{
|
|
5455
5916
|
labelFontWeight: 400
|
5456
5917
|
}
|
5457
5918
|
};
|
5919
|
+
const tableConfig = {
|
5920
|
+
borderColor: '#4b4e53',
|
5921
|
+
bodyFontSize: 12,
|
5922
|
+
bodyFontColor: '#fdfdfd',
|
5923
|
+
bodyBackgroundColor: 'transparent',
|
5924
|
+
headerFontSize: 12,
|
5925
|
+
headerFontColor: '#fdfdfd',
|
5926
|
+
headerBackgroundColor: '#36393e',
|
5927
|
+
hoverBodyBackgroundColor: '#4284ff66',
|
5928
|
+
hoverHeaderBackgroundColor: '#5f5f5f88',
|
5929
|
+
selectedBorderColor: '#3073F2'
|
5930
|
+
};
|
5458
5931
|
return {
|
5459
5932
|
config: {
|
5933
|
+
table: tableConfig,
|
5934
|
+
pivotTable: tableConfig,
|
5460
5935
|
line: {
|
5461
5936
|
...baseConfig,
|
5462
5937
|
xAxis: bandAxis,
|
@@ -5632,6 +6107,7 @@ const registerAll = ()=>{
|
|
5632
6107
|
registerDarkTheme();
|
5633
6108
|
};
|
5634
6109
|
const external_zod_namespaceObject = require("zod");
|
6110
|
+
var external_zod_default = /*#__PURE__*/ __webpack_require__.n(external_zod_namespaceObject);
|
5635
6111
|
const zChartType = external_zod_namespaceObject.z["enum"]([
|
5636
6112
|
'table',
|
5637
6113
|
'pivotTable',
|
@@ -5661,7 +6137,7 @@ const zDimension = external_zod_namespaceObject.z.object({
|
|
5661
6137
|
'dimension',
|
5662
6138
|
'rowDimension',
|
5663
6139
|
'columnDimension'
|
5664
|
-
]).default('dimension')
|
6140
|
+
]).default('dimension')
|
5665
6141
|
});
|
5666
6142
|
const zDimensionGroup = external_zod_namespaceObject.z.object({
|
5667
6143
|
id: external_zod_namespaceObject.z.string(),
|
@@ -5705,8 +6181,8 @@ const zNumFormat = external_zod_namespaceObject.z.object({
|
|
5705
6181
|
const zMeasure = external_zod_namespaceObject.z.object({
|
5706
6182
|
id: external_zod_namespaceObject.z.string(),
|
5707
6183
|
alias: external_zod_namespaceObject.z.string().optional(),
|
5708
|
-
autoFormat: external_zod_namespaceObject.z.boolean().default(true)
|
5709
|
-
format: zNumFormat["default"]({})
|
6184
|
+
autoFormat: external_zod_namespaceObject.z.boolean().default(true),
|
6185
|
+
format: zNumFormat["default"]({})
|
5710
6186
|
});
|
5711
6187
|
const zMeasureGroup = external_zod_namespaceObject.z.object({
|
5712
6188
|
id: external_zod_namespaceObject.z.string(),
|
@@ -5914,6 +6390,19 @@ const zLegend = external_zod_namespaceObject.z.object({
|
|
5914
6390
|
const zTooltip = external_zod_namespaceObject.z.object({
|
5915
6391
|
enable: external_zod_namespaceObject.z.boolean().default(true).optional()
|
5916
6392
|
});
|
6393
|
+
const zTableConfig = external_zod_namespaceObject.z.object({
|
6394
|
+
borderColor: external_zod_namespaceObject.z.string().optional(),
|
6395
|
+
bodyFontSize: external_zod_namespaceObject.z.number().optional(),
|
6396
|
+
bodyFontColor: external_zod_namespaceObject.z.string().optional(),
|
6397
|
+
bodyBackgroundColor: external_zod_namespaceObject.z.string().optional(),
|
6398
|
+
hoverBodyBackgroundColor: external_zod_namespaceObject.z.string().optional(),
|
6399
|
+
headerFontSize: external_zod_namespaceObject.z.number().optional(),
|
6400
|
+
headerFontColor: external_zod_namespaceObject.z.string().optional(),
|
6401
|
+
headerBackgroundColor: external_zod_namespaceObject.z.string().optional(),
|
6402
|
+
hoverHeaderBackgroundColor: external_zod_namespaceObject.z.string().optional(),
|
6403
|
+
selectedBorderColor: external_zod_namespaceObject.z.string().optional()
|
6404
|
+
});
|
6405
|
+
const zPivotTableConfig = zTableConfig;
|
5917
6406
|
const zLineConfig = external_zod_namespaceObject.z.object({
|
5918
6407
|
backgroundColor: zBackgroundColor.optional(),
|
5919
6408
|
label: zLabel.optional(),
|
@@ -6002,8 +6491,8 @@ const zFunnelConfig = external_zod_namespaceObject.z.object({
|
|
6002
6491
|
legend: zLegend.optional()
|
6003
6492
|
});
|
6004
6493
|
const zConfig = external_zod_namespaceObject.z.object({
|
6005
|
-
table:
|
6006
|
-
pivotTable:
|
6494
|
+
table: zTableConfig.optional(),
|
6495
|
+
pivotTable: zPivotTableConfig.optional(),
|
6007
6496
|
line: zLineConfig.optional(),
|
6008
6497
|
column: zColumnConfig.optional(),
|
6009
6498
|
columnParallel: zColumnParallelConfig.optional(),
|
@@ -6375,6 +6864,25 @@ const zAnnotation = external_zod_namespaceObject.z.object({
|
|
6375
6864
|
annotationHorizontalLine: zAnnotationHorizontalLine.or(external_zod_namespaceObject.z.array(zAnnotationHorizontalLine)).optional(),
|
6376
6865
|
annotationArea: zAnnotationArea.or(external_zod_namespaceObject.z.array(zAnnotationArea)).optional()
|
6377
6866
|
});
|
6867
|
+
const zSortAxis = external_zod_namespaceObject.z.object({
|
6868
|
+
order: external_zod_namespaceObject.z["enum"]([
|
6869
|
+
'asc',
|
6870
|
+
'desc'
|
6871
|
+
]).default('asc'),
|
6872
|
+
orderBy: external_zod_namespaceObject.z.string().optional(),
|
6873
|
+
customOrder: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.any()).optional()
|
6874
|
+
});
|
6875
|
+
const zSortLegend = external_zod_namespaceObject.z.object({
|
6876
|
+
order: external_zod_namespaceObject.z["enum"]([
|
6877
|
+
'asc',
|
6878
|
+
'desc'
|
6879
|
+
]).default('asc'),
|
6880
|
+
orderBy: external_zod_namespaceObject.z.string().optional(),
|
6881
|
+
customOrder: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.any()).optional()
|
6882
|
+
});
|
6883
|
+
const zAnalysis = external_zod_default().object({
|
6884
|
+
orderMapping: external_zod_default().record(external_zod_default().string(), external_zod_default().array(external_zod_default().string())).optional()
|
6885
|
+
});
|
6378
6886
|
const zLocale = external_zod_namespaceObject.z["enum"]([
|
6379
6887
|
'zh-CN',
|
6380
6888
|
'en-US'
|
@@ -6410,6 +6918,8 @@ const zLine = external_zod_namespaceObject.z.object({
|
|
6410
6918
|
xAxis: zXBandAxis.optional(),
|
6411
6919
|
yAxis: zYLinearAxis.optional(),
|
6412
6920
|
crosshairLine: zCrosshairLine.optional(),
|
6921
|
+
sortAxis: zSortAxis.optional(),
|
6922
|
+
sortLegend: zSortLegend.optional(),
|
6413
6923
|
theme: zTheme.optional(),
|
6414
6924
|
pointStyle: zPointStyle.optional(),
|
6415
6925
|
lineStyle: zLineStyle.optional(),
|
@@ -6710,6 +7220,7 @@ const zAdvancedVSeed = external_zod_namespaceObject.z.object({
|
|
6710
7220
|
measures: zMeasureTree,
|
6711
7221
|
encoding: zEncoding,
|
6712
7222
|
config: zConfig,
|
7223
|
+
analysis: zAnalysis,
|
6713
7224
|
theme: zTheme,
|
6714
7225
|
markStyle: zMarkStyle,
|
6715
7226
|
customTheme: zCustomThemeConfig,
|
@@ -6806,6 +7317,7 @@ exports.tableAdvancedPipeline = __webpack_exports__.tableAdvancedPipeline;
|
|
6806
7317
|
exports.tableSpecPipeline = __webpack_exports__.tableSpecPipeline;
|
6807
7318
|
exports.unfoldDimensions = __webpack_exports__.unfoldDimensions;
|
6808
7319
|
exports.zAdvancedVSeed = __webpack_exports__.zAdvancedVSeed;
|
7320
|
+
exports.zAnalysis = __webpack_exports__.zAnalysis;
|
6809
7321
|
exports.zAnnotation = __webpack_exports__.zAnnotation;
|
6810
7322
|
exports.zAnnotationArea = __webpack_exports__.zAnnotationArea;
|
6811
7323
|
exports.zAnnotationHorizontalLine = __webpack_exports__.zAnnotationHorizontalLine;
|
@@ -6867,6 +7379,7 @@ exports.zNumFormat = __webpack_exports__.zNumFormat;
|
|
6867
7379
|
exports.zPie = __webpack_exports__.zPie;
|
6868
7380
|
exports.zPieConfig = __webpack_exports__.zPieConfig;
|
6869
7381
|
exports.zPivotTable = __webpack_exports__.zPivotTable;
|
7382
|
+
exports.zPivotTableConfig = __webpack_exports__.zPivotTableConfig;
|
6870
7383
|
exports.zPointStyle = __webpack_exports__.zPointStyle;
|
6871
7384
|
exports.zRose = __webpack_exports__.zRose;
|
6872
7385
|
exports.zRoseConfig = __webpack_exports__.zRoseConfig;
|
@@ -6874,8 +7387,11 @@ exports.zRoseParallel = __webpack_exports__.zRoseParallel;
|
|
6874
7387
|
exports.zRoseParallelConfig = __webpack_exports__.zRoseParallelConfig;
|
6875
7388
|
exports.zScatter = __webpack_exports__.zScatter;
|
6876
7389
|
exports.zScatterConfig = __webpack_exports__.zScatterConfig;
|
7390
|
+
exports.zSortAxis = __webpack_exports__.zSortAxis;
|
7391
|
+
exports.zSortLegend = __webpack_exports__.zSortLegend;
|
6877
7392
|
exports.zStackCornerRadius = __webpack_exports__.zStackCornerRadius;
|
6878
7393
|
exports.zTable = __webpack_exports__.zTable;
|
7394
|
+
exports.zTableConfig = __webpack_exports__.zTableConfig;
|
6879
7395
|
exports.zTheme = __webpack_exports__.zTheme;
|
6880
7396
|
exports.zTooltip = __webpack_exports__.zTooltip;
|
6881
7397
|
exports.zUnfoldInfo = __webpack_exports__.zUnfoldInfo;
|
@@ -6975,6 +7491,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
6975
7491
|
"tableSpecPipeline",
|
6976
7492
|
"unfoldDimensions",
|
6977
7493
|
"zAdvancedVSeed",
|
7494
|
+
"zAnalysis",
|
6978
7495
|
"zAnnotation",
|
6979
7496
|
"zAnnotationArea",
|
6980
7497
|
"zAnnotationHorizontalLine",
|
@@ -7036,6 +7553,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
7036
7553
|
"zPie",
|
7037
7554
|
"zPieConfig",
|
7038
7555
|
"zPivotTable",
|
7556
|
+
"zPivotTableConfig",
|
7039
7557
|
"zPointStyle",
|
7040
7558
|
"zRose",
|
7041
7559
|
"zRoseConfig",
|
@@ -7043,8 +7561,11 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
7043
7561
|
"zRoseParallelConfig",
|
7044
7562
|
"zScatter",
|
7045
7563
|
"zScatterConfig",
|
7564
|
+
"zSortAxis",
|
7565
|
+
"zSortLegend",
|
7046
7566
|
"zStackCornerRadius",
|
7047
7567
|
"zTable",
|
7568
|
+
"zTableConfig",
|
7048
7569
|
"zTheme",
|
7049
7570
|
"zTooltip",
|
7050
7571
|
"zUnfoldInfo",
|