@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.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
import { clone, groupBy, isArray, isEmpty, isNullish, isNumber, isString, mergeDeep, omit, pick, unique } from "remeda";
|
2
|
-
import {
|
1
|
+
import { clone, groupBy, isArray, isEmpty, isNullish, isNumber, isString, mergeDeep, omit, pick, sort, unique } from "remeda";
|
2
|
+
import { color as external_d3_color_color } from "d3-color";
|
3
|
+
import zod, { z } from "zod";
|
3
4
|
const initAdvancedVSeed = (advancedVSeed, context)=>{
|
4
5
|
const { vseed } = context;
|
5
6
|
const { chartType, locale } = vseed;
|
@@ -61,7 +62,6 @@ const createNumFormatter = (format, locale = intl.getLocale())=>{
|
|
61
62
|
roundingMode,
|
62
63
|
roundingPriority
|
63
64
|
};
|
64
|
-
console.log('debug roundingMode', roundingMode);
|
65
65
|
if (isNumber(fractionDigits)) {
|
66
66
|
if (fractionDigits >= 0) {
|
67
67
|
numFormatterOptions.minimumFractionDigits = fractionDigits;
|
@@ -752,11 +752,12 @@ const encodingXY = (advancedVSeed)=>{
|
|
752
752
|
};
|
753
753
|
const { datasetReshapeInfo, dimensions } = advancedVSeed;
|
754
754
|
if (!datasetReshapeInfo || !dimensions) return result;
|
755
|
+
const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
755
756
|
const isZeroDimension = 0 === dimensions.length;
|
756
757
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
757
758
|
const { foldInfo, unfoldInfo } = cur;
|
758
759
|
const x = [
|
759
|
-
isZeroDimension ? foldInfo.measureName :
|
760
|
+
isZeroDimension ? foldInfo.measureName : xDimension?.id
|
760
761
|
];
|
761
762
|
const y = [
|
762
763
|
foldInfo.measureValue
|
@@ -788,11 +789,12 @@ const encodingYX = (advancedVSeed)=>{
|
|
788
789
|
};
|
789
790
|
const { datasetReshapeInfo, dimensions } = advancedVSeed;
|
790
791
|
if (!datasetReshapeInfo || !dimensions) return result;
|
792
|
+
const yDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
791
793
|
const isZeroDimension = 0 === dimensions.length;
|
792
794
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
793
795
|
const { foldInfo, unfoldInfo } = cur;
|
794
796
|
const y = [
|
795
|
-
isZeroDimension ? foldInfo.measureName :
|
797
|
+
isZeroDimension ? foldInfo.measureName : yDimension?.id
|
796
798
|
];
|
797
799
|
const x = [
|
798
800
|
foldInfo.measureValue
|
@@ -860,6 +862,7 @@ const encodingRose = (advancedVSeed)=>{
|
|
860
862
|
};
|
861
863
|
const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
|
862
864
|
if (!datasetReshapeInfo || !dimensions || !measures) return result;
|
865
|
+
const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
863
866
|
const is1D1M = 1 === dimensions.length && 1 === measures.length;
|
864
867
|
const isZeroDimension = 0 === dimensions.length;
|
865
868
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
@@ -868,13 +871,13 @@ const encodingRose = (advancedVSeed)=>{
|
|
868
871
|
foldInfo.measureValue
|
869
872
|
];
|
870
873
|
const angle = [
|
871
|
-
isZeroDimension ? foldInfo.measureName :
|
874
|
+
isZeroDimension ? foldInfo.measureName : angleDimension?.id
|
872
875
|
];
|
873
876
|
const group = [
|
874
|
-
is1D1M ?
|
877
|
+
is1D1M ? angleDimension?.id : unfoldInfo.groupId
|
875
878
|
];
|
876
879
|
const color = [
|
877
|
-
is1D1M ?
|
880
|
+
is1D1M ? angleDimension?.id : unfoldInfo.groupId
|
878
881
|
];
|
879
882
|
return [
|
880
883
|
...prev,
|
@@ -1094,6 +1097,81 @@ const annotation_annotation = (advancedVSeed, context)=>{
|
|
1094
1097
|
annotation
|
1095
1098
|
};
|
1096
1099
|
};
|
1100
|
+
const sortXBandAxis = (advancedVSeed, context)=>{
|
1101
|
+
const result = {
|
1102
|
+
...advancedVSeed
|
1103
|
+
};
|
1104
|
+
const { vseed } = context;
|
1105
|
+
const { sortAxis, dataset } = vseed;
|
1106
|
+
const { encoding } = advancedVSeed;
|
1107
|
+
const xField = encoding?.[0]?.x?.[0];
|
1108
|
+
if (!sortAxis || !xField) return advancedVSeed;
|
1109
|
+
if (!result.analysis) result.analysis = {};
|
1110
|
+
if (!result.analysis.orderMapping) result.analysis.orderMapping = {};
|
1111
|
+
const axisOrderResult = calcOrder(sortAxis, xField, dataset);
|
1112
|
+
result.analysis.orderMapping[xField] = axisOrderResult;
|
1113
|
+
return result;
|
1114
|
+
};
|
1115
|
+
const sortYBandAxis = (advancedVSeed, context)=>{
|
1116
|
+
const result = {
|
1117
|
+
...advancedVSeed
|
1118
|
+
};
|
1119
|
+
const { vseed } = context;
|
1120
|
+
const { sortAxis, dataset } = vseed;
|
1121
|
+
const { encoding } = advancedVSeed;
|
1122
|
+
const yField = encoding?.[0]?.y?.[0];
|
1123
|
+
if (!sortAxis || !yField) return advancedVSeed;
|
1124
|
+
if (!result.analysis) result.analysis = {};
|
1125
|
+
if (!result.analysis.orderMapping) result.analysis.orderMapping = {};
|
1126
|
+
const axisOrderResult = calcOrder(sortAxis, yField, dataset);
|
1127
|
+
result.analysis.orderMapping[yField] = axisOrderResult;
|
1128
|
+
return result;
|
1129
|
+
};
|
1130
|
+
const sort_sortLegend = (advancedVSeed, context)=>{
|
1131
|
+
const result = {
|
1132
|
+
...advancedVSeed
|
1133
|
+
};
|
1134
|
+
const { vseed } = context;
|
1135
|
+
const { sortLegend } = vseed;
|
1136
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
1137
|
+
const groupField = datasetReshapeInfo?.[0]?.unfoldInfo?.groupId;
|
1138
|
+
const colorIdMap = datasetReshapeInfo?.[0]?.unfoldInfo?.colorIdMap;
|
1139
|
+
const colorItems = datasetReshapeInfo?.[0]?.unfoldInfo?.colorItems;
|
1140
|
+
if (!sortLegend || !groupField || !colorIdMap || !colorItems) return advancedVSeed;
|
1141
|
+
if (!result.analysis) result.analysis = {};
|
1142
|
+
if (!result.analysis.orderMapping) result.analysis.orderMapping = {};
|
1143
|
+
if (sortLegend.customOrder) {
|
1144
|
+
const nameMap = Object.keys(colorIdMap).reduce((pre, cur)=>{
|
1145
|
+
pre[colorIdMap[cur]] = cur;
|
1146
|
+
return pre;
|
1147
|
+
}, {});
|
1148
|
+
const orderRes = sortLegend.customOrder.map((itemNameOrId)=>nameMap[itemNameOrId] ? nameMap[itemNameOrId] : itemNameOrId);
|
1149
|
+
result.analysis.orderMapping[groupField] = orderRes;
|
1150
|
+
return result;
|
1151
|
+
}
|
1152
|
+
const dataset = advancedVSeed.dataset?.flat(2);
|
1153
|
+
const orderRes = calcOrder(sortLegend, groupField, dataset || []);
|
1154
|
+
result.analysis.orderMapping[groupField] = orderRes;
|
1155
|
+
return result;
|
1156
|
+
};
|
1157
|
+
const calcOrder = (sortAxis, id, dataset)=>{
|
1158
|
+
if (sortAxis.customOrder) return sortAxis.customOrder;
|
1159
|
+
const order = sortAxis.order || 'asc';
|
1160
|
+
const orderBy = sortAxis.orderBy;
|
1161
|
+
const res = sort(dataset, (a, b)=>{
|
1162
|
+
const aValue = a[orderBy || id];
|
1163
|
+
const bValue = b[orderBy || id];
|
1164
|
+
if ('asc' === order) {
|
1165
|
+
if (aValue < bValue) return -1;
|
1166
|
+
if (aValue > bValue) return 1;
|
1167
|
+
return 0;
|
1168
|
+
}
|
1169
|
+
if (aValue > bValue) return -1;
|
1170
|
+
if (aValue < bValue) return 1;
|
1171
|
+
return 0;
|
1172
|
+
});
|
1173
|
+
return unique(res.map((item)=>item[id]));
|
1174
|
+
};
|
1097
1175
|
const lineAdvancedPipeline = [
|
1098
1176
|
initAdvancedVSeed,
|
1099
1177
|
autoMeasures,
|
@@ -1104,6 +1182,8 @@ const lineAdvancedPipeline = [
|
|
1104
1182
|
pivotReshapeTo2D1M
|
1105
1183
|
]),
|
1106
1184
|
encodingXY,
|
1185
|
+
sortXBandAxis,
|
1186
|
+
sort_sortLegend,
|
1107
1187
|
lineConfig,
|
1108
1188
|
theme_theme,
|
1109
1189
|
markStyle_markStyle,
|
@@ -1119,6 +1199,8 @@ const barAdvancedPipeline = [
|
|
1119
1199
|
pivotReshapeTo2D1M
|
1120
1200
|
]),
|
1121
1201
|
encodingYX,
|
1202
|
+
sortYBandAxis,
|
1203
|
+
sort_sortLegend,
|
1122
1204
|
barConfig,
|
1123
1205
|
theme_theme,
|
1124
1206
|
markStyle_markStyle,
|
@@ -1134,6 +1216,8 @@ const barParallelAdvancedPipeline = [
|
|
1134
1216
|
pivotReshapeTo2D1M
|
1135
1217
|
]),
|
1136
1218
|
encodingYX,
|
1219
|
+
sortYBandAxis,
|
1220
|
+
sort_sortLegend,
|
1137
1221
|
barParallelConfig,
|
1138
1222
|
theme_theme,
|
1139
1223
|
markStyle_markStyle,
|
@@ -1149,6 +1233,8 @@ const barPercentAdvancedPipeline = [
|
|
1149
1233
|
pivotReshapeTo2D1M
|
1150
1234
|
]),
|
1151
1235
|
encodingYX,
|
1236
|
+
sortYBandAxis,
|
1237
|
+
sort_sortLegend,
|
1152
1238
|
barPercentConfig,
|
1153
1239
|
theme_theme,
|
1154
1240
|
markStyle_markStyle,
|
@@ -1164,6 +1250,8 @@ const columnAdvancedPipeline = [
|
|
1164
1250
|
pivotReshapeTo2D1M
|
1165
1251
|
]),
|
1166
1252
|
encodingXY,
|
1253
|
+
sortXBandAxis,
|
1254
|
+
sort_sortLegend,
|
1167
1255
|
columnConfig,
|
1168
1256
|
theme_theme,
|
1169
1257
|
markStyle_markStyle,
|
@@ -1179,6 +1267,8 @@ const columnParallelAdvancedPipeline = [
|
|
1179
1267
|
pivotReshapeTo2D1M
|
1180
1268
|
]),
|
1181
1269
|
encodingXY,
|
1270
|
+
sortXBandAxis,
|
1271
|
+
sort_sortLegend,
|
1182
1272
|
columnParallelConfig,
|
1183
1273
|
theme_theme,
|
1184
1274
|
markStyle_markStyle,
|
@@ -1194,6 +1284,8 @@ const columnPercentAdvancedPipeline = [
|
|
1194
1284
|
pivotReshapeTo2D1M
|
1195
1285
|
]),
|
1196
1286
|
encodingXY,
|
1287
|
+
sortXBandAxis,
|
1288
|
+
sort_sortLegend,
|
1197
1289
|
columnPercentConfig,
|
1198
1290
|
theme_theme,
|
1199
1291
|
markStyle_markStyle,
|
@@ -1209,6 +1301,8 @@ const areaAdvancedPipeline = [
|
|
1209
1301
|
pivotReshapeTo2D1M
|
1210
1302
|
]),
|
1211
1303
|
encodingXY,
|
1304
|
+
sortXBandAxis,
|
1305
|
+
sort_sortLegend,
|
1212
1306
|
areaConfig,
|
1213
1307
|
theme_theme,
|
1214
1308
|
markStyle_markStyle,
|
@@ -1224,6 +1318,8 @@ const areaPercentAdvancedPipeline = [
|
|
1224
1318
|
pivotReshapeTo2D1M
|
1225
1319
|
]),
|
1226
1320
|
encodingXY,
|
1321
|
+
sortXBandAxis,
|
1322
|
+
sort_sortLegend,
|
1227
1323
|
areaPercentConfig,
|
1228
1324
|
theme_theme,
|
1229
1325
|
markStyle_markStyle,
|
@@ -1470,23 +1566,54 @@ const tableAdvancedPipeline = [
|
|
1470
1566
|
];
|
1471
1567
|
const dataset_dataset = (spec, context)=>{
|
1472
1568
|
const { advancedVSeed } = context;
|
1473
|
-
const { encoding } = advancedVSeed;
|
1569
|
+
const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
|
1570
|
+
const { orderMapping = {} } = analysis ?? {};
|
1474
1571
|
const angle = encoding[0]?.angle?.[0];
|
1475
1572
|
const x = encoding[0]?.x?.[0];
|
1573
|
+
const y = encoding[0]?.y?.[0];
|
1476
1574
|
const group = encoding[0]?.group?.[0];
|
1575
|
+
const id = datasetReshapeInfo[0].id;
|
1477
1576
|
const fields = {};
|
1478
1577
|
if (angle) fields[angle] = {
|
1479
1578
|
sortIndex: 0
|
1480
1579
|
};
|
1481
|
-
if (x)
|
1482
|
-
|
1483
|
-
|
1484
|
-
|
1485
|
-
|
1486
|
-
|
1580
|
+
if (x) {
|
1581
|
+
const order = orderMapping[x];
|
1582
|
+
if (order) fields[x] = {
|
1583
|
+
sortIndex: 0,
|
1584
|
+
domain: order,
|
1585
|
+
lockStatisticsByDomain: true
|
1586
|
+
};
|
1587
|
+
else fields[x] = {
|
1588
|
+
sortIndex: 0
|
1589
|
+
};
|
1590
|
+
}
|
1591
|
+
if (y) {
|
1592
|
+
const order = orderMapping[y];
|
1593
|
+
if (order) fields[y] = {
|
1594
|
+
sortIndex: 0,
|
1595
|
+
domain: order,
|
1596
|
+
lockStatisticsByDomain: true
|
1597
|
+
};
|
1598
|
+
else fields[y] = {
|
1599
|
+
sortIndex: 0
|
1600
|
+
};
|
1601
|
+
}
|
1602
|
+
if (group) {
|
1603
|
+
const order = orderMapping[group];
|
1604
|
+
if (order) fields[group] = {
|
1605
|
+
sortIndex: 0,
|
1606
|
+
domain: order,
|
1607
|
+
lockStatisticsByDomain: true
|
1608
|
+
};
|
1609
|
+
else fields[group] = {
|
1610
|
+
sortIndex: 0
|
1611
|
+
};
|
1612
|
+
}
|
1487
1613
|
return {
|
1488
1614
|
...spec,
|
1489
1615
|
data: {
|
1616
|
+
id,
|
1490
1617
|
values: advancedVSeed.dataset,
|
1491
1618
|
fields: fields
|
1492
1619
|
}
|
@@ -1508,12 +1635,6 @@ const datasetPivot = (spec, context)=>{
|
|
1508
1635
|
records: records
|
1509
1636
|
};
|
1510
1637
|
};
|
1511
|
-
const datasetPivotPlaceholder = (spec)=>({
|
1512
|
-
...spec,
|
1513
|
-
data: {
|
1514
|
-
id: 'placeholderDataId'
|
1515
|
-
}
|
1516
|
-
});
|
1517
1638
|
const initColumn = (spec, context)=>{
|
1518
1639
|
const result = {
|
1519
1640
|
...spec
|
@@ -2542,7 +2663,7 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
2542
2663
|
}), {});
|
2543
2664
|
const { legend, color } = baseConfig;
|
2544
2665
|
const { colorScheme } = color;
|
2545
|
-
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight, maxSize, border, shapeType = 'rectRound' } = legend || {};
|
2666
|
+
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400, maxSize, border, shapeType = 'rectRound' } = legend || {};
|
2546
2667
|
const orient = [
|
2547
2668
|
'bottom',
|
2548
2669
|
'bottomLeft',
|
@@ -3903,7 +4024,7 @@ const pivotLine = [
|
|
3903
4024
|
initLine,
|
3904
4025
|
color_color,
|
3905
4026
|
background_backgroundColor,
|
3906
|
-
|
4027
|
+
dataset_dataset,
|
3907
4028
|
xBand,
|
3908
4029
|
yLinear,
|
3909
4030
|
label_label,
|
@@ -3954,7 +4075,7 @@ const pivotColumn = [
|
|
3954
4075
|
stackInverse,
|
3955
4076
|
color_color,
|
3956
4077
|
background_backgroundColor,
|
3957
|
-
|
4078
|
+
dataset_dataset,
|
3958
4079
|
xBand,
|
3959
4080
|
yLinear,
|
3960
4081
|
label_label,
|
@@ -4001,7 +4122,7 @@ const pivotColumnParallel = [
|
|
4001
4122
|
stackCornerRadius_stackCornerRadius,
|
4002
4123
|
color_color,
|
4003
4124
|
background_backgroundColor,
|
4004
|
-
|
4125
|
+
dataset_dataset,
|
4005
4126
|
xBand,
|
4006
4127
|
yLinear,
|
4007
4128
|
label_label,
|
@@ -4052,7 +4173,7 @@ const pivotColumnPercent = [
|
|
4052
4173
|
color_color,
|
4053
4174
|
percent,
|
4054
4175
|
background_backgroundColor,
|
4055
|
-
|
4176
|
+
dataset_dataset,
|
4056
4177
|
xBand,
|
4057
4178
|
yLinear,
|
4058
4179
|
label_label,
|
@@ -4099,7 +4220,8 @@ const pivotBar = [
|
|
4099
4220
|
stackCornerRadius_stackCornerRadius,
|
4100
4221
|
color_color,
|
4101
4222
|
background_backgroundColor,
|
4102
|
-
|
4223
|
+
dataset_dataset,
|
4224
|
+
xLinear,
|
4103
4225
|
yBand,
|
4104
4226
|
label_label,
|
4105
4227
|
label_label,
|
@@ -4146,9 +4268,9 @@ const pivotBarParallel = [
|
|
4146
4268
|
stackCornerRadius_stackCornerRadius,
|
4147
4269
|
color_color,
|
4148
4270
|
background_backgroundColor,
|
4149
|
-
|
4150
|
-
yBand,
|
4271
|
+
dataset_dataset,
|
4151
4272
|
xLinear,
|
4273
|
+
yBand,
|
4152
4274
|
label_label,
|
4153
4275
|
tooltip_tooltip,
|
4154
4276
|
horizontalCrosshairRect,
|
@@ -4195,7 +4317,7 @@ const pivotBarPercent = [
|
|
4195
4317
|
color_color,
|
4196
4318
|
background_backgroundColor,
|
4197
4319
|
percent,
|
4198
|
-
|
4320
|
+
dataset_dataset,
|
4199
4321
|
yBand,
|
4200
4322
|
xLinear,
|
4201
4323
|
label_label,
|
@@ -4245,7 +4367,7 @@ const pivotArea = [
|
|
4245
4367
|
color_color,
|
4246
4368
|
background_backgroundColor,
|
4247
4369
|
stackInverse,
|
4248
|
-
|
4370
|
+
dataset_dataset,
|
4249
4371
|
xBand,
|
4250
4372
|
yLinear,
|
4251
4373
|
label_label,
|
@@ -4299,7 +4421,7 @@ const pivotAreaPercent = [
|
|
4299
4421
|
color_color,
|
4300
4422
|
background_backgroundColor,
|
4301
4423
|
percent,
|
4302
|
-
|
4424
|
+
dataset_dataset,
|
4303
4425
|
xBand,
|
4304
4426
|
yLinear,
|
4305
4427
|
label_label,
|
@@ -4342,7 +4464,7 @@ const pivotPie = [
|
|
4342
4464
|
initPie,
|
4343
4465
|
color_color,
|
4344
4466
|
background_backgroundColor,
|
4345
|
-
|
4467
|
+
dataset_dataset,
|
4346
4468
|
label_label,
|
4347
4469
|
tooltip_tooltip,
|
4348
4470
|
annotationPoint_annotationPoint,
|
@@ -4379,7 +4501,7 @@ const pivotDonut = [
|
|
4379
4501
|
initDonut,
|
4380
4502
|
color_color,
|
4381
4503
|
background_backgroundColor,
|
4382
|
-
|
4504
|
+
dataset_dataset,
|
4383
4505
|
label_label,
|
4384
4506
|
tooltip_tooltip,
|
4385
4507
|
annotationPoint_annotationPoint,
|
@@ -4419,7 +4541,7 @@ const pivotRose = [
|
|
4419
4541
|
stackInverse,
|
4420
4542
|
color_color,
|
4421
4543
|
background_backgroundColor,
|
4422
|
-
|
4544
|
+
dataset_dataset,
|
4423
4545
|
radiusAxis,
|
4424
4546
|
angleAxis,
|
4425
4547
|
label_label,
|
@@ -4460,7 +4582,7 @@ const pivotRoseParallel = [
|
|
4460
4582
|
stackCornerRadius_stackCornerRadius,
|
4461
4583
|
color_color,
|
4462
4584
|
background_backgroundColor,
|
4463
|
-
|
4585
|
+
dataset_dataset,
|
4464
4586
|
radiusAxis,
|
4465
4587
|
angleAxis,
|
4466
4588
|
label_label,
|
@@ -4500,7 +4622,7 @@ const pivotFunnel = [
|
|
4500
4622
|
initFunnel,
|
4501
4623
|
color_color,
|
4502
4624
|
background_backgroundColor,
|
4503
|
-
|
4625
|
+
dataset_dataset,
|
4504
4626
|
label_label,
|
4505
4627
|
tooltip_tooltip,
|
4506
4628
|
annotationPoint_annotationPoint,
|
@@ -4543,7 +4665,7 @@ const pivotScatter = [
|
|
4543
4665
|
initScatter,
|
4544
4666
|
color_color,
|
4545
4667
|
background_backgroundColor,
|
4546
|
-
|
4668
|
+
dataset_dataset,
|
4547
4669
|
xLinear,
|
4548
4670
|
yLinear,
|
4549
4671
|
label_label,
|
@@ -4574,7 +4696,22 @@ const initTable = (spec, context)=>{
|
|
4574
4696
|
heightMode: 'autoHeight',
|
4575
4697
|
autoWrapText: true,
|
4576
4698
|
columnResizeMode: 'all',
|
4577
|
-
showHeader: true
|
4699
|
+
showHeader: true,
|
4700
|
+
tooltip: {
|
4701
|
+
isShowOverflowTextTooltip: true
|
4702
|
+
},
|
4703
|
+
animationAppear: {
|
4704
|
+
duration: 300,
|
4705
|
+
delay: 250,
|
4706
|
+
type: 'one-by-one',
|
4707
|
+
direction: 'row'
|
4708
|
+
},
|
4709
|
+
hover: {
|
4710
|
+
highlightMode: 'row'
|
4711
|
+
},
|
4712
|
+
theme: {
|
4713
|
+
underlayBackgroundColor: 'transparent'
|
4714
|
+
}
|
4578
4715
|
};
|
4579
4716
|
};
|
4580
4717
|
const initPivotTable = (spec, context)=>{
|
@@ -4586,7 +4723,30 @@ const initPivotTable = (spec, context)=>{
|
|
4586
4723
|
widthMode: 'standard',
|
4587
4724
|
heightMode: 'autoHeight',
|
4588
4725
|
autoWrapText: true,
|
4589
|
-
columnResizeMode: 'all'
|
4726
|
+
columnResizeMode: 'all',
|
4727
|
+
columnResizeType: 'column',
|
4728
|
+
showColumnHeader: true,
|
4729
|
+
showRowHeader: true,
|
4730
|
+
select: {
|
4731
|
+
highlightMode: 'cell',
|
4732
|
+
headerSelectMode: 'inline'
|
4733
|
+
},
|
4734
|
+
hover: {
|
4735
|
+
highlightMode: 'cross'
|
4736
|
+
},
|
4737
|
+
tooltip: {
|
4738
|
+
isShowOverflowTextTooltip: true
|
4739
|
+
},
|
4740
|
+
widthAdaptiveMode: 'all',
|
4741
|
+
animationAppear: {
|
4742
|
+
duration: 300,
|
4743
|
+
delay: 250,
|
4744
|
+
type: 'one-by-one',
|
4745
|
+
direction: 'row'
|
4746
|
+
},
|
4747
|
+
theme: {
|
4748
|
+
underlayBackgroundColor: 'transparent'
|
4749
|
+
}
|
4590
4750
|
};
|
4591
4751
|
};
|
4592
4752
|
const measureTreeToColumns = (spec, context)=>{
|
@@ -4595,7 +4755,13 @@ const measureTreeToColumns = (spec, context)=>{
|
|
4595
4755
|
const result = {
|
4596
4756
|
...spec
|
4597
4757
|
};
|
4598
|
-
const
|
4758
|
+
const eachNode = (node)=>{
|
4759
|
+
if ('children' in node) return {};
|
4760
|
+
return {
|
4761
|
+
width: 'auto'
|
4762
|
+
};
|
4763
|
+
};
|
4764
|
+
const columns = treeTreeToColumns(measures, eachNode);
|
4599
4765
|
return {
|
4600
4766
|
...result,
|
4601
4767
|
columns: [
|
@@ -4610,7 +4776,13 @@ const dimensionTreeToColumns = (spec, context)=>{
|
|
4610
4776
|
const result = {
|
4611
4777
|
...spec
|
4612
4778
|
};
|
4613
|
-
const
|
4779
|
+
const eachNode = (node)=>{
|
4780
|
+
if ('children' in node) return {};
|
4781
|
+
return {
|
4782
|
+
width: 'auto'
|
4783
|
+
};
|
4784
|
+
};
|
4785
|
+
const columns = treeTreeToColumns(dimensions, eachNode);
|
4614
4786
|
return {
|
4615
4787
|
...result,
|
4616
4788
|
columns: [
|
@@ -4619,19 +4791,30 @@ const dimensionTreeToColumns = (spec, context)=>{
|
|
4619
4791
|
]
|
4620
4792
|
};
|
4621
4793
|
};
|
4622
|
-
const treeTreeToColumns = (tree
|
4794
|
+
const treeTreeToColumns = (tree, callback)=>{
|
4623
4795
|
const result = tree.map((item)=>{
|
4624
|
-
|
4625
|
-
|
4626
|
-
|
4627
|
-
|
4628
|
-
|
4629
|
-
|
4630
|
-
|
4631
|
-
|
4632
|
-
|
4633
|
-
|
4634
|
-
|
4796
|
+
if ('children' in item && Array.isArray(item.children)) {
|
4797
|
+
const groupNode = item;
|
4798
|
+
const field = groupNode.id;
|
4799
|
+
const title = groupNode.alias ?? groupNode.id;
|
4800
|
+
const props = callback?.(groupNode) || {};
|
4801
|
+
return {
|
4802
|
+
field,
|
4803
|
+
title,
|
4804
|
+
columns: treeTreeToColumns(item.children, callback),
|
4805
|
+
...props
|
4806
|
+
};
|
4807
|
+
}
|
4808
|
+
{
|
4809
|
+
const field = item.id;
|
4810
|
+
const title = item.alias ?? item.id;
|
4811
|
+
const props = callback?.(item) || {};
|
4812
|
+
return {
|
4813
|
+
field,
|
4814
|
+
title,
|
4815
|
+
...props
|
4816
|
+
};
|
4817
|
+
}
|
4635
4818
|
});
|
4636
4819
|
return result || [];
|
4637
4820
|
};
|
@@ -4667,6 +4850,7 @@ const pivotIndicators_pivotIndicators = (spec, context)=>{
|
|
4667
4850
|
return {
|
4668
4851
|
...spec,
|
4669
4852
|
indicatorsAsCol: true,
|
4853
|
+
indicatorTitle: intl.i18n`指标名称`,
|
4670
4854
|
indicators: measures.map((item)=>({
|
4671
4855
|
cellType: 'text',
|
4672
4856
|
indicatorKey: item.id,
|
@@ -4675,16 +4859,254 @@ const pivotIndicators_pivotIndicators = (spec, context)=>{
|
|
4675
4859
|
}))
|
4676
4860
|
};
|
4677
4861
|
};
|
4862
|
+
const bodyStyle = (spec, context)=>{
|
4863
|
+
const result = {
|
4864
|
+
...spec
|
4865
|
+
};
|
4866
|
+
const { advancedVSeed } = context;
|
4867
|
+
const { customTheme, chartType } = advancedVSeed;
|
4868
|
+
const themConfig = customTheme?.config?.[chartType];
|
4869
|
+
if (!result.theme || !themConfig) return result;
|
4870
|
+
const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
|
4871
|
+
const backgroundColor = themConfig.bodyBackgroundColor || '#fff';
|
4872
|
+
const fontColor = themConfig.bodyFontColor || '#1B1F23';
|
4873
|
+
const fontSize = themConfig.bodyFontSize || 12;
|
4874
|
+
const hoverCellBgColor = themConfig.hoverBodyBackgroundColor || '#bedaff';
|
4875
|
+
const hoverInlineColor = external_d3_color_color(hoverCellBgColor)?.copy({
|
4876
|
+
opacity: 0.2
|
4877
|
+
}).toString();
|
4878
|
+
result.theme.bodyStyle = {
|
4879
|
+
borderColor: borderColor,
|
4880
|
+
borderLineWidth: 1,
|
4881
|
+
padding: [
|
4882
|
+
8.6,
|
4883
|
+
12,
|
4884
|
+
8.6,
|
4885
|
+
12
|
4886
|
+
],
|
4887
|
+
textAlign: 'right',
|
4888
|
+
hover: {
|
4889
|
+
cellBgColor: hoverCellBgColor,
|
4890
|
+
inlineRowBgColor: hoverInlineColor,
|
4891
|
+
inlineColumnBgColor: hoverInlineColor
|
4892
|
+
},
|
4893
|
+
color: fontColor,
|
4894
|
+
fontSize: fontSize,
|
4895
|
+
fontStyle: 'normal',
|
4896
|
+
fontWeight: 'normal',
|
4897
|
+
fontVariant: 'normal',
|
4898
|
+
bgColor: backgroundColor,
|
4899
|
+
lineHeight: 1.5 * fontSize
|
4900
|
+
};
|
4901
|
+
return result;
|
4902
|
+
};
|
4903
|
+
const headerStyle = (spec, context)=>{
|
4904
|
+
const result = {
|
4905
|
+
...spec
|
4906
|
+
};
|
4907
|
+
const { advancedVSeed } = context;
|
4908
|
+
const { customTheme, chartType } = advancedVSeed;
|
4909
|
+
const themConfig = customTheme?.config?.[chartType];
|
4910
|
+
if (!result.theme || !themConfig) return result;
|
4911
|
+
const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
|
4912
|
+
const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
|
4913
|
+
const fontColor = themConfig.headerFontColor || '#1B1F23';
|
4914
|
+
const fontSize = themConfig.headerFontSize || 12;
|
4915
|
+
const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
|
4916
|
+
const hoverInlineColor = themConfig.hoverHeaderBackgroundColor;
|
4917
|
+
result.theme.headerStyle = {
|
4918
|
+
borderColor: borderColor,
|
4919
|
+
borderLineWidth: 1,
|
4920
|
+
padding: [
|
4921
|
+
8,
|
4922
|
+
12,
|
4923
|
+
8,
|
4924
|
+
12
|
4925
|
+
],
|
4926
|
+
textAlign: 'center',
|
4927
|
+
hover: {
|
4928
|
+
cellBgColor: external_d3_color_color(hoverCellBgColor)?.copy({
|
4929
|
+
opacity: 1
|
4930
|
+
}).brighter(0.5).toString(),
|
4931
|
+
inlineRowBgColor: hoverInlineColor,
|
4932
|
+
inlineColumnBgColor: hoverInlineColor
|
4933
|
+
},
|
4934
|
+
frameStyle: {
|
4935
|
+
borderColor: [
|
4936
|
+
null,
|
4937
|
+
null,
|
4938
|
+
borderColor,
|
4939
|
+
null
|
4940
|
+
],
|
4941
|
+
borderLineWidth: 1
|
4942
|
+
},
|
4943
|
+
fontSize: fontSize,
|
4944
|
+
fontVariant: 'normal',
|
4945
|
+
fontStyle: 'normal',
|
4946
|
+
fontWeight: 'bold',
|
4947
|
+
color: fontColor,
|
4948
|
+
bgColor: backgroundColor,
|
4949
|
+
lineHeight: 1.5 * fontSize
|
4950
|
+
};
|
4951
|
+
return result;
|
4952
|
+
};
|
4953
|
+
const rowHeaderStyle = (spec, context)=>{
|
4954
|
+
const result = {
|
4955
|
+
...spec
|
4956
|
+
};
|
4957
|
+
const { advancedVSeed } = context;
|
4958
|
+
const { customTheme, chartType } = advancedVSeed;
|
4959
|
+
const themConfig = customTheme?.config?.[chartType];
|
4960
|
+
if (!result.theme || !themConfig) return result;
|
4961
|
+
const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
|
4962
|
+
const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
|
4963
|
+
const fontColor = themConfig.headerFontColor || '#1B1F23';
|
4964
|
+
const fontSize = themConfig.headerFontSize || 12;
|
4965
|
+
const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
|
4966
|
+
const hoverInlineColor = themConfig.hoverHeaderBackgroundColor;
|
4967
|
+
result.theme.rowHeaderStyle = {
|
4968
|
+
borderColor: borderColor,
|
4969
|
+
borderLineWidth: 1,
|
4970
|
+
padding: [
|
4971
|
+
8.6,
|
4972
|
+
12,
|
4973
|
+
8.6,
|
4974
|
+
12
|
4975
|
+
],
|
4976
|
+
textAlign: 'left',
|
4977
|
+
hover: {
|
4978
|
+
cellBgColor: external_d3_color_color(hoverCellBgColor)?.copy({
|
4979
|
+
opacity: 1
|
4980
|
+
}).brighter(0.5).toString(),
|
4981
|
+
inlineRowBgColor: hoverInlineColor,
|
4982
|
+
inlineColumnBgColor: hoverInlineColor
|
4983
|
+
},
|
4984
|
+
frameStyle: {
|
4985
|
+
borderColor: [
|
4986
|
+
null,
|
4987
|
+
borderColor,
|
4988
|
+
null,
|
4989
|
+
null
|
4990
|
+
],
|
4991
|
+
borderLineWidth: 1
|
4992
|
+
},
|
4993
|
+
fontSize: fontSize,
|
4994
|
+
fontVariant: 'normal',
|
4995
|
+
fontStyle: 'normal',
|
4996
|
+
fontWeight: 'bold',
|
4997
|
+
color: fontColor,
|
4998
|
+
bgColor: backgroundColor,
|
4999
|
+
lineHeight: 1.5 * fontSize
|
5000
|
+
};
|
5001
|
+
return result;
|
5002
|
+
};
|
5003
|
+
const cornerHeaderStyle = (spec, context)=>{
|
5004
|
+
const result = {
|
5005
|
+
...spec
|
5006
|
+
};
|
5007
|
+
const { advancedVSeed } = context;
|
5008
|
+
const { customTheme, chartType } = advancedVSeed;
|
5009
|
+
const themConfig = customTheme?.config?.[chartType];
|
5010
|
+
if (!result.theme || !themConfig) return result;
|
5011
|
+
const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
|
5012
|
+
const backgroundColor = themConfig.headerBackgroundColor || '#EEF1F5';
|
5013
|
+
const fontColor = themConfig.headerFontColor || '#1B1F23';
|
5014
|
+
const fontSize = themConfig.headerFontSize || 12;
|
5015
|
+
const hoverCellBgColor = themConfig.hoverHeaderBackgroundColor || '#bedaff';
|
5016
|
+
const hoverInlineColor = themConfig.hoverHeaderBackgroundColor;
|
5017
|
+
result.theme.cornerHeaderStyle = {
|
5018
|
+
borderColor: [
|
5019
|
+
borderColor,
|
5020
|
+
borderColor
|
5021
|
+
],
|
5022
|
+
borderLineWidth: 1,
|
5023
|
+
padding: [
|
5024
|
+
8,
|
5025
|
+
12,
|
5026
|
+
8,
|
5027
|
+
12
|
5028
|
+
],
|
5029
|
+
textAlign: 'left',
|
5030
|
+
hover: {
|
5031
|
+
cellBgColor: external_d3_color_color(hoverCellBgColor)?.copy({
|
5032
|
+
opacity: 1
|
5033
|
+
}).brighter(0.5).toString(),
|
5034
|
+
inlineRowBgColor: hoverInlineColor,
|
5035
|
+
inlineColumnBgColor: hoverInlineColor
|
5036
|
+
},
|
5037
|
+
frameStyle: {
|
5038
|
+
borderColor: [
|
5039
|
+
null,
|
5040
|
+
borderColor,
|
5041
|
+
borderColor,
|
5042
|
+
null
|
5043
|
+
],
|
5044
|
+
borderLineWidth: 1
|
5045
|
+
},
|
5046
|
+
fontSize: fontSize,
|
5047
|
+
fontVariant: 'normal',
|
5048
|
+
fontStyle: 'normal',
|
5049
|
+
fontWeight: 'bold',
|
5050
|
+
color: fontColor,
|
5051
|
+
bgColor: backgroundColor,
|
5052
|
+
lineHeight: 1.5 * fontSize
|
5053
|
+
};
|
5054
|
+
return result;
|
5055
|
+
};
|
5056
|
+
const frameStyle = (spec, context)=>{
|
5057
|
+
const result = {
|
5058
|
+
...spec
|
5059
|
+
};
|
5060
|
+
const { advancedVSeed } = context;
|
5061
|
+
const { customTheme, chartType } = advancedVSeed;
|
5062
|
+
const themConfig = customTheme?.config?.[chartType];
|
5063
|
+
if (!result.theme || !themConfig) return result;
|
5064
|
+
const borderColor = themConfig.borderColor || 'rgb(224, 224, 224)';
|
5065
|
+
result.theme.frameStyle = {
|
5066
|
+
borderColor,
|
5067
|
+
borderLineWidth: 0,
|
5068
|
+
cornerRadius: 4
|
5069
|
+
};
|
5070
|
+
return result;
|
5071
|
+
};
|
5072
|
+
const selectionStyle = (spec, context)=>{
|
5073
|
+
const result = {
|
5074
|
+
...spec
|
5075
|
+
};
|
5076
|
+
const { advancedVSeed } = context;
|
5077
|
+
const { customTheme, chartType } = advancedVSeed;
|
5078
|
+
const themConfig = customTheme?.config?.[chartType];
|
5079
|
+
if (!result.theme || !themConfig) return result;
|
5080
|
+
const borderColor = themConfig.selectedBorderColor || 'rgb(224, 224, 224)';
|
5081
|
+
result.theme.selectionStyle = {
|
5082
|
+
cellBorderColor: borderColor,
|
5083
|
+
cellBorderLineWidth: 2,
|
5084
|
+
cellBgColor: external_d3_color_color(borderColor)?.copy({
|
5085
|
+
opacity: 0.15
|
5086
|
+
}).toString()
|
5087
|
+
};
|
5088
|
+
return result;
|
5089
|
+
};
|
4678
5090
|
const tableSpecPipeline = [
|
4679
5091
|
initTable,
|
4680
5092
|
dimensionTreeToColumns,
|
4681
|
-
measureTreeToColumns
|
5093
|
+
measureTreeToColumns,
|
5094
|
+
bodyStyle,
|
5095
|
+
headerStyle,
|
5096
|
+
frameStyle,
|
5097
|
+
selectionStyle
|
4682
5098
|
];
|
4683
5099
|
const pivotTableSpecPipeline = [
|
4684
5100
|
initPivotTable,
|
4685
5101
|
pivotColumns,
|
4686
5102
|
pivotRows,
|
4687
|
-
pivotIndicators_pivotIndicators
|
5103
|
+
pivotIndicators_pivotIndicators,
|
5104
|
+
bodyStyle,
|
5105
|
+
headerStyle,
|
5106
|
+
rowHeaderStyle,
|
5107
|
+
cornerHeaderStyle,
|
5108
|
+
frameStyle,
|
5109
|
+
selectionStyle
|
4688
5110
|
];
|
4689
5111
|
const buildAdvanced = (builder)=>{
|
4690
5112
|
const { chartType } = builder.vseed;
|
@@ -4737,6 +5159,16 @@ const getColorItems = (builder)=>{
|
|
4737
5159
|
}), {});
|
4738
5160
|
return colorItems.map((d)=>colorIdMap[d]);
|
4739
5161
|
};
|
5162
|
+
const getColorIdMap = (builder)=>{
|
5163
|
+
const advancedVSeed = builder.advancedVSeed;
|
5164
|
+
if (!advancedVSeed) return {};
|
5165
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
5166
|
+
const colorIdMap = datasetReshapeInfo.reduce((prev, cur)=>({
|
5167
|
+
...prev,
|
5168
|
+
...cur.unfoldInfo.colorIdMap
|
5169
|
+
}), {});
|
5170
|
+
return colorIdMap;
|
5171
|
+
};
|
4740
5172
|
class Builder {
|
4741
5173
|
_vseed;
|
4742
5174
|
_advancedVSeed = null;
|
@@ -4753,6 +5185,7 @@ class Builder {
|
|
4753
5185
|
getTheme = (themeKey)=>Builder._themeMap[themeKey];
|
4754
5186
|
getThemeMap = ()=>Builder._themeMap;
|
4755
5187
|
getColorItems = ()=>getColorItems(this);
|
5188
|
+
getColorIdMap = ()=>getColorIdMap(this);
|
4756
5189
|
get vseed() {
|
4757
5190
|
return this._vseed;
|
4758
5191
|
}
|
@@ -4981,8 +5414,22 @@ const darkTheme = ()=>{
|
|
4981
5414
|
labelFontWeight: 400
|
4982
5415
|
}
|
4983
5416
|
};
|
5417
|
+
const tableConfig = {
|
5418
|
+
borderColor: '#4b4e53',
|
5419
|
+
bodyFontSize: 12,
|
5420
|
+
bodyFontColor: '#fdfdfd',
|
5421
|
+
bodyBackgroundColor: 'transparent',
|
5422
|
+
headerFontSize: 12,
|
5423
|
+
headerFontColor: '#fdfdfd',
|
5424
|
+
headerBackgroundColor: '#36393e',
|
5425
|
+
hoverBodyBackgroundColor: '#4284ff66',
|
5426
|
+
hoverHeaderBackgroundColor: '#5f5f5f88',
|
5427
|
+
selectedBorderColor: '#3073F2'
|
5428
|
+
};
|
4984
5429
|
return {
|
4985
5430
|
config: {
|
5431
|
+
table: tableConfig,
|
5432
|
+
pivotTable: tableConfig,
|
4986
5433
|
line: {
|
4987
5434
|
...baseConfig,
|
4988
5435
|
xAxis: bandAxis,
|
@@ -5261,8 +5708,22 @@ const lightTheme = ()=>{
|
|
5261
5708
|
labelFontWeight: 400
|
5262
5709
|
}
|
5263
5710
|
};
|
5711
|
+
const tableConfig = {
|
5712
|
+
borderColor: '#e3e5eb',
|
5713
|
+
bodyFontSize: 12,
|
5714
|
+
bodyFontColor: '#141414',
|
5715
|
+
bodyBackgroundColor: 'transparent',
|
5716
|
+
headerFontSize: 12,
|
5717
|
+
headerFontColor: '#21252c',
|
5718
|
+
headerBackgroundColor: '#f6f7f9',
|
5719
|
+
hoverBodyBackgroundColor: '#bedaff',
|
5720
|
+
hoverHeaderBackgroundColor: '#D9DDE488',
|
5721
|
+
selectedBorderColor: '#4080ff'
|
5722
|
+
};
|
5264
5723
|
return {
|
5265
5724
|
config: {
|
5725
|
+
table: tableConfig,
|
5726
|
+
pivotTable: tableConfig,
|
5266
5727
|
line: {
|
5267
5728
|
...baseConfig,
|
5268
5729
|
xAxis: bandAxis,
|
@@ -5466,7 +5927,7 @@ const zDimension = z.object({
|
|
5466
5927
|
'dimension',
|
5467
5928
|
'rowDimension',
|
5468
5929
|
'columnDimension'
|
5469
|
-
]).default('dimension')
|
5930
|
+
]).default('dimension')
|
5470
5931
|
});
|
5471
5932
|
const zDimensionGroup = z.object({
|
5472
5933
|
id: z.string(),
|
@@ -5510,8 +5971,8 @@ const zNumFormat = z.object({
|
|
5510
5971
|
const zMeasure = z.object({
|
5511
5972
|
id: z.string(),
|
5512
5973
|
alias: z.string().optional(),
|
5513
|
-
autoFormat: z.boolean().default(true)
|
5514
|
-
format: zNumFormat["default"]({})
|
5974
|
+
autoFormat: z.boolean().default(true),
|
5975
|
+
format: zNumFormat["default"]({})
|
5515
5976
|
});
|
5516
5977
|
const zMeasureGroup = z.object({
|
5517
5978
|
id: z.string(),
|
@@ -5719,6 +6180,19 @@ const zLegend = z.object({
|
|
5719
6180
|
const zTooltip = z.object({
|
5720
6181
|
enable: z.boolean().default(true).optional()
|
5721
6182
|
});
|
6183
|
+
const zTableConfig = z.object({
|
6184
|
+
borderColor: z.string().optional(),
|
6185
|
+
bodyFontSize: z.number().optional(),
|
6186
|
+
bodyFontColor: z.string().optional(),
|
6187
|
+
bodyBackgroundColor: z.string().optional(),
|
6188
|
+
hoverBodyBackgroundColor: z.string().optional(),
|
6189
|
+
headerFontSize: z.number().optional(),
|
6190
|
+
headerFontColor: z.string().optional(),
|
6191
|
+
headerBackgroundColor: z.string().optional(),
|
6192
|
+
hoverHeaderBackgroundColor: z.string().optional(),
|
6193
|
+
selectedBorderColor: z.string().optional()
|
6194
|
+
});
|
6195
|
+
const zPivotTableConfig = zTableConfig;
|
5722
6196
|
const zLineConfig = z.object({
|
5723
6197
|
backgroundColor: zBackgroundColor.optional(),
|
5724
6198
|
label: zLabel.optional(),
|
@@ -5807,8 +6281,8 @@ const zFunnelConfig = z.object({
|
|
5807
6281
|
legend: zLegend.optional()
|
5808
6282
|
});
|
5809
6283
|
const zConfig = z.object({
|
5810
|
-
table:
|
5811
|
-
pivotTable:
|
6284
|
+
table: zTableConfig.optional(),
|
6285
|
+
pivotTable: zPivotTableConfig.optional(),
|
5812
6286
|
line: zLineConfig.optional(),
|
5813
6287
|
column: zColumnConfig.optional(),
|
5814
6288
|
columnParallel: zColumnParallelConfig.optional(),
|
@@ -6180,6 +6654,25 @@ const zAnnotation = z.object({
|
|
6180
6654
|
annotationHorizontalLine: zAnnotationHorizontalLine.or(z.array(zAnnotationHorizontalLine)).optional(),
|
6181
6655
|
annotationArea: zAnnotationArea.or(z.array(zAnnotationArea)).optional()
|
6182
6656
|
});
|
6657
|
+
const zSortAxis = z.object({
|
6658
|
+
order: z["enum"]([
|
6659
|
+
'asc',
|
6660
|
+
'desc'
|
6661
|
+
]).default('asc'),
|
6662
|
+
orderBy: z.string().optional(),
|
6663
|
+
customOrder: z.array(z.any()).optional()
|
6664
|
+
});
|
6665
|
+
const zSortLegend = z.object({
|
6666
|
+
order: z["enum"]([
|
6667
|
+
'asc',
|
6668
|
+
'desc'
|
6669
|
+
]).default('asc'),
|
6670
|
+
orderBy: z.string().optional(),
|
6671
|
+
customOrder: z.array(z.any()).optional()
|
6672
|
+
});
|
6673
|
+
const zAnalysis = zod.object({
|
6674
|
+
orderMapping: zod.record(zod.string(), zod.array(zod.string())).optional()
|
6675
|
+
});
|
6183
6676
|
const zLocale = z["enum"]([
|
6184
6677
|
'zh-CN',
|
6185
6678
|
'en-US'
|
@@ -6215,6 +6708,8 @@ const zLine = z.object({
|
|
6215
6708
|
xAxis: zXBandAxis.optional(),
|
6216
6709
|
yAxis: zYLinearAxis.optional(),
|
6217
6710
|
crosshairLine: zCrosshairLine.optional(),
|
6711
|
+
sortAxis: zSortAxis.optional(),
|
6712
|
+
sortLegend: zSortLegend.optional(),
|
6218
6713
|
theme: zTheme.optional(),
|
6219
6714
|
pointStyle: zPointStyle.optional(),
|
6220
6715
|
lineStyle: zLineStyle.optional(),
|
@@ -6515,12 +7010,13 @@ const zAdvancedVSeed = z.object({
|
|
6515
7010
|
measures: zMeasureTree,
|
6516
7011
|
encoding: zEncoding,
|
6517
7012
|
config: zConfig,
|
7013
|
+
analysis: zAnalysis,
|
6518
7014
|
theme: zTheme,
|
6519
7015
|
markStyle: zMarkStyle,
|
6520
7016
|
customTheme: zCustomThemeConfig,
|
6521
7017
|
annotation: zAnnotation,
|
6522
7018
|
locale: zLocale
|
6523
7019
|
});
|
6524
|
-
export { Builder, FoldMeasureId, FoldMeasureName, FoldMeasureValue, ORIGINAL_DATA, Separator, UnfoldDimensionGroup, UnfoldDimensionGroupId, areaAdvancedPipeline, areaPercentAdvancedPipeline, areaPercentSpecPipeline, areaSpecPipeline, autoFormatter, autoNumFormatter, barAdvancedPipeline, barParallelAdvancedPipeline, barParallelSpecPipeline, barPercentAdvancedPipeline, barPercentSpecPipeline, barSpecPipeline, columnAdvancedPipeline, columnParallelAdvancedPipeline, columnParallelSpecPipeline, columnPercentAdvancedPipeline, columnPercentSpecPipeline, columnSpecPipeline, createFormatter, createNumFormatter, darkTheme, dataReshapeFor1D1M, dataReshapeFor1D2M, dataReshapeFor2D1M, donutAdvancedPipeline, donutSpecPipeline, execPipeline, findAllDimensions, findAllMeasures, findDimensionById, findFirstDimension, findFirstMeasure, findMeasureById, foldMeasures, funnelAdvancedPipeline, funnelSpecPipeline, i18n, intl, isPivotChart, isPivotTable, isTable, isVChart, isVTable, lightTheme, lineAdvancedPipeline, lineSpecPipeline, pieAdvancedPipeline, pieSpecPipeline, pivotTableAdvancedPipeline, pivotTableSpecPipeline, preorderTraverse, registerAll, registerArea, registerAreaPercent, registerBar, registerBarParallel, registerBarPercent, registerColumn, registerColumnParallel, registerColumnPercent, registerCustomTheme, registerDarkTheme, registerDonut, registerFunnel, registerLightTheme, registerLine, registerPie, registerPivotTable, registerRose, registerRoseParallel, registerScatter, registerTable, roseAdvancedPipeline, roseParallelAdvancedPipeline, roseParallelSpecPipeline, roseSpecPipeline, scatterAdvancedPipeline, scatterSpecPipeline, tableAdvancedPipeline, tableSpecPipeline, unfoldDimensions, zAdvancedVSeed, zAnnotation, zAnnotationArea, zAnnotationHorizontalLine, zAnnotationPoint, zAnnotationVerticalLine, zArea, zAreaConfig, zAreaPercent, zAreaPercentConfig, zAreaStyle, zAxis, zBackgroundColor, zBar, zBarConfig, zBarParallel, zBarParallelConfig, zBarPercent, zBarPercentConfig, zBarStyle, zChartType, zColor, zColumn, zColumnConfig, zColumnParallel, zColumnParallelConfig, zColumnPercent, zColumnPercentConfig, zConfig, zCrosshairLine, zCrosshairRect, zCustomTheme, zCustomThemeConfig, zDataset, zDatasetReshapeInfo, zDatum, zDimension, zDimensionGroup, zDimensionTree, zDimensions, zDonut, zDonutConfig, zDualAxisConfig, zEncoding, zFoldInfo, zFunnel, zFunnelConfig, zLabel, zLegend, zLine, zLineConfig, zLineStyle, zLocale, zMarkStyle, zMeasure, zMeasureGroup, zMeasureTree, zMeasures, zNumFormat, zPie, zPieConfig, zPivotTable, zPointStyle, zRose, zRoseConfig, zRoseParallel, zRoseParallelConfig, zScatter, zScatterConfig, zStackCornerRadius, zTable, zTheme, zTooltip, zUnfoldInfo, zVSeed, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
|
7020
|
+
export { Builder, FoldMeasureId, FoldMeasureName, FoldMeasureValue, ORIGINAL_DATA, Separator, UnfoldDimensionGroup, UnfoldDimensionGroupId, areaAdvancedPipeline, areaPercentAdvancedPipeline, areaPercentSpecPipeline, areaSpecPipeline, autoFormatter, autoNumFormatter, barAdvancedPipeline, barParallelAdvancedPipeline, barParallelSpecPipeline, barPercentAdvancedPipeline, barPercentSpecPipeline, barSpecPipeline, columnAdvancedPipeline, columnParallelAdvancedPipeline, columnParallelSpecPipeline, columnPercentAdvancedPipeline, columnPercentSpecPipeline, columnSpecPipeline, createFormatter, createNumFormatter, darkTheme, dataReshapeFor1D1M, dataReshapeFor1D2M, dataReshapeFor2D1M, donutAdvancedPipeline, donutSpecPipeline, execPipeline, findAllDimensions, findAllMeasures, findDimensionById, findFirstDimension, findFirstMeasure, findMeasureById, foldMeasures, funnelAdvancedPipeline, funnelSpecPipeline, i18n, intl, isPivotChart, isPivotTable, isTable, isVChart, isVTable, lightTheme, lineAdvancedPipeline, lineSpecPipeline, pieAdvancedPipeline, pieSpecPipeline, pivotTableAdvancedPipeline, pivotTableSpecPipeline, preorderTraverse, registerAll, registerArea, registerAreaPercent, registerBar, registerBarParallel, registerBarPercent, registerColumn, registerColumnParallel, registerColumnPercent, registerCustomTheme, registerDarkTheme, registerDonut, registerFunnel, registerLightTheme, registerLine, registerPie, registerPivotTable, registerRose, registerRoseParallel, registerScatter, registerTable, roseAdvancedPipeline, roseParallelAdvancedPipeline, roseParallelSpecPipeline, roseSpecPipeline, scatterAdvancedPipeline, scatterSpecPipeline, tableAdvancedPipeline, tableSpecPipeline, unfoldDimensions, zAdvancedVSeed, zAnalysis, zAnnotation, zAnnotationArea, zAnnotationHorizontalLine, zAnnotationPoint, zAnnotationVerticalLine, zArea, zAreaConfig, zAreaPercent, zAreaPercentConfig, zAreaStyle, zAxis, zBackgroundColor, zBar, zBarConfig, zBarParallel, zBarParallelConfig, zBarPercent, zBarPercentConfig, zBarStyle, zChartType, zColor, zColumn, zColumnConfig, zColumnParallel, zColumnParallelConfig, zColumnPercent, zColumnPercentConfig, zConfig, zCrosshairLine, zCrosshairRect, zCustomTheme, zCustomThemeConfig, zDataset, zDatasetReshapeInfo, zDatum, zDimension, zDimensionGroup, zDimensionTree, zDimensions, zDonut, zDonutConfig, zDualAxisConfig, zEncoding, zFoldInfo, zFunnel, zFunnelConfig, zLabel, zLegend, zLine, zLineConfig, zLineStyle, zLocale, zMarkStyle, zMeasure, zMeasureGroup, zMeasureTree, zMeasures, zNumFormat, zPie, zPieConfig, zPivotTable, zPivotTableConfig, zPointStyle, zRose, zRoseConfig, zRoseParallel, zRoseParallelConfig, zScatter, zScatterConfig, zSortAxis, zSortLegend, zStackCornerRadius, zTable, zTableConfig, zTheme, zTooltip, zUnfoldInfo, zVSeed, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
|
6525
7021
|
|
6526
7022
|
//# sourceMappingURL=index.js.map
|