@visactor/vseed 0.0.13 → 0.0.15
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.
- package/dist/builder/builder/builder.d.ts +6 -0
- package/dist/dataReshape/constant.d.ts +1 -0
- package/dist/dataReshape/dataReshapeFor1D1M.d.ts +1 -0
- package/dist/dataReshape/dataReshapeFor2D1M.d.ts +1 -0
- package/dist/dataReshape/unfoldDimensions.d.ts +1 -1
- package/dist/index.cjs +312 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +307 -43
- package/dist/index.js.map +1 -1
- package/dist/types/advancedVSeed.d.ts +2 -0
- package/dist/types/chartType/area/area.d.ts +867 -0
- package/dist/types/chartType/area/index.d.ts +1 -1
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +867 -0
- package/dist/types/chartType/areaPercent/index.d.ts +1 -1
- package/dist/types/chartType/bar/bar.d.ts +713 -2
- package/dist/types/chartType/bar/index.d.ts +1 -1
- package/dist/types/chartType/barParallel/barParallel.d.ts +711 -0
- package/dist/types/chartType/barParallel/index.d.ts +1 -1
- package/dist/types/chartType/barPercent/barPercent.d.ts +711 -0
- package/dist/types/chartType/barPercent/index.d.ts +1 -1
- package/dist/types/chartType/column/column.d.ts +711 -0
- package/dist/types/chartType/column/index.d.ts +1 -1
- package/dist/types/chartType/columnParallel/columnParallel.d.ts +711 -0
- package/dist/types/chartType/columnParallel/index.d.ts +1 -1
- package/dist/types/chartType/columnPercent/columnPercent.d.ts +711 -0
- package/dist/types/chartType/columnPercent/index.d.ts +1 -1
- package/dist/types/chartType/index.d.ts +11 -11
- package/dist/types/chartType/line/index.d.ts +1 -1
- package/dist/types/chartType/line/line.d.ts +794 -0
- package/dist/types/chartType/pie/index.d.ts +1 -1
- package/dist/types/chartType/pie/pie.d.ts +137 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/properties/datasetReshapeInfo/datasetReshapeInfo.d.ts +6 -0
- package/dist/types/vseed.d.ts +6855 -31
- package/dist/umd/index.js +8687 -0
- package/dist/umd/index.js.map +1 -0
- package/package.json +10 -10
package/dist/index.js
CHANGED
@@ -266,30 +266,40 @@ const FoldMeasureName = '__MeaName__';
|
|
266
266
|
const FoldMeasureValue = '__MeaValue__';
|
267
267
|
const FoldMeasureId = '__MeaId__';
|
268
268
|
const UnfoldDimensionGroup = '__DimGroup__';
|
269
|
+
const UnfoldDimensionGroupId = '__DimGroupID__';
|
269
270
|
const Separator = '-';
|
270
271
|
const ORIGINAL_DATA = '__OriginalData__';
|
271
|
-
const unfoldDimensions = (dataset, dimensions, measures, unfoldStartIndex = 0,
|
272
|
+
const unfoldDimensions = (dataset, dimensions, measures, unfoldStartIndex = 0, unfoldGroupName = UnfoldDimensionGroup, unfoldGroupId = UnfoldDimensionGroupId, foldMeasureId = FoldMeasureId, dimensionsSeparator = Separator)=>{
|
272
273
|
if (unfoldStartIndex < 0 || unfoldStartIndex >= dimensions.length) throw new Error('unfoldStartIndex is out of range');
|
273
274
|
const dimensionsToBeUnfolded = dimensions.slice(unfoldStartIndex);
|
274
275
|
const unfoldInfo = {
|
275
|
-
groupName:
|
276
|
-
|
276
|
+
groupName: unfoldGroupName,
|
277
|
+
groupId: unfoldGroupId,
|
278
|
+
colorItems: [],
|
279
|
+
colorIdMap: {}
|
277
280
|
};
|
278
281
|
if (0 === dimensions.length || 0 === measures.length) return {
|
279
282
|
dataset,
|
280
283
|
unfoldInfo: {
|
281
|
-
groupName:
|
282
|
-
|
284
|
+
groupName: unfoldGroupName,
|
285
|
+
groupId: unfoldGroupId,
|
286
|
+
colorItems: [],
|
287
|
+
colorIdMap: {}
|
283
288
|
}
|
284
289
|
};
|
285
290
|
const colorItems = [];
|
291
|
+
const colorMap = {};
|
286
292
|
for(let i = 0; i < dataset.length; i++){
|
287
293
|
const datum = dataset[i];
|
288
|
-
const
|
289
|
-
datum[
|
290
|
-
|
294
|
+
const colorName = generateDimGroupName(dimensionsToBeUnfolded, datum, dimensionsSeparator);
|
295
|
+
const colorId = colorName + (datum[foldMeasureId] || '');
|
296
|
+
datum[unfoldGroupName] = colorName;
|
297
|
+
datum[unfoldGroupId] = colorId;
|
298
|
+
colorItems.push(colorId);
|
299
|
+
colorMap[colorId] = colorName;
|
291
300
|
}
|
292
301
|
unfoldInfo.colorItems = unique(colorItems);
|
302
|
+
unfoldInfo.colorIdMap = colorMap;
|
293
303
|
return {
|
294
304
|
dataset,
|
295
305
|
unfoldInfo
|
@@ -315,7 +325,7 @@ const foldMeasures = (dataset, measures, measureId = FoldMeasureId, measureName
|
|
315
325
|
const { id, alias } = measure;
|
316
326
|
datum[id] = dataset[i][id];
|
317
327
|
datum[measureId] = id;
|
318
|
-
datum[measureName] = alias;
|
328
|
+
datum[measureName] = alias || id;
|
319
329
|
datum[measureValue] = dataset[i][id];
|
320
330
|
foldInfo.foldMap[id] = alias;
|
321
331
|
result[index++] = datum;
|
@@ -334,12 +344,14 @@ const emptyReshapeResult = {
|
|
334
344
|
measureValue: ''
|
335
345
|
},
|
336
346
|
unfoldInfo: {
|
347
|
+
groupName: '',
|
348
|
+
groupId: '',
|
337
349
|
colorItems: [],
|
338
|
-
|
350
|
+
colorIdMap: {}
|
339
351
|
}
|
340
352
|
};
|
341
353
|
const dataReshapeFor2D1M = (dataset, dimensions, measures, options)=>{
|
342
|
-
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup } = options || {};
|
354
|
+
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup, unfoldDimensionGroupId = UnfoldDimensionGroupId } = options || {};
|
343
355
|
if (0 === dimensions.length && 0 === measures.length) return emptyReshapeResult;
|
344
356
|
const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, foldMeasureId, foldMeasureName, foldMeasureValue);
|
345
357
|
if (0 === dimensions.length) {
|
@@ -359,7 +371,7 @@ const dataReshapeFor2D1M = (dataset, dimensions, measures, options)=>{
|
|
359
371
|
id: foldMeasureValue,
|
360
372
|
alias: i18n`指标值`
|
361
373
|
}
|
362
|
-
], 1, unfoldDimensionGroup);
|
374
|
+
], 1, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
363
375
|
return {
|
364
376
|
dataset: finalDataset,
|
365
377
|
foldInfo,
|
@@ -379,7 +391,7 @@ const dataReshapeFor2D1M = (dataset, dimensions, measures, options)=>{
|
|
379
391
|
id: foldMeasureValue,
|
380
392
|
alias: i18n`指标值`
|
381
393
|
}
|
382
|
-
], 1, unfoldDimensionGroup);
|
394
|
+
], 1, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
383
395
|
return {
|
384
396
|
dataset: finalDataset,
|
385
397
|
foldInfo,
|
@@ -397,11 +409,13 @@ const dataReshapeFor1D1M_emptyReshapeResult = {
|
|
397
409
|
},
|
398
410
|
unfoldInfo: {
|
399
411
|
groupName: '',
|
400
|
-
|
412
|
+
groupId: '',
|
413
|
+
colorItems: [],
|
414
|
+
colorIdMap: {}
|
401
415
|
}
|
402
416
|
};
|
403
417
|
const dataReshapeFor1D1M = (dataset, dimensions, measures, options)=>{
|
404
|
-
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup } = options || {};
|
418
|
+
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup, unfoldDimensionGroupId = UnfoldDimensionGroupId } = options || {};
|
405
419
|
if (0 === dimensions.length && 0 === measures.length) return dataReshapeFor1D1M_emptyReshapeResult;
|
406
420
|
const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, foldMeasureId, foldMeasureName, foldMeasureValue);
|
407
421
|
if (0 === dimensions.length) {
|
@@ -416,7 +430,7 @@ const dataReshapeFor1D1M = (dataset, dimensions, measures, options)=>{
|
|
416
430
|
id: foldMeasureValue,
|
417
431
|
alias: i18n`指标值`
|
418
432
|
}
|
419
|
-
], 0, unfoldDimensionGroup);
|
433
|
+
], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
420
434
|
return {
|
421
435
|
dataset: finalDataset,
|
422
436
|
foldInfo,
|
@@ -436,7 +450,7 @@ const dataReshapeFor1D1M = (dataset, dimensions, measures, options)=>{
|
|
436
450
|
id: foldMeasureValue,
|
437
451
|
alias: i18n`指标值`
|
438
452
|
}
|
439
|
-
], 0, unfoldDimensionGroup);
|
453
|
+
], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
440
454
|
return {
|
441
455
|
dataset: finalDataset,
|
442
456
|
foldInfo,
|
@@ -576,7 +590,6 @@ const encodingXY = (advancedVSeed)=>{
|
|
576
590
|
if (!datasetReshapeInfo || !dimensions) return result;
|
577
591
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
578
592
|
const { foldInfo, unfoldInfo } = cur;
|
579
|
-
const isSingleDimension = 1 === dimensions.length;
|
580
593
|
const isZeroDimension = 0 === dimensions.length;
|
581
594
|
const x = [
|
582
595
|
isZeroDimension ? foldInfo.measureName : dimensions[0].id
|
@@ -585,7 +598,7 @@ const encodingXY = (advancedVSeed)=>{
|
|
585
598
|
foldInfo.measureValue
|
586
599
|
];
|
587
600
|
const group = [
|
588
|
-
|
601
|
+
unfoldInfo.groupId
|
589
602
|
];
|
590
603
|
const color = [
|
591
604
|
foldInfo.measureName
|
@@ -614,7 +627,6 @@ const encodingYX = (advancedVSeed)=>{
|
|
614
627
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
615
628
|
const { foldInfo, unfoldInfo } = cur;
|
616
629
|
const isZeroDimension = 0 === dimensions.length;
|
617
|
-
const isSingleDimension = 1 === dimensions.length;
|
618
630
|
const y = [
|
619
631
|
isZeroDimension ? foldInfo.measureName : dimensions[0].id
|
620
632
|
];
|
@@ -622,7 +634,7 @@ const encodingYX = (advancedVSeed)=>{
|
|
622
634
|
foldInfo.measureValue
|
623
635
|
];
|
624
636
|
const group = [
|
625
|
-
|
637
|
+
unfoldInfo.groupId
|
626
638
|
];
|
627
639
|
const color = [
|
628
640
|
foldInfo.measureName
|
@@ -654,13 +666,13 @@ const encodingPolar = (advancedVSeed)=>{
|
|
654
666
|
foldInfo.measureValue
|
655
667
|
];
|
656
668
|
const angle = [
|
657
|
-
unfoldInfo.
|
669
|
+
unfoldInfo.groupId
|
658
670
|
];
|
659
671
|
const group = [
|
660
|
-
unfoldInfo.
|
672
|
+
unfoldInfo.groupId
|
661
673
|
];
|
662
674
|
const color = [
|
663
|
-
unfoldInfo.
|
675
|
+
unfoldInfo.groupId
|
664
676
|
];
|
665
677
|
return [
|
666
678
|
...prev,
|
@@ -1587,14 +1599,15 @@ const tooltip_tooltip = (spec, context)=>{
|
|
1587
1599
|
const baseConfig = advancedVSeed.baseConfig.vchart;
|
1588
1600
|
const { tooltip = defaultTooltip } = baseConfig;
|
1589
1601
|
const { enable } = tooltip;
|
1590
|
-
const { measureId,
|
1602
|
+
const { measureId, measureValue } = datasetReshapeInfo[0].foldInfo;
|
1603
|
+
const { groupName } = datasetReshapeInfo[0].unfoldInfo;
|
1591
1604
|
result.tooltip = {
|
1592
1605
|
visible: enable,
|
1593
1606
|
mark: {
|
1594
1607
|
content: [
|
1595
1608
|
{
|
1596
1609
|
visible: true,
|
1597
|
-
key: (datum)=>datum && datum[
|
1610
|
+
key: (datum)=>datum && datum[groupName] || '',
|
1598
1611
|
value: (datum)=>{
|
1599
1612
|
if (!datum) return '';
|
1600
1613
|
const value = datum[measureValue];
|
@@ -1616,7 +1629,7 @@ const tooltip_tooltip = (spec, context)=>{
|
|
1616
1629
|
content: [
|
1617
1630
|
{
|
1618
1631
|
visible: true,
|
1619
|
-
key: (datum)=>datum && datum[
|
1632
|
+
key: (datum)=>datum && datum[groupName] || '',
|
1620
1633
|
value: (datum)=>{
|
1621
1634
|
if (!datum) return '';
|
1622
1635
|
const value = datum[measureValue];
|
@@ -1645,22 +1658,27 @@ const label_label = (spec, context)=>{
|
|
1645
1658
|
const { measures, datasetReshapeInfo, locale } = advancedVSeed;
|
1646
1659
|
const baseConfig = advancedVSeed.baseConfig.vchart;
|
1647
1660
|
if (!baseConfig || !baseConfig.label) return result;
|
1648
|
-
const { measureId } = datasetReshapeInfo[0].foldInfo;
|
1661
|
+
const { measureId, measureValue } = datasetReshapeInfo[0].foldInfo;
|
1649
1662
|
const { label } = baseConfig;
|
1650
1663
|
const { enable } = label;
|
1651
1664
|
result.label = {
|
1652
1665
|
visible: enable,
|
1653
1666
|
formatMethod: (value, datum)=>{
|
1654
|
-
const
|
1655
|
-
const
|
1656
|
-
|
1657
|
-
|
1658
|
-
|
1659
|
-
const
|
1660
|
-
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1667
|
+
const result = [];
|
1668
|
+
const formatValue = (value)=>{
|
1669
|
+
const id = datum[measureId];
|
1670
|
+
const measure = findMeasureById(measures, id);
|
1671
|
+
if (!measure) return value;
|
1672
|
+
const { format = {}, autoFormat = true } = measure;
|
1673
|
+
if (!isEmpty(format)) {
|
1674
|
+
const formatter = createFormatter(format);
|
1675
|
+
return formatter(value);
|
1676
|
+
}
|
1677
|
+
if (autoFormat) return autoFormatter(value, locale);
|
1678
|
+
return String(value);
|
1679
|
+
};
|
1680
|
+
result.push(formatValue(datum[measureValue]));
|
1681
|
+
return result.join(' ');
|
1664
1682
|
}
|
1665
1683
|
};
|
1666
1684
|
return result;
|
@@ -1670,6 +1688,8 @@ const discreteLegend = (spec, context)=>{
|
|
1670
1688
|
...spec
|
1671
1689
|
};
|
1672
1690
|
const { advancedVSeed } = context;
|
1691
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
1692
|
+
const { unfoldInfo } = datasetReshapeInfo[0];
|
1673
1693
|
const baseConfig = advancedVSeed.baseConfig.vchart;
|
1674
1694
|
if (!baseConfig || !baseConfig.legend) return result;
|
1675
1695
|
const { legend } = baseConfig;
|
@@ -1743,6 +1763,7 @@ const discreteLegend = (spec, context)=>{
|
|
1743
1763
|
}
|
1744
1764
|
},
|
1745
1765
|
label: {
|
1766
|
+
formatMethod: (value)=>unfoldInfo.colorIdMap[String(value)] ?? value,
|
1746
1767
|
style: {
|
1747
1768
|
fontSize: labelFontSize,
|
1748
1769
|
fill: labelFontColor,
|
@@ -1770,6 +1791,10 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
1770
1791
|
if (!baseConfig || !baseConfig.legend) return result;
|
1771
1792
|
const { datasetReshapeInfo } = advancedVSeed;
|
1772
1793
|
const colorItems = unique(datasetReshapeInfo.flatMap((d)=>d.unfoldInfo.colorItems));
|
1794
|
+
const colorIdMap = datasetReshapeInfo.reduce((prev, cur)=>({
|
1795
|
+
...prev,
|
1796
|
+
...cur.unfoldInfo.colorIdMap
|
1797
|
+
}), {});
|
1773
1798
|
const { legend, color } = baseConfig;
|
1774
1799
|
const { colorScheme } = color;
|
1775
1800
|
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight, maxSize, border, shapeType = 'rectRound' } = legend || {};
|
@@ -1844,6 +1869,7 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
1844
1869
|
}
|
1845
1870
|
},
|
1846
1871
|
label: {
|
1872
|
+
formatMethod: (value)=>colorIdMap[String(value)] ?? value,
|
1847
1873
|
style: {
|
1848
1874
|
fontSize: labelFontSize,
|
1849
1875
|
fill: labelFontColor,
|
@@ -1876,11 +1902,19 @@ const color_color = (spec, context)=>{
|
|
1876
1902
|
if (!baseConfig || !baseConfig.color) return result;
|
1877
1903
|
const { color } = baseConfig;
|
1878
1904
|
const { colorScheme, colorMapping } = color;
|
1905
|
+
const mappingList = [];
|
1906
|
+
if (colorMapping) Object.entries(colorMapping).forEach(([key, value])=>{
|
1907
|
+
const idMap = Object.entries(unfoldInfo.colorIdMap).filter(([_, v])=>key === v);
|
1908
|
+
for (const [colorId] of idMap)mappingList.push([
|
1909
|
+
colorId,
|
1910
|
+
value
|
1911
|
+
]);
|
1912
|
+
});
|
1879
1913
|
result.color = {
|
1880
1914
|
type: 'ordinal',
|
1881
1915
|
domain: unfoldInfo.colorItems,
|
1882
1916
|
range: colorScheme,
|
1883
|
-
specified:
|
1917
|
+
specified: Object.fromEntries(mappingList)
|
1884
1918
|
};
|
1885
1919
|
return result;
|
1886
1920
|
};
|
@@ -2361,8 +2395,7 @@ const lineStyle_lineStyle = (spec, context)=>{
|
|
2361
2395
|
},
|
2362
2396
|
style: {
|
2363
2397
|
curveType: curveType,
|
2364
|
-
|
2365
|
-
fillOpacity: lineColorOpacity,
|
2398
|
+
strokeOpacity: lineColorOpacity,
|
2366
2399
|
stroke: lineColor,
|
2367
2400
|
lineWidth: lineWidth,
|
2368
2401
|
lineDash: lineDash
|
@@ -2697,7 +2730,7 @@ const annotationArea_annotationArea = (spec, context)=>{
|
|
2697
2730
|
right: 'insideRight'
|
2698
2731
|
};
|
2699
2732
|
const markArea = annotationAreaList.flatMap((annotationArea)=>{
|
2700
|
-
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#191d24', backgroundPadding =
|
2733
|
+
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#191d24', backgroundPadding = 10, backgroundVisible = true, outerPadding = 4, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor, areaBorderRadius, areaBorderWidth } = annotationArea;
|
2701
2734
|
const dataset = advancedVSeed.dataset.flat();
|
2702
2735
|
const selectedData = dataset.filter((datum)=>selector_selector(datum, selectorPoint));
|
2703
2736
|
return {
|
@@ -4188,6 +4221,8 @@ const zFoldInfo = z.object({
|
|
4188
4221
|
});
|
4189
4222
|
const zUnfoldInfo = z.object({
|
4190
4223
|
colorItems: z.array(z.string()),
|
4224
|
+
groupId: z.string(),
|
4225
|
+
colorIdMap: z.record(z.string(), z.string()),
|
4191
4226
|
groupName: z.string()
|
4192
4227
|
});
|
4193
4228
|
const zDatasetReshapeInfo = z.array(z.object({
|
@@ -4804,6 +4839,235 @@ const zCustomThemeConfig = z.object({
|
|
4804
4839
|
});
|
4805
4840
|
const zCustomTheme = z.record(z.string(), zCustomThemeConfig).optional();
|
4806
4841
|
const zTheme = z.string();
|
4807
|
-
|
4842
|
+
const zLocale = z["enum"]([
|
4843
|
+
'zh-CN',
|
4844
|
+
'en-US'
|
4845
|
+
]).default('zh-CN');
|
4846
|
+
const zBar = z.object({
|
4847
|
+
chartType: z.literal('bar'),
|
4848
|
+
dataset: zDataset.optional(),
|
4849
|
+
dimensions: zDimensions.optional(),
|
4850
|
+
measures: zMeasures.optional(),
|
4851
|
+
backgroundColor: zBackgroundColor.optional(),
|
4852
|
+
color: zColor.optional(),
|
4853
|
+
label: zLabel.optional(),
|
4854
|
+
legend: zLegend.optional(),
|
4855
|
+
tooltip: zTooltip.optional(),
|
4856
|
+
xAxis: zXLinearAxis.optional(),
|
4857
|
+
yAxis: zYBandAxis.optional(),
|
4858
|
+
crosshairRect: zCrosshairRect.optional(),
|
4859
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
4860
|
+
theme: zTheme.optional(),
|
4861
|
+
barStyle: zBarStyle.optional(),
|
4862
|
+
annotationPoint: zAnnotationPoint.optional(),
|
4863
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
4864
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
4865
|
+
annotationArea: zAnnotationArea.optional(),
|
4866
|
+
locale: zLocale.optional()
|
4867
|
+
});
|
4868
|
+
const zBarParallel = z.object({
|
4869
|
+
chartType: z.literal('barParallel'),
|
4870
|
+
dataset: zDataset.optional(),
|
4871
|
+
dimensions: zDimensions.optional(),
|
4872
|
+
measures: zMeasures.optional(),
|
4873
|
+
backgroundColor: zBackgroundColor.optional(),
|
4874
|
+
color: zColor.optional(),
|
4875
|
+
label: zLabel.optional(),
|
4876
|
+
legend: zLegend.optional(),
|
4877
|
+
tooltip: zTooltip.optional(),
|
4878
|
+
xAxis: zXLinearAxis.optional(),
|
4879
|
+
yAxis: zYBandAxis.optional(),
|
4880
|
+
crosshairRect: zCrosshairRect.optional(),
|
4881
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
4882
|
+
theme: zTheme.optional(),
|
4883
|
+
barStyle: zBarStyle.optional(),
|
4884
|
+
annotationPoint: zAnnotationPoint.optional(),
|
4885
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
4886
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
4887
|
+
annotationArea: zAnnotationArea.optional(),
|
4888
|
+
locale: zLocale.optional()
|
4889
|
+
});
|
4890
|
+
const zColumn = z.object({
|
4891
|
+
chartType: z.literal('column'),
|
4892
|
+
dataset: zDataset.optional(),
|
4893
|
+
dimensions: zDimensions.optional(),
|
4894
|
+
measures: zMeasures.optional(),
|
4895
|
+
backgroundColor: zBackgroundColor.optional(),
|
4896
|
+
color: zColor.optional(),
|
4897
|
+
label: zLabel.optional(),
|
4898
|
+
legend: zLegend.optional(),
|
4899
|
+
tooltip: zTooltip.optional(),
|
4900
|
+
xAxis: zXBandAxis.optional(),
|
4901
|
+
yAxis: zYLinearAxis.optional(),
|
4902
|
+
crosshairRect: zCrosshairRect.optional(),
|
4903
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
4904
|
+
theme: zTheme.optional(),
|
4905
|
+
barStyle: zBarStyle.optional(),
|
4906
|
+
annotationPoint: zAnnotationPoint.optional(),
|
4907
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
4908
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
4909
|
+
annotationArea: zAnnotationArea.optional(),
|
4910
|
+
locale: zLocale.optional()
|
4911
|
+
});
|
4912
|
+
const zColumnParallel = z.object({
|
4913
|
+
chartType: z.literal('columnParallel'),
|
4914
|
+
dataset: zDataset.optional(),
|
4915
|
+
dimensions: zDimensions.optional(),
|
4916
|
+
measures: zMeasures.optional(),
|
4917
|
+
backgroundColor: zBackgroundColor.optional(),
|
4918
|
+
color: zColor.optional(),
|
4919
|
+
label: zLabel.optional(),
|
4920
|
+
legend: zLegend.optional(),
|
4921
|
+
tooltip: zTooltip.optional(),
|
4922
|
+
xAxis: zXBandAxis.optional(),
|
4923
|
+
yAxis: zYLinearAxis.optional(),
|
4924
|
+
crosshairRect: zCrosshairRect.optional(),
|
4925
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
4926
|
+
theme: zTheme.optional(),
|
4927
|
+
barStyle: zBarStyle.optional(),
|
4928
|
+
annotationPoint: zAnnotationPoint.optional(),
|
4929
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
4930
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
4931
|
+
annotationArea: zAnnotationArea.optional(),
|
4932
|
+
locale: zLocale.optional()
|
4933
|
+
});
|
4934
|
+
const zColumnPercent = z.object({
|
4935
|
+
chartType: z.literal('columnPercent'),
|
4936
|
+
dataset: zDataset.optional(),
|
4937
|
+
dimensions: zDimensions.optional(),
|
4938
|
+
measures: zMeasures.optional(),
|
4939
|
+
backgroundColor: zBackgroundColor.optional(),
|
4940
|
+
color: zColor.optional(),
|
4941
|
+
label: zLabel.optional(),
|
4942
|
+
legend: zLegend.optional(),
|
4943
|
+
tooltip: zTooltip.optional(),
|
4944
|
+
xAxis: zXBandAxis.optional(),
|
4945
|
+
yAxis: zYLinearAxis.optional(),
|
4946
|
+
crosshairRect: zCrosshairRect.optional(),
|
4947
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
4948
|
+
theme: zTheme.optional(),
|
4949
|
+
barStyle: zBarStyle.optional(),
|
4950
|
+
annotationPoint: zAnnotationPoint.optional(),
|
4951
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
4952
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
4953
|
+
annotationArea: zAnnotationArea.optional(),
|
4954
|
+
locale: zLocale.optional()
|
4955
|
+
});
|
4956
|
+
const zLine = z.object({
|
4957
|
+
chartType: z.literal('line'),
|
4958
|
+
dataset: zDataset.optional(),
|
4959
|
+
dimensions: zDimensions.optional(),
|
4960
|
+
measures: zMeasures.optional(),
|
4961
|
+
backgroundColor: zBackgroundColor.optional(),
|
4962
|
+
color: zColor.optional(),
|
4963
|
+
label: zLabel.optional(),
|
4964
|
+
legend: zLegend.optional(),
|
4965
|
+
tooltip: zTooltip.optional(),
|
4966
|
+
xAxis: zXBandAxis.optional(),
|
4967
|
+
yAxis: zYLinearAxis.optional(),
|
4968
|
+
crosshairLine: zCrosshairLine.optional(),
|
4969
|
+
theme: zTheme.optional(),
|
4970
|
+
pointStyle: zPointStyle.optional(),
|
4971
|
+
lineStyle: zLineStyle.optional(),
|
4972
|
+
annotationPoint: zAnnotationPoint.optional(),
|
4973
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
4974
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
4975
|
+
annotationArea: zAnnotationArea.optional(),
|
4976
|
+
locale: zLocale.optional()
|
4977
|
+
});
|
4978
|
+
const zBarPercent = z.object({
|
4979
|
+
chartType: z.literal('barPercent'),
|
4980
|
+
dataset: zDataset.optional(),
|
4981
|
+
dimensions: zDimensions.optional(),
|
4982
|
+
measures: zMeasures.optional(),
|
4983
|
+
backgroundColor: zBackgroundColor.optional(),
|
4984
|
+
color: zColor.optional(),
|
4985
|
+
label: zLabel.optional(),
|
4986
|
+
legend: zLegend.optional(),
|
4987
|
+
tooltip: zTooltip.optional(),
|
4988
|
+
xAxis: zXLinearAxis.optional(),
|
4989
|
+
yAxis: zYBandAxis.optional(),
|
4990
|
+
crosshairRect: zCrosshairRect.optional(),
|
4991
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
4992
|
+
theme: zTheme.optional(),
|
4993
|
+
barStyle: zBarStyle.optional(),
|
4994
|
+
annotationPoint: zAnnotationPoint.optional(),
|
4995
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
4996
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
4997
|
+
annotationArea: zAnnotationArea.optional(),
|
4998
|
+
locale: zLocale.optional()
|
4999
|
+
});
|
5000
|
+
const zPie = z.object({
|
5001
|
+
chartType: z.literal('pie'),
|
5002
|
+
dataset: zDataset.optional(),
|
5003
|
+
dimensions: zDimensions.optional(),
|
5004
|
+
measures: zMeasures.optional(),
|
5005
|
+
backgroundColor: zBackgroundColor.optional(),
|
5006
|
+
color: zColor.optional(),
|
5007
|
+
label: zLabel.optional(),
|
5008
|
+
legend: zLegend.optional(),
|
5009
|
+
tooltip: zTooltip.optional(),
|
5010
|
+
theme: zTheme.optional(),
|
5011
|
+
locale: zLocale.optional()
|
5012
|
+
});
|
5013
|
+
const zArea = z.object({
|
5014
|
+
chartType: z.literal('area'),
|
5015
|
+
dataset: zDataset.optional(),
|
5016
|
+
dimensions: zDimensions.optional(),
|
5017
|
+
measures: zMeasures.optional(),
|
5018
|
+
backgroundColor: zBackgroundColor.optional(),
|
5019
|
+
color: zColor.optional(),
|
5020
|
+
label: zLabel.optional(),
|
5021
|
+
legend: zLegend.optional(),
|
5022
|
+
tooltip: zTooltip.optional(),
|
5023
|
+
xAxis: zXBandAxis.optional(),
|
5024
|
+
yAxis: zYLinearAxis.optional(),
|
5025
|
+
crosshairLine: zCrosshairLine.optional(),
|
5026
|
+
theme: zTheme.optional(),
|
5027
|
+
pointStyle: zPointStyle.optional(),
|
5028
|
+
lineStyle: zLineStyle.optional(),
|
5029
|
+
areaStyle: zAreaStyle.optional(),
|
5030
|
+
annotationPoint: zAnnotationPoint.optional(),
|
5031
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5032
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5033
|
+
annotationArea: zAnnotationArea.optional(),
|
5034
|
+
locale: zLocale.optional()
|
5035
|
+
});
|
5036
|
+
const zAreaPercent = z.object({
|
5037
|
+
chartType: z.literal('areaPercent'),
|
5038
|
+
dataset: zDataset.optional(),
|
5039
|
+
dimensions: zDimensions.optional(),
|
5040
|
+
measures: zMeasures.optional(),
|
5041
|
+
backgroundColor: zBackgroundColor.optional(),
|
5042
|
+
color: zColor.optional(),
|
5043
|
+
label: zLabel.optional(),
|
5044
|
+
legend: zLegend.optional(),
|
5045
|
+
tooltip: zTooltip.optional(),
|
5046
|
+
xAxis: zXBandAxis.optional(),
|
5047
|
+
yAxis: zYLinearAxis.optional(),
|
5048
|
+
crosshairLine: zCrosshairLine.optional(),
|
5049
|
+
theme: zTheme.optional(),
|
5050
|
+
pointStyle: zPointStyle.optional(),
|
5051
|
+
lineStyle: zLineStyle.optional(),
|
5052
|
+
areaStyle: zAreaStyle.optional(),
|
5053
|
+
annotationPoint: zAnnotationPoint.optional(),
|
5054
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5055
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5056
|
+
annotationArea: zAnnotationArea.optional(),
|
5057
|
+
locale: zLocale.optional()
|
5058
|
+
});
|
5059
|
+
const zVSeed = z.discriminatedUnion('chartType', [
|
5060
|
+
zLine,
|
5061
|
+
zColumn,
|
5062
|
+
zColumnParallel,
|
5063
|
+
zColumnPercent,
|
5064
|
+
zBar,
|
5065
|
+
zBarParallel,
|
5066
|
+
zBarPercent,
|
5067
|
+
zArea,
|
5068
|
+
zAreaPercent,
|
5069
|
+
zPie
|
5070
|
+
]);
|
5071
|
+
export { Builder, FoldMeasureId, FoldMeasureName, FoldMeasureValue, ORIGINAL_DATA, Separator, UnfoldDimensionGroup, UnfoldDimensionGroupId, areaAdvancedPipeline, areaPercentAdvancedPipeline, areaPercentSpecPipeline, areaSpecPipeline, autoFormatter, autoNumFormatter, barAdvancedPipeline, barParallelAdvancedPipeline, barParallelSpecPipeline, barPercentAdvancedPipeline, barPercentSpecPipeline, barSpecPipeline, columnAdvancedPipeline, columnParallelAdvancedPipeline, columnParallelSpecPipeline, columnPercentAdvancedPipeline, columnPercentSpecPipeline, columnSpecPipeline, createFormatter, createNumFormatter, darkTheme, dataReshapeFor1D1M, dataReshapeFor2D1M, execPipeline, findMeasureById, foldMeasures, i18n, intl, isPivotChart, isVChart, isVTable, lightTheme, lineAdvancedPipeline, lineSpecPipeline, pieAdvancedPipeline, pieSpecPipeline, all_registerAll as registerAll, registerArea, registerAreaPercent, registerBar, registerBarParallel, registerBarPercent, registerColumn, registerColumnParallel, registerColumnPercent, registerCustomTheme, registerDarkTheme, registerLightTheme, registerLine, unfoldDimensions, zAnnotation, zAnnotationArea, zAnnotationHorizontalLine, zAnnotationPoint, zAnnotationVerticalLine, zAreaStyle, zAxis, zBackgroundColor, zBarStyle, zBaseConfig, zChartType, zColor, zConfig, zCrosshairLine, zCrosshairRect, zCustomTheme, zCustomThemeConfig, zDataset, zDatasetReshapeInfo, zDatum, zDimension, zDimensions, zEncoding, zFoldInfo, zLabel, zLegend, zLineStyle, zMarkStyle, zMeasure, zMeasureGroup, zMeasures, zNumFormat, zPointStyle, zStackCornerRadius, zTheme, zTooltip, zUnfoldInfo, zVSeed, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
|
4808
5072
|
|
4809
5073
|
//# sourceMappingURL=index.js.map
|