@visactor/vseed 0.0.21 → 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.
Files changed (31) hide show
  1. package/dist/builder/builder/advanced/colorItems.d.ts +1 -0
  2. package/dist/builder/builder/advanced/index.d.ts +1 -1
  3. package/dist/builder/builder/builder.d.ts +10 -0
  4. package/dist/index.cjs +214 -38
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.js +198 -41
  7. package/dist/index.js.map +1 -1
  8. package/dist/pipeline/advanced/chart/pipes/analysis/index.d.ts +1 -0
  9. package/dist/pipeline/advanced/chart/pipes/analysis/sort.d.ts +4 -0
  10. package/dist/pipeline/advanced/chart/pipes/index.d.ts +1 -0
  11. package/dist/pipeline/spec/chart/pipes/dataset/datasetPivot.d.ts +0 -1
  12. package/dist/pipeline/spec/chart/pipes/dataset/index.d.ts +1 -1
  13. package/dist/types/advancedVSeed.d.ts +3 -0
  14. package/dist/types/chartType/area/area.d.ts +25 -1
  15. package/dist/types/chartType/areaPercent/areaPercent.d.ts +25 -1
  16. package/dist/types/chartType/bar/bar.d.ts +25 -1
  17. package/dist/types/chartType/barParallel/barParallel.d.ts +25 -1
  18. package/dist/types/chartType/barPercent/barPercent.d.ts +25 -1
  19. package/dist/types/chartType/column/column.d.ts +25 -1
  20. package/dist/types/chartType/columnParallel/columnParallel.d.ts +25 -1
  21. package/dist/types/chartType/columnPercent/columnPercent.d.ts +25 -1
  22. package/dist/types/chartType/line/line.d.ts +41 -1
  23. package/dist/types/properties/analysis/analysis.d.ts +4 -0
  24. package/dist/types/properties/analysis/index.d.ts +3 -0
  25. package/dist/types/properties/analysis/sortAxis.d.ts +39 -0
  26. package/dist/types/properties/analysis/sortLegend.d.ts +39 -0
  27. package/dist/types/properties/index.d.ts +1 -0
  28. package/dist/types/vseed.d.ts +16 -0
  29. package/dist/umd/index.js +8105 -78
  30. package/dist/umd/index.js.map +1 -1
  31. package/package.json +1 -1
@@ -1,2 +1,3 @@
1
1
  import type { Builder } from '../builder';
2
2
  export declare const getColorItems: (builder: Builder) => string[];
3
+ export declare const getColorIdMap: (builder: Builder) => Record<string, string>;
@@ -1 +1 @@
1
- export { getColorItems } from './colorItems';
1
+ export * from './colorItems';
@@ -1317,6 +1317,9 @@ export declare class Builder implements VSeedBuilder {
1317
1317
  } | undefined;
1318
1318
  } | undefined;
1319
1319
  };
1320
+ analysis: {
1321
+ orderMapping?: Record<string, string[]> | undefined;
1322
+ };
1320
1323
  theme: string;
1321
1324
  markStyle: {
1322
1325
  barStyle?: {
@@ -5652,6 +5655,7 @@ export declare class Builder implements VSeedBuilder {
5652
5655
  } | undefined;
5653
5656
  }>;
5654
5657
  getColorItems: () => string[];
5658
+ getColorIdMap: () => Record<string, string>;
5655
5659
  get vseed(): VSeed;
5656
5660
  set vseed(value: VSeed);
5657
5661
  get advancedVSeed(): {
@@ -6965,6 +6969,9 @@ export declare class Builder implements VSeedBuilder {
6965
6969
  } | undefined;
6966
6970
  } | undefined;
6967
6971
  };
6972
+ analysis: {
6973
+ orderMapping?: Record<string, string[]> | undefined;
6974
+ };
6968
6975
  theme: string;
6969
6976
  markStyle: {
6970
6977
  barStyle?: {
@@ -10082,6 +10089,9 @@ export declare class Builder implements VSeedBuilder {
10082
10089
  } | undefined;
10083
10090
  } | undefined;
10084
10091
  };
10092
+ analysis: {
10093
+ orderMapping?: Record<string, string[]> | undefined;
10094
+ };
10085
10095
  theme: string;
10086
10096
  markStyle: {
10087
10097
  barStyle?: {
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,
@@ -86,6 +97,7 @@ __webpack_require__.d(__webpack_exports__, {
86
97
  registerBarPercent: ()=>registerBarPercent,
87
98
  roseSpecPipeline: ()=>roseSpecPipeline,
88
99
  zPivotTable: ()=>zPivotTable,
100
+ zSortAxis: ()=>zSortAxis,
89
101
  registerLightTheme: ()=>registerLightTheme,
90
102
  roseAdvancedPipeline: ()=>roseAdvancedPipeline,
91
103
  zBarParallel: ()=>zBarParallel,
@@ -257,7 +269,6 @@ const createNumFormatter = (format, locale = intl.getLocale())=>{
257
269
  roundingMode,
258
270
  roundingPriority
259
271
  };
260
- console.log('debug roundingMode', roundingMode);
261
272
  if ((0, external_remeda_namespaceObject.isNumber)(fractionDigits)) {
262
273
  if (fractionDigits >= 0) {
263
274
  numFormatterOptions.minimumFractionDigits = fractionDigits;
@@ -948,11 +959,12 @@ const encodingXY = (advancedVSeed)=>{
948
959
  };
949
960
  const { datasetReshapeInfo, dimensions } = advancedVSeed;
950
961
  if (!datasetReshapeInfo || !dimensions) return result;
962
+ const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
951
963
  const isZeroDimension = 0 === dimensions.length;
952
964
  const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
953
965
  const { foldInfo, unfoldInfo } = cur;
954
966
  const x = [
955
- isZeroDimension ? foldInfo.measureName : dimensions[0].id
967
+ isZeroDimension ? foldInfo.measureName : xDimension?.id
956
968
  ];
957
969
  const y = [
958
970
  foldInfo.measureValue
@@ -984,11 +996,12 @@ const encodingYX = (advancedVSeed)=>{
984
996
  };
985
997
  const { datasetReshapeInfo, dimensions } = advancedVSeed;
986
998
  if (!datasetReshapeInfo || !dimensions) return result;
999
+ const yDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
987
1000
  const isZeroDimension = 0 === dimensions.length;
988
1001
  const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
989
1002
  const { foldInfo, unfoldInfo } = cur;
990
1003
  const y = [
991
- isZeroDimension ? foldInfo.measureName : dimensions[0].id
1004
+ isZeroDimension ? foldInfo.measureName : yDimension?.id
992
1005
  ];
993
1006
  const x = [
994
1007
  foldInfo.measureValue
@@ -1056,6 +1069,7 @@ const encodingRose = (advancedVSeed)=>{
1056
1069
  };
1057
1070
  const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
1058
1071
  if (!datasetReshapeInfo || !dimensions || !measures) return result;
1072
+ const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
1059
1073
  const is1D1M = 1 === dimensions.length && 1 === measures.length;
1060
1074
  const isZeroDimension = 0 === dimensions.length;
1061
1075
  const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
@@ -1064,13 +1078,13 @@ const encodingRose = (advancedVSeed)=>{
1064
1078
  foldInfo.measureValue
1065
1079
  ];
1066
1080
  const angle = [
1067
- isZeroDimension ? foldInfo.measureName : dimensions[0].id
1081
+ isZeroDimension ? foldInfo.measureName : angleDimension?.id
1068
1082
  ];
1069
1083
  const group = [
1070
- is1D1M ? dimensions[0].id : unfoldInfo.groupId
1084
+ is1D1M ? angleDimension?.id : unfoldInfo.groupId
1071
1085
  ];
1072
1086
  const color = [
1073
- is1D1M ? dimensions[0].id : unfoldInfo.groupId
1087
+ is1D1M ? angleDimension?.id : unfoldInfo.groupId
1074
1088
  ];
1075
1089
  return [
1076
1090
  ...prev,
@@ -1290,6 +1304,81 @@ const annotation_annotation = (advancedVSeed, context)=>{
1290
1304
  annotation
1291
1305
  };
1292
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
+ };
1293
1382
  const lineAdvancedPipeline = [
1294
1383
  initAdvancedVSeed,
1295
1384
  autoMeasures,
@@ -1300,6 +1389,8 @@ const lineAdvancedPipeline = [
1300
1389
  pivotReshapeTo2D1M
1301
1390
  ]),
1302
1391
  encodingXY,
1392
+ sortXBandAxis,
1393
+ sort_sortLegend,
1303
1394
  lineConfig,
1304
1395
  theme_theme,
1305
1396
  markStyle_markStyle,
@@ -1315,6 +1406,8 @@ const barAdvancedPipeline = [
1315
1406
  pivotReshapeTo2D1M
1316
1407
  ]),
1317
1408
  encodingYX,
1409
+ sortYBandAxis,
1410
+ sort_sortLegend,
1318
1411
  barConfig,
1319
1412
  theme_theme,
1320
1413
  markStyle_markStyle,
@@ -1330,6 +1423,8 @@ const barParallelAdvancedPipeline = [
1330
1423
  pivotReshapeTo2D1M
1331
1424
  ]),
1332
1425
  encodingYX,
1426
+ sortYBandAxis,
1427
+ sort_sortLegend,
1333
1428
  barParallelConfig,
1334
1429
  theme_theme,
1335
1430
  markStyle_markStyle,
@@ -1345,6 +1440,8 @@ const barPercentAdvancedPipeline = [
1345
1440
  pivotReshapeTo2D1M
1346
1441
  ]),
1347
1442
  encodingYX,
1443
+ sortYBandAxis,
1444
+ sort_sortLegend,
1348
1445
  barPercentConfig,
1349
1446
  theme_theme,
1350
1447
  markStyle_markStyle,
@@ -1360,6 +1457,8 @@ const columnAdvancedPipeline = [
1360
1457
  pivotReshapeTo2D1M
1361
1458
  ]),
1362
1459
  encodingXY,
1460
+ sortXBandAxis,
1461
+ sort_sortLegend,
1363
1462
  columnConfig,
1364
1463
  theme_theme,
1365
1464
  markStyle_markStyle,
@@ -1375,6 +1474,8 @@ const columnParallelAdvancedPipeline = [
1375
1474
  pivotReshapeTo2D1M
1376
1475
  ]),
1377
1476
  encodingXY,
1477
+ sortXBandAxis,
1478
+ sort_sortLegend,
1378
1479
  columnParallelConfig,
1379
1480
  theme_theme,
1380
1481
  markStyle_markStyle,
@@ -1390,6 +1491,8 @@ const columnPercentAdvancedPipeline = [
1390
1491
  pivotReshapeTo2D1M
1391
1492
  ]),
1392
1493
  encodingXY,
1494
+ sortXBandAxis,
1495
+ sort_sortLegend,
1393
1496
  columnPercentConfig,
1394
1497
  theme_theme,
1395
1498
  markStyle_markStyle,
@@ -1405,6 +1508,8 @@ const areaAdvancedPipeline = [
1405
1508
  pivotReshapeTo2D1M
1406
1509
  ]),
1407
1510
  encodingXY,
1511
+ sortXBandAxis,
1512
+ sort_sortLegend,
1408
1513
  areaConfig,
1409
1514
  theme_theme,
1410
1515
  markStyle_markStyle,
@@ -1420,6 +1525,8 @@ const areaPercentAdvancedPipeline = [
1420
1525
  pivotReshapeTo2D1M
1421
1526
  ]),
1422
1527
  encodingXY,
1528
+ sortXBandAxis,
1529
+ sort_sortLegend,
1423
1530
  areaPercentConfig,
1424
1531
  theme_theme,
1425
1532
  markStyle_markStyle,
@@ -1666,23 +1773,54 @@ const tableAdvancedPipeline = [
1666
1773
  ];
1667
1774
  const dataset_dataset = (spec, context)=>{
1668
1775
  const { advancedVSeed } = context;
1669
- const { encoding } = advancedVSeed;
1776
+ const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
1777
+ const { orderMapping = {} } = analysis ?? {};
1670
1778
  const angle = encoding[0]?.angle?.[0];
1671
1779
  const x = encoding[0]?.x?.[0];
1780
+ const y = encoding[0]?.y?.[0];
1672
1781
  const group = encoding[0]?.group?.[0];
1782
+ const id = datasetReshapeInfo[0].id;
1673
1783
  const fields = {};
1674
1784
  if (angle) fields[angle] = {
1675
1785
  sortIndex: 0
1676
1786
  };
1677
- if (x) fields[x] = {
1678
- sortIndex: 0
1679
- };
1680
- if (group) fields[group] = {
1681
- sortIndex: 1
1682
- };
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
+ }
1683
1820
  return {
1684
1821
  ...spec,
1685
1822
  data: {
1823
+ id,
1686
1824
  values: advancedVSeed.dataset,
1687
1825
  fields: fields
1688
1826
  }
@@ -1704,12 +1842,6 @@ const datasetPivot = (spec, context)=>{
1704
1842
  records: records
1705
1843
  };
1706
1844
  };
1707
- const datasetPivotPlaceholder = (spec)=>({
1708
- ...spec,
1709
- data: {
1710
- id: 'placeholderDataId'
1711
- }
1712
- });
1713
1845
  const initColumn = (spec, context)=>{
1714
1846
  const result = {
1715
1847
  ...spec
@@ -2738,7 +2870,7 @@ const pivotDiscreteLegend = (spec, context)=>{
2738
2870
  }), {});
2739
2871
  const { legend, color } = baseConfig;
2740
2872
  const { colorScheme } = color;
2741
- 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 || {};
2742
2874
  const orient = [
2743
2875
  'bottom',
2744
2876
  'bottomLeft',
@@ -4099,7 +4231,7 @@ const pivotLine = [
4099
4231
  initLine,
4100
4232
  color_color,
4101
4233
  background_backgroundColor,
4102
- datasetPivotPlaceholder,
4234
+ dataset_dataset,
4103
4235
  xBand,
4104
4236
  yLinear,
4105
4237
  label_label,
@@ -4150,7 +4282,7 @@ const pivotColumn = [
4150
4282
  stackInverse,
4151
4283
  color_color,
4152
4284
  background_backgroundColor,
4153
- datasetPivotPlaceholder,
4285
+ dataset_dataset,
4154
4286
  xBand,
4155
4287
  yLinear,
4156
4288
  label_label,
@@ -4197,7 +4329,7 @@ const pivotColumnParallel = [
4197
4329
  stackCornerRadius_stackCornerRadius,
4198
4330
  color_color,
4199
4331
  background_backgroundColor,
4200
- datasetPivotPlaceholder,
4332
+ dataset_dataset,
4201
4333
  xBand,
4202
4334
  yLinear,
4203
4335
  label_label,
@@ -4248,7 +4380,7 @@ const pivotColumnPercent = [
4248
4380
  color_color,
4249
4381
  percent,
4250
4382
  background_backgroundColor,
4251
- datasetPivotPlaceholder,
4383
+ dataset_dataset,
4252
4384
  xBand,
4253
4385
  yLinear,
4254
4386
  label_label,
@@ -4295,7 +4427,8 @@ const pivotBar = [
4295
4427
  stackCornerRadius_stackCornerRadius,
4296
4428
  color_color,
4297
4429
  background_backgroundColor,
4298
- datasetPivotPlaceholder,
4430
+ dataset_dataset,
4431
+ xLinear,
4299
4432
  yBand,
4300
4433
  label_label,
4301
4434
  label_label,
@@ -4342,9 +4475,9 @@ const pivotBarParallel = [
4342
4475
  stackCornerRadius_stackCornerRadius,
4343
4476
  color_color,
4344
4477
  background_backgroundColor,
4345
- datasetPivotPlaceholder,
4346
- yBand,
4478
+ dataset_dataset,
4347
4479
  xLinear,
4480
+ yBand,
4348
4481
  label_label,
4349
4482
  tooltip_tooltip,
4350
4483
  horizontalCrosshairRect,
@@ -4391,7 +4524,7 @@ const pivotBarPercent = [
4391
4524
  color_color,
4392
4525
  background_backgroundColor,
4393
4526
  percent,
4394
- datasetPivotPlaceholder,
4527
+ dataset_dataset,
4395
4528
  yBand,
4396
4529
  xLinear,
4397
4530
  label_label,
@@ -4441,7 +4574,7 @@ const pivotArea = [
4441
4574
  color_color,
4442
4575
  background_backgroundColor,
4443
4576
  stackInverse,
4444
- datasetPivotPlaceholder,
4577
+ dataset_dataset,
4445
4578
  xBand,
4446
4579
  yLinear,
4447
4580
  label_label,
@@ -4495,7 +4628,7 @@ const pivotAreaPercent = [
4495
4628
  color_color,
4496
4629
  background_backgroundColor,
4497
4630
  percent,
4498
- datasetPivotPlaceholder,
4631
+ dataset_dataset,
4499
4632
  xBand,
4500
4633
  yLinear,
4501
4634
  label_label,
@@ -4538,7 +4671,7 @@ const pivotPie = [
4538
4671
  initPie,
4539
4672
  color_color,
4540
4673
  background_backgroundColor,
4541
- datasetPivotPlaceholder,
4674
+ dataset_dataset,
4542
4675
  label_label,
4543
4676
  tooltip_tooltip,
4544
4677
  annotationPoint_annotationPoint,
@@ -4575,7 +4708,7 @@ const pivotDonut = [
4575
4708
  initDonut,
4576
4709
  color_color,
4577
4710
  background_backgroundColor,
4578
- datasetPivotPlaceholder,
4711
+ dataset_dataset,
4579
4712
  label_label,
4580
4713
  tooltip_tooltip,
4581
4714
  annotationPoint_annotationPoint,
@@ -4615,7 +4748,7 @@ const pivotRose = [
4615
4748
  stackInverse,
4616
4749
  color_color,
4617
4750
  background_backgroundColor,
4618
- datasetPivotPlaceholder,
4751
+ dataset_dataset,
4619
4752
  radiusAxis,
4620
4753
  angleAxis,
4621
4754
  label_label,
@@ -4656,7 +4789,7 @@ const pivotRoseParallel = [
4656
4789
  stackCornerRadius_stackCornerRadius,
4657
4790
  color_color,
4658
4791
  background_backgroundColor,
4659
- datasetPivotPlaceholder,
4792
+ dataset_dataset,
4660
4793
  radiusAxis,
4661
4794
  angleAxis,
4662
4795
  label_label,
@@ -4696,7 +4829,7 @@ const pivotFunnel = [
4696
4829
  initFunnel,
4697
4830
  color_color,
4698
4831
  background_backgroundColor,
4699
- datasetPivotPlaceholder,
4832
+ dataset_dataset,
4700
4833
  label_label,
4701
4834
  tooltip_tooltip,
4702
4835
  annotationPoint_annotationPoint,
@@ -4739,7 +4872,7 @@ const pivotScatter = [
4739
4872
  initScatter,
4740
4873
  color_color,
4741
4874
  background_backgroundColor,
4742
- datasetPivotPlaceholder,
4875
+ dataset_dataset,
4743
4876
  xLinear,
4744
4877
  yLinear,
4745
4878
  label_label,
@@ -4780,6 +4913,9 @@ const initTable = (spec, context)=>{
4780
4913
  type: 'one-by-one',
4781
4914
  direction: 'row'
4782
4915
  },
4916
+ hover: {
4917
+ highlightMode: 'row'
4918
+ },
4783
4919
  theme: {
4784
4920
  underlayBackgroundColor: 'transparent'
4785
4921
  }
@@ -4945,7 +5081,7 @@ const bodyStyle = (spec, context)=>{
4945
5081
  const fontSize = themConfig.bodyFontSize || 12;
4946
5082
  const hoverCellBgColor = themConfig.hoverBodyBackgroundColor || '#bedaff';
4947
5083
  const hoverInlineColor = (0, external_d3_color_namespaceObject.color)(hoverCellBgColor)?.copy({
4948
- opacity: 0.1
5084
+ opacity: 0.2
4949
5085
  }).toString();
4950
5086
  result.theme.bodyStyle = {
4951
5087
  borderColor: borderColor,
@@ -5137,7 +5273,7 @@ const frameStyle = (spec, context)=>{
5137
5273
  result.theme.frameStyle = {
5138
5274
  borderColor,
5139
5275
  borderLineWidth: 0,
5140
- cornerRadius: 0
5276
+ cornerRadius: 4
5141
5277
  };
5142
5278
  return result;
5143
5279
  };
@@ -5231,6 +5367,16 @@ const getColorItems = (builder)=>{
5231
5367
  }), {});
5232
5368
  return colorItems.map((d)=>colorIdMap[d]);
5233
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
+ };
5234
5380
  class Builder {
5235
5381
  _vseed;
5236
5382
  _advancedVSeed = null;
@@ -5247,6 +5393,7 @@ class Builder {
5247
5393
  getTheme = (themeKey)=>Builder._themeMap[themeKey];
5248
5394
  getThemeMap = ()=>Builder._themeMap;
5249
5395
  getColorItems = ()=>getColorItems(this);
5396
+ getColorIdMap = ()=>getColorIdMap(this);
5250
5397
  get vseed() {
5251
5398
  return this._vseed;
5252
5399
  }
@@ -5960,6 +6107,7 @@ const registerAll = ()=>{
5960
6107
  registerDarkTheme();
5961
6108
  };
5962
6109
  const external_zod_namespaceObject = require("zod");
6110
+ var external_zod_default = /*#__PURE__*/ __webpack_require__.n(external_zod_namespaceObject);
5963
6111
  const zChartType = external_zod_namespaceObject.z["enum"]([
5964
6112
  'table',
5965
6113
  'pivotTable',
@@ -6716,6 +6864,25 @@ const zAnnotation = external_zod_namespaceObject.z.object({
6716
6864
  annotationHorizontalLine: zAnnotationHorizontalLine.or(external_zod_namespaceObject.z.array(zAnnotationHorizontalLine)).optional(),
6717
6865
  annotationArea: zAnnotationArea.or(external_zod_namespaceObject.z.array(zAnnotationArea)).optional()
6718
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
+ });
6719
6886
  const zLocale = external_zod_namespaceObject.z["enum"]([
6720
6887
  'zh-CN',
6721
6888
  'en-US'
@@ -6751,6 +6918,8 @@ const zLine = external_zod_namespaceObject.z.object({
6751
6918
  xAxis: zXBandAxis.optional(),
6752
6919
  yAxis: zYLinearAxis.optional(),
6753
6920
  crosshairLine: zCrosshairLine.optional(),
6921
+ sortAxis: zSortAxis.optional(),
6922
+ sortLegend: zSortLegend.optional(),
6754
6923
  theme: zTheme.optional(),
6755
6924
  pointStyle: zPointStyle.optional(),
6756
6925
  lineStyle: zLineStyle.optional(),
@@ -7051,6 +7220,7 @@ const zAdvancedVSeed = external_zod_namespaceObject.z.object({
7051
7220
  measures: zMeasureTree,
7052
7221
  encoding: zEncoding,
7053
7222
  config: zConfig,
7223
+ analysis: zAnalysis,
7054
7224
  theme: zTheme,
7055
7225
  markStyle: zMarkStyle,
7056
7226
  customTheme: zCustomThemeConfig,
@@ -7147,6 +7317,7 @@ exports.tableAdvancedPipeline = __webpack_exports__.tableAdvancedPipeline;
7147
7317
  exports.tableSpecPipeline = __webpack_exports__.tableSpecPipeline;
7148
7318
  exports.unfoldDimensions = __webpack_exports__.unfoldDimensions;
7149
7319
  exports.zAdvancedVSeed = __webpack_exports__.zAdvancedVSeed;
7320
+ exports.zAnalysis = __webpack_exports__.zAnalysis;
7150
7321
  exports.zAnnotation = __webpack_exports__.zAnnotation;
7151
7322
  exports.zAnnotationArea = __webpack_exports__.zAnnotationArea;
7152
7323
  exports.zAnnotationHorizontalLine = __webpack_exports__.zAnnotationHorizontalLine;
@@ -7216,6 +7387,8 @@ exports.zRoseParallel = __webpack_exports__.zRoseParallel;
7216
7387
  exports.zRoseParallelConfig = __webpack_exports__.zRoseParallelConfig;
7217
7388
  exports.zScatter = __webpack_exports__.zScatter;
7218
7389
  exports.zScatterConfig = __webpack_exports__.zScatterConfig;
7390
+ exports.zSortAxis = __webpack_exports__.zSortAxis;
7391
+ exports.zSortLegend = __webpack_exports__.zSortLegend;
7219
7392
  exports.zStackCornerRadius = __webpack_exports__.zStackCornerRadius;
7220
7393
  exports.zTable = __webpack_exports__.zTable;
7221
7394
  exports.zTableConfig = __webpack_exports__.zTableConfig;
@@ -7318,6 +7491,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
7318
7491
  "tableSpecPipeline",
7319
7492
  "unfoldDimensions",
7320
7493
  "zAdvancedVSeed",
7494
+ "zAnalysis",
7321
7495
  "zAnnotation",
7322
7496
  "zAnnotationArea",
7323
7497
  "zAnnotationHorizontalLine",
@@ -7387,6 +7561,8 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
7387
7561
  "zRoseParallelConfig",
7388
7562
  "zScatter",
7389
7563
  "zScatterConfig",
7564
+ "zSortAxis",
7565
+ "zSortLegend",
7390
7566
  "zStackCornerRadius",
7391
7567
  "zTable",
7392
7568
  "zTableConfig",