@visactor/vseed 0.0.22 → 0.0.23

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 (37) hide show
  1. package/dist/builder/builder/builder.d.ts +939 -65
  2. package/dist/builder/register/chartType.d.ts +1 -0
  3. package/dist/builder/register/custom.d.ts +3 -0
  4. package/dist/builder/register/index.d.ts +1 -0
  5. package/dist/dataReshape/dataReshapeFor1D.d.ts +19 -0
  6. package/dist/dataReshape/index.d.ts +1 -0
  7. package/dist/index.cjs +500 -14
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.js +470 -8
  10. package/dist/index.js.map +1 -1
  11. package/dist/pipeline/advanced/chart/pipeline/areaRange.d.ts +2 -0
  12. package/dist/pipeline/advanced/chart/pipeline/index.d.ts +1 -0
  13. package/dist/pipeline/advanced/chart/pipes/encoding/encodingXYY.d.ts +2 -0
  14. package/dist/pipeline/advanced/chart/pipes/encoding/index.d.ts +1 -0
  15. package/dist/pipeline/advanced/chart/pipes/init/autoMeasuresBy2M1Group.d.ts +8 -0
  16. package/dist/pipeline/advanced/chart/pipes/init/index.d.ts +1 -0
  17. package/dist/pipeline/advanced/chart/pipes/reshape/index.d.ts +2 -0
  18. package/dist/pipeline/advanced/chart/pipes/reshape/pivotReshapeTo1D.d.ts +8 -0
  19. package/dist/pipeline/advanced/chart/pipes/reshape/reshapeTo1D.d.ts +8 -0
  20. package/dist/pipeline/spec/chart/pipeline/areaRange.d.ts +1 -0
  21. package/dist/pipeline/spec/chart/pipeline/index.d.ts +1 -0
  22. package/dist/pipeline/spec/chart/pipes/index.d.ts +1 -0
  23. package/dist/pipeline/spec/chart/pipes/init/areaRange.d.ts +4 -0
  24. package/dist/pipeline/spec/chart/pipes/init/index.d.ts +1 -0
  25. package/dist/pipeline/spec/chart/pipes/series/index.d.ts +1 -0
  26. package/dist/pipeline/spec/chart/pipes/series/series.d.ts +2 -0
  27. package/dist/types/advancedVSeed.d.ts +307 -0
  28. package/dist/types/chartType/areaRange/areaRange.d.ts +1337 -0
  29. package/dist/types/chartType/areaRange/index.d.ts +1 -0
  30. package/dist/types/chartType/index.d.ts +1 -0
  31. package/dist/types/properties/chartType/chartType.d.ts +3 -1
  32. package/dist/types/properties/config/config.d.ts +307 -0
  33. package/dist/types/properties/theme/customTheme.d.ts +306 -0
  34. package/dist/types/vseed.d.ts +1190 -1
  35. package/dist/umd/index.js +484 -14
  36. package/dist/umd/index.js.map +1 -1
  37. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -44,6 +44,7 @@ __webpack_require__.d(__webpack_exports__, {
44
44
  zRoseConfig: ()=>zRoseConfig,
45
45
  findFirstMeasure: ()=>findFirstMeasure,
46
46
  scatterAdvancedPipeline: ()=>scatterAdvancedPipeline,
47
+ updateSpec: ()=>updateSpec,
47
48
  zCrosshairRect: ()=>zCrosshairRect,
48
49
  scatterSpecPipeline: ()=>scatterSpecPipeline,
49
50
  intl: ()=>intl,
@@ -78,6 +79,7 @@ __webpack_require__.d(__webpack_exports__, {
78
79
  barPercentAdvancedPipeline: ()=>barPercentAdvancedPipeline,
79
80
  findAllDimensions: ()=>findAllDimensions,
80
81
  findDimensionById: ()=>findDimensionById,
82
+ zAreaRangeConfig: ()=>zAreaRangeConfig,
81
83
  zPivotTableConfig: ()=>zPivotTableConfig,
82
84
  zArea: ()=>zArea,
83
85
  zColumnParallel: ()=>zColumnParallel,
@@ -94,22 +96,22 @@ __webpack_require__.d(__webpack_exports__, {
94
96
  zCustomThemeConfig: ()=>zCustomThemeConfig,
95
97
  registerColumnPercent: ()=>registerColumnPercent,
96
98
  zCrosshairLine: ()=>zCrosshairLine,
97
- registerBarPercent: ()=>registerBarPercent,
99
+ registerAreaRange: ()=>registerAreaRange,
98
100
  roseSpecPipeline: ()=>roseSpecPipeline,
101
+ registerBarPercent: ()=>registerBarPercent,
99
102
  zPivotTable: ()=>zPivotTable,
100
- zSortAxis: ()=>zSortAxis,
101
103
  registerLightTheme: ()=>registerLightTheme,
102
104
  roseAdvancedPipeline: ()=>roseAdvancedPipeline,
103
105
  zBarParallel: ()=>zBarParallel,
104
106
  zAnnotationVerticalLine: ()=>zAnnotationVerticalLine,
105
- zChartType: ()=>zChartType,
106
- tableAdvancedPipeline: ()=>tableAdvancedPipeline,
107
107
  registerDarkTheme: ()=>registerDarkTheme,
108
- registerPivotTable: ()=>registerPivotTable,
108
+ tableAdvancedPipeline: ()=>tableAdvancedPipeline,
109
109
  pieSpecPipeline: ()=>pieSpecPipeline,
110
+ registerPivotTable: ()=>registerPivotTable,
111
+ zChartType: ()=>zChartType,
110
112
  zMeasureTree: ()=>zMeasureTree,
111
113
  barSpecPipeline: ()=>barSpecPipeline,
112
- zStackCornerRadius: ()=>zStackCornerRadius,
114
+ zSortAxis: ()=>zSortAxis,
113
115
  registerRose: ()=>registerRose,
114
116
  zRose: ()=>zRose,
115
117
  unfoldDimensions: ()=>unfoldDimensions,
@@ -122,6 +124,7 @@ __webpack_require__.d(__webpack_exports__, {
122
124
  registerBar: ()=>registerBar,
123
125
  isVChart: ()=>isVChart,
124
126
  zPieConfig: ()=>zPieConfig,
127
+ zStackCornerRadius: ()=>zStackCornerRadius,
125
128
  zTable: ()=>zTable,
126
129
  registerLine: ()=>registerLine,
127
130
  registerCustomTheme: ()=>registerCustomTheme,
@@ -153,6 +156,7 @@ __webpack_require__.d(__webpack_exports__, {
153
156
  zAnnotationPoint: ()=>zAnnotationPoint,
154
157
  lightTheme: ()=>lightTheme,
155
158
  registerColumnParallel: ()=>registerColumnParallel,
159
+ updateAdvanced: ()=>updateAdvanced,
156
160
  zDimension: ()=>zDimension,
157
161
  isPivotChart: ()=>isPivotChart,
158
162
  zDualAxisConfig: ()=>zDualAxisConfig,
@@ -161,6 +165,7 @@ __webpack_require__.d(__webpack_exports__, {
161
165
  zLineConfig: ()=>zLineConfig,
162
166
  zTableConfig: ()=>zTableConfig,
163
167
  zXBandAxis: ()=>zXBandAxis,
168
+ dataReshapeFor1D: ()=>dataReshapeFor1D,
164
169
  zColumnPercentConfig: ()=>zColumnPercentConfig,
165
170
  findMeasureById: ()=>findMeasureById,
166
171
  zVSeed: ()=>zVSeed,
@@ -171,6 +176,9 @@ __webpack_require__.d(__webpack_exports__, {
171
176
  zMeasure: ()=>zMeasure,
172
177
  zLocale: ()=>zLocale,
173
178
  pivotTableSpecPipeline: ()=>pivotTableSpecPipeline,
179
+ areaRangeSpecPipeline: ()=>areaRangeSpecPipeline,
180
+ areaRangeAdvancedPipeline: ()=>areaRangeAdvancedPipeline,
181
+ zAreaRange: ()=>zAreaRange,
174
182
  registerScatter: ()=>registerScatter,
175
183
  zEncoding: ()=>zEncoding,
176
184
  autoNumFormatter: ()=>autoNumFormatter,
@@ -194,9 +202,9 @@ __webpack_require__.d(__webpack_exports__, {
194
202
  zBarParallelConfig: ()=>zBarParallelConfig,
195
203
  barParallelAdvancedPipeline: ()=>barParallelAdvancedPipeline,
196
204
  FoldMeasureValue: ()=>FoldMeasureValue,
197
- zBarPercentConfig: ()=>zBarPercentConfig,
198
205
  barPercentSpecPipeline: ()=>barPercentSpecPipeline,
199
206
  lineAdvancedPipeline: ()=>lineAdvancedPipeline,
207
+ zBarPercentConfig: ()=>zBarPercentConfig,
200
208
  lineSpecPipeline: ()=>lineSpecPipeline,
201
209
  zTooltip: ()=>zTooltip,
202
210
  createFormatter: ()=>createFormatter,
@@ -506,6 +514,51 @@ const autoDimensions = (advancedVSeed, context)=>{
506
514
  }));
507
515
  return result;
508
516
  };
517
+ const autoMeasuresBy2M1Group = (advancedVSeed, context)=>{
518
+ const result = {
519
+ ...advancedVSeed
520
+ };
521
+ const { vseed } = context;
522
+ const { measures, dataset } = vseed;
523
+ if (!dataset) throw new Error('dataset is required');
524
+ if (0 === dataset.length) return result;
525
+ if (measures) {
526
+ result.measures = auto2M1Group(measures);
527
+ return result;
528
+ }
529
+ const top100dataset = dataset.slice(0, 100);
530
+ const sample = top100dataset.reduce((prev, cur)=>({
531
+ ...prev,
532
+ ...cur
533
+ }), {});
534
+ const newMeasures = Object.keys(sample).filter((key)=>top100dataset.some((item)=>'number' == typeof item[key]) && ![
535
+ '',
536
+ null,
537
+ void 0
538
+ ].includes(key)).map((measure)=>({
539
+ id: measure,
540
+ alias: measure
541
+ }));
542
+ result.measures = auto2M1Group(newMeasures);
543
+ return result;
544
+ };
545
+ const auto2M1Group = (measures)=>{
546
+ const allMeasures = findAllMeasures(measures);
547
+ if (allMeasures.length <= 2) return allMeasures;
548
+ const groups = measures.filter((measure)=>'children' in measure);
549
+ const singleMeasures = measures.filter((measure)=>!('children' in measure));
550
+ for(let i = 0; i < singleMeasures.length; i += 2){
551
+ const group = autoMeasuresBy2M1Group_createEmptyMeasureGroup();
552
+ group.children = allMeasures.slice(i, i + 2);
553
+ groups.push(group);
554
+ }
555
+ return groups;
556
+ };
557
+ const autoMeasuresBy2M1Group_createEmptyMeasureGroup = ()=>({
558
+ id: '',
559
+ alias: '',
560
+ children: []
561
+ });
509
562
  const FoldMeasureName = '__MeaName__';
510
563
  const FoldMeasureValue = '__MeaValue__';
511
564
  const FoldMeasureId = '__MeaId__';
@@ -536,10 +589,10 @@ const unfoldDimensions = (dataset, dimensions, measures, unfoldStartIndex = 0, u
536
589
  for(let i = 0; i < dataset.length; i++){
537
590
  const datum = dataset[i];
538
591
  const colorName = generateDimGroupName(dimensionsToBeUnfolded, datum, dimensionsSeparator);
539
- const colorId = [
592
+ const colorId = datum[foldMeasureId] ? [
540
593
  colorName,
541
- datum[foldMeasureId] || 'id'
542
- ].join(dimensionsSeparator);
594
+ datum[foldMeasureId]
595
+ ].join(dimensionsSeparator) : colorName;
543
596
  datum[unfoldGroupName] = colorName;
544
597
  datum[unfoldGroupId] = colorId;
545
598
  colorItems.push(colorId);
@@ -765,6 +818,58 @@ const dataReshapeFor1D2M = (dataset, dimensions, measures, options)=>{
765
818
  };
766
819
  }
767
820
  };
821
+ const dataReshapeFor1D_emptyReshapeResult = {
822
+ dataset: [],
823
+ foldInfo: {
824
+ foldMap: {},
825
+ measureId: '',
826
+ measureName: '',
827
+ measureValue: ''
828
+ },
829
+ unfoldInfo: {
830
+ groupName: '',
831
+ groupId: '',
832
+ colorItems: [],
833
+ colorIdMap: {}
834
+ }
835
+ };
836
+ const dataReshapeFor1D = (dataset, dimensions, measures, options)=>{
837
+ const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup, unfoldDimensionGroupId = UnfoldDimensionGroupId } = options || {};
838
+ if (0 === dimensions.length && 0 === measures.length) return dataReshapeFor1D_emptyReshapeResult;
839
+ if (0 === dimensions.length) {
840
+ const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(dataset, [], [], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
841
+ return {
842
+ dataset: finalDataset,
843
+ foldInfo: {
844
+ foldMap: {},
845
+ measureId: foldMeasureId,
846
+ measureName: foldMeasureName,
847
+ measureValue: foldMeasureValue
848
+ },
849
+ unfoldInfo
850
+ };
851
+ }
852
+ {
853
+ const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(dataset, [
854
+ ...dimensions
855
+ ], [
856
+ {
857
+ id: foldMeasureValue,
858
+ alias: i18n`指标值`
859
+ }
860
+ ], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
861
+ return {
862
+ dataset: finalDataset,
863
+ foldInfo: {
864
+ foldMap: {},
865
+ measureId: foldMeasureId,
866
+ measureName: foldMeasureName,
867
+ measureValue: foldMeasureValue
868
+ },
869
+ unfoldInfo
870
+ };
871
+ }
872
+ };
768
873
  const reshapeTo2D1M = (advancedVSeed, context)=>{
769
874
  const result = {
770
875
  ...advancedVSeed
@@ -833,6 +938,28 @@ const reshapeTo1D2M = (advancedVSeed, context)=>{
833
938
  ]
834
939
  };
835
940
  };
941
+ const reshapeTo1D = (advancedVSeed, context)=>{
942
+ const result = {
943
+ ...advancedVSeed
944
+ };
945
+ const { vseed } = context;
946
+ const { dataset } = vseed;
947
+ const { dimensions, measures } = advancedVSeed;
948
+ if (!measures || !dimensions || !dataset) return result;
949
+ if (0 === measures.length) throw new Error('measures can not be empty');
950
+ const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeFor1D(dataset, dimensions, measures);
951
+ return {
952
+ ...result,
953
+ dataset: newDatasets,
954
+ datasetReshapeInfo: [
955
+ {
956
+ id: '1D2M',
957
+ foldInfo,
958
+ unfoldInfo
959
+ }
960
+ ]
961
+ };
962
+ };
836
963
  const pivotReshapeTo1D1M = (advancedVSeed, context)=>{
837
964
  const result = {
838
965
  ...advancedVSeed
@@ -953,6 +1080,46 @@ const pivotReshapeTo2D1M = (advancedVSeed, context)=>{
953
1080
  datasetReshapeInfo: datasetReshapeInfo
954
1081
  };
955
1082
  };
1083
+ const pivotReshapeTo1D = (advancedVSeed, context)=>{
1084
+ const result = {
1085
+ ...advancedVSeed
1086
+ };
1087
+ const { vseed } = context;
1088
+ const { dataset } = vseed;
1089
+ const { measures } = advancedVSeed;
1090
+ const dimensions = advancedVSeed.dimensions;
1091
+ if (!measures || !dimensions) return result;
1092
+ const measureGroups = [];
1093
+ if (measures) measures.forEach((measure)=>{
1094
+ if (measure.children && measure.children.length > 0) measureGroups.push(measure);
1095
+ });
1096
+ const newDatasets = [];
1097
+ const datasetReshapeInfo = [];
1098
+ measureGroups.forEach((measureGroup)=>{
1099
+ const measures = measureGroup.children;
1100
+ if (!measures) return;
1101
+ const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
1102
+ const groupId = measureGroup.id;
1103
+ const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeFor1D(dataset, commonDimensions, measures, {
1104
+ foldMeasureId: FoldMeasureId,
1105
+ foldMeasureName: FoldMeasureName,
1106
+ foldMeasureValue: FoldMeasureValue + groupId,
1107
+ unfoldDimensionGroup: UnfoldDimensionGroup
1108
+ });
1109
+ const reshapeInfo = {
1110
+ id: groupId,
1111
+ foldInfo,
1112
+ unfoldInfo
1113
+ };
1114
+ newDatasets.push(newSubDataset);
1115
+ datasetReshapeInfo.push(reshapeInfo);
1116
+ });
1117
+ return {
1118
+ ...result,
1119
+ dataset: newDatasets,
1120
+ datasetReshapeInfo: datasetReshapeInfo
1121
+ };
1122
+ };
956
1123
  const encodingXY = (advancedVSeed)=>{
957
1124
  const result = {
958
1125
  ...advancedVSeed
@@ -1063,6 +1230,74 @@ const encodingYY = (advancedVSeed)=>{
1063
1230
  encoding
1064
1231
  };
1065
1232
  };
1233
+ const encodingXYY = (advancedVSeed)=>{
1234
+ const result = {
1235
+ ...advancedVSeed
1236
+ };
1237
+ const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
1238
+ if (!datasetReshapeInfo || !dimensions || !measures) return result;
1239
+ const encoding = datasetReshapeInfo.reduce((prev, cur, index)=>{
1240
+ const measure = measures[index];
1241
+ if ('children' in measure) {
1242
+ const m1 = measure.children?.[0];
1243
+ const m2 = measure.children?.[1] || m1;
1244
+ const { foldInfo, unfoldInfo } = cur;
1245
+ const x = [
1246
+ unfoldInfo.groupId
1247
+ ];
1248
+ const y = [
1249
+ m1?.id,
1250
+ m2?.id
1251
+ ];
1252
+ const group = [
1253
+ unfoldInfo.groupId
1254
+ ];
1255
+ const color = [
1256
+ foldInfo.measureName
1257
+ ];
1258
+ return [
1259
+ ...prev,
1260
+ {
1261
+ x,
1262
+ y,
1263
+ group,
1264
+ color
1265
+ }
1266
+ ];
1267
+ }
1268
+ {
1269
+ const m1 = measures[index];
1270
+ const m2 = measures[index + 1] || m1;
1271
+ const { foldInfo, unfoldInfo } = cur;
1272
+ const x = [
1273
+ unfoldInfo.groupId
1274
+ ];
1275
+ const y = [
1276
+ m1.id,
1277
+ m2.id
1278
+ ];
1279
+ const group = [
1280
+ unfoldInfo.groupId
1281
+ ];
1282
+ const color = [
1283
+ foldInfo.measureName
1284
+ ];
1285
+ return [
1286
+ ...prev,
1287
+ {
1288
+ x,
1289
+ y,
1290
+ group,
1291
+ color
1292
+ }
1293
+ ];
1294
+ }
1295
+ }, []);
1296
+ return {
1297
+ ...result,
1298
+ encoding
1299
+ };
1300
+ };
1066
1301
  const encodingRose = (advancedVSeed)=>{
1067
1302
  const result = {
1068
1303
  ...advancedVSeed
@@ -1532,6 +1767,22 @@ const areaPercentAdvancedPipeline = [
1532
1767
  markStyle_markStyle,
1533
1768
  annotation_annotation
1534
1769
  ];
1770
+ const areaRangeAdvancedPipeline = [
1771
+ initAdvancedVSeed,
1772
+ autoMeasuresBy2M1Group,
1773
+ autoDimensions,
1774
+ pivotAdapter([
1775
+ reshapeTo1D
1776
+ ], [
1777
+ pivotReshapeTo1D
1778
+ ]),
1779
+ encodingXYY,
1780
+ sortXBandAxis,
1781
+ areaConfig,
1782
+ theme_theme,
1783
+ markStyle_markStyle,
1784
+ annotation_annotation
1785
+ ];
1535
1786
  const pieAdvancedPipeline = [
1536
1787
  initAdvancedVSeed,
1537
1788
  autoMeasures,
@@ -1772,7 +2023,7 @@ const tableAdvancedPipeline = [
1772
2023
  theme_theme
1773
2024
  ];
1774
2025
  const dataset_dataset = (spec, context)=>{
1775
- const { advancedVSeed } = context;
2026
+ const { advancedVSeed, vseed } = context;
1776
2027
  const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
1777
2028
  const { orderMapping = {} } = analysis ?? {};
1778
2029
  const angle = encoding[0]?.angle?.[0];
@@ -1821,7 +2072,7 @@ const dataset_dataset = (spec, context)=>{
1821
2072
  ...spec,
1822
2073
  data: {
1823
2074
  id,
1824
- values: advancedVSeed.dataset,
2075
+ values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset,
1825
2076
  fields: fields
1826
2077
  }
1827
2078
  };
@@ -1930,6 +2181,88 @@ const initArea = (spec, context)=>{
1930
2181
  result.animation = true;
1931
2182
  return result;
1932
2183
  };
2184
+ const initAreaRange = (spec, context)=>{
2185
+ const result = {
2186
+ ...spec
2187
+ };
2188
+ const { advancedVSeed } = context;
2189
+ const { encoding } = advancedVSeed;
2190
+ if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
2191
+ const { color } = advancedVSeed.config.areaRange;
2192
+ result.type = 'rangeArea';
2193
+ result.direction = 'vertical';
2194
+ result.stack = false;
2195
+ result.xField = encoding[0].x[0];
2196
+ result.yField = [
2197
+ encoding[0].y[0],
2198
+ encoding[0].y[1]
2199
+ ];
2200
+ result.animation = true;
2201
+ result.area = {
2202
+ style: {
2203
+ fill: color.colorScheme?.[0]
2204
+ }
2205
+ };
2206
+ return result;
2207
+ };
2208
+ const initAreaRangeLine1 = (spec, context)=>{
2209
+ const result = {
2210
+ ...spec
2211
+ };
2212
+ const { advancedVSeed } = context;
2213
+ const { encoding } = advancedVSeed;
2214
+ if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
2215
+ const { color } = advancedVSeed.config.areaRange;
2216
+ result.type = 'line';
2217
+ result.direction = 'vertical';
2218
+ result.stack = false;
2219
+ result.xField = encoding[0].x[0];
2220
+ result.yField = [
2221
+ encoding[0].y[0]
2222
+ ];
2223
+ result.animation = true;
2224
+ result.line = {
2225
+ style: {
2226
+ stroke: color.colorScheme?.[0]
2227
+ }
2228
+ };
2229
+ result.point = {
2230
+ style: {
2231
+ visible: false,
2232
+ fill: color.colorScheme?.[0]
2233
+ }
2234
+ };
2235
+ return result;
2236
+ };
2237
+ const initAreaRangeLine2 = (spec, context)=>{
2238
+ const result = {
2239
+ ...spec
2240
+ };
2241
+ const { advancedVSeed } = context;
2242
+ const { encoding } = advancedVSeed;
2243
+ if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
2244
+ const { color } = advancedVSeed.config.areaRange;
2245
+ result.type = 'line';
2246
+ result.direction = 'vertical';
2247
+ result.stack = false;
2248
+ result.xField = encoding[0].x[0];
2249
+ result.yField = [
2250
+ encoding[0].y[1]
2251
+ ];
2252
+ result.animation = true;
2253
+ result.line = {
2254
+ style: {
2255
+ stroke: color.colorScheme?.[0]
2256
+ }
2257
+ };
2258
+ result.point = {
2259
+ style: {
2260
+ visible: false,
2261
+ fill: color.colorScheme?.[0]
2262
+ }
2263
+ };
2264
+ return result;
2265
+ };
1933
2266
  const initLine = (spec, context)=>{
1934
2267
  const result = {
1935
2268
  ...spec
@@ -4203,6 +4536,21 @@ const horizontalCrosshairLine = (spec, context)=>{
4203
4536
  };
4204
4537
  return result;
4205
4538
  };
4539
+ const series = (...args)=>{
4540
+ const result = {
4541
+ type: 'common',
4542
+ padding: 0,
4543
+ region: [
4544
+ {
4545
+ clip: true
4546
+ }
4547
+ ]
4548
+ };
4549
+ return (_, context)=>{
4550
+ result.series = args.map((pipeline)=>execPipeline(pipeline, context, {}));
4551
+ return result;
4552
+ };
4553
+ };
4206
4554
  const line_line = [
4207
4555
  initLine,
4208
4556
  color_color,
@@ -4649,6 +4997,69 @@ const pivotAreaPercent = [
4649
4997
  const areaPercentSpecPipeline = [
4650
4998
  pivotAdapter_pivotAdapter(areaPercent, pivotAreaPercent)
4651
4999
  ];
5000
+ const areaRange = [
5001
+ series([
5002
+ initAreaRange,
5003
+ areaStyle_areaStyle
5004
+ ], [
5005
+ initAreaRangeLine1,
5006
+ lineStyle_lineStyle,
5007
+ pointStyle_pointStyle,
5008
+ pointStateDimensionHover
5009
+ ], [
5010
+ initAreaRangeLine2,
5011
+ lineStyle_lineStyle,
5012
+ pointStyle_pointStyle,
5013
+ pointStateDimensionHover
5014
+ ]),
5015
+ dataset_dataset,
5016
+ background_backgroundColor,
5017
+ xBand,
5018
+ yLinear,
5019
+ label_label,
5020
+ verticalCrosshairLine,
5021
+ annotationPoint_annotationPoint,
5022
+ annotationVerticalLine_annotationVerticalLine,
5023
+ annotationHorizontalLine_annotationHorizontalLine,
5024
+ annotationArea_annotationArea
5025
+ ];
5026
+ const pivotAreaRange = [
5027
+ initPivot,
5028
+ pivotGridStyle,
5029
+ pivotIndicators_pivotIndicatorsAsRow,
5030
+ datasetPivot,
5031
+ pivotIndicators([
5032
+ series([
5033
+ initAreaRange,
5034
+ areaStyle_areaStyle
5035
+ ], [
5036
+ initAreaRangeLine1,
5037
+ lineStyle_lineStyle,
5038
+ pointStyle_pointStyle,
5039
+ pointStateDimensionHover
5040
+ ], [
5041
+ initAreaRangeLine2,
5042
+ lineStyle_lineStyle,
5043
+ pointStyle_pointStyle,
5044
+ pointStateDimensionHover
5045
+ ]),
5046
+ background_backgroundColor,
5047
+ dataset_dataset,
5048
+ xBand,
5049
+ yLinear,
5050
+ label_label,
5051
+ verticalCrosshairLine,
5052
+ annotationPoint_annotationPoint,
5053
+ annotationVerticalLine_annotationVerticalLine,
5054
+ annotationHorizontalLine_annotationHorizontalLine,
5055
+ annotationArea_annotationArea
5056
+ ]),
5057
+ pivotRowDimensions,
5058
+ pivotColumnDimensions
5059
+ ];
5060
+ const areaRangeSpecPipeline = [
5061
+ pivotAdapter_pivotAdapter(areaRange, pivotAreaRange)
5062
+ ];
4652
5063
  const pie = [
4653
5064
  initPie,
4654
5065
  color_color,
@@ -5388,8 +5799,18 @@ class Builder {
5388
5799
  build = ()=>build(this);
5389
5800
  buildSpec = (advanced)=>buildSpec(this, advanced);
5390
5801
  buildAdvanced = ()=>buildAdvanced(this);
5391
- getAdvancedPipeline = (chartType)=>Builder._advancedPipelineMap[chartType];
5392
- getSpecPipeline = (chartType)=>Builder._specPipelineMap[chartType];
5802
+ getAdvancedPipeline = (chartType)=>{
5803
+ const customPipe = Builder._customAdvancedPipe[chartType];
5804
+ const pipeline = Builder._advancedPipelineMap[chartType];
5805
+ if (customPipe) pipeline.push(customPipe);
5806
+ return pipeline;
5807
+ };
5808
+ getSpecPipeline = (chartType)=>{
5809
+ const customPipe = Builder._customSpecPipe[chartType];
5810
+ const pipeline = Builder._specPipelineMap[chartType];
5811
+ if (customPipe) pipeline.push(customPipe);
5812
+ return pipeline;
5813
+ };
5393
5814
  getTheme = (themeKey)=>Builder._themeMap[themeKey];
5394
5815
  getThemeMap = ()=>Builder._themeMap;
5395
5816
  getColorItems = ()=>getColorItems(this);
@@ -5414,6 +5835,8 @@ class Builder {
5414
5835
  }
5415
5836
  static _advancedPipelineMap = {};
5416
5837
  static _specPipelineMap = {};
5838
+ static _customAdvancedPipe = {};
5839
+ static _customSpecPipe = {};
5417
5840
  static _themeMap = {};
5418
5841
  static from = (vseed)=>new Builder(vseed);
5419
5842
  }
@@ -5437,6 +5860,10 @@ const registerAreaPercent = ()=>{
5437
5860
  Builder._advancedPipelineMap.areaPercent = areaPercentAdvancedPipeline;
5438
5861
  Builder._specPipelineMap.areaPercent = areaPercentSpecPipeline;
5439
5862
  };
5863
+ const registerAreaRange = ()=>{
5864
+ Builder._advancedPipelineMap.areaRange = areaRangeAdvancedPipeline;
5865
+ Builder._specPipelineMap.areaRange = areaRangeSpecPipeline;
5866
+ };
5440
5867
  const registerBarPercent = ()=>{
5441
5868
  Builder._advancedPipelineMap.barPercent = barPercentAdvancedPipeline;
5442
5869
  Builder._specPipelineMap.barPercent = barPercentSpecPipeline;
@@ -5729,6 +6156,12 @@ const lightTheme = ()=>{
5729
6156
  yAxis: linearAxis,
5730
6157
  crosshairLine
5731
6158
  },
6159
+ areaRange: {
6160
+ ...baseConfig,
6161
+ xAxis: bandAxis,
6162
+ yAxis: linearAxis,
6163
+ crosshairLine
6164
+ },
5732
6165
  scatter: {
5733
6166
  ...baseConfig,
5734
6167
  xAxis: {
@@ -6022,6 +6455,12 @@ const darkTheme = ()=>{
6022
6455
  yAxis: linearAxis,
6023
6456
  crosshairLine: crosshairLine
6024
6457
  },
6458
+ areaRange: {
6459
+ ...baseConfig,
6460
+ xAxis: bandAxis,
6461
+ yAxis: linearAxis,
6462
+ crosshairLine: crosshairLine
6463
+ },
6025
6464
  scatter: {
6026
6465
  ...baseConfig,
6027
6466
  xAxis: {
@@ -6095,6 +6534,7 @@ const registerAll = ()=>{
6095
6534
  registerBarPercent();
6096
6535
  registerArea();
6097
6536
  registerAreaPercent();
6537
+ registerAreaRange();
6098
6538
  registerPie();
6099
6539
  registerDonut();
6100
6540
  registerRose();
@@ -6106,6 +6546,12 @@ const registerAll = ()=>{
6106
6546
  registerLightTheme();
6107
6547
  registerDarkTheme();
6108
6548
  };
6549
+ const updateAdvanced = (chartType, advancedPipe)=>{
6550
+ Builder._customAdvancedPipe[chartType] = advancedPipe;
6551
+ };
6552
+ const updateSpec = (chartType, specPipe)=>{
6553
+ Builder._customSpecPipe[chartType] = specPipe;
6554
+ };
6109
6555
  const external_zod_namespaceObject = require("zod");
6110
6556
  var external_zod_default = /*#__PURE__*/ __webpack_require__.n(external_zod_namespaceObject);
6111
6557
  const zChartType = external_zod_namespaceObject.z["enum"]([
@@ -6120,6 +6566,7 @@ const zChartType = external_zod_namespaceObject.z["enum"]([
6120
6566
  'barParallel',
6121
6567
  'area',
6122
6568
  'areaPercent',
6569
+ 'areaRange',
6123
6570
  'rose',
6124
6571
  'roseParallel',
6125
6572
  'pie',
@@ -6450,6 +6897,7 @@ const zAreaConfig = external_zod_namespaceObject.z.object({
6450
6897
  crosshairLine: zCrosshairLine.optional()
6451
6898
  });
6452
6899
  const zAreaPercentConfig = zAreaConfig;
6900
+ const zAreaRangeConfig = zAreaConfig;
6453
6901
  const zRoseConfig = external_zod_namespaceObject.z.object({
6454
6902
  backgroundColor: zBackgroundColor.optional(),
6455
6903
  label: zLabel.optional(),
@@ -6502,6 +6950,7 @@ const zConfig = external_zod_namespaceObject.z.object({
6502
6950
  barPercent: zBarPercentConfig.optional(),
6503
6951
  area: zAreaConfig.optional(),
6504
6952
  areaPercent: zAreaPercentConfig.optional(),
6953
+ areaRange: zAreaRangeConfig.optional(),
6505
6954
  rose: zRoseConfig.optional(),
6506
6955
  roseParallel: zRoseParallelConfig.optional(),
6507
6956
  pie: zPieConfig.optional(),
@@ -7107,6 +7556,26 @@ const zAreaPercent = external_zod_namespaceObject.z.object({
7107
7556
  annotationArea: external_zod_namespaceObject.z.array(zAnnotationArea).or(zAnnotationArea).optional(),
7108
7557
  locale: zLocale.optional()
7109
7558
  });
7559
+ const zAreaRange = external_zod_namespaceObject.z.object({
7560
+ chartType: external_zod_namespaceObject.z.literal('areaRange'),
7561
+ dataset: zDataset.optional(),
7562
+ dimensions: zDimensions.optional(),
7563
+ measures: zMeasureTree.optional(),
7564
+ backgroundColor: zBackgroundColor.optional(),
7565
+ label: zLabel.optional(),
7566
+ xAxis: zXBandAxis.optional(),
7567
+ yAxis: zYLinearAxis.optional(),
7568
+ crosshairLine: zCrosshairLine.optional(),
7569
+ theme: zTheme.optional(),
7570
+ pointStyle: zPointStyle.optional(),
7571
+ lineStyle: zLineStyle.optional(),
7572
+ areaStyle: zAreaStyle.optional(),
7573
+ annotationPoint: external_zod_namespaceObject.z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
7574
+ annotationVerticalLine: external_zod_namespaceObject.z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
7575
+ annotationHorizontalLine: external_zod_namespaceObject.z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
7576
+ annotationArea: external_zod_namespaceObject.z.array(zAnnotationArea).or(zAnnotationArea).optional(),
7577
+ locale: zLocale.optional()
7578
+ });
7110
7579
  const zRose = external_zod_namespaceObject.z.object({
7111
7580
  chartType: external_zod_namespaceObject.z.literal('rose'),
7112
7581
  dataset: zDataset.optional(),
@@ -7205,6 +7674,7 @@ const zVSeed = external_zod_namespaceObject.z.discriminatedUnion('chartType', [
7205
7674
  zBarPercent,
7206
7675
  zArea,
7207
7676
  zAreaPercent,
7677
+ zAreaRange,
7208
7678
  zPie,
7209
7679
  zRose,
7210
7680
  zRoseParallel,
@@ -7238,6 +7708,8 @@ exports.UnfoldDimensionGroupId = __webpack_exports__.UnfoldDimensionGroupId;
7238
7708
  exports.areaAdvancedPipeline = __webpack_exports__.areaAdvancedPipeline;
7239
7709
  exports.areaPercentAdvancedPipeline = __webpack_exports__.areaPercentAdvancedPipeline;
7240
7710
  exports.areaPercentSpecPipeline = __webpack_exports__.areaPercentSpecPipeline;
7711
+ exports.areaRangeAdvancedPipeline = __webpack_exports__.areaRangeAdvancedPipeline;
7712
+ exports.areaRangeSpecPipeline = __webpack_exports__.areaRangeSpecPipeline;
7241
7713
  exports.areaSpecPipeline = __webpack_exports__.areaSpecPipeline;
7242
7714
  exports.autoFormatter = __webpack_exports__.autoFormatter;
7243
7715
  exports.autoNumFormatter = __webpack_exports__.autoNumFormatter;
@@ -7256,6 +7728,7 @@ exports.columnSpecPipeline = __webpack_exports__.columnSpecPipeline;
7256
7728
  exports.createFormatter = __webpack_exports__.createFormatter;
7257
7729
  exports.createNumFormatter = __webpack_exports__.createNumFormatter;
7258
7730
  exports.darkTheme = __webpack_exports__.darkTheme;
7731
+ exports.dataReshapeFor1D = __webpack_exports__.dataReshapeFor1D;
7259
7732
  exports.dataReshapeFor1D1M = __webpack_exports__.dataReshapeFor1D1M;
7260
7733
  exports.dataReshapeFor1D2M = __webpack_exports__.dataReshapeFor1D2M;
7261
7734
  exports.dataReshapeFor2D1M = __webpack_exports__.dataReshapeFor2D1M;
@@ -7289,6 +7762,7 @@ exports.preorderTraverse = __webpack_exports__.preorderTraverse;
7289
7762
  exports.registerAll = __webpack_exports__.registerAll;
7290
7763
  exports.registerArea = __webpack_exports__.registerArea;
7291
7764
  exports.registerAreaPercent = __webpack_exports__.registerAreaPercent;
7765
+ exports.registerAreaRange = __webpack_exports__.registerAreaRange;
7292
7766
  exports.registerBar = __webpack_exports__.registerBar;
7293
7767
  exports.registerBarParallel = __webpack_exports__.registerBarParallel;
7294
7768
  exports.registerBarPercent = __webpack_exports__.registerBarPercent;
@@ -7316,6 +7790,8 @@ exports.scatterSpecPipeline = __webpack_exports__.scatterSpecPipeline;
7316
7790
  exports.tableAdvancedPipeline = __webpack_exports__.tableAdvancedPipeline;
7317
7791
  exports.tableSpecPipeline = __webpack_exports__.tableSpecPipeline;
7318
7792
  exports.unfoldDimensions = __webpack_exports__.unfoldDimensions;
7793
+ exports.updateAdvanced = __webpack_exports__.updateAdvanced;
7794
+ exports.updateSpec = __webpack_exports__.updateSpec;
7319
7795
  exports.zAdvancedVSeed = __webpack_exports__.zAdvancedVSeed;
7320
7796
  exports.zAnalysis = __webpack_exports__.zAnalysis;
7321
7797
  exports.zAnnotation = __webpack_exports__.zAnnotation;
@@ -7327,6 +7803,8 @@ exports.zArea = __webpack_exports__.zArea;
7327
7803
  exports.zAreaConfig = __webpack_exports__.zAreaConfig;
7328
7804
  exports.zAreaPercent = __webpack_exports__.zAreaPercent;
7329
7805
  exports.zAreaPercentConfig = __webpack_exports__.zAreaPercentConfig;
7806
+ exports.zAreaRange = __webpack_exports__.zAreaRange;
7807
+ exports.zAreaRangeConfig = __webpack_exports__.zAreaRangeConfig;
7330
7808
  exports.zAreaStyle = __webpack_exports__.zAreaStyle;
7331
7809
  exports.zAxis = __webpack_exports__.zAxis;
7332
7810
  exports.zBackgroundColor = __webpack_exports__.zBackgroundColor;
@@ -7412,6 +7890,8 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
7412
7890
  "areaAdvancedPipeline",
7413
7891
  "areaPercentAdvancedPipeline",
7414
7892
  "areaPercentSpecPipeline",
7893
+ "areaRangeAdvancedPipeline",
7894
+ "areaRangeSpecPipeline",
7415
7895
  "areaSpecPipeline",
7416
7896
  "autoFormatter",
7417
7897
  "autoNumFormatter",
@@ -7430,6 +7910,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
7430
7910
  "createFormatter",
7431
7911
  "createNumFormatter",
7432
7912
  "darkTheme",
7913
+ "dataReshapeFor1D",
7433
7914
  "dataReshapeFor1D1M",
7434
7915
  "dataReshapeFor1D2M",
7435
7916
  "dataReshapeFor2D1M",
@@ -7463,6 +7944,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
7463
7944
  "registerAll",
7464
7945
  "registerArea",
7465
7946
  "registerAreaPercent",
7947
+ "registerAreaRange",
7466
7948
  "registerBar",
7467
7949
  "registerBarParallel",
7468
7950
  "registerBarPercent",
@@ -7490,6 +7972,8 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
7490
7972
  "tableAdvancedPipeline",
7491
7973
  "tableSpecPipeline",
7492
7974
  "unfoldDimensions",
7975
+ "updateAdvanced",
7976
+ "updateSpec",
7493
7977
  "zAdvancedVSeed",
7494
7978
  "zAnalysis",
7495
7979
  "zAnnotation",
@@ -7501,6 +7985,8 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
7501
7985
  "zAreaConfig",
7502
7986
  "zAreaPercent",
7503
7987
  "zAreaPercentConfig",
7988
+ "zAreaRange",
7989
+ "zAreaRangeConfig",
7504
7990
  "zAreaStyle",
7505
7991
  "zAxis",
7506
7992
  "zBackgroundColor",