@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.
- package/dist/builder/builder/builder.d.ts +939 -65
- package/dist/builder/register/chartType.d.ts +1 -0
- package/dist/builder/register/custom.d.ts +3 -0
- package/dist/builder/register/index.d.ts +1 -0
- package/dist/dataReshape/dataReshapeFor1D.d.ts +19 -0
- package/dist/dataReshape/index.d.ts +1 -0
- package/dist/index.cjs +500 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +470 -8
- package/dist/index.js.map +1 -1
- package/dist/pipeline/advanced/chart/pipeline/areaRange.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipeline/index.d.ts +1 -0
- package/dist/pipeline/advanced/chart/pipes/encoding/encodingXYY.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipes/encoding/index.d.ts +1 -0
- package/dist/pipeline/advanced/chart/pipes/init/autoMeasuresBy2M1Group.d.ts +8 -0
- package/dist/pipeline/advanced/chart/pipes/init/index.d.ts +1 -0
- package/dist/pipeline/advanced/chart/pipes/reshape/index.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipes/reshape/pivotReshapeTo1D.d.ts +8 -0
- package/dist/pipeline/advanced/chart/pipes/reshape/reshapeTo1D.d.ts +8 -0
- package/dist/pipeline/spec/chart/pipeline/areaRange.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipeline/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/init/areaRange.d.ts +4 -0
- package/dist/pipeline/spec/chart/pipes/init/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/series/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/series/series.d.ts +2 -0
- package/dist/types/advancedVSeed.d.ts +307 -0
- package/dist/types/chartType/areaRange/areaRange.d.ts +1337 -0
- package/dist/types/chartType/areaRange/index.d.ts +1 -0
- package/dist/types/chartType/index.d.ts +1 -0
- package/dist/types/properties/chartType/chartType.d.ts +3 -1
- package/dist/types/properties/config/config.d.ts +307 -0
- package/dist/types/properties/theme/customTheme.d.ts +306 -0
- package/dist/types/vseed.d.ts +1190 -1
- package/dist/umd/index.js +484 -14
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -299,6 +299,51 @@ const autoDimensions = (advancedVSeed, context)=>{
|
|
299
299
|
}));
|
300
300
|
return result;
|
301
301
|
};
|
302
|
+
const autoMeasuresBy2M1Group = (advancedVSeed, context)=>{
|
303
|
+
const result = {
|
304
|
+
...advancedVSeed
|
305
|
+
};
|
306
|
+
const { vseed } = context;
|
307
|
+
const { measures, dataset } = vseed;
|
308
|
+
if (!dataset) throw new Error('dataset is required');
|
309
|
+
if (0 === dataset.length) return result;
|
310
|
+
if (measures) {
|
311
|
+
result.measures = auto2M1Group(measures);
|
312
|
+
return result;
|
313
|
+
}
|
314
|
+
const top100dataset = dataset.slice(0, 100);
|
315
|
+
const sample = top100dataset.reduce((prev, cur)=>({
|
316
|
+
...prev,
|
317
|
+
...cur
|
318
|
+
}), {});
|
319
|
+
const newMeasures = Object.keys(sample).filter((key)=>top100dataset.some((item)=>'number' == typeof item[key]) && ![
|
320
|
+
'',
|
321
|
+
null,
|
322
|
+
void 0
|
323
|
+
].includes(key)).map((measure)=>({
|
324
|
+
id: measure,
|
325
|
+
alias: measure
|
326
|
+
}));
|
327
|
+
result.measures = auto2M1Group(newMeasures);
|
328
|
+
return result;
|
329
|
+
};
|
330
|
+
const auto2M1Group = (measures)=>{
|
331
|
+
const allMeasures = findAllMeasures(measures);
|
332
|
+
if (allMeasures.length <= 2) return allMeasures;
|
333
|
+
const groups = measures.filter((measure)=>'children' in measure);
|
334
|
+
const singleMeasures = measures.filter((measure)=>!('children' in measure));
|
335
|
+
for(let i = 0; i < singleMeasures.length; i += 2){
|
336
|
+
const group = autoMeasuresBy2M1Group_createEmptyMeasureGroup();
|
337
|
+
group.children = allMeasures.slice(i, i + 2);
|
338
|
+
groups.push(group);
|
339
|
+
}
|
340
|
+
return groups;
|
341
|
+
};
|
342
|
+
const autoMeasuresBy2M1Group_createEmptyMeasureGroup = ()=>({
|
343
|
+
id: '',
|
344
|
+
alias: '',
|
345
|
+
children: []
|
346
|
+
});
|
302
347
|
const FoldMeasureName = '__MeaName__';
|
303
348
|
const FoldMeasureValue = '__MeaValue__';
|
304
349
|
const FoldMeasureId = '__MeaId__';
|
@@ -329,10 +374,10 @@ const unfoldDimensions = (dataset, dimensions, measures, unfoldStartIndex = 0, u
|
|
329
374
|
for(let i = 0; i < dataset.length; i++){
|
330
375
|
const datum = dataset[i];
|
331
376
|
const colorName = generateDimGroupName(dimensionsToBeUnfolded, datum, dimensionsSeparator);
|
332
|
-
const colorId = [
|
377
|
+
const colorId = datum[foldMeasureId] ? [
|
333
378
|
colorName,
|
334
|
-
datum[foldMeasureId]
|
335
|
-
].join(dimensionsSeparator);
|
379
|
+
datum[foldMeasureId]
|
380
|
+
].join(dimensionsSeparator) : colorName;
|
336
381
|
datum[unfoldGroupName] = colorName;
|
337
382
|
datum[unfoldGroupId] = colorId;
|
338
383
|
colorItems.push(colorId);
|
@@ -558,6 +603,58 @@ const dataReshapeFor1D2M = (dataset, dimensions, measures, options)=>{
|
|
558
603
|
};
|
559
604
|
}
|
560
605
|
};
|
606
|
+
const dataReshapeFor1D_emptyReshapeResult = {
|
607
|
+
dataset: [],
|
608
|
+
foldInfo: {
|
609
|
+
foldMap: {},
|
610
|
+
measureId: '',
|
611
|
+
measureName: '',
|
612
|
+
measureValue: ''
|
613
|
+
},
|
614
|
+
unfoldInfo: {
|
615
|
+
groupName: '',
|
616
|
+
groupId: '',
|
617
|
+
colorItems: [],
|
618
|
+
colorIdMap: {}
|
619
|
+
}
|
620
|
+
};
|
621
|
+
const dataReshapeFor1D = (dataset, dimensions, measures, options)=>{
|
622
|
+
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup, unfoldDimensionGroupId = UnfoldDimensionGroupId } = options || {};
|
623
|
+
if (0 === dimensions.length && 0 === measures.length) return dataReshapeFor1D_emptyReshapeResult;
|
624
|
+
if (0 === dimensions.length) {
|
625
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(dataset, [], [], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
626
|
+
return {
|
627
|
+
dataset: finalDataset,
|
628
|
+
foldInfo: {
|
629
|
+
foldMap: {},
|
630
|
+
measureId: foldMeasureId,
|
631
|
+
measureName: foldMeasureName,
|
632
|
+
measureValue: foldMeasureValue
|
633
|
+
},
|
634
|
+
unfoldInfo
|
635
|
+
};
|
636
|
+
}
|
637
|
+
{
|
638
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(dataset, [
|
639
|
+
...dimensions
|
640
|
+
], [
|
641
|
+
{
|
642
|
+
id: foldMeasureValue,
|
643
|
+
alias: i18n`指标值`
|
644
|
+
}
|
645
|
+
], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
646
|
+
return {
|
647
|
+
dataset: finalDataset,
|
648
|
+
foldInfo: {
|
649
|
+
foldMap: {},
|
650
|
+
measureId: foldMeasureId,
|
651
|
+
measureName: foldMeasureName,
|
652
|
+
measureValue: foldMeasureValue
|
653
|
+
},
|
654
|
+
unfoldInfo
|
655
|
+
};
|
656
|
+
}
|
657
|
+
};
|
561
658
|
const reshapeTo2D1M = (advancedVSeed, context)=>{
|
562
659
|
const result = {
|
563
660
|
...advancedVSeed
|
@@ -626,6 +723,28 @@ const reshapeTo1D2M = (advancedVSeed, context)=>{
|
|
626
723
|
]
|
627
724
|
};
|
628
725
|
};
|
726
|
+
const reshapeTo1D = (advancedVSeed, context)=>{
|
727
|
+
const result = {
|
728
|
+
...advancedVSeed
|
729
|
+
};
|
730
|
+
const { vseed } = context;
|
731
|
+
const { dataset } = vseed;
|
732
|
+
const { dimensions, measures } = advancedVSeed;
|
733
|
+
if (!measures || !dimensions || !dataset) return result;
|
734
|
+
if (0 === measures.length) throw new Error('measures can not be empty');
|
735
|
+
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeFor1D(dataset, dimensions, measures);
|
736
|
+
return {
|
737
|
+
...result,
|
738
|
+
dataset: newDatasets,
|
739
|
+
datasetReshapeInfo: [
|
740
|
+
{
|
741
|
+
id: '1D2M',
|
742
|
+
foldInfo,
|
743
|
+
unfoldInfo
|
744
|
+
}
|
745
|
+
]
|
746
|
+
};
|
747
|
+
};
|
629
748
|
const pivotReshapeTo1D1M = (advancedVSeed, context)=>{
|
630
749
|
const result = {
|
631
750
|
...advancedVSeed
|
@@ -746,6 +865,46 @@ const pivotReshapeTo2D1M = (advancedVSeed, context)=>{
|
|
746
865
|
datasetReshapeInfo: datasetReshapeInfo
|
747
866
|
};
|
748
867
|
};
|
868
|
+
const pivotReshapeTo1D = (advancedVSeed, context)=>{
|
869
|
+
const result = {
|
870
|
+
...advancedVSeed
|
871
|
+
};
|
872
|
+
const { vseed } = context;
|
873
|
+
const { dataset } = vseed;
|
874
|
+
const { measures } = advancedVSeed;
|
875
|
+
const dimensions = advancedVSeed.dimensions;
|
876
|
+
if (!measures || !dimensions) return result;
|
877
|
+
const measureGroups = [];
|
878
|
+
if (measures) measures.forEach((measure)=>{
|
879
|
+
if (measure.children && measure.children.length > 0) measureGroups.push(measure);
|
880
|
+
});
|
881
|
+
const newDatasets = [];
|
882
|
+
const datasetReshapeInfo = [];
|
883
|
+
measureGroups.forEach((measureGroup)=>{
|
884
|
+
const measures = measureGroup.children;
|
885
|
+
if (!measures) return;
|
886
|
+
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
887
|
+
const groupId = measureGroup.id;
|
888
|
+
const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeFor1D(dataset, commonDimensions, measures, {
|
889
|
+
foldMeasureId: FoldMeasureId,
|
890
|
+
foldMeasureName: FoldMeasureName,
|
891
|
+
foldMeasureValue: FoldMeasureValue + groupId,
|
892
|
+
unfoldDimensionGroup: UnfoldDimensionGroup
|
893
|
+
});
|
894
|
+
const reshapeInfo = {
|
895
|
+
id: groupId,
|
896
|
+
foldInfo,
|
897
|
+
unfoldInfo
|
898
|
+
};
|
899
|
+
newDatasets.push(newSubDataset);
|
900
|
+
datasetReshapeInfo.push(reshapeInfo);
|
901
|
+
});
|
902
|
+
return {
|
903
|
+
...result,
|
904
|
+
dataset: newDatasets,
|
905
|
+
datasetReshapeInfo: datasetReshapeInfo
|
906
|
+
};
|
907
|
+
};
|
749
908
|
const encodingXY = (advancedVSeed)=>{
|
750
909
|
const result = {
|
751
910
|
...advancedVSeed
|
@@ -856,6 +1015,74 @@ const encodingYY = (advancedVSeed)=>{
|
|
856
1015
|
encoding
|
857
1016
|
};
|
858
1017
|
};
|
1018
|
+
const encodingXYY = (advancedVSeed)=>{
|
1019
|
+
const result = {
|
1020
|
+
...advancedVSeed
|
1021
|
+
};
|
1022
|
+
const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
|
1023
|
+
if (!datasetReshapeInfo || !dimensions || !measures) return result;
|
1024
|
+
const encoding = datasetReshapeInfo.reduce((prev, cur, index)=>{
|
1025
|
+
const measure = measures[index];
|
1026
|
+
if ('children' in measure) {
|
1027
|
+
const m1 = measure.children?.[0];
|
1028
|
+
const m2 = measure.children?.[1] || m1;
|
1029
|
+
const { foldInfo, unfoldInfo } = cur;
|
1030
|
+
const x = [
|
1031
|
+
unfoldInfo.groupId
|
1032
|
+
];
|
1033
|
+
const y = [
|
1034
|
+
m1?.id,
|
1035
|
+
m2?.id
|
1036
|
+
];
|
1037
|
+
const group = [
|
1038
|
+
unfoldInfo.groupId
|
1039
|
+
];
|
1040
|
+
const color = [
|
1041
|
+
foldInfo.measureName
|
1042
|
+
];
|
1043
|
+
return [
|
1044
|
+
...prev,
|
1045
|
+
{
|
1046
|
+
x,
|
1047
|
+
y,
|
1048
|
+
group,
|
1049
|
+
color
|
1050
|
+
}
|
1051
|
+
];
|
1052
|
+
}
|
1053
|
+
{
|
1054
|
+
const m1 = measures[index];
|
1055
|
+
const m2 = measures[index + 1] || m1;
|
1056
|
+
const { foldInfo, unfoldInfo } = cur;
|
1057
|
+
const x = [
|
1058
|
+
unfoldInfo.groupId
|
1059
|
+
];
|
1060
|
+
const y = [
|
1061
|
+
m1.id,
|
1062
|
+
m2.id
|
1063
|
+
];
|
1064
|
+
const group = [
|
1065
|
+
unfoldInfo.groupId
|
1066
|
+
];
|
1067
|
+
const color = [
|
1068
|
+
foldInfo.measureName
|
1069
|
+
];
|
1070
|
+
return [
|
1071
|
+
...prev,
|
1072
|
+
{
|
1073
|
+
x,
|
1074
|
+
y,
|
1075
|
+
group,
|
1076
|
+
color
|
1077
|
+
}
|
1078
|
+
];
|
1079
|
+
}
|
1080
|
+
}, []);
|
1081
|
+
return {
|
1082
|
+
...result,
|
1083
|
+
encoding
|
1084
|
+
};
|
1085
|
+
};
|
859
1086
|
const encodingRose = (advancedVSeed)=>{
|
860
1087
|
const result = {
|
861
1088
|
...advancedVSeed
|
@@ -1325,6 +1552,22 @@ const areaPercentAdvancedPipeline = [
|
|
1325
1552
|
markStyle_markStyle,
|
1326
1553
|
annotation_annotation
|
1327
1554
|
];
|
1555
|
+
const areaRangeAdvancedPipeline = [
|
1556
|
+
initAdvancedVSeed,
|
1557
|
+
autoMeasuresBy2M1Group,
|
1558
|
+
autoDimensions,
|
1559
|
+
pivotAdapter([
|
1560
|
+
reshapeTo1D
|
1561
|
+
], [
|
1562
|
+
pivotReshapeTo1D
|
1563
|
+
]),
|
1564
|
+
encodingXYY,
|
1565
|
+
sortXBandAxis,
|
1566
|
+
areaConfig,
|
1567
|
+
theme_theme,
|
1568
|
+
markStyle_markStyle,
|
1569
|
+
annotation_annotation
|
1570
|
+
];
|
1328
1571
|
const pieAdvancedPipeline = [
|
1329
1572
|
initAdvancedVSeed,
|
1330
1573
|
autoMeasures,
|
@@ -1565,7 +1808,7 @@ const tableAdvancedPipeline = [
|
|
1565
1808
|
theme_theme
|
1566
1809
|
];
|
1567
1810
|
const dataset_dataset = (spec, context)=>{
|
1568
|
-
const { advancedVSeed } = context;
|
1811
|
+
const { advancedVSeed, vseed } = context;
|
1569
1812
|
const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
|
1570
1813
|
const { orderMapping = {} } = analysis ?? {};
|
1571
1814
|
const angle = encoding[0]?.angle?.[0];
|
@@ -1614,7 +1857,7 @@ const dataset_dataset = (spec, context)=>{
|
|
1614
1857
|
...spec,
|
1615
1858
|
data: {
|
1616
1859
|
id,
|
1617
|
-
values: advancedVSeed.dataset,
|
1860
|
+
values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset,
|
1618
1861
|
fields: fields
|
1619
1862
|
}
|
1620
1863
|
};
|
@@ -1723,6 +1966,88 @@ const initArea = (spec, context)=>{
|
|
1723
1966
|
result.animation = true;
|
1724
1967
|
return result;
|
1725
1968
|
};
|
1969
|
+
const initAreaRange = (spec, context)=>{
|
1970
|
+
const result = {
|
1971
|
+
...spec
|
1972
|
+
};
|
1973
|
+
const { advancedVSeed } = context;
|
1974
|
+
const { encoding } = advancedVSeed;
|
1975
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
1976
|
+
const { color } = advancedVSeed.config.areaRange;
|
1977
|
+
result.type = 'rangeArea';
|
1978
|
+
result.direction = 'vertical';
|
1979
|
+
result.stack = false;
|
1980
|
+
result.xField = encoding[0].x[0];
|
1981
|
+
result.yField = [
|
1982
|
+
encoding[0].y[0],
|
1983
|
+
encoding[0].y[1]
|
1984
|
+
];
|
1985
|
+
result.animation = true;
|
1986
|
+
result.area = {
|
1987
|
+
style: {
|
1988
|
+
fill: color.colorScheme?.[0]
|
1989
|
+
}
|
1990
|
+
};
|
1991
|
+
return result;
|
1992
|
+
};
|
1993
|
+
const initAreaRangeLine1 = (spec, context)=>{
|
1994
|
+
const result = {
|
1995
|
+
...spec
|
1996
|
+
};
|
1997
|
+
const { advancedVSeed } = context;
|
1998
|
+
const { encoding } = advancedVSeed;
|
1999
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
2000
|
+
const { color } = advancedVSeed.config.areaRange;
|
2001
|
+
result.type = 'line';
|
2002
|
+
result.direction = 'vertical';
|
2003
|
+
result.stack = false;
|
2004
|
+
result.xField = encoding[0].x[0];
|
2005
|
+
result.yField = [
|
2006
|
+
encoding[0].y[0]
|
2007
|
+
];
|
2008
|
+
result.animation = true;
|
2009
|
+
result.line = {
|
2010
|
+
style: {
|
2011
|
+
stroke: color.colorScheme?.[0]
|
2012
|
+
}
|
2013
|
+
};
|
2014
|
+
result.point = {
|
2015
|
+
style: {
|
2016
|
+
visible: false,
|
2017
|
+
fill: color.colorScheme?.[0]
|
2018
|
+
}
|
2019
|
+
};
|
2020
|
+
return result;
|
2021
|
+
};
|
2022
|
+
const initAreaRangeLine2 = (spec, context)=>{
|
2023
|
+
const result = {
|
2024
|
+
...spec
|
2025
|
+
};
|
2026
|
+
const { advancedVSeed } = context;
|
2027
|
+
const { encoding } = advancedVSeed;
|
2028
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
2029
|
+
const { color } = advancedVSeed.config.areaRange;
|
2030
|
+
result.type = 'line';
|
2031
|
+
result.direction = 'vertical';
|
2032
|
+
result.stack = false;
|
2033
|
+
result.xField = encoding[0].x[0];
|
2034
|
+
result.yField = [
|
2035
|
+
encoding[0].y[1]
|
2036
|
+
];
|
2037
|
+
result.animation = true;
|
2038
|
+
result.line = {
|
2039
|
+
style: {
|
2040
|
+
stroke: color.colorScheme?.[0]
|
2041
|
+
}
|
2042
|
+
};
|
2043
|
+
result.point = {
|
2044
|
+
style: {
|
2045
|
+
visible: false,
|
2046
|
+
fill: color.colorScheme?.[0]
|
2047
|
+
}
|
2048
|
+
};
|
2049
|
+
return result;
|
2050
|
+
};
|
1726
2051
|
const initLine = (spec, context)=>{
|
1727
2052
|
const result = {
|
1728
2053
|
...spec
|
@@ -3996,6 +4321,21 @@ const horizontalCrosshairLine = (spec, context)=>{
|
|
3996
4321
|
};
|
3997
4322
|
return result;
|
3998
4323
|
};
|
4324
|
+
const series = (...args)=>{
|
4325
|
+
const result = {
|
4326
|
+
type: 'common',
|
4327
|
+
padding: 0,
|
4328
|
+
region: [
|
4329
|
+
{
|
4330
|
+
clip: true
|
4331
|
+
}
|
4332
|
+
]
|
4333
|
+
};
|
4334
|
+
return (_, context)=>{
|
4335
|
+
result.series = args.map((pipeline)=>execPipeline(pipeline, context, {}));
|
4336
|
+
return result;
|
4337
|
+
};
|
4338
|
+
};
|
3999
4339
|
const line_line = [
|
4000
4340
|
initLine,
|
4001
4341
|
color_color,
|
@@ -4442,6 +4782,69 @@ const pivotAreaPercent = [
|
|
4442
4782
|
const areaPercentSpecPipeline = [
|
4443
4783
|
pivotAdapter_pivotAdapter(areaPercent, pivotAreaPercent)
|
4444
4784
|
];
|
4785
|
+
const areaRange = [
|
4786
|
+
series([
|
4787
|
+
initAreaRange,
|
4788
|
+
areaStyle_areaStyle
|
4789
|
+
], [
|
4790
|
+
initAreaRangeLine1,
|
4791
|
+
lineStyle_lineStyle,
|
4792
|
+
pointStyle_pointStyle,
|
4793
|
+
pointStateDimensionHover
|
4794
|
+
], [
|
4795
|
+
initAreaRangeLine2,
|
4796
|
+
lineStyle_lineStyle,
|
4797
|
+
pointStyle_pointStyle,
|
4798
|
+
pointStateDimensionHover
|
4799
|
+
]),
|
4800
|
+
dataset_dataset,
|
4801
|
+
background_backgroundColor,
|
4802
|
+
xBand,
|
4803
|
+
yLinear,
|
4804
|
+
label_label,
|
4805
|
+
verticalCrosshairLine,
|
4806
|
+
annotationPoint_annotationPoint,
|
4807
|
+
annotationVerticalLine_annotationVerticalLine,
|
4808
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
4809
|
+
annotationArea_annotationArea
|
4810
|
+
];
|
4811
|
+
const pivotAreaRange = [
|
4812
|
+
initPivot,
|
4813
|
+
pivotGridStyle,
|
4814
|
+
pivotIndicators_pivotIndicatorsAsRow,
|
4815
|
+
datasetPivot,
|
4816
|
+
pivotIndicators([
|
4817
|
+
series([
|
4818
|
+
initAreaRange,
|
4819
|
+
areaStyle_areaStyle
|
4820
|
+
], [
|
4821
|
+
initAreaRangeLine1,
|
4822
|
+
lineStyle_lineStyle,
|
4823
|
+
pointStyle_pointStyle,
|
4824
|
+
pointStateDimensionHover
|
4825
|
+
], [
|
4826
|
+
initAreaRangeLine2,
|
4827
|
+
lineStyle_lineStyle,
|
4828
|
+
pointStyle_pointStyle,
|
4829
|
+
pointStateDimensionHover
|
4830
|
+
]),
|
4831
|
+
background_backgroundColor,
|
4832
|
+
dataset_dataset,
|
4833
|
+
xBand,
|
4834
|
+
yLinear,
|
4835
|
+
label_label,
|
4836
|
+
verticalCrosshairLine,
|
4837
|
+
annotationPoint_annotationPoint,
|
4838
|
+
annotationVerticalLine_annotationVerticalLine,
|
4839
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
4840
|
+
annotationArea_annotationArea
|
4841
|
+
]),
|
4842
|
+
pivotRowDimensions,
|
4843
|
+
pivotColumnDimensions
|
4844
|
+
];
|
4845
|
+
const areaRangeSpecPipeline = [
|
4846
|
+
pivotAdapter_pivotAdapter(areaRange, pivotAreaRange)
|
4847
|
+
];
|
4445
4848
|
const pie = [
|
4446
4849
|
initPie,
|
4447
4850
|
color_color,
|
@@ -5180,8 +5583,18 @@ class Builder {
|
|
5180
5583
|
build = ()=>build(this);
|
5181
5584
|
buildSpec = (advanced)=>buildSpec(this, advanced);
|
5182
5585
|
buildAdvanced = ()=>buildAdvanced(this);
|
5183
|
-
getAdvancedPipeline = (chartType)=>
|
5184
|
-
|
5586
|
+
getAdvancedPipeline = (chartType)=>{
|
5587
|
+
const customPipe = Builder._customAdvancedPipe[chartType];
|
5588
|
+
const pipeline = Builder._advancedPipelineMap[chartType];
|
5589
|
+
if (customPipe) pipeline.push(customPipe);
|
5590
|
+
return pipeline;
|
5591
|
+
};
|
5592
|
+
getSpecPipeline = (chartType)=>{
|
5593
|
+
const customPipe = Builder._customSpecPipe[chartType];
|
5594
|
+
const pipeline = Builder._specPipelineMap[chartType];
|
5595
|
+
if (customPipe) pipeline.push(customPipe);
|
5596
|
+
return pipeline;
|
5597
|
+
};
|
5185
5598
|
getTheme = (themeKey)=>Builder._themeMap[themeKey];
|
5186
5599
|
getThemeMap = ()=>Builder._themeMap;
|
5187
5600
|
getColorItems = ()=>getColorItems(this);
|
@@ -5206,6 +5619,8 @@ class Builder {
|
|
5206
5619
|
}
|
5207
5620
|
static _advancedPipelineMap = {};
|
5208
5621
|
static _specPipelineMap = {};
|
5622
|
+
static _customAdvancedPipe = {};
|
5623
|
+
static _customSpecPipe = {};
|
5209
5624
|
static _themeMap = {};
|
5210
5625
|
static from = (vseed)=>new Builder(vseed);
|
5211
5626
|
}
|
@@ -5229,6 +5644,10 @@ const registerAreaPercent = ()=>{
|
|
5229
5644
|
Builder._advancedPipelineMap.areaPercent = areaPercentAdvancedPipeline;
|
5230
5645
|
Builder._specPipelineMap.areaPercent = areaPercentSpecPipeline;
|
5231
5646
|
};
|
5647
|
+
const registerAreaRange = ()=>{
|
5648
|
+
Builder._advancedPipelineMap.areaRange = areaRangeAdvancedPipeline;
|
5649
|
+
Builder._specPipelineMap.areaRange = areaRangeSpecPipeline;
|
5650
|
+
};
|
5232
5651
|
const registerBarPercent = ()=>{
|
5233
5652
|
Builder._advancedPipelineMap.barPercent = barPercentAdvancedPipeline;
|
5234
5653
|
Builder._specPipelineMap.barPercent = barPercentSpecPipeline;
|
@@ -5520,6 +5939,12 @@ const darkTheme = ()=>{
|
|
5520
5939
|
yAxis: linearAxis,
|
5521
5940
|
crosshairLine: crosshairLine
|
5522
5941
|
},
|
5942
|
+
areaRange: {
|
5943
|
+
...baseConfig,
|
5944
|
+
xAxis: bandAxis,
|
5945
|
+
yAxis: linearAxis,
|
5946
|
+
crosshairLine: crosshairLine
|
5947
|
+
},
|
5523
5948
|
scatter: {
|
5524
5949
|
...baseConfig,
|
5525
5950
|
xAxis: {
|
@@ -5814,6 +6239,12 @@ const lightTheme = ()=>{
|
|
5814
6239
|
yAxis: linearAxis,
|
5815
6240
|
crosshairLine
|
5816
6241
|
},
|
6242
|
+
areaRange: {
|
6243
|
+
...baseConfig,
|
6244
|
+
xAxis: bandAxis,
|
6245
|
+
yAxis: linearAxis,
|
6246
|
+
crosshairLine
|
6247
|
+
},
|
5817
6248
|
scatter: {
|
5818
6249
|
...baseConfig,
|
5819
6250
|
xAxis: {
|
@@ -5887,6 +6318,7 @@ const registerAll = ()=>{
|
|
5887
6318
|
registerBarPercent();
|
5888
6319
|
registerArea();
|
5889
6320
|
registerAreaPercent();
|
6321
|
+
registerAreaRange();
|
5890
6322
|
registerPie();
|
5891
6323
|
registerDonut();
|
5892
6324
|
registerRose();
|
@@ -5898,6 +6330,12 @@ const registerAll = ()=>{
|
|
5898
6330
|
registerLightTheme();
|
5899
6331
|
registerDarkTheme();
|
5900
6332
|
};
|
6333
|
+
const updateAdvanced = (chartType, advancedPipe)=>{
|
6334
|
+
Builder._customAdvancedPipe[chartType] = advancedPipe;
|
6335
|
+
};
|
6336
|
+
const updateSpec = (chartType, specPipe)=>{
|
6337
|
+
Builder._customSpecPipe[chartType] = specPipe;
|
6338
|
+
};
|
5901
6339
|
const zChartType = z["enum"]([
|
5902
6340
|
'table',
|
5903
6341
|
'pivotTable',
|
@@ -5910,6 +6348,7 @@ const zChartType = z["enum"]([
|
|
5910
6348
|
'barParallel',
|
5911
6349
|
'area',
|
5912
6350
|
'areaPercent',
|
6351
|
+
'areaRange',
|
5913
6352
|
'rose',
|
5914
6353
|
'roseParallel',
|
5915
6354
|
'pie',
|
@@ -6240,6 +6679,7 @@ const zAreaConfig = z.object({
|
|
6240
6679
|
crosshairLine: zCrosshairLine.optional()
|
6241
6680
|
});
|
6242
6681
|
const zAreaPercentConfig = zAreaConfig;
|
6682
|
+
const zAreaRangeConfig = zAreaConfig;
|
6243
6683
|
const zRoseConfig = z.object({
|
6244
6684
|
backgroundColor: zBackgroundColor.optional(),
|
6245
6685
|
label: zLabel.optional(),
|
@@ -6292,6 +6732,7 @@ const zConfig = z.object({
|
|
6292
6732
|
barPercent: zBarPercentConfig.optional(),
|
6293
6733
|
area: zAreaConfig.optional(),
|
6294
6734
|
areaPercent: zAreaPercentConfig.optional(),
|
6735
|
+
areaRange: zAreaRangeConfig.optional(),
|
6295
6736
|
rose: zRoseConfig.optional(),
|
6296
6737
|
roseParallel: zRoseParallelConfig.optional(),
|
6297
6738
|
pie: zPieConfig.optional(),
|
@@ -6897,6 +7338,26 @@ const zAreaPercent = z.object({
|
|
6897
7338
|
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
6898
7339
|
locale: zLocale.optional()
|
6899
7340
|
});
|
7341
|
+
const zAreaRange = z.object({
|
7342
|
+
chartType: z.literal('areaRange'),
|
7343
|
+
dataset: zDataset.optional(),
|
7344
|
+
dimensions: zDimensions.optional(),
|
7345
|
+
measures: zMeasureTree.optional(),
|
7346
|
+
backgroundColor: zBackgroundColor.optional(),
|
7347
|
+
label: zLabel.optional(),
|
7348
|
+
xAxis: zXBandAxis.optional(),
|
7349
|
+
yAxis: zYLinearAxis.optional(),
|
7350
|
+
crosshairLine: zCrosshairLine.optional(),
|
7351
|
+
theme: zTheme.optional(),
|
7352
|
+
pointStyle: zPointStyle.optional(),
|
7353
|
+
lineStyle: zLineStyle.optional(),
|
7354
|
+
areaStyle: zAreaStyle.optional(),
|
7355
|
+
annotationPoint: z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
7356
|
+
annotationVerticalLine: z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
7357
|
+
annotationHorizontalLine: z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
7358
|
+
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
7359
|
+
locale: zLocale.optional()
|
7360
|
+
});
|
6900
7361
|
const zRose = z.object({
|
6901
7362
|
chartType: z.literal('rose'),
|
6902
7363
|
dataset: zDataset.optional(),
|
@@ -6995,6 +7456,7 @@ const zVSeed = z.discriminatedUnion('chartType', [
|
|
6995
7456
|
zBarPercent,
|
6996
7457
|
zArea,
|
6997
7458
|
zAreaPercent,
|
7459
|
+
zAreaRange,
|
6998
7460
|
zPie,
|
6999
7461
|
zRose,
|
7000
7462
|
zRoseParallel,
|
@@ -7017,6 +7479,6 @@ const zAdvancedVSeed = z.object({
|
|
7017
7479
|
annotation: zAnnotation,
|
7018
7480
|
locale: zLocale
|
7019
7481
|
});
|
7020
|
-
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, dataReshapeFor1D2M, dataReshapeFor2D1M, donutAdvancedPipeline, donutSpecPipeline, execPipeline, findAllDimensions, findAllMeasures, findDimensionById, findFirstDimension, findFirstMeasure, findMeasureById, foldMeasures, funnelAdvancedPipeline, funnelSpecPipeline, i18n, intl, isPivotChart, isPivotTable, isTable, isVChart, isVTable, lightTheme, lineAdvancedPipeline, lineSpecPipeline, pieAdvancedPipeline, pieSpecPipeline, pivotTableAdvancedPipeline, pivotTableSpecPipeline, preorderTraverse, registerAll, registerArea, registerAreaPercent, registerBar, registerBarParallel, registerBarPercent, registerColumn, registerColumnParallel, registerColumnPercent, registerCustomTheme, registerDarkTheme, registerDonut, registerFunnel, registerLightTheme, registerLine, registerPie, registerPivotTable, registerRose, registerRoseParallel, registerScatter, registerTable, roseAdvancedPipeline, roseParallelAdvancedPipeline, roseParallelSpecPipeline, roseSpecPipeline, scatterAdvancedPipeline, scatterSpecPipeline, tableAdvancedPipeline, tableSpecPipeline, unfoldDimensions, zAdvancedVSeed, zAnalysis, zAnnotation, zAnnotationArea, zAnnotationHorizontalLine, zAnnotationPoint, zAnnotationVerticalLine, zArea, zAreaConfig, zAreaPercent, zAreaPercentConfig, zAreaStyle, zAxis, zBackgroundColor, zBar, zBarConfig, zBarParallel, zBarParallelConfig, zBarPercent, zBarPercentConfig, zBarStyle, zChartType, zColor, zColumn, zColumnConfig, zColumnParallel, zColumnParallelConfig, zColumnPercent, zColumnPercentConfig, zConfig, zCrosshairLine, zCrosshairRect, zCustomTheme, zCustomThemeConfig, zDataset, zDatasetReshapeInfo, zDatum, zDimension, zDimensionGroup, zDimensionTree, zDimensions, zDonut, zDonutConfig, zDualAxisConfig, zEncoding, zFoldInfo, zFunnel, zFunnelConfig, zLabel, zLegend, zLine, zLineConfig, zLineStyle, zLocale, zMarkStyle, zMeasure, zMeasureGroup, zMeasureTree, zMeasures, zNumFormat, zPie, zPieConfig, zPivotTable, zPivotTableConfig, zPointStyle, zRose, zRoseConfig, zRoseParallel, zRoseParallelConfig, zScatter, zScatterConfig, zSortAxis, zSortLegend, zStackCornerRadius, zTable, zTableConfig, zTheme, zTooltip, zUnfoldInfo, zVSeed, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
|
7482
|
+
export { Builder, FoldMeasureId, FoldMeasureName, FoldMeasureValue, ORIGINAL_DATA, Separator, UnfoldDimensionGroup, UnfoldDimensionGroupId, areaAdvancedPipeline, areaPercentAdvancedPipeline, areaPercentSpecPipeline, areaRangeAdvancedPipeline, areaRangeSpecPipeline, areaSpecPipeline, autoFormatter, autoNumFormatter, barAdvancedPipeline, barParallelAdvancedPipeline, barParallelSpecPipeline, barPercentAdvancedPipeline, barPercentSpecPipeline, barSpecPipeline, columnAdvancedPipeline, columnParallelAdvancedPipeline, columnParallelSpecPipeline, columnPercentAdvancedPipeline, columnPercentSpecPipeline, columnSpecPipeline, createFormatter, createNumFormatter, darkTheme, dataReshapeFor1D, dataReshapeFor1D1M, dataReshapeFor1D2M, dataReshapeFor2D1M, donutAdvancedPipeline, donutSpecPipeline, execPipeline, findAllDimensions, findAllMeasures, findDimensionById, findFirstDimension, findFirstMeasure, findMeasureById, foldMeasures, funnelAdvancedPipeline, funnelSpecPipeline, i18n, intl, isPivotChart, isPivotTable, isTable, isVChart, isVTable, lightTheme, lineAdvancedPipeline, lineSpecPipeline, pieAdvancedPipeline, pieSpecPipeline, pivotTableAdvancedPipeline, pivotTableSpecPipeline, preorderTraverse, registerAll, registerArea, registerAreaPercent, registerAreaRange, registerBar, registerBarParallel, registerBarPercent, registerColumn, registerColumnParallel, registerColumnPercent, registerCustomTheme, registerDarkTheme, registerDonut, registerFunnel, registerLightTheme, registerLine, registerPie, registerPivotTable, registerRose, registerRoseParallel, registerScatter, registerTable, roseAdvancedPipeline, roseParallelAdvancedPipeline, roseParallelSpecPipeline, roseSpecPipeline, scatterAdvancedPipeline, scatterSpecPipeline, tableAdvancedPipeline, tableSpecPipeline, unfoldDimensions, updateAdvanced, updateSpec, zAdvancedVSeed, zAnalysis, zAnnotation, zAnnotationArea, zAnnotationHorizontalLine, zAnnotationPoint, zAnnotationVerticalLine, zArea, zAreaConfig, zAreaPercent, zAreaPercentConfig, zAreaRange, zAreaRangeConfig, zAreaStyle, zAxis, zBackgroundColor, zBar, zBarConfig, zBarParallel, zBarParallelConfig, zBarPercent, zBarPercentConfig, zBarStyle, zChartType, zColor, zColumn, zColumnConfig, zColumnParallel, zColumnParallelConfig, zColumnPercent, zColumnPercentConfig, zConfig, zCrosshairLine, zCrosshairRect, zCustomTheme, zCustomThemeConfig, zDataset, zDatasetReshapeInfo, zDatum, zDimension, zDimensionGroup, zDimensionTree, zDimensions, zDonut, zDonutConfig, zDualAxisConfig, zEncoding, zFoldInfo, zFunnel, zFunnelConfig, zLabel, zLegend, zLine, zLineConfig, zLineStyle, zLocale, zMarkStyle, zMeasure, zMeasureGroup, zMeasureTree, zMeasures, zNumFormat, zPie, zPieConfig, zPivotTable, zPivotTableConfig, zPointStyle, zRose, zRoseConfig, zRoseParallel, zRoseParallelConfig, zScatter, zScatterConfig, zSortAxis, zSortLegend, zStackCornerRadius, zTable, zTableConfig, zTheme, zTooltip, zUnfoldInfo, zVSeed, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
|
7021
7483
|
|
7022
7484
|
//# sourceMappingURL=index.js.map
|