@visactor/vseed 0.0.33 → 0.0.35
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/buildAdvanced.d.ts +1 -1
- package/dist/builder/builder/buildSpec.d.ts +1 -1
- package/dist/builder/builder/builder.d.ts +2794 -4887
- package/dist/builder/register/chartType/dualAxis.d.ts +1 -0
- package/dist/builder/register/chartType/index.d.ts +12 -11
- package/dist/dataReshape/constant.d.ts +3 -1
- package/dist/index.cjs +1362 -202
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1289 -156
- package/dist/index.js.map +1 -1
- package/dist/pipeline/advanced/chart/pipeline/dualAxis.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipeline/index.d.ts +1 -0
- package/dist/pipeline/advanced/chart/pipes/config/dualAxis.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipes/config/index.d.ts +1 -0
- package/dist/pipeline/advanced/chart/pipes/encoding/encodingAreaRange.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipes/encoding/index.d.ts +1 -0
- package/dist/pipeline/advanced/chart/pipes/init/autoDualMeasures.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipes/reshape/index.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipes/reshape/pivotReshapeTo2D2M.d.ts +8 -0
- package/dist/pipeline/advanced/chart/pipes/reshape/reshapeTo2D2M.d.ts +8 -0
- package/dist/pipeline/spec/chart/pipeline/dualAxis.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipeline/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/axes/index.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/axes/yLinearPrimary.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/axes/yLinearSecondary.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/dataset/datasetDualAxis.d.ts +3 -0
- package/dist/pipeline/spec/chart/pipes/dataset/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/dual/dualChartType.d.ts +3 -0
- package/dist/pipeline/spec/chart/pipes/dual/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/init/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/init/initDualAxis.d.ts +3 -0
- package/dist/pipeline/spec/chart/pipes/label/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/label/labelDualAxis.d.ts +3 -0
- package/dist/pipeline/spec/chart/pipes/tooltip/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/tooltip/tooltipDualAxis.d.ts +3 -0
- package/dist/pipeline/utils/chatType.d.ts +2 -2
- package/dist/pipeline/utils/measures/depth.d.ts +8 -0
- package/dist/pipeline/utils/measures/index.d.ts +1 -0
- package/dist/types/advancedVSeed.d.ts +491 -14
- package/dist/types/builder/builder.d.ts +16 -15
- package/dist/types/chartType/area/area.d.ts +0 -1494
- package/dist/types/chartType/area/index.d.ts +2 -1
- package/dist/types/chartType/area/zArea.d.ts +1494 -0
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +0 -1494
- package/dist/types/chartType/areaPercent/index.d.ts +2 -1
- package/dist/types/chartType/areaPercent/zAreaPercent.d.ts +1494 -0
- package/dist/types/chartType/areaRange/areaRange.d.ts +0 -1433
- package/dist/types/chartType/areaRange/index.d.ts +2 -1
- package/dist/types/chartType/areaRange/zAreaRange.d.ts +1433 -0
- package/dist/types/chartType/dualAxis/dualAxis.d.ts +123 -23
- package/dist/types/chartType/dualAxis/index.d.ts +1 -0
- package/dist/types/chartType/dualAxis/zDualAxis.d.ts +1955 -0
- package/dist/types/chartType/index.d.ts +1 -1
- package/dist/types/properties/chartType/dualChartType.d.ts +18 -0
- package/dist/types/properties/chartType/index.d.ts +2 -0
- package/dist/types/properties/config/config.d.ts +477 -7
- package/dist/types/properties/datasetReshapeInfo/datasetReshapeInfo.d.ts +7 -0
- package/dist/types/properties/measures/dualMeasures.d.ts +8 -0
- package/dist/types/properties/measures/index.d.ts +4 -1
- package/dist/types/properties/measures/measures.d.ts +0 -107
- package/dist/types/properties/measures/zDualMeasures.d.ts +287 -0
- package/dist/types/properties/measures/zMeasures.d.ts +108 -0
- package/dist/types/properties/theme/customTheme.d.ts +484 -14
- package/dist/types/vseed.d.ts +1953 -0
- package/dist/umd/index.js +1282 -140
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -8,11 +8,11 @@ const buildAdvanced = (builder)=>{
|
|
8
8
|
const start = 'undefined' != typeof performance ? performance.now() : Date.now();
|
9
9
|
const { chartType } = builder.vseed;
|
10
10
|
if (!chartType) throw new Error('chartType is nil in buildAdvanced');
|
11
|
-
const pipeline =
|
11
|
+
const pipeline = Builder.getAdvancedPipeline(chartType);
|
12
12
|
if (!pipeline) throw new Error(`no advanced pipeline for chartType ${chartType}`);
|
13
13
|
const context = {
|
14
14
|
vseed: builder.vseed,
|
15
|
-
customTheme:
|
15
|
+
customTheme: Builder.getThemeMap()
|
16
16
|
};
|
17
17
|
try {
|
18
18
|
return execPipeline(pipeline, context);
|
@@ -28,7 +28,7 @@ const buildSpec = (builder, advancedVSeed)=>{
|
|
28
28
|
const start = 'undefined' != typeof performance ? performance.now() : Date.now();
|
29
29
|
const { chartType } = builder.vseed;
|
30
30
|
if (!chartType) throw new Error('chartType is nil in buildSpec');
|
31
|
-
const pipeline =
|
31
|
+
const pipeline = Builder.getSpecPipeline(chartType);
|
32
32
|
if (!pipeline) throw new Error(`no spec pipeline for chartType ${chartType}`);
|
33
33
|
const context = {
|
34
34
|
vseed: builder.vseed,
|
@@ -111,20 +111,6 @@ class Builder {
|
|
111
111
|
build = ()=>build(this);
|
112
112
|
buildSpec = (advanced)=>buildSpec(this, advanced);
|
113
113
|
buildAdvanced = ()=>buildAdvanced(this);
|
114
|
-
getAdvancedPipeline = (chartType)=>{
|
115
|
-
const customPipe = Builder._customAdvancedPipe[chartType];
|
116
|
-
const pipeline = Builder._advancedPipelineMap[chartType];
|
117
|
-
if (customPipe) pipeline.push(customPipe);
|
118
|
-
return pipeline;
|
119
|
-
};
|
120
|
-
getSpecPipeline = (chartType)=>{
|
121
|
-
const customPipe = Builder._customSpecPipe[chartType];
|
122
|
-
const pipeline = Builder._specPipelineMap[chartType];
|
123
|
-
if (customPipe) pipeline.push(customPipe);
|
124
|
-
return pipeline;
|
125
|
-
};
|
126
|
-
getTheme = (themeKey)=>Builder._themeMap[themeKey];
|
127
|
-
getThemeMap = ()=>Builder._themeMap;
|
128
114
|
getColorItems = ()=>getColorItems(this);
|
129
115
|
getColorIdMap = ()=>getColorIdMap(this);
|
130
116
|
get vseed() {
|
@@ -151,12 +137,26 @@ class Builder {
|
|
151
137
|
set performance(value) {
|
152
138
|
this._performance = value;
|
153
139
|
}
|
140
|
+
static getAdvancedPipeline = (chartType)=>{
|
141
|
+
const customPipe = Builder._customAdvancedPipe[chartType];
|
142
|
+
const pipeline = Builder._advancedPipelineMap[chartType];
|
143
|
+
if (customPipe) pipeline.push(customPipe);
|
144
|
+
return pipeline;
|
145
|
+
};
|
146
|
+
static getSpecPipeline = (chartType)=>{
|
147
|
+
const customPipe = Builder._customSpecPipe[chartType];
|
148
|
+
const pipeline = Builder._specPipelineMap[chartType];
|
149
|
+
if (customPipe) pipeline.push(customPipe);
|
150
|
+
return pipeline;
|
151
|
+
};
|
152
|
+
static getTheme = (themeKey)=>Builder._themeMap[themeKey];
|
153
|
+
static getThemeMap = ()=>Builder._themeMap;
|
154
|
+
static from = (vseed)=>new Builder(vseed);
|
154
155
|
static _advancedPipelineMap = {};
|
155
156
|
static _specPipelineMap = {};
|
156
157
|
static _customAdvancedPipe = {};
|
157
158
|
static _customSpecPipe = {};
|
158
159
|
static _themeMap = {};
|
159
|
-
static from = (vseed)=>new Builder(vseed);
|
160
160
|
}
|
161
161
|
const initAdvancedVSeed = (advancedVSeed, context)=>{
|
162
162
|
const { vseed } = context;
|
@@ -256,7 +256,10 @@ const autoDimensions = (advancedVSeed, context)=>{
|
|
256
256
|
if (!dataset) throw new Error('dataset is required');
|
257
257
|
if (0 === dataset.length) return result;
|
258
258
|
if (dimensions) {
|
259
|
-
result.dimensions = dimensions
|
259
|
+
result.dimensions = dimensions.map((dim)=>({
|
260
|
+
location: 'dimension',
|
261
|
+
...dim
|
262
|
+
}));
|
260
263
|
return result;
|
261
264
|
}
|
262
265
|
const top100dataset = dataset.slice(0, 100);
|
@@ -552,7 +555,7 @@ const autoPivotMeasures = (advancedVSeed, context)=>{
|
|
552
555
|
const measures = findAllMeasures(vseed.measures);
|
553
556
|
if (!dataset) throw new Error('dataset is required');
|
554
557
|
if (0 === dataset.length) return result;
|
555
|
-
if (measures) {
|
558
|
+
if (vseed.measures) {
|
556
559
|
result.measures = findAllMeasures(measures);
|
557
560
|
return result;
|
558
561
|
}
|
@@ -850,6 +853,15 @@ const initAdvancedVSeed_initAdvancedVSeed = (advancedVSeed, context)=>{
|
|
850
853
|
locale: locale || 'zh-CN'
|
851
854
|
};
|
852
855
|
};
|
856
|
+
const measureDepth = (measures = [])=>{
|
857
|
+
if (!measures) return 0;
|
858
|
+
let depth = 1;
|
859
|
+
preorderTraverse(measures, (node)=>{
|
860
|
+
if ('children' in node) depth = Math.max(depth, 1 + measureDepth(node.children));
|
861
|
+
return false;
|
862
|
+
});
|
863
|
+
return depth;
|
864
|
+
};
|
853
865
|
const isTable = (vseed)=>'table' === vseed.chartType;
|
854
866
|
const isPivotTable = (vseed)=>'pivotTable' === vseed.chartType;
|
855
867
|
const isVTable = (vseed)=>[
|
@@ -859,9 +871,18 @@ const isVTable = (vseed)=>[
|
|
859
871
|
const isVChart = (vseed)=>!isVTable(vseed);
|
860
872
|
const isPivotChart = (vseed)=>{
|
861
873
|
if (isVTable(vseed)) return false;
|
874
|
+
if ('dualAxis' === vseed.chartType) {
|
875
|
+
if (vseed.measures) {
|
876
|
+
const depth = measureDepth(vseed.measures);
|
877
|
+
if (3 === depth) return true;
|
878
|
+
return false;
|
879
|
+
}
|
880
|
+
if (vseed.dualMeasures && vseed.dualMeasures.length > 1) return true;
|
881
|
+
return false;
|
882
|
+
}
|
862
883
|
const { measures = [], dimensions = [] } = vseed;
|
863
884
|
const hasRowOrColumnDimension = dimensions && dimensions.some((dimension)=>'rowDimension' === dimension.location || 'columnDimension' === dimension.location);
|
864
|
-
const hasMeasureGroup = measures && measures.
|
885
|
+
const hasMeasureGroup = measures && measures.some((measure)=>measure && measure.children);
|
865
886
|
return hasRowOrColumnDimension || hasMeasureGroup;
|
866
887
|
};
|
867
888
|
const autoMeasures_autoMeasures = (advancedVSeed, context)=>{
|
@@ -945,7 +966,10 @@ const autoDimensions_autoDimensions = (advancedVSeed, context)=>{
|
|
945
966
|
if (!dataset) throw new Error('dataset is required');
|
946
967
|
if (0 === dataset.length) return result;
|
947
968
|
if (dimensions) {
|
948
|
-
result.dimensions = dimensions
|
969
|
+
result.dimensions = dimensions.map((dim)=>({
|
970
|
+
location: 'dimension',
|
971
|
+
...dim
|
972
|
+
}));
|
949
973
|
return result;
|
950
974
|
}
|
951
975
|
const top100dataset = dataset.slice(0, 100);
|
@@ -971,8 +995,10 @@ const pivotAdapter = (pipeline, pivotPipeline)=>(advancedVSeed, context)=>{
|
|
971
995
|
return execPipeline(pipeline, context, advancedVSeed);
|
972
996
|
};
|
973
997
|
const FoldMeasureName = '__MeaName__';
|
974
|
-
const FoldMeasureValue = '__MeaValue__';
|
975
998
|
const FoldMeasureId = '__MeaId__';
|
999
|
+
const FoldMeasureValue = '__MeaValue__';
|
1000
|
+
const FoldPrimaryMeasureValue = '__MeaPrimaryValue__';
|
1001
|
+
const FoldSecondaryMeasureValue = '__MeaSecondaryValue__';
|
976
1002
|
const UnfoldDimensionGroup = '__DimGroup__';
|
977
1003
|
const UnfoldDimensionGroupId = '__DimGroupID__';
|
978
1004
|
const Separator = '-';
|
@@ -1152,6 +1178,7 @@ const reshapeTo2D1M0Name = (advancedVSeed, context)=>{
|
|
1152
1178
|
datasetReshapeInfo: [
|
1153
1179
|
{
|
1154
1180
|
id: '2D1M',
|
1181
|
+
index: 0,
|
1155
1182
|
foldInfo,
|
1156
1183
|
unfoldInfo
|
1157
1184
|
}
|
@@ -1176,7 +1203,7 @@ const pivotReshapeTo2D1M0Name = (advancedVSeed, context)=>{
|
|
1176
1203
|
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
1177
1204
|
const newDatasets = [];
|
1178
1205
|
const datasetReshapeInfo = [];
|
1179
|
-
measureGroups.forEach((measureGroup)=>{
|
1206
|
+
measureGroups.forEach((measureGroup, index)=>{
|
1180
1207
|
const measures = measureGroup.children;
|
1181
1208
|
if (!measures) return;
|
1182
1209
|
const groupId = measureGroup.id;
|
@@ -1188,6 +1215,7 @@ const pivotReshapeTo2D1M0Name = (advancedVSeed, context)=>{
|
|
1188
1215
|
});
|
1189
1216
|
const reshapeInfo = {
|
1190
1217
|
id: groupId,
|
1218
|
+
index,
|
1191
1219
|
foldInfo,
|
1192
1220
|
unfoldInfo
|
1193
1221
|
};
|
@@ -1469,11 +1497,13 @@ const color_color = (spec, context)=>{
|
|
1469
1497
|
const { unfoldInfo } = datasetReshapeInfo[0];
|
1470
1498
|
const baseConfig = advancedVSeed.config[chartType];
|
1471
1499
|
if (!baseConfig || !baseConfig.color) return result;
|
1500
|
+
const colorItems = unfoldInfo.colorItems;
|
1501
|
+
const colorIdMap = unfoldInfo.colorIdMap;
|
1472
1502
|
const { color } = baseConfig;
|
1473
1503
|
const { colorScheme, colorMapping } = color;
|
1474
1504
|
const mappingList = [];
|
1475
1505
|
if (colorMapping) Object.entries(colorMapping).sort((a, b)=>a[0].split(Separator).length - b[0].split(Separator).length).forEach(([key, value])=>{
|
1476
|
-
const idMap = Object.entries(
|
1506
|
+
const idMap = Object.entries(colorIdMap).filter(([_, v])=>v.includes(key));
|
1477
1507
|
for (const [colorId] of idMap)mappingList.push([
|
1478
1508
|
colorId,
|
1479
1509
|
value
|
@@ -1481,7 +1511,7 @@ const color_color = (spec, context)=>{
|
|
1481
1511
|
});
|
1482
1512
|
result.color = {
|
1483
1513
|
type: 'ordinal',
|
1484
|
-
domain:
|
1514
|
+
domain: colorItems,
|
1485
1515
|
range: colorScheme,
|
1486
1516
|
specified: Object.fromEntries(mappingList)
|
1487
1517
|
};
|
@@ -3191,6 +3221,7 @@ const reshapeTo2D1M = (advancedVSeed, context)=>{
|
|
3191
3221
|
datasetReshapeInfo: [
|
3192
3222
|
{
|
3193
3223
|
id: '2D1M',
|
3224
|
+
index: 0,
|
3194
3225
|
foldInfo,
|
3195
3226
|
unfoldInfo
|
3196
3227
|
}
|
@@ -3215,7 +3246,7 @@ const pivotReshapeTo2D1M = (advancedVSeed, context)=>{
|
|
3215
3246
|
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
3216
3247
|
const newDatasets = [];
|
3217
3248
|
const datasetReshapeInfo = [];
|
3218
|
-
measureGroups.forEach((measureGroup)=>{
|
3249
|
+
measureGroups.forEach((measureGroup, index)=>{
|
3219
3250
|
const measures = measureGroup.children;
|
3220
3251
|
if (!measures) return;
|
3221
3252
|
const groupId = measureGroup.id;
|
@@ -3227,6 +3258,7 @@ const pivotReshapeTo2D1M = (advancedVSeed, context)=>{
|
|
3227
3258
|
});
|
3228
3259
|
const reshapeInfo = {
|
3229
3260
|
id: groupId,
|
3261
|
+
index,
|
3230
3262
|
foldInfo,
|
3231
3263
|
unfoldInfo
|
3232
3264
|
};
|
@@ -4633,6 +4665,7 @@ const reshapeTo1D = (advancedVSeed, context)=>{
|
|
4633
4665
|
datasetReshapeInfo: [
|
4634
4666
|
{
|
4635
4667
|
id: '1D2M',
|
4668
|
+
index: 0,
|
4636
4669
|
foldInfo,
|
4637
4670
|
unfoldInfo
|
4638
4671
|
}
|
@@ -4654,7 +4687,7 @@ const pivotReshapeTo1D = (advancedVSeed, context)=>{
|
|
4654
4687
|
});
|
4655
4688
|
const newDatasets = [];
|
4656
4689
|
const datasetReshapeInfo = [];
|
4657
|
-
measureGroups.forEach((measureGroup)=>{
|
4690
|
+
measureGroups.forEach((measureGroup, index)=>{
|
4658
4691
|
const measures = measureGroup.children;
|
4659
4692
|
if (!measures) return;
|
4660
4693
|
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
@@ -4667,6 +4700,7 @@ const pivotReshapeTo1D = (advancedVSeed, context)=>{
|
|
4667
4700
|
});
|
4668
4701
|
const reshapeInfo = {
|
4669
4702
|
id: groupId,
|
4703
|
+
index,
|
4670
4704
|
foldInfo,
|
4671
4705
|
unfoldInfo
|
4672
4706
|
};
|
@@ -4679,7 +4713,7 @@ const pivotReshapeTo1D = (advancedVSeed, context)=>{
|
|
4679
4713
|
datasetReshapeInfo: datasetReshapeInfo
|
4680
4714
|
};
|
4681
4715
|
};
|
4682
|
-
const
|
4716
|
+
const encodingAreaRange = (advancedVSeed)=>{
|
4683
4717
|
const result = {
|
4684
4718
|
...advancedVSeed
|
4685
4719
|
};
|
@@ -4756,7 +4790,7 @@ const areaRangeAdvancedPipeline = [
|
|
4756
4790
|
], [
|
4757
4791
|
pivotReshapeTo1D
|
4758
4792
|
]),
|
4759
|
-
|
4793
|
+
encodingAreaRange,
|
4760
4794
|
sortXBandAxis,
|
4761
4795
|
areaConfig,
|
4762
4796
|
theme_theme,
|
@@ -5078,6 +5112,7 @@ const reshapeTo1D2M = (advancedVSeed, context)=>{
|
|
5078
5112
|
datasetReshapeInfo: [
|
5079
5113
|
{
|
5080
5114
|
id: '1D2M',
|
5115
|
+
index: 0,
|
5081
5116
|
foldInfo,
|
5082
5117
|
unfoldInfo
|
5083
5118
|
}
|
@@ -5099,7 +5134,7 @@ const pivotReshapeTo1D2M = (advancedVSeed, context)=>{
|
|
5099
5134
|
});
|
5100
5135
|
const newDatasets = [];
|
5101
5136
|
const datasetReshapeInfo = [];
|
5102
|
-
measureGroups.forEach((measureGroup)=>{
|
5137
|
+
measureGroups.forEach((measureGroup, index)=>{
|
5103
5138
|
const measures = measureGroup.children;
|
5104
5139
|
if (!measures) return;
|
5105
5140
|
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
@@ -5112,6 +5147,7 @@ const pivotReshapeTo1D2M = (advancedVSeed, context)=>{
|
|
5112
5147
|
});
|
5113
5148
|
const reshapeInfo = {
|
5114
5149
|
id: groupId,
|
5150
|
+
index,
|
5115
5151
|
foldInfo,
|
5116
5152
|
unfoldInfo
|
5117
5153
|
};
|
@@ -5291,69 +5327,7 @@ const registerScatter = ()=>{
|
|
5291
5327
|
Builder._advancedPipelineMap.scatter = scatterAdvancedPipeline;
|
5292
5328
|
Builder._specPipelineMap.scatter = scatterSpecPipeline;
|
5293
5329
|
};
|
5294
|
-
const
|
5295
|
-
dataset: [],
|
5296
|
-
foldInfo: {
|
5297
|
-
foldMap: {},
|
5298
|
-
measureId: '',
|
5299
|
-
measureName: '',
|
5300
|
-
measureValue: ''
|
5301
|
-
},
|
5302
|
-
unfoldInfo: {
|
5303
|
-
groupName: '',
|
5304
|
-
groupId: '',
|
5305
|
-
colorItems: [],
|
5306
|
-
colorIdMap: {}
|
5307
|
-
}
|
5308
|
-
};
|
5309
|
-
const dataReshapeFor1D1M = (dataset, dimensions, measures, options)=>{
|
5310
|
-
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup, unfoldDimensionGroupId = UnfoldDimensionGroupId } = options || {};
|
5311
|
-
if (0 === dimensions.length && 0 === measures.length) return dataReshapeFor1D1M_emptyReshapeResult;
|
5312
|
-
const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, foldMeasureId, foldMeasureName, foldMeasureValue);
|
5313
|
-
if (0 === dimensions.length) {
|
5314
|
-
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, [
|
5315
|
-
{
|
5316
|
-
id: foldMeasureName,
|
5317
|
-
alias: i18n`指标名称`,
|
5318
|
-
location: 'dimension'
|
5319
|
-
}
|
5320
|
-
], [
|
5321
|
-
{
|
5322
|
-
id: foldMeasureValue,
|
5323
|
-
alias: i18n`指标值`
|
5324
|
-
}
|
5325
|
-
], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
5326
|
-
return {
|
5327
|
-
dataset: finalDataset,
|
5328
|
-
foldInfo,
|
5329
|
-
unfoldInfo
|
5330
|
-
};
|
5331
|
-
}
|
5332
|
-
{
|
5333
|
-
const dims = 1 === measures.length ? [
|
5334
|
-
...dimensions
|
5335
|
-
] : [
|
5336
|
-
...dimensions,
|
5337
|
-
{
|
5338
|
-
id: foldMeasureName,
|
5339
|
-
alias: i18n`指标名称`,
|
5340
|
-
location: 'dimension'
|
5341
|
-
}
|
5342
|
-
];
|
5343
|
-
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, dims, [
|
5344
|
-
{
|
5345
|
-
id: foldMeasureValue,
|
5346
|
-
alias: i18n`指标值`
|
5347
|
-
}
|
5348
|
-
], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
5349
|
-
return {
|
5350
|
-
dataset: finalDataset,
|
5351
|
-
foldInfo,
|
5352
|
-
unfoldInfo
|
5353
|
-
};
|
5354
|
-
}
|
5355
|
-
};
|
5356
|
-
const reshapeTo1D1M = (advancedVSeed, context)=>{
|
5330
|
+
const reshapeTo2D2M = (advancedVSeed, context)=>{
|
5357
5331
|
const result = {
|
5358
5332
|
...advancedVSeed
|
5359
5333
|
};
|
@@ -5362,84 +5336,138 @@ const reshapeTo1D1M = (advancedVSeed, context)=>{
|
|
5362
5336
|
const { dimensions, measures } = advancedVSeed;
|
5363
5337
|
if (!measures || !dimensions || !dataset) return result;
|
5364
5338
|
if (0 === measures.length) throw new Error('measures can not be empty');
|
5365
|
-
|
5339
|
+
if (measures.length > 2) throw new Error('measures can not be more than 2');
|
5340
|
+
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
5341
|
+
const datasets = [];
|
5342
|
+
const foldInfoList = [];
|
5343
|
+
const unfoldInfoList = [];
|
5344
|
+
const primaryMeasures = measures[0];
|
5345
|
+
const secondaryMeasures = measures[1] || [];
|
5346
|
+
if (primaryMeasures && primaryMeasures.children) {
|
5347
|
+
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeFor2D1M(dataset, commonDimensions, primaryMeasures.children, {
|
5348
|
+
foldMeasureValue: FoldPrimaryMeasureValue
|
5349
|
+
});
|
5350
|
+
datasets.push(newDatasets);
|
5351
|
+
foldInfoList.push(foldInfo);
|
5352
|
+
unfoldInfoList.push(unfoldInfo);
|
5353
|
+
}
|
5354
|
+
if (secondaryMeasures && secondaryMeasures.children) {
|
5355
|
+
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeFor2D1M(dataset, commonDimensions, secondaryMeasures.children, {
|
5356
|
+
foldMeasureValue: FoldSecondaryMeasureValue
|
5357
|
+
});
|
5358
|
+
datasets.push(newDatasets);
|
5359
|
+
foldInfoList.push(foldInfo);
|
5360
|
+
unfoldInfoList.push(unfoldInfo);
|
5361
|
+
}
|
5362
|
+
const unfoldInfo = {
|
5363
|
+
groupName: unfoldInfoList[0].groupName,
|
5364
|
+
groupId: unfoldInfoList[0].groupId,
|
5365
|
+
colorItems: unfoldInfoList.flatMap((d)=>d.colorItems),
|
5366
|
+
colorIdMap: unfoldInfoList.reduce((prev, cur)=>({
|
5367
|
+
...prev,
|
5368
|
+
...cur.colorIdMap
|
5369
|
+
}), {})
|
5370
|
+
};
|
5366
5371
|
return {
|
5367
5372
|
...result,
|
5368
|
-
dataset:
|
5373
|
+
dataset: datasets,
|
5369
5374
|
datasetReshapeInfo: [
|
5370
5375
|
{
|
5371
|
-
id: '
|
5372
|
-
|
5373
|
-
|
5376
|
+
id: '2D2M',
|
5377
|
+
index: 0,
|
5378
|
+
foldInfo: foldInfoList[0],
|
5379
|
+
foldInfoList: foldInfoList,
|
5380
|
+
unfoldInfo: unfoldInfo
|
5374
5381
|
}
|
5375
5382
|
]
|
5376
5383
|
};
|
5377
5384
|
};
|
5378
|
-
const
|
5385
|
+
const pivotReshapeTo2D2M = (advancedVSeed, context)=>{
|
5379
5386
|
const result = {
|
5380
5387
|
...advancedVSeed
|
5381
5388
|
};
|
5382
5389
|
const { vseed } = context;
|
5383
5390
|
const { dataset } = vseed;
|
5384
|
-
const { measures } = advancedVSeed;
|
5385
|
-
|
5386
|
-
|
5387
|
-
const
|
5388
|
-
if (measures) measures.forEach((measure)=>{
|
5389
|
-
if (measure.children && measure.children.length > 0) measureGroups.push(measure);
|
5390
|
-
});
|
5391
|
-
const newDatasets = [];
|
5391
|
+
const { dimensions, measures } = advancedVSeed;
|
5392
|
+
if (!measures || !dimensions || !dataset) return result;
|
5393
|
+
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
5394
|
+
const datasetList = [];
|
5392
5395
|
const datasetReshapeInfo = [];
|
5393
|
-
|
5394
|
-
const measures = measureGroup.children;
|
5395
|
-
if (
|
5396
|
-
|
5397
|
-
const
|
5398
|
-
const
|
5399
|
-
|
5400
|
-
|
5401
|
-
|
5402
|
-
|
5403
|
-
|
5396
|
+
measures.forEach((measureGroup, index)=>{
|
5397
|
+
const measures = measureGroup.children || [];
|
5398
|
+
if (0 === measures.length) throw new Error('measures can not be empty');
|
5399
|
+
if (measures.length > 2) throw new Error('measures can not be more than 2');
|
5400
|
+
const datasets = [];
|
5401
|
+
const foldInfoList = [];
|
5402
|
+
const unfoldInfoList = [];
|
5403
|
+
const primaryMeasures = measures[0];
|
5404
|
+
const secondaryMeasures = measures[1] || measures[0];
|
5405
|
+
if (primaryMeasures && primaryMeasures.children) {
|
5406
|
+
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeFor2D1M(dataset, commonDimensions, primaryMeasures.children, {
|
5407
|
+
foldMeasureValue: `${FoldPrimaryMeasureValue}${index}`
|
5408
|
+
});
|
5409
|
+
datasets.push(newDatasets);
|
5410
|
+
foldInfoList.push(foldInfo);
|
5411
|
+
unfoldInfoList.push(unfoldInfo);
|
5412
|
+
}
|
5413
|
+
if (secondaryMeasures && secondaryMeasures.children) {
|
5414
|
+
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeFor2D1M(dataset, commonDimensions, secondaryMeasures.children, {
|
5415
|
+
foldMeasureValue: `${FoldSecondaryMeasureValue}${index}`
|
5416
|
+
});
|
5417
|
+
datasets.push(newDatasets);
|
5418
|
+
foldInfoList.push(foldInfo);
|
5419
|
+
unfoldInfoList.push(unfoldInfo);
|
5420
|
+
}
|
5421
|
+
datasetList.push(datasets.flat(2));
|
5422
|
+
const unfoldInfo = {
|
5423
|
+
groupName: unfoldInfoList[0].groupName,
|
5424
|
+
groupId: unfoldInfoList[0].groupId,
|
5425
|
+
colorItems: unfoldInfoList.flatMap((d)=>d.colorItems),
|
5426
|
+
colorIdMap: unfoldInfoList.reduce((prev, cur)=>({
|
5427
|
+
...prev,
|
5428
|
+
...cur.colorIdMap
|
5429
|
+
}), {})
|
5430
|
+
};
|
5404
5431
|
const reshapeInfo = {
|
5405
|
-
id:
|
5406
|
-
|
5407
|
-
|
5432
|
+
id: `2D2M-${index}`,
|
5433
|
+
index,
|
5434
|
+
foldInfo: foldInfoList[0],
|
5435
|
+
unfoldInfo: unfoldInfo,
|
5436
|
+
foldInfoList: foldInfoList
|
5408
5437
|
};
|
5409
|
-
newDatasets.push(newSubDataset);
|
5410
5438
|
datasetReshapeInfo.push(reshapeInfo);
|
5411
5439
|
});
|
5412
5440
|
return {
|
5413
5441
|
...result,
|
5414
|
-
dataset:
|
5415
|
-
datasetReshapeInfo
|
5442
|
+
dataset: datasetList,
|
5443
|
+
datasetReshapeInfo
|
5416
5444
|
};
|
5417
5445
|
};
|
5418
|
-
const
|
5446
|
+
const encodingXYY = (advancedVSeed)=>{
|
5419
5447
|
const result = {
|
5420
5448
|
...advancedVSeed
|
5421
5449
|
};
|
5422
|
-
const { datasetReshapeInfo } = advancedVSeed;
|
5423
|
-
if (!datasetReshapeInfo) return result;
|
5450
|
+
const { datasetReshapeInfo, dimensions } = advancedVSeed;
|
5451
|
+
if (!datasetReshapeInfo || !dimensions) return result;
|
5452
|
+
const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location) || dimensions[0];
|
5453
|
+
const isZeroDimension = 0 === dimensions.length;
|
5424
5454
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
5425
|
-
const {
|
5426
|
-
const
|
5427
|
-
|
5428
|
-
];
|
5429
|
-
const angle = [
|
5430
|
-
unfoldInfo.groupId
|
5455
|
+
const { foldInfoList, unfoldInfo } = cur;
|
5456
|
+
const x = [
|
5457
|
+
isZeroDimension ? foldInfoList[0].measureName : xDimension?.id
|
5431
5458
|
];
|
5459
|
+
const y = foldInfoList.map((d)=>d.measureValue);
|
5432
5460
|
const group = [
|
5433
5461
|
unfoldInfo.groupId
|
5434
5462
|
];
|
5435
5463
|
const color = [
|
5436
|
-
|
5464
|
+
foldInfoList[0].measureName
|
5437
5465
|
];
|
5438
5466
|
return [
|
5439
5467
|
...prev,
|
5440
5468
|
{
|
5441
|
-
|
5442
|
-
|
5469
|
+
x,
|
5470
|
+
y,
|
5443
5471
|
group,
|
5444
5472
|
color
|
5445
5473
|
}
|
@@ -5450,35 +5478,1046 @@ const encodingPie = (advancedVSeed)=>{
|
|
5450
5478
|
encoding
|
5451
5479
|
};
|
5452
5480
|
};
|
5453
|
-
const
|
5481
|
+
const dualAxisConfig = (advancedVSeed, context)=>{
|
5482
|
+
const { vseed } = context;
|
5483
|
+
const { chartType } = vseed;
|
5484
|
+
const result = {
|
5485
|
+
...advancedVSeed
|
5486
|
+
};
|
5487
|
+
const config = pick(vseed, [
|
5488
|
+
'backgroundColor',
|
5489
|
+
'color',
|
5490
|
+
'label',
|
5491
|
+
'legend',
|
5492
|
+
'tooltip',
|
5493
|
+
'dualChartType',
|
5494
|
+
'primaryYAxis',
|
5495
|
+
'secondaryYAxis',
|
5496
|
+
'crosshairLine'
|
5497
|
+
]);
|
5498
|
+
result.config = {
|
5499
|
+
...result.config || {},
|
5500
|
+
[chartType]: {
|
5501
|
+
...config
|
5502
|
+
}
|
5503
|
+
};
|
5504
|
+
return result;
|
5505
|
+
};
|
5506
|
+
const autoDualMeasures = (advancedVSeed, context)=>{
|
5507
|
+
const result = {
|
5508
|
+
...advancedVSeed
|
5509
|
+
};
|
5510
|
+
const { vseed } = context;
|
5511
|
+
const { dataset, dualMeasures, measures } = vseed;
|
5512
|
+
if (!dataset) throw new Error('dataset is required');
|
5513
|
+
if (0 === dataset.length) return result;
|
5514
|
+
if (dualMeasures) {
|
5515
|
+
result.measures = dualMeasuresToMeasureTree(dualMeasures);
|
5516
|
+
return result;
|
5517
|
+
}
|
5518
|
+
if (measures && measureDepth(measures) > 1) {
|
5519
|
+
result.measures = measures;
|
5520
|
+
return result;
|
5521
|
+
}
|
5522
|
+
const top100dataset = dataset.slice(0, 100);
|
5523
|
+
const sample = top100dataset.reduce((prev, cur)=>({
|
5524
|
+
...prev,
|
5525
|
+
...cur
|
5526
|
+
}), {});
|
5527
|
+
const newMeasures = measures || Object.keys(sample).filter((key)=>top100dataset.some((item)=>'number' == typeof item[key]) && ![
|
5528
|
+
'',
|
5529
|
+
null,
|
5530
|
+
void 0
|
5531
|
+
].includes(key)).map((measure)=>({
|
5532
|
+
id: measure,
|
5533
|
+
alias: measure
|
5534
|
+
}));
|
5535
|
+
if (0 === newMeasures.length) result.measures = [];
|
5536
|
+
else if (1 === newMeasures.length) result.measures = [
|
5537
|
+
{
|
5538
|
+
id: 'primary',
|
5539
|
+
alias: 'primary',
|
5540
|
+
children: newMeasures
|
5541
|
+
}
|
5542
|
+
];
|
5543
|
+
else if (newMeasures.length > 1) result.measures = [
|
5544
|
+
{
|
5545
|
+
id: 'primary',
|
5546
|
+
alias: 'primary',
|
5547
|
+
children: newMeasures.slice(0, 1)
|
5548
|
+
},
|
5549
|
+
{
|
5550
|
+
id: 'secondary',
|
5551
|
+
alias: 'secondary',
|
5552
|
+
children: newMeasures.slice(1)
|
5553
|
+
}
|
5554
|
+
];
|
5555
|
+
return result;
|
5556
|
+
};
|
5557
|
+
const dualMeasuresToMeasureTree = (dualMeasures)=>{
|
5558
|
+
const measureTree = dualMeasures.map((item, index)=>{
|
5559
|
+
const { primaryMeasures, secondaryMeasures, primaryAlias, secondaryAlias } = item;
|
5560
|
+
const groupChildren = [];
|
5561
|
+
if (primaryMeasures) {
|
5562
|
+
const arrPrimaryMeasures = Array.isArray(primaryMeasures) ? primaryMeasures : [
|
5563
|
+
primaryMeasures
|
5564
|
+
];
|
5565
|
+
groupChildren.push({
|
5566
|
+
id: `${index}-primary`,
|
5567
|
+
alias: primaryAlias || arrPrimaryMeasures.map((item)=>item.alias || item.id).toString(),
|
5568
|
+
children: arrPrimaryMeasures
|
5569
|
+
});
|
5570
|
+
}
|
5571
|
+
if (secondaryMeasures) {
|
5572
|
+
const arrSecondaryMeasures = Array.isArray(secondaryMeasures) ? secondaryMeasures : [
|
5573
|
+
secondaryMeasures
|
5574
|
+
];
|
5575
|
+
groupChildren.push({
|
5576
|
+
id: `${index}-secondary`,
|
5577
|
+
alias: secondaryAlias || arrSecondaryMeasures.map((item)=>item.alias || item.id).toString(),
|
5578
|
+
children: arrSecondaryMeasures
|
5579
|
+
});
|
5580
|
+
}
|
5581
|
+
const id = [
|
5582
|
+
primaryAlias,
|
5583
|
+
secondaryAlias,
|
5584
|
+
index
|
5585
|
+
].filter((d)=>!isNullish(d)).join('-');
|
5586
|
+
return {
|
5587
|
+
id,
|
5588
|
+
alias: id,
|
5589
|
+
children: groupChildren
|
5590
|
+
};
|
5591
|
+
});
|
5592
|
+
if (1 === dualMeasures.length) return measureTree[0].children || [];
|
5593
|
+
return measureTree;
|
5594
|
+
};
|
5595
|
+
const dualAxisAdvancedPipeline = [
|
5454
5596
|
initAdvancedVSeed_initAdvancedVSeed,
|
5455
|
-
|
5597
|
+
autoDualMeasures,
|
5456
5598
|
autoDimensions_autoDimensions,
|
5457
5599
|
pivotAdapter([
|
5458
|
-
|
5600
|
+
reshapeTo2D2M
|
5459
5601
|
], [
|
5460
|
-
|
5602
|
+
pivotReshapeTo2D2M
|
5461
5603
|
]),
|
5462
|
-
|
5463
|
-
|
5604
|
+
encodingXYY,
|
5605
|
+
sortXBandAxis,
|
5606
|
+
sort_sortLegend,
|
5607
|
+
dualAxisConfig,
|
5464
5608
|
theme_theme,
|
5609
|
+
markStyle_markStyle,
|
5465
5610
|
annotation_annotation
|
5466
5611
|
];
|
5467
|
-
const
|
5612
|
+
const initDualAxisPrimary = (spec, context)=>{
|
5468
5613
|
const result = {
|
5469
5614
|
...spec
|
5470
5615
|
};
|
5471
5616
|
const { advancedVSeed } = context;
|
5472
|
-
const { encoding,
|
5473
|
-
if (!encoding[0].
|
5474
|
-
|
5475
|
-
result.type = '
|
5476
|
-
result.
|
5477
|
-
result.
|
5478
|
-
result.
|
5479
|
-
result.categoryField = encoding[0].angle[0];
|
5617
|
+
const { encoding, datasetReshapeInfo } = advancedVSeed;
|
5618
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
5619
|
+
result.id = `${datasetReshapeInfo[0].id}-primary-series`;
|
5620
|
+
result.type = 'bar';
|
5621
|
+
result.direction = 'vertical';
|
5622
|
+
result.xField = encoding[0].x[0];
|
5623
|
+
result.yField = encoding[0].y[0];
|
5480
5624
|
result.seriesField = encoding[0].group[0];
|
5481
|
-
result.
|
5625
|
+
result.animation = true;
|
5626
|
+
return result;
|
5627
|
+
};
|
5628
|
+
const initDualAxisSecondary = (spec, context)=>{
|
5629
|
+
const result = {
|
5630
|
+
...spec
|
5631
|
+
};
|
5632
|
+
const { advancedVSeed } = context;
|
5633
|
+
const { encoding, datasetReshapeInfo } = advancedVSeed;
|
5634
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
5635
|
+
result.id = `${datasetReshapeInfo[0].id}-secondary-series`;
|
5636
|
+
result.type = 'line';
|
5637
|
+
result.direction = 'vertical';
|
5638
|
+
result.xField = encoding[0].x[0];
|
5639
|
+
result.yField = encoding[0].y[1];
|
5640
|
+
result.seriesField = encoding[0].group[0];
|
5641
|
+
result.animation = true;
|
5642
|
+
return result;
|
5643
|
+
};
|
5644
|
+
const dualChartTypePrimary = (spec, context)=>{
|
5645
|
+
const result = {
|
5646
|
+
...spec
|
5647
|
+
};
|
5648
|
+
const { advancedVSeed, vseed } = context;
|
5649
|
+
const { chartType } = vseed;
|
5650
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
5651
|
+
const index = datasetReshapeInfo[0].index;
|
5652
|
+
const config = advancedVSeed.config?.[chartType]?.dualChartType || {
|
5653
|
+
primary: 'column',
|
5654
|
+
secondary: 'line'
|
5655
|
+
};
|
5656
|
+
const primary = Array.isArray(config) ? config[index].primary || config[0].primary : config.primary;
|
5657
|
+
switch(primary){
|
5658
|
+
case 'line':
|
5659
|
+
result.type = 'line';
|
5660
|
+
break;
|
5661
|
+
case 'column':
|
5662
|
+
result.type = 'bar';
|
5663
|
+
break;
|
5664
|
+
case 'columnParallel':
|
5665
|
+
{
|
5666
|
+
const columnSpec = result;
|
5667
|
+
if (Array.isArray(columnSpec.xField)) columnSpec.xField.push(datasetReshapeInfo[0].unfoldInfo.groupId);
|
5668
|
+
else if (columnSpec.xField) columnSpec.xField = [
|
5669
|
+
columnSpec.xField,
|
5670
|
+
datasetReshapeInfo[0].unfoldInfo.groupId
|
5671
|
+
];
|
5672
|
+
columnSpec.type = 'bar';
|
5673
|
+
break;
|
5674
|
+
}
|
5675
|
+
case 'columnPercent':
|
5676
|
+
result.type = 'bar';
|
5677
|
+
result.percent = true;
|
5678
|
+
break;
|
5679
|
+
case 'area':
|
5680
|
+
result.type = 'area';
|
5681
|
+
break;
|
5682
|
+
case 'areaPercent':
|
5683
|
+
result.type = 'area';
|
5684
|
+
result.percent = true;
|
5685
|
+
break;
|
5686
|
+
case 'scatter':
|
5687
|
+
result.type = 'scatter';
|
5688
|
+
break;
|
5689
|
+
default:
|
5690
|
+
result.type = primary;
|
5691
|
+
}
|
5692
|
+
return result;
|
5693
|
+
};
|
5694
|
+
const dualChartTypeSecondary = (spec, context)=>{
|
5695
|
+
const result = {
|
5696
|
+
...spec
|
5697
|
+
};
|
5698
|
+
const { advancedVSeed, vseed } = context;
|
5699
|
+
const { chartType } = vseed;
|
5700
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
5701
|
+
const config = advancedVSeed.config?.[chartType]?.dualChartType || {
|
5702
|
+
primary: 'column',
|
5703
|
+
secondary: 'line'
|
5704
|
+
};
|
5705
|
+
const index = datasetReshapeInfo[0].index;
|
5706
|
+
const secondary = Array.isArray(config) ? config[index].secondary || config[0].secondary : config.secondary;
|
5707
|
+
switch(secondary){
|
5708
|
+
case 'line':
|
5709
|
+
result.type = 'line';
|
5710
|
+
break;
|
5711
|
+
case 'column':
|
5712
|
+
result.type = 'bar';
|
5713
|
+
break;
|
5714
|
+
case 'columnParallel':
|
5715
|
+
{
|
5716
|
+
const columnSpec = result;
|
5717
|
+
if (Array.isArray(columnSpec.xField)) columnSpec.xField.push(datasetReshapeInfo[0].unfoldInfo.groupId);
|
5718
|
+
else if (columnSpec.xField) columnSpec.xField = [
|
5719
|
+
columnSpec.xField,
|
5720
|
+
datasetReshapeInfo[0].unfoldInfo.groupId
|
5721
|
+
];
|
5722
|
+
columnSpec.type = 'bar';
|
5723
|
+
break;
|
5724
|
+
}
|
5725
|
+
case 'columnPercent':
|
5726
|
+
result.type = 'bar';
|
5727
|
+
result.percent = true;
|
5728
|
+
break;
|
5729
|
+
case 'area':
|
5730
|
+
result.type = 'area';
|
5731
|
+
break;
|
5732
|
+
case 'areaPercent':
|
5733
|
+
result.type = 'area';
|
5734
|
+
result.percent = true;
|
5735
|
+
break;
|
5736
|
+
case 'scatter':
|
5737
|
+
result.type = 'scatter';
|
5738
|
+
break;
|
5739
|
+
default:
|
5740
|
+
result.type = secondary;
|
5741
|
+
}
|
5742
|
+
return result;
|
5743
|
+
};
|
5744
|
+
const datasetPrimary = (spec, context)=>{
|
5745
|
+
const { advancedVSeed, vseed } = context;
|
5746
|
+
const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
|
5747
|
+
const { orderMapping = {} } = analysis ?? {};
|
5748
|
+
const x = encoding[0]?.x?.[0];
|
5749
|
+
const group = encoding[0]?.group?.[0];
|
5750
|
+
const id = datasetReshapeInfo[0].id;
|
5751
|
+
const fields = {};
|
5752
|
+
if (x) {
|
5753
|
+
const order = orderMapping[x];
|
5754
|
+
if (order) fields[x] = {
|
5755
|
+
sortIndex: 0,
|
5756
|
+
domain: order,
|
5757
|
+
lockStatisticsByDomain: true
|
5758
|
+
};
|
5759
|
+
else fields[x] = {
|
5760
|
+
sortIndex: 0
|
5761
|
+
};
|
5762
|
+
}
|
5763
|
+
if (group) {
|
5764
|
+
const order = orderMapping[group];
|
5765
|
+
if (order) fields[group] = {
|
5766
|
+
sortIndex: 0,
|
5767
|
+
domain: order,
|
5768
|
+
lockStatisticsByDomain: true
|
5769
|
+
};
|
5770
|
+
else fields[group] = {
|
5771
|
+
sortIndex: 0
|
5772
|
+
};
|
5773
|
+
}
|
5774
|
+
return {
|
5775
|
+
...spec,
|
5776
|
+
data: {
|
5777
|
+
id: `${id}-primary-dataset`,
|
5778
|
+
values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset[0],
|
5779
|
+
fields: fields
|
5780
|
+
}
|
5781
|
+
};
|
5782
|
+
};
|
5783
|
+
const datasetSecondary = (spec, context)=>{
|
5784
|
+
const { advancedVSeed, vseed } = context;
|
5785
|
+
const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
|
5786
|
+
const { orderMapping = {} } = analysis ?? {};
|
5787
|
+
const x = encoding[0]?.x?.[0];
|
5788
|
+
const group = encoding[0]?.group?.[0];
|
5789
|
+
const id = datasetReshapeInfo[0].id;
|
5790
|
+
const fields = {};
|
5791
|
+
if (x) {
|
5792
|
+
const order = orderMapping[x];
|
5793
|
+
if (order) fields[x] = {
|
5794
|
+
sortIndex: 0,
|
5795
|
+
domain: order,
|
5796
|
+
lockStatisticsByDomain: true
|
5797
|
+
};
|
5798
|
+
else fields[x] = {
|
5799
|
+
sortIndex: 0
|
5800
|
+
};
|
5801
|
+
}
|
5802
|
+
if (group) {
|
5803
|
+
const order = orderMapping[group];
|
5804
|
+
if (order) fields[group] = {
|
5805
|
+
sortIndex: 0,
|
5806
|
+
domain: order,
|
5807
|
+
lockStatisticsByDomain: true
|
5808
|
+
};
|
5809
|
+
else fields[group] = {
|
5810
|
+
sortIndex: 0
|
5811
|
+
};
|
5812
|
+
}
|
5813
|
+
return {
|
5814
|
+
...spec,
|
5815
|
+
data: {
|
5816
|
+
id: `${id}-secondary-dataset`,
|
5817
|
+
values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset[1],
|
5818
|
+
fields: fields
|
5819
|
+
}
|
5820
|
+
};
|
5821
|
+
};
|
5822
|
+
const labelPrimary = (spec, context)=>{
|
5823
|
+
const result = {
|
5824
|
+
...spec
|
5825
|
+
};
|
5826
|
+
const { advancedVSeed } = context;
|
5827
|
+
const { measures, datasetReshapeInfo, locale } = advancedVSeed;
|
5828
|
+
const { chartType } = advancedVSeed;
|
5829
|
+
const baseConfig = advancedVSeed.config[chartType];
|
5830
|
+
if (!baseConfig || !baseConfig.label) return result;
|
5831
|
+
const foldInfoList = datasetReshapeInfo[0].foldInfoList;
|
5832
|
+
const { measureId, measureValue } = foldInfoList[0];
|
5833
|
+
const { label } = baseConfig;
|
5834
|
+
const { enable } = label;
|
5835
|
+
result.label = {
|
5836
|
+
visible: enable,
|
5837
|
+
formatMethod: (value, datum)=>{
|
5838
|
+
const result = [];
|
5839
|
+
const formatValue = (value)=>{
|
5840
|
+
const id = datum[measureId];
|
5841
|
+
const measure = findMeasureById(measures, id);
|
5842
|
+
if (!measure) return value;
|
5843
|
+
const { format = {}, autoFormat = true } = measure;
|
5844
|
+
if (!isEmpty(format)) {
|
5845
|
+
const formatter = createFormatter(format);
|
5846
|
+
return formatter(value);
|
5847
|
+
}
|
5848
|
+
if (autoFormat) return autoFormatter(value, locale);
|
5849
|
+
return String(value);
|
5850
|
+
};
|
5851
|
+
result.push(formatValue(datum[measureValue]));
|
5852
|
+
return result.join(' ');
|
5853
|
+
}
|
5854
|
+
};
|
5855
|
+
return result;
|
5856
|
+
};
|
5857
|
+
const labelSecondary = (spec, context)=>{
|
5858
|
+
const result = {
|
5859
|
+
...spec
|
5860
|
+
};
|
5861
|
+
const { advancedVSeed } = context;
|
5862
|
+
const { measures, datasetReshapeInfo, locale } = advancedVSeed;
|
5863
|
+
const { chartType } = advancedVSeed;
|
5864
|
+
const baseConfig = advancedVSeed.config[chartType];
|
5865
|
+
if (!baseConfig || !baseConfig.label) return result;
|
5866
|
+
if (isNullish(datasetReshapeInfo[0].foldInfoList?.[1])) return result;
|
5867
|
+
const foldInfoList = datasetReshapeInfo[0].foldInfoList;
|
5868
|
+
const { measureId, measureValue } = foldInfoList[1];
|
5869
|
+
const { label } = baseConfig;
|
5870
|
+
const { enable } = label;
|
5871
|
+
result.label = {
|
5872
|
+
visible: enable,
|
5873
|
+
formatMethod: (value, datum)=>{
|
5874
|
+
const result = [];
|
5875
|
+
const formatValue = (value)=>{
|
5876
|
+
const id = datum[measureId];
|
5877
|
+
const measure = findMeasureById(measures, id);
|
5878
|
+
if (!measure) return value;
|
5879
|
+
const { format = {}, autoFormat = true } = measure;
|
5880
|
+
if (!isEmpty(format)) {
|
5881
|
+
const formatter = createFormatter(format);
|
5882
|
+
return formatter(value);
|
5883
|
+
}
|
5884
|
+
if (autoFormat) return autoFormatter(value, locale);
|
5885
|
+
return String(value);
|
5886
|
+
};
|
5887
|
+
result.push(formatValue(datum[measureValue]));
|
5888
|
+
return result.join(' ');
|
5889
|
+
}
|
5890
|
+
};
|
5891
|
+
return result;
|
5892
|
+
};
|
5893
|
+
const tooltipPrimary = (spec, context)=>{
|
5894
|
+
const result = {
|
5895
|
+
...spec
|
5896
|
+
};
|
5897
|
+
const { advancedVSeed } = context;
|
5898
|
+
const { measures, datasetReshapeInfo, chartType, locale, dimensions } = advancedVSeed;
|
5899
|
+
const baseConfig = advancedVSeed.config[chartType];
|
5900
|
+
const { tooltip = {
|
5901
|
+
enable: true
|
5902
|
+
} } = baseConfig;
|
5903
|
+
const { enable } = tooltip;
|
5904
|
+
const foldInfoList = datasetReshapeInfo[0].foldInfoList;
|
5905
|
+
const unfoldInfo = datasetReshapeInfo[0].unfoldInfo;
|
5906
|
+
const { measureId, measureValue, measureName } = foldInfoList[0];
|
5907
|
+
const { groupName } = unfoldInfo;
|
5908
|
+
result.tooltip = {
|
5909
|
+
visible: enable,
|
5910
|
+
mark: {
|
5911
|
+
title: {
|
5912
|
+
visible: true
|
5913
|
+
},
|
5914
|
+
content: [
|
5915
|
+
...dimensions.map((item)=>({
|
5916
|
+
visible: true,
|
5917
|
+
hasShape: true,
|
5918
|
+
shapeType: 'rectRound',
|
5919
|
+
key: (datum)=>{
|
5920
|
+
if (item.alias || item.id) return item.alias || item.id;
|
5921
|
+
return datum && datum[item.id];
|
5922
|
+
},
|
5923
|
+
value: (datum)=>datum && datum[item.id]
|
5924
|
+
})),
|
5925
|
+
{
|
5926
|
+
visible: true,
|
5927
|
+
hasShape: true,
|
5928
|
+
key: (datum)=>datum && datum[measureName || groupName] || '',
|
5929
|
+
value: (datum)=>{
|
5930
|
+
if (!datum) return '';
|
5931
|
+
const value = datum[measureValue];
|
5932
|
+
const id = datum[measureId];
|
5933
|
+
const measure = findMeasureById(measures, id);
|
5934
|
+
if (!measure) return String(value);
|
5935
|
+
const { format = {}, autoFormat = true } = measure;
|
5936
|
+
if (!isEmpty(format)) {
|
5937
|
+
const formatter = createFormatter(format);
|
5938
|
+
return formatter(value);
|
5939
|
+
}
|
5940
|
+
if (autoFormat) return autoFormatter(value, locale);
|
5941
|
+
return String(value);
|
5942
|
+
}
|
5943
|
+
}
|
5944
|
+
]
|
5945
|
+
},
|
5946
|
+
dimension: {
|
5947
|
+
content: [
|
5948
|
+
{
|
5949
|
+
visible: true,
|
5950
|
+
key: (datum)=>datum && datum[groupName] || '',
|
5951
|
+
value: (datum)=>{
|
5952
|
+
if (!datum) return '';
|
5953
|
+
const value = datum[measureValue];
|
5954
|
+
const id = datum[measureId];
|
5955
|
+
const measure = findMeasureById(measures, id);
|
5956
|
+
if (!measure) return String(value);
|
5957
|
+
const { format = {}, autoFormat = true } = measure;
|
5958
|
+
if (!isEmpty(format)) {
|
5959
|
+
const formatter = createFormatter(format);
|
5960
|
+
return formatter(value);
|
5961
|
+
}
|
5962
|
+
if (autoFormat) return autoFormatter(value, locale);
|
5963
|
+
return String(value);
|
5964
|
+
},
|
5965
|
+
shapeType: 'rectRound'
|
5966
|
+
}
|
5967
|
+
]
|
5968
|
+
}
|
5969
|
+
};
|
5970
|
+
return result;
|
5971
|
+
};
|
5972
|
+
const tooltipSecondary = (spec, context)=>{
|
5973
|
+
const result = {
|
5974
|
+
...spec
|
5975
|
+
};
|
5976
|
+
const { advancedVSeed } = context;
|
5977
|
+
const { measures, datasetReshapeInfo, chartType, locale, dimensions } = advancedVSeed;
|
5978
|
+
const baseConfig = advancedVSeed.config[chartType];
|
5979
|
+
const { tooltip = {
|
5980
|
+
enable: true
|
5981
|
+
} } = baseConfig;
|
5982
|
+
const { enable } = tooltip;
|
5983
|
+
if (isNullish(datasetReshapeInfo[0].foldInfoList?.[1])) return result;
|
5984
|
+
const foldInfoList = datasetReshapeInfo[0].foldInfoList;
|
5985
|
+
const unfoldInfo = datasetReshapeInfo[0].unfoldInfo;
|
5986
|
+
const { measureId, measureValue, measureName } = foldInfoList[1];
|
5987
|
+
const { groupName } = unfoldInfo;
|
5988
|
+
result.tooltip = {
|
5989
|
+
visible: enable,
|
5990
|
+
mark: {
|
5991
|
+
title: {
|
5992
|
+
visible: true
|
5993
|
+
},
|
5994
|
+
content: [
|
5995
|
+
...dimensions.map((item)=>({
|
5996
|
+
visible: true,
|
5997
|
+
hasShape: true,
|
5998
|
+
shapeType: 'rectRound',
|
5999
|
+
key: (datum)=>{
|
6000
|
+
if (item.alias || item.id) return item.alias || item.id;
|
6001
|
+
return datum && datum[item.id];
|
6002
|
+
},
|
6003
|
+
value: (datum)=>datum && datum[item.id]
|
6004
|
+
})),
|
6005
|
+
{
|
6006
|
+
visible: true,
|
6007
|
+
hasShape: true,
|
6008
|
+
key: (datum)=>datum && datum[measureName || groupName] || '',
|
6009
|
+
value: (datum)=>{
|
6010
|
+
if (!datum) return '';
|
6011
|
+
const value = datum[measureValue];
|
6012
|
+
const id = datum[measureId];
|
6013
|
+
const measure = findMeasureById(measures, id);
|
6014
|
+
if (!measure) return String(value);
|
6015
|
+
const { format = {}, autoFormat = true } = measure;
|
6016
|
+
if (!isEmpty(format)) {
|
6017
|
+
const formatter = createFormatter(format);
|
6018
|
+
return formatter(value);
|
6019
|
+
}
|
6020
|
+
if (autoFormat) return autoFormatter(value, locale);
|
6021
|
+
return String(value);
|
6022
|
+
}
|
6023
|
+
}
|
6024
|
+
]
|
6025
|
+
},
|
6026
|
+
dimension: {
|
6027
|
+
content: [
|
6028
|
+
{
|
6029
|
+
visible: true,
|
6030
|
+
key: (datum)=>datum && datum[groupName] || '',
|
6031
|
+
value: (datum)=>{
|
6032
|
+
if (!datum) return '';
|
6033
|
+
const value = datum[measureValue];
|
6034
|
+
const id = datum[measureId];
|
6035
|
+
const measure = findMeasureById(measures, id);
|
6036
|
+
if (!measure) return String(value);
|
6037
|
+
const { format = {}, autoFormat = true } = measure;
|
6038
|
+
if (!isEmpty(format)) {
|
6039
|
+
const formatter = createFormatter(format);
|
6040
|
+
return formatter(value);
|
6041
|
+
}
|
6042
|
+
if (autoFormat) return autoFormatter(value, locale);
|
6043
|
+
return String(value);
|
6044
|
+
},
|
6045
|
+
shapeType: 'rectRound'
|
6046
|
+
}
|
6047
|
+
]
|
6048
|
+
}
|
6049
|
+
};
|
6050
|
+
return result;
|
6051
|
+
};
|
6052
|
+
const yLinearPrimary = (spec, context)=>{
|
6053
|
+
const result = {
|
6054
|
+
...spec
|
6055
|
+
};
|
6056
|
+
const { advancedVSeed, vseed } = context;
|
6057
|
+
const { chartType } = vseed;
|
6058
|
+
const { locale, datasetReshapeInfo } = advancedVSeed;
|
6059
|
+
const config = advancedVSeed.config?.[chartType]?.primaryYAxis;
|
6060
|
+
if (datasetReshapeInfo[0].foldInfoList?.[0] && isEmpty(datasetReshapeInfo[0].foldInfoList[0].foldMap)) return result;
|
6061
|
+
const id = `${datasetReshapeInfo[0].id}-primary-axis`;
|
6062
|
+
const seriesId = `${datasetReshapeInfo[0].id}-primary-series`;
|
6063
|
+
if (!result.axes) result.axes = [];
|
6064
|
+
if (!config) {
|
6065
|
+
result.axes = [
|
6066
|
+
...result.axes,
|
6067
|
+
{
|
6068
|
+
visible: true,
|
6069
|
+
id,
|
6070
|
+
seriesId,
|
6071
|
+
type: 'linear',
|
6072
|
+
orient: 'left',
|
6073
|
+
sync: {
|
6074
|
+
axisId: `${datasetReshapeInfo[0].id}-secondary-axis`,
|
6075
|
+
tickAlign: false,
|
6076
|
+
zeroAlign: true
|
6077
|
+
}
|
6078
|
+
}
|
6079
|
+
];
|
6080
|
+
return result;
|
6081
|
+
}
|
6082
|
+
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10 } = config;
|
6083
|
+
const linearAxis = {
|
6084
|
+
visible,
|
6085
|
+
id,
|
6086
|
+
seriesId,
|
6087
|
+
sync: {
|
6088
|
+
axisId: `${datasetReshapeInfo[0].id}-secondary-axis`,
|
6089
|
+
tickAlign: false,
|
6090
|
+
zeroAlign: true
|
6091
|
+
},
|
6092
|
+
type: log ? 'log' : 'linear',
|
6093
|
+
base: logBase,
|
6094
|
+
orient: 'left',
|
6095
|
+
nice,
|
6096
|
+
zero: log ? false : zero,
|
6097
|
+
inverse,
|
6098
|
+
max,
|
6099
|
+
min,
|
6100
|
+
label: {
|
6101
|
+
visible: label?.visible,
|
6102
|
+
formatMethod: (value)=>autoFormatter(value, locale),
|
6103
|
+
style: {
|
6104
|
+
fill: label?.labelColor,
|
6105
|
+
angle: label?.labelAngle,
|
6106
|
+
fontSize: label?.labelFontSize,
|
6107
|
+
fontWeight: label?.labelFontWeight
|
6108
|
+
}
|
6109
|
+
},
|
6110
|
+
title: {
|
6111
|
+
visible: title?.visible,
|
6112
|
+
text: title?.titleText,
|
6113
|
+
style: {
|
6114
|
+
fill: title?.titleColor,
|
6115
|
+
fontSize: title?.titleFontSize,
|
6116
|
+
fontWeight: title?.titleFontWeight
|
6117
|
+
}
|
6118
|
+
},
|
6119
|
+
tick: {
|
6120
|
+
visible: tick?.visible,
|
6121
|
+
tickSize: tick?.tickSize,
|
6122
|
+
inside: tick?.tickInside,
|
6123
|
+
style: {
|
6124
|
+
stroke: tick?.tickColor
|
6125
|
+
}
|
6126
|
+
},
|
6127
|
+
grid: {
|
6128
|
+
visible: grid?.visible,
|
6129
|
+
style: {
|
6130
|
+
lineWidth: grid?.gridWidth,
|
6131
|
+
stroke: grid?.gridColor
|
6132
|
+
}
|
6133
|
+
},
|
6134
|
+
domainLine: {
|
6135
|
+
visible: line?.visible,
|
6136
|
+
style: {
|
6137
|
+
lineWidth: line?.lineWidth,
|
6138
|
+
stroke: line?.lineColor
|
6139
|
+
}
|
6140
|
+
},
|
6141
|
+
innerOffset: {
|
6142
|
+
top: LINEAR_AXIS_INNER_OFFSET_TOP
|
6143
|
+
}
|
6144
|
+
};
|
6145
|
+
result.axes = [
|
6146
|
+
...result.axes,
|
6147
|
+
linearAxis
|
6148
|
+
];
|
6149
|
+
return result;
|
6150
|
+
};
|
6151
|
+
const yLinearSecondary = (spec, context)=>{
|
6152
|
+
const result = {
|
6153
|
+
...spec
|
6154
|
+
};
|
6155
|
+
const { advancedVSeed, vseed } = context;
|
6156
|
+
const { chartType } = vseed;
|
6157
|
+
const { locale, datasetReshapeInfo } = advancedVSeed;
|
6158
|
+
const config = advancedVSeed.config?.[chartType]?.secondaryYAxis;
|
6159
|
+
if (isNullish(datasetReshapeInfo[0].foldInfoList?.[1])) return result;
|
6160
|
+
const id = `${datasetReshapeInfo[0].id}-secondary-axis`;
|
6161
|
+
const seriesId = `${datasetReshapeInfo[0].id}-secondary-series`;
|
6162
|
+
if (!result.axes) result.axes = [];
|
6163
|
+
if (!config) {
|
6164
|
+
result.axes = [
|
6165
|
+
...result.axes,
|
6166
|
+
{
|
6167
|
+
visible: true,
|
6168
|
+
id,
|
6169
|
+
seriesId,
|
6170
|
+
type: 'linear',
|
6171
|
+
orient: 'right'
|
6172
|
+
}
|
6173
|
+
];
|
6174
|
+
return result;
|
6175
|
+
}
|
6176
|
+
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10 } = config;
|
6177
|
+
const linearAxis = {
|
6178
|
+
visible,
|
6179
|
+
id,
|
6180
|
+
seriesId,
|
6181
|
+
type: log ? 'log' : 'linear',
|
6182
|
+
base: logBase,
|
6183
|
+
orient: 'right',
|
6184
|
+
nice,
|
6185
|
+
zero: log ? false : zero,
|
6186
|
+
inverse,
|
6187
|
+
max,
|
6188
|
+
min,
|
6189
|
+
label: {
|
6190
|
+
visible: label?.visible,
|
6191
|
+
formatMethod: (value)=>autoFormatter(value, locale),
|
6192
|
+
style: {
|
6193
|
+
fill: label?.labelColor,
|
6194
|
+
angle: label?.labelAngle,
|
6195
|
+
fontSize: label?.labelFontSize,
|
6196
|
+
fontWeight: label?.labelFontWeight
|
6197
|
+
}
|
6198
|
+
},
|
6199
|
+
title: {
|
6200
|
+
visible: title?.visible,
|
6201
|
+
text: title?.titleText,
|
6202
|
+
style: {
|
6203
|
+
fill: title?.titleColor,
|
6204
|
+
fontSize: title?.titleFontSize,
|
6205
|
+
fontWeight: title?.titleFontWeight
|
6206
|
+
}
|
6207
|
+
},
|
6208
|
+
tick: {
|
6209
|
+
visible: tick?.visible,
|
6210
|
+
tickSize: tick?.tickSize,
|
6211
|
+
inside: tick?.tickInside,
|
6212
|
+
style: {
|
6213
|
+
stroke: tick?.tickColor
|
6214
|
+
}
|
6215
|
+
},
|
6216
|
+
grid: {
|
6217
|
+
visible: grid?.visible,
|
6218
|
+
style: {
|
6219
|
+
lineWidth: grid?.gridWidth,
|
6220
|
+
stroke: grid?.gridColor
|
6221
|
+
}
|
6222
|
+
},
|
6223
|
+
domainLine: {
|
6224
|
+
visible: line?.visible,
|
6225
|
+
style: {
|
6226
|
+
lineWidth: line?.lineWidth,
|
6227
|
+
stroke: line?.lineColor
|
6228
|
+
}
|
6229
|
+
},
|
6230
|
+
innerOffset: {
|
6231
|
+
top: LINEAR_AXIS_INNER_OFFSET_TOP
|
6232
|
+
}
|
6233
|
+
};
|
6234
|
+
result.axes = [
|
6235
|
+
...result.axes,
|
6236
|
+
linearAxis
|
6237
|
+
];
|
6238
|
+
return result;
|
6239
|
+
};
|
6240
|
+
const dualAxis = [
|
6241
|
+
series([
|
6242
|
+
initDualAxisPrimary,
|
6243
|
+
dualChartTypePrimary,
|
6244
|
+
datasetPrimary,
|
6245
|
+
labelPrimary,
|
6246
|
+
tooltipPrimary,
|
6247
|
+
progressive,
|
6248
|
+
barStyle_barStyle,
|
6249
|
+
pointStyle_pointStyle,
|
6250
|
+
pointStateDimensionHover,
|
6251
|
+
lineStyle_lineStyle,
|
6252
|
+
areaStyle_areaStyle
|
6253
|
+
], [
|
6254
|
+
initDualAxisSecondary,
|
6255
|
+
dualChartTypeSecondary,
|
6256
|
+
datasetSecondary,
|
6257
|
+
labelSecondary,
|
6258
|
+
tooltipSecondary,
|
6259
|
+
progressive,
|
6260
|
+
barStyle_barStyle,
|
6261
|
+
pointStyle_pointStyle,
|
6262
|
+
pointStateDimensionHover,
|
6263
|
+
lineStyle_lineStyle,
|
6264
|
+
areaStyle_areaStyle
|
6265
|
+
]),
|
6266
|
+
xBand,
|
6267
|
+
yLinearPrimary,
|
6268
|
+
yLinearSecondary,
|
6269
|
+
color_color,
|
6270
|
+
background_backgroundColor,
|
6271
|
+
discreteLegend,
|
6272
|
+
verticalCrosshairRect,
|
6273
|
+
annotationPoint_annotationPoint,
|
6274
|
+
annotationVerticalLine_annotationVerticalLine,
|
6275
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
6276
|
+
annotationArea_annotationArea
|
6277
|
+
];
|
6278
|
+
const pivotDualAxis = [
|
6279
|
+
initPivot,
|
6280
|
+
pivotGridStyle,
|
6281
|
+
pivotIndicators_pivotIndicatorsAsRow,
|
6282
|
+
datasetPivot,
|
6283
|
+
pivotIndicators_pivotIndicators([
|
6284
|
+
series([
|
6285
|
+
initDualAxisPrimary,
|
6286
|
+
dualChartTypePrimary,
|
6287
|
+
datasetPrimary,
|
6288
|
+
labelPrimary,
|
6289
|
+
tooltipPrimary,
|
6290
|
+
progressive,
|
6291
|
+
barStyle_barStyle,
|
6292
|
+
pointStyle_pointStyle,
|
6293
|
+
pointStateDimensionHover,
|
6294
|
+
lineStyle_lineStyle,
|
6295
|
+
areaStyle_areaStyle
|
6296
|
+
], [
|
6297
|
+
initDualAxisSecondary,
|
6298
|
+
dualChartTypeSecondary,
|
6299
|
+
datasetSecondary,
|
6300
|
+
labelSecondary,
|
6301
|
+
tooltipSecondary,
|
6302
|
+
progressive,
|
6303
|
+
barStyle_barStyle,
|
6304
|
+
pointStyle_pointStyle,
|
6305
|
+
pointStateDimensionHover,
|
6306
|
+
lineStyle_lineStyle,
|
6307
|
+
areaStyle_areaStyle
|
6308
|
+
]),
|
6309
|
+
xBand,
|
6310
|
+
yLinearPrimary,
|
6311
|
+
yLinearSecondary,
|
6312
|
+
color_color,
|
6313
|
+
background_backgroundColor,
|
6314
|
+
verticalCrosshairRect,
|
6315
|
+
annotationPoint_annotationPoint,
|
6316
|
+
annotationVerticalLine_annotationVerticalLine,
|
6317
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
6318
|
+
annotationArea_annotationArea
|
6319
|
+
]),
|
6320
|
+
pivotRowDimensions,
|
6321
|
+
pivotColumnDimensions,
|
6322
|
+
pivotDiscreteLegend
|
6323
|
+
];
|
6324
|
+
const dualAxisSpecPipeline = [
|
6325
|
+
pivotAdapter_pivotAdapter(dualAxis, pivotDualAxis)
|
6326
|
+
];
|
6327
|
+
const registerDualAxis = ()=>{
|
6328
|
+
Builder._advancedPipelineMap.dualAxis = dualAxisAdvancedPipeline;
|
6329
|
+
Builder._specPipelineMap.dualAxis = dualAxisSpecPipeline;
|
6330
|
+
};
|
6331
|
+
const dataReshapeFor1D1M_emptyReshapeResult = {
|
6332
|
+
dataset: [],
|
6333
|
+
foldInfo: {
|
6334
|
+
foldMap: {},
|
6335
|
+
measureId: '',
|
6336
|
+
measureName: '',
|
6337
|
+
measureValue: ''
|
6338
|
+
},
|
6339
|
+
unfoldInfo: {
|
6340
|
+
groupName: '',
|
6341
|
+
groupId: '',
|
6342
|
+
colorItems: [],
|
6343
|
+
colorIdMap: {}
|
6344
|
+
}
|
6345
|
+
};
|
6346
|
+
const dataReshapeFor1D1M = (dataset, dimensions, measures, options)=>{
|
6347
|
+
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup, unfoldDimensionGroupId = UnfoldDimensionGroupId } = options || {};
|
6348
|
+
if (0 === dimensions.length && 0 === measures.length) return dataReshapeFor1D1M_emptyReshapeResult;
|
6349
|
+
const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, foldMeasureId, foldMeasureName, foldMeasureValue);
|
6350
|
+
if (0 === dimensions.length) {
|
6351
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, [
|
6352
|
+
{
|
6353
|
+
id: foldMeasureName,
|
6354
|
+
alias: i18n`指标名称`,
|
6355
|
+
location: 'dimension'
|
6356
|
+
}
|
6357
|
+
], [
|
6358
|
+
{
|
6359
|
+
id: foldMeasureValue,
|
6360
|
+
alias: i18n`指标值`
|
6361
|
+
}
|
6362
|
+
], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
6363
|
+
return {
|
6364
|
+
dataset: finalDataset,
|
6365
|
+
foldInfo,
|
6366
|
+
unfoldInfo
|
6367
|
+
};
|
6368
|
+
}
|
6369
|
+
{
|
6370
|
+
const dims = 1 === measures.length ? [
|
6371
|
+
...dimensions
|
6372
|
+
] : [
|
6373
|
+
...dimensions,
|
6374
|
+
{
|
6375
|
+
id: foldMeasureName,
|
6376
|
+
alias: i18n`指标名称`,
|
6377
|
+
location: 'dimension'
|
6378
|
+
}
|
6379
|
+
];
|
6380
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, dims, [
|
6381
|
+
{
|
6382
|
+
id: foldMeasureValue,
|
6383
|
+
alias: i18n`指标值`
|
6384
|
+
}
|
6385
|
+
], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
6386
|
+
return {
|
6387
|
+
dataset: finalDataset,
|
6388
|
+
foldInfo,
|
6389
|
+
unfoldInfo
|
6390
|
+
};
|
6391
|
+
}
|
6392
|
+
};
|
6393
|
+
const reshapeTo1D1M = (advancedVSeed, context)=>{
|
6394
|
+
const result = {
|
6395
|
+
...advancedVSeed
|
6396
|
+
};
|
6397
|
+
const { vseed } = context;
|
6398
|
+
const { dataset } = vseed;
|
6399
|
+
const { dimensions, measures } = advancedVSeed;
|
6400
|
+
if (!measures || !dimensions || !dataset) return result;
|
6401
|
+
if (0 === measures.length) throw new Error('measures can not be empty');
|
6402
|
+
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeFor1D1M(dataset, dimensions, measures);
|
6403
|
+
return {
|
6404
|
+
...result,
|
6405
|
+
dataset: newDatasets,
|
6406
|
+
datasetReshapeInfo: [
|
6407
|
+
{
|
6408
|
+
id: '1D1M',
|
6409
|
+
index: 0,
|
6410
|
+
foldInfo,
|
6411
|
+
unfoldInfo
|
6412
|
+
}
|
6413
|
+
]
|
6414
|
+
};
|
6415
|
+
};
|
6416
|
+
const pivotReshapeTo1D1M = (advancedVSeed, context)=>{
|
6417
|
+
const result = {
|
6418
|
+
...advancedVSeed
|
6419
|
+
};
|
6420
|
+
const { vseed } = context;
|
6421
|
+
const { dataset } = vseed;
|
6422
|
+
const { measures } = advancedVSeed;
|
6423
|
+
const dimensions = advancedVSeed.dimensions;
|
6424
|
+
if (!measures || !dimensions) return result;
|
6425
|
+
const measureGroups = [];
|
6426
|
+
if (measures) measures.forEach((measure)=>{
|
6427
|
+
if (measure.children && measure.children.length > 0) measureGroups.push(measure);
|
6428
|
+
});
|
6429
|
+
const newDatasets = [];
|
6430
|
+
const datasetReshapeInfo = [];
|
6431
|
+
measureGroups.forEach((measureGroup, index)=>{
|
6432
|
+
const measures = measureGroup.children;
|
6433
|
+
if (!measures) return;
|
6434
|
+
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
6435
|
+
const groupId = measureGroup.id;
|
6436
|
+
const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeFor1D1M(dataset, commonDimensions, measures, {
|
6437
|
+
foldMeasureId: FoldMeasureId,
|
6438
|
+
foldMeasureName: FoldMeasureName,
|
6439
|
+
foldMeasureValue: FoldMeasureValue + groupId,
|
6440
|
+
unfoldDimensionGroup: UnfoldDimensionGroup
|
6441
|
+
});
|
6442
|
+
const reshapeInfo = {
|
6443
|
+
id: groupId,
|
6444
|
+
index,
|
6445
|
+
foldInfo,
|
6446
|
+
unfoldInfo
|
6447
|
+
};
|
6448
|
+
newDatasets.push(newSubDataset);
|
6449
|
+
datasetReshapeInfo.push(reshapeInfo);
|
6450
|
+
});
|
6451
|
+
return {
|
6452
|
+
...result,
|
6453
|
+
dataset: newDatasets,
|
6454
|
+
datasetReshapeInfo: datasetReshapeInfo
|
6455
|
+
};
|
6456
|
+
};
|
6457
|
+
const encodingPie = (advancedVSeed)=>{
|
6458
|
+
const result = {
|
6459
|
+
...advancedVSeed
|
6460
|
+
};
|
6461
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
6462
|
+
if (!datasetReshapeInfo) return result;
|
6463
|
+
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
6464
|
+
const { foldInfo, unfoldInfo } = cur;
|
6465
|
+
const radius = [
|
6466
|
+
foldInfo.measureValue
|
6467
|
+
];
|
6468
|
+
const angle = [
|
6469
|
+
unfoldInfo.groupId
|
6470
|
+
];
|
6471
|
+
const group = [
|
6472
|
+
unfoldInfo.groupId
|
6473
|
+
];
|
6474
|
+
const color = [
|
6475
|
+
unfoldInfo.groupId
|
6476
|
+
];
|
6477
|
+
return [
|
6478
|
+
...prev,
|
6479
|
+
{
|
6480
|
+
angle,
|
6481
|
+
radius,
|
6482
|
+
group,
|
6483
|
+
color
|
6484
|
+
}
|
6485
|
+
];
|
6486
|
+
}, []);
|
6487
|
+
return {
|
6488
|
+
...result,
|
6489
|
+
encoding
|
6490
|
+
};
|
6491
|
+
};
|
6492
|
+
const pieAdvancedPipeline = [
|
6493
|
+
initAdvancedVSeed_initAdvancedVSeed,
|
6494
|
+
autoMeasures_autoMeasures,
|
6495
|
+
autoDimensions_autoDimensions,
|
6496
|
+
pivotAdapter([
|
6497
|
+
reshapeTo1D1M
|
6498
|
+
], [
|
6499
|
+
pivotReshapeTo1D1M
|
6500
|
+
]),
|
6501
|
+
encodingPie,
|
6502
|
+
pieConfig,
|
6503
|
+
theme_theme,
|
6504
|
+
annotation_annotation
|
6505
|
+
];
|
6506
|
+
const initPie = (spec, context)=>{
|
6507
|
+
const result = {
|
6508
|
+
...spec
|
6509
|
+
};
|
6510
|
+
const { advancedVSeed } = context;
|
6511
|
+
const { encoding, dataset } = advancedVSeed;
|
6512
|
+
if (!encoding[0].angle || !encoding[0].radius || !encoding[0].group) return result;
|
6513
|
+
const showStroke = dataset.length <= 30;
|
6514
|
+
result.type = 'pie';
|
6515
|
+
result.outerRadius = 0.8;
|
6516
|
+
result.innerRadius = 0;
|
6517
|
+
result.valueField = encoding[0].radius[0];
|
6518
|
+
result.categoryField = encoding[0].angle[0];
|
6519
|
+
result.seriesField = encoding[0].group[0];
|
6520
|
+
result.padding = 0;
|
5482
6521
|
result.region = [
|
5483
6522
|
{
|
5484
6523
|
clip: true
|
@@ -6756,6 +7795,22 @@ const lightTheme = ()=>{
|
|
6756
7795
|
},
|
6757
7796
|
crosshairLine
|
6758
7797
|
},
|
7798
|
+
dualAxis: {
|
7799
|
+
...baseConfig,
|
7800
|
+
xAxis: bandAxis,
|
7801
|
+
primaryYAxis: linearAxis,
|
7802
|
+
secondaryYAxis: {
|
7803
|
+
...linearAxis,
|
7804
|
+
grid: {
|
7805
|
+
visible: false
|
7806
|
+
}
|
7807
|
+
},
|
7808
|
+
dualChartType: {
|
7809
|
+
primary: 'column',
|
7810
|
+
secondary: 'line'
|
7811
|
+
},
|
7812
|
+
crosshairRect
|
7813
|
+
},
|
6759
7814
|
pie: {
|
6760
7815
|
...baseConfig
|
6761
7816
|
},
|
@@ -7078,6 +8133,22 @@ const darkTheme = ()=>{
|
|
7078
8133
|
},
|
7079
8134
|
crosshairLine
|
7080
8135
|
},
|
8136
|
+
dualAxis: {
|
8137
|
+
...baseConfig,
|
8138
|
+
xAxis: bandAxis,
|
8139
|
+
primaryYAxis: linearAxis,
|
8140
|
+
secondaryYAxis: {
|
8141
|
+
...linearAxis,
|
8142
|
+
grid: {
|
8143
|
+
visible: false
|
8144
|
+
}
|
8145
|
+
},
|
8146
|
+
dualChartType: {
|
8147
|
+
primary: 'column',
|
8148
|
+
secondary: 'line'
|
8149
|
+
},
|
8150
|
+
crosshairRect
|
8151
|
+
},
|
7081
8152
|
pie: {
|
7082
8153
|
...baseConfig
|
7083
8154
|
},
|
@@ -7143,6 +8214,7 @@ const registerAll = ()=>{
|
|
7143
8214
|
registerAreaPercent();
|
7144
8215
|
registerAreaRange();
|
7145
8216
|
registerScatter();
|
8217
|
+
registerDualAxis();
|
7146
8218
|
registerPie();
|
7147
8219
|
registerDonut();
|
7148
8220
|
registerRose();
|
@@ -7182,6 +8254,22 @@ const zChartType = z["enum"]([
|
|
7182
8254
|
'funnel',
|
7183
8255
|
'heatmap'
|
7184
8256
|
]);
|
8257
|
+
const zDualChartType = z.object({
|
8258
|
+
primary: z["enum"]([
|
8259
|
+
'line',
|
8260
|
+
'column',
|
8261
|
+
'columnParallel',
|
8262
|
+
'area',
|
8263
|
+
'scatter'
|
8264
|
+
]).default('column'),
|
8265
|
+
secondary: z["enum"]([
|
8266
|
+
'line',
|
8267
|
+
'column',
|
8268
|
+
'columnParallel',
|
8269
|
+
'area',
|
8270
|
+
'scatter'
|
8271
|
+
]).default('line')
|
8272
|
+
});
|
7185
8273
|
const zDatum = z.record(z.string().or(z.number()), z.any());
|
7186
8274
|
const zDataset = z.array(zDatum);
|
7187
8275
|
const zDimension = z.object({
|
@@ -7247,6 +8335,14 @@ const zMeasureGroup = z.object({
|
|
7247
8335
|
});
|
7248
8336
|
const zMeasures = z.array(zMeasure);
|
7249
8337
|
const zMeasureTree = z.array(zMeasureGroup.or(zMeasure));
|
8338
|
+
const zDualMeasure = z.object({
|
8339
|
+
id: z.string(),
|
8340
|
+
primaryMeasures: z.array(zMeasure).or(zMeasure).optional(),
|
8341
|
+
primaryAlias: z.string().optional(),
|
8342
|
+
secondaryMeasures: z.array(zMeasure).or(zMeasure).optional(),
|
8343
|
+
secondaryAlias: z.string().optional()
|
8344
|
+
});
|
8345
|
+
const zDualMeasures = z.array(zDualMeasure);
|
7250
8346
|
const zFoldInfo = z.object({
|
7251
8347
|
foldMap: z.record(z.string(), z.string().or(z.undefined())),
|
7252
8348
|
measureId: z.string(),
|
@@ -7261,7 +8357,9 @@ const zUnfoldInfo = z.object({
|
|
7261
8357
|
});
|
7262
8358
|
const zDatasetReshapeInfo = z.array(z.object({
|
7263
8359
|
id: z.string(),
|
8360
|
+
index: z.number(),
|
7264
8361
|
foldInfo: zFoldInfo,
|
8362
|
+
foldInfoList: z.array(zFoldInfo).optional(),
|
7265
8363
|
unfoldInfo: zUnfoldInfo
|
7266
8364
|
}));
|
7267
8365
|
const zEncoding = z.array(z.object({
|
@@ -7541,7 +8639,12 @@ const zDualAxisConfig = z.object({
|
|
7541
8639
|
label: zLabel.optional(),
|
7542
8640
|
color: zColor.optional(),
|
7543
8641
|
tooltip: zTooltip.optional(),
|
7544
|
-
legend: zLegend.optional()
|
8642
|
+
legend: zLegend.optional(),
|
8643
|
+
dualChartType: z.array(zDualChartType).or(zDualChartType).optional(),
|
8644
|
+
primaryYAxis: z.array(zYLinearAxis).or(zYLinearAxis).optional(),
|
8645
|
+
secondaryYAxis: z.array(zYLinearAxis).or(zYLinearAxis).optional(),
|
8646
|
+
xAxis: zXBandAxis.optional(),
|
8647
|
+
crosshairRect: zCrosshairRect.optional()
|
7545
8648
|
});
|
7546
8649
|
const zScatterConfig = z.object({
|
7547
8650
|
backgroundColor: zBackgroundColor.optional(),
|
@@ -7585,8 +8688,8 @@ const zConfig = z.object({
|
|
7585
8688
|
area: zAreaConfig.optional(),
|
7586
8689
|
areaPercent: zAreaPercentConfig.optional(),
|
7587
8690
|
areaRange: zAreaRangeConfig.optional(),
|
7588
|
-
dualAxis: zDualAxisConfig.optional(),
|
7589
8691
|
scatter: zScatterConfig.optional(),
|
8692
|
+
dualAxis: zDualAxisConfig.optional(),
|
7590
8693
|
rose: zRoseConfig.optional(),
|
7591
8694
|
roseParallel: zRoseParallelConfig.optional(),
|
7592
8695
|
pie: zPieConfig.optional(),
|
@@ -8239,6 +9342,35 @@ const zScatter = z.object({
|
|
8239
9342
|
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
8240
9343
|
locale: zLocale.optional()
|
8241
9344
|
});
|
9345
|
+
const zDualAxis = z.object({
|
9346
|
+
chartType: z.literal('dualAxis'),
|
9347
|
+
dataset: zDataset.optional(),
|
9348
|
+
dimensions: zDimensions.optional(),
|
9349
|
+
measures: zMeasureTree.optional(),
|
9350
|
+
dualMeasures: zDualMeasures.optional(),
|
9351
|
+
dualChartType: z.array(zDualChartType).or(zDualChartType).optional(),
|
9352
|
+
primaryYAxis: z.array(zYLinearAxis).or(zYLinearAxis).optional(),
|
9353
|
+
secondaryYAxis: z.array(zYLinearAxis).or(zYLinearAxis).optional(),
|
9354
|
+
xAxis: zXBandAxis.optional(),
|
9355
|
+
backgroundColor: zBackgroundColor.optional(),
|
9356
|
+
color: zColor.optional(),
|
9357
|
+
label: zLabel.optional(),
|
9358
|
+
legend: zLegend.optional(),
|
9359
|
+
tooltip: zTooltip.optional(),
|
9360
|
+
crosshairRect: zCrosshairRect.optional(),
|
9361
|
+
sort: zSort.optional(),
|
9362
|
+
sortLegend: zSortLegend.optional(),
|
9363
|
+
theme: zTheme.optional(),
|
9364
|
+
barStyle: z.array(zBarStyle).or(zBarStyle).optional(),
|
9365
|
+
pointStyle: z.array(zPointStyle).or(zPointStyle).optional(),
|
9366
|
+
lineStyle: z.array(zLineStyle).or(zLineStyle).optional(),
|
9367
|
+
areaStyle: z.array(zAreaStyle).or(zAreaStyle).optional(),
|
9368
|
+
annotationPoint: z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
9369
|
+
annotationVerticalLine: z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
9370
|
+
annotationHorizontalLine: z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
9371
|
+
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
9372
|
+
locale: zLocale.optional()
|
9373
|
+
});
|
8242
9374
|
const zRose = z.object({
|
8243
9375
|
chartType: z.literal('rose'),
|
8244
9376
|
dataset: zDataset.optional(),
|
@@ -8344,6 +9476,7 @@ const zVSeed = z.discriminatedUnion('chartType', [
|
|
8344
9476
|
zAreaPercent,
|
8345
9477
|
zAreaRange,
|
8346
9478
|
zScatter,
|
9479
|
+
zDualAxis,
|
8347
9480
|
zPie,
|
8348
9481
|
zDonut,
|
8349
9482
|
zRose,
|
@@ -8367,6 +9500,6 @@ const zAdvancedVSeed = z.object({
|
|
8367
9500
|
annotation: zAnnotation,
|
8368
9501
|
locale: zLocale
|
8369
9502
|
});
|
8370
|
-
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, dataReshapeFor2D1M0Name, donutAdvancedPipeline, donutSpecPipeline, execPipeline, findAllDimensions, findAllMeasures, findDimensionById, findFirstDimension, findFirstMeasure, findMeasureById, foldMeasures, funnelAdvancedPipeline, funnelSpecPipeline, heatmapAdvancedPipeline, heatmapSpecPipeline, i18n, intl, isDimensionSelector, isMeasureSelector, isPartialDatumSelector, isPivotChart, isPivotTable, isTable, isVChart, isVTable, isValueSelector, lightTheme, lineAdvancedPipeline, lineSpecPipeline, pieAdvancedPipeline, pieSpecPipeline, pivotTableAdvancedPipeline, pivotTableSpecPipeline, preorderTraverse, radarAdvancedPipeline, radarSpecPipeline, registerAll, registerArea, registerAreaPercent, registerAreaRange, registerBar, registerBarParallel, registerBarPercent, registerColumn, registerColumnParallel, registerColumnPercent, registerCustomTheme, registerDarkTheme, registerDonut, registerFunnel, registerHeatmap, registerLightTheme, registerLine, registerPie, registerPivotTable, registerRadar, registerRose, registerRoseParallel, registerScatter, registerTable, roseAdvancedPipeline, roseParallelAdvancedPipeline, roseParallelSpecPipeline, roseSpecPipeline, scatterAdvancedPipeline, scatterSpecPipeline, selector_selector as selector, 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, zColorLegend, 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, zHeatmap, zHeatmapConfig, zLabel, zLegend, zLine, zLineConfig, zLineStyle, zLinearColor, zLocale, zMarkStyle, zMeasure, zMeasureGroup, zMeasureTree, zMeasures, zNumFormat, zPie, zPieConfig, zPivotTable, zPivotTableConfig, zPointStyle, zRadar, zRadarConfig, zRose, zRoseConfig, zRoseParallel, zRoseParallelConfig, zScatter, zScatterConfig, zSort, zSortLegend, zStackCornerRadius, zTable, zTableConfig, zTheme, zTooltip, zUnfoldInfo, zVSeed, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
|
9503
|
+
export { Builder, FoldMeasureId, FoldMeasureName, FoldMeasureValue, FoldPrimaryMeasureValue, FoldSecondaryMeasureValue, 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, dataReshapeFor2D1M0Name, donutAdvancedPipeline, donutSpecPipeline, dualAxisAdvancedPipeline, dualAxisSpecPipeline, execPipeline, findAllDimensions, findAllMeasures, findDimensionById, findFirstDimension, findFirstMeasure, findMeasureById, foldMeasures, funnelAdvancedPipeline, funnelSpecPipeline, heatmapAdvancedPipeline, heatmapSpecPipeline, i18n, intl, isDimensionSelector, isMeasureSelector, isPartialDatumSelector, isPivotChart, isPivotTable, isTable, isVChart, isVTable, isValueSelector, lightTheme, lineAdvancedPipeline, lineSpecPipeline, measureDepth, pieAdvancedPipeline, pieSpecPipeline, pivotTableAdvancedPipeline, pivotTableSpecPipeline, preorderTraverse, radarAdvancedPipeline, radarSpecPipeline, registerAll, registerArea, registerAreaPercent, registerAreaRange, registerBar, registerBarParallel, registerBarPercent, registerColumn, registerColumnParallel, registerColumnPercent, registerCustomTheme, registerDarkTheme, registerDonut, registerFunnel, registerHeatmap, registerLightTheme, registerLine, registerPie, registerPivotTable, registerRadar, registerRose, registerRoseParallel, registerScatter, registerTable, roseAdvancedPipeline, roseParallelAdvancedPipeline, roseParallelSpecPipeline, roseSpecPipeline, scatterAdvancedPipeline, scatterSpecPipeline, selector_selector as selector, 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, zColorLegend, zColumn, zColumnConfig, zColumnParallel, zColumnParallelConfig, zColumnPercent, zColumnPercentConfig, zConfig, zCrosshairLine, zCrosshairRect, zCustomTheme, zCustomThemeConfig, zDataset, zDatasetReshapeInfo, zDatum, zDimension, zDimensionGroup, zDimensionTree, zDimensions, zDonut, zDonutConfig, zDualAxis, zDualAxisConfig, zDualChartType, zDualMeasure, zDualMeasures, zEncoding, zFoldInfo, zFunnel, zFunnelConfig, zHeatmap, zHeatmapConfig, zLabel, zLegend, zLine, zLineConfig, zLineStyle, zLinearColor, zLocale, zMarkStyle, zMeasure, zMeasureGroup, zMeasureTree, zMeasures, zNumFormat, zPie, zPieConfig, zPivotTable, zPivotTableConfig, zPointStyle, zRadar, zRadarConfig, zRose, zRoseConfig, zRoseParallel, zRoseParallelConfig, zScatter, zScatterConfig, zSort, zSortLegend, zStackCornerRadius, zTable, zTableConfig, zTheme, zTooltip, zUnfoldInfo, zVSeed, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
|
8371
9504
|
|
8372
9505
|
//# sourceMappingURL=index.js.map
|