@visactor/vseed 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/builder/builder/builder.d.ts +116 -0
  2. package/dist/dataReshape/constant.d.ts +0 -8
  3. package/dist/dataReshape/foldMeasures.d.ts +6 -24
  4. package/dist/index.cjs +571 -299
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.js +554 -261
  7. package/dist/index.js.map +1 -1
  8. package/dist/pipeline/advanced/chart/pipes/encoding/index.d.ts +1 -0
  9. package/dist/pipeline/advanced/chart/pipes/encoding/line.d.ts +2 -0
  10. package/dist/pipeline/spec/chart/pipes/color/colorAdapter.d.ts +3 -0
  11. package/dist/pipeline/spec/chart/pipes/color/colorAreaStyleFill.d.ts +2 -0
  12. package/dist/pipeline/spec/chart/pipes/color/colorBarStyleFill.d.ts +2 -0
  13. package/dist/pipeline/spec/chart/pipes/color/colorLineStyleFill.d.ts +2 -0
  14. package/dist/pipeline/spec/chart/pipes/color/colorPointStyleFill.d.ts +2 -0
  15. package/dist/pipeline/spec/chart/pipes/color/index.d.ts +6 -0
  16. package/dist/pipeline/spec/chart/pipes/{tooltip/tooltipDisable.d.ts → color/linearColor.d.ts} +1 -1
  17. package/dist/pipeline/spec/chart/pipes/legend/colorLegend.d.ts +2 -0
  18. package/dist/pipeline/spec/chart/pipes/legend/index.d.ts +2 -0
  19. package/dist/pipeline/spec/chart/pipes/legend/pivotColorLegend.d.ts +2 -0
  20. package/dist/pipeline/spec/chart/pipes/tooltip/index.d.ts +0 -1
  21. package/dist/pipeline/utils/dimensions/find.d.ts +0 -2
  22. package/dist/pipeline/utils/dimensions/index.d.ts +0 -1
  23. package/dist/pipeline/utils/dimensions/typeGuard.d.ts +0 -4
  24. package/dist/types/advancedVSeed.d.ts +40 -0
  25. package/dist/types/chartType/area/area.d.ts +5 -2
  26. package/dist/types/chartType/area/zArea.d.ts +1 -0
  27. package/dist/types/chartType/areaPercent/areaPercent.d.ts +5 -2
  28. package/dist/types/chartType/areaPercent/zAreaPercent.d.ts +1 -0
  29. package/dist/types/chartType/bar/bar.d.ts +5 -2
  30. package/dist/types/chartType/bar/zBar.d.ts +1 -0
  31. package/dist/types/chartType/barParallel/barParallel.d.ts +5 -2
  32. package/dist/types/chartType/barParallel/zBarParallel.d.ts +1 -0
  33. package/dist/types/chartType/barPercent/barPercent.d.ts +5 -2
  34. package/dist/types/chartType/barPercent/zBarPercent.d.ts +1 -0
  35. package/dist/types/chartType/column/column.d.ts +5 -2
  36. package/dist/types/chartType/column/zColumn.d.ts +1 -0
  37. package/dist/types/chartType/columnParallel/columnParallel.d.ts +6 -3
  38. package/dist/types/chartType/columnParallel/zColumnParallel.d.ts +1 -0
  39. package/dist/types/chartType/columnPercent/columnPercent.d.ts +6 -3
  40. package/dist/types/chartType/columnPercent/zColumnPercent.d.ts +1 -0
  41. package/dist/types/chartType/donut/donut.d.ts +8 -6
  42. package/dist/types/chartType/donut/zDonut.d.ts +1 -0
  43. package/dist/types/chartType/dualAxis/dualAxis.d.ts +7 -3
  44. package/dist/types/chartType/dualAxis/zDualAxis.d.ts +1 -0
  45. package/dist/types/chartType/funnel/funnel.d.ts +5 -2
  46. package/dist/types/chartType/funnel/zFunnel.d.ts +2 -0
  47. package/dist/types/chartType/heatmap/heatmap.d.ts +5 -2
  48. package/dist/types/chartType/heatmap/zHeatmap.d.ts +2 -0
  49. package/dist/types/chartType/line/line.d.ts +5 -2
  50. package/dist/types/chartType/line/zLine.d.ts +1 -0
  51. package/dist/types/chartType/pie/pie.d.ts +7 -5
  52. package/dist/types/chartType/pie/zPie.d.ts +1 -0
  53. package/dist/types/chartType/radar/radar.d.ts +5 -2
  54. package/dist/types/chartType/radar/zRadar.d.ts +1 -0
  55. package/dist/types/chartType/rose/rose.d.ts +5 -2
  56. package/dist/types/chartType/rose/zRose.d.ts +1 -0
  57. package/dist/types/chartType/roseParallel/roseParallel.d.ts +6 -3
  58. package/dist/types/chartType/roseParallel/zRoseParallel.d.ts +1 -0
  59. package/dist/types/chartType/scatter/scatter.d.ts +6 -2
  60. package/dist/types/chartType/scatter/zScatter.d.ts +1 -0
  61. package/dist/types/properties/config/color/color.d.ts +8 -2
  62. package/dist/types/properties/config/config.d.ts +36 -0
  63. package/dist/types/properties/config/legend/legend.d.ts +9 -5
  64. package/dist/types/properties/datasetReshapeInfo/datasetReshapeInfo.d.ts +2 -0
  65. package/dist/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.d.ts +6 -0
  66. package/dist/types/properties/theme/customTheme.d.ts +36 -0
  67. package/dist/types/zVseed.d.ts +20 -0
  68. package/dist/umd/index.js +571 -285
  69. package/dist/umd/index.js.map +1 -1
  70. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -24,7 +24,6 @@ var __webpack_require__ = {};
24
24
  var __webpack_exports__ = {};
25
25
  __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
- zTooltip: ()=>zTooltip,
28
27
  funnelAdvancedPipeline: ()=>funnelAdvancedPipeline,
29
28
  zHeatmapConfig: ()=>zHeatmapConfig,
30
29
  zBar: ()=>zBar,
@@ -74,12 +73,10 @@ __webpack_require__.d(__webpack_exports__, {
74
73
  zRoseParallel: ()=>zRoseParallel,
75
74
  MeasureName: ()=>MeasureName,
76
75
  zDataset: ()=>zDataset,
77
- UnfoldDimensionGroupId: ()=>UnfoldDimensionGroupId,
78
76
  zNumFormat: ()=>zNumFormat,
79
77
  barPercentAdvancedPipeline: ()=>barPercentAdvancedPipeline,
80
78
  findAllDimensions: ()=>findAllDimensions,
81
79
  FoldYMeasureValue: ()=>FoldYMeasureValue,
82
- findDimensionById: ()=>findDimensionById,
83
80
  zPivotTableConfig: ()=>zPivotTableConfig,
84
81
  zArea: ()=>zArea,
85
82
  zColumnParallel: ()=>zColumnParallel,
@@ -105,31 +102,31 @@ __webpack_require__.d(__webpack_exports__, {
105
102
  registerLightTheme: ()=>registerLightTheme,
106
103
  roseAdvancedPipeline: ()=>roseAdvancedPipeline,
107
104
  zBarParallel: ()=>zBarParallel,
108
- registerDarkTheme: ()=>registerDarkTheme,
109
- registerPivotTable: ()=>registerPivotTable,
110
105
  isPartialDatumSelector: ()=>isPartialDatumSelector,
111
- pieSpecPipeline: ()=>pieSpecPipeline,
112
- isDimensionGroup: ()=>isDimensionGroup,
113
- dualAxisSpecPipeline: ()=>dualAxisSpecPipeline,
106
+ registerPivotTable: ()=>registerPivotTable,
114
107
  tableAdvancedPipeline: ()=>tableAdvancedPipeline,
115
- barSpecPipeline: ()=>barSpecPipeline,
108
+ registerDarkTheme: ()=>registerDarkTheme,
109
+ dualAxisSpecPipeline: ()=>dualAxisSpecPipeline,
110
+ pieSpecPipeline: ()=>pieSpecPipeline,
116
111
  zAnnotationVerticalLine: ()=>zAnnotationVerticalLine,
117
- registerRose: ()=>registerRose,
112
+ barSpecPipeline: ()=>barSpecPipeline,
118
113
  zChartType: ()=>zChartType,
114
+ registerRose: ()=>registerRose,
115
+ zMeasureTree: ()=>zMeasureTree,
119
116
  unfoldDimensions: ()=>unfoldDimensions,
120
117
  roseParallelAdvancedPipeline: ()=>roseParallelAdvancedPipeline,
121
118
  registerTable: ()=>registerTable,
122
- Builder: ()=>Builder,
123
119
  isMeasureGroup: ()=>isMeasureGroup,
120
+ autoFormatter: ()=>autoFormatter,
124
121
  YEncoding: ()=>YEncoding,
125
122
  registerAll: ()=>registerAll,
126
123
  registerBar: ()=>registerBar,
127
124
  isVChart: ()=>isVChart,
128
125
  radarSpecPipeline: ()=>radarSpecPipeline,
129
- findFirstDimension: ()=>findFirstDimension,
130
- autoFormatter: ()=>autoFormatter,
131
- zMeasureTree: ()=>zMeasureTree,
126
+ Builder: ()=>Builder,
132
127
  zPieConfig: ()=>zPieConfig,
128
+ zPivotTable: ()=>zPivotTable,
129
+ zRadar: ()=>zRadar,
133
130
  registerLine: ()=>registerLine,
134
131
  registerCustomTheme: ()=>registerCustomTheme,
135
132
  zColor: ()=>zColor,
@@ -149,21 +146,19 @@ __webpack_require__.d(__webpack_exports__, {
149
146
  zAxis: ()=>zAxis,
150
147
  isVTable: ()=>isVTable,
151
148
  zMeasures: ()=>zMeasures,
152
- zPivotTable: ()=>zPivotTable,
149
+ zRadarConfig: ()=>zRadarConfig,
153
150
  zLine: ()=>zLine,
154
151
  columnSpecPipeline: ()=>columnSpecPipeline,
155
- UnfoldDimensionGroup: ()=>UnfoldDimensionGroup,
156
- zDatasetReshapeInfo: ()=>zDatasetReshapeInfo,
157
152
  zFoldInfo: ()=>zFoldInfo,
153
+ zDatasetReshapeInfo: ()=>zDatasetReshapeInfo,
158
154
  zLinearColor: ()=>zLinearColor,
155
+ zStackCornerRadius: ()=>zStackCornerRadius,
159
156
  zAreaStyle: ()=>zAreaStyle,
160
157
  ORIGINAL_DATA: ()=>ORIGINAL_DATA,
161
- zRadarConfig: ()=>zRadarConfig,
158
+ zUnfoldInfo: ()=>zUnfoldInfo,
162
159
  zAnnotationArea: ()=>zAnnotationArea,
163
- zStackCornerRadius: ()=>zStackCornerRadius,
164
160
  DetailEncoding: ()=>DetailEncoding,
165
161
  zRose: ()=>zRose,
166
- zUnfoldInfo: ()=>zUnfoldInfo,
167
162
  columnParallelSpecPipeline: ()=>columnParallelSpecPipeline,
168
163
  i18n: ()=>i18n,
169
164
  zPointStyle: ()=>zPointStyle,
@@ -172,7 +167,6 @@ __webpack_require__.d(__webpack_exports__, {
172
167
  registerColumnParallel: ()=>registerColumnParallel,
173
168
  updateAdvanced: ()=>updateAdvanced,
174
169
  zDimension: ()=>zDimension,
175
- zRadar: ()=>zRadar,
176
170
  zTable: ()=>zTable,
177
171
  isMeasure: ()=>isMeasure,
178
172
  FoldSecondaryMeasureValue: ()=>FoldSecondaryMeasureValue,
@@ -196,9 +190,9 @@ __webpack_require__.d(__webpack_exports__, {
196
190
  registerBarParallel: ()=>registerBarParallel,
197
191
  registerRadar: ()=>registerRadar,
198
192
  zEncodings: ()=>zEncodings,
199
- isDimension: ()=>isDimension,
200
193
  pivotTableSpecPipeline: ()=>pivotTableSpecPipeline,
201
194
  zLocale: ()=>zLocale,
195
+ zMeasure: ()=>zMeasure,
202
196
  FoldXMeasureValue: ()=>FoldXMeasureValue,
203
197
  dualAxisAdvancedPipeline: ()=>dualAxisAdvancedPipeline,
204
198
  registerScatter: ()=>registerScatter,
@@ -210,10 +204,9 @@ __webpack_require__.d(__webpack_exports__, {
210
204
  zAdvancedVSeed: ()=>zAdvancedVSeed,
211
205
  zConfig: ()=>zConfig,
212
206
  zBarStyle: ()=>zBarStyle,
213
- zMeasure: ()=>zMeasure,
214
207
  zRoseParallelConfig: ()=>zRoseParallelConfig,
215
- zAreaPercent: ()=>zAreaPercent,
216
208
  zXLinearAxis: ()=>zXLinearAxis,
209
+ zAreaPercent: ()=>zAreaPercent,
217
210
  columnParallelAdvancedPipeline: ()=>columnParallelAdvancedPipeline,
218
211
  isValueSelector: ()=>isValueSelector,
219
212
  donutAdvancedPipeline: ()=>donutAdvancedPipeline,
@@ -231,8 +224,8 @@ __webpack_require__.d(__webpack_exports__, {
231
224
  lineAdvancedPipeline: ()=>lineAdvancedPipeline,
232
225
  dataReshapeByEncoding: ()=>dataReshapeByEncoding,
233
226
  lineSpecPipeline: ()=>lineSpecPipeline,
234
- isDimensions: ()=>isDimensions,
235
227
  zBarPercentConfig: ()=>zBarPercentConfig,
228
+ zTooltip: ()=>zTooltip,
236
229
  createFormatter: ()=>createFormatter,
237
230
  zDimensionGroup: ()=>zDimensionGroup,
238
231
  isMeasureSelector: ()=>isMeasureSelector,
@@ -956,32 +949,6 @@ const autoPivotMeasures = (advancedVSeed, context)=>{
956
949
  }));
957
950
  return result;
958
951
  };
959
- const findDimensionById = (dimensions = [], id)=>{
960
- if (!dimensions) return;
961
- let result;
962
- preorderTraverse(dimensions, (node)=>{
963
- if (!('children' in node)) {
964
- if (node.id === id) {
965
- result = node;
966
- return true;
967
- }
968
- }
969
- return false;
970
- });
971
- return result;
972
- };
973
- const findFirstDimension = (dimensions = [])=>{
974
- if (!dimensions) return;
975
- let result;
976
- preorderTraverse(dimensions, (node)=>{
977
- if (!('children' in node)) {
978
- result = node;
979
- return true;
980
- }
981
- return false;
982
- });
983
- return result;
984
- };
985
952
  const findAllDimensions = (dimensions = [])=>{
986
953
  if (!dimensions) return [];
987
954
  const result = [];
@@ -1437,8 +1404,6 @@ const AngleEncoding = '__Dim_Angle__';
1437
1404
  const DetailEncoding = '__Dim_Detail__';
1438
1405
  const ColorEncoding = '__Dim_Color__';
1439
1406
  const ColorIdEncoding = '__Dim_ColorId__';
1440
- const UnfoldDimensionGroup = '__DimGroup__';
1441
- const UnfoldDimensionGroupId = '__DimGroupID__';
1442
1407
  const autoDimensions_autoDimensions = (advancedVSeed, context)=>{
1443
1408
  const result = {
1444
1409
  ...advancedVSeed
@@ -1478,23 +1443,26 @@ const autoDimensions_autoDimensions = (advancedVSeed, context)=>{
1478
1443
  result.dimensions.push(MeaName);
1479
1444
  return result;
1480
1445
  };
1481
- const encodingForColumn = (advancedVSeed, context)=>{
1446
+ const encodingForLine = (advancedVSeed, context)=>{
1482
1447
  const { vseed } = context;
1483
1448
  const { dimensions } = advancedVSeed;
1484
1449
  if (!dimensions) return advancedVSeed;
1485
1450
  const encoding = vseed.encoding;
1486
1451
  if (encoding) {
1487
- const x = encoding.x || [];
1488
- const detail = encoding.detail || [];
1489
- const color = encoding.color || [];
1490
- const mergedDetail = [
1491
- ...color.filter((d)=>!x.includes(d)),
1492
- ...detail
1452
+ const x = encoding.x || [
1453
+ dimensions[0].id
1454
+ ];
1455
+ const color = encoding.color || [
1456
+ (dimensions[1] || dimensions[0]).id
1493
1457
  ];
1458
+ const detail = encoding.detail || [];
1459
+ const mergedDetail = 0 === detail.length ? dimensions.map((d)=>d.id).filter((id)=>!x.includes(id)) : encoding.detail;
1494
1460
  return {
1495
1461
  ...advancedVSeed,
1496
1462
  encoding: {
1497
1463
  ...encoding,
1464
+ x,
1465
+ color,
1498
1466
  detail: mergedDetail
1499
1467
  }
1500
1468
  };
@@ -1502,7 +1470,7 @@ const encodingForColumn = (advancedVSeed, context)=>{
1502
1470
  const onlyMeasureName = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureName);
1503
1471
  const mergedEncoding = {
1504
1472
  x: dimensions.slice(0, 1).map((item)=>item.id),
1505
- color: dimensions.slice(1).map((item)=>item.id),
1473
+ color: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
1506
1474
  detail: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
1507
1475
  tooltip: dimensions.map((item)=>item.id),
1508
1476
  label: [],
@@ -1520,11 +1488,21 @@ const pivotAdapter = (pipeline, pivotPipeline)=>(advancedVSeed, context)=>{
1520
1488
  if (usePivotChart) return execPipeline(pivotPipeline, context, advancedVSeed);
1521
1489
  return execPipeline(pipeline, context, advancedVSeed);
1522
1490
  };
1523
- const foldMeasures = (dataset, measures, measureId = FoldMeasureId, measureName = FoldMeasureName, measureValue = FoldMeasureValue)=>{
1491
+ const foldMeasures = (dataset, measures, encoding, options)=>{
1492
+ const { measureId = FoldMeasureId, measureName = FoldMeasureName, measureValue = FoldMeasureValue } = options || {};
1493
+ const colorMeasureId = encoding?.color?.length === 1 && measures.some((m)=>m.id === encoding?.color?.[0]) ? encoding?.color?.[0] : void 0;
1524
1494
  const foldInfo = {
1525
1495
  measureId,
1526
1496
  measureName,
1527
1497
  measureValue,
1498
+ colorRange: [
1499
+ 0,
1500
+ 1
1501
+ ],
1502
+ measureRange: [
1503
+ 0,
1504
+ 1
1505
+ ],
1528
1506
  foldMap: {}
1529
1507
  };
1530
1508
  const result = new Array(dataset.length * measures.length);
@@ -1541,6 +1519,19 @@ const foldMeasures = (dataset, measures, measureId = FoldMeasureId, measureName
1541
1519
  datum[measureId] = id;
1542
1520
  datum[measureName] = alias || id;
1543
1521
  datum[measureValue] = dataset[i][id];
1522
+ if (colorMeasureId) {
1523
+ const value = datum[ORIGINAL_DATA][colorMeasureId];
1524
+ datum[ColorEncoding] = value;
1525
+ datum[ColorIdEncoding] = colorMeasureId;
1526
+ foldInfo.colorRange = [
1527
+ Math.min(foldInfo.colorRange[0] || 1 / 0, Number(value)),
1528
+ Math.max(foldInfo.colorRange[1] || -1 / 0, Number(value))
1529
+ ];
1530
+ }
1531
+ foldInfo.measureRange = [
1532
+ Math.min(foldInfo.measureRange[0] || 1 / 0, Number(datum[id])),
1533
+ Math.max(foldInfo.measureRange[1] || -1 / 0, Number(datum[id]))
1534
+ ];
1544
1535
  foldInfo.foldMap[id] = alias;
1545
1536
  result[index++] = datum;
1546
1537
  }
@@ -1576,7 +1567,7 @@ const unfoldDimensions = (dataset, dimensions, encoding, options)=>{
1576
1567
  applyEncoding(YEncoding, yDimensions, datum, separator);
1577
1568
  applyEncoding(ColorEncoding, colorDimensions, datum, separator);
1578
1569
  applyEncoding(DetailEncoding, detailDimensions, datum, separator);
1579
- if (!datum[ColorEncoding]) continue;
1570
+ if (!colorDimensions.length || !datum[ColorEncoding]) continue;
1580
1571
  const measureId = String(datum[foldMeasureId]);
1581
1572
  const colorItem = String(datum[ColorEncoding]);
1582
1573
  const colorId = colorItemAsId ? colorItem : measureId ? [
@@ -1597,29 +1588,13 @@ const unfoldDimensions = (dataset, dimensions, encoding, options)=>{
1597
1588
  const applyEncoding = (encoding, dimensions, datum, separator)=>{
1598
1589
  if (encoding && dimensions.length) datum[encoding] = dimensions.map((dim)=>String(datum[dim.id])).join(separator);
1599
1590
  };
1600
- const emptyReshapeResult = {
1601
- dataset: [],
1602
- foldInfo: {
1603
- foldMap: {},
1604
- measureId: '',
1605
- measureName: '',
1606
- measureValue: ''
1607
- },
1608
- unfoldInfo: {
1609
- encodingAngle: AngleEncoding,
1610
- encodingX: XEncoding,
1611
- encodingY: YEncoding,
1612
- encodingDetail: DetailEncoding,
1613
- encodingColor: ColorEncoding,
1614
- encodingColorId: ColorIdEncoding,
1615
- colorItems: [],
1616
- colorIdMap: {}
1617
- }
1618
- };
1619
1591
  const dataReshapeByEncoding = (dataset, dimensions, measures, encoding, options)=>{
1620
1592
  const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, colorItemAsId = false } = options || {};
1621
- if (0 === dimensions.length && 0 === measures.length) return emptyReshapeResult;
1622
- const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, foldMeasureId, foldMeasureName, foldMeasureValue);
1593
+ const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, encoding, {
1594
+ measureId: foldMeasureId,
1595
+ measureName: foldMeasureName,
1596
+ measureValue: foldMeasureValue
1597
+ });
1623
1598
  const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, dimensions, encoding, {
1624
1599
  foldMeasureId,
1625
1600
  separator: Separator,
@@ -1885,7 +1860,7 @@ const lineAdvancedPipeline = [
1885
1860
  initAdvancedVSeed_initAdvancedVSeed,
1886
1861
  autoMeasures_autoMeasures,
1887
1862
  autoDimensions_autoDimensions,
1888
- encodingForColumn,
1863
+ encodingForLine,
1889
1864
  pivotAdapter([
1890
1865
  reshapeWithEncoding
1891
1866
  ], [
@@ -1898,6 +1873,17 @@ const lineAdvancedPipeline = [
1898
1873
  markStyle_markStyle,
1899
1874
  annotation_annotation
1900
1875
  ];
1876
+ const colorAdapter = (ordinalPipe, linearPipe)=>(spec, context)=>{
1877
+ const { advancedVSeed } = context;
1878
+ if (isLinearColor(advancedVSeed)) return linearPipe(spec, context);
1879
+ return ordinalPipe(spec, context);
1880
+ };
1881
+ const isLinearColor = (advancedVSeed)=>{
1882
+ const { encoding, measures } = advancedVSeed;
1883
+ const measureIdList = findAllMeasures(measures).map((measure)=>measure.id);
1884
+ const { color } = encoding;
1885
+ return color?.length === 1 && measureIdList.includes(color[0]);
1886
+ };
1901
1887
  const initLine = (spec, context)=>{
1902
1888
  const result = {
1903
1889
  ...spec
@@ -1909,7 +1895,7 @@ const initLine = (spec, context)=>{
1909
1895
  result.direction = 'vertical';
1910
1896
  result.xField = unfoldInfo.encodingX;
1911
1897
  result.yField = foldInfo.measureValue;
1912
- result.seriesField = unfoldInfo.encodingColorId;
1898
+ result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
1913
1899
  result.padding = 0;
1914
1900
  result.region = [
1915
1901
  {
@@ -1970,6 +1956,31 @@ const createSpecifiedForColorMapping = (colorMapping, colorIdMap, colorItems)=>{
1970
1956
  ...accurateMap
1971
1957
  };
1972
1958
  };
1959
+ const linearColor = (spec, context)=>{
1960
+ const result = {
1961
+ ...spec
1962
+ };
1963
+ const { advancedVSeed } = context;
1964
+ const { datasetReshapeInfo, chartType } = advancedVSeed;
1965
+ const { unfoldInfo, id } = datasetReshapeInfo[0];
1966
+ const baseConfig = advancedVSeed.config[chartType];
1967
+ if (!baseConfig || !baseConfig.color) return result;
1968
+ const { color } = baseConfig;
1969
+ const { colorScheme, linearColorScheme } = color;
1970
+ result.color = {
1971
+ type: 'linear',
1972
+ range: linearColorScheme || colorScheme || [],
1973
+ domain: [
1974
+ {
1975
+ dataId: id,
1976
+ fields: [
1977
+ unfoldInfo.encodingColor
1978
+ ]
1979
+ }
1980
+ ]
1981
+ };
1982
+ return result;
1983
+ };
1973
1984
  const background_backgroundColor = (spec, context)=>{
1974
1985
  const result = {
1975
1986
  ...spec
@@ -2477,6 +2488,95 @@ const discreteLegend = (spec, context)=>{
2477
2488
  };
2478
2489
  return result;
2479
2490
  };
2491
+ const colorLegend = (spec, context)=>{
2492
+ const result = {
2493
+ ...spec
2494
+ };
2495
+ const { advancedVSeed } = context;
2496
+ const { datasetReshapeInfo, chartType } = advancedVSeed;
2497
+ const { unfoldInfo } = datasetReshapeInfo[0];
2498
+ const baseConfig = advancedVSeed.config[chartType];
2499
+ if (!baseConfig || !baseConfig.legend) return result;
2500
+ const { legend } = baseConfig;
2501
+ const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight } = legend || {};
2502
+ const orient = [
2503
+ 'bottom',
2504
+ 'bottomLeft',
2505
+ 'bottomRight',
2506
+ 'bl',
2507
+ 'br'
2508
+ ].includes(position) ? 'bottom' : [
2509
+ 'top',
2510
+ 'topLeft',
2511
+ 'topRight',
2512
+ 'tl',
2513
+ 'tr'
2514
+ ].includes(position) ? 'top' : [
2515
+ 'left',
2516
+ 'leftTop',
2517
+ 'leftBottom',
2518
+ 'lt',
2519
+ 'lb'
2520
+ ].includes(position) ? 'left' : 'right';
2521
+ const legendPosition = [
2522
+ 'topLeft',
2523
+ 'bottomLeft',
2524
+ 'leftTop',
2525
+ 'rightTop',
2526
+ 'lt',
2527
+ 'rt',
2528
+ 'tl',
2529
+ 'bl'
2530
+ ].includes(position) ? 'start' : [
2531
+ 'topRight',
2532
+ 'bottomRight',
2533
+ 'leftBottom',
2534
+ 'rightBottom',
2535
+ 'lb',
2536
+ 'rb',
2537
+ 'rt',
2538
+ 'br'
2539
+ ].includes(position) ? 'end' : 'middle';
2540
+ result.legends = {
2541
+ type: 'color',
2542
+ visible: enable,
2543
+ orient,
2544
+ position: legendPosition,
2545
+ padding: 0,
2546
+ field: unfoldInfo.encodingColor,
2547
+ maxWidth: '30%',
2548
+ startText: {
2549
+ visible: true,
2550
+ style: {
2551
+ fill: labelFontColor,
2552
+ fontSize: labelFontSize,
2553
+ fontWeight: labelFontWeight
2554
+ }
2555
+ },
2556
+ endText: {
2557
+ visible: true,
2558
+ style: {
2559
+ fill: labelFontColor,
2560
+ fontSize: labelFontSize,
2561
+ fontWeight: labelFontWeight
2562
+ }
2563
+ }
2564
+ };
2565
+ return result;
2566
+ };
2567
+ const colorPointStyleFill = (stylePipe)=>(spec, context)=>{
2568
+ const result = stylePipe(spec, context);
2569
+ const { advancedVSeed } = context;
2570
+ const { datasetReshapeInfo } = advancedVSeed;
2571
+ const { unfoldInfo } = datasetReshapeInfo[0];
2572
+ if (isLinearColor(advancedVSeed)) {
2573
+ if (result?.point?.style) result.point.style.fill = {
2574
+ field: unfoldInfo.encodingColor,
2575
+ scale: 'color'
2576
+ };
2577
+ }
2578
+ return result;
2579
+ };
2480
2580
  const selector_selector = (vchartDatum, selector)=>{
2481
2581
  if (!selector) return true;
2482
2582
  const selectorMode = 'And';
@@ -2573,7 +2673,10 @@ const pointStyle_pointStyle = (spec, context)=>{
2573
2673
  const { markStyle } = advancedVSeed;
2574
2674
  const { pointStyle } = markStyle;
2575
2675
  const result = {
2576
- ...spec
2676
+ ...spec,
2677
+ point: {
2678
+ style: {}
2679
+ }
2577
2680
  };
2578
2681
  if (!pointStyle) return result;
2579
2682
  const pointStyles = Array.isArray(pointStyle) ? pointStyle : [
@@ -2617,6 +2720,7 @@ const pointStyle_pointStyle = (spec, context)=>{
2617
2720
  return {
2618
2721
  ...result,
2619
2722
  point: {
2723
+ ...result.point,
2620
2724
  state: {
2621
2725
  ...customMap
2622
2726
  }
@@ -2672,15 +2776,31 @@ const pointStateHover = (spec, context)=>{
2672
2776
  };
2673
2777
  return result;
2674
2778
  };
2779
+ const colorLineStyleFill = (stylePipe)=>(spec, context)=>{
2780
+ const result = stylePipe(spec, context);
2781
+ const { advancedVSeed } = context;
2782
+ const { datasetReshapeInfo } = advancedVSeed;
2783
+ const { unfoldInfo } = datasetReshapeInfo[0];
2784
+ if (isLinearColor(advancedVSeed)) {
2785
+ if (result?.line?.style) result.line.style.stroke = {
2786
+ field: unfoldInfo.encodingColor,
2787
+ scale: 'color'
2788
+ };
2789
+ }
2790
+ return result;
2791
+ };
2675
2792
  const lineStyle_lineStyle = (spec, context)=>{
2676
2793
  const { advancedVSeed } = context;
2677
2794
  const { markStyle, datasetReshapeInfo, dataset } = advancedVSeed;
2678
2795
  const { unfoldInfo } = datasetReshapeInfo[0];
2679
2796
  const { lineStyle } = markStyle;
2680
- if (!lineStyle) return spec;
2681
2797
  const result = {
2682
- ...spec
2798
+ ...spec,
2799
+ line: {
2800
+ style: {}
2801
+ }
2683
2802
  };
2803
+ if (!lineStyle) return result;
2684
2804
  const lineStyles = Array.isArray(lineStyle) ? lineStyle : [
2685
2805
  lineStyle
2686
2806
  ];
@@ -2724,6 +2844,7 @@ const lineStyle_lineStyle = (spec, context)=>{
2724
2844
  return {
2725
2845
  ...result,
2726
2846
  line: {
2847
+ ...result.line,
2727
2848
  state: {
2728
2849
  ...customMap
2729
2850
  }
@@ -3496,7 +3617,7 @@ const pivotAdapter_pivotAdapter = (pipeline, pivotPipeline)=>(spec, context)=>{
3496
3617
  };
3497
3618
  const line_line = [
3498
3619
  initLine,
3499
- color_color,
3620
+ colorAdapter(color_color, linearColor),
3500
3621
  background_backgroundColor,
3501
3622
  datasetXY,
3502
3623
  progressive,
@@ -3505,10 +3626,10 @@ const line_line = [
3505
3626
  label_label,
3506
3627
  tooltip_tooltip,
3507
3628
  verticalCrosshairLine,
3508
- discreteLegend,
3509
- pointStyle_pointStyle,
3629
+ colorAdapter(discreteLegend, colorLegend),
3630
+ colorPointStyleFill(pointStyle_pointStyle),
3510
3631
  pointStateDimensionHover,
3511
- lineStyle_lineStyle,
3632
+ colorLineStyleFill(lineStyle_lineStyle),
3512
3633
  annotationPoint_annotationPoint,
3513
3634
  annotationVerticalLine_annotationVerticalLine,
3514
3635
  annotationHorizontalLine_annotationHorizontalLine,
@@ -3549,6 +3670,48 @@ const registerLine = ()=>{
3549
3670
  Builder._advancedPipelineMap.line = lineAdvancedPipeline;
3550
3671
  Builder._specPipelineMap.line = lineSpecPipeline;
3551
3672
  };
3673
+ const encodingForColumn = (advancedVSeed, context)=>{
3674
+ const { vseed } = context;
3675
+ const { dimensions } = advancedVSeed;
3676
+ if (!dimensions) return advancedVSeed;
3677
+ const encoding = vseed.encoding;
3678
+ if (encoding) {
3679
+ const x = encoding.x || [
3680
+ dimensions[0].id
3681
+ ];
3682
+ const color = encoding.color || [
3683
+ (dimensions[1] || dimensions[0]).id
3684
+ ];
3685
+ const detail = encoding.detail || [];
3686
+ const mergedDetail = 0 === detail.length ? (0, external_remeda_namespaceObject.unique)([
3687
+ ...color,
3688
+ ...detail
3689
+ ]) : detail;
3690
+ return {
3691
+ ...advancedVSeed,
3692
+ encoding: {
3693
+ ...encoding,
3694
+ x,
3695
+ color,
3696
+ detail: mergedDetail
3697
+ }
3698
+ };
3699
+ }
3700
+ const onlyMeasureName = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureName);
3701
+ const mergedEncoding = {
3702
+ x: dimensions.slice(0, 1).map((item)=>item.id),
3703
+ color: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
3704
+ detail: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
3705
+ tooltip: dimensions.map((item)=>item.id),
3706
+ label: [],
3707
+ row: [],
3708
+ column: []
3709
+ };
3710
+ return {
3711
+ ...advancedVSeed,
3712
+ encoding: mergedEncoding
3713
+ };
3714
+ };
3552
3715
  const columnAdvancedPipeline = [
3553
3716
  initAdvancedVSeed_initAdvancedVSeed,
3554
3717
  autoMeasures_autoMeasures,
@@ -3591,9 +3754,14 @@ const stackCornerRadius_stackCornerRadius = (spec, context)=>{
3591
3754
  const { advancedVSeed, vseed } = context;
3592
3755
  const { chartType } = vseed;
3593
3756
  const stackCornerRadius = advancedVSeed.config?.[chartType]?.stackCornerRadius;
3757
+ const { datasetReshapeInfo } = advancedVSeed;
3758
+ const { foldInfo } = datasetReshapeInfo[0];
3594
3759
  return {
3595
3760
  ...spec,
3596
- stackCornerRadius
3761
+ stackCornerRadius: (_, datum)=>{
3762
+ if (datum[foldInfo.measureValue] > 0) return stackCornerRadius;
3763
+ return 0;
3764
+ }
3597
3765
  };
3598
3766
  };
3599
3767
  const stackInverse = (spec)=>{
@@ -3643,6 +3811,19 @@ const verticalCrosshairRect = (spec, context)=>{
3643
3811
  };
3644
3812
  return result;
3645
3813
  };
3814
+ const colorBarStyleFill = (stylePipe)=>(spec, context)=>{
3815
+ const result = stylePipe(spec, context);
3816
+ const { advancedVSeed } = context;
3817
+ const { datasetReshapeInfo } = advancedVSeed;
3818
+ const { unfoldInfo } = datasetReshapeInfo[0];
3819
+ if (isLinearColor(advancedVSeed)) {
3820
+ if (result?.bar?.style) result.bar.style.fill = {
3821
+ field: unfoldInfo.encodingColor,
3822
+ scale: 'color'
3823
+ };
3824
+ }
3825
+ return result;
3826
+ };
3646
3827
  const barStyle_barStyle = (spec, context)=>{
3647
3828
  const { advancedVSeed } = context;
3648
3829
  const { markStyle, dataset = [] } = advancedVSeed;
@@ -3838,11 +4019,98 @@ const annotationAreaBand = (spec, context)=>{
3838
4019
  markArea: markArea
3839
4020
  };
3840
4021
  };
4022
+ const pivotColorLegend = (spec, context)=>{
4023
+ const result = {
4024
+ ...spec
4025
+ };
4026
+ const { advancedVSeed } = context;
4027
+ const { chartType } = advancedVSeed;
4028
+ const baseConfig = advancedVSeed.config[chartType];
4029
+ if (!baseConfig || !baseConfig.legend) return result;
4030
+ const { datasetReshapeInfo } = advancedVSeed;
4031
+ const max = Math.max(...datasetReshapeInfo.map((d)=>d.foldInfo.colorRange[1]));
4032
+ const min = Math.min(...datasetReshapeInfo.map((d)=>d.foldInfo.colorRange[0]));
4033
+ const { legend, color } = baseConfig;
4034
+ const { colorScheme, linearColorScheme } = color;
4035
+ const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400 } = legend || {};
4036
+ const orient = [
4037
+ 'bottom',
4038
+ 'bottomLeft',
4039
+ 'bottomRight',
4040
+ 'bl',
4041
+ 'br'
4042
+ ].includes(position) ? 'bottom' : [
4043
+ 'top',
4044
+ 'topLeft',
4045
+ 'topRight',
4046
+ 'tl',
4047
+ 'tr'
4048
+ ].includes(position) ? 'top' : [
4049
+ 'left',
4050
+ 'leftTop',
4051
+ 'leftBottom',
4052
+ 'lt',
4053
+ 'lb'
4054
+ ].includes(position) ? 'left' : 'right';
4055
+ const legendPosition = [
4056
+ 'topLeft',
4057
+ 'bottomLeft',
4058
+ 'leftTop',
4059
+ 'rightTop',
4060
+ 'lt',
4061
+ 'rt',
4062
+ 'tl',
4063
+ 'bl'
4064
+ ].includes(position) ? 'start' : [
4065
+ 'topRight',
4066
+ 'bottomRight',
4067
+ 'leftBottom',
4068
+ 'rightBottom',
4069
+ 'lb',
4070
+ 'rb',
4071
+ 'rt',
4072
+ 'br'
4073
+ ].includes(position) ? 'end' : 'middle';
4074
+ const legends = {
4075
+ visible: enable,
4076
+ type: 'color',
4077
+ orient,
4078
+ position: legendPosition,
4079
+ colors: linearColorScheme || colorScheme || [],
4080
+ value: [
4081
+ min,
4082
+ max
4083
+ ],
4084
+ min: min,
4085
+ max: max,
4086
+ maxWidth: '30%',
4087
+ startText: {
4088
+ visible: true,
4089
+ style: {
4090
+ fill: labelFontColor,
4091
+ fontSize: labelFontSize,
4092
+ fontWeight: labelFontWeight
4093
+ }
4094
+ },
4095
+ endText: {
4096
+ visible: true,
4097
+ style: {
4098
+ fill: labelFontColor,
4099
+ fontSize: labelFontSize,
4100
+ fontWeight: labelFontWeight
4101
+ }
4102
+ }
4103
+ };
4104
+ return {
4105
+ ...result,
4106
+ legends
4107
+ };
4108
+ };
3841
4109
  const column = [
3842
4110
  initColumn,
3843
4111
  stackCornerRadius_stackCornerRadius,
3844
4112
  stackInverse,
3845
- color_color,
4113
+ colorAdapter(color_color, linearColor),
3846
4114
  background_backgroundColor,
3847
4115
  datasetXY,
3848
4116
  progressive,
@@ -3851,8 +4119,8 @@ const column = [
3851
4119
  label_label,
3852
4120
  tooltip_tooltip,
3853
4121
  verticalCrosshairRect,
3854
- discreteLegend,
3855
- barStyle_barStyle,
4122
+ colorAdapter(discreteLegend, colorLegend),
4123
+ colorBarStyleFill(barStyle_barStyle),
3856
4124
  annotationPoint_annotationPoint,
3857
4125
  annotationVerticalLine_annotationVerticalLine,
3858
4126
  annotationHorizontalLine_annotationHorizontalLine,
@@ -3867,7 +4135,7 @@ const pivotColumn = [
3867
4135
  initColumn,
3868
4136
  stackCornerRadius_stackCornerRadius,
3869
4137
  stackInverse,
3870
- color_color,
4138
+ colorAdapter(color_color, linearColor),
3871
4139
  background_backgroundColor,
3872
4140
  datasetXY,
3873
4141
  progressive,
@@ -3876,7 +4144,7 @@ const pivotColumn = [
3876
4144
  label_label,
3877
4145
  tooltip_tooltip,
3878
4146
  verticalCrosshairRect,
3879
- barStyle_barStyle,
4147
+ colorBarStyleFill(barStyle_barStyle),
3880
4148
  annotationPoint_annotationPoint,
3881
4149
  annotationVerticalLine_annotationVerticalLine,
3882
4150
  annotationHorizontalLine_annotationHorizontalLine,
@@ -3884,7 +4152,7 @@ const pivotColumn = [
3884
4152
  ]),
3885
4153
  pivotRowDimensions,
3886
4154
  pivotColumnDimensions,
3887
- pivotDiscreteLegend
4155
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
3888
4156
  ];
3889
4157
  const columnSpecPipeline = [
3890
4158
  pivotAdapter_pivotAdapter(column, pivotColumn)
@@ -3940,7 +4208,7 @@ const initColumnParallel = (spec, context)=>{
3940
4208
  const columnParallel = [
3941
4209
  initColumnParallel,
3942
4210
  stackCornerRadius_stackCornerRadius,
3943
- color_color,
4211
+ colorAdapter(color_color, linearColor),
3944
4212
  background_backgroundColor,
3945
4213
  datasetXY,
3946
4214
  progressive,
@@ -3948,9 +4216,9 @@ const columnParallel = [
3948
4216
  yLinear,
3949
4217
  label_label,
3950
4218
  tooltip_tooltip,
3951
- discreteLegend,
4219
+ colorAdapter(discreteLegend, colorLegend),
3952
4220
  verticalCrosshairRect,
3953
- barStyle_barStyle,
4221
+ colorBarStyleFill(barStyle_barStyle),
3954
4222
  annotationPoint_annotationPoint,
3955
4223
  annotationVerticalLine_annotationVerticalLine,
3956
4224
  annotationHorizontalLine_annotationHorizontalLine,
@@ -3964,7 +4232,7 @@ const pivotColumnParallel = [
3964
4232
  pivotIndicators_pivotIndicators([
3965
4233
  initColumnParallel,
3966
4234
  stackCornerRadius_stackCornerRadius,
3967
- color_color,
4235
+ colorAdapter(color_color, linearColor),
3968
4236
  background_backgroundColor,
3969
4237
  datasetXY,
3970
4238
  progressive,
@@ -3973,7 +4241,7 @@ const pivotColumnParallel = [
3973
4241
  label_label,
3974
4242
  tooltip_tooltip,
3975
4243
  verticalCrosshairRect,
3976
- barStyle_barStyle,
4244
+ colorBarStyleFill(barStyle_barStyle),
3977
4245
  annotationPoint_annotationPoint,
3978
4246
  annotationVerticalLine_annotationVerticalLine,
3979
4247
  annotationHorizontalLine_annotationHorizontalLine,
@@ -3981,7 +4249,7 @@ const pivotColumnParallel = [
3981
4249
  ]),
3982
4250
  pivotRowDimensions,
3983
4251
  pivotColumnDimensions,
3984
- pivotDiscreteLegend
4252
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
3985
4253
  ];
3986
4254
  const columnParallelSpecPipeline = [
3987
4255
  pivotAdapter_pivotAdapter(columnParallel, pivotColumnParallel)
@@ -4018,7 +4286,7 @@ const columnPercent = [
4018
4286
  initColumn,
4019
4287
  stackCornerRadius_stackCornerRadius,
4020
4288
  stackInverse,
4021
- color_color,
4289
+ colorAdapter(color_color, linearColor),
4022
4290
  background_backgroundColor,
4023
4291
  percent,
4024
4292
  datasetXY,
@@ -4027,9 +4295,9 @@ const columnPercent = [
4027
4295
  yLinear,
4028
4296
  label_label,
4029
4297
  tooltip_tooltip,
4298
+ colorAdapter(discreteLegend, colorLegend),
4030
4299
  verticalCrosshairRect,
4031
- discreteLegend,
4032
- barStyle_barStyle,
4300
+ colorBarStyleFill(barStyle_barStyle),
4033
4301
  annotationPoint_annotationPoint,
4034
4302
  annotationVerticalLine_annotationVerticalLine,
4035
4303
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4044,7 +4312,7 @@ const pivotColumnPercent = [
4044
4312
  initColumn,
4045
4313
  stackCornerRadius_stackCornerRadius,
4046
4314
  stackInverse,
4047
- color_color,
4315
+ colorAdapter(color_color, linearColor),
4048
4316
  percent,
4049
4317
  background_backgroundColor,
4050
4318
  datasetXY,
@@ -4054,7 +4322,7 @@ const pivotColumnPercent = [
4054
4322
  label_label,
4055
4323
  tooltip_tooltip,
4056
4324
  verticalCrosshairRect,
4057
- barStyle_barStyle,
4325
+ colorBarStyleFill(barStyle_barStyle),
4058
4326
  annotationPoint_annotationPoint,
4059
4327
  annotationVerticalLine_annotationVerticalLine,
4060
4328
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4062,7 +4330,7 @@ const pivotColumnPercent = [
4062
4330
  ]),
4063
4331
  pivotRowDimensions,
4064
4332
  pivotColumnDimensions,
4065
- pivotDiscreteLegend
4333
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
4066
4334
  ];
4067
4335
  const columnPercentSpecPipeline = [
4068
4336
  pivotAdapter_pivotAdapter(columnPercent, pivotColumnPercent)
@@ -4077,17 +4345,23 @@ const encodingForBar = (advancedVSeed, context)=>{
4077
4345
  if (!dimensions) return advancedVSeed;
4078
4346
  const encoding = vseed.encoding;
4079
4347
  if (encoding) {
4080
- const y = encoding.y || [];
4348
+ const y = encoding.y || [
4349
+ dimensions[0].id
4350
+ ];
4351
+ const color = encoding.color || [
4352
+ (dimensions[1] || dimensions[0]).id
4353
+ ];
4081
4354
  const detail = encoding.detail || [];
4082
- const color = encoding.color || [];
4083
- const mergedDetail = [
4084
- ...color.filter((d)=>!y.includes(d)),
4355
+ const mergedDetail = 0 === detail.length ? (0, external_remeda_namespaceObject.unique)([
4356
+ ...color,
4085
4357
  ...detail
4086
- ];
4358
+ ]) : detail;
4087
4359
  return {
4088
4360
  ...advancedVSeed,
4089
4361
  encoding: {
4090
4362
  ...encoding,
4363
+ y,
4364
+ color,
4091
4365
  detail: mergedDetail
4092
4366
  }
4093
4367
  };
@@ -4095,7 +4369,7 @@ const encodingForBar = (advancedVSeed, context)=>{
4095
4369
  const onlyMeasureName = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureName);
4096
4370
  const mergedEncoding = {
4097
4371
  y: dimensions.slice(0, 1).map((item)=>item.id),
4098
- color: dimensions.slice(1).map((item)=>item.id),
4372
+ color: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
4099
4373
  detail: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
4100
4374
  tooltip: dimensions.map((item)=>item.id),
4101
4375
  label: [],
@@ -4425,7 +4699,7 @@ const horizontalCrosshairRect = (spec, context)=>{
4425
4699
  const bar = [
4426
4700
  initBar,
4427
4701
  stackCornerRadius_stackCornerRadius,
4428
- color_color,
4702
+ colorAdapter(color_color, linearColor),
4429
4703
  background_backgroundColor,
4430
4704
  datasetYX,
4431
4705
  progressive,
@@ -4433,9 +4707,9 @@ const bar = [
4433
4707
  yBand,
4434
4708
  label_label,
4435
4709
  tooltip_tooltip,
4710
+ colorAdapter(discreteLegend, colorLegend),
4436
4711
  horizontalCrosshairRect,
4437
- discreteLegend,
4438
- barStyle_barStyle,
4712
+ colorBarStyleFill(barStyle_barStyle),
4439
4713
  annotationPoint_annotationPoint,
4440
4714
  annotationVerticalLine_annotationVerticalLine,
4441
4715
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4449,7 +4723,7 @@ const pivotBar = [
4449
4723
  pivotIndicators_pivotIndicators([
4450
4724
  initBar,
4451
4725
  stackCornerRadius_stackCornerRadius,
4452
- color_color,
4726
+ colorAdapter(color_color, linearColor),
4453
4727
  background_backgroundColor,
4454
4728
  datasetYX,
4455
4729
  progressive,
@@ -4458,8 +4732,8 @@ const pivotBar = [
4458
4732
  label_label,
4459
4733
  label_label,
4460
4734
  tooltip_tooltip,
4735
+ colorBarStyleFill(barStyle_barStyle),
4461
4736
  horizontalCrosshairRect,
4462
- barStyle_barStyle,
4463
4737
  annotationPoint_annotationPoint,
4464
4738
  annotationVerticalLine_annotationVerticalLine,
4465
4739
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4467,7 +4741,7 @@ const pivotBar = [
4467
4741
  ]),
4468
4742
  pivotRowDimensions,
4469
4743
  pivotColumnDimensions,
4470
- pivotDiscreteLegend
4744
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
4471
4745
  ];
4472
4746
  const barSpecPipeline = [
4473
4747
  pivotAdapter_pivotAdapter(bar, pivotBar)
@@ -4523,7 +4797,7 @@ const initBarParallel = (spec, context)=>{
4523
4797
  const barParallel = [
4524
4798
  initBarParallel,
4525
4799
  stackCornerRadius_stackCornerRadius,
4526
- color_color,
4800
+ colorAdapter(color_color, linearColor),
4527
4801
  background_backgroundColor,
4528
4802
  datasetYX,
4529
4803
  progressive,
@@ -4531,9 +4805,9 @@ const barParallel = [
4531
4805
  yBand,
4532
4806
  label_label,
4533
4807
  tooltip_tooltip,
4808
+ colorAdapter(discreteLegend, colorLegend),
4534
4809
  horizontalCrosshairRect,
4535
- discreteLegend,
4536
- barStyle_barStyle,
4810
+ colorBarStyleFill(barStyle_barStyle),
4537
4811
  annotationPoint_annotationPoint,
4538
4812
  annotationVerticalLine_annotationVerticalLine,
4539
4813
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4547,15 +4821,15 @@ const pivotBarParallel = [
4547
4821
  pivotIndicators_pivotIndicators([
4548
4822
  initBarParallel,
4549
4823
  stackCornerRadius_stackCornerRadius,
4550
- color_color,
4824
+ colorAdapter(color_color, linearColor),
4551
4825
  background_backgroundColor,
4552
4826
  datasetYX,
4553
4827
  xLinear,
4554
4828
  yBand,
4555
4829
  label_label,
4556
4830
  tooltip_tooltip,
4831
+ colorBarStyleFill(barStyle_barStyle),
4557
4832
  horizontalCrosshairRect,
4558
- barStyle_barStyle,
4559
4833
  annotationPoint_annotationPoint,
4560
4834
  annotationVerticalLine_annotationVerticalLine,
4561
4835
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4563,7 +4837,7 @@ const pivotBarParallel = [
4563
4837
  ]),
4564
4838
  pivotRowDimensions,
4565
4839
  pivotColumnDimensions,
4566
- pivotDiscreteLegend
4840
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
4567
4841
  ];
4568
4842
  const barParallelSpecPipeline = [
4569
4843
  pivotAdapter_pivotAdapter(barParallel, pivotBarParallel)
@@ -4592,7 +4866,7 @@ const barPercentAdvancedPipeline = [
4592
4866
  const barPercent = [
4593
4867
  initBar,
4594
4868
  stackCornerRadius_stackCornerRadius,
4595
- color_color,
4869
+ colorAdapter(color_color, linearColor),
4596
4870
  background_backgroundColor,
4597
4871
  percent,
4598
4872
  datasetYX,
@@ -4601,9 +4875,9 @@ const barPercent = [
4601
4875
  yBand,
4602
4876
  label_label,
4603
4877
  tooltip_tooltip,
4878
+ colorAdapter(discreteLegend, colorLegend),
4604
4879
  horizontalCrosshairRect,
4605
- discreteLegend,
4606
- barStyle_barStyle,
4880
+ colorBarStyleFill(barStyle_barStyle),
4607
4881
  annotationPoint_annotationPoint,
4608
4882
  annotationVerticalLine_annotationVerticalLine,
4609
4883
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4617,7 +4891,7 @@ const pivotBarPercent = [
4617
4891
  pivotIndicators_pivotIndicators([
4618
4892
  initBar,
4619
4893
  stackCornerRadius_stackCornerRadius,
4620
- color_color,
4894
+ colorAdapter(color_color, linearColor),
4621
4895
  background_backgroundColor,
4622
4896
  percent,
4623
4897
  datasetYX,
@@ -4625,8 +4899,8 @@ const pivotBarPercent = [
4625
4899
  xLinear,
4626
4900
  label_label,
4627
4901
  tooltip_tooltip,
4902
+ colorBarStyleFill(barStyle_barStyle),
4628
4903
  horizontalCrosshairRect,
4629
- barStyle_barStyle,
4630
4904
  annotationPoint_annotationPoint,
4631
4905
  annotationVerticalLine_annotationVerticalLine,
4632
4906
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4634,7 +4908,7 @@ const pivotBarPercent = [
4634
4908
  ]),
4635
4909
  pivotRowDimensions,
4636
4910
  pivotColumnDimensions,
4637
- pivotDiscreteLegend
4911
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
4638
4912
  ];
4639
4913
  const barPercentSpecPipeline = [
4640
4914
  pivotAdapter_pivotAdapter(barPercent, pivotBarPercent)
@@ -4671,7 +4945,7 @@ const initArea = (spec, context)=>{
4671
4945
  result.direction = 'vertical';
4672
4946
  result.yField = foldInfo.measureValue;
4673
4947
  result.xField = unfoldInfo.encodingX;
4674
- result.seriesField = unfoldInfo.encodingColorId;
4948
+ result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
4675
4949
  result.padding = 0;
4676
4950
  result.region = [
4677
4951
  {
@@ -4681,20 +4955,32 @@ const initArea = (spec, context)=>{
4681
4955
  result.animation = true;
4682
4956
  return result;
4683
4957
  };
4958
+ const colorAreaStyleFill = (stylePipe)=>(spec, context)=>{
4959
+ const result = stylePipe(spec, context);
4960
+ const { advancedVSeed } = context;
4961
+ const { datasetReshapeInfo } = advancedVSeed;
4962
+ const { unfoldInfo } = datasetReshapeInfo[0];
4963
+ if (isLinearColor(advancedVSeed)) {
4964
+ if (result?.area?.style) result.area.style.fill = {
4965
+ field: unfoldInfo.encodingColor,
4966
+ scale: 'color'
4967
+ };
4968
+ }
4969
+ return result;
4970
+ };
4684
4971
  const areaStyle_areaStyle = (spec, context)=>{
4685
4972
  const { advancedVSeed } = context;
4686
4973
  const { markStyle, datasetReshapeInfo, dataset } = advancedVSeed;
4687
4974
  const { areaStyle } = markStyle;
4688
4975
  const { unfoldInfo } = datasetReshapeInfo[0];
4689
- if (!areaStyle) return {
4976
+ const result = {
4690
4977
  ...spec,
4691
4978
  area: {
4692
- visible: true
4979
+ visible: true,
4980
+ style: {}
4693
4981
  }
4694
4982
  };
4695
- const result = {
4696
- ...spec
4697
- };
4983
+ if (!areaStyle) return result;
4698
4984
  const areaStyles = Array.isArray(areaStyle) ? areaStyle : [
4699
4985
  areaStyle
4700
4986
  ];
@@ -4722,6 +5008,7 @@ const areaStyle_areaStyle = (spec, context)=>{
4722
5008
  return {
4723
5009
  ...result,
4724
5010
  area: {
5011
+ ...result.area,
4725
5012
  visible: true,
4726
5013
  state: {
4727
5014
  ...customMap
@@ -4732,7 +5019,7 @@ const areaStyle_areaStyle = (spec, context)=>{
4732
5019
  const area_area = [
4733
5020
  initArea,
4734
5021
  stackInverse,
4735
- color_color,
5022
+ colorAdapter(color_color, linearColor),
4736
5023
  background_backgroundColor,
4737
5024
  datasetXY,
4738
5025
  progressive,
@@ -4740,12 +5027,12 @@ const area_area = [
4740
5027
  yLinear,
4741
5028
  label_label,
4742
5029
  tooltip_tooltip,
5030
+ colorAdapter(discreteLegend, colorLegend),
4743
5031
  verticalCrosshairLine,
4744
- discreteLegend,
4745
- pointStyle_pointStyle,
5032
+ colorPointStyleFill(pointStyle_pointStyle),
4746
5033
  pointStateDimensionHover,
4747
- lineStyle_lineStyle,
4748
- areaStyle_areaStyle,
5034
+ colorLineStyleFill(lineStyle_lineStyle),
5035
+ colorAreaStyleFill(areaStyle_areaStyle),
4749
5036
  annotationPoint_annotationPoint,
4750
5037
  annotationVerticalLine_annotationVerticalLine,
4751
5038
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4758,7 +5045,7 @@ const pivotArea = [
4758
5045
  datasetPivot,
4759
5046
  pivotIndicators_pivotIndicators([
4760
5047
  initArea,
4761
- color_color,
5048
+ colorAdapter(color_color, linearColor),
4762
5049
  background_backgroundColor,
4763
5050
  stackInverse,
4764
5051
  datasetXY,
@@ -4768,10 +5055,10 @@ const pivotArea = [
4768
5055
  label_label,
4769
5056
  tooltip_tooltip,
4770
5057
  verticalCrosshairLine,
4771
- pointStyle_pointStyle,
5058
+ colorPointStyleFill(pointStyle_pointStyle),
4772
5059
  pointStateDimensionHover,
4773
- lineStyle_lineStyle,
4774
- areaStyle_areaStyle,
5060
+ colorLineStyleFill(lineStyle_lineStyle),
5061
+ colorAreaStyleFill(areaStyle_areaStyle),
4775
5062
  annotationPoint_annotationPoint,
4776
5063
  annotationVerticalLine_annotationVerticalLine,
4777
5064
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4779,7 +5066,7 @@ const pivotArea = [
4779
5066
  ]),
4780
5067
  pivotRowDimensions,
4781
5068
  pivotColumnDimensions,
4782
- pivotDiscreteLegend
5069
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
4783
5070
  ];
4784
5071
  const areaSpecPipeline = [
4785
5072
  pivotAdapter_pivotAdapter(area_area, pivotArea)
@@ -4808,7 +5095,7 @@ const areaPercentAdvancedPipeline = [
4808
5095
  const areaPercent = [
4809
5096
  initArea,
4810
5097
  stackInverse,
4811
- color_color,
5098
+ colorAdapter(color_color, linearColor),
4812
5099
  background_backgroundColor,
4813
5100
  percent,
4814
5101
  datasetXY,
@@ -4817,11 +5104,12 @@ const areaPercent = [
4817
5104
  yLinear,
4818
5105
  label_label,
4819
5106
  tooltip_tooltip,
5107
+ colorAdapter(discreteLegend, colorLegend),
4820
5108
  verticalCrosshairLine,
4821
- discreteLegend,
4822
- pointStyle_pointStyle,
4823
- lineStyle_lineStyle,
4824
- areaStyle_areaStyle,
5109
+ colorPointStyleFill(pointStyle_pointStyle),
5110
+ pointStateDimensionHover,
5111
+ colorLineStyleFill(lineStyle_lineStyle),
5112
+ colorAreaStyleFill(areaStyle_areaStyle),
4825
5113
  annotationPoint_annotationPoint,
4826
5114
  annotationVerticalLine_annotationVerticalLine,
4827
5115
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4835,7 +5123,7 @@ const pivotAreaPercent = [
4835
5123
  pivotIndicators_pivotIndicators([
4836
5124
  initArea,
4837
5125
  stackInverse,
4838
- color_color,
5126
+ colorAdapter(color_color, linearColor),
4839
5127
  background_backgroundColor,
4840
5128
  percent,
4841
5129
  datasetXY,
@@ -4845,9 +5133,10 @@ const pivotAreaPercent = [
4845
5133
  label_label,
4846
5134
  tooltip_tooltip,
4847
5135
  verticalCrosshairLine,
4848
- pointStyle_pointStyle,
4849
- lineStyle_lineStyle,
4850
- areaStyle_areaStyle,
5136
+ colorPointStyleFill(pointStyle_pointStyle),
5137
+ pointStateDimensionHover,
5138
+ colorLineStyleFill(lineStyle_lineStyle),
5139
+ colorAreaStyleFill(areaStyle_areaStyle),
4851
5140
  annotationPoint_annotationPoint,
4852
5141
  annotationVerticalLine_annotationVerticalLine,
4853
5142
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4855,7 +5144,7 @@ const pivotAreaPercent = [
4855
5144
  ]),
4856
5145
  pivotRowDimensions,
4857
5146
  pivotColumnDimensions,
4858
- pivotDiscreteLegend
5147
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
4859
5148
  ];
4860
5149
  const areaPercentSpecPipeline = [
4861
5150
  pivotAdapter_pivotAdapter(areaPercent, pivotAreaPercent)
@@ -4960,15 +5249,18 @@ const encodingForScatter = (advancedVSeed, context)=>{
4960
5249
  const encoding = vseed.encoding;
4961
5250
  if (encoding) {
4962
5251
  const detail = encoding.detail || [];
4963
- const color = encoding.color || [];
4964
- const mergedDetail = (0, external_remeda_namespaceObject.unique)([
5252
+ const color = encoding.color || [
5253
+ (dimensions[1] || dimensions[0]).id
5254
+ ];
5255
+ const mergedDetail = 0 === detail.length ? (0, external_remeda_namespaceObject.unique)([
4965
5256
  ...color,
4966
5257
  ...detail
4967
- ]);
5258
+ ]) : detail;
4968
5259
  return {
4969
5260
  ...advancedVSeed,
4970
5261
  encoding: {
4971
5262
  ...encoding,
5263
+ color,
4972
5264
  detail: mergedDetail
4973
5265
  }
4974
5266
  };
@@ -5207,7 +5499,7 @@ const horizontalCrosshairLine = (spec, context)=>{
5207
5499
  };
5208
5500
  const scatter = [
5209
5501
  initScatter,
5210
- color_color,
5502
+ colorAdapter(color_color, linearColor),
5211
5503
  background_backgroundColor,
5212
5504
  datasetScatter,
5213
5505
  progressive,
@@ -5215,10 +5507,10 @@ const scatter = [
5215
5507
  yLinear,
5216
5508
  label_label,
5217
5509
  tooltip_tooltip,
5510
+ colorAdapter(discreteLegend, colorLegend),
5218
5511
  verticalCrosshairLine,
5219
5512
  horizontalCrosshairLine,
5220
- discreteLegend,
5221
- pointStyle_pointStyle,
5513
+ colorPointStyleFill(pointStyle_pointStyle),
5222
5514
  pointStateHover,
5223
5515
  annotationPoint_annotationPoint,
5224
5516
  annotationVerticalLine_annotationVerticalLine,
@@ -5232,7 +5524,7 @@ const pivotScatter = [
5232
5524
  datasetPivot,
5233
5525
  pivotIndicators_pivotIndicators([
5234
5526
  initScatter,
5235
- color_color,
5527
+ colorAdapter(color_color, linearColor),
5236
5528
  background_backgroundColor,
5237
5529
  datasetScatter,
5238
5530
  progressive,
@@ -5242,7 +5534,7 @@ const pivotScatter = [
5242
5534
  tooltip_tooltip,
5243
5535
  verticalCrosshairLine,
5244
5536
  horizontalCrosshairLine,
5245
- pointStyle_pointStyle,
5537
+ colorPointStyleFill(pointStyle_pointStyle),
5246
5538
  pointStateHover,
5247
5539
  annotationPoint_annotationPoint,
5248
5540
  annotationVerticalLine_annotationVerticalLine,
@@ -5355,17 +5647,23 @@ const encodingForDualAxis = (advancedVSeed, context)=>{
5355
5647
  if (!dimensions) return advancedVSeed;
5356
5648
  const encoding = vseed.encoding;
5357
5649
  if (encoding) {
5358
- const x = encoding.x || [];
5650
+ const x = encoding.x || [
5651
+ dimensions[0].id
5652
+ ];
5653
+ const color = encoding.color || [
5654
+ (dimensions[1] || dimensions[0]).id
5655
+ ];
5359
5656
  const detail = encoding.detail || [];
5360
- const color = encoding.color || [];
5361
- const mergedDetail = [
5362
- ...color.filter((d)=>!x.includes(d)),
5657
+ const mergedDetail = 0 === detail.length ? (0, external_remeda_namespaceObject.unique)([
5658
+ ...color,
5363
5659
  ...detail
5364
- ];
5660
+ ]) : detail;
5365
5661
  return {
5366
5662
  ...advancedVSeed,
5367
5663
  encoding: {
5368
5664
  ...encoding,
5665
+ x,
5666
+ color,
5369
5667
  detail: mergedDetail
5370
5668
  }
5371
5669
  };
@@ -6345,7 +6643,6 @@ const encodingForPie = (advancedVSeed, context)=>{
6345
6643
  }
6346
6644
  };
6347
6645
  const mergedEncoding = {
6348
- angle: dimensions.slice(0, 1).map((item)=>item.id),
6349
6646
  color: dimensions.slice(0).map((item)=>item.id),
6350
6647
  detail: dimensions.slice(0).map((item)=>item.id),
6351
6648
  tooltip: dimensions.map((item)=>item.id),
@@ -6384,8 +6681,7 @@ const initPie = (spec, context)=>{
6384
6681
  result.outerRadius = 0.8;
6385
6682
  result.innerRadius = 0;
6386
6683
  result.valueField = foldInfo.measureValue;
6387
- result.categoryField = unfoldInfo.encodingAngle;
6388
- result.seriesField = unfoldInfo.encodingColorId;
6684
+ result.categoryField = unfoldInfo.encodingColorId;
6389
6685
  result.padding = 0;
6390
6686
  result.region = [
6391
6687
  {
@@ -6476,8 +6772,7 @@ const initDonut = (spec, context)=>{
6476
6772
  result.outerRadius = 0.8;
6477
6773
  result.innerRadius = 0.8 * result.outerRadius;
6478
6774
  result.valueField = foldInfo.measureValue;
6479
- result.categoryField = unfoldInfo.encodingDetail;
6480
- result.seriesField = unfoldInfo.encodingColorId;
6775
+ result.categoryField = unfoldInfo.encodingColorId;
6481
6776
  result.padding = 0;
6482
6777
  result.region = [
6483
6778
  {
@@ -6547,17 +6842,23 @@ const encodingForRose = (advancedVSeed, context)=>{
6547
6842
  if (!dimensions) return advancedVSeed;
6548
6843
  const encoding = vseed.encoding;
6549
6844
  if (encoding) {
6550
- const angle = encoding.angle || [];
6845
+ const angle = encoding.angle || [
6846
+ dimensions[0].id
6847
+ ];
6848
+ const color = encoding.color || [
6849
+ (dimensions[1] || dimensions[0]).id
6850
+ ];
6551
6851
  const detail = encoding.detail || [];
6552
- const color = encoding.color || [];
6553
- const mergedDetail = [
6554
- ...color.filter((d)=>!angle.includes(d)),
6852
+ const mergedDetail = 0 === detail.length ? (0, external_remeda_namespaceObject.unique)([
6853
+ ...color,
6555
6854
  ...detail
6556
- ];
6855
+ ]) : detail;
6557
6856
  return {
6558
6857
  ...advancedVSeed,
6559
6858
  encoding: {
6560
6859
  ...encoding,
6860
+ angle,
6861
+ color,
6561
6862
  detail: mergedDetail
6562
6863
  }
6563
6864
  };
@@ -6565,7 +6866,7 @@ const encodingForRose = (advancedVSeed, context)=>{
6565
6866
  const onlyMeasureName = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureName);
6566
6867
  const mergedEncoding = {
6567
6868
  angle: dimensions.slice(0, 1).map((item)=>item.id),
6568
- color: dimensions.slice(1).map((item)=>item.id),
6869
+ color: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
6569
6870
  detail: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
6570
6871
  tooltip: dimensions.map((item)=>item.id),
6571
6872
  label: [],
@@ -6600,7 +6901,7 @@ const initRose = (spec, context)=>{
6600
6901
  const { dataset, datasetReshapeInfo } = advancedVSeed;
6601
6902
  const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
6602
6903
  result.type = 'rose';
6603
- result.categoryField = unfoldInfo.encodingAngle;
6904
+ result.angleField = unfoldInfo.encodingAngle;
6604
6905
  result.seriesField = unfoldInfo.encodingColorId;
6605
6906
  result.valueField = foldInfo.measureValue;
6606
6907
  result.padding = 0;
@@ -6770,7 +7071,7 @@ const initRoseParallel = (spec, context)=>{
6770
7071
  const { unfoldInfo, foldInfo } = datasetReshapeInfo[0];
6771
7072
  const sameDimensionsMode = dimensions.length > 1 && dimensions.every((dim)=>dim.id === dimensions[0].id);
6772
7073
  result.type = 'rose';
6773
- result.categoryField = sameDimensionsMode ? [
7074
+ result.angleField = sameDimensionsMode ? [
6774
7075
  unfoldInfo.encodingAngle
6775
7076
  ] : [
6776
7077
  unfoldInfo.encodingAngle,
@@ -6860,17 +7161,23 @@ const encodingForRadar = (advancedVSeed, context)=>{
6860
7161
  if (!dimensions) return advancedVSeed;
6861
7162
  const encoding = vseed.encoding;
6862
7163
  if (encoding) {
6863
- const angle = encoding.angle || [];
7164
+ const angle = encoding.angle || [
7165
+ dimensions[0].id
7166
+ ];
7167
+ const color = encoding.color || [
7168
+ (dimensions[1] || dimensions[0]).id
7169
+ ];
6864
7170
  const detail = encoding.detail || [];
6865
- const color = encoding.color || [];
6866
- const mergedDetail = [
6867
- ...color.filter((d)=>!angle.includes(d)),
7171
+ const mergedDetail = 0 === detail.length ? (0, external_remeda_namespaceObject.unique)([
7172
+ ...color,
6868
7173
  ...detail
6869
- ];
7174
+ ]) : detail;
6870
7175
  return {
6871
7176
  ...advancedVSeed,
6872
7177
  encoding: {
6873
7178
  ...encoding,
7179
+ angle,
7180
+ color,
6874
7181
  detail: mergedDetail
6875
7182
  }
6876
7183
  };
@@ -6915,7 +7222,7 @@ const initRadar = (spec, context)=>{
6915
7222
  result.type = 'radar';
6916
7223
  result.angleField = unfoldInfo.encodingAngle;
6917
7224
  result.radiusField = foldInfo.measureValue;
6918
- result.seriesField = unfoldInfo.encodingColorId;
7225
+ result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
6919
7226
  result.padding = 0;
6920
7227
  result.region = [
6921
7228
  {
@@ -6980,7 +7287,7 @@ const radarRadiusAxis = (spec, context)=>{
6980
7287
  };
6981
7288
  const radar = [
6982
7289
  initRadar,
6983
- color_color,
7290
+ colorAdapter(color_color, linearColor),
6984
7291
  background_backgroundColor,
6985
7292
  datasetXY,
6986
7293
  progressive,
@@ -6988,12 +7295,12 @@ const radar = [
6988
7295
  radarRadiusAxis,
6989
7296
  label_label,
6990
7297
  tooltip_tooltip,
7298
+ colorAdapter(discreteLegend, colorLegend),
6991
7299
  verticalCrosshairLine,
6992
- discreteLegend,
6993
- pointStyle_pointStyle,
7300
+ colorPointStyleFill(pointStyle_pointStyle),
6994
7301
  pointStateDimensionHover,
6995
- lineStyle_lineStyle,
6996
- areaStyle_areaStyle
7302
+ colorLineStyleFill(lineStyle_lineStyle),
7303
+ colorAreaStyleFill(areaStyle_areaStyle)
6997
7304
  ];
6998
7305
  const pivotRadar = [
6999
7306
  initPivot,
@@ -7002,7 +7309,7 @@ const pivotRadar = [
7002
7309
  datasetPivot,
7003
7310
  pivotIndicators_pivotIndicators([
7004
7311
  initRadar,
7005
- color_color,
7312
+ colorAdapter(color_color, linearColor),
7006
7313
  background_backgroundColor,
7007
7314
  datasetXY,
7008
7315
  progressive,
@@ -7011,14 +7318,14 @@ const pivotRadar = [
7011
7318
  label_label,
7012
7319
  tooltip_tooltip,
7013
7320
  verticalCrosshairLine,
7014
- pointStyle_pointStyle,
7321
+ colorPointStyleFill(pointStyle_pointStyle),
7015
7322
  pointStateDimensionHover,
7016
- lineStyle_lineStyle,
7017
- areaStyle_areaStyle
7323
+ colorLineStyleFill(lineStyle_lineStyle),
7324
+ colorAreaStyleFill(areaStyle_areaStyle)
7018
7325
  ]),
7019
7326
  pivotRowDimensions,
7020
7327
  pivotColumnDimensions,
7021
- pivotDiscreteLegend
7328
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
7022
7329
  ];
7023
7330
  const radarSpecPipeline = [
7024
7331
  pivotAdapter_pivotAdapter(radar, pivotRadar)
@@ -7074,8 +7381,7 @@ const initFunnel = (spec, context)=>{
7074
7381
  const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
7075
7382
  result.type = 'funnel';
7076
7383
  result.valueField = foldInfo.measureValue;
7077
- result.categoryField = unfoldInfo.encodingDetail;
7078
- result.seriesField = unfoldInfo.encodingColorId;
7384
+ result.categoryField = unfoldInfo.encodingColorId;
7079
7385
  result.padding = 0;
7080
7386
  result.isTransform = true;
7081
7387
  result.shape = 'rect';
@@ -7110,6 +7416,7 @@ const funnel = [
7110
7416
  initFunnel,
7111
7417
  background_backgroundColor,
7112
7418
  datasetXY,
7419
+ color_color,
7113
7420
  label_label,
7114
7421
  tooltip_tooltip,
7115
7422
  discreteLegend,
@@ -7127,6 +7434,7 @@ const pivotFunnel = [
7127
7434
  initFunnel,
7128
7435
  background_backgroundColor,
7129
7436
  datasetXY,
7437
+ color_color,
7130
7438
  label_label,
7131
7439
  tooltip_tooltip,
7132
7440
  discreteLegend,
@@ -7150,12 +7458,22 @@ const encodingForHeatmap = (advancedVSeed, context)=>{
7150
7458
  const { dimensions } = advancedVSeed;
7151
7459
  if (!dimensions) return advancedVSeed;
7152
7460
  const encoding = vseed.encoding;
7153
- if (encoding) return {
7154
- ...advancedVSeed,
7155
- encoding: {
7156
- ...encoding
7157
- }
7158
- };
7461
+ if (encoding) {
7462
+ const x = encoding.x || [
7463
+ dimensions[0].id
7464
+ ];
7465
+ const y = encoding.y || [
7466
+ (dimensions[1] || dimensions[0]).id
7467
+ ];
7468
+ return {
7469
+ ...advancedVSeed,
7470
+ encoding: {
7471
+ x,
7472
+ y,
7473
+ ...encoding
7474
+ }
7475
+ };
7476
+ }
7159
7477
  const onlyMeasureName = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureName);
7160
7478
  const mergedEncoding = {
7161
7479
  x: dimensions.slice(0, 1).map((item)=>item.id),
@@ -7242,6 +7560,7 @@ const heatmap = [
7242
7560
  initHeatmap,
7243
7561
  background_backgroundColor,
7244
7562
  datasetXY,
7563
+ color_color,
7245
7564
  label_label,
7246
7565
  labelColorInversion,
7247
7566
  discreteLegend,
@@ -7263,6 +7582,7 @@ const pivotHeatmap = [
7263
7582
  initHeatmap,
7264
7583
  background_backgroundColor,
7265
7584
  datasetXY,
7585
+ color_color,
7266
7586
  label_label,
7267
7587
  labelColorInversion,
7268
7588
  discreteLegend,
@@ -7393,6 +7713,10 @@ const lightTheme = ()=>{
7393
7713
  const baseConfig = {
7394
7714
  backgroundColor: 'transparent',
7395
7715
  color: {
7716
+ linearColorScheme: [
7717
+ '#C2CEFF',
7718
+ '#5766EC'
7719
+ ],
7396
7720
  colorScheme: [
7397
7721
  '#8D72F6',
7398
7722
  '#5766EC',
@@ -7457,8 +7781,8 @@ const lightTheme = ()=>{
7457
7781
  stackCornerRadius: [
7458
7782
  4,
7459
7783
  4,
7460
- 4,
7461
- 4
7784
+ 0,
7785
+ 0
7462
7786
  ]
7463
7787
  },
7464
7788
  columnParallel: {
@@ -7469,8 +7793,8 @@ const lightTheme = ()=>{
7469
7793
  stackCornerRadius: [
7470
7794
  4,
7471
7795
  4,
7472
- 4,
7473
- 4
7796
+ 0,
7797
+ 0
7474
7798
  ]
7475
7799
  },
7476
7800
  columnPercent: {
@@ -7481,8 +7805,8 @@ const lightTheme = ()=>{
7481
7805
  stackCornerRadius: [
7482
7806
  4,
7483
7807
  4,
7484
- 4,
7485
- 4
7808
+ 0,
7809
+ 0
7486
7810
  ]
7487
7811
  },
7488
7812
  bar: {
@@ -7491,10 +7815,10 @@ const lightTheme = ()=>{
7491
7815
  yAxis: barBandAxis,
7492
7816
  crosshairRect,
7493
7817
  stackCornerRadius: [
7818
+ 0,
7494
7819
  4,
7495
7820
  4,
7496
- 4,
7497
- 4
7821
+ 0
7498
7822
  ]
7499
7823
  },
7500
7824
  barParallel: {
@@ -7503,10 +7827,10 @@ const lightTheme = ()=>{
7503
7827
  yAxis: barBandAxis,
7504
7828
  crosshairRect,
7505
7829
  stackCornerRadius: [
7830
+ 0,
7506
7831
  4,
7507
7832
  4,
7508
- 4,
7509
- 4
7833
+ 0
7510
7834
  ]
7511
7835
  },
7512
7836
  barPercent: {
@@ -7515,10 +7839,10 @@ const lightTheme = ()=>{
7515
7839
  yAxis: barBandAxis,
7516
7840
  crosshairRect,
7517
7841
  stackCornerRadius: [
7842
+ 0,
7518
7843
  4,
7519
7844
  4,
7520
- 4,
7521
- 4
7845
+ 0
7522
7846
  ]
7523
7847
  },
7524
7848
  area: {
@@ -7583,38 +7907,10 @@ const lightTheme = ()=>{
7583
7907
  ...baseConfig
7584
7908
  },
7585
7909
  funnel: {
7586
- ...baseConfig,
7587
- color: {
7588
- colorScheme: [
7589
- '#5766EC',
7590
- '#6372F0',
7591
- '#7080F4',
7592
- '#7C8CFA',
7593
- '#8998FF',
7594
- '#95A3FF',
7595
- '#A0AEFF',
7596
- '#ACB9FF',
7597
- '#B7C4FF',
7598
- '#C2CEFF'
7599
- ].reverse()
7600
- }
7910
+ ...baseConfig
7601
7911
  },
7602
7912
  heatmap: {
7603
- ...baseConfig,
7604
- color: {
7605
- colorScheme: [
7606
- '#5766EC',
7607
- '#6372F0',
7608
- '#7080F4',
7609
- '#7C8CFA',
7610
- '#8998FF',
7611
- '#95A3FF',
7612
- '#A0AEFF',
7613
- '#ACB9FF',
7614
- '#B7C4FF',
7615
- '#C2CEFF'
7616
- ].reverse()
7617
- }
7913
+ ...baseConfig
7618
7914
  }
7619
7915
  }
7620
7916
  };
@@ -7726,6 +8022,10 @@ const darkTheme = ()=>{
7726
8022
  const baseConfig = {
7727
8023
  backgroundColor: 'transparent',
7728
8024
  color: {
8025
+ linearColorScheme: [
8026
+ '#A0CEFF',
8027
+ '#2E62F1'
8028
+ ],
7729
8029
  colorScheme: [
7730
8030
  '#2E62F1',
7731
8031
  '#4DC36A',
@@ -7789,8 +8089,8 @@ const darkTheme = ()=>{
7789
8089
  stackCornerRadius: [
7790
8090
  4,
7791
8091
  4,
7792
- 4,
7793
- 4
8092
+ 0,
8093
+ 0
7794
8094
  ]
7795
8095
  },
7796
8096
  columnParallel: {
@@ -7801,8 +8101,8 @@ const darkTheme = ()=>{
7801
8101
  stackCornerRadius: [
7802
8102
  4,
7803
8103
  4,
7804
- 4,
7805
- 4
8104
+ 0,
8105
+ 0
7806
8106
  ]
7807
8107
  },
7808
8108
  columnPercent: {
@@ -7813,8 +8113,8 @@ const darkTheme = ()=>{
7813
8113
  stackCornerRadius: [
7814
8114
  4,
7815
8115
  4,
7816
- 4,
7817
- 4
8116
+ 0,
8117
+ 0
7818
8118
  ]
7819
8119
  },
7820
8120
  bar: {
@@ -7835,10 +8135,10 @@ const darkTheme = ()=>{
7835
8135
  yAxis: barBandAxis,
7836
8136
  crosshairRect: crosshairRect,
7837
8137
  stackCornerRadius: [
8138
+ 0,
7838
8139
  4,
7839
8140
  4,
7840
- 4,
7841
- 4
8141
+ 0
7842
8142
  ]
7843
8143
  },
7844
8144
  barPercent: {
@@ -7847,10 +8147,10 @@ const darkTheme = ()=>{
7847
8147
  yAxis: barBandAxis,
7848
8148
  crosshairRect: crosshairRect,
7849
8149
  stackCornerRadius: [
8150
+ 0,
7850
8151
  4,
7851
8152
  4,
7852
- 4,
7853
- 4
8153
+ 0
7854
8154
  ]
7855
8155
  },
7856
8156
  area: {
@@ -7915,21 +8215,7 @@ const darkTheme = ()=>{
7915
8215
  ...baseConfig
7916
8216
  },
7917
8217
  funnel: {
7918
- ...baseConfig,
7919
- color: {
7920
- colorScheme: [
7921
- '#2E62F1',
7922
- '#3A6EF6',
7923
- '#4780FA',
7924
- '#548CFE',
7925
- '#6198FF',
7926
- '#6FA3FF',
7927
- '#7CACFF',
7928
- '#88B7FF',
7929
- '#94C2FF',
7930
- '#A0CEFF'
7931
- ]
7932
- }
8218
+ ...baseConfig
7933
8219
  },
7934
8220
  heatmap: {
7935
8221
  ...baseConfig
@@ -7980,9 +8266,6 @@ const updateAdvanced = (chartType, advancedPipe)=>{
7980
8266
  const updateSpec = (chartType, specPipe)=>{
7981
8267
  Builder._customSpecPipe[chartType] = specPipe;
7982
8268
  };
7983
- const isDimension = (dimension)=>!('children' in dimension);
7984
- const isDimensionGroup = (dimension)=>'children' in dimension;
7985
- const isDimensions = (dimensions)=>dimensions.every(isDimension);
7986
8269
  const external_zod_namespaceObject = require("zod");
7987
8270
  const zChartType = external_zod_namespaceObject.z["enum"]([
7988
8271
  'table',
@@ -8101,6 +8384,8 @@ const zScatterMeasure = external_zod_namespaceObject.z.object({
8101
8384
  const zScatterMeasures = external_zod_namespaceObject.z.array(zScatterMeasure);
8102
8385
  const zFoldInfo = external_zod_namespaceObject.z.object({
8103
8386
  foldMap: external_zod_namespaceObject.z.record(external_zod_namespaceObject.z.string(), external_zod_namespaceObject.z.string().or(external_zod_namespaceObject.z.undefined())),
8387
+ colorRange: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.number()),
8388
+ measureRange: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.number()),
8104
8389
  measureId: external_zod_namespaceObject.z.string(),
8105
8390
  measureName: external_zod_namespaceObject.z.string(),
8106
8391
  measureValue: external_zod_namespaceObject.z.string()
@@ -8245,10 +8530,11 @@ const zStackCornerRadius = external_zod_namespaceObject.z.number().or(external_z
8245
8530
  const zBackgroundColor = external_zod_namespaceObject.z.string().default('transparent').nullish();
8246
8531
  const zColor = external_zod_namespaceObject.z.object({
8247
8532
  colorScheme: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()).nullish(),
8533
+ linearColorScheme: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()).nullish(),
8248
8534
  colorMapping: external_zod_namespaceObject.z.record(external_zod_namespaceObject.z.string(), external_zod_namespaceObject.z.string()).nullish()
8249
8535
  });
8250
8536
  const zLinearColor = external_zod_namespaceObject.z.object({
8251
- colorScheme: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()).nullish()
8537
+ linearColorScheme: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()).nullish()
8252
8538
  });
8253
8539
  const zLabel = external_zod_namespaceObject.z.object({
8254
8540
  enable: external_zod_namespaceObject.z.boolean().default(true).nullish()
@@ -9229,7 +9515,7 @@ const zFunnel = external_zod_namespaceObject.z.object({
9229
9515
  dimensions: zDimensions.nullish(),
9230
9516
  measures: zMeasureTree.nullish(),
9231
9517
  backgroundColor: zBackgroundColor.nullish(),
9232
- color: zLinearColor.nullish(),
9518
+ color: zColor.nullish(),
9233
9519
  label: zLabel.nullish(),
9234
9520
  legend: zColorLegend.nullish(),
9235
9521
  tooltip: zTooltip.nullish(),
@@ -9242,7 +9528,7 @@ const zHeatmap = external_zod_namespaceObject.z.object({
9242
9528
  dimensions: zDimensions.nullish(),
9243
9529
  measures: zMeasureTree.nullish(),
9244
9530
  backgroundColor: zBackgroundColor.nullish(),
9245
- color: zLinearColor.nullish(),
9531
+ color: zColor.nullish(),
9246
9532
  label: zLabel.nullish(),
9247
9533
  legend: zColorLegend.nullish(),
9248
9534
  tooltip: zTooltip.nullish(),
@@ -9302,8 +9588,6 @@ exports.FoldYMeasureValue = __webpack_exports__.FoldYMeasureValue;
9302
9588
  exports.MeasureName = __webpack_exports__.MeasureName;
9303
9589
  exports.ORIGINAL_DATA = __webpack_exports__.ORIGINAL_DATA;
9304
9590
  exports.Separator = __webpack_exports__.Separator;
9305
- exports.UnfoldDimensionGroup = __webpack_exports__.UnfoldDimensionGroup;
9306
- exports.UnfoldDimensionGroupId = __webpack_exports__.UnfoldDimensionGroupId;
9307
9591
  exports.XEncoding = __webpack_exports__.XEncoding;
9308
9592
  exports.YEncoding = __webpack_exports__.YEncoding;
9309
9593
  exports.areaAdvancedPipeline = __webpack_exports__.areaAdvancedPipeline;
@@ -9335,8 +9619,6 @@ exports.dualAxisSpecPipeline = __webpack_exports__.dualAxisSpecPipeline;
9335
9619
  exports.execPipeline = __webpack_exports__.execPipeline;
9336
9620
  exports.findAllDimensions = __webpack_exports__.findAllDimensions;
9337
9621
  exports.findAllMeasures = __webpack_exports__.findAllMeasures;
9338
- exports.findDimensionById = __webpack_exports__.findDimensionById;
9339
- exports.findFirstDimension = __webpack_exports__.findFirstDimension;
9340
9622
  exports.findFirstMeasure = __webpack_exports__.findFirstMeasure;
9341
9623
  exports.findMeasureById = __webpack_exports__.findMeasureById;
9342
9624
  exports.foldMeasures = __webpack_exports__.foldMeasures;
@@ -9346,10 +9628,7 @@ exports.heatmapAdvancedPipeline = __webpack_exports__.heatmapAdvancedPipeline;
9346
9628
  exports.heatmapSpecPipeline = __webpack_exports__.heatmapSpecPipeline;
9347
9629
  exports.i18n = __webpack_exports__.i18n;
9348
9630
  exports.intl = __webpack_exports__.intl;
9349
- exports.isDimension = __webpack_exports__.isDimension;
9350
- exports.isDimensionGroup = __webpack_exports__.isDimensionGroup;
9351
9631
  exports.isDimensionSelector = __webpack_exports__.isDimensionSelector;
9352
- exports.isDimensions = __webpack_exports__.isDimensions;
9353
9632
  exports.isMeasure = __webpack_exports__.isMeasure;
9354
9633
  exports.isMeasureGroup = __webpack_exports__.isMeasureGroup;
9355
9634
  exports.isMeasureSelector = __webpack_exports__.isMeasureSelector;
@@ -9520,8 +9799,6 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
9520
9799
  "MeasureName",
9521
9800
  "ORIGINAL_DATA",
9522
9801
  "Separator",
9523
- "UnfoldDimensionGroup",
9524
- "UnfoldDimensionGroupId",
9525
9802
  "XEncoding",
9526
9803
  "YEncoding",
9527
9804
  "areaAdvancedPipeline",
@@ -9553,8 +9830,6 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
9553
9830
  "execPipeline",
9554
9831
  "findAllDimensions",
9555
9832
  "findAllMeasures",
9556
- "findDimensionById",
9557
- "findFirstDimension",
9558
9833
  "findFirstMeasure",
9559
9834
  "findMeasureById",
9560
9835
  "foldMeasures",
@@ -9564,10 +9839,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
9564
9839
  "heatmapSpecPipeline",
9565
9840
  "i18n",
9566
9841
  "intl",
9567
- "isDimension",
9568
- "isDimensionGroup",
9569
9842
  "isDimensionSelector",
9570
- "isDimensions",
9571
9843
  "isMeasure",
9572
9844
  "isMeasureGroup",
9573
9845
  "isMeasureSelector",