@visactor/vseed 0.0.24 → 0.0.26

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 (33) hide show
  1. package/dist/index.cjs +340 -81
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +334 -81
  4. package/dist/index.js.map +1 -1
  5. package/dist/pipeline/advanced/chart/pipes/encoding/encodingMatrix.d.ts +2 -0
  6. package/dist/pipeline/spec/chart/pipes/color/index.d.ts +1 -0
  7. package/dist/pipeline/spec/chart/pipes/color/linearColor.d.ts +2 -0
  8. package/dist/pipeline/spec/chart/pipes/dataset/{dataset.d.ts → datasetXY.d.ts} +1 -1
  9. package/dist/pipeline/spec/chart/pipes/dataset/datasetYX.d.ts +2 -0
  10. package/dist/pipeline/spec/chart/pipes/dataset/index.d.ts +2 -1
  11. package/dist/pipeline/spec/chart/pipes/init/heatmap.d.ts +2 -0
  12. package/dist/pipeline/spec/chart/pipes/label/index.d.ts +1 -0
  13. package/dist/pipeline/spec/chart/pipes/label/labelColorInversion.d.ts +2 -0
  14. package/dist/pipeline/spec/chart/pipes/legend/colorLegend.d.ts +2 -0
  15. package/dist/pipeline/spec/chart/pipes/legend/index.d.ts +1 -0
  16. package/dist/types/advancedVSeed.d.ts +2 -2
  17. package/dist/types/chartType/area/area.d.ts +1 -1
  18. package/dist/types/chartType/areaPercent/areaPercent.d.ts +1 -1
  19. package/dist/types/chartType/areaRange/areaRange.d.ts +1 -1
  20. package/dist/types/chartType/funnel/funnel.d.ts +6 -39
  21. package/dist/types/chartType/heatmap/heatmap.d.ts +6 -37
  22. package/dist/types/chartType/line/line.d.ts +1 -1
  23. package/dist/types/properties/config/color/color.d.ts +11 -0
  24. package/dist/types/properties/config/legend/legend.d.ts +26 -0
  25. package/dist/types/properties/markStyle/areaStyle.d.ts +0 -2
  26. package/dist/types/properties/markStyle/barStyle.d.ts +0 -6
  27. package/dist/types/properties/markStyle/lineStyle.d.ts +1 -6
  28. package/dist/types/properties/markStyle/markStyle.d.ts +2 -2
  29. package/dist/types/properties/markStyle/pointStyle.d.ts +0 -6
  30. package/dist/types/vseed.d.ts +6 -66
  31. package/dist/umd/index.js +336 -81
  32. package/dist/umd/index.js.map +1 -1
  33. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1362,7 +1362,7 @@ const encodingFunnel = (advancedVSeed)=>{
1362
1362
  unfoldInfo.groupId
1363
1363
  ];
1364
1364
  const color = [
1365
- unfoldInfo.groupId
1365
+ foldInfo.measureValue
1366
1366
  ];
1367
1367
  return [
1368
1368
  ...prev,
@@ -1848,6 +1848,39 @@ const scatterAdvancedPipeline = [
1848
1848
  markStyle_markStyle,
1849
1849
  annotation_annotation
1850
1850
  ];
1851
+ const encodingMatrix = (advancedVSeed)=>{
1852
+ const result = {
1853
+ ...advancedVSeed
1854
+ };
1855
+ const { datasetReshapeInfo, dimensions } = advancedVSeed;
1856
+ if (!datasetReshapeInfo || !dimensions) return result;
1857
+ const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
1858
+ const isZeroDimension = 0 === dimensions.length;
1859
+ const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
1860
+ const { foldInfo, unfoldInfo } = cur;
1861
+ const x = [
1862
+ isZeroDimension ? foldInfo.measureName : xDimension?.id
1863
+ ];
1864
+ const y = [
1865
+ unfoldInfo.groupName
1866
+ ];
1867
+ const color = [
1868
+ foldInfo.measureValue
1869
+ ];
1870
+ return [
1871
+ ...prev,
1872
+ {
1873
+ x,
1874
+ y,
1875
+ color
1876
+ }
1877
+ ];
1878
+ }, []);
1879
+ return {
1880
+ ...result,
1881
+ encoding
1882
+ };
1883
+ };
1851
1884
  const heatmapAdvancedPipeline = [
1852
1885
  initAdvancedVSeed,
1853
1886
  autoMeasures,
@@ -1857,7 +1890,7 @@ const heatmapAdvancedPipeline = [
1857
1890
  ], [
1858
1891
  pivotReshapeTo2D1M
1859
1892
  ]),
1860
- encodingXY,
1893
+ encodingMatrix,
1861
1894
  sortXBandAxis,
1862
1895
  heatmapConfig,
1863
1896
  theme_theme,
@@ -2032,12 +2065,11 @@ const tableAdvancedPipeline = [
2032
2065
  records_records,
2033
2066
  theme_theme
2034
2067
  ];
2035
- const dataset_dataset = (spec, context)=>{
2068
+ const datasetYX = (spec, context)=>{
2036
2069
  const { advancedVSeed, vseed } = context;
2037
2070
  const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
2038
2071
  const { orderMapping = {} } = analysis ?? {};
2039
2072
  const angle = encoding[0]?.angle?.[0];
2040
- const x = encoding[0]?.x?.[0];
2041
2073
  const y = encoding[0]?.y?.[0];
2042
2074
  const group = encoding[0]?.group?.[0];
2043
2075
  const id = datasetReshapeInfo[0].id;
@@ -2045,25 +2077,57 @@ const dataset_dataset = (spec, context)=>{
2045
2077
  if (angle) fields[angle] = {
2046
2078
  sortIndex: 0
2047
2079
  };
2048
- if (x) {
2049
- const order = orderMapping[x];
2050
- if (order) fields[x] = {
2080
+ if (y) {
2081
+ const order = orderMapping[y];
2082
+ if (order) fields[y] = {
2051
2083
  sortIndex: 0,
2052
2084
  domain: order,
2053
2085
  lockStatisticsByDomain: true
2054
2086
  };
2055
- else fields[x] = {
2087
+ else fields[y] = {
2056
2088
  sortIndex: 0
2057
2089
  };
2058
2090
  }
2059
- if (y) {
2060
- const order = orderMapping[y];
2061
- if (order) fields[y] = {
2091
+ if (group) {
2092
+ const order = orderMapping[group];
2093
+ if (order) fields[group] = {
2062
2094
  sortIndex: 0,
2063
2095
  domain: order,
2064
2096
  lockStatisticsByDomain: true
2065
2097
  };
2066
- else fields[y] = {
2098
+ else fields[group] = {
2099
+ sortIndex: 0
2100
+ };
2101
+ }
2102
+ return {
2103
+ ...spec,
2104
+ data: {
2105
+ id,
2106
+ values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset,
2107
+ fields: fields
2108
+ }
2109
+ };
2110
+ };
2111
+ const datasetXY = (spec, context)=>{
2112
+ const { advancedVSeed, vseed } = context;
2113
+ const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
2114
+ const { orderMapping = {} } = analysis ?? {};
2115
+ const angle = encoding[0]?.angle?.[0];
2116
+ const x = encoding[0]?.x?.[0];
2117
+ const group = encoding[0]?.group?.[0];
2118
+ const id = datasetReshapeInfo[0].id;
2119
+ const fields = {};
2120
+ if (angle) fields[angle] = {
2121
+ sortIndex: 0
2122
+ };
2123
+ if (x) {
2124
+ const order = orderMapping[x];
2125
+ if (order) fields[x] = {
2126
+ sortIndex: 0,
2127
+ domain: order,
2128
+ lockStatisticsByDomain: true
2129
+ };
2130
+ else fields[x] = {
2067
2131
  sortIndex: 0
2068
2132
  };
2069
2133
  }
@@ -2157,7 +2221,7 @@ const initBarParallel = (spec, context)=>{
2157
2221
  result.direction = 'horizontal';
2158
2222
  result.yField = [
2159
2223
  encoding[0].y[0],
2160
- unfoldInfo.groupName
2224
+ unfoldInfo.groupId
2161
2225
  ];
2162
2226
  result.xField = encoding[0].x[0];
2163
2227
  result.seriesField = encoding[0].group[0];
@@ -2306,7 +2370,7 @@ const initColumnParallel = (spec, context)=>{
2306
2370
  result.direction = 'vertical';
2307
2371
  result.xField = [
2308
2372
  encoding[0].x[0],
2309
- unfoldInfo.groupName
2373
+ unfoldInfo.groupId
2310
2374
  ];
2311
2375
  result.yField = encoding[0].y[0];
2312
2376
  result.seriesField = encoding[0].group[0];
@@ -2324,8 +2388,9 @@ const initPie = (spec, context)=>{
2324
2388
  ...spec
2325
2389
  };
2326
2390
  const { advancedVSeed } = context;
2327
- const { encoding } = advancedVSeed;
2391
+ const { encoding, dataset } = advancedVSeed;
2328
2392
  if (!encoding[0].angle || !encoding[0].radius || !encoding[0].group) return result;
2393
+ const showStroke = dataset.length > 20;
2329
2394
  result.type = 'pie';
2330
2395
  result.outerRadius = 0.8;
2331
2396
  result.innerRadius = 0;
@@ -2341,7 +2406,7 @@ const initPie = (spec, context)=>{
2341
2406
  result.pie = {
2342
2407
  style: {
2343
2408
  stroke: '#ffffff',
2344
- lineWidth: 1,
2409
+ lineWidth: showStroke ? 1 : 0,
2345
2410
  centerOffset: 0
2346
2411
  },
2347
2412
  state: {
@@ -2359,8 +2424,9 @@ const initDonut = (spec, context)=>{
2359
2424
  ...spec
2360
2425
  };
2361
2426
  const { advancedVSeed } = context;
2362
- const { encoding } = advancedVSeed;
2427
+ const { encoding, dataset } = advancedVSeed;
2363
2428
  if (!encoding[0].angle || !encoding[0].radius || !encoding[0].group) return result;
2429
+ const showStroke = dataset.length > 20;
2364
2430
  result.type = 'pie';
2365
2431
  result.outerRadius = 0.8;
2366
2432
  result.innerRadius = 0.8 * result.outerRadius;
@@ -2376,7 +2442,7 @@ const initDonut = (spec, context)=>{
2376
2442
  result.pie = {
2377
2443
  style: {
2378
2444
  stroke: '#ffffff',
2379
- lineWidth: 1
2445
+ lineWidth: showStroke ? 1 : 0
2380
2446
  },
2381
2447
  state: {
2382
2448
  hover: {
@@ -2435,7 +2501,7 @@ const initRoseParallel = (spec, context)=>{
2435
2501
  result.type = 'rose';
2436
2502
  result.categoryField = [
2437
2503
  encoding[0].angle[0],
2438
- unfoldInfo.groupName
2504
+ unfoldInfo.groupId
2439
2505
  ];
2440
2506
  result.valueField = encoding[0].radius[0];
2441
2507
  result.seriesField = encoding[0].group[0];
@@ -2527,7 +2593,11 @@ const initFunnel = (spec, context)=>{
2527
2593
  ];
2528
2594
  result.funnel = {
2529
2595
  style: {
2530
- cornerRadius: 4
2596
+ cornerRadius: 4,
2597
+ fill: {
2598
+ field: encoding[0].color[0],
2599
+ scale: 'color'
2600
+ }
2531
2601
  },
2532
2602
  state: {
2533
2603
  hover: {
@@ -3173,6 +3243,16 @@ const label_label = (spec, context)=>{
3173
3243
  };
3174
3244
  return result;
3175
3245
  };
3246
+ const labelColorInversion = (spec)=>{
3247
+ const result = {
3248
+ ...spec
3249
+ };
3250
+ if (result.label) result.label.smartInvert = true;
3251
+ else result.label = {
3252
+ smartInvert: true
3253
+ };
3254
+ return result;
3255
+ };
3176
3256
  const discreteLegend = (spec, context)=>{
3177
3257
  const result = {
3178
3258
  ...spec
@@ -3382,6 +3462,69 @@ const pivotDiscreteLegend = (spec, context)=>{
3382
3462
  legends
3383
3463
  };
3384
3464
  };
3465
+ const colorLegend = (spec, context)=>{
3466
+ const result = {
3467
+ ...spec
3468
+ };
3469
+ const { advancedVSeed } = context;
3470
+ const { chartType } = advancedVSeed;
3471
+ const baseConfig = advancedVSeed.config[chartType];
3472
+ const { encoding } = advancedVSeed;
3473
+ if (!encoding[0].color) return result;
3474
+ if (!baseConfig || !baseConfig.legend) return result;
3475
+ const { legend } = baseConfig;
3476
+ const { enable, position = 'bottom' } = legend || {};
3477
+ const orient = [
3478
+ 'bottom',
3479
+ 'bottomLeft',
3480
+ 'bottomRight',
3481
+ 'bl',
3482
+ 'br'
3483
+ ].includes(position) ? 'bottom' : [
3484
+ 'top',
3485
+ 'topLeft',
3486
+ 'topRight',
3487
+ 'tl',
3488
+ 'tr'
3489
+ ].includes(position) ? 'top' : [
3490
+ 'left',
3491
+ 'leftTop',
3492
+ 'leftBottom',
3493
+ 'lt',
3494
+ 'lb'
3495
+ ].includes(position) ? 'left' : 'right';
3496
+ const legendPosition = [
3497
+ 'topLeft',
3498
+ 'bottomLeft',
3499
+ 'leftTop',
3500
+ 'rightTop',
3501
+ 'lt',
3502
+ 'rt',
3503
+ 'tl',
3504
+ 'bl'
3505
+ ].includes(position) ? 'start' : [
3506
+ 'topRight',
3507
+ 'bottomRight',
3508
+ 'leftBottom',
3509
+ 'rightBottom',
3510
+ 'lb',
3511
+ 'rb',
3512
+ 'rt',
3513
+ 'br'
3514
+ ].includes(position) ? 'end' : 'middle';
3515
+ result.legends = {
3516
+ type: 'color',
3517
+ visible: enable,
3518
+ orient,
3519
+ position: legendPosition,
3520
+ field: encoding[0].color[0],
3521
+ inverse: !![
3522
+ 'left',
3523
+ 'right'
3524
+ ].includes(orient)
3525
+ };
3526
+ return result;
3527
+ };
3385
3528
  const color_color = (spec, context)=>{
3386
3529
  const result = {
3387
3530
  ...spec
@@ -3409,6 +3552,28 @@ const color_color = (spec, context)=>{
3409
3552
  };
3410
3553
  return result;
3411
3554
  };
3555
+ const linearColor = (spec, context)=>{
3556
+ const result = {
3557
+ ...spec
3558
+ };
3559
+ const { advancedVSeed } = context;
3560
+ const { datasetReshapeInfo, chartType, encoding } = advancedVSeed;
3561
+ const baseConfig = advancedVSeed.config[chartType];
3562
+ if (!baseConfig || !baseConfig.color) return result;
3563
+ const { color } = baseConfig;
3564
+ const { colorScheme } = color;
3565
+ result.color = {
3566
+ type: 'linear',
3567
+ domain: [
3568
+ {
3569
+ dataId: datasetReshapeInfo[0].id,
3570
+ fields: encoding?.[0]?.color
3571
+ }
3572
+ ],
3573
+ range: colorScheme
3574
+ };
3575
+ return result;
3576
+ };
3412
3577
  const pivotAdapter_pivotAdapter = (pipeline, pivotPipeline)=>(spec, context)=>{
3413
3578
  const { vseed } = context;
3414
3579
  const usePivotChart = isPivotChart(vseed);
@@ -4640,7 +4805,7 @@ const line_line = [
4640
4805
  initLine,
4641
4806
  color_color,
4642
4807
  background_backgroundColor,
4643
- dataset_dataset,
4808
+ datasetXY,
4644
4809
  xBand,
4645
4810
  yLinear,
4646
4811
  label_label,
@@ -4664,7 +4829,7 @@ const pivotLine = [
4664
4829
  initLine,
4665
4830
  color_color,
4666
4831
  background_backgroundColor,
4667
- dataset_dataset,
4832
+ datasetXY,
4668
4833
  xBand,
4669
4834
  yLinear,
4670
4835
  label_label,
@@ -4691,7 +4856,7 @@ const column = [
4691
4856
  stackInverse,
4692
4857
  color_color,
4693
4858
  background_backgroundColor,
4694
- dataset_dataset,
4859
+ datasetXY,
4695
4860
  xBand,
4696
4861
  yLinear,
4697
4862
  label_label,
@@ -4715,7 +4880,7 @@ const pivotColumn = [
4715
4880
  stackInverse,
4716
4881
  color_color,
4717
4882
  background_backgroundColor,
4718
- dataset_dataset,
4883
+ datasetXY,
4719
4884
  xBand,
4720
4885
  yLinear,
4721
4886
  label_label,
@@ -4739,7 +4904,7 @@ const columnParallel = [
4739
4904
  stackCornerRadius_stackCornerRadius,
4740
4905
  color_color,
4741
4906
  background_backgroundColor,
4742
- dataset_dataset,
4907
+ datasetXY,
4743
4908
  xBand,
4744
4909
  yLinear,
4745
4910
  label_label,
@@ -4762,7 +4927,7 @@ const pivotColumnParallel = [
4762
4927
  stackCornerRadius_stackCornerRadius,
4763
4928
  color_color,
4764
4929
  background_backgroundColor,
4765
- dataset_dataset,
4930
+ datasetXY,
4766
4931
  xBand,
4767
4932
  yLinear,
4768
4933
  label_label,
@@ -4788,7 +4953,7 @@ const columnPercent = [
4788
4953
  color_color,
4789
4954
  background_backgroundColor,
4790
4955
  percent,
4791
- dataset_dataset,
4956
+ datasetXY,
4792
4957
  xBand,
4793
4958
  yLinear,
4794
4959
  label_label,
@@ -4813,7 +4978,7 @@ const pivotColumnPercent = [
4813
4978
  color_color,
4814
4979
  percent,
4815
4980
  background_backgroundColor,
4816
- dataset_dataset,
4981
+ datasetXY,
4817
4982
  xBand,
4818
4983
  yLinear,
4819
4984
  label_label,
@@ -4837,7 +5002,7 @@ const bar = [
4837
5002
  stackCornerRadius_stackCornerRadius,
4838
5003
  color_color,
4839
5004
  background_backgroundColor,
4840
- dataset_dataset,
5005
+ datasetYX,
4841
5006
  xLinear,
4842
5007
  yBand,
4843
5008
  label_label,
@@ -4860,7 +5025,7 @@ const pivotBar = [
4860
5025
  stackCornerRadius_stackCornerRadius,
4861
5026
  color_color,
4862
5027
  background_backgroundColor,
4863
- dataset_dataset,
5028
+ datasetYX,
4864
5029
  xLinear,
4865
5030
  yBand,
4866
5031
  label_label,
@@ -4885,7 +5050,7 @@ const barParallel = [
4885
5050
  stackCornerRadius_stackCornerRadius,
4886
5051
  color_color,
4887
5052
  background_backgroundColor,
4888
- dataset_dataset,
5053
+ datasetYX,
4889
5054
  xLinear,
4890
5055
  yBand,
4891
5056
  label_label,
@@ -4908,7 +5073,7 @@ const pivotBarParallel = [
4908
5073
  stackCornerRadius_stackCornerRadius,
4909
5074
  color_color,
4910
5075
  background_backgroundColor,
4911
- dataset_dataset,
5076
+ datasetYX,
4912
5077
  xLinear,
4913
5078
  yBand,
4914
5079
  label_label,
@@ -4933,7 +5098,7 @@ const barPercent = [
4933
5098
  color_color,
4934
5099
  background_backgroundColor,
4935
5100
  percent,
4936
- dataset_dataset,
5101
+ datasetYX,
4937
5102
  xLinear,
4938
5103
  yBand,
4939
5104
  label_label,
@@ -4957,7 +5122,7 @@ const pivotBarPercent = [
4957
5122
  color_color,
4958
5123
  background_backgroundColor,
4959
5124
  percent,
4960
- dataset_dataset,
5125
+ datasetYX,
4961
5126
  yBand,
4962
5127
  xLinear,
4963
5128
  label_label,
@@ -4981,7 +5146,7 @@ const area_area = [
4981
5146
  stackInverse,
4982
5147
  color_color,
4983
5148
  background_backgroundColor,
4984
- dataset_dataset,
5149
+ datasetXY,
4985
5150
  xBand,
4986
5151
  yLinear,
4987
5152
  label_label,
@@ -5007,7 +5172,7 @@ const pivotArea = [
5007
5172
  color_color,
5008
5173
  background_backgroundColor,
5009
5174
  stackInverse,
5010
- dataset_dataset,
5175
+ datasetXY,
5011
5176
  xBand,
5012
5177
  yLinear,
5013
5178
  label_label,
@@ -5035,7 +5200,7 @@ const areaPercent = [
5035
5200
  color_color,
5036
5201
  background_backgroundColor,
5037
5202
  percent,
5038
- dataset_dataset,
5203
+ datasetXY,
5039
5204
  xBand,
5040
5205
  yLinear,
5041
5206
  label_label,
@@ -5061,7 +5226,7 @@ const pivotAreaPercent = [
5061
5226
  color_color,
5062
5227
  background_backgroundColor,
5063
5228
  percent,
5064
- dataset_dataset,
5229
+ datasetXY,
5065
5230
  xBand,
5066
5231
  yLinear,
5067
5232
  label_label,
@@ -5097,7 +5262,7 @@ const areaRange = [
5097
5262
  pointStyle_pointStyle,
5098
5263
  pointStateDimensionHover
5099
5264
  ]),
5100
- dataset_dataset,
5265
+ datasetXY,
5101
5266
  background_backgroundColor,
5102
5267
  xBand,
5103
5268
  yLinear,
@@ -5129,7 +5294,7 @@ const pivotAreaRange = [
5129
5294
  pointStateDimensionHover
5130
5295
  ]),
5131
5296
  background_backgroundColor,
5132
- dataset_dataset,
5297
+ datasetXY,
5133
5298
  xBand,
5134
5299
  yLinear,
5135
5300
  label_label,
@@ -5149,7 +5314,7 @@ const scatter = [
5149
5314
  initScatter,
5150
5315
  color_color,
5151
5316
  background_backgroundColor,
5152
- dataset_dataset,
5317
+ datasetXY,
5153
5318
  xLinear,
5154
5319
  yLinear,
5155
5320
  label_label,
@@ -5173,7 +5338,7 @@ const pivotScatter = [
5173
5338
  initScatter,
5174
5339
  color_color,
5175
5340
  background_backgroundColor,
5176
- dataset_dataset,
5341
+ datasetXY,
5177
5342
  xLinear,
5178
5343
  yLinear,
5179
5344
  label_label,
@@ -5198,7 +5363,7 @@ const pie = [
5198
5363
  initPie,
5199
5364
  color_color,
5200
5365
  background_backgroundColor,
5201
- dataset_dataset,
5366
+ datasetXY,
5202
5367
  label_label,
5203
5368
  tooltip_tooltip,
5204
5369
  discreteLegend,
@@ -5216,7 +5381,7 @@ const pivotPie = [
5216
5381
  initPie,
5217
5382
  color_color,
5218
5383
  background_backgroundColor,
5219
- dataset_dataset,
5384
+ datasetXY,
5220
5385
  label_label,
5221
5386
  tooltip_tooltip,
5222
5387
  annotationPoint_annotationPoint,
@@ -5235,7 +5400,7 @@ const donut = [
5235
5400
  initDonut,
5236
5401
  color_color,
5237
5402
  background_backgroundColor,
5238
- dataset_dataset,
5403
+ datasetXY,
5239
5404
  label_label,
5240
5405
  tooltip_tooltip,
5241
5406
  discreteLegend,
@@ -5253,7 +5418,7 @@ const pivotDonut = [
5253
5418
  initDonut,
5254
5419
  color_color,
5255
5420
  background_backgroundColor,
5256
- dataset_dataset,
5421
+ datasetXY,
5257
5422
  label_label,
5258
5423
  tooltip_tooltip,
5259
5424
  annotationPoint_annotationPoint,
@@ -5274,7 +5439,7 @@ const rose = [
5274
5439
  stackInverse,
5275
5440
  color_color,
5276
5441
  background_backgroundColor,
5277
- dataset_dataset,
5442
+ datasetXY,
5278
5443
  radiusAxis,
5279
5444
  angleAxis,
5280
5445
  label_label,
@@ -5293,7 +5458,7 @@ const pivotRose = [
5293
5458
  stackInverse,
5294
5459
  color_color,
5295
5460
  background_backgroundColor,
5296
- dataset_dataset,
5461
+ datasetXY,
5297
5462
  radiusAxis,
5298
5463
  angleAxis,
5299
5464
  label_label,
@@ -5312,7 +5477,7 @@ const roseParallel = [
5312
5477
  stackCornerRadius_stackCornerRadius,
5313
5478
  color_color,
5314
5479
  background_backgroundColor,
5315
- dataset_dataset,
5480
+ datasetXY,
5316
5481
  radiusAxis,
5317
5482
  angleAxis,
5318
5483
  label_label,
@@ -5334,7 +5499,7 @@ const pivotRoseParallel = [
5334
5499
  stackCornerRadius_stackCornerRadius,
5335
5500
  color_color,
5336
5501
  background_backgroundColor,
5337
- dataset_dataset,
5502
+ datasetXY,
5338
5503
  radiusAxis,
5339
5504
  angleAxis,
5340
5505
  label_label,
@@ -5356,7 +5521,7 @@ const radar = [
5356
5521
  initRadar,
5357
5522
  color_color,
5358
5523
  background_backgroundColor,
5359
- dataset_dataset,
5524
+ datasetXY,
5360
5525
  radarAngleAxis,
5361
5526
  radarRadiusAxis,
5362
5527
  label_label,
@@ -5377,7 +5542,7 @@ const pivotRadar = [
5377
5542
  initRadar,
5378
5543
  color_color,
5379
5544
  background_backgroundColor,
5380
- dataset_dataset,
5545
+ datasetXY,
5381
5546
  radarAngleAxis,
5382
5547
  radarRadiusAxis,
5383
5548
  label_label,
@@ -5397,12 +5562,12 @@ const radarSpecPipeline = [
5397
5562
  ];
5398
5563
  const funnel = [
5399
5564
  initFunnel,
5400
- color_color,
5565
+ linearColor,
5401
5566
  background_backgroundColor,
5402
- dataset_dataset,
5567
+ datasetXY,
5403
5568
  label_label,
5404
5569
  tooltip_tooltip,
5405
- discreteLegend,
5570
+ colorLegend,
5406
5571
  annotationPoint_annotationPoint,
5407
5572
  annotationVerticalLine_annotationVerticalLine,
5408
5573
  annotationHorizontalLine_annotationHorizontalLine,
@@ -5415,34 +5580,76 @@ const pivotFunnel = [
5415
5580
  datasetPivot,
5416
5581
  pivotIndicators([
5417
5582
  initFunnel,
5418
- color_color,
5583
+ linearColor,
5419
5584
  background_backgroundColor,
5420
- dataset_dataset,
5585
+ datasetXY,
5421
5586
  label_label,
5422
5587
  tooltip_tooltip,
5588
+ colorLegend,
5423
5589
  annotationPoint_annotationPoint,
5424
5590
  annotationVerticalLine_annotationVerticalLine,
5425
5591
  annotationHorizontalLine_annotationHorizontalLine,
5426
5592
  annotationArea_annotationArea
5427
5593
  ]),
5428
5594
  pivotRowDimensions,
5429
- pivotColumnDimensions,
5430
- pivotDiscreteLegend
5595
+ pivotColumnDimensions
5431
5596
  ];
5432
5597
  const funnelSpecPipeline = [
5433
5598
  pivotAdapter_pivotAdapter(funnel, pivotFunnel)
5434
5599
  ];
5600
+ const initHeatmap = (spec, context)=>{
5601
+ const result = {
5602
+ ...spec
5603
+ };
5604
+ const { advancedVSeed } = context;
5605
+ const { encoding } = advancedVSeed;
5606
+ if (!encoding[0].y || !encoding[0].x || !encoding[0].color) return result;
5607
+ result.type = 'heatmap';
5608
+ result.direction = 'vertical';
5609
+ result.xField = encoding[0].x[0];
5610
+ result.yField = encoding[0].y[0];
5611
+ result.valueField = encoding[0].color[0];
5612
+ result.padding = 0;
5613
+ result.cell = {
5614
+ style: {
5615
+ shape: 'rect',
5616
+ stroke: '#ffffff',
5617
+ lineWidth: 1,
5618
+ fill: {
5619
+ field: encoding[0].color[0],
5620
+ scale: 'color'
5621
+ }
5622
+ }
5623
+ };
5624
+ result.axes = [
5625
+ {
5626
+ type: 'band',
5627
+ orient: 'left',
5628
+ bandPadding: 0
5629
+ },
5630
+ {
5631
+ type: 'band',
5632
+ orient: 'bottom',
5633
+ bandPadding: 0
5634
+ }
5635
+ ];
5636
+ result.region = [
5637
+ {
5638
+ clip: true
5639
+ }
5640
+ ];
5641
+ result.animation = true;
5642
+ return result;
5643
+ };
5435
5644
  const heatmap = [
5436
- initLine,
5437
- color_color,
5645
+ initHeatmap,
5646
+ linearColor,
5438
5647
  background_backgroundColor,
5439
- dataset_dataset,
5440
- xBand,
5441
- yLinear,
5648
+ datasetXY,
5442
5649
  label_label,
5650
+ labelColorInversion,
5651
+ colorLegend,
5443
5652
  tooltip_tooltip,
5444
- verticalCrosshairLine,
5445
- discreteLegend,
5446
5653
  pointStyle_pointStyle,
5447
5654
  pointStateDimensionHover,
5448
5655
  lineStyle_lineStyle,
@@ -5457,15 +5664,14 @@ const pivotHeatmap = [
5457
5664
  pivotIndicators_pivotIndicatorsAsRow,
5458
5665
  datasetPivot,
5459
5666
  pivotIndicators([
5460
- initLine,
5461
- color_color,
5667
+ initHeatmap,
5668
+ linearColor,
5462
5669
  background_backgroundColor,
5463
- dataset_dataset,
5464
- xBand,
5465
- yLinear,
5670
+ datasetXY,
5466
5671
  label_label,
5672
+ labelColorInversion,
5673
+ colorLegend,
5467
5674
  tooltip_tooltip,
5468
- verticalCrosshairLine,
5469
5675
  pointStyle_pointStyle,
5470
5676
  pointStateDimensionHover,
5471
5677
  lineStyle_lineStyle,
@@ -5475,8 +5681,7 @@ const pivotHeatmap = [
5475
5681
  annotationArea_annotationArea
5476
5682
  ]),
5477
5683
  pivotRowDimensions,
5478
- pivotColumnDimensions,
5479
- pivotDiscreteLegend
5684
+ pivotColumnDimensions
5480
5685
  ];
5481
5686
  const heatmapSpecPipeline = [
5482
5687
  pivotAdapter_pivotAdapter(heatmap, pivotHeatmap)
@@ -6394,6 +6599,9 @@ const darkTheme = ()=>{
6394
6599
  '#A0CEFF'
6395
6600
  ]
6396
6601
  }
6602
+ },
6603
+ heatmap: {
6604
+ ...baseConfig
6397
6605
  }
6398
6606
  }
6399
6607
  };
@@ -6695,7 +6903,24 @@ const lightTheme = ()=>{
6695
6903
  '#ACB9FF',
6696
6904
  '#B7C4FF',
6697
6905
  '#C2CEFF'
6698
- ]
6906
+ ].reverse()
6907
+ }
6908
+ },
6909
+ heatmap: {
6910
+ ...baseConfig,
6911
+ color: {
6912
+ colorScheme: [
6913
+ '#5766EC',
6914
+ '#6372F0',
6915
+ '#7080F4',
6916
+ '#7C8CFA',
6917
+ '#8998FF',
6918
+ '#95A3FF',
6919
+ '#A0AEFF',
6920
+ '#ACB9FF',
6921
+ '#B7C4FF',
6922
+ '#C2CEFF'
6923
+ ].reverse()
6699
6924
  }
6700
6925
  }
6701
6926
  }
@@ -6969,6 +7194,9 @@ const zColor = z.object({
6969
7194
  colorScheme: z.array(z.string()).optional(),
6970
7195
  colorMapping: z.record(z.string(), z.string()).optional()
6971
7196
  });
7197
+ const zLinearColor = z.object({
7198
+ colorScheme: z.array(z.string()).optional()
7199
+ });
6972
7200
  const zLabel = z.object({
6973
7201
  enable: z.boolean().default(true).optional()
6974
7202
  });
@@ -7026,6 +7254,31 @@ const zLegend = z.object({
7026
7254
  labelFontColor: z.string().default('#fff').optional(),
7027
7255
  labelFontWeight: z.number().or(z.string()).default(400).optional()
7028
7256
  });
7257
+ const zColorLegend = z.object({
7258
+ position: z["enum"]([
7259
+ 'left',
7260
+ 'leftTop',
7261
+ 'leftBottom',
7262
+ 'lt',
7263
+ 'lb',
7264
+ 'top',
7265
+ 'topLeft',
7266
+ 'topRight',
7267
+ 'tl',
7268
+ 'tr',
7269
+ 'right',
7270
+ 'rightTop',
7271
+ 'rightBottom',
7272
+ 'rt',
7273
+ 'rb',
7274
+ 'bottom',
7275
+ 'bottomLeft',
7276
+ 'bottomRight',
7277
+ 'bl',
7278
+ 'br'
7279
+ ]).default('bottom').optional(),
7280
+ enable: z.boolean().default(true).optional()
7281
+ });
7029
7282
  const zTooltip = z.object({
7030
7283
  enable: z.boolean().default(true).optional()
7031
7284
  });
@@ -7301,7 +7554,7 @@ const zLineStyle = z.object({
7301
7554
  zSelector,
7302
7555
  zSelectors
7303
7556
  ]).optional(),
7304
- lineSmooth: z.boolean().default(true).optional(),
7557
+ lineSmooth: z.boolean().optional(),
7305
7558
  lineColor: z.string().optional(),
7306
7559
  lineColorOpacity: z.number().optional(),
7307
7560
  lineWidth: z.number().optional(),
@@ -7858,9 +8111,9 @@ const zFunnel = z.object({
7858
8111
  dimensions: zDimensions.optional(),
7859
8112
  measures: zMeasureTree.optional(),
7860
8113
  backgroundColor: zBackgroundColor.optional(),
7861
- color: zColor.optional(),
8114
+ color: zLinearColor.optional(),
7862
8115
  label: zLabel.optional(),
7863
- legend: zLegend.optional(),
8116
+ legend: zColorLegend.optional(),
7864
8117
  tooltip: zTooltip.optional(),
7865
8118
  theme: zTheme.optional(),
7866
8119
  locale: zLocale.optional()
@@ -7871,9 +8124,9 @@ const zHeatmap = z.object({
7871
8124
  dimensions: zDimensions.optional(),
7872
8125
  measures: zMeasureTree.optional(),
7873
8126
  backgroundColor: zBackgroundColor.optional(),
7874
- color: zColor.optional(),
8127
+ color: zLinearColor.optional(),
7875
8128
  label: zLabel.optional(),
7876
- legend: zLegend.optional(),
8129
+ legend: zColorLegend.optional(),
7877
8130
  tooltip: zTooltip.optional(),
7878
8131
  theme: zTheme.optional(),
7879
8132
  locale: zLocale.optional()
@@ -7915,6 +8168,6 @@ const zAdvancedVSeed = z.object({
7915
8168
  annotation: zAnnotation,
7916
8169
  locale: zLocale
7917
8170
  });
7918
- export { Builder, FoldMeasureId, FoldMeasureName, FoldMeasureValue, ORIGINAL_DATA, Separator, UnfoldDimensionGroup, UnfoldDimensionGroupId, areaAdvancedPipeline, areaPercentAdvancedPipeline, areaPercentSpecPipeline, areaRangeAdvancedPipeline, areaRangeSpecPipeline, areaSpecPipeline, autoFormatter, autoNumFormatter, barAdvancedPipeline, barParallelAdvancedPipeline, barParallelSpecPipeline, barPercentAdvancedPipeline, barPercentSpecPipeline, barSpecPipeline, columnAdvancedPipeline, columnParallelAdvancedPipeline, columnParallelSpecPipeline, columnPercentAdvancedPipeline, columnPercentSpecPipeline, columnSpecPipeline, createFormatter, createNumFormatter, darkTheme, dataReshapeFor1D, dataReshapeFor1D1M, dataReshapeFor1D2M, dataReshapeFor2D1M, dataReshapeFor2D1M0Name, donutAdvancedPipeline, donutSpecPipeline, execPipeline, findAllDimensions, findAllMeasures, findDimensionById, findFirstDimension, findFirstMeasure, findMeasureById, foldMeasures, funnelAdvancedPipeline, funnelSpecPipeline, heatmapAdvancedPipeline, heatmapSpecPipeline, i18n, intl, isPivotChart, isPivotTable, isTable, isVChart, isVTable, lightTheme, lineAdvancedPipeline, lineSpecPipeline, pieAdvancedPipeline, pieSpecPipeline, pivotTableAdvancedPipeline, pivotTableSpecPipeline, preorderTraverse, radarAdvancedPipeline, radarSpecPipeline, registerAll, registerArea, registerAreaPercent, registerAreaRange, 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, tableAdvancedPipeline, tableSpecPipeline, unfoldDimensions, updateAdvanced, updateSpec, zAdvancedVSeed, zAnalysis, zAnnotation, zAnnotationArea, zAnnotationHorizontalLine, zAnnotationPoint, zAnnotationVerticalLine, zArea, zAreaConfig, zAreaPercent, zAreaPercentConfig, zAreaRange, zAreaRangeConfig, zAreaStyle, zAxis, zBackgroundColor, zBar, zBarConfig, zBarParallel, zBarParallelConfig, zBarPercent, zBarPercentConfig, zBarStyle, zChartType, zColor, zColumn, zColumnConfig, zColumnParallel, zColumnParallelConfig, zColumnPercent, zColumnPercentConfig, zConfig, zCrosshairLine, zCrosshairRect, zCustomTheme, zCustomThemeConfig, zDataset, zDatasetReshapeInfo, zDatum, zDimension, zDimensionGroup, zDimensionTree, zDimensions, zDonut, zDonutConfig, zDualAxisConfig, zEncoding, zFoldInfo, zFunnel, zFunnelConfig, zHeatmap, zHeatmapConfig, zLabel, zLegend, zLine, zLineConfig, zLineStyle, zLocale, zMarkStyle, zMeasure, zMeasureGroup, zMeasureTree, zMeasures, zNumFormat, zPie, zPieConfig, zPivotTable, zPivotTableConfig, zPointStyle, zRadar, zRadarConfig, zRose, zRoseConfig, zRoseParallel, zRoseParallelConfig, zScatter, zScatterConfig, zSortAxis, zSortLegend, zStackCornerRadius, zTable, zTableConfig, zTheme, zTooltip, zUnfoldInfo, zVSeed, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
8171
+ export { Builder, FoldMeasureId, FoldMeasureName, FoldMeasureValue, ORIGINAL_DATA, Separator, UnfoldDimensionGroup, UnfoldDimensionGroupId, areaAdvancedPipeline, areaPercentAdvancedPipeline, areaPercentSpecPipeline, areaRangeAdvancedPipeline, areaRangeSpecPipeline, areaSpecPipeline, autoFormatter, autoNumFormatter, barAdvancedPipeline, barParallelAdvancedPipeline, barParallelSpecPipeline, barPercentAdvancedPipeline, barPercentSpecPipeline, barSpecPipeline, columnAdvancedPipeline, columnParallelAdvancedPipeline, columnParallelSpecPipeline, columnPercentAdvancedPipeline, columnPercentSpecPipeline, columnSpecPipeline, createFormatter, createNumFormatter, darkTheme, dataReshapeFor1D, dataReshapeFor1D1M, dataReshapeFor1D2M, dataReshapeFor2D1M, dataReshapeFor2D1M0Name, donutAdvancedPipeline, donutSpecPipeline, execPipeline, findAllDimensions, findAllMeasures, findDimensionById, findFirstDimension, findFirstMeasure, findMeasureById, foldMeasures, funnelAdvancedPipeline, funnelSpecPipeline, heatmapAdvancedPipeline, heatmapSpecPipeline, i18n, intl, isPivotChart, isPivotTable, isTable, isVChart, isVTable, lightTheme, lineAdvancedPipeline, lineSpecPipeline, pieAdvancedPipeline, pieSpecPipeline, pivotTableAdvancedPipeline, pivotTableSpecPipeline, preorderTraverse, radarAdvancedPipeline, radarSpecPipeline, registerAll, registerArea, registerAreaPercent, registerAreaRange, 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, tableAdvancedPipeline, tableSpecPipeline, unfoldDimensions, updateAdvanced, updateSpec, zAdvancedVSeed, zAnalysis, zAnnotation, zAnnotationArea, zAnnotationHorizontalLine, zAnnotationPoint, zAnnotationVerticalLine, zArea, zAreaConfig, zAreaPercent, zAreaPercentConfig, zAreaRange, zAreaRangeConfig, 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, zDualAxisConfig, zEncoding, 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, zSortAxis, zSortLegend, zStackCornerRadius, zTable, zTableConfig, zTheme, zTooltip, zUnfoldInfo, zVSeed, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
7919
8172
 
7920
8173
  //# sourceMappingURL=index.js.map