@visactor/vseed 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/builder/builder/builder.d.ts +12 -0
  4. package/dist/esm/pipeline/spec/chart/pipeline/donut.js +2 -1
  5. package/dist/esm/pipeline/spec/chart/pipeline/donut.js.map +1 -1
  6. package/dist/esm/pipeline/spec/chart/pipeline/funnel.js +2 -1
  7. package/dist/esm/pipeline/spec/chart/pipeline/funnel.js.map +1 -1
  8. package/dist/esm/pipeline/spec/chart/pipeline/pie.js +2 -1
  9. package/dist/esm/pipeline/spec/chart/pipeline/pie.js.map +1 -1
  10. package/dist/esm/pipeline/spec/chart/pipeline/radar.js +2 -1
  11. package/dist/esm/pipeline/spec/chart/pipeline/radar.js.map +1 -1
  12. package/dist/esm/pipeline/spec/chart/pipeline/rose.js +2 -1
  13. package/dist/esm/pipeline/spec/chart/pipeline/rose.js.map +1 -1
  14. package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js +2 -1
  15. package/dist/esm/pipeline/spec/chart/pipeline/roseParallel.js.map +1 -1
  16. package/dist/esm/pipeline/spec/chart/pipes/markStyle/areaStyle.js +9 -1
  17. package/dist/esm/pipeline/spec/chart/pipes/markStyle/areaStyle.js.map +1 -1
  18. package/dist/esm/pipeline/spec/chart/pipes/markStyle/curve/curve.d.ts +3 -0
  19. package/dist/esm/pipeline/spec/chart/pipes/markStyle/curve/curve.js +12 -0
  20. package/dist/esm/pipeline/spec/chart/pipes/markStyle/curve/curve.js.map +1 -0
  21. package/dist/esm/pipeline/spec/chart/pipes/markStyle/curve/index.d.ts +1 -0
  22. package/dist/esm/pipeline/spec/chart/pipes/markStyle/curve/index.js +2 -0
  23. package/dist/esm/pipeline/spec/chart/pipes/markStyle/lineStyle.js +4 -1
  24. package/dist/esm/pipeline/spec/chart/pipes/markStyle/lineStyle.js.map +1 -1
  25. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/index.d.ts +1 -0
  26. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/index.js +2 -1
  27. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js +7 -4
  28. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotGridStyle.js.map +1 -1
  29. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotHideIndicatorName.d.ts +2 -0
  30. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotHideIndicatorName.js +7 -0
  31. package/dist/esm/pipeline/spec/chart/pipes/pivotChart/pivotHideIndicatorName.js.map +1 -0
  32. package/dist/esm/pipeline/spec/chart/pipes/size/scatterSize.js +2 -1
  33. package/dist/esm/pipeline/spec/chart/pipes/size/scatterSize.js.map +1 -1
  34. package/dist/esm/pipeline/utils/chatType.d.ts +16 -0
  35. package/dist/esm/pipeline/utils/chatType.js +12 -7
  36. package/dist/esm/pipeline/utils/chatType.js.map +1 -1
  37. package/dist/esm/theme/dark.js +5 -1
  38. package/dist/esm/theme/dark.js.map +1 -1
  39. package/dist/esm/theme/light.js +5 -1
  40. package/dist/esm/theme/light.js.map +1 -1
  41. package/dist/esm/types/advancedVSeed.d.ts +4 -0
  42. package/dist/esm/types/chartType/funnel/funnel.d.ts +2 -2
  43. package/dist/esm/types/chartType/heatmap/heatmap.d.ts +2 -2
  44. package/dist/esm/types/properties/config/color/color.d.ts +0 -8
  45. package/dist/esm/types/properties/config/color/color.js.map +1 -1
  46. package/dist/esm/types/properties/config/config.d.ts +4 -0
  47. package/dist/esm/types/properties/config/config.js +3 -1
  48. package/dist/esm/types/properties/config/config.js.map +1 -1
  49. package/dist/esm/types/properties/theme/customTheme.d.ts +4 -0
  50. package/dist/umd/index.js +71 -23
  51. package/dist/umd/index.js.map +1 -1
  52. package/package.json +1 -1
package/dist/umd/index.js CHANGED
@@ -67,8 +67,8 @@
67
67
  var __webpack_exports__ = {};
68
68
  __webpack_require__.r(__webpack_exports__);
69
69
  __webpack_require__.d(__webpack_exports__, {
70
+ zScatter: ()=>zScatter,
70
71
  zScatterConfig: ()=>zScatterConfig,
71
- zTooltip: ()=>zTooltip,
72
72
  funnelAdvancedPipeline: ()=>funnelAdvancedPipeline,
73
73
  zHeatmapConfig: ()=>zHeatmapConfig,
74
74
  zBar: ()=>zBar,
@@ -92,11 +92,13 @@
92
92
  columnPercentAdvancedPipeline: ()=>columnPercentAdvancedPipeline,
93
93
  zColumnConfig: ()=>zColumnConfig,
94
94
  zAnnotation: ()=>zAnnotation,
95
+ isRadar: ()=>isRadar,
95
96
  selector: ()=>selector_selector,
96
97
  zDualMeasure: ()=>zDualMeasure,
97
- zSortLegend: ()=>zSortLegend,
98
98
  pivotTableAdvancedPipeline: ()=>pivotTableAdvancedPipeline,
99
+ zSortLegend: ()=>zSortLegend,
99
100
  isMeasures: ()=>isMeasures,
101
+ zTooltip: ()=>zTooltip,
100
102
  zYBandAxis: ()=>zYBandAxis,
101
103
  zAnnotationHorizontalLine: ()=>zAnnotationHorizontalLine,
102
104
  zYLinearAxis: ()=>zYLinearAxis,
@@ -210,8 +212,8 @@
210
212
  zAnnotationArea: ()=>zAnnotationArea,
211
213
  zStackCornerRadius: ()=>zStackCornerRadius,
212
214
  DetailEncoding: ()=>DetailEncoding,
215
+ isPivot: ()=>isPivot,
213
216
  zRose: ()=>zRose,
214
- zUnfoldInfo: ()=>zUnfoldInfo,
215
217
  columnParallelSpecPipeline: ()=>columnParallelSpecPipeline,
216
218
  zPointStyle: ()=>zPointStyle,
217
219
  zAnnotationPoint: ()=>zAnnotationPoint,
@@ -223,6 +225,7 @@
223
225
  isMeasure: ()=>isMeasure,
224
226
  FoldSecondaryMeasureValue: ()=>FoldSecondaryMeasureValue,
225
227
  zSort: ()=>zSort,
228
+ zUnfoldInfo: ()=>zUnfoldInfo,
226
229
  isPivotChart: ()=>isPivotChart,
227
230
  zDualAxisConfig: ()=>zDualAxisConfig,
228
231
  zColumn: ()=>zColumn,
@@ -254,13 +257,13 @@
254
257
  autoNumFormatter: ()=>autoNumFormatter,
255
258
  measureDepth: ()=>measureDepth,
256
259
  tableSpecPipeline: ()=>tableSpecPipeline,
260
+ isCombination: ()=>isCombination,
257
261
  zAdvancedVSeed: ()=>zAdvancedVSeed,
258
- zConfig: ()=>zConfig,
259
262
  zBarStyle: ()=>zBarStyle,
260
263
  deleteDimensionTreeByCallback: ()=>deleteDimensionTreeByCallback,
261
- zMeasure: ()=>zMeasure,
264
+ zConfig: ()=>zConfig,
262
265
  zAreaPercent: ()=>zAreaPercent,
263
- zRoseParallelConfig: ()=>zRoseParallelConfig,
266
+ zMeasure: ()=>zMeasure,
264
267
  columnParallelAdvancedPipeline: ()=>columnParallelAdvancedPipeline,
265
268
  isValueSelector: ()=>isValueSelector,
266
269
  donutAdvancedPipeline: ()=>donutAdvancedPipeline,
@@ -270,7 +273,7 @@
270
273
  isPivotTable: ()=>isPivotTable,
271
274
  zDimensionEncoding: ()=>zDimensionEncoding,
272
275
  zFunnel: ()=>zFunnel,
273
- zScatter: ()=>zScatter,
276
+ zRoseParallelConfig: ()=>zRoseParallelConfig,
274
277
  zBarParallelConfig: ()=>zBarParallelConfig,
275
278
  barParallelAdvancedPipeline: ()=>barParallelAdvancedPipeline,
276
279
  FoldMeasureValue: ()=>FoldMeasureValue,
@@ -522,6 +525,7 @@
522
525
  const DEFAULT_PARENT_ID = '__DefaultParentId__';
523
526
  const isTable = (vseed)=>'table' === vseed.chartType;
524
527
  const isPivotTable = (vseed)=>'pivotTable' === vseed.chartType;
528
+ const isRadar = (vseed)=>'radar' === vseed.chartType;
525
529
  const isVTable = (vseed)=>[
526
530
  'table',
527
531
  'pivotTable'
@@ -529,14 +533,19 @@
529
533
  const isVChart = (vseed)=>!isVTable(vseed);
530
534
  const isPivotChart = (vseed)=>{
531
535
  if (isVTable(vseed)) return false;
536
+ if (isPivot(vseed)) return true;
537
+ return isCombination(vseed);
538
+ };
539
+ const isPivot = (vseed)=>{
540
+ const { dimensions = [] } = vseed;
541
+ return dimensions && dimensions.some((dimension)=>'row' === dimension.encoding || 'column' === dimension.encoding);
542
+ };
543
+ const isCombination = (vseed)=>{
532
544
  if (isMeasureTreeWithParentId(vseed.measures)) {
533
545
  const parentIds = vseed.measures?.map((measure)=>measure.parentId || DEFAULT_PARENT_ID);
534
546
  return parentIds && chunk_QJLMYOTX_i(parentIds).length > 1;
535
547
  }
536
548
  if ('dualAxis' === vseed.chartType || 'scatter' === vseed.chartType) {
537
- const { dimensions = [] } = vseed;
538
- const hasRowOrColumnDimension = dimensions && dimensions.some((dimension)=>'row' === dimension.encoding || 'column' === dimension.encoding);
539
- if (hasRowOrColumnDimension) return true;
540
549
  if ('scatter' === vseed.chartType) {
541
550
  if (isMeasureTreeWithChildren(vseed.measures)) {
542
551
  const depth = measureDepth(vseed.measures);
@@ -554,10 +563,9 @@
554
563
  }
555
564
  return false;
556
565
  }
557
- const { measures = [], dimensions = [] } = vseed;
558
- const hasRowOrColumnDimension = dimensions && dimensions.some((dimension)=>'row' === dimension.encoding || 'column' === dimension.encoding);
566
+ const { measures = [] } = vseed;
559
567
  const hasMeasureGroup = measures && measures.some((measure)=>measure && measure.children);
560
- return hasRowOrColumnDimension || hasMeasureGroup;
568
+ return hasMeasureGroup;
561
569
  };
562
570
  const getColorItems = (builder)=>{
563
571
  const advancedVSeed = builder.advancedVSeed;
@@ -3249,6 +3257,14 @@
3249
3257
  }
3250
3258
  return Object.setPrototypeOf(r, Object.prototype), r;
3251
3259
  };
3260
+ const getCurveType = (vseed, lineSmooth = false)=>{
3261
+ if (!lineSmooth) return 'linear';
3262
+ return isRadar(vseed) ? 'catmullRomClosed' : 'monotone';
3263
+ };
3264
+ const getCurveTension = (vseed, lineSmooth = false)=>{
3265
+ if (!lineSmooth) return 0;
3266
+ return isRadar(vseed) ? 0.4 : 0;
3267
+ };
3252
3268
  const lineStyle_lineStyle = (spec, context)=>{
3253
3269
  const { advancedVSeed } = context;
3254
3270
  const { markStyle, datasetReshapeInfo, dataset } = advancedVSeed;
@@ -3280,7 +3296,8 @@
3280
3296
  0,
3281
3297
  0
3282
3298
  ];
3283
- const curveType = lineSmooth ? 'monotone' : 'linear';
3299
+ const curveType = getCurveType(context.vseed, lineSmooth);
3300
+ const curveTension = getCurveTension(context.vseed, lineSmooth);
3284
3301
  return {
3285
3302
  ...result,
3286
3303
  [`custom${index + 1}`]: {
@@ -3293,6 +3310,7 @@
3293
3310
  style: {
3294
3311
  visible: lineVisible,
3295
3312
  curveType: curveType,
3313
+ curveTension: curveTension,
3296
3314
  strokeOpacity: lineColorOpacity,
3297
3315
  stroke: lineColor,
3298
3316
  lineWidth: lineWidth,
@@ -3931,7 +3949,9 @@
3931
3949
  }
3932
3950
  };
3933
3951
  };
3934
- const pivotGridStyle = (spec)=>{
3952
+ const pivotGridStyle = (spec, context)=>{
3953
+ const { vseed } = context;
3954
+ const onlyCombination = !isPivot(vseed) && isCombination(vseed);
3935
3955
  const result = {
3936
3956
  ...spec
3937
3957
  };
@@ -3940,8 +3960,8 @@
3940
3960
  const bodyFontColor = '#141414';
3941
3961
  const headerFontColor = '#21252c';
3942
3962
  const headerBackgroundColor = 'rgba(0,0,0,0)';
3943
- const hoverHeaderBackgroundColor = '#D9DDE4';
3944
- const hoverHeaderInlineBackgroundColor = '#D9DDE455';
3963
+ const hoverHeaderBackgroundColor = onlyCombination ? transparent : '#D9DDE4';
3964
+ const hoverHeaderInlineBackgroundColor = onlyCombination ? transparent : '#D9DDE455';
3945
3965
  return {
3946
3966
  ...result,
3947
3967
  theme: {
@@ -3952,7 +3972,7 @@
3952
3972
  borderLineWidth: [
3953
3973
  1,
3954
3974
  1,
3955
- 0,
3975
+ 1,
3956
3976
  1
3957
3977
  ],
3958
3978
  bgColor: transparent,
@@ -5867,7 +5887,7 @@
5867
5887
  const areaStyle_areaStyle = (spec, context)=>{
5868
5888
  const { advancedVSeed } = context;
5869
5889
  const { markStyle, datasetReshapeInfo, dataset } = advancedVSeed;
5870
- const { areaStyle } = markStyle;
5890
+ const { areaStyle, lineStyle } = markStyle;
5871
5891
  const { unfoldInfo } = datasetReshapeInfo[0];
5872
5892
  const result = {
5873
5893
  ...spec,
@@ -5880,10 +5900,15 @@
5880
5900
  const areaStyles = Array.isArray(areaStyle) ? areaStyle : [
5881
5901
  areaStyle
5882
5902
  ];
5903
+ const lineStyles = Array.isArray(lineStyle) ? lineStyle : [
5904
+ lineStyle
5905
+ ];
5883
5906
  const group = unfoldInfo.encodingColorId;
5884
5907
  const areaGroups = chunk_HVPVHFDT_i(dataset, (d)=>d[group ?? '']);
5885
5908
  const customMap = areaStyles.reduce((result, style, index)=>{
5886
5909
  const { areaColor, areaColorOpacity, areaVisible = true } = style;
5910
+ const curveType = getCurveType(context.vseed, lineStyles[index]?.lineSmooth);
5911
+ const curveTension = getCurveTension(context.vseed, lineStyles[index]?.lineSmooth);
5887
5912
  return {
5888
5913
  ...result,
5889
5914
  [`custom${index + 1}`]: {
@@ -5894,6 +5919,8 @@
5894
5919
  return false;
5895
5920
  },
5896
5921
  style: {
5922
+ curveType,
5923
+ curveTension,
5897
5924
  visible: areaVisible,
5898
5925
  fill: areaColor,
5899
5926
  fillOpacity: areaColorOpacity
@@ -6450,7 +6477,8 @@
6450
6477
  const { advancedVSeed } = context;
6451
6478
  const { chartType, encoding } = advancedVSeed;
6452
6479
  const baseConfig = advancedVSeed.config[chartType];
6453
- if (!baseConfig || !baseConfig.sizeRange && !baseConfig.size) return result;
6480
+ const hasSizeEncoding = encoding?.size?.[0];
6481
+ if (!hasSizeEncoding) return result;
6454
6482
  const size = baseConfig.size ?? baseConfig.sizeRange;
6455
6483
  result.size = {
6456
6484
  type: 'linear',
@@ -7864,6 +7892,10 @@
7864
7892
  };
7865
7893
  return result;
7866
7894
  };
7895
+ const pivotHideIndicatorName = (spec)=>({
7896
+ ...spec,
7897
+ hideIndicatorName: true
7898
+ });
7867
7899
  const pie = [
7868
7900
  initPie,
7869
7901
  colorAdapter(color_color, linearColor),
@@ -7883,6 +7915,7 @@
7883
7915
  initPivot,
7884
7916
  pivotGridStyle,
7885
7917
  pivotIndicators_pivotIndicatorsAsRow,
7918
+ pivotHideIndicatorName,
7886
7919
  datasetPivot,
7887
7920
  pivotIndicators_pivotIndicators([
7888
7921
  initPie,
@@ -7975,6 +8008,7 @@
7975
8008
  initPivot,
7976
8009
  pivotGridStyle,
7977
8010
  pivotIndicators_pivotIndicatorsAsRow,
8011
+ pivotHideIndicatorName,
7978
8012
  datasetPivot,
7979
8013
  pivotIndicators_pivotIndicators([
7980
8014
  initDonut,
@@ -8196,6 +8230,7 @@
8196
8230
  initPivot,
8197
8231
  pivotGridStyle,
8198
8232
  pivotIndicators_pivotIndicatorsAsRow,
8233
+ pivotHideIndicatorName,
8199
8234
  datasetPivot,
8200
8235
  pivotIndicators_pivotIndicators([
8201
8236
  initRose,
@@ -8313,6 +8348,7 @@
8313
8348
  initPivot,
8314
8349
  pivotGridStyle,
8315
8350
  pivotIndicators_pivotIndicatorsAsRow,
8351
+ pivotHideIndicatorName,
8316
8352
  datasetPivot,
8317
8353
  pivotIndicators_pivotIndicators([
8318
8354
  initRoseParallel,
@@ -8534,6 +8570,7 @@
8534
8570
  initPivot,
8535
8571
  pivotGridStyle,
8536
8572
  pivotIndicators_pivotIndicatorsAsRow,
8573
+ pivotHideIndicatorName,
8537
8574
  datasetPivot,
8538
8575
  pivotIndicators_pivotIndicators([
8539
8576
  initRadar,
@@ -8733,6 +8770,7 @@
8733
8770
  initPivot,
8734
8771
  pivotGridStyle,
8735
8772
  pivotIndicators_pivotIndicatorsAsRow,
8773
+ pivotHideIndicatorName,
8736
8774
  datasetPivot,
8737
8775
  pivotIndicators_pivotIndicators([
8738
8776
  initFunnel,
@@ -9348,7 +9386,11 @@
9348
9386
  visible: true
9349
9387
  }
9350
9388
  },
9351
- crosshairLine
9389
+ crosshairLine,
9390
+ sizeRange: [
9391
+ 8,
9392
+ 24
9393
+ ]
9352
9394
  },
9353
9395
  dualAxis: {
9354
9396
  ...baseConfig,
@@ -9683,7 +9725,11 @@
9683
9725
  visible: true
9684
9726
  }
9685
9727
  },
9686
- crosshairLine
9728
+ crosshairLine,
9729
+ sizeRange: [
9730
+ 8,
9731
+ 24
9732
+ ]
9687
9733
  },
9688
9734
  dualAxis: {
9689
9735
  ...baseConfig,
@@ -13635,7 +13681,9 @@
13635
13681
  legend: zLegend.nullish(),
13636
13682
  xAxis: zXLinearAxis.nullish(),
13637
13683
  yAxis: zYLinearAxis.nullish(),
13638
- crosshairLine: zCrosshairLine.nullish()
13684
+ crosshairLine: zCrosshairLine.nullish(),
13685
+ size: schemas_number().or(schemas_array(schemas_number())).nullish(),
13686
+ sizeRange: schemas_number().or(schemas_array(schemas_number())).nullish()
13639
13687
  });
13640
13688
  const zRoseConfig = schemas_object({
13641
13689
  backgroundColor: zBackgroundColor.nullish(),