@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
@@ -19,6 +19,8 @@ export declare class Builder implements VSeedBuilder {
|
|
19
19
|
};
|
20
20
|
unfoldInfo: {
|
21
21
|
colorItems: string[];
|
22
|
+
groupId: string;
|
23
|
+
colorIdMap: Record<string, string>;
|
22
24
|
groupName: string;
|
23
25
|
};
|
24
26
|
}[];
|
@@ -5555,6 +5557,8 @@ export declare class Builder implements VSeedBuilder {
|
|
5555
5557
|
};
|
5556
5558
|
unfoldInfo: {
|
5557
5559
|
colorItems: string[];
|
5560
|
+
groupId: string;
|
5561
|
+
colorIdMap: Record<string, string>;
|
5558
5562
|
groupName: string;
|
5559
5563
|
};
|
5560
5564
|
}[];
|
@@ -8355,6 +8359,8 @@ export declare class Builder implements VSeedBuilder {
|
|
8355
8359
|
};
|
8356
8360
|
unfoldInfo: {
|
8357
8361
|
colorItems: string[];
|
8362
|
+
groupId: string;
|
8363
|
+
colorIdMap: Record<string, string>;
|
8358
8364
|
groupName: string;
|
8359
8365
|
};
|
8360
8366
|
}[];
|
@@ -2,5 +2,6 @@ export declare const FoldMeasureName = "__MeaName__";
|
|
2
2
|
export declare const FoldMeasureValue = "__MeaValue__";
|
3
3
|
export declare const FoldMeasureId = "__MeaId__";
|
4
4
|
export declare const UnfoldDimensionGroup = "__DimGroup__";
|
5
|
+
export declare const UnfoldDimensionGroupId = "__DimGroupID__";
|
5
6
|
export declare const Separator = "-";
|
6
7
|
export declare const ORIGINAL_DATA = "__OriginalData__";
|
@@ -11,6 +11,7 @@ export declare const dataReshapeFor1D1M: (dataset: Dataset, dimensions: Dimensio
|
|
11
11
|
foldMeasureName?: string;
|
12
12
|
foldMeasureValue?: string;
|
13
13
|
unfoldDimensionGroup?: string;
|
14
|
+
unfoldDimensionGroupId?: string;
|
14
15
|
}) => {
|
15
16
|
dataset: Dataset;
|
16
17
|
foldInfo: FoldInfo;
|
@@ -11,6 +11,7 @@ export declare const dataReshapeFor2D1M: (dataset: Dataset, dimensions: Dimensio
|
|
11
11
|
foldMeasureName?: string;
|
12
12
|
foldMeasureValue?: string;
|
13
13
|
unfoldDimensionGroup?: string;
|
14
|
+
unfoldDimensionGroupId?: string;
|
14
15
|
}) => {
|
15
16
|
dataset: Dataset;
|
16
17
|
foldInfo: FoldInfo;
|
@@ -5,7 +5,7 @@ import type { UnfoldInfo } from '../types';
|
|
5
5
|
* 展开指定的维度
|
6
6
|
* @description 第一步: 根据指定的维度, 将多个维度展开为N个指标(取决于维值去重后的数量), 随后合并成一个维度.
|
7
7
|
*/
|
8
|
-
export declare const unfoldDimensions: (dataset: Dataset, dimensions: Dimension[], measures: Measure[], unfoldStartIndex?: number,
|
8
|
+
export declare const unfoldDimensions: (dataset: Dataset, dimensions: Dimension[], measures: Measure[], unfoldStartIndex?: number, unfoldGroupName?: string, unfoldGroupId?: string, foldMeasureId?: string, dimensionsSeparator?: string) => {
|
9
9
|
dataset: Dataset;
|
10
10
|
unfoldInfo: UnfoldInfo;
|
11
11
|
};
|
package/dist/index.cjs
CHANGED
@@ -77,9 +77,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
77
77
|
registerArea: ()=>registerArea,
|
78
78
|
findMeasureById: ()=>findMeasureById,
|
79
79
|
zDataset: ()=>zDataset,
|
80
|
+
UnfoldDimensionGroupId: ()=>UnfoldDimensionGroupId,
|
80
81
|
zNumFormat: ()=>zNumFormat,
|
81
82
|
barPercentAdvancedPipeline: ()=>barPercentAdvancedPipeline,
|
82
83
|
areaPercentAdvancedPipeline: ()=>areaPercentAdvancedPipeline,
|
84
|
+
zVSeed: ()=>zVSeed,
|
83
85
|
zBackgroundColor: ()=>zBackgroundColor,
|
84
86
|
registerBarParallel: ()=>registerBarParallel,
|
85
87
|
zMeasure: ()=>zMeasure,
|
@@ -390,30 +392,40 @@ const FoldMeasureName = '__MeaName__';
|
|
390
392
|
const FoldMeasureValue = '__MeaValue__';
|
391
393
|
const FoldMeasureId = '__MeaId__';
|
392
394
|
const UnfoldDimensionGroup = '__DimGroup__';
|
395
|
+
const UnfoldDimensionGroupId = '__DimGroupID__';
|
393
396
|
const Separator = '-';
|
394
397
|
const ORIGINAL_DATA = '__OriginalData__';
|
395
|
-
const unfoldDimensions = (dataset, dimensions, measures, unfoldStartIndex = 0,
|
398
|
+
const unfoldDimensions = (dataset, dimensions, measures, unfoldStartIndex = 0, unfoldGroupName = UnfoldDimensionGroup, unfoldGroupId = UnfoldDimensionGroupId, foldMeasureId = FoldMeasureId, dimensionsSeparator = Separator)=>{
|
396
399
|
if (unfoldStartIndex < 0 || unfoldStartIndex >= dimensions.length) throw new Error('unfoldStartIndex is out of range');
|
397
400
|
const dimensionsToBeUnfolded = dimensions.slice(unfoldStartIndex);
|
398
401
|
const unfoldInfo = {
|
399
|
-
groupName:
|
400
|
-
|
402
|
+
groupName: unfoldGroupName,
|
403
|
+
groupId: unfoldGroupId,
|
404
|
+
colorItems: [],
|
405
|
+
colorIdMap: {}
|
401
406
|
};
|
402
407
|
if (0 === dimensions.length || 0 === measures.length) return {
|
403
408
|
dataset,
|
404
409
|
unfoldInfo: {
|
405
|
-
groupName:
|
406
|
-
|
410
|
+
groupName: unfoldGroupName,
|
411
|
+
groupId: unfoldGroupId,
|
412
|
+
colorItems: [],
|
413
|
+
colorIdMap: {}
|
407
414
|
}
|
408
415
|
};
|
409
416
|
const colorItems = [];
|
417
|
+
const colorMap = {};
|
410
418
|
for(let i = 0; i < dataset.length; i++){
|
411
419
|
const datum = dataset[i];
|
412
|
-
const
|
413
|
-
datum[
|
414
|
-
|
420
|
+
const colorName = generateDimGroupName(dimensionsToBeUnfolded, datum, dimensionsSeparator);
|
421
|
+
const colorId = colorName + (datum[foldMeasureId] || '');
|
422
|
+
datum[unfoldGroupName] = colorName;
|
423
|
+
datum[unfoldGroupId] = colorId;
|
424
|
+
colorItems.push(colorId);
|
425
|
+
colorMap[colorId] = colorName;
|
415
426
|
}
|
416
427
|
unfoldInfo.colorItems = (0, external_remeda_namespaceObject.unique)(colorItems);
|
428
|
+
unfoldInfo.colorIdMap = colorMap;
|
417
429
|
return {
|
418
430
|
dataset,
|
419
431
|
unfoldInfo
|
@@ -439,7 +451,7 @@ const foldMeasures = (dataset, measures, measureId = FoldMeasureId, measureName
|
|
439
451
|
const { id, alias } = measure;
|
440
452
|
datum[id] = dataset[i][id];
|
441
453
|
datum[measureId] = id;
|
442
|
-
datum[measureName] = alias;
|
454
|
+
datum[measureName] = alias || id;
|
443
455
|
datum[measureValue] = dataset[i][id];
|
444
456
|
foldInfo.foldMap[id] = alias;
|
445
457
|
result[index++] = datum;
|
@@ -458,12 +470,14 @@ const emptyReshapeResult = {
|
|
458
470
|
measureValue: ''
|
459
471
|
},
|
460
472
|
unfoldInfo: {
|
473
|
+
groupName: '',
|
474
|
+
groupId: '',
|
461
475
|
colorItems: [],
|
462
|
-
|
476
|
+
colorIdMap: {}
|
463
477
|
}
|
464
478
|
};
|
465
479
|
const dataReshapeFor2D1M = (dataset, dimensions, measures, options)=>{
|
466
|
-
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup } = options || {};
|
480
|
+
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup, unfoldDimensionGroupId = UnfoldDimensionGroupId } = options || {};
|
467
481
|
if (0 === dimensions.length && 0 === measures.length) return emptyReshapeResult;
|
468
482
|
const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, foldMeasureId, foldMeasureName, foldMeasureValue);
|
469
483
|
if (0 === dimensions.length) {
|
@@ -483,7 +497,7 @@ const dataReshapeFor2D1M = (dataset, dimensions, measures, options)=>{
|
|
483
497
|
id: foldMeasureValue,
|
484
498
|
alias: i18n`指标值`
|
485
499
|
}
|
486
|
-
], 1, unfoldDimensionGroup);
|
500
|
+
], 1, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
487
501
|
return {
|
488
502
|
dataset: finalDataset,
|
489
503
|
foldInfo,
|
@@ -503,7 +517,7 @@ const dataReshapeFor2D1M = (dataset, dimensions, measures, options)=>{
|
|
503
517
|
id: foldMeasureValue,
|
504
518
|
alias: i18n`指标值`
|
505
519
|
}
|
506
|
-
], 1, unfoldDimensionGroup);
|
520
|
+
], 1, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
507
521
|
return {
|
508
522
|
dataset: finalDataset,
|
509
523
|
foldInfo,
|
@@ -521,11 +535,13 @@ const dataReshapeFor1D1M_emptyReshapeResult = {
|
|
521
535
|
},
|
522
536
|
unfoldInfo: {
|
523
537
|
groupName: '',
|
524
|
-
|
538
|
+
groupId: '',
|
539
|
+
colorItems: [],
|
540
|
+
colorIdMap: {}
|
525
541
|
}
|
526
542
|
};
|
527
543
|
const dataReshapeFor1D1M = (dataset, dimensions, measures, options)=>{
|
528
|
-
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup } = options || {};
|
544
|
+
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup, unfoldDimensionGroupId = UnfoldDimensionGroupId } = options || {};
|
529
545
|
if (0 === dimensions.length && 0 === measures.length) return dataReshapeFor1D1M_emptyReshapeResult;
|
530
546
|
const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, foldMeasureId, foldMeasureName, foldMeasureValue);
|
531
547
|
if (0 === dimensions.length) {
|
@@ -540,7 +556,7 @@ const dataReshapeFor1D1M = (dataset, dimensions, measures, options)=>{
|
|
540
556
|
id: foldMeasureValue,
|
541
557
|
alias: i18n`指标值`
|
542
558
|
}
|
543
|
-
], 0, unfoldDimensionGroup);
|
559
|
+
], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
544
560
|
return {
|
545
561
|
dataset: finalDataset,
|
546
562
|
foldInfo,
|
@@ -560,7 +576,7 @@ const dataReshapeFor1D1M = (dataset, dimensions, measures, options)=>{
|
|
560
576
|
id: foldMeasureValue,
|
561
577
|
alias: i18n`指标值`
|
562
578
|
}
|
563
|
-
], 0, unfoldDimensionGroup);
|
579
|
+
], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
564
580
|
return {
|
565
581
|
dataset: finalDataset,
|
566
582
|
foldInfo,
|
@@ -700,7 +716,6 @@ const encodingXY = (advancedVSeed)=>{
|
|
700
716
|
if (!datasetReshapeInfo || !dimensions) return result;
|
701
717
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
702
718
|
const { foldInfo, unfoldInfo } = cur;
|
703
|
-
const isSingleDimension = 1 === dimensions.length;
|
704
719
|
const isZeroDimension = 0 === dimensions.length;
|
705
720
|
const x = [
|
706
721
|
isZeroDimension ? foldInfo.measureName : dimensions[0].id
|
@@ -709,7 +724,7 @@ const encodingXY = (advancedVSeed)=>{
|
|
709
724
|
foldInfo.measureValue
|
710
725
|
];
|
711
726
|
const group = [
|
712
|
-
|
727
|
+
unfoldInfo.groupId
|
713
728
|
];
|
714
729
|
const color = [
|
715
730
|
foldInfo.measureName
|
@@ -738,7 +753,6 @@ const encodingYX = (advancedVSeed)=>{
|
|
738
753
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
739
754
|
const { foldInfo, unfoldInfo } = cur;
|
740
755
|
const isZeroDimension = 0 === dimensions.length;
|
741
|
-
const isSingleDimension = 1 === dimensions.length;
|
742
756
|
const y = [
|
743
757
|
isZeroDimension ? foldInfo.measureName : dimensions[0].id
|
744
758
|
];
|
@@ -746,7 +760,7 @@ const encodingYX = (advancedVSeed)=>{
|
|
746
760
|
foldInfo.measureValue
|
747
761
|
];
|
748
762
|
const group = [
|
749
|
-
|
763
|
+
unfoldInfo.groupId
|
750
764
|
];
|
751
765
|
const color = [
|
752
766
|
foldInfo.measureName
|
@@ -778,13 +792,13 @@ const encodingPolar = (advancedVSeed)=>{
|
|
778
792
|
foldInfo.measureValue
|
779
793
|
];
|
780
794
|
const angle = [
|
781
|
-
unfoldInfo.
|
795
|
+
unfoldInfo.groupId
|
782
796
|
];
|
783
797
|
const group = [
|
784
|
-
unfoldInfo.
|
798
|
+
unfoldInfo.groupId
|
785
799
|
];
|
786
800
|
const color = [
|
787
|
-
unfoldInfo.
|
801
|
+
unfoldInfo.groupId
|
788
802
|
];
|
789
803
|
return [
|
790
804
|
...prev,
|
@@ -1711,14 +1725,15 @@ const tooltip_tooltip = (spec, context)=>{
|
|
1711
1725
|
const baseConfig = advancedVSeed.baseConfig.vchart;
|
1712
1726
|
const { tooltip = defaultTooltip } = baseConfig;
|
1713
1727
|
const { enable } = tooltip;
|
1714
|
-
const { measureId,
|
1728
|
+
const { measureId, measureValue } = datasetReshapeInfo[0].foldInfo;
|
1729
|
+
const { groupName } = datasetReshapeInfo[0].unfoldInfo;
|
1715
1730
|
result.tooltip = {
|
1716
1731
|
visible: enable,
|
1717
1732
|
mark: {
|
1718
1733
|
content: [
|
1719
1734
|
{
|
1720
1735
|
visible: true,
|
1721
|
-
key: (datum)=>datum && datum[
|
1736
|
+
key: (datum)=>datum && datum[groupName] || '',
|
1722
1737
|
value: (datum)=>{
|
1723
1738
|
if (!datum) return '';
|
1724
1739
|
const value = datum[measureValue];
|
@@ -1740,7 +1755,7 @@ const tooltip_tooltip = (spec, context)=>{
|
|
1740
1755
|
content: [
|
1741
1756
|
{
|
1742
1757
|
visible: true,
|
1743
|
-
key: (datum)=>datum && datum[
|
1758
|
+
key: (datum)=>datum && datum[groupName] || '',
|
1744
1759
|
value: (datum)=>{
|
1745
1760
|
if (!datum) return '';
|
1746
1761
|
const value = datum[measureValue];
|
@@ -1769,22 +1784,27 @@ const label_label = (spec, context)=>{
|
|
1769
1784
|
const { measures, datasetReshapeInfo, locale } = advancedVSeed;
|
1770
1785
|
const baseConfig = advancedVSeed.baseConfig.vchart;
|
1771
1786
|
if (!baseConfig || !baseConfig.label) return result;
|
1772
|
-
const { measureId } = datasetReshapeInfo[0].foldInfo;
|
1787
|
+
const { measureId, measureValue } = datasetReshapeInfo[0].foldInfo;
|
1773
1788
|
const { label } = baseConfig;
|
1774
1789
|
const { enable } = label;
|
1775
1790
|
result.label = {
|
1776
1791
|
visible: enable,
|
1777
1792
|
formatMethod: (value, datum)=>{
|
1778
|
-
const
|
1779
|
-
const
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1783
|
-
const
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1787
|
-
|
1793
|
+
const result = [];
|
1794
|
+
const formatValue = (value)=>{
|
1795
|
+
const id = datum[measureId];
|
1796
|
+
const measure = findMeasureById(measures, id);
|
1797
|
+
if (!measure) return value;
|
1798
|
+
const { format = {}, autoFormat = true } = measure;
|
1799
|
+
if (!(0, external_remeda_namespaceObject.isEmpty)(format)) {
|
1800
|
+
const formatter = createFormatter(format);
|
1801
|
+
return formatter(value);
|
1802
|
+
}
|
1803
|
+
if (autoFormat) return autoFormatter(value, locale);
|
1804
|
+
return String(value);
|
1805
|
+
};
|
1806
|
+
result.push(formatValue(datum[measureValue]));
|
1807
|
+
return result.join(' ');
|
1788
1808
|
}
|
1789
1809
|
};
|
1790
1810
|
return result;
|
@@ -1794,6 +1814,8 @@ const discreteLegend = (spec, context)=>{
|
|
1794
1814
|
...spec
|
1795
1815
|
};
|
1796
1816
|
const { advancedVSeed } = context;
|
1817
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
1818
|
+
const { unfoldInfo } = datasetReshapeInfo[0];
|
1797
1819
|
const baseConfig = advancedVSeed.baseConfig.vchart;
|
1798
1820
|
if (!baseConfig || !baseConfig.legend) return result;
|
1799
1821
|
const { legend } = baseConfig;
|
@@ -1867,6 +1889,7 @@ const discreteLegend = (spec, context)=>{
|
|
1867
1889
|
}
|
1868
1890
|
},
|
1869
1891
|
label: {
|
1892
|
+
formatMethod: (value)=>unfoldInfo.colorIdMap[String(value)] ?? value,
|
1870
1893
|
style: {
|
1871
1894
|
fontSize: labelFontSize,
|
1872
1895
|
fill: labelFontColor,
|
@@ -1894,6 +1917,10 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
1894
1917
|
if (!baseConfig || !baseConfig.legend) return result;
|
1895
1918
|
const { datasetReshapeInfo } = advancedVSeed;
|
1896
1919
|
const colorItems = (0, external_remeda_namespaceObject.unique)(datasetReshapeInfo.flatMap((d)=>d.unfoldInfo.colorItems));
|
1920
|
+
const colorIdMap = datasetReshapeInfo.reduce((prev, cur)=>({
|
1921
|
+
...prev,
|
1922
|
+
...cur.unfoldInfo.colorIdMap
|
1923
|
+
}), {});
|
1897
1924
|
const { legend, color } = baseConfig;
|
1898
1925
|
const { colorScheme } = color;
|
1899
1926
|
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight, maxSize, border, shapeType = 'rectRound' } = legend || {};
|
@@ -1968,6 +1995,7 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
1968
1995
|
}
|
1969
1996
|
},
|
1970
1997
|
label: {
|
1998
|
+
formatMethod: (value)=>colorIdMap[String(value)] ?? value,
|
1971
1999
|
style: {
|
1972
2000
|
fontSize: labelFontSize,
|
1973
2001
|
fill: labelFontColor,
|
@@ -2000,11 +2028,19 @@ const color_color = (spec, context)=>{
|
|
2000
2028
|
if (!baseConfig || !baseConfig.color) return result;
|
2001
2029
|
const { color } = baseConfig;
|
2002
2030
|
const { colorScheme, colorMapping } = color;
|
2031
|
+
const mappingList = [];
|
2032
|
+
if (colorMapping) Object.entries(colorMapping).forEach(([key, value])=>{
|
2033
|
+
const idMap = Object.entries(unfoldInfo.colorIdMap).filter(([_, v])=>key === v);
|
2034
|
+
for (const [colorId] of idMap)mappingList.push([
|
2035
|
+
colorId,
|
2036
|
+
value
|
2037
|
+
]);
|
2038
|
+
});
|
2003
2039
|
result.color = {
|
2004
2040
|
type: 'ordinal',
|
2005
2041
|
domain: unfoldInfo.colorItems,
|
2006
2042
|
range: colorScheme,
|
2007
|
-
specified:
|
2043
|
+
specified: Object.fromEntries(mappingList)
|
2008
2044
|
};
|
2009
2045
|
return result;
|
2010
2046
|
};
|
@@ -2485,8 +2521,7 @@ const lineStyle_lineStyle = (spec, context)=>{
|
|
2485
2521
|
},
|
2486
2522
|
style: {
|
2487
2523
|
curveType: curveType,
|
2488
|
-
|
2489
|
-
fillOpacity: lineColorOpacity,
|
2524
|
+
strokeOpacity: lineColorOpacity,
|
2490
2525
|
stroke: lineColor,
|
2491
2526
|
lineWidth: lineWidth,
|
2492
2527
|
lineDash: lineDash
|
@@ -2821,7 +2856,7 @@ const annotationArea_annotationArea = (spec, context)=>{
|
|
2821
2856
|
right: 'insideRight'
|
2822
2857
|
};
|
2823
2858
|
const markArea = annotationAreaList.flatMap((annotationArea)=>{
|
2824
|
-
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#191d24', backgroundPadding =
|
2859
|
+
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;
|
2825
2860
|
const dataset = advancedVSeed.dataset.flat();
|
2826
2861
|
const selectedData = dataset.filter((datum)=>selector_selector(datum, selectorPoint));
|
2827
2862
|
return {
|
@@ -4313,6 +4348,8 @@ const zFoldInfo = external_zod_namespaceObject.z.object({
|
|
4313
4348
|
});
|
4314
4349
|
const zUnfoldInfo = external_zod_namespaceObject.z.object({
|
4315
4350
|
colorItems: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()),
|
4351
|
+
groupId: external_zod_namespaceObject.z.string(),
|
4352
|
+
colorIdMap: external_zod_namespaceObject.z.record(external_zod_namespaceObject.z.string(), external_zod_namespaceObject.z.string()),
|
4316
4353
|
groupName: external_zod_namespaceObject.z.string()
|
4317
4354
|
});
|
4318
4355
|
const zDatasetReshapeInfo = external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.object({
|
@@ -4929,6 +4966,235 @@ const zCustomThemeConfig = external_zod_namespaceObject.z.object({
|
|
4929
4966
|
});
|
4930
4967
|
const zCustomTheme = external_zod_namespaceObject.z.record(external_zod_namespaceObject.z.string(), zCustomThemeConfig).optional();
|
4931
4968
|
const zTheme = external_zod_namespaceObject.z.string();
|
4969
|
+
const zLocale = external_zod_namespaceObject.z["enum"]([
|
4970
|
+
'zh-CN',
|
4971
|
+
'en-US'
|
4972
|
+
]).default('zh-CN');
|
4973
|
+
const zBar = external_zod_namespaceObject.z.object({
|
4974
|
+
chartType: external_zod_namespaceObject.z.literal('bar'),
|
4975
|
+
dataset: zDataset.optional(),
|
4976
|
+
dimensions: zDimensions.optional(),
|
4977
|
+
measures: zMeasures.optional(),
|
4978
|
+
backgroundColor: zBackgroundColor.optional(),
|
4979
|
+
color: zColor.optional(),
|
4980
|
+
label: zLabel.optional(),
|
4981
|
+
legend: zLegend.optional(),
|
4982
|
+
tooltip: zTooltip.optional(),
|
4983
|
+
xAxis: zXLinearAxis.optional(),
|
4984
|
+
yAxis: zYBandAxis.optional(),
|
4985
|
+
crosshairRect: zCrosshairRect.optional(),
|
4986
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
4987
|
+
theme: zTheme.optional(),
|
4988
|
+
barStyle: zBarStyle.optional(),
|
4989
|
+
annotationPoint: zAnnotationPoint.optional(),
|
4990
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
4991
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
4992
|
+
annotationArea: zAnnotationArea.optional(),
|
4993
|
+
locale: zLocale.optional()
|
4994
|
+
});
|
4995
|
+
const zBarParallel = external_zod_namespaceObject.z.object({
|
4996
|
+
chartType: external_zod_namespaceObject.z.literal('barParallel'),
|
4997
|
+
dataset: zDataset.optional(),
|
4998
|
+
dimensions: zDimensions.optional(),
|
4999
|
+
measures: zMeasures.optional(),
|
5000
|
+
backgroundColor: zBackgroundColor.optional(),
|
5001
|
+
color: zColor.optional(),
|
5002
|
+
label: zLabel.optional(),
|
5003
|
+
legend: zLegend.optional(),
|
5004
|
+
tooltip: zTooltip.optional(),
|
5005
|
+
xAxis: zXLinearAxis.optional(),
|
5006
|
+
yAxis: zYBandAxis.optional(),
|
5007
|
+
crosshairRect: zCrosshairRect.optional(),
|
5008
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
5009
|
+
theme: zTheme.optional(),
|
5010
|
+
barStyle: zBarStyle.optional(),
|
5011
|
+
annotationPoint: zAnnotationPoint.optional(),
|
5012
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5013
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5014
|
+
annotationArea: zAnnotationArea.optional(),
|
5015
|
+
locale: zLocale.optional()
|
5016
|
+
});
|
5017
|
+
const zColumn = external_zod_namespaceObject.z.object({
|
5018
|
+
chartType: external_zod_namespaceObject.z.literal('column'),
|
5019
|
+
dataset: zDataset.optional(),
|
5020
|
+
dimensions: zDimensions.optional(),
|
5021
|
+
measures: zMeasures.optional(),
|
5022
|
+
backgroundColor: zBackgroundColor.optional(),
|
5023
|
+
color: zColor.optional(),
|
5024
|
+
label: zLabel.optional(),
|
5025
|
+
legend: zLegend.optional(),
|
5026
|
+
tooltip: zTooltip.optional(),
|
5027
|
+
xAxis: zXBandAxis.optional(),
|
5028
|
+
yAxis: zYLinearAxis.optional(),
|
5029
|
+
crosshairRect: zCrosshairRect.optional(),
|
5030
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
5031
|
+
theme: zTheme.optional(),
|
5032
|
+
barStyle: zBarStyle.optional(),
|
5033
|
+
annotationPoint: zAnnotationPoint.optional(),
|
5034
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5035
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5036
|
+
annotationArea: zAnnotationArea.optional(),
|
5037
|
+
locale: zLocale.optional()
|
5038
|
+
});
|
5039
|
+
const zColumnParallel = external_zod_namespaceObject.z.object({
|
5040
|
+
chartType: external_zod_namespaceObject.z.literal('columnParallel'),
|
5041
|
+
dataset: zDataset.optional(),
|
5042
|
+
dimensions: zDimensions.optional(),
|
5043
|
+
measures: zMeasures.optional(),
|
5044
|
+
backgroundColor: zBackgroundColor.optional(),
|
5045
|
+
color: zColor.optional(),
|
5046
|
+
label: zLabel.optional(),
|
5047
|
+
legend: zLegend.optional(),
|
5048
|
+
tooltip: zTooltip.optional(),
|
5049
|
+
xAxis: zXBandAxis.optional(),
|
5050
|
+
yAxis: zYLinearAxis.optional(),
|
5051
|
+
crosshairRect: zCrosshairRect.optional(),
|
5052
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
5053
|
+
theme: zTheme.optional(),
|
5054
|
+
barStyle: zBarStyle.optional(),
|
5055
|
+
annotationPoint: zAnnotationPoint.optional(),
|
5056
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5057
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5058
|
+
annotationArea: zAnnotationArea.optional(),
|
5059
|
+
locale: zLocale.optional()
|
5060
|
+
});
|
5061
|
+
const zColumnPercent = external_zod_namespaceObject.z.object({
|
5062
|
+
chartType: external_zod_namespaceObject.z.literal('columnPercent'),
|
5063
|
+
dataset: zDataset.optional(),
|
5064
|
+
dimensions: zDimensions.optional(),
|
5065
|
+
measures: zMeasures.optional(),
|
5066
|
+
backgroundColor: zBackgroundColor.optional(),
|
5067
|
+
color: zColor.optional(),
|
5068
|
+
label: zLabel.optional(),
|
5069
|
+
legend: zLegend.optional(),
|
5070
|
+
tooltip: zTooltip.optional(),
|
5071
|
+
xAxis: zXBandAxis.optional(),
|
5072
|
+
yAxis: zYLinearAxis.optional(),
|
5073
|
+
crosshairRect: zCrosshairRect.optional(),
|
5074
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
5075
|
+
theme: zTheme.optional(),
|
5076
|
+
barStyle: zBarStyle.optional(),
|
5077
|
+
annotationPoint: zAnnotationPoint.optional(),
|
5078
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5079
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5080
|
+
annotationArea: zAnnotationArea.optional(),
|
5081
|
+
locale: zLocale.optional()
|
5082
|
+
});
|
5083
|
+
const zLine = external_zod_namespaceObject.z.object({
|
5084
|
+
chartType: external_zod_namespaceObject.z.literal('line'),
|
5085
|
+
dataset: zDataset.optional(),
|
5086
|
+
dimensions: zDimensions.optional(),
|
5087
|
+
measures: zMeasures.optional(),
|
5088
|
+
backgroundColor: zBackgroundColor.optional(),
|
5089
|
+
color: zColor.optional(),
|
5090
|
+
label: zLabel.optional(),
|
5091
|
+
legend: zLegend.optional(),
|
5092
|
+
tooltip: zTooltip.optional(),
|
5093
|
+
xAxis: zXBandAxis.optional(),
|
5094
|
+
yAxis: zYLinearAxis.optional(),
|
5095
|
+
crosshairLine: zCrosshairLine.optional(),
|
5096
|
+
theme: zTheme.optional(),
|
5097
|
+
pointStyle: zPointStyle.optional(),
|
5098
|
+
lineStyle: zLineStyle.optional(),
|
5099
|
+
annotationPoint: zAnnotationPoint.optional(),
|
5100
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5101
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5102
|
+
annotationArea: zAnnotationArea.optional(),
|
5103
|
+
locale: zLocale.optional()
|
5104
|
+
});
|
5105
|
+
const zBarPercent = external_zod_namespaceObject.z.object({
|
5106
|
+
chartType: external_zod_namespaceObject.z.literal('barPercent'),
|
5107
|
+
dataset: zDataset.optional(),
|
5108
|
+
dimensions: zDimensions.optional(),
|
5109
|
+
measures: zMeasures.optional(),
|
5110
|
+
backgroundColor: zBackgroundColor.optional(),
|
5111
|
+
color: zColor.optional(),
|
5112
|
+
label: zLabel.optional(),
|
5113
|
+
legend: zLegend.optional(),
|
5114
|
+
tooltip: zTooltip.optional(),
|
5115
|
+
xAxis: zXLinearAxis.optional(),
|
5116
|
+
yAxis: zYBandAxis.optional(),
|
5117
|
+
crosshairRect: zCrosshairRect.optional(),
|
5118
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
5119
|
+
theme: zTheme.optional(),
|
5120
|
+
barStyle: zBarStyle.optional(),
|
5121
|
+
annotationPoint: zAnnotationPoint.optional(),
|
5122
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5123
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5124
|
+
annotationArea: zAnnotationArea.optional(),
|
5125
|
+
locale: zLocale.optional()
|
5126
|
+
});
|
5127
|
+
const zPie = external_zod_namespaceObject.z.object({
|
5128
|
+
chartType: external_zod_namespaceObject.z.literal('pie'),
|
5129
|
+
dataset: zDataset.optional(),
|
5130
|
+
dimensions: zDimensions.optional(),
|
5131
|
+
measures: zMeasures.optional(),
|
5132
|
+
backgroundColor: zBackgroundColor.optional(),
|
5133
|
+
color: zColor.optional(),
|
5134
|
+
label: zLabel.optional(),
|
5135
|
+
legend: zLegend.optional(),
|
5136
|
+
tooltip: zTooltip.optional(),
|
5137
|
+
theme: zTheme.optional(),
|
5138
|
+
locale: zLocale.optional()
|
5139
|
+
});
|
5140
|
+
const zArea = external_zod_namespaceObject.z.object({
|
5141
|
+
chartType: external_zod_namespaceObject.z.literal('area'),
|
5142
|
+
dataset: zDataset.optional(),
|
5143
|
+
dimensions: zDimensions.optional(),
|
5144
|
+
measures: zMeasures.optional(),
|
5145
|
+
backgroundColor: zBackgroundColor.optional(),
|
5146
|
+
color: zColor.optional(),
|
5147
|
+
label: zLabel.optional(),
|
5148
|
+
legend: zLegend.optional(),
|
5149
|
+
tooltip: zTooltip.optional(),
|
5150
|
+
xAxis: zXBandAxis.optional(),
|
5151
|
+
yAxis: zYLinearAxis.optional(),
|
5152
|
+
crosshairLine: zCrosshairLine.optional(),
|
5153
|
+
theme: zTheme.optional(),
|
5154
|
+
pointStyle: zPointStyle.optional(),
|
5155
|
+
lineStyle: zLineStyle.optional(),
|
5156
|
+
areaStyle: zAreaStyle.optional(),
|
5157
|
+
annotationPoint: zAnnotationPoint.optional(),
|
5158
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5159
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5160
|
+
annotationArea: zAnnotationArea.optional(),
|
5161
|
+
locale: zLocale.optional()
|
5162
|
+
});
|
5163
|
+
const zAreaPercent = external_zod_namespaceObject.z.object({
|
5164
|
+
chartType: external_zod_namespaceObject.z.literal('areaPercent'),
|
5165
|
+
dataset: zDataset.optional(),
|
5166
|
+
dimensions: zDimensions.optional(),
|
5167
|
+
measures: zMeasures.optional(),
|
5168
|
+
backgroundColor: zBackgroundColor.optional(),
|
5169
|
+
color: zColor.optional(),
|
5170
|
+
label: zLabel.optional(),
|
5171
|
+
legend: zLegend.optional(),
|
5172
|
+
tooltip: zTooltip.optional(),
|
5173
|
+
xAxis: zXBandAxis.optional(),
|
5174
|
+
yAxis: zYLinearAxis.optional(),
|
5175
|
+
crosshairLine: zCrosshairLine.optional(),
|
5176
|
+
theme: zTheme.optional(),
|
5177
|
+
pointStyle: zPointStyle.optional(),
|
5178
|
+
lineStyle: zLineStyle.optional(),
|
5179
|
+
areaStyle: zAreaStyle.optional(),
|
5180
|
+
annotationPoint: zAnnotationPoint.optional(),
|
5181
|
+
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5182
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5183
|
+
annotationArea: zAnnotationArea.optional(),
|
5184
|
+
locale: zLocale.optional()
|
5185
|
+
});
|
5186
|
+
const zVSeed = external_zod_namespaceObject.z.discriminatedUnion('chartType', [
|
5187
|
+
zLine,
|
5188
|
+
zColumn,
|
5189
|
+
zColumnParallel,
|
5190
|
+
zColumnPercent,
|
5191
|
+
zBar,
|
5192
|
+
zBarParallel,
|
5193
|
+
zBarPercent,
|
5194
|
+
zArea,
|
5195
|
+
zAreaPercent,
|
5196
|
+
zPie
|
5197
|
+
]);
|
4932
5198
|
exports.Builder = __webpack_exports__.Builder;
|
4933
5199
|
exports.FoldMeasureId = __webpack_exports__.FoldMeasureId;
|
4934
5200
|
exports.FoldMeasureName = __webpack_exports__.FoldMeasureName;
|
@@ -4936,6 +5202,7 @@ exports.FoldMeasureValue = __webpack_exports__.FoldMeasureValue;
|
|
4936
5202
|
exports.ORIGINAL_DATA = __webpack_exports__.ORIGINAL_DATA;
|
4937
5203
|
exports.Separator = __webpack_exports__.Separator;
|
4938
5204
|
exports.UnfoldDimensionGroup = __webpack_exports__.UnfoldDimensionGroup;
|
5205
|
+
exports.UnfoldDimensionGroupId = __webpack_exports__.UnfoldDimensionGroupId;
|
4939
5206
|
exports.areaAdvancedPipeline = __webpack_exports__.areaAdvancedPipeline;
|
4940
5207
|
exports.areaPercentAdvancedPipeline = __webpack_exports__.areaPercentAdvancedPipeline;
|
4941
5208
|
exports.areaPercentSpecPipeline = __webpack_exports__.areaPercentSpecPipeline;
|
@@ -5023,6 +5290,7 @@ exports.zStackCornerRadius = __webpack_exports__.zStackCornerRadius;
|
|
5023
5290
|
exports.zTheme = __webpack_exports__.zTheme;
|
5024
5291
|
exports.zTooltip = __webpack_exports__.zTooltip;
|
5025
5292
|
exports.zUnfoldInfo = __webpack_exports__.zUnfoldInfo;
|
5293
|
+
exports.zVSeed = __webpack_exports__.zVSeed;
|
5026
5294
|
exports.zXBandAxis = __webpack_exports__.zXBandAxis;
|
5027
5295
|
exports.zXLinearAxis = __webpack_exports__.zXLinearAxis;
|
5028
5296
|
exports.zYBandAxis = __webpack_exports__.zYBandAxis;
|
@@ -5035,6 +5303,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
5035
5303
|
"ORIGINAL_DATA",
|
5036
5304
|
"Separator",
|
5037
5305
|
"UnfoldDimensionGroup",
|
5306
|
+
"UnfoldDimensionGroupId",
|
5038
5307
|
"areaAdvancedPipeline",
|
5039
5308
|
"areaPercentAdvancedPipeline",
|
5040
5309
|
"areaPercentSpecPipeline",
|
@@ -5122,6 +5391,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
5122
5391
|
"zTheme",
|
5123
5392
|
"zTooltip",
|
5124
5393
|
"zUnfoldInfo",
|
5394
|
+
"zVSeed",
|
5125
5395
|
"zXBandAxis",
|
5126
5396
|
"zXLinearAxis",
|
5127
5397
|
"zYBandAxis",
|