@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.js CHANGED
@@ -713,32 +713,6 @@ const autoPivotMeasures = (advancedVSeed, context)=>{
713
713
  }));
714
714
  return result;
715
715
  };
716
- const findDimensionById = (dimensions = [], id)=>{
717
- if (!dimensions) return;
718
- let result;
719
- preorderTraverse(dimensions, (node)=>{
720
- if (!('children' in node)) {
721
- if (node.id === id) {
722
- result = node;
723
- return true;
724
- }
725
- }
726
- return false;
727
- });
728
- return result;
729
- };
730
- const findFirstDimension = (dimensions = [])=>{
731
- if (!dimensions) return;
732
- let result;
733
- preorderTraverse(dimensions, (node)=>{
734
- if (!('children' in node)) {
735
- result = node;
736
- return true;
737
- }
738
- return false;
739
- });
740
- return result;
741
- };
742
716
  const findAllDimensions = (dimensions = [])=>{
743
717
  if (!dimensions) return [];
744
718
  const result = [];
@@ -1194,8 +1168,6 @@ const AngleEncoding = '__Dim_Angle__';
1194
1168
  const DetailEncoding = '__Dim_Detail__';
1195
1169
  const ColorEncoding = '__Dim_Color__';
1196
1170
  const ColorIdEncoding = '__Dim_ColorId__';
1197
- const UnfoldDimensionGroup = '__DimGroup__';
1198
- const UnfoldDimensionGroupId = '__DimGroupID__';
1199
1171
  const autoDimensions_autoDimensions = (advancedVSeed, context)=>{
1200
1172
  const result = {
1201
1173
  ...advancedVSeed
@@ -1235,23 +1207,26 @@ const autoDimensions_autoDimensions = (advancedVSeed, context)=>{
1235
1207
  result.dimensions.push(MeaName);
1236
1208
  return result;
1237
1209
  };
1238
- const encodingForColumn = (advancedVSeed, context)=>{
1210
+ const encodingForLine = (advancedVSeed, context)=>{
1239
1211
  const { vseed } = context;
1240
1212
  const { dimensions } = advancedVSeed;
1241
1213
  if (!dimensions) return advancedVSeed;
1242
1214
  const encoding = vseed.encoding;
1243
1215
  if (encoding) {
1244
- const x = encoding.x || [];
1245
- const detail = encoding.detail || [];
1246
- const color = encoding.color || [];
1247
- const mergedDetail = [
1248
- ...color.filter((d)=>!x.includes(d)),
1249
- ...detail
1216
+ const x = encoding.x || [
1217
+ dimensions[0].id
1250
1218
  ];
1219
+ const color = encoding.color || [
1220
+ (dimensions[1] || dimensions[0]).id
1221
+ ];
1222
+ const detail = encoding.detail || [];
1223
+ const mergedDetail = 0 === detail.length ? dimensions.map((d)=>d.id).filter((id)=>!x.includes(id)) : encoding.detail;
1251
1224
  return {
1252
1225
  ...advancedVSeed,
1253
1226
  encoding: {
1254
1227
  ...encoding,
1228
+ x,
1229
+ color,
1255
1230
  detail: mergedDetail
1256
1231
  }
1257
1232
  };
@@ -1259,7 +1234,7 @@ const encodingForColumn = (advancedVSeed, context)=>{
1259
1234
  const onlyMeasureName = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureName);
1260
1235
  const mergedEncoding = {
1261
1236
  x: dimensions.slice(0, 1).map((item)=>item.id),
1262
- color: dimensions.slice(1).map((item)=>item.id),
1237
+ color: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
1263
1238
  detail: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
1264
1239
  tooltip: dimensions.map((item)=>item.id),
1265
1240
  label: [],
@@ -1277,11 +1252,21 @@ const pivotAdapter = (pipeline, pivotPipeline)=>(advancedVSeed, context)=>{
1277
1252
  if (usePivotChart) return execPipeline(pivotPipeline, context, advancedVSeed);
1278
1253
  return execPipeline(pipeline, context, advancedVSeed);
1279
1254
  };
1280
- const foldMeasures = (dataset, measures, measureId = FoldMeasureId, measureName = FoldMeasureName, measureValue = FoldMeasureValue)=>{
1255
+ const foldMeasures = (dataset, measures, encoding, options)=>{
1256
+ const { measureId = FoldMeasureId, measureName = FoldMeasureName, measureValue = FoldMeasureValue } = options || {};
1257
+ const colorMeasureId = encoding?.color?.length === 1 && measures.some((m)=>m.id === encoding?.color?.[0]) ? encoding?.color?.[0] : void 0;
1281
1258
  const foldInfo = {
1282
1259
  measureId,
1283
1260
  measureName,
1284
1261
  measureValue,
1262
+ colorRange: [
1263
+ 0,
1264
+ 1
1265
+ ],
1266
+ measureRange: [
1267
+ 0,
1268
+ 1
1269
+ ],
1285
1270
  foldMap: {}
1286
1271
  };
1287
1272
  const result = new Array(dataset.length * measures.length);
@@ -1298,6 +1283,19 @@ const foldMeasures = (dataset, measures, measureId = FoldMeasureId, measureName
1298
1283
  datum[measureId] = id;
1299
1284
  datum[measureName] = alias || id;
1300
1285
  datum[measureValue] = dataset[i][id];
1286
+ if (colorMeasureId) {
1287
+ const value = datum[ORIGINAL_DATA][colorMeasureId];
1288
+ datum[ColorEncoding] = value;
1289
+ datum[ColorIdEncoding] = colorMeasureId;
1290
+ foldInfo.colorRange = [
1291
+ Math.min(foldInfo.colorRange[0] || 1 / 0, Number(value)),
1292
+ Math.max(foldInfo.colorRange[1] || -1 / 0, Number(value))
1293
+ ];
1294
+ }
1295
+ foldInfo.measureRange = [
1296
+ Math.min(foldInfo.measureRange[0] || 1 / 0, Number(datum[id])),
1297
+ Math.max(foldInfo.measureRange[1] || -1 / 0, Number(datum[id]))
1298
+ ];
1301
1299
  foldInfo.foldMap[id] = alias;
1302
1300
  result[index++] = datum;
1303
1301
  }
@@ -1333,7 +1331,7 @@ const unfoldDimensions = (dataset, dimensions, encoding, options)=>{
1333
1331
  applyEncoding(YEncoding, yDimensions, datum, separator);
1334
1332
  applyEncoding(ColorEncoding, colorDimensions, datum, separator);
1335
1333
  applyEncoding(DetailEncoding, detailDimensions, datum, separator);
1336
- if (!datum[ColorEncoding]) continue;
1334
+ if (!colorDimensions.length || !datum[ColorEncoding]) continue;
1337
1335
  const measureId = String(datum[foldMeasureId]);
1338
1336
  const colorItem = String(datum[ColorEncoding]);
1339
1337
  const colorId = colorItemAsId ? colorItem : measureId ? [
@@ -1354,29 +1352,13 @@ const unfoldDimensions = (dataset, dimensions, encoding, options)=>{
1354
1352
  const applyEncoding = (encoding, dimensions, datum, separator)=>{
1355
1353
  if (encoding && dimensions.length) datum[encoding] = dimensions.map((dim)=>String(datum[dim.id])).join(separator);
1356
1354
  };
1357
- const emptyReshapeResult = {
1358
- dataset: [],
1359
- foldInfo: {
1360
- foldMap: {},
1361
- measureId: '',
1362
- measureName: '',
1363
- measureValue: ''
1364
- },
1365
- unfoldInfo: {
1366
- encodingAngle: AngleEncoding,
1367
- encodingX: XEncoding,
1368
- encodingY: YEncoding,
1369
- encodingDetail: DetailEncoding,
1370
- encodingColor: ColorEncoding,
1371
- encodingColorId: ColorIdEncoding,
1372
- colorItems: [],
1373
- colorIdMap: {}
1374
- }
1375
- };
1376
1355
  const dataReshapeByEncoding = (dataset, dimensions, measures, encoding, options)=>{
1377
1356
  const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, colorItemAsId = false } = options || {};
1378
- if (0 === dimensions.length && 0 === measures.length) return emptyReshapeResult;
1379
- const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, foldMeasureId, foldMeasureName, foldMeasureValue);
1357
+ const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, encoding, {
1358
+ measureId: foldMeasureId,
1359
+ measureName: foldMeasureName,
1360
+ measureValue: foldMeasureValue
1361
+ });
1380
1362
  const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, dimensions, encoding, {
1381
1363
  foldMeasureId,
1382
1364
  separator: Separator,
@@ -1642,7 +1624,7 @@ const lineAdvancedPipeline = [
1642
1624
  initAdvancedVSeed_initAdvancedVSeed,
1643
1625
  autoMeasures_autoMeasures,
1644
1626
  autoDimensions_autoDimensions,
1645
- encodingForColumn,
1627
+ encodingForLine,
1646
1628
  pivotAdapter([
1647
1629
  reshapeWithEncoding
1648
1630
  ], [
@@ -1655,6 +1637,17 @@ const lineAdvancedPipeline = [
1655
1637
  markStyle_markStyle,
1656
1638
  annotation_annotation
1657
1639
  ];
1640
+ const colorAdapter = (ordinalPipe, linearPipe)=>(spec, context)=>{
1641
+ const { advancedVSeed } = context;
1642
+ if (isLinearColor(advancedVSeed)) return linearPipe(spec, context);
1643
+ return ordinalPipe(spec, context);
1644
+ };
1645
+ const isLinearColor = (advancedVSeed)=>{
1646
+ const { encoding, measures } = advancedVSeed;
1647
+ const measureIdList = findAllMeasures(measures).map((measure)=>measure.id);
1648
+ const { color } = encoding;
1649
+ return color?.length === 1 && measureIdList.includes(color[0]);
1650
+ };
1658
1651
  const initLine = (spec, context)=>{
1659
1652
  const result = {
1660
1653
  ...spec
@@ -1666,7 +1659,7 @@ const initLine = (spec, context)=>{
1666
1659
  result.direction = 'vertical';
1667
1660
  result.xField = unfoldInfo.encodingX;
1668
1661
  result.yField = foldInfo.measureValue;
1669
- result.seriesField = unfoldInfo.encodingColorId;
1662
+ result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
1670
1663
  result.padding = 0;
1671
1664
  result.region = [
1672
1665
  {
@@ -1727,6 +1720,31 @@ const createSpecifiedForColorMapping = (colorMapping, colorIdMap, colorItems)=>{
1727
1720
  ...accurateMap
1728
1721
  };
1729
1722
  };
1723
+ const linearColor = (spec, context)=>{
1724
+ const result = {
1725
+ ...spec
1726
+ };
1727
+ const { advancedVSeed } = context;
1728
+ const { datasetReshapeInfo, chartType } = advancedVSeed;
1729
+ const { unfoldInfo, id } = datasetReshapeInfo[0];
1730
+ const baseConfig = advancedVSeed.config[chartType];
1731
+ if (!baseConfig || !baseConfig.color) return result;
1732
+ const { color } = baseConfig;
1733
+ const { colorScheme, linearColorScheme } = color;
1734
+ result.color = {
1735
+ type: 'linear',
1736
+ range: linearColorScheme || colorScheme || [],
1737
+ domain: [
1738
+ {
1739
+ dataId: id,
1740
+ fields: [
1741
+ unfoldInfo.encodingColor
1742
+ ]
1743
+ }
1744
+ ]
1745
+ };
1746
+ return result;
1747
+ };
1730
1748
  const background_backgroundColor = (spec, context)=>{
1731
1749
  const result = {
1732
1750
  ...spec
@@ -2234,6 +2252,95 @@ const discreteLegend = (spec, context)=>{
2234
2252
  };
2235
2253
  return result;
2236
2254
  };
2255
+ const colorLegend = (spec, context)=>{
2256
+ const result = {
2257
+ ...spec
2258
+ };
2259
+ const { advancedVSeed } = context;
2260
+ const { datasetReshapeInfo, chartType } = advancedVSeed;
2261
+ const { unfoldInfo } = datasetReshapeInfo[0];
2262
+ const baseConfig = advancedVSeed.config[chartType];
2263
+ if (!baseConfig || !baseConfig.legend) return result;
2264
+ const { legend } = baseConfig;
2265
+ const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight } = legend || {};
2266
+ const orient = [
2267
+ 'bottom',
2268
+ 'bottomLeft',
2269
+ 'bottomRight',
2270
+ 'bl',
2271
+ 'br'
2272
+ ].includes(position) ? 'bottom' : [
2273
+ 'top',
2274
+ 'topLeft',
2275
+ 'topRight',
2276
+ 'tl',
2277
+ 'tr'
2278
+ ].includes(position) ? 'top' : [
2279
+ 'left',
2280
+ 'leftTop',
2281
+ 'leftBottom',
2282
+ 'lt',
2283
+ 'lb'
2284
+ ].includes(position) ? 'left' : 'right';
2285
+ const legendPosition = [
2286
+ 'topLeft',
2287
+ 'bottomLeft',
2288
+ 'leftTop',
2289
+ 'rightTop',
2290
+ 'lt',
2291
+ 'rt',
2292
+ 'tl',
2293
+ 'bl'
2294
+ ].includes(position) ? 'start' : [
2295
+ 'topRight',
2296
+ 'bottomRight',
2297
+ 'leftBottom',
2298
+ 'rightBottom',
2299
+ 'lb',
2300
+ 'rb',
2301
+ 'rt',
2302
+ 'br'
2303
+ ].includes(position) ? 'end' : 'middle';
2304
+ result.legends = {
2305
+ type: 'color',
2306
+ visible: enable,
2307
+ orient,
2308
+ position: legendPosition,
2309
+ padding: 0,
2310
+ field: unfoldInfo.encodingColor,
2311
+ maxWidth: '30%',
2312
+ startText: {
2313
+ visible: true,
2314
+ style: {
2315
+ fill: labelFontColor,
2316
+ fontSize: labelFontSize,
2317
+ fontWeight: labelFontWeight
2318
+ }
2319
+ },
2320
+ endText: {
2321
+ visible: true,
2322
+ style: {
2323
+ fill: labelFontColor,
2324
+ fontSize: labelFontSize,
2325
+ fontWeight: labelFontWeight
2326
+ }
2327
+ }
2328
+ };
2329
+ return result;
2330
+ };
2331
+ const colorPointStyleFill = (stylePipe)=>(spec, context)=>{
2332
+ const result = stylePipe(spec, context);
2333
+ const { advancedVSeed } = context;
2334
+ const { datasetReshapeInfo } = advancedVSeed;
2335
+ const { unfoldInfo } = datasetReshapeInfo[0];
2336
+ if (isLinearColor(advancedVSeed)) {
2337
+ if (result?.point?.style) result.point.style.fill = {
2338
+ field: unfoldInfo.encodingColor,
2339
+ scale: 'color'
2340
+ };
2341
+ }
2342
+ return result;
2343
+ };
2237
2344
  const selector_selector = (vchartDatum, selector)=>{
2238
2345
  if (!selector) return true;
2239
2346
  const selectorMode = 'And';
@@ -2330,7 +2437,10 @@ const pointStyle_pointStyle = (spec, context)=>{
2330
2437
  const { markStyle } = advancedVSeed;
2331
2438
  const { pointStyle } = markStyle;
2332
2439
  const result = {
2333
- ...spec
2440
+ ...spec,
2441
+ point: {
2442
+ style: {}
2443
+ }
2334
2444
  };
2335
2445
  if (!pointStyle) return result;
2336
2446
  const pointStyles = Array.isArray(pointStyle) ? pointStyle : [
@@ -2374,6 +2484,7 @@ const pointStyle_pointStyle = (spec, context)=>{
2374
2484
  return {
2375
2485
  ...result,
2376
2486
  point: {
2487
+ ...result.point,
2377
2488
  state: {
2378
2489
  ...customMap
2379
2490
  }
@@ -2429,15 +2540,31 @@ const pointStateHover = (spec, context)=>{
2429
2540
  };
2430
2541
  return result;
2431
2542
  };
2543
+ const colorLineStyleFill = (stylePipe)=>(spec, context)=>{
2544
+ const result = stylePipe(spec, context);
2545
+ const { advancedVSeed } = context;
2546
+ const { datasetReshapeInfo } = advancedVSeed;
2547
+ const { unfoldInfo } = datasetReshapeInfo[0];
2548
+ if (isLinearColor(advancedVSeed)) {
2549
+ if (result?.line?.style) result.line.style.stroke = {
2550
+ field: unfoldInfo.encodingColor,
2551
+ scale: 'color'
2552
+ };
2553
+ }
2554
+ return result;
2555
+ };
2432
2556
  const lineStyle_lineStyle = (spec, context)=>{
2433
2557
  const { advancedVSeed } = context;
2434
2558
  const { markStyle, datasetReshapeInfo, dataset } = advancedVSeed;
2435
2559
  const { unfoldInfo } = datasetReshapeInfo[0];
2436
2560
  const { lineStyle } = markStyle;
2437
- if (!lineStyle) return spec;
2438
2561
  const result = {
2439
- ...spec
2562
+ ...spec,
2563
+ line: {
2564
+ style: {}
2565
+ }
2440
2566
  };
2567
+ if (!lineStyle) return result;
2441
2568
  const lineStyles = Array.isArray(lineStyle) ? lineStyle : [
2442
2569
  lineStyle
2443
2570
  ];
@@ -2481,6 +2608,7 @@ const lineStyle_lineStyle = (spec, context)=>{
2481
2608
  return {
2482
2609
  ...result,
2483
2610
  line: {
2611
+ ...result.line,
2484
2612
  state: {
2485
2613
  ...customMap
2486
2614
  }
@@ -3253,7 +3381,7 @@ const pivotAdapter_pivotAdapter = (pipeline, pivotPipeline)=>(spec, context)=>{
3253
3381
  };
3254
3382
  const line_line = [
3255
3383
  initLine,
3256
- color_color,
3384
+ colorAdapter(color_color, linearColor),
3257
3385
  background_backgroundColor,
3258
3386
  datasetXY,
3259
3387
  progressive,
@@ -3262,10 +3390,10 @@ const line_line = [
3262
3390
  label_label,
3263
3391
  tooltip_tooltip,
3264
3392
  verticalCrosshairLine,
3265
- discreteLegend,
3266
- pointStyle_pointStyle,
3393
+ colorAdapter(discreteLegend, colorLegend),
3394
+ colorPointStyleFill(pointStyle_pointStyle),
3267
3395
  pointStateDimensionHover,
3268
- lineStyle_lineStyle,
3396
+ colorLineStyleFill(lineStyle_lineStyle),
3269
3397
  annotationPoint_annotationPoint,
3270
3398
  annotationVerticalLine_annotationVerticalLine,
3271
3399
  annotationHorizontalLine_annotationHorizontalLine,
@@ -3306,6 +3434,48 @@ const registerLine = ()=>{
3306
3434
  Builder._advancedPipelineMap.line = lineAdvancedPipeline;
3307
3435
  Builder._specPipelineMap.line = lineSpecPipeline;
3308
3436
  };
3437
+ const encodingForColumn = (advancedVSeed, context)=>{
3438
+ const { vseed } = context;
3439
+ const { dimensions } = advancedVSeed;
3440
+ if (!dimensions) return advancedVSeed;
3441
+ const encoding = vseed.encoding;
3442
+ if (encoding) {
3443
+ const x = encoding.x || [
3444
+ dimensions[0].id
3445
+ ];
3446
+ const color = encoding.color || [
3447
+ (dimensions[1] || dimensions[0]).id
3448
+ ];
3449
+ const detail = encoding.detail || [];
3450
+ const mergedDetail = 0 === detail.length ? unique([
3451
+ ...color,
3452
+ ...detail
3453
+ ]) : detail;
3454
+ return {
3455
+ ...advancedVSeed,
3456
+ encoding: {
3457
+ ...encoding,
3458
+ x,
3459
+ color,
3460
+ detail: mergedDetail
3461
+ }
3462
+ };
3463
+ }
3464
+ const onlyMeasureName = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureName);
3465
+ const mergedEncoding = {
3466
+ x: dimensions.slice(0, 1).map((item)=>item.id),
3467
+ color: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
3468
+ detail: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
3469
+ tooltip: dimensions.map((item)=>item.id),
3470
+ label: [],
3471
+ row: [],
3472
+ column: []
3473
+ };
3474
+ return {
3475
+ ...advancedVSeed,
3476
+ encoding: mergedEncoding
3477
+ };
3478
+ };
3309
3479
  const columnAdvancedPipeline = [
3310
3480
  initAdvancedVSeed_initAdvancedVSeed,
3311
3481
  autoMeasures_autoMeasures,
@@ -3348,9 +3518,14 @@ const stackCornerRadius_stackCornerRadius = (spec, context)=>{
3348
3518
  const { advancedVSeed, vseed } = context;
3349
3519
  const { chartType } = vseed;
3350
3520
  const stackCornerRadius = advancedVSeed.config?.[chartType]?.stackCornerRadius;
3521
+ const { datasetReshapeInfo } = advancedVSeed;
3522
+ const { foldInfo } = datasetReshapeInfo[0];
3351
3523
  return {
3352
3524
  ...spec,
3353
- stackCornerRadius
3525
+ stackCornerRadius: (_, datum)=>{
3526
+ if (datum[foldInfo.measureValue] > 0) return stackCornerRadius;
3527
+ return 0;
3528
+ }
3354
3529
  };
3355
3530
  };
3356
3531
  const stackInverse = (spec)=>{
@@ -3400,6 +3575,19 @@ const verticalCrosshairRect = (spec, context)=>{
3400
3575
  };
3401
3576
  return result;
3402
3577
  };
3578
+ const colorBarStyleFill = (stylePipe)=>(spec, context)=>{
3579
+ const result = stylePipe(spec, context);
3580
+ const { advancedVSeed } = context;
3581
+ const { datasetReshapeInfo } = advancedVSeed;
3582
+ const { unfoldInfo } = datasetReshapeInfo[0];
3583
+ if (isLinearColor(advancedVSeed)) {
3584
+ if (result?.bar?.style) result.bar.style.fill = {
3585
+ field: unfoldInfo.encodingColor,
3586
+ scale: 'color'
3587
+ };
3588
+ }
3589
+ return result;
3590
+ };
3403
3591
  const barStyle_barStyle = (spec, context)=>{
3404
3592
  const { advancedVSeed } = context;
3405
3593
  const { markStyle, dataset = [] } = advancedVSeed;
@@ -3595,11 +3783,98 @@ const annotationAreaBand = (spec, context)=>{
3595
3783
  markArea: markArea
3596
3784
  };
3597
3785
  };
3786
+ const pivotColorLegend = (spec, context)=>{
3787
+ const result = {
3788
+ ...spec
3789
+ };
3790
+ const { advancedVSeed } = context;
3791
+ const { chartType } = advancedVSeed;
3792
+ const baseConfig = advancedVSeed.config[chartType];
3793
+ if (!baseConfig || !baseConfig.legend) return result;
3794
+ const { datasetReshapeInfo } = advancedVSeed;
3795
+ const max = Math.max(...datasetReshapeInfo.map((d)=>d.foldInfo.colorRange[1]));
3796
+ const min = Math.min(...datasetReshapeInfo.map((d)=>d.foldInfo.colorRange[0]));
3797
+ const { legend, color } = baseConfig;
3798
+ const { colorScheme, linearColorScheme } = color;
3799
+ const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400 } = legend || {};
3800
+ const orient = [
3801
+ 'bottom',
3802
+ 'bottomLeft',
3803
+ 'bottomRight',
3804
+ 'bl',
3805
+ 'br'
3806
+ ].includes(position) ? 'bottom' : [
3807
+ 'top',
3808
+ 'topLeft',
3809
+ 'topRight',
3810
+ 'tl',
3811
+ 'tr'
3812
+ ].includes(position) ? 'top' : [
3813
+ 'left',
3814
+ 'leftTop',
3815
+ 'leftBottom',
3816
+ 'lt',
3817
+ 'lb'
3818
+ ].includes(position) ? 'left' : 'right';
3819
+ const legendPosition = [
3820
+ 'topLeft',
3821
+ 'bottomLeft',
3822
+ 'leftTop',
3823
+ 'rightTop',
3824
+ 'lt',
3825
+ 'rt',
3826
+ 'tl',
3827
+ 'bl'
3828
+ ].includes(position) ? 'start' : [
3829
+ 'topRight',
3830
+ 'bottomRight',
3831
+ 'leftBottom',
3832
+ 'rightBottom',
3833
+ 'lb',
3834
+ 'rb',
3835
+ 'rt',
3836
+ 'br'
3837
+ ].includes(position) ? 'end' : 'middle';
3838
+ const legends = {
3839
+ visible: enable,
3840
+ type: 'color',
3841
+ orient,
3842
+ position: legendPosition,
3843
+ colors: linearColorScheme || colorScheme || [],
3844
+ value: [
3845
+ min,
3846
+ max
3847
+ ],
3848
+ min: min,
3849
+ max: max,
3850
+ maxWidth: '30%',
3851
+ startText: {
3852
+ visible: true,
3853
+ style: {
3854
+ fill: labelFontColor,
3855
+ fontSize: labelFontSize,
3856
+ fontWeight: labelFontWeight
3857
+ }
3858
+ },
3859
+ endText: {
3860
+ visible: true,
3861
+ style: {
3862
+ fill: labelFontColor,
3863
+ fontSize: labelFontSize,
3864
+ fontWeight: labelFontWeight
3865
+ }
3866
+ }
3867
+ };
3868
+ return {
3869
+ ...result,
3870
+ legends
3871
+ };
3872
+ };
3598
3873
  const column = [
3599
3874
  initColumn,
3600
3875
  stackCornerRadius_stackCornerRadius,
3601
3876
  stackInverse,
3602
- color_color,
3877
+ colorAdapter(color_color, linearColor),
3603
3878
  background_backgroundColor,
3604
3879
  datasetXY,
3605
3880
  progressive,
@@ -3608,8 +3883,8 @@ const column = [
3608
3883
  label_label,
3609
3884
  tooltip_tooltip,
3610
3885
  verticalCrosshairRect,
3611
- discreteLegend,
3612
- barStyle_barStyle,
3886
+ colorAdapter(discreteLegend, colorLegend),
3887
+ colorBarStyleFill(barStyle_barStyle),
3613
3888
  annotationPoint_annotationPoint,
3614
3889
  annotationVerticalLine_annotationVerticalLine,
3615
3890
  annotationHorizontalLine_annotationHorizontalLine,
@@ -3624,7 +3899,7 @@ const pivotColumn = [
3624
3899
  initColumn,
3625
3900
  stackCornerRadius_stackCornerRadius,
3626
3901
  stackInverse,
3627
- color_color,
3902
+ colorAdapter(color_color, linearColor),
3628
3903
  background_backgroundColor,
3629
3904
  datasetXY,
3630
3905
  progressive,
@@ -3633,7 +3908,7 @@ const pivotColumn = [
3633
3908
  label_label,
3634
3909
  tooltip_tooltip,
3635
3910
  verticalCrosshairRect,
3636
- barStyle_barStyle,
3911
+ colorBarStyleFill(barStyle_barStyle),
3637
3912
  annotationPoint_annotationPoint,
3638
3913
  annotationVerticalLine_annotationVerticalLine,
3639
3914
  annotationHorizontalLine_annotationHorizontalLine,
@@ -3641,7 +3916,7 @@ const pivotColumn = [
3641
3916
  ]),
3642
3917
  pivotRowDimensions,
3643
3918
  pivotColumnDimensions,
3644
- pivotDiscreteLegend
3919
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
3645
3920
  ];
3646
3921
  const columnSpecPipeline = [
3647
3922
  pivotAdapter_pivotAdapter(column, pivotColumn)
@@ -3697,7 +3972,7 @@ const initColumnParallel = (spec, context)=>{
3697
3972
  const columnParallel = [
3698
3973
  initColumnParallel,
3699
3974
  stackCornerRadius_stackCornerRadius,
3700
- color_color,
3975
+ colorAdapter(color_color, linearColor),
3701
3976
  background_backgroundColor,
3702
3977
  datasetXY,
3703
3978
  progressive,
@@ -3705,9 +3980,9 @@ const columnParallel = [
3705
3980
  yLinear,
3706
3981
  label_label,
3707
3982
  tooltip_tooltip,
3708
- discreteLegend,
3983
+ colorAdapter(discreteLegend, colorLegend),
3709
3984
  verticalCrosshairRect,
3710
- barStyle_barStyle,
3985
+ colorBarStyleFill(barStyle_barStyle),
3711
3986
  annotationPoint_annotationPoint,
3712
3987
  annotationVerticalLine_annotationVerticalLine,
3713
3988
  annotationHorizontalLine_annotationHorizontalLine,
@@ -3721,7 +3996,7 @@ const pivotColumnParallel = [
3721
3996
  pivotIndicators_pivotIndicators([
3722
3997
  initColumnParallel,
3723
3998
  stackCornerRadius_stackCornerRadius,
3724
- color_color,
3999
+ colorAdapter(color_color, linearColor),
3725
4000
  background_backgroundColor,
3726
4001
  datasetXY,
3727
4002
  progressive,
@@ -3730,7 +4005,7 @@ const pivotColumnParallel = [
3730
4005
  label_label,
3731
4006
  tooltip_tooltip,
3732
4007
  verticalCrosshairRect,
3733
- barStyle_barStyle,
4008
+ colorBarStyleFill(barStyle_barStyle),
3734
4009
  annotationPoint_annotationPoint,
3735
4010
  annotationVerticalLine_annotationVerticalLine,
3736
4011
  annotationHorizontalLine_annotationHorizontalLine,
@@ -3738,7 +4013,7 @@ const pivotColumnParallel = [
3738
4013
  ]),
3739
4014
  pivotRowDimensions,
3740
4015
  pivotColumnDimensions,
3741
- pivotDiscreteLegend
4016
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
3742
4017
  ];
3743
4018
  const columnParallelSpecPipeline = [
3744
4019
  pivotAdapter_pivotAdapter(columnParallel, pivotColumnParallel)
@@ -3775,7 +4050,7 @@ const columnPercent = [
3775
4050
  initColumn,
3776
4051
  stackCornerRadius_stackCornerRadius,
3777
4052
  stackInverse,
3778
- color_color,
4053
+ colorAdapter(color_color, linearColor),
3779
4054
  background_backgroundColor,
3780
4055
  percent,
3781
4056
  datasetXY,
@@ -3784,9 +4059,9 @@ const columnPercent = [
3784
4059
  yLinear,
3785
4060
  label_label,
3786
4061
  tooltip_tooltip,
4062
+ colorAdapter(discreteLegend, colorLegend),
3787
4063
  verticalCrosshairRect,
3788
- discreteLegend,
3789
- barStyle_barStyle,
4064
+ colorBarStyleFill(barStyle_barStyle),
3790
4065
  annotationPoint_annotationPoint,
3791
4066
  annotationVerticalLine_annotationVerticalLine,
3792
4067
  annotationHorizontalLine_annotationHorizontalLine,
@@ -3801,7 +4076,7 @@ const pivotColumnPercent = [
3801
4076
  initColumn,
3802
4077
  stackCornerRadius_stackCornerRadius,
3803
4078
  stackInverse,
3804
- color_color,
4079
+ colorAdapter(color_color, linearColor),
3805
4080
  percent,
3806
4081
  background_backgroundColor,
3807
4082
  datasetXY,
@@ -3811,7 +4086,7 @@ const pivotColumnPercent = [
3811
4086
  label_label,
3812
4087
  tooltip_tooltip,
3813
4088
  verticalCrosshairRect,
3814
- barStyle_barStyle,
4089
+ colorBarStyleFill(barStyle_barStyle),
3815
4090
  annotationPoint_annotationPoint,
3816
4091
  annotationVerticalLine_annotationVerticalLine,
3817
4092
  annotationHorizontalLine_annotationHorizontalLine,
@@ -3819,7 +4094,7 @@ const pivotColumnPercent = [
3819
4094
  ]),
3820
4095
  pivotRowDimensions,
3821
4096
  pivotColumnDimensions,
3822
- pivotDiscreteLegend
4097
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
3823
4098
  ];
3824
4099
  const columnPercentSpecPipeline = [
3825
4100
  pivotAdapter_pivotAdapter(columnPercent, pivotColumnPercent)
@@ -3834,17 +4109,23 @@ const encodingForBar = (advancedVSeed, context)=>{
3834
4109
  if (!dimensions) return advancedVSeed;
3835
4110
  const encoding = vseed.encoding;
3836
4111
  if (encoding) {
3837
- const y = encoding.y || [];
4112
+ const y = encoding.y || [
4113
+ dimensions[0].id
4114
+ ];
4115
+ const color = encoding.color || [
4116
+ (dimensions[1] || dimensions[0]).id
4117
+ ];
3838
4118
  const detail = encoding.detail || [];
3839
- const color = encoding.color || [];
3840
- const mergedDetail = [
3841
- ...color.filter((d)=>!y.includes(d)),
4119
+ const mergedDetail = 0 === detail.length ? unique([
4120
+ ...color,
3842
4121
  ...detail
3843
- ];
4122
+ ]) : detail;
3844
4123
  return {
3845
4124
  ...advancedVSeed,
3846
4125
  encoding: {
3847
4126
  ...encoding,
4127
+ y,
4128
+ color,
3848
4129
  detail: mergedDetail
3849
4130
  }
3850
4131
  };
@@ -3852,7 +4133,7 @@ const encodingForBar = (advancedVSeed, context)=>{
3852
4133
  const onlyMeasureName = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureName);
3853
4134
  const mergedEncoding = {
3854
4135
  y: dimensions.slice(0, 1).map((item)=>item.id),
3855
- color: dimensions.slice(1).map((item)=>item.id),
4136
+ color: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
3856
4137
  detail: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
3857
4138
  tooltip: dimensions.map((item)=>item.id),
3858
4139
  label: [],
@@ -4182,7 +4463,7 @@ const horizontalCrosshairRect = (spec, context)=>{
4182
4463
  const bar = [
4183
4464
  initBar,
4184
4465
  stackCornerRadius_stackCornerRadius,
4185
- color_color,
4466
+ colorAdapter(color_color, linearColor),
4186
4467
  background_backgroundColor,
4187
4468
  datasetYX,
4188
4469
  progressive,
@@ -4190,9 +4471,9 @@ const bar = [
4190
4471
  yBand,
4191
4472
  label_label,
4192
4473
  tooltip_tooltip,
4474
+ colorAdapter(discreteLegend, colorLegend),
4193
4475
  horizontalCrosshairRect,
4194
- discreteLegend,
4195
- barStyle_barStyle,
4476
+ colorBarStyleFill(barStyle_barStyle),
4196
4477
  annotationPoint_annotationPoint,
4197
4478
  annotationVerticalLine_annotationVerticalLine,
4198
4479
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4206,7 +4487,7 @@ const pivotBar = [
4206
4487
  pivotIndicators_pivotIndicators([
4207
4488
  initBar,
4208
4489
  stackCornerRadius_stackCornerRadius,
4209
- color_color,
4490
+ colorAdapter(color_color, linearColor),
4210
4491
  background_backgroundColor,
4211
4492
  datasetYX,
4212
4493
  progressive,
@@ -4215,8 +4496,8 @@ const pivotBar = [
4215
4496
  label_label,
4216
4497
  label_label,
4217
4498
  tooltip_tooltip,
4499
+ colorBarStyleFill(barStyle_barStyle),
4218
4500
  horizontalCrosshairRect,
4219
- barStyle_barStyle,
4220
4501
  annotationPoint_annotationPoint,
4221
4502
  annotationVerticalLine_annotationVerticalLine,
4222
4503
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4224,7 +4505,7 @@ const pivotBar = [
4224
4505
  ]),
4225
4506
  pivotRowDimensions,
4226
4507
  pivotColumnDimensions,
4227
- pivotDiscreteLegend
4508
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
4228
4509
  ];
4229
4510
  const barSpecPipeline = [
4230
4511
  pivotAdapter_pivotAdapter(bar, pivotBar)
@@ -4280,7 +4561,7 @@ const initBarParallel = (spec, context)=>{
4280
4561
  const barParallel = [
4281
4562
  initBarParallel,
4282
4563
  stackCornerRadius_stackCornerRadius,
4283
- color_color,
4564
+ colorAdapter(color_color, linearColor),
4284
4565
  background_backgroundColor,
4285
4566
  datasetYX,
4286
4567
  progressive,
@@ -4288,9 +4569,9 @@ const barParallel = [
4288
4569
  yBand,
4289
4570
  label_label,
4290
4571
  tooltip_tooltip,
4572
+ colorAdapter(discreteLegend, colorLegend),
4291
4573
  horizontalCrosshairRect,
4292
- discreteLegend,
4293
- barStyle_barStyle,
4574
+ colorBarStyleFill(barStyle_barStyle),
4294
4575
  annotationPoint_annotationPoint,
4295
4576
  annotationVerticalLine_annotationVerticalLine,
4296
4577
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4304,15 +4585,15 @@ const pivotBarParallel = [
4304
4585
  pivotIndicators_pivotIndicators([
4305
4586
  initBarParallel,
4306
4587
  stackCornerRadius_stackCornerRadius,
4307
- color_color,
4588
+ colorAdapter(color_color, linearColor),
4308
4589
  background_backgroundColor,
4309
4590
  datasetYX,
4310
4591
  xLinear,
4311
4592
  yBand,
4312
4593
  label_label,
4313
4594
  tooltip_tooltip,
4595
+ colorBarStyleFill(barStyle_barStyle),
4314
4596
  horizontalCrosshairRect,
4315
- barStyle_barStyle,
4316
4597
  annotationPoint_annotationPoint,
4317
4598
  annotationVerticalLine_annotationVerticalLine,
4318
4599
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4320,7 +4601,7 @@ const pivotBarParallel = [
4320
4601
  ]),
4321
4602
  pivotRowDimensions,
4322
4603
  pivotColumnDimensions,
4323
- pivotDiscreteLegend
4604
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
4324
4605
  ];
4325
4606
  const barParallelSpecPipeline = [
4326
4607
  pivotAdapter_pivotAdapter(barParallel, pivotBarParallel)
@@ -4349,7 +4630,7 @@ const barPercentAdvancedPipeline = [
4349
4630
  const barPercent = [
4350
4631
  initBar,
4351
4632
  stackCornerRadius_stackCornerRadius,
4352
- color_color,
4633
+ colorAdapter(color_color, linearColor),
4353
4634
  background_backgroundColor,
4354
4635
  percent,
4355
4636
  datasetYX,
@@ -4358,9 +4639,9 @@ const barPercent = [
4358
4639
  yBand,
4359
4640
  label_label,
4360
4641
  tooltip_tooltip,
4642
+ colorAdapter(discreteLegend, colorLegend),
4361
4643
  horizontalCrosshairRect,
4362
- discreteLegend,
4363
- barStyle_barStyle,
4644
+ colorBarStyleFill(barStyle_barStyle),
4364
4645
  annotationPoint_annotationPoint,
4365
4646
  annotationVerticalLine_annotationVerticalLine,
4366
4647
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4374,7 +4655,7 @@ const pivotBarPercent = [
4374
4655
  pivotIndicators_pivotIndicators([
4375
4656
  initBar,
4376
4657
  stackCornerRadius_stackCornerRadius,
4377
- color_color,
4658
+ colorAdapter(color_color, linearColor),
4378
4659
  background_backgroundColor,
4379
4660
  percent,
4380
4661
  datasetYX,
@@ -4382,8 +4663,8 @@ const pivotBarPercent = [
4382
4663
  xLinear,
4383
4664
  label_label,
4384
4665
  tooltip_tooltip,
4666
+ colorBarStyleFill(barStyle_barStyle),
4385
4667
  horizontalCrosshairRect,
4386
- barStyle_barStyle,
4387
4668
  annotationPoint_annotationPoint,
4388
4669
  annotationVerticalLine_annotationVerticalLine,
4389
4670
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4391,7 +4672,7 @@ const pivotBarPercent = [
4391
4672
  ]),
4392
4673
  pivotRowDimensions,
4393
4674
  pivotColumnDimensions,
4394
- pivotDiscreteLegend
4675
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
4395
4676
  ];
4396
4677
  const barPercentSpecPipeline = [
4397
4678
  pivotAdapter_pivotAdapter(barPercent, pivotBarPercent)
@@ -4428,7 +4709,7 @@ const initArea = (spec, context)=>{
4428
4709
  result.direction = 'vertical';
4429
4710
  result.yField = foldInfo.measureValue;
4430
4711
  result.xField = unfoldInfo.encodingX;
4431
- result.seriesField = unfoldInfo.encodingColorId;
4712
+ result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
4432
4713
  result.padding = 0;
4433
4714
  result.region = [
4434
4715
  {
@@ -4438,20 +4719,32 @@ const initArea = (spec, context)=>{
4438
4719
  result.animation = true;
4439
4720
  return result;
4440
4721
  };
4722
+ const colorAreaStyleFill = (stylePipe)=>(spec, context)=>{
4723
+ const result = stylePipe(spec, context);
4724
+ const { advancedVSeed } = context;
4725
+ const { datasetReshapeInfo } = advancedVSeed;
4726
+ const { unfoldInfo } = datasetReshapeInfo[0];
4727
+ if (isLinearColor(advancedVSeed)) {
4728
+ if (result?.area?.style) result.area.style.fill = {
4729
+ field: unfoldInfo.encodingColor,
4730
+ scale: 'color'
4731
+ };
4732
+ }
4733
+ return result;
4734
+ };
4441
4735
  const areaStyle_areaStyle = (spec, context)=>{
4442
4736
  const { advancedVSeed } = context;
4443
4737
  const { markStyle, datasetReshapeInfo, dataset } = advancedVSeed;
4444
4738
  const { areaStyle } = markStyle;
4445
4739
  const { unfoldInfo } = datasetReshapeInfo[0];
4446
- if (!areaStyle) return {
4740
+ const result = {
4447
4741
  ...spec,
4448
4742
  area: {
4449
- visible: true
4743
+ visible: true,
4744
+ style: {}
4450
4745
  }
4451
4746
  };
4452
- const result = {
4453
- ...spec
4454
- };
4747
+ if (!areaStyle) return result;
4455
4748
  const areaStyles = Array.isArray(areaStyle) ? areaStyle : [
4456
4749
  areaStyle
4457
4750
  ];
@@ -4479,6 +4772,7 @@ const areaStyle_areaStyle = (spec, context)=>{
4479
4772
  return {
4480
4773
  ...result,
4481
4774
  area: {
4775
+ ...result.area,
4482
4776
  visible: true,
4483
4777
  state: {
4484
4778
  ...customMap
@@ -4489,7 +4783,7 @@ const areaStyle_areaStyle = (spec, context)=>{
4489
4783
  const area_area = [
4490
4784
  initArea,
4491
4785
  stackInverse,
4492
- color_color,
4786
+ colorAdapter(color_color, linearColor),
4493
4787
  background_backgroundColor,
4494
4788
  datasetXY,
4495
4789
  progressive,
@@ -4497,12 +4791,12 @@ const area_area = [
4497
4791
  yLinear,
4498
4792
  label_label,
4499
4793
  tooltip_tooltip,
4794
+ colorAdapter(discreteLegend, colorLegend),
4500
4795
  verticalCrosshairLine,
4501
- discreteLegend,
4502
- pointStyle_pointStyle,
4796
+ colorPointStyleFill(pointStyle_pointStyle),
4503
4797
  pointStateDimensionHover,
4504
- lineStyle_lineStyle,
4505
- areaStyle_areaStyle,
4798
+ colorLineStyleFill(lineStyle_lineStyle),
4799
+ colorAreaStyleFill(areaStyle_areaStyle),
4506
4800
  annotationPoint_annotationPoint,
4507
4801
  annotationVerticalLine_annotationVerticalLine,
4508
4802
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4515,7 +4809,7 @@ const pivotArea = [
4515
4809
  datasetPivot,
4516
4810
  pivotIndicators_pivotIndicators([
4517
4811
  initArea,
4518
- color_color,
4812
+ colorAdapter(color_color, linearColor),
4519
4813
  background_backgroundColor,
4520
4814
  stackInverse,
4521
4815
  datasetXY,
@@ -4525,10 +4819,10 @@ const pivotArea = [
4525
4819
  label_label,
4526
4820
  tooltip_tooltip,
4527
4821
  verticalCrosshairLine,
4528
- pointStyle_pointStyle,
4822
+ colorPointStyleFill(pointStyle_pointStyle),
4529
4823
  pointStateDimensionHover,
4530
- lineStyle_lineStyle,
4531
- areaStyle_areaStyle,
4824
+ colorLineStyleFill(lineStyle_lineStyle),
4825
+ colorAreaStyleFill(areaStyle_areaStyle),
4532
4826
  annotationPoint_annotationPoint,
4533
4827
  annotationVerticalLine_annotationVerticalLine,
4534
4828
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4536,7 +4830,7 @@ const pivotArea = [
4536
4830
  ]),
4537
4831
  pivotRowDimensions,
4538
4832
  pivotColumnDimensions,
4539
- pivotDiscreteLegend
4833
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
4540
4834
  ];
4541
4835
  const areaSpecPipeline = [
4542
4836
  pivotAdapter_pivotAdapter(area_area, pivotArea)
@@ -4565,7 +4859,7 @@ const areaPercentAdvancedPipeline = [
4565
4859
  const areaPercent = [
4566
4860
  initArea,
4567
4861
  stackInverse,
4568
- color_color,
4862
+ colorAdapter(color_color, linearColor),
4569
4863
  background_backgroundColor,
4570
4864
  percent,
4571
4865
  datasetXY,
@@ -4574,11 +4868,12 @@ const areaPercent = [
4574
4868
  yLinear,
4575
4869
  label_label,
4576
4870
  tooltip_tooltip,
4871
+ colorAdapter(discreteLegend, colorLegend),
4577
4872
  verticalCrosshairLine,
4578
- discreteLegend,
4579
- pointStyle_pointStyle,
4580
- lineStyle_lineStyle,
4581
- areaStyle_areaStyle,
4873
+ colorPointStyleFill(pointStyle_pointStyle),
4874
+ pointStateDimensionHover,
4875
+ colorLineStyleFill(lineStyle_lineStyle),
4876
+ colorAreaStyleFill(areaStyle_areaStyle),
4582
4877
  annotationPoint_annotationPoint,
4583
4878
  annotationVerticalLine_annotationVerticalLine,
4584
4879
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4592,7 +4887,7 @@ const pivotAreaPercent = [
4592
4887
  pivotIndicators_pivotIndicators([
4593
4888
  initArea,
4594
4889
  stackInverse,
4595
- color_color,
4890
+ colorAdapter(color_color, linearColor),
4596
4891
  background_backgroundColor,
4597
4892
  percent,
4598
4893
  datasetXY,
@@ -4602,9 +4897,10 @@ const pivotAreaPercent = [
4602
4897
  label_label,
4603
4898
  tooltip_tooltip,
4604
4899
  verticalCrosshairLine,
4605
- pointStyle_pointStyle,
4606
- lineStyle_lineStyle,
4607
- areaStyle_areaStyle,
4900
+ colorPointStyleFill(pointStyle_pointStyle),
4901
+ pointStateDimensionHover,
4902
+ colorLineStyleFill(lineStyle_lineStyle),
4903
+ colorAreaStyleFill(areaStyle_areaStyle),
4608
4904
  annotationPoint_annotationPoint,
4609
4905
  annotationVerticalLine_annotationVerticalLine,
4610
4906
  annotationHorizontalLine_annotationHorizontalLine,
@@ -4612,7 +4908,7 @@ const pivotAreaPercent = [
4612
4908
  ]),
4613
4909
  pivotRowDimensions,
4614
4910
  pivotColumnDimensions,
4615
- pivotDiscreteLegend
4911
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
4616
4912
  ];
4617
4913
  const areaPercentSpecPipeline = [
4618
4914
  pivotAdapter_pivotAdapter(areaPercent, pivotAreaPercent)
@@ -4717,15 +5013,18 @@ const encodingForScatter = (advancedVSeed, context)=>{
4717
5013
  const encoding = vseed.encoding;
4718
5014
  if (encoding) {
4719
5015
  const detail = encoding.detail || [];
4720
- const color = encoding.color || [];
4721
- const mergedDetail = unique([
5016
+ const color = encoding.color || [
5017
+ (dimensions[1] || dimensions[0]).id
5018
+ ];
5019
+ const mergedDetail = 0 === detail.length ? unique([
4722
5020
  ...color,
4723
5021
  ...detail
4724
- ]);
5022
+ ]) : detail;
4725
5023
  return {
4726
5024
  ...advancedVSeed,
4727
5025
  encoding: {
4728
5026
  ...encoding,
5027
+ color,
4729
5028
  detail: mergedDetail
4730
5029
  }
4731
5030
  };
@@ -4964,7 +5263,7 @@ const horizontalCrosshairLine = (spec, context)=>{
4964
5263
  };
4965
5264
  const scatter = [
4966
5265
  initScatter,
4967
- color_color,
5266
+ colorAdapter(color_color, linearColor),
4968
5267
  background_backgroundColor,
4969
5268
  datasetScatter,
4970
5269
  progressive,
@@ -4972,10 +5271,10 @@ const scatter = [
4972
5271
  yLinear,
4973
5272
  label_label,
4974
5273
  tooltip_tooltip,
5274
+ colorAdapter(discreteLegend, colorLegend),
4975
5275
  verticalCrosshairLine,
4976
5276
  horizontalCrosshairLine,
4977
- discreteLegend,
4978
- pointStyle_pointStyle,
5277
+ colorPointStyleFill(pointStyle_pointStyle),
4979
5278
  pointStateHover,
4980
5279
  annotationPoint_annotationPoint,
4981
5280
  annotationVerticalLine_annotationVerticalLine,
@@ -4989,7 +5288,7 @@ const pivotScatter = [
4989
5288
  datasetPivot,
4990
5289
  pivotIndicators_pivotIndicators([
4991
5290
  initScatter,
4992
- color_color,
5291
+ colorAdapter(color_color, linearColor),
4993
5292
  background_backgroundColor,
4994
5293
  datasetScatter,
4995
5294
  progressive,
@@ -4999,7 +5298,7 @@ const pivotScatter = [
4999
5298
  tooltip_tooltip,
5000
5299
  verticalCrosshairLine,
5001
5300
  horizontalCrosshairLine,
5002
- pointStyle_pointStyle,
5301
+ colorPointStyleFill(pointStyle_pointStyle),
5003
5302
  pointStateHover,
5004
5303
  annotationPoint_annotationPoint,
5005
5304
  annotationVerticalLine_annotationVerticalLine,
@@ -5112,17 +5411,23 @@ const encodingForDualAxis = (advancedVSeed, context)=>{
5112
5411
  if (!dimensions) return advancedVSeed;
5113
5412
  const encoding = vseed.encoding;
5114
5413
  if (encoding) {
5115
- const x = encoding.x || [];
5414
+ const x = encoding.x || [
5415
+ dimensions[0].id
5416
+ ];
5417
+ const color = encoding.color || [
5418
+ (dimensions[1] || dimensions[0]).id
5419
+ ];
5116
5420
  const detail = encoding.detail || [];
5117
- const color = encoding.color || [];
5118
- const mergedDetail = [
5119
- ...color.filter((d)=>!x.includes(d)),
5421
+ const mergedDetail = 0 === detail.length ? unique([
5422
+ ...color,
5120
5423
  ...detail
5121
- ];
5424
+ ]) : detail;
5122
5425
  return {
5123
5426
  ...advancedVSeed,
5124
5427
  encoding: {
5125
5428
  ...encoding,
5429
+ x,
5430
+ color,
5126
5431
  detail: mergedDetail
5127
5432
  }
5128
5433
  };
@@ -6102,7 +6407,6 @@ const encodingForPie = (advancedVSeed, context)=>{
6102
6407
  }
6103
6408
  };
6104
6409
  const mergedEncoding = {
6105
- angle: dimensions.slice(0, 1).map((item)=>item.id),
6106
6410
  color: dimensions.slice(0).map((item)=>item.id),
6107
6411
  detail: dimensions.slice(0).map((item)=>item.id),
6108
6412
  tooltip: dimensions.map((item)=>item.id),
@@ -6141,8 +6445,7 @@ const initPie = (spec, context)=>{
6141
6445
  result.outerRadius = 0.8;
6142
6446
  result.innerRadius = 0;
6143
6447
  result.valueField = foldInfo.measureValue;
6144
- result.categoryField = unfoldInfo.encodingAngle;
6145
- result.seriesField = unfoldInfo.encodingColorId;
6448
+ result.categoryField = unfoldInfo.encodingColorId;
6146
6449
  result.padding = 0;
6147
6450
  result.region = [
6148
6451
  {
@@ -6233,8 +6536,7 @@ const initDonut = (spec, context)=>{
6233
6536
  result.outerRadius = 0.8;
6234
6537
  result.innerRadius = 0.8 * result.outerRadius;
6235
6538
  result.valueField = foldInfo.measureValue;
6236
- result.categoryField = unfoldInfo.encodingDetail;
6237
- result.seriesField = unfoldInfo.encodingColorId;
6539
+ result.categoryField = unfoldInfo.encodingColorId;
6238
6540
  result.padding = 0;
6239
6541
  result.region = [
6240
6542
  {
@@ -6304,17 +6606,23 @@ const encodingForRose = (advancedVSeed, context)=>{
6304
6606
  if (!dimensions) return advancedVSeed;
6305
6607
  const encoding = vseed.encoding;
6306
6608
  if (encoding) {
6307
- const angle = encoding.angle || [];
6609
+ const angle = encoding.angle || [
6610
+ dimensions[0].id
6611
+ ];
6612
+ const color = encoding.color || [
6613
+ (dimensions[1] || dimensions[0]).id
6614
+ ];
6308
6615
  const detail = encoding.detail || [];
6309
- const color = encoding.color || [];
6310
- const mergedDetail = [
6311
- ...color.filter((d)=>!angle.includes(d)),
6616
+ const mergedDetail = 0 === detail.length ? unique([
6617
+ ...color,
6312
6618
  ...detail
6313
- ];
6619
+ ]) : detail;
6314
6620
  return {
6315
6621
  ...advancedVSeed,
6316
6622
  encoding: {
6317
6623
  ...encoding,
6624
+ angle,
6625
+ color,
6318
6626
  detail: mergedDetail
6319
6627
  }
6320
6628
  };
@@ -6322,7 +6630,7 @@ const encodingForRose = (advancedVSeed, context)=>{
6322
6630
  const onlyMeasureName = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureName);
6323
6631
  const mergedEncoding = {
6324
6632
  angle: dimensions.slice(0, 1).map((item)=>item.id),
6325
- color: dimensions.slice(1).map((item)=>item.id),
6633
+ color: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
6326
6634
  detail: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
6327
6635
  tooltip: dimensions.map((item)=>item.id),
6328
6636
  label: [],
@@ -6357,7 +6665,7 @@ const initRose = (spec, context)=>{
6357
6665
  const { dataset, datasetReshapeInfo } = advancedVSeed;
6358
6666
  const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
6359
6667
  result.type = 'rose';
6360
- result.categoryField = unfoldInfo.encodingAngle;
6668
+ result.angleField = unfoldInfo.encodingAngle;
6361
6669
  result.seriesField = unfoldInfo.encodingColorId;
6362
6670
  result.valueField = foldInfo.measureValue;
6363
6671
  result.padding = 0;
@@ -6527,7 +6835,7 @@ const initRoseParallel = (spec, context)=>{
6527
6835
  const { unfoldInfo, foldInfo } = datasetReshapeInfo[0];
6528
6836
  const sameDimensionsMode = dimensions.length > 1 && dimensions.every((dim)=>dim.id === dimensions[0].id);
6529
6837
  result.type = 'rose';
6530
- result.categoryField = sameDimensionsMode ? [
6838
+ result.angleField = sameDimensionsMode ? [
6531
6839
  unfoldInfo.encodingAngle
6532
6840
  ] : [
6533
6841
  unfoldInfo.encodingAngle,
@@ -6617,17 +6925,23 @@ const encodingForRadar = (advancedVSeed, context)=>{
6617
6925
  if (!dimensions) return advancedVSeed;
6618
6926
  const encoding = vseed.encoding;
6619
6927
  if (encoding) {
6620
- const angle = encoding.angle || [];
6928
+ const angle = encoding.angle || [
6929
+ dimensions[0].id
6930
+ ];
6931
+ const color = encoding.color || [
6932
+ (dimensions[1] || dimensions[0]).id
6933
+ ];
6621
6934
  const detail = encoding.detail || [];
6622
- const color = encoding.color || [];
6623
- const mergedDetail = [
6624
- ...color.filter((d)=>!angle.includes(d)),
6935
+ const mergedDetail = 0 === detail.length ? unique([
6936
+ ...color,
6625
6937
  ...detail
6626
- ];
6938
+ ]) : detail;
6627
6939
  return {
6628
6940
  ...advancedVSeed,
6629
6941
  encoding: {
6630
6942
  ...encoding,
6943
+ angle,
6944
+ color,
6631
6945
  detail: mergedDetail
6632
6946
  }
6633
6947
  };
@@ -6672,7 +6986,7 @@ const initRadar = (spec, context)=>{
6672
6986
  result.type = 'radar';
6673
6987
  result.angleField = unfoldInfo.encodingAngle;
6674
6988
  result.radiusField = foldInfo.measureValue;
6675
- result.seriesField = unfoldInfo.encodingColorId;
6989
+ result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
6676
6990
  result.padding = 0;
6677
6991
  result.region = [
6678
6992
  {
@@ -6737,7 +7051,7 @@ const radarRadiusAxis = (spec, context)=>{
6737
7051
  };
6738
7052
  const radar = [
6739
7053
  initRadar,
6740
- color_color,
7054
+ colorAdapter(color_color, linearColor),
6741
7055
  background_backgroundColor,
6742
7056
  datasetXY,
6743
7057
  progressive,
@@ -6745,12 +7059,12 @@ const radar = [
6745
7059
  radarRadiusAxis,
6746
7060
  label_label,
6747
7061
  tooltip_tooltip,
7062
+ colorAdapter(discreteLegend, colorLegend),
6748
7063
  verticalCrosshairLine,
6749
- discreteLegend,
6750
- pointStyle_pointStyle,
7064
+ colorPointStyleFill(pointStyle_pointStyle),
6751
7065
  pointStateDimensionHover,
6752
- lineStyle_lineStyle,
6753
- areaStyle_areaStyle
7066
+ colorLineStyleFill(lineStyle_lineStyle),
7067
+ colorAreaStyleFill(areaStyle_areaStyle)
6754
7068
  ];
6755
7069
  const pivotRadar = [
6756
7070
  initPivot,
@@ -6759,7 +7073,7 @@ const pivotRadar = [
6759
7073
  datasetPivot,
6760
7074
  pivotIndicators_pivotIndicators([
6761
7075
  initRadar,
6762
- color_color,
7076
+ colorAdapter(color_color, linearColor),
6763
7077
  background_backgroundColor,
6764
7078
  datasetXY,
6765
7079
  progressive,
@@ -6768,14 +7082,14 @@ const pivotRadar = [
6768
7082
  label_label,
6769
7083
  tooltip_tooltip,
6770
7084
  verticalCrosshairLine,
6771
- pointStyle_pointStyle,
7085
+ colorPointStyleFill(pointStyle_pointStyle),
6772
7086
  pointStateDimensionHover,
6773
- lineStyle_lineStyle,
6774
- areaStyle_areaStyle
7087
+ colorLineStyleFill(lineStyle_lineStyle),
7088
+ colorAreaStyleFill(areaStyle_areaStyle)
6775
7089
  ]),
6776
7090
  pivotRowDimensions,
6777
7091
  pivotColumnDimensions,
6778
- pivotDiscreteLegend
7092
+ colorAdapter(pivotDiscreteLegend, pivotColorLegend)
6779
7093
  ];
6780
7094
  const radarSpecPipeline = [
6781
7095
  pivotAdapter_pivotAdapter(radar, pivotRadar)
@@ -6831,8 +7145,7 @@ const initFunnel = (spec, context)=>{
6831
7145
  const { foldInfo, unfoldInfo } = datasetReshapeInfo[0];
6832
7146
  result.type = 'funnel';
6833
7147
  result.valueField = foldInfo.measureValue;
6834
- result.categoryField = unfoldInfo.encodingDetail;
6835
- result.seriesField = unfoldInfo.encodingColorId;
7148
+ result.categoryField = unfoldInfo.encodingColorId;
6836
7149
  result.padding = 0;
6837
7150
  result.isTransform = true;
6838
7151
  result.shape = 'rect';
@@ -6867,6 +7180,7 @@ const funnel = [
6867
7180
  initFunnel,
6868
7181
  background_backgroundColor,
6869
7182
  datasetXY,
7183
+ color_color,
6870
7184
  label_label,
6871
7185
  tooltip_tooltip,
6872
7186
  discreteLegend,
@@ -6884,6 +7198,7 @@ const pivotFunnel = [
6884
7198
  initFunnel,
6885
7199
  background_backgroundColor,
6886
7200
  datasetXY,
7201
+ color_color,
6887
7202
  label_label,
6888
7203
  tooltip_tooltip,
6889
7204
  discreteLegend,
@@ -6907,12 +7222,22 @@ const encodingForHeatmap = (advancedVSeed, context)=>{
6907
7222
  const { dimensions } = advancedVSeed;
6908
7223
  if (!dimensions) return advancedVSeed;
6909
7224
  const encoding = vseed.encoding;
6910
- if (encoding) return {
6911
- ...advancedVSeed,
6912
- encoding: {
6913
- ...encoding
6914
- }
6915
- };
7225
+ if (encoding) {
7226
+ const x = encoding.x || [
7227
+ dimensions[0].id
7228
+ ];
7229
+ const y = encoding.y || [
7230
+ (dimensions[1] || dimensions[0]).id
7231
+ ];
7232
+ return {
7233
+ ...advancedVSeed,
7234
+ encoding: {
7235
+ x,
7236
+ y,
7237
+ ...encoding
7238
+ }
7239
+ };
7240
+ }
6916
7241
  const onlyMeasureName = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureName);
6917
7242
  const mergedEncoding = {
6918
7243
  x: dimensions.slice(0, 1).map((item)=>item.id),
@@ -6999,6 +7324,7 @@ const heatmap = [
6999
7324
  initHeatmap,
7000
7325
  background_backgroundColor,
7001
7326
  datasetXY,
7327
+ color_color,
7002
7328
  label_label,
7003
7329
  labelColorInversion,
7004
7330
  discreteLegend,
@@ -7020,6 +7346,7 @@ const pivotHeatmap = [
7020
7346
  initHeatmap,
7021
7347
  background_backgroundColor,
7022
7348
  datasetXY,
7349
+ color_color,
7023
7350
  label_label,
7024
7351
  labelColorInversion,
7025
7352
  discreteLegend,
@@ -7150,6 +7477,10 @@ const lightTheme = ()=>{
7150
7477
  const baseConfig = {
7151
7478
  backgroundColor: 'transparent',
7152
7479
  color: {
7480
+ linearColorScheme: [
7481
+ '#C2CEFF',
7482
+ '#5766EC'
7483
+ ],
7153
7484
  colorScheme: [
7154
7485
  '#8D72F6',
7155
7486
  '#5766EC',
@@ -7214,8 +7545,8 @@ const lightTheme = ()=>{
7214
7545
  stackCornerRadius: [
7215
7546
  4,
7216
7547
  4,
7217
- 4,
7218
- 4
7548
+ 0,
7549
+ 0
7219
7550
  ]
7220
7551
  },
7221
7552
  columnParallel: {
@@ -7226,8 +7557,8 @@ const lightTheme = ()=>{
7226
7557
  stackCornerRadius: [
7227
7558
  4,
7228
7559
  4,
7229
- 4,
7230
- 4
7560
+ 0,
7561
+ 0
7231
7562
  ]
7232
7563
  },
7233
7564
  columnPercent: {
@@ -7238,8 +7569,8 @@ const lightTheme = ()=>{
7238
7569
  stackCornerRadius: [
7239
7570
  4,
7240
7571
  4,
7241
- 4,
7242
- 4
7572
+ 0,
7573
+ 0
7243
7574
  ]
7244
7575
  },
7245
7576
  bar: {
@@ -7248,10 +7579,10 @@ const lightTheme = ()=>{
7248
7579
  yAxis: barBandAxis,
7249
7580
  crosshairRect,
7250
7581
  stackCornerRadius: [
7582
+ 0,
7251
7583
  4,
7252
7584
  4,
7253
- 4,
7254
- 4
7585
+ 0
7255
7586
  ]
7256
7587
  },
7257
7588
  barParallel: {
@@ -7260,10 +7591,10 @@ const lightTheme = ()=>{
7260
7591
  yAxis: barBandAxis,
7261
7592
  crosshairRect,
7262
7593
  stackCornerRadius: [
7594
+ 0,
7263
7595
  4,
7264
7596
  4,
7265
- 4,
7266
- 4
7597
+ 0
7267
7598
  ]
7268
7599
  },
7269
7600
  barPercent: {
@@ -7272,10 +7603,10 @@ const lightTheme = ()=>{
7272
7603
  yAxis: barBandAxis,
7273
7604
  crosshairRect,
7274
7605
  stackCornerRadius: [
7606
+ 0,
7275
7607
  4,
7276
7608
  4,
7277
- 4,
7278
- 4
7609
+ 0
7279
7610
  ]
7280
7611
  },
7281
7612
  area: {
@@ -7340,38 +7671,10 @@ const lightTheme = ()=>{
7340
7671
  ...baseConfig
7341
7672
  },
7342
7673
  funnel: {
7343
- ...baseConfig,
7344
- color: {
7345
- colorScheme: [
7346
- '#5766EC',
7347
- '#6372F0',
7348
- '#7080F4',
7349
- '#7C8CFA',
7350
- '#8998FF',
7351
- '#95A3FF',
7352
- '#A0AEFF',
7353
- '#ACB9FF',
7354
- '#B7C4FF',
7355
- '#C2CEFF'
7356
- ].reverse()
7357
- }
7674
+ ...baseConfig
7358
7675
  },
7359
7676
  heatmap: {
7360
- ...baseConfig,
7361
- color: {
7362
- colorScheme: [
7363
- '#5766EC',
7364
- '#6372F0',
7365
- '#7080F4',
7366
- '#7C8CFA',
7367
- '#8998FF',
7368
- '#95A3FF',
7369
- '#A0AEFF',
7370
- '#ACB9FF',
7371
- '#B7C4FF',
7372
- '#C2CEFF'
7373
- ].reverse()
7374
- }
7677
+ ...baseConfig
7375
7678
  }
7376
7679
  }
7377
7680
  };
@@ -7483,6 +7786,10 @@ const darkTheme = ()=>{
7483
7786
  const baseConfig = {
7484
7787
  backgroundColor: 'transparent',
7485
7788
  color: {
7789
+ linearColorScheme: [
7790
+ '#A0CEFF',
7791
+ '#2E62F1'
7792
+ ],
7486
7793
  colorScheme: [
7487
7794
  '#2E62F1',
7488
7795
  '#4DC36A',
@@ -7546,8 +7853,8 @@ const darkTheme = ()=>{
7546
7853
  stackCornerRadius: [
7547
7854
  4,
7548
7855
  4,
7549
- 4,
7550
- 4
7856
+ 0,
7857
+ 0
7551
7858
  ]
7552
7859
  },
7553
7860
  columnParallel: {
@@ -7558,8 +7865,8 @@ const darkTheme = ()=>{
7558
7865
  stackCornerRadius: [
7559
7866
  4,
7560
7867
  4,
7561
- 4,
7562
- 4
7868
+ 0,
7869
+ 0
7563
7870
  ]
7564
7871
  },
7565
7872
  columnPercent: {
@@ -7570,8 +7877,8 @@ const darkTheme = ()=>{
7570
7877
  stackCornerRadius: [
7571
7878
  4,
7572
7879
  4,
7573
- 4,
7574
- 4
7880
+ 0,
7881
+ 0
7575
7882
  ]
7576
7883
  },
7577
7884
  bar: {
@@ -7592,10 +7899,10 @@ const darkTheme = ()=>{
7592
7899
  yAxis: barBandAxis,
7593
7900
  crosshairRect: crosshairRect,
7594
7901
  stackCornerRadius: [
7902
+ 0,
7595
7903
  4,
7596
7904
  4,
7597
- 4,
7598
- 4
7905
+ 0
7599
7906
  ]
7600
7907
  },
7601
7908
  barPercent: {
@@ -7604,10 +7911,10 @@ const darkTheme = ()=>{
7604
7911
  yAxis: barBandAxis,
7605
7912
  crosshairRect: crosshairRect,
7606
7913
  stackCornerRadius: [
7914
+ 0,
7607
7915
  4,
7608
7916
  4,
7609
- 4,
7610
- 4
7917
+ 0
7611
7918
  ]
7612
7919
  },
7613
7920
  area: {
@@ -7672,21 +7979,7 @@ const darkTheme = ()=>{
7672
7979
  ...baseConfig
7673
7980
  },
7674
7981
  funnel: {
7675
- ...baseConfig,
7676
- color: {
7677
- colorScheme: [
7678
- '#2E62F1',
7679
- '#3A6EF6',
7680
- '#4780FA',
7681
- '#548CFE',
7682
- '#6198FF',
7683
- '#6FA3FF',
7684
- '#7CACFF',
7685
- '#88B7FF',
7686
- '#94C2FF',
7687
- '#A0CEFF'
7688
- ]
7689
- }
7982
+ ...baseConfig
7690
7983
  },
7691
7984
  heatmap: {
7692
7985
  ...baseConfig
@@ -7737,9 +8030,6 @@ const updateAdvanced = (chartType, advancedPipe)=>{
7737
8030
  const updateSpec = (chartType, specPipe)=>{
7738
8031
  Builder._customSpecPipe[chartType] = specPipe;
7739
8032
  };
7740
- const isDimension = (dimension)=>!('children' in dimension);
7741
- const isDimensionGroup = (dimension)=>'children' in dimension;
7742
- const isDimensions = (dimensions)=>dimensions.every(isDimension);
7743
8033
  const zChartType = z["enum"]([
7744
8034
  'table',
7745
8035
  'pivotTable',
@@ -7857,6 +8147,8 @@ const zScatterMeasure = z.object({
7857
8147
  const zScatterMeasures = z.array(zScatterMeasure);
7858
8148
  const zFoldInfo = z.object({
7859
8149
  foldMap: z.record(z.string(), z.string().or(z.undefined())),
8150
+ colorRange: z.array(z.number()),
8151
+ measureRange: z.array(z.number()),
7860
8152
  measureId: z.string(),
7861
8153
  measureName: z.string(),
7862
8154
  measureValue: z.string()
@@ -8001,10 +8293,11 @@ const zStackCornerRadius = z.number().or(z.array(z.number())).default([
8001
8293
  const zBackgroundColor = z.string().default('transparent').nullish();
8002
8294
  const zColor = z.object({
8003
8295
  colorScheme: z.array(z.string()).nullish(),
8296
+ linearColorScheme: z.array(z.string()).nullish(),
8004
8297
  colorMapping: z.record(z.string(), z.string()).nullish()
8005
8298
  });
8006
8299
  const zLinearColor = z.object({
8007
- colorScheme: z.array(z.string()).nullish()
8300
+ linearColorScheme: z.array(z.string()).nullish()
8008
8301
  });
8009
8302
  const zLabel = z.object({
8010
8303
  enable: z.boolean().default(true).nullish()
@@ -8985,7 +9278,7 @@ const zFunnel = z.object({
8985
9278
  dimensions: zDimensions.nullish(),
8986
9279
  measures: zMeasureTree.nullish(),
8987
9280
  backgroundColor: zBackgroundColor.nullish(),
8988
- color: zLinearColor.nullish(),
9281
+ color: zColor.nullish(),
8989
9282
  label: zLabel.nullish(),
8990
9283
  legend: zColorLegend.nullish(),
8991
9284
  tooltip: zTooltip.nullish(),
@@ -8998,7 +9291,7 @@ const zHeatmap = z.object({
8998
9291
  dimensions: zDimensions.nullish(),
8999
9292
  measures: zMeasureTree.nullish(),
9000
9293
  backgroundColor: zBackgroundColor.nullish(),
9001
- color: zLinearColor.nullish(),
9294
+ color: zColor.nullish(),
9002
9295
  label: zLabel.nullish(),
9003
9296
  legend: zColorLegend.nullish(),
9004
9297
  tooltip: zTooltip.nullish(),
@@ -9043,6 +9336,6 @@ const zAdvancedVSeed = z.object({
9043
9336
  annotation: zAnnotation,
9044
9337
  locale: zLocale
9045
9338
  });
9046
- export { AngleEncoding, Builder, ColorEncoding, ColorIdEncoding, DetailEncoding, FoldMeasureId, FoldMeasureName, FoldMeasureValue, FoldPrimaryMeasureValue, FoldSecondaryMeasureValue, FoldXMeasureValue, FoldYMeasureValue, MeasureName, ORIGINAL_DATA, Separator, UnfoldDimensionGroup, UnfoldDimensionGroupId, XEncoding, YEncoding, areaAdvancedPipeline, areaPercentAdvancedPipeline, areaPercentSpecPipeline, areaSpecPipeline, autoFormatter, autoNumFormatter, barAdvancedPipeline, barParallelAdvancedPipeline, barParallelSpecPipeline, barPercentAdvancedPipeline, barPercentSpecPipeline, barSpecPipeline, columnAdvancedPipeline, columnParallelAdvancedPipeline, columnParallelSpecPipeline, columnPercentAdvancedPipeline, columnPercentSpecPipeline, columnSpecPipeline, createFormatter, createNumFormatter, darkTheme, dataReshapeByEncoding, donutAdvancedPipeline, donutSpecPipeline, dualAxisAdvancedPipeline, dualAxisSpecPipeline, execPipeline, findAllDimensions, findAllMeasures, findDimensionById, findFirstDimension, findFirstMeasure, findMeasureById, foldMeasures, funnelAdvancedPipeline, funnelSpecPipeline, heatmapAdvancedPipeline, heatmapSpecPipeline, i18n, intl, isDimension, isDimensionGroup, isDimensionSelector, isDimensions, isMeasure, isMeasureGroup, isMeasureSelector, isMeasures, isPartialDatumSelector, isPivotChart, isPivotTable, isTable, isVChart, isVTable, isValueSelector, lightTheme, lineAdvancedPipeline, lineSpecPipeline, measureDepth, pieAdvancedPipeline, pieSpecPipeline, pivotTableAdvancedPipeline, pivotTableSpecPipeline, preorderTraverse, radarAdvancedPipeline, radarSpecPipeline, registerAll, registerArea, registerAreaPercent, registerBar, registerBarParallel, registerBarPercent, registerColumn, registerColumnParallel, registerColumnPercent, registerCustomTheme, registerDarkTheme, registerDonut, registerFunnel, registerHeatmap, registerLightTheme, registerLine, registerPie, registerPivotTable, registerRadar, registerRose, registerRoseParallel, registerScatter, registerTable, roseAdvancedPipeline, roseParallelAdvancedPipeline, roseParallelSpecPipeline, roseSpecPipeline, scatterAdvancedPipeline, scatterSpecPipeline, selector_selector as selector, tableAdvancedPipeline, tableSpecPipeline, unfoldDimensions, updateAdvanced, updateSpec, zAdvancedVSeed, zAnalysis, zAnnotation, zAnnotationArea, zAnnotationHorizontalLine, zAnnotationPoint, zAnnotationVerticalLine, zArea, zAreaConfig, zAreaPercent, zAreaPercentConfig, zAreaStyle, zAxis, zBackgroundColor, zBar, zBarConfig, zBarParallel, zBarParallelConfig, zBarPercent, zBarPercentConfig, zBarStyle, zChartType, zColor, zColorLegend, zColumn, zColumnConfig, zColumnParallel, zColumnParallelConfig, zColumnPercent, zColumnPercentConfig, zConfig, zCrosshairLine, zCrosshairRect, zCustomTheme, zCustomThemeConfig, zDataset, zDatasetReshapeInfo, zDatum, zDimension, zDimensionGroup, zDimensionTree, zDimensions, zDonut, zDonutConfig, zDualAxis, zDualAxisConfig, zDualChartType, zDualMeasure, zDualMeasures, zEncoding, zEncodings, zFoldInfo, zFunnel, zFunnelConfig, zHeatmap, zHeatmapConfig, zLabel, zLegend, zLine, zLineConfig, zLineStyle, zLinearColor, zLocale, zMarkStyle, zMeasure, zMeasureGroup, zMeasureTree, zMeasures, zNumFormat, zPie, zPieConfig, zPivotTable, zPivotTableConfig, zPointStyle, zRadar, zRadarConfig, zRose, zRoseConfig, zRoseParallel, zRoseParallelConfig, zScatter, zScatterConfig, zScatterMeasure, zScatterMeasures, zSort, zSortLegend, zStackCornerRadius, zTable, zTableConfig, zTheme, zTooltip, zUnfoldInfo, zVSeed, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
9339
+ export { AngleEncoding, Builder, ColorEncoding, ColorIdEncoding, DetailEncoding, FoldMeasureId, FoldMeasureName, FoldMeasureValue, FoldPrimaryMeasureValue, FoldSecondaryMeasureValue, FoldXMeasureValue, FoldYMeasureValue, MeasureName, ORIGINAL_DATA, Separator, XEncoding, YEncoding, areaAdvancedPipeline, areaPercentAdvancedPipeline, areaPercentSpecPipeline, areaSpecPipeline, autoFormatter, autoNumFormatter, barAdvancedPipeline, barParallelAdvancedPipeline, barParallelSpecPipeline, barPercentAdvancedPipeline, barPercentSpecPipeline, barSpecPipeline, columnAdvancedPipeline, columnParallelAdvancedPipeline, columnParallelSpecPipeline, columnPercentAdvancedPipeline, columnPercentSpecPipeline, columnSpecPipeline, createFormatter, createNumFormatter, darkTheme, dataReshapeByEncoding, donutAdvancedPipeline, donutSpecPipeline, dualAxisAdvancedPipeline, dualAxisSpecPipeline, execPipeline, findAllDimensions, findAllMeasures, findFirstMeasure, findMeasureById, foldMeasures, funnelAdvancedPipeline, funnelSpecPipeline, heatmapAdvancedPipeline, heatmapSpecPipeline, i18n, intl, isDimensionSelector, isMeasure, isMeasureGroup, isMeasureSelector, isMeasures, isPartialDatumSelector, isPivotChart, isPivotTable, isTable, isVChart, isVTable, isValueSelector, lightTheme, lineAdvancedPipeline, lineSpecPipeline, measureDepth, pieAdvancedPipeline, pieSpecPipeline, pivotTableAdvancedPipeline, pivotTableSpecPipeline, preorderTraverse, radarAdvancedPipeline, radarSpecPipeline, registerAll, registerArea, registerAreaPercent, registerBar, registerBarParallel, registerBarPercent, registerColumn, registerColumnParallel, registerColumnPercent, registerCustomTheme, registerDarkTheme, registerDonut, registerFunnel, registerHeatmap, registerLightTheme, registerLine, registerPie, registerPivotTable, registerRadar, registerRose, registerRoseParallel, registerScatter, registerTable, roseAdvancedPipeline, roseParallelAdvancedPipeline, roseParallelSpecPipeline, roseSpecPipeline, scatterAdvancedPipeline, scatterSpecPipeline, selector_selector as selector, tableAdvancedPipeline, tableSpecPipeline, unfoldDimensions, updateAdvanced, updateSpec, zAdvancedVSeed, zAnalysis, zAnnotation, zAnnotationArea, zAnnotationHorizontalLine, zAnnotationPoint, zAnnotationVerticalLine, zArea, zAreaConfig, zAreaPercent, zAreaPercentConfig, zAreaStyle, zAxis, zBackgroundColor, zBar, zBarConfig, zBarParallel, zBarParallelConfig, zBarPercent, zBarPercentConfig, zBarStyle, zChartType, zColor, zColorLegend, zColumn, zColumnConfig, zColumnParallel, zColumnParallelConfig, zColumnPercent, zColumnPercentConfig, zConfig, zCrosshairLine, zCrosshairRect, zCustomTheme, zCustomThemeConfig, zDataset, zDatasetReshapeInfo, zDatum, zDimension, zDimensionGroup, zDimensionTree, zDimensions, zDonut, zDonutConfig, zDualAxis, zDualAxisConfig, zDualChartType, zDualMeasure, zDualMeasures, zEncoding, zEncodings, zFoldInfo, zFunnel, zFunnelConfig, zHeatmap, zHeatmapConfig, zLabel, zLegend, zLine, zLineConfig, zLineStyle, zLinearColor, zLocale, zMarkStyle, zMeasure, zMeasureGroup, zMeasureTree, zMeasures, zNumFormat, zPie, zPieConfig, zPivotTable, zPivotTableConfig, zPointStyle, zRadar, zRadarConfig, zRose, zRoseConfig, zRoseParallel, zRoseParallelConfig, zScatter, zScatterConfig, zScatterMeasure, zScatterMeasures, zSort, zSortLegend, zStackCornerRadius, zTable, zTableConfig, zTheme, zTooltip, zUnfoldInfo, zVSeed, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
9047
9340
 
9048
9341
  //# sourceMappingURL=index.js.map