@visactor/vseed 0.0.24 → 0.0.25

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 +337 -78
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.js +331 -78
  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 +333 -78
  32. package/dist/umd/index.js.map +1 -1
  33. package/package.json +1 -1
package/dist/umd/index.js CHANGED
@@ -64,6 +64,7 @@
64
64
  findAllMeasures: ()=>findAllMeasures,
65
65
  funnelSpecPipeline: ()=>funnelSpecPipeline,
66
66
  zAnalysis: ()=>zAnalysis,
67
+ zColorLegend: ()=>zColorLegend,
67
68
  preorderTraverse: ()=>preorderTraverse,
68
69
  zDimensionTree: ()=>zDimensionTree,
69
70
  roseParallelSpecPipeline: ()=>roseParallelSpecPipeline,
@@ -152,9 +153,10 @@
152
153
  UnfoldDimensionGroup: ()=>UnfoldDimensionGroup,
153
154
  zDatasetReshapeInfo: ()=>zDatasetReshapeInfo,
154
155
  zFoldInfo: ()=>zFoldInfo,
155
- zUnfoldInfo: ()=>zUnfoldInfo,
156
+ zLinearColor: ()=>zLinearColor,
156
157
  zAreaStyle: ()=>zAreaStyle,
157
158
  ORIGINAL_DATA: ()=>ORIGINAL_DATA,
159
+ zUnfoldInfo: ()=>zUnfoldInfo,
158
160
  zAnnotationArea: ()=>zAnnotationArea,
159
161
  columnParallelSpecPipeline: ()=>columnParallelSpecPipeline,
160
162
  i18n: ()=>i18n,
@@ -2332,7 +2334,7 @@
2332
2334
  unfoldInfo.groupId
2333
2335
  ];
2334
2336
  const color = [
2335
- unfoldInfo.groupId
2337
+ foldInfo.measureValue
2336
2338
  ];
2337
2339
  return [
2338
2340
  ...prev,
@@ -2880,6 +2882,39 @@
2880
2882
  markStyle_markStyle,
2881
2883
  annotation_annotation
2882
2884
  ];
2885
+ const encodingMatrix = (advancedVSeed)=>{
2886
+ const result = {
2887
+ ...advancedVSeed
2888
+ };
2889
+ const { datasetReshapeInfo, dimensions } = advancedVSeed;
2890
+ if (!datasetReshapeInfo || !dimensions) return result;
2891
+ const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
2892
+ const isZeroDimension = 0 === dimensions.length;
2893
+ const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
2894
+ const { foldInfo, unfoldInfo } = cur;
2895
+ const x = [
2896
+ isZeroDimension ? foldInfo.measureName : xDimension?.id
2897
+ ];
2898
+ const y = [
2899
+ unfoldInfo.groupName
2900
+ ];
2901
+ const color = [
2902
+ foldInfo.measureValue
2903
+ ];
2904
+ return [
2905
+ ...prev,
2906
+ {
2907
+ x,
2908
+ y,
2909
+ color
2910
+ }
2911
+ ];
2912
+ }, []);
2913
+ return {
2914
+ ...result,
2915
+ encoding
2916
+ };
2917
+ };
2883
2918
  const heatmapAdvancedPipeline = [
2884
2919
  initAdvancedVSeed,
2885
2920
  autoMeasures,
@@ -2889,7 +2924,7 @@
2889
2924
  ], [
2890
2925
  pivotReshapeTo2D1M
2891
2926
  ]),
2892
- encodingXY,
2927
+ encodingMatrix,
2893
2928
  sortXBandAxis,
2894
2929
  heatmapConfig,
2895
2930
  theme_theme,
@@ -3064,12 +3099,11 @@
3064
3099
  records_records,
3065
3100
  theme_theme
3066
3101
  ];
3067
- const dataset_dataset = (spec, context)=>{
3102
+ const datasetYX = (spec, context)=>{
3068
3103
  const { advancedVSeed, vseed } = context;
3069
3104
  const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
3070
3105
  const { orderMapping = {} } = analysis ?? {};
3071
3106
  const angle = encoding[0]?.angle?.[0];
3072
- const x = encoding[0]?.x?.[0];
3073
3107
  const y = encoding[0]?.y?.[0];
3074
3108
  const group = encoding[0]?.group?.[0];
3075
3109
  const id = datasetReshapeInfo[0].id;
@@ -3077,25 +3111,57 @@
3077
3111
  if (angle) fields[angle] = {
3078
3112
  sortIndex: 0
3079
3113
  };
3080
- if (x) {
3081
- const order = orderMapping[x];
3082
- if (order) fields[x] = {
3114
+ if (y) {
3115
+ const order = orderMapping[y];
3116
+ if (order) fields[y] = {
3083
3117
  sortIndex: 0,
3084
3118
  domain: order,
3085
3119
  lockStatisticsByDomain: true
3086
3120
  };
3087
- else fields[x] = {
3121
+ else fields[y] = {
3088
3122
  sortIndex: 0
3089
3123
  };
3090
3124
  }
3091
- if (y) {
3092
- const order = orderMapping[y];
3093
- if (order) fields[y] = {
3125
+ if (group) {
3126
+ const order = orderMapping[group];
3127
+ if (order) fields[group] = {
3094
3128
  sortIndex: 0,
3095
3129
  domain: order,
3096
3130
  lockStatisticsByDomain: true
3097
3131
  };
3098
- else fields[y] = {
3132
+ else fields[group] = {
3133
+ sortIndex: 0
3134
+ };
3135
+ }
3136
+ return {
3137
+ ...spec,
3138
+ data: {
3139
+ id,
3140
+ values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset,
3141
+ fields: fields
3142
+ }
3143
+ };
3144
+ };
3145
+ const datasetXY = (spec, context)=>{
3146
+ const { advancedVSeed, vseed } = context;
3147
+ const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
3148
+ const { orderMapping = {} } = analysis ?? {};
3149
+ const angle = encoding[0]?.angle?.[0];
3150
+ const x = encoding[0]?.x?.[0];
3151
+ const group = encoding[0]?.group?.[0];
3152
+ const id = datasetReshapeInfo[0].id;
3153
+ const fields = {};
3154
+ if (angle) fields[angle] = {
3155
+ sortIndex: 0
3156
+ };
3157
+ if (x) {
3158
+ const order = orderMapping[x];
3159
+ if (order) fields[x] = {
3160
+ sortIndex: 0,
3161
+ domain: order,
3162
+ lockStatisticsByDomain: true
3163
+ };
3164
+ else fields[x] = {
3099
3165
  sortIndex: 0
3100
3166
  };
3101
3167
  }
@@ -3356,8 +3422,9 @@
3356
3422
  ...spec
3357
3423
  };
3358
3424
  const { advancedVSeed } = context;
3359
- const { encoding } = advancedVSeed;
3425
+ const { encoding, dataset } = advancedVSeed;
3360
3426
  if (!encoding[0].angle || !encoding[0].radius || !encoding[0].group) return result;
3427
+ const showStroke = dataset.length > 20;
3361
3428
  result.type = 'pie';
3362
3429
  result.outerRadius = 0.8;
3363
3430
  result.innerRadius = 0;
@@ -3373,7 +3440,7 @@
3373
3440
  result.pie = {
3374
3441
  style: {
3375
3442
  stroke: '#ffffff',
3376
- lineWidth: 1,
3443
+ lineWidth: showStroke ? 1 : 0,
3377
3444
  centerOffset: 0
3378
3445
  },
3379
3446
  state: {
@@ -3391,8 +3458,9 @@
3391
3458
  ...spec
3392
3459
  };
3393
3460
  const { advancedVSeed } = context;
3394
- const { encoding } = advancedVSeed;
3461
+ const { encoding, dataset } = advancedVSeed;
3395
3462
  if (!encoding[0].angle || !encoding[0].radius || !encoding[0].group) return result;
3463
+ const showStroke = dataset.length > 20;
3396
3464
  result.type = 'pie';
3397
3465
  result.outerRadius = 0.8;
3398
3466
  result.innerRadius = 0.8 * result.outerRadius;
@@ -3408,7 +3476,7 @@
3408
3476
  result.pie = {
3409
3477
  style: {
3410
3478
  stroke: '#ffffff',
3411
- lineWidth: 1
3479
+ lineWidth: showStroke ? 1 : 0
3412
3480
  },
3413
3481
  state: {
3414
3482
  hover: {
@@ -3559,7 +3627,11 @@
3559
3627
  ];
3560
3628
  result.funnel = {
3561
3629
  style: {
3562
- cornerRadius: 4
3630
+ cornerRadius: 4,
3631
+ fill: {
3632
+ field: encoding[0].color[0],
3633
+ scale: 'color'
3634
+ }
3563
3635
  },
3564
3636
  state: {
3565
3637
  hover: {
@@ -4208,6 +4280,16 @@
4208
4280
  };
4209
4281
  return result;
4210
4282
  };
4283
+ const labelColorInversion = (spec)=>{
4284
+ const result = {
4285
+ ...spec
4286
+ };
4287
+ if (result.label) result.label.smartInvert = true;
4288
+ else result.label = {
4289
+ smartInvert: true
4290
+ };
4291
+ return result;
4292
+ };
4211
4293
  const discreteLegend = (spec, context)=>{
4212
4294
  const result = {
4213
4295
  ...spec
@@ -4417,6 +4499,69 @@
4417
4499
  legends
4418
4500
  };
4419
4501
  };
4502
+ const colorLegend = (spec, context)=>{
4503
+ const result = {
4504
+ ...spec
4505
+ };
4506
+ const { advancedVSeed } = context;
4507
+ const { chartType } = advancedVSeed;
4508
+ const baseConfig = advancedVSeed.config[chartType];
4509
+ const { encoding } = advancedVSeed;
4510
+ if (!encoding[0].color) return result;
4511
+ if (!baseConfig || !baseConfig.legend) return result;
4512
+ const { legend } = baseConfig;
4513
+ const { enable, position = 'bottom' } = legend || {};
4514
+ const orient = [
4515
+ 'bottom',
4516
+ 'bottomLeft',
4517
+ 'bottomRight',
4518
+ 'bl',
4519
+ 'br'
4520
+ ].includes(position) ? 'bottom' : [
4521
+ 'top',
4522
+ 'topLeft',
4523
+ 'topRight',
4524
+ 'tl',
4525
+ 'tr'
4526
+ ].includes(position) ? 'top' : [
4527
+ 'left',
4528
+ 'leftTop',
4529
+ 'leftBottom',
4530
+ 'lt',
4531
+ 'lb'
4532
+ ].includes(position) ? 'left' : 'right';
4533
+ const legendPosition = [
4534
+ 'topLeft',
4535
+ 'bottomLeft',
4536
+ 'leftTop',
4537
+ 'rightTop',
4538
+ 'lt',
4539
+ 'rt',
4540
+ 'tl',
4541
+ 'bl'
4542
+ ].includes(position) ? 'start' : [
4543
+ 'topRight',
4544
+ 'bottomRight',
4545
+ 'leftBottom',
4546
+ 'rightBottom',
4547
+ 'lb',
4548
+ 'rb',
4549
+ 'rt',
4550
+ 'br'
4551
+ ].includes(position) ? 'end' : 'middle';
4552
+ result.legends = {
4553
+ type: 'color',
4554
+ visible: enable,
4555
+ orient,
4556
+ position: legendPosition,
4557
+ field: encoding[0].color[0],
4558
+ inverse: !![
4559
+ 'left',
4560
+ 'right'
4561
+ ].includes(orient)
4562
+ };
4563
+ return result;
4564
+ };
4420
4565
  const color_color = (spec, context)=>{
4421
4566
  const result = {
4422
4567
  ...spec
@@ -4444,6 +4589,28 @@
4444
4589
  };
4445
4590
  return result;
4446
4591
  };
4592
+ const linearColor = (spec, context)=>{
4593
+ const result = {
4594
+ ...spec
4595
+ };
4596
+ const { advancedVSeed } = context;
4597
+ const { datasetReshapeInfo, chartType, encoding } = advancedVSeed;
4598
+ const baseConfig = advancedVSeed.config[chartType];
4599
+ if (!baseConfig || !baseConfig.color) return result;
4600
+ const { color } = baseConfig;
4601
+ const { colorScheme } = color;
4602
+ result.color = {
4603
+ type: 'linear',
4604
+ domain: [
4605
+ {
4606
+ dataId: datasetReshapeInfo[0].id,
4607
+ fields: encoding?.[0]?.color
4608
+ }
4609
+ ],
4610
+ range: colorScheme
4611
+ };
4612
+ return result;
4613
+ };
4447
4614
  const pivotAdapter_pivotAdapter = (pipeline, pivotPipeline)=>(spec, context)=>{
4448
4615
  const { vseed } = context;
4449
4616
  const usePivotChart = isPivotChart(vseed);
@@ -5697,7 +5864,7 @@
5697
5864
  initLine,
5698
5865
  color_color,
5699
5866
  background_backgroundColor,
5700
- dataset_dataset,
5867
+ datasetXY,
5701
5868
  xBand,
5702
5869
  yLinear,
5703
5870
  label_label,
@@ -5721,7 +5888,7 @@
5721
5888
  initLine,
5722
5889
  color_color,
5723
5890
  background_backgroundColor,
5724
- dataset_dataset,
5891
+ datasetXY,
5725
5892
  xBand,
5726
5893
  yLinear,
5727
5894
  label_label,
@@ -5748,7 +5915,7 @@
5748
5915
  stackInverse,
5749
5916
  color_color,
5750
5917
  background_backgroundColor,
5751
- dataset_dataset,
5918
+ datasetXY,
5752
5919
  xBand,
5753
5920
  yLinear,
5754
5921
  label_label,
@@ -5772,7 +5939,7 @@
5772
5939
  stackInverse,
5773
5940
  color_color,
5774
5941
  background_backgroundColor,
5775
- dataset_dataset,
5942
+ datasetXY,
5776
5943
  xBand,
5777
5944
  yLinear,
5778
5945
  label_label,
@@ -5796,7 +5963,7 @@
5796
5963
  stackCornerRadius_stackCornerRadius,
5797
5964
  color_color,
5798
5965
  background_backgroundColor,
5799
- dataset_dataset,
5966
+ datasetXY,
5800
5967
  xBand,
5801
5968
  yLinear,
5802
5969
  label_label,
@@ -5819,7 +5986,7 @@
5819
5986
  stackCornerRadius_stackCornerRadius,
5820
5987
  color_color,
5821
5988
  background_backgroundColor,
5822
- dataset_dataset,
5989
+ datasetXY,
5823
5990
  xBand,
5824
5991
  yLinear,
5825
5992
  label_label,
@@ -5845,7 +6012,7 @@
5845
6012
  color_color,
5846
6013
  background_backgroundColor,
5847
6014
  percent,
5848
- dataset_dataset,
6015
+ datasetXY,
5849
6016
  xBand,
5850
6017
  yLinear,
5851
6018
  label_label,
@@ -5870,7 +6037,7 @@
5870
6037
  color_color,
5871
6038
  percent,
5872
6039
  background_backgroundColor,
5873
- dataset_dataset,
6040
+ datasetXY,
5874
6041
  xBand,
5875
6042
  yLinear,
5876
6043
  label_label,
@@ -5894,7 +6061,7 @@
5894
6061
  stackCornerRadius_stackCornerRadius,
5895
6062
  color_color,
5896
6063
  background_backgroundColor,
5897
- dataset_dataset,
6064
+ datasetYX,
5898
6065
  xLinear,
5899
6066
  yBand,
5900
6067
  label_label,
@@ -5917,7 +6084,7 @@
5917
6084
  stackCornerRadius_stackCornerRadius,
5918
6085
  color_color,
5919
6086
  background_backgroundColor,
5920
- dataset_dataset,
6087
+ datasetYX,
5921
6088
  xLinear,
5922
6089
  yBand,
5923
6090
  label_label,
@@ -5942,7 +6109,7 @@
5942
6109
  stackCornerRadius_stackCornerRadius,
5943
6110
  color_color,
5944
6111
  background_backgroundColor,
5945
- dataset_dataset,
6112
+ datasetYX,
5946
6113
  xLinear,
5947
6114
  yBand,
5948
6115
  label_label,
@@ -5965,7 +6132,7 @@
5965
6132
  stackCornerRadius_stackCornerRadius,
5966
6133
  color_color,
5967
6134
  background_backgroundColor,
5968
- dataset_dataset,
6135
+ datasetYX,
5969
6136
  xLinear,
5970
6137
  yBand,
5971
6138
  label_label,
@@ -5990,7 +6157,7 @@
5990
6157
  color_color,
5991
6158
  background_backgroundColor,
5992
6159
  percent,
5993
- dataset_dataset,
6160
+ datasetYX,
5994
6161
  xLinear,
5995
6162
  yBand,
5996
6163
  label_label,
@@ -6014,7 +6181,7 @@
6014
6181
  color_color,
6015
6182
  background_backgroundColor,
6016
6183
  percent,
6017
- dataset_dataset,
6184
+ datasetYX,
6018
6185
  yBand,
6019
6186
  xLinear,
6020
6187
  label_label,
@@ -6038,7 +6205,7 @@
6038
6205
  stackInverse,
6039
6206
  color_color,
6040
6207
  background_backgroundColor,
6041
- dataset_dataset,
6208
+ datasetXY,
6042
6209
  xBand,
6043
6210
  yLinear,
6044
6211
  label_label,
@@ -6064,7 +6231,7 @@
6064
6231
  color_color,
6065
6232
  background_backgroundColor,
6066
6233
  stackInverse,
6067
- dataset_dataset,
6234
+ datasetXY,
6068
6235
  xBand,
6069
6236
  yLinear,
6070
6237
  label_label,
@@ -6092,7 +6259,7 @@
6092
6259
  color_color,
6093
6260
  background_backgroundColor,
6094
6261
  percent,
6095
- dataset_dataset,
6262
+ datasetXY,
6096
6263
  xBand,
6097
6264
  yLinear,
6098
6265
  label_label,
@@ -6118,7 +6285,7 @@
6118
6285
  color_color,
6119
6286
  background_backgroundColor,
6120
6287
  percent,
6121
- dataset_dataset,
6288
+ datasetXY,
6122
6289
  xBand,
6123
6290
  yLinear,
6124
6291
  label_label,
@@ -6154,7 +6321,7 @@
6154
6321
  pointStyle_pointStyle,
6155
6322
  pointStateDimensionHover
6156
6323
  ]),
6157
- dataset_dataset,
6324
+ datasetXY,
6158
6325
  background_backgroundColor,
6159
6326
  xBand,
6160
6327
  yLinear,
@@ -6186,7 +6353,7 @@
6186
6353
  pointStateDimensionHover
6187
6354
  ]),
6188
6355
  background_backgroundColor,
6189
- dataset_dataset,
6356
+ datasetXY,
6190
6357
  xBand,
6191
6358
  yLinear,
6192
6359
  label_label,
@@ -6206,7 +6373,7 @@
6206
6373
  initScatter,
6207
6374
  color_color,
6208
6375
  background_backgroundColor,
6209
- dataset_dataset,
6376
+ datasetXY,
6210
6377
  xLinear,
6211
6378
  yLinear,
6212
6379
  label_label,
@@ -6230,7 +6397,7 @@
6230
6397
  initScatter,
6231
6398
  color_color,
6232
6399
  background_backgroundColor,
6233
- dataset_dataset,
6400
+ datasetXY,
6234
6401
  xLinear,
6235
6402
  yLinear,
6236
6403
  label_label,
@@ -6255,7 +6422,7 @@
6255
6422
  initPie,
6256
6423
  color_color,
6257
6424
  background_backgroundColor,
6258
- dataset_dataset,
6425
+ datasetXY,
6259
6426
  label_label,
6260
6427
  tooltip_tooltip,
6261
6428
  discreteLegend,
@@ -6273,7 +6440,7 @@
6273
6440
  initPie,
6274
6441
  color_color,
6275
6442
  background_backgroundColor,
6276
- dataset_dataset,
6443
+ datasetXY,
6277
6444
  label_label,
6278
6445
  tooltip_tooltip,
6279
6446
  annotationPoint_annotationPoint,
@@ -6292,7 +6459,7 @@
6292
6459
  initDonut,
6293
6460
  color_color,
6294
6461
  background_backgroundColor,
6295
- dataset_dataset,
6462
+ datasetXY,
6296
6463
  label_label,
6297
6464
  tooltip_tooltip,
6298
6465
  discreteLegend,
@@ -6310,7 +6477,7 @@
6310
6477
  initDonut,
6311
6478
  color_color,
6312
6479
  background_backgroundColor,
6313
- dataset_dataset,
6480
+ datasetXY,
6314
6481
  label_label,
6315
6482
  tooltip_tooltip,
6316
6483
  annotationPoint_annotationPoint,
@@ -6331,7 +6498,7 @@
6331
6498
  stackInverse,
6332
6499
  color_color,
6333
6500
  background_backgroundColor,
6334
- dataset_dataset,
6501
+ datasetXY,
6335
6502
  radiusAxis,
6336
6503
  angleAxis,
6337
6504
  label_label,
@@ -6350,7 +6517,7 @@
6350
6517
  stackInverse,
6351
6518
  color_color,
6352
6519
  background_backgroundColor,
6353
- dataset_dataset,
6520
+ datasetXY,
6354
6521
  radiusAxis,
6355
6522
  angleAxis,
6356
6523
  label_label,
@@ -6369,7 +6536,7 @@
6369
6536
  stackCornerRadius_stackCornerRadius,
6370
6537
  color_color,
6371
6538
  background_backgroundColor,
6372
- dataset_dataset,
6539
+ datasetXY,
6373
6540
  radiusAxis,
6374
6541
  angleAxis,
6375
6542
  label_label,
@@ -6391,7 +6558,7 @@
6391
6558
  stackCornerRadius_stackCornerRadius,
6392
6559
  color_color,
6393
6560
  background_backgroundColor,
6394
- dataset_dataset,
6561
+ datasetXY,
6395
6562
  radiusAxis,
6396
6563
  angleAxis,
6397
6564
  label_label,
@@ -6413,7 +6580,7 @@
6413
6580
  initRadar,
6414
6581
  color_color,
6415
6582
  background_backgroundColor,
6416
- dataset_dataset,
6583
+ datasetXY,
6417
6584
  radarAngleAxis,
6418
6585
  radarRadiusAxis,
6419
6586
  label_label,
@@ -6434,7 +6601,7 @@
6434
6601
  initRadar,
6435
6602
  color_color,
6436
6603
  background_backgroundColor,
6437
- dataset_dataset,
6604
+ datasetXY,
6438
6605
  radarAngleAxis,
6439
6606
  radarRadiusAxis,
6440
6607
  label_label,
@@ -6454,12 +6621,12 @@
6454
6621
  ];
6455
6622
  const funnel = [
6456
6623
  initFunnel,
6457
- color_color,
6624
+ linearColor,
6458
6625
  background_backgroundColor,
6459
- dataset_dataset,
6626
+ datasetXY,
6460
6627
  label_label,
6461
6628
  tooltip_tooltip,
6462
- discreteLegend,
6629
+ colorLegend,
6463
6630
  annotationPoint_annotationPoint,
6464
6631
  annotationVerticalLine_annotationVerticalLine,
6465
6632
  annotationHorizontalLine_annotationHorizontalLine,
@@ -6472,34 +6639,76 @@
6472
6639
  datasetPivot,
6473
6640
  pivotIndicators([
6474
6641
  initFunnel,
6475
- color_color,
6642
+ linearColor,
6476
6643
  background_backgroundColor,
6477
- dataset_dataset,
6644
+ datasetXY,
6478
6645
  label_label,
6479
6646
  tooltip_tooltip,
6647
+ colorLegend,
6480
6648
  annotationPoint_annotationPoint,
6481
6649
  annotationVerticalLine_annotationVerticalLine,
6482
6650
  annotationHorizontalLine_annotationHorizontalLine,
6483
6651
  annotationArea_annotationArea
6484
6652
  ]),
6485
6653
  pivotRowDimensions,
6486
- pivotColumnDimensions,
6487
- pivotDiscreteLegend
6654
+ pivotColumnDimensions
6488
6655
  ];
6489
6656
  const funnelSpecPipeline = [
6490
6657
  pivotAdapter_pivotAdapter(funnel, pivotFunnel)
6491
6658
  ];
6659
+ const initHeatmap = (spec, context)=>{
6660
+ const result = {
6661
+ ...spec
6662
+ };
6663
+ const { advancedVSeed } = context;
6664
+ const { encoding } = advancedVSeed;
6665
+ if (!encoding[0].y || !encoding[0].x || !encoding[0].color) return result;
6666
+ result.type = 'heatmap';
6667
+ result.direction = 'vertical';
6668
+ result.xField = encoding[0].x[0];
6669
+ result.yField = encoding[0].y[0];
6670
+ result.valueField = encoding[0].color[0];
6671
+ result.padding = 0;
6672
+ result.cell = {
6673
+ style: {
6674
+ shape: 'rect',
6675
+ stroke: '#ffffff',
6676
+ lineWidth: 1,
6677
+ fill: {
6678
+ field: encoding[0].color[0],
6679
+ scale: 'color'
6680
+ }
6681
+ }
6682
+ };
6683
+ result.axes = [
6684
+ {
6685
+ type: 'band',
6686
+ orient: 'left',
6687
+ bandPadding: 0
6688
+ },
6689
+ {
6690
+ type: 'band',
6691
+ orient: 'bottom',
6692
+ bandPadding: 0
6693
+ }
6694
+ ];
6695
+ result.region = [
6696
+ {
6697
+ clip: true
6698
+ }
6699
+ ];
6700
+ result.animation = true;
6701
+ return result;
6702
+ };
6492
6703
  const heatmap = [
6493
- initLine,
6494
- color_color,
6704
+ initHeatmap,
6705
+ linearColor,
6495
6706
  background_backgroundColor,
6496
- dataset_dataset,
6497
- xBand,
6498
- yLinear,
6707
+ datasetXY,
6499
6708
  label_label,
6709
+ labelColorInversion,
6710
+ colorLegend,
6500
6711
  tooltip_tooltip,
6501
- verticalCrosshairLine,
6502
- discreteLegend,
6503
6712
  pointStyle_pointStyle,
6504
6713
  pointStateDimensionHover,
6505
6714
  lineStyle_lineStyle,
@@ -6514,15 +6723,14 @@
6514
6723
  pivotIndicators_pivotIndicatorsAsRow,
6515
6724
  datasetPivot,
6516
6725
  pivotIndicators([
6517
- initLine,
6518
- color_color,
6726
+ initHeatmap,
6727
+ linearColor,
6519
6728
  background_backgroundColor,
6520
- dataset_dataset,
6521
- xBand,
6522
- yLinear,
6729
+ datasetXY,
6523
6730
  label_label,
6731
+ labelColorInversion,
6732
+ colorLegend,
6524
6733
  tooltip_tooltip,
6525
- verticalCrosshairLine,
6526
6734
  pointStyle_pointStyle,
6527
6735
  pointStateDimensionHover,
6528
6736
  lineStyle_lineStyle,
@@ -6532,8 +6740,7 @@
6532
6740
  annotationArea_annotationArea
6533
6741
  ]),
6534
6742
  pivotRowDimensions,
6535
- pivotColumnDimensions,
6536
- pivotDiscreteLegend
6743
+ pivotColumnDimensions
6537
6744
  ];
6538
6745
  const heatmapSpecPipeline = [
6539
6746
  pivotAdapter_pivotAdapter(heatmap, pivotHeatmap)
@@ -7773,7 +7980,24 @@
7773
7980
  '#ACB9FF',
7774
7981
  '#B7C4FF',
7775
7982
  '#C2CEFF'
7776
- ]
7983
+ ].reverse()
7984
+ }
7985
+ },
7986
+ heatmap: {
7987
+ ...baseConfig,
7988
+ color: {
7989
+ colorScheme: [
7990
+ '#5766EC',
7991
+ '#6372F0',
7992
+ '#7080F4',
7993
+ '#7C8CFA',
7994
+ '#8998FF',
7995
+ '#95A3FF',
7996
+ '#A0AEFF',
7997
+ '#ACB9FF',
7998
+ '#B7C4FF',
7999
+ '#C2CEFF'
8000
+ ].reverse()
7777
8001
  }
7778
8002
  }
7779
8003
  }
@@ -8077,6 +8301,9 @@
8077
8301
  '#A0CEFF'
8078
8302
  ]
8079
8303
  }
8304
+ },
8305
+ heatmap: {
8306
+ ...baseConfig
8080
8307
  }
8081
8308
  }
8082
8309
  };
@@ -13154,6 +13381,9 @@
13154
13381
  colorScheme: schemas_array(schemas_string()).optional(),
13155
13382
  colorMapping: record(schemas_string(), schemas_string()).optional()
13156
13383
  });
13384
+ const zLinearColor = schemas_object({
13385
+ colorScheme: schemas_array(schemas_string()).optional()
13386
+ });
13157
13387
  const zLabel = schemas_object({
13158
13388
  enable: schemas_boolean().default(true).optional()
13159
13389
  });
@@ -13211,6 +13441,31 @@
13211
13441
  labelFontColor: schemas_string().default('#fff').optional(),
13212
13442
  labelFontWeight: schemas_number().or(schemas_string()).default(400).optional()
13213
13443
  });
13444
+ const zColorLegend = schemas_object({
13445
+ position: schemas_enum([
13446
+ 'left',
13447
+ 'leftTop',
13448
+ 'leftBottom',
13449
+ 'lt',
13450
+ 'lb',
13451
+ 'top',
13452
+ 'topLeft',
13453
+ 'topRight',
13454
+ 'tl',
13455
+ 'tr',
13456
+ 'right',
13457
+ 'rightTop',
13458
+ 'rightBottom',
13459
+ 'rt',
13460
+ 'rb',
13461
+ 'bottom',
13462
+ 'bottomLeft',
13463
+ 'bottomRight',
13464
+ 'bl',
13465
+ 'br'
13466
+ ]).default('bottom').optional(),
13467
+ enable: schemas_boolean().default(true).optional()
13468
+ });
13214
13469
  const zTooltip = schemas_object({
13215
13470
  enable: schemas_boolean().default(true).optional()
13216
13471
  });
@@ -13486,7 +13741,7 @@
13486
13741
  zSelector,
13487
13742
  zSelectors
13488
13743
  ]).optional(),
13489
- lineSmooth: schemas_boolean().default(true).optional(),
13744
+ lineSmooth: schemas_boolean().optional(),
13490
13745
  lineColor: schemas_string().optional(),
13491
13746
  lineColorOpacity: schemas_number().optional(),
13492
13747
  lineWidth: schemas_number().optional(),
@@ -19752,9 +20007,9 @@
19752
20007
  dimensions: zDimensions.optional(),
19753
20008
  measures: zMeasureTree.optional(),
19754
20009
  backgroundColor: zBackgroundColor.optional(),
19755
- color: zColor.optional(),
20010
+ color: zLinearColor.optional(),
19756
20011
  label: zLabel.optional(),
19757
- legend: zLegend.optional(),
20012
+ legend: zColorLegend.optional(),
19758
20013
  tooltip: zTooltip.optional(),
19759
20014
  theme: zTheme.optional(),
19760
20015
  locale: zLocale.optional()
@@ -19765,9 +20020,9 @@
19765
20020
  dimensions: zDimensions.optional(),
19766
20021
  measures: zMeasureTree.optional(),
19767
20022
  backgroundColor: zBackgroundColor.optional(),
19768
- color: zColor.optional(),
20023
+ color: zLinearColor.optional(),
19769
20024
  label: zLabel.optional(),
19770
- legend: zLegend.optional(),
20025
+ legend: zColorLegend.optional(),
19771
20026
  tooltip: zTooltip.optional(),
19772
20027
  theme: zTheme.optional(),
19773
20028
  locale: zLocale.optional()