@visactor/vseed 0.0.22 → 0.0.24
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 +2168 -926
- package/dist/builder/register/chartType.d.ts +3 -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/dataReshapeFor2D1M0Name.d.ts +19 -0
- package/dist/dataReshape/index.d.ts +2 -0
- package/dist/dataReshape/unfoldZeroDimensions.d.ts +10 -0
- package/dist/index.cjs +1104 -149
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1032 -134
- package/dist/index.js.map +1 -1
- package/dist/pipeline/advanced/chart/pipeline/areaRange.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipeline/heatmap.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipeline/index.d.ts +3 -0
- package/dist/pipeline/advanced/chart/pipeline/radar.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipes/config/config.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipes/encoding/encodingAR.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipes/encoding/encodingXYY.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipes/encoding/index.d.ts +2 -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 +5 -1
- package/dist/pipeline/advanced/chart/pipes/reshape/pivotReshapeTo1D.d.ts +8 -0
- package/dist/pipeline/advanced/chart/pipes/reshape/pivotReshapeTo2D1M0Name.d.ts +8 -0
- package/dist/pipeline/advanced/chart/pipes/reshape/reshapeTo1D.d.ts +8 -0
- package/dist/pipeline/advanced/chart/pipes/reshape/reshapeTo2D1M0Name.d.ts +8 -0
- package/dist/pipeline/spec/chart/pipeline/areaRange.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipeline/heatmap.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipeline/index.d.ts +4 -1
- package/dist/pipeline/spec/chart/pipeline/radar.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/axes/index.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/axes/radarAngle.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/axes/radarRadius.d.ts +2 -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 +4 -2
- package/dist/pipeline/spec/chart/pipes/{axes/a.d.ts → init/radar.d.ts} +1 -1
- 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 +763 -186
- package/dist/types/chartType/areaRange/areaRange.d.ts +1337 -0
- package/dist/types/chartType/areaRange/index.d.ts +1 -0
- package/dist/types/chartType/heatmap/heatmap.d.ts +207 -0
- package/dist/types/chartType/heatmap/index.d.ts +1 -0
- package/dist/types/chartType/index.d.ts +5 -2
- package/dist/types/chartType/radar/index.d.ts +1 -0
- package/dist/types/chartType/radar/radar.d.ts +207 -0
- package/dist/types/properties/chartType/chartType.d.ts +12 -6
- package/dist/types/properties/config/config.d.ts +843 -255
- package/dist/types/properties/theme/customTheme.d.ts +788 -214
- package/dist/types/vseed.d.ts +2051 -628
- package/dist/umd/index.js +1066 -149
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/umd/index.js
CHANGED
@@ -31,16 +31,18 @@
|
|
31
31
|
__webpack_require__.r(__webpack_exports__);
|
32
32
|
__webpack_require__.d(__webpack_exports__, {
|
33
33
|
funnelAdvancedPipeline: ()=>funnelAdvancedPipeline,
|
34
|
-
|
34
|
+
zHeatmapConfig: ()=>zHeatmapConfig,
|
35
35
|
zBar: ()=>zBar,
|
36
36
|
pieAdvancedPipeline: ()=>pieAdvancedPipeline,
|
37
37
|
execPipeline: ()=>execPipeline,
|
38
38
|
areaSpecPipeline: ()=>areaSpecPipeline,
|
39
39
|
isTable: ()=>isTable,
|
40
40
|
zDonut: ()=>zDonut,
|
41
|
+
zPie: ()=>zPie,
|
41
42
|
zRoseConfig: ()=>zRoseConfig,
|
42
43
|
findFirstMeasure: ()=>findFirstMeasure,
|
43
44
|
scatterAdvancedPipeline: ()=>scatterAdvancedPipeline,
|
45
|
+
updateSpec: ()=>updateSpec,
|
44
46
|
zCrosshairRect: ()=>zCrosshairRect,
|
45
47
|
scatterSpecPipeline: ()=>scatterSpecPipeline,
|
46
48
|
intl: ()=>intl,
|
@@ -75,6 +77,7 @@
|
|
75
77
|
barPercentAdvancedPipeline: ()=>barPercentAdvancedPipeline,
|
76
78
|
findAllDimensions: ()=>findAllDimensions,
|
77
79
|
findDimensionById: ()=>findDimensionById,
|
80
|
+
zAreaRangeConfig: ()=>zAreaRangeConfig,
|
78
81
|
zPivotTableConfig: ()=>zPivotTableConfig,
|
79
82
|
zArea: ()=>zArea,
|
80
83
|
zColumnParallel: ()=>zColumnParallel,
|
@@ -84,31 +87,32 @@
|
|
84
87
|
zColumnParallelConfig: ()=>zColumnParallelConfig,
|
85
88
|
donutSpecPipeline: ()=>donutSpecPipeline,
|
86
89
|
registerAreaPercent: ()=>registerAreaPercent,
|
87
|
-
|
90
|
+
zHeatmap: ()=>zHeatmap,
|
88
91
|
zBarPercent: ()=>zBarPercent,
|
92
|
+
zTheme: ()=>zTheme,
|
89
93
|
zDatum: ()=>zDatum,
|
90
94
|
barAdvancedPipeline: ()=>barAdvancedPipeline,
|
91
95
|
zCustomThemeConfig: ()=>zCustomThemeConfig,
|
92
96
|
registerColumnPercent: ()=>registerColumnPercent,
|
93
|
-
|
94
|
-
|
97
|
+
registerHeatmap: ()=>registerHeatmap,
|
98
|
+
registerAreaRange: ()=>registerAreaRange,
|
95
99
|
roseSpecPipeline: ()=>roseSpecPipeline,
|
96
|
-
|
97
|
-
|
100
|
+
dataReshapeFor2D1M0Name: ()=>dataReshapeFor2D1M0Name,
|
101
|
+
registerBarPercent: ()=>registerBarPercent,
|
98
102
|
registerLightTheme: ()=>registerLightTheme,
|
99
103
|
roseAdvancedPipeline: ()=>roseAdvancedPipeline,
|
100
104
|
zBarParallel: ()=>zBarParallel,
|
101
105
|
zAnnotationVerticalLine: ()=>zAnnotationVerticalLine,
|
102
|
-
|
106
|
+
registerPivotTable: ()=>registerPivotTable,
|
103
107
|
tableAdvancedPipeline: ()=>tableAdvancedPipeline,
|
104
108
|
registerDarkTheme: ()=>registerDarkTheme,
|
105
|
-
registerPivotTable: ()=>registerPivotTable,
|
106
109
|
pieSpecPipeline: ()=>pieSpecPipeline,
|
107
|
-
|
110
|
+
zChartType: ()=>zChartType,
|
111
|
+
zCrosshairLine: ()=>zCrosshairLine,
|
108
112
|
barSpecPipeline: ()=>barSpecPipeline,
|
109
|
-
|
113
|
+
zMeasureTree: ()=>zMeasureTree,
|
110
114
|
registerRose: ()=>registerRose,
|
111
|
-
|
115
|
+
zPivotTable: ()=>zPivotTable,
|
112
116
|
unfoldDimensions: ()=>unfoldDimensions,
|
113
117
|
roseParallelAdvancedPipeline: ()=>roseParallelAdvancedPipeline,
|
114
118
|
registerTable: ()=>registerTable,
|
@@ -118,29 +122,37 @@
|
|
118
122
|
registerAll: ()=>registerAll,
|
119
123
|
registerBar: ()=>registerBar,
|
120
124
|
isVChart: ()=>isVChart,
|
125
|
+
radarSpecPipeline: ()=>radarSpecPipeline,
|
121
126
|
zPieConfig: ()=>zPieConfig,
|
122
|
-
|
127
|
+
zRadar: ()=>zRadar,
|
128
|
+
zRose: ()=>zRose,
|
129
|
+
zStackCornerRadius: ()=>zStackCornerRadius,
|
123
130
|
registerLine: ()=>registerLine,
|
124
131
|
registerCustomTheme: ()=>registerCustomTheme,
|
125
132
|
zColor: ()=>zColor,
|
126
133
|
registerRoseParallel: ()=>registerRoseParallel,
|
127
134
|
registerDonut: ()=>registerDonut,
|
135
|
+
heatmapSpecPipeline: ()=>heatmapSpecPipeline,
|
136
|
+
heatmapAdvancedPipeline: ()=>heatmapAdvancedPipeline,
|
128
137
|
zDonutConfig: ()=>zDonutConfig,
|
129
|
-
zMeasureGroup: ()=>zMeasureGroup,
|
130
|
-
zUnfoldInfo: ()=>zUnfoldInfo,
|
131
138
|
zFunnelConfig: ()=>zFunnelConfig,
|
139
|
+
zMeasureGroup: ()=>zMeasureGroup,
|
132
140
|
zMeasures: ()=>zMeasures,
|
133
141
|
FoldMeasureName: ()=>FoldMeasureName,
|
142
|
+
zRadarConfig: ()=>zRadarConfig,
|
134
143
|
darkTheme: ()=>darkTheme,
|
135
144
|
createNumFormatter: ()=>createNumFormatter,
|
136
145
|
zAreaConfig: ()=>zAreaConfig,
|
137
146
|
zAxis: ()=>zAxis,
|
138
147
|
isVTable: ()=>isVTable,
|
148
|
+
zSortAxis: ()=>zSortAxis,
|
149
|
+
zTable: ()=>zTable,
|
139
150
|
zLine: ()=>zLine,
|
140
151
|
columnSpecPipeline: ()=>columnSpecPipeline,
|
141
152
|
UnfoldDimensionGroup: ()=>UnfoldDimensionGroup,
|
142
153
|
zDatasetReshapeInfo: ()=>zDatasetReshapeInfo,
|
143
154
|
zFoldInfo: ()=>zFoldInfo,
|
155
|
+
zUnfoldInfo: ()=>zUnfoldInfo,
|
144
156
|
zAreaStyle: ()=>zAreaStyle,
|
145
157
|
ORIGINAL_DATA: ()=>ORIGINAL_DATA,
|
146
158
|
zAnnotationArea: ()=>zAnnotationArea,
|
@@ -150,6 +162,7 @@
|
|
150
162
|
zAnnotationPoint: ()=>zAnnotationPoint,
|
151
163
|
lightTheme: ()=>lightTheme,
|
152
164
|
registerColumnParallel: ()=>registerColumnParallel,
|
165
|
+
updateAdvanced: ()=>updateAdvanced,
|
153
166
|
zDimension: ()=>zDimension,
|
154
167
|
isPivotChart: ()=>isPivotChart,
|
155
168
|
zDualAxisConfig: ()=>zDualAxisConfig,
|
@@ -158,16 +171,22 @@
|
|
158
171
|
zLineConfig: ()=>zLineConfig,
|
159
172
|
zTableConfig: ()=>zTableConfig,
|
160
173
|
zXBandAxis: ()=>zXBandAxis,
|
174
|
+
dataReshapeFor1D: ()=>dataReshapeFor1D,
|
161
175
|
zColumnPercentConfig: ()=>zColumnPercentConfig,
|
162
176
|
findMeasureById: ()=>findMeasureById,
|
163
177
|
zVSeed: ()=>zVSeed,
|
164
178
|
areaPercentAdvancedPipeline: ()=>areaPercentAdvancedPipeline,
|
179
|
+
radarAdvancedPipeline: ()=>radarAdvancedPipeline,
|
165
180
|
zBackgroundColor: ()=>zBackgroundColor,
|
166
181
|
zAreaPercentConfig: ()=>zAreaPercentConfig,
|
167
182
|
registerBarParallel: ()=>registerBarParallel,
|
168
|
-
|
183
|
+
registerRadar: ()=>registerRadar,
|
169
184
|
zLocale: ()=>zLocale,
|
170
185
|
pivotTableSpecPipeline: ()=>pivotTableSpecPipeline,
|
186
|
+
zMeasure: ()=>zMeasure,
|
187
|
+
areaRangeSpecPipeline: ()=>areaRangeSpecPipeline,
|
188
|
+
areaRangeAdvancedPipeline: ()=>areaRangeAdvancedPipeline,
|
189
|
+
zAreaRange: ()=>zAreaRange,
|
171
190
|
registerScatter: ()=>registerScatter,
|
172
191
|
zEncoding: ()=>zEncoding,
|
173
192
|
autoNumFormatter: ()=>autoNumFormatter,
|
@@ -191,9 +210,9 @@
|
|
191
210
|
zBarParallelConfig: ()=>zBarParallelConfig,
|
192
211
|
barParallelAdvancedPipeline: ()=>barParallelAdvancedPipeline,
|
193
212
|
FoldMeasureValue: ()=>FoldMeasureValue,
|
194
|
-
zBarPercentConfig: ()=>zBarPercentConfig,
|
195
213
|
barPercentSpecPipeline: ()=>barPercentSpecPipeline,
|
196
214
|
lineAdvancedPipeline: ()=>lineAdvancedPipeline,
|
215
|
+
zBarPercentConfig: ()=>zBarPercentConfig,
|
197
216
|
lineSpecPipeline: ()=>lineSpecPipeline,
|
198
217
|
zTooltip: ()=>zTooltip,
|
199
218
|
createFormatter: ()=>createFormatter,
|
@@ -1135,6 +1154,51 @@
|
|
1135
1154
|
}));
|
1136
1155
|
return result;
|
1137
1156
|
};
|
1157
|
+
const autoMeasuresBy2M1Group = (advancedVSeed, context)=>{
|
1158
|
+
const result = {
|
1159
|
+
...advancedVSeed
|
1160
|
+
};
|
1161
|
+
const { vseed } = context;
|
1162
|
+
const { measures, dataset } = vseed;
|
1163
|
+
if (!dataset) throw new Error('dataset is required');
|
1164
|
+
if (0 === dataset.length) return result;
|
1165
|
+
if (measures) {
|
1166
|
+
result.measures = auto2M1Group(measures);
|
1167
|
+
return result;
|
1168
|
+
}
|
1169
|
+
const top100dataset = dataset.slice(0, 100);
|
1170
|
+
const sample = top100dataset.reduce((prev, cur)=>({
|
1171
|
+
...prev,
|
1172
|
+
...cur
|
1173
|
+
}), {});
|
1174
|
+
const newMeasures = Object.keys(sample).filter((key)=>top100dataset.some((item)=>'number' == typeof item[key]) && ![
|
1175
|
+
'',
|
1176
|
+
null,
|
1177
|
+
void 0
|
1178
|
+
].includes(key)).map((measure)=>({
|
1179
|
+
id: measure,
|
1180
|
+
alias: measure
|
1181
|
+
}));
|
1182
|
+
result.measures = auto2M1Group(newMeasures);
|
1183
|
+
return result;
|
1184
|
+
};
|
1185
|
+
const auto2M1Group = (measures)=>{
|
1186
|
+
const allMeasures = findAllMeasures(measures);
|
1187
|
+
if (allMeasures.length <= 2) return allMeasures;
|
1188
|
+
const groups = measures.filter((measure)=>'children' in measure);
|
1189
|
+
const singleMeasures = measures.filter((measure)=>!('children' in measure));
|
1190
|
+
for(let i = 0; i < singleMeasures.length; i += 2){
|
1191
|
+
const group = autoMeasuresBy2M1Group_createEmptyMeasureGroup();
|
1192
|
+
group.children = allMeasures.slice(i, i + 2);
|
1193
|
+
groups.push(group);
|
1194
|
+
}
|
1195
|
+
return groups;
|
1196
|
+
};
|
1197
|
+
const autoMeasuresBy2M1Group_createEmptyMeasureGroup = ()=>({
|
1198
|
+
id: '',
|
1199
|
+
alias: '',
|
1200
|
+
children: []
|
1201
|
+
});
|
1138
1202
|
const FoldMeasureName = '__MeaName__';
|
1139
1203
|
const FoldMeasureValue = '__MeaValue__';
|
1140
1204
|
const FoldMeasureId = '__MeaId__';
|
@@ -1246,10 +1310,10 @@
|
|
1246
1310
|
for(let i = 0; i < dataset.length; i++){
|
1247
1311
|
const datum = dataset[i];
|
1248
1312
|
const colorName = generateDimGroupName(dimensionsToBeUnfolded, datum, dimensionsSeparator);
|
1249
|
-
const colorId = [
|
1313
|
+
const colorId = datum[foldMeasureId] ? [
|
1250
1314
|
colorName,
|
1251
|
-
datum[foldMeasureId]
|
1252
|
-
].join(dimensionsSeparator);
|
1315
|
+
datum[foldMeasureId]
|
1316
|
+
].join(dimensionsSeparator) : colorName;
|
1253
1317
|
datum[unfoldGroupName] = colorName;
|
1254
1318
|
datum[unfoldGroupId] = colorId;
|
1255
1319
|
colorItems.push(colorId);
|
@@ -1509,6 +1573,148 @@
|
|
1509
1573
|
};
|
1510
1574
|
}
|
1511
1575
|
};
|
1576
|
+
const dataReshapeFor1D_emptyReshapeResult = {
|
1577
|
+
dataset: [],
|
1578
|
+
foldInfo: {
|
1579
|
+
foldMap: {},
|
1580
|
+
measureId: '',
|
1581
|
+
measureName: '',
|
1582
|
+
measureValue: ''
|
1583
|
+
},
|
1584
|
+
unfoldInfo: {
|
1585
|
+
groupName: '',
|
1586
|
+
groupId: '',
|
1587
|
+
colorItems: [],
|
1588
|
+
colorIdMap: {}
|
1589
|
+
}
|
1590
|
+
};
|
1591
|
+
const dataReshapeFor1D = (dataset, dimensions, measures, options)=>{
|
1592
|
+
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup, unfoldDimensionGroupId = UnfoldDimensionGroupId } = options || {};
|
1593
|
+
if (0 === dimensions.length && 0 === measures.length) return dataReshapeFor1D_emptyReshapeResult;
|
1594
|
+
if (0 === dimensions.length) {
|
1595
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(dataset, [], [], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
1596
|
+
return {
|
1597
|
+
dataset: finalDataset,
|
1598
|
+
foldInfo: {
|
1599
|
+
foldMap: {},
|
1600
|
+
measureId: foldMeasureId,
|
1601
|
+
measureName: foldMeasureName,
|
1602
|
+
measureValue: foldMeasureValue
|
1603
|
+
},
|
1604
|
+
unfoldInfo
|
1605
|
+
};
|
1606
|
+
}
|
1607
|
+
{
|
1608
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(dataset, [
|
1609
|
+
...dimensions
|
1610
|
+
], [
|
1611
|
+
{
|
1612
|
+
id: foldMeasureValue,
|
1613
|
+
alias: i18n`指标值`
|
1614
|
+
}
|
1615
|
+
], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
1616
|
+
return {
|
1617
|
+
dataset: finalDataset,
|
1618
|
+
foldInfo: {
|
1619
|
+
foldMap: {},
|
1620
|
+
measureId: foldMeasureId,
|
1621
|
+
measureName: foldMeasureName,
|
1622
|
+
measureValue: foldMeasureValue
|
1623
|
+
},
|
1624
|
+
unfoldInfo
|
1625
|
+
};
|
1626
|
+
}
|
1627
|
+
};
|
1628
|
+
const unfoldZeroDimensions = (dataset, measures, measureName, unfoldGroupName = UnfoldDimensionGroup, unfoldGroupId = UnfoldDimensionGroupId)=>{
|
1629
|
+
const unfoldInfo = {
|
1630
|
+
groupName: unfoldGroupName,
|
1631
|
+
groupId: unfoldGroupId,
|
1632
|
+
colorItems: [],
|
1633
|
+
colorIdMap: {}
|
1634
|
+
};
|
1635
|
+
if (0 === measures.length) return {
|
1636
|
+
dataset,
|
1637
|
+
unfoldInfo: {
|
1638
|
+
groupName: unfoldGroupName,
|
1639
|
+
groupId: unfoldGroupId,
|
1640
|
+
colorItems: [],
|
1641
|
+
colorIdMap: {}
|
1642
|
+
}
|
1643
|
+
};
|
1644
|
+
const colorItems = [];
|
1645
|
+
const colorMap = {};
|
1646
|
+
for(let i = 0; i < dataset.length; i++){
|
1647
|
+
const datum = dataset[i];
|
1648
|
+
const colorName = measureName;
|
1649
|
+
const colorId = measureName;
|
1650
|
+
datum[unfoldGroupName] = colorName;
|
1651
|
+
datum[unfoldGroupId] = colorId;
|
1652
|
+
colorItems.push(colorId);
|
1653
|
+
colorMap[colorId] = colorName;
|
1654
|
+
}
|
1655
|
+
unfoldInfo.colorItems = chunk_QJLMYOTX_i(colorItems);
|
1656
|
+
unfoldInfo.colorIdMap = colorMap;
|
1657
|
+
return {
|
1658
|
+
dataset,
|
1659
|
+
unfoldInfo
|
1660
|
+
};
|
1661
|
+
};
|
1662
|
+
const dataReshapeFor2D1M0Name_emptyReshapeResult = {
|
1663
|
+
dataset: [],
|
1664
|
+
foldInfo: {
|
1665
|
+
foldMap: {},
|
1666
|
+
measureId: '',
|
1667
|
+
measureName: '',
|
1668
|
+
measureValue: ''
|
1669
|
+
},
|
1670
|
+
unfoldInfo: {
|
1671
|
+
groupName: '',
|
1672
|
+
groupId: '',
|
1673
|
+
colorItems: [],
|
1674
|
+
colorIdMap: {}
|
1675
|
+
}
|
1676
|
+
};
|
1677
|
+
const dataReshapeFor2D1M0Name = (dataset, dimensions, measures, options)=>{
|
1678
|
+
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup, unfoldDimensionGroupId = UnfoldDimensionGroupId } = options || {};
|
1679
|
+
if (0 === dimensions.length && 0 === measures.length) return dataReshapeFor2D1M0Name_emptyReshapeResult;
|
1680
|
+
const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, foldMeasureId, foldMeasureName, foldMeasureValue);
|
1681
|
+
if (0 === dimensions.length) {
|
1682
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldZeroDimensions(foldedDataset, [
|
1683
|
+
{
|
1684
|
+
id: foldMeasureValue,
|
1685
|
+
alias: i18n`指标值`
|
1686
|
+
}
|
1687
|
+
], i18n`指标名称`, unfoldDimensionGroup, unfoldDimensionGroupId);
|
1688
|
+
return {
|
1689
|
+
dataset: finalDataset,
|
1690
|
+
foldInfo,
|
1691
|
+
unfoldInfo
|
1692
|
+
};
|
1693
|
+
}
|
1694
|
+
{
|
1695
|
+
const onlyOneMeasure = 1 === measures.length;
|
1696
|
+
const onlyOneDimension = 1 === dimensions.length;
|
1697
|
+
const dims = [
|
1698
|
+
...dimensions
|
1699
|
+
];
|
1700
|
+
if (!onlyOneMeasure || onlyOneDimension) dims.push({
|
1701
|
+
id: foldMeasureName,
|
1702
|
+
alias: i18n`指标名称`,
|
1703
|
+
location: 'dimension'
|
1704
|
+
});
|
1705
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, dims, [
|
1706
|
+
{
|
1707
|
+
id: foldMeasureValue,
|
1708
|
+
alias: i18n`指标值`
|
1709
|
+
}
|
1710
|
+
], 1, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
1711
|
+
return {
|
1712
|
+
dataset: finalDataset,
|
1713
|
+
foldInfo,
|
1714
|
+
unfoldInfo
|
1715
|
+
};
|
1716
|
+
}
|
1717
|
+
};
|
1512
1718
|
const reshapeTo2D1M = (advancedVSeed, context)=>{
|
1513
1719
|
const result = {
|
1514
1720
|
...advancedVSeed
|
@@ -1533,6 +1739,30 @@
|
|
1533
1739
|
measures
|
1534
1740
|
};
|
1535
1741
|
};
|
1742
|
+
const reshapeTo2D1M0Name = (advancedVSeed, context)=>{
|
1743
|
+
const result = {
|
1744
|
+
...advancedVSeed
|
1745
|
+
};
|
1746
|
+
const { vseed } = context;
|
1747
|
+
const { dataset } = vseed;
|
1748
|
+
const { dimensions, measures } = advancedVSeed;
|
1749
|
+
if (!measures || !dimensions || !dataset) return result;
|
1750
|
+
if (0 === measures.length) throw new Error('measures can not be empty');
|
1751
|
+
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeFor2D1M0Name(dataset, dimensions, measures);
|
1752
|
+
return {
|
1753
|
+
...result,
|
1754
|
+
dataset: newDatasets,
|
1755
|
+
datasetReshapeInfo: [
|
1756
|
+
{
|
1757
|
+
id: '2D1M',
|
1758
|
+
foldInfo,
|
1759
|
+
unfoldInfo
|
1760
|
+
}
|
1761
|
+
],
|
1762
|
+
dimensions,
|
1763
|
+
measures
|
1764
|
+
};
|
1765
|
+
};
|
1536
1766
|
const reshapeTo1D1M = (advancedVSeed, context)=>{
|
1537
1767
|
const result = {
|
1538
1768
|
...advancedVSeed
|
@@ -1577,6 +1807,108 @@
|
|
1577
1807
|
]
|
1578
1808
|
};
|
1579
1809
|
};
|
1810
|
+
const reshapeTo1D = (advancedVSeed, context)=>{
|
1811
|
+
const result = {
|
1812
|
+
...advancedVSeed
|
1813
|
+
};
|
1814
|
+
const { vseed } = context;
|
1815
|
+
const { dataset } = vseed;
|
1816
|
+
const { dimensions, measures } = advancedVSeed;
|
1817
|
+
if (!measures || !dimensions || !dataset) return result;
|
1818
|
+
if (0 === measures.length) throw new Error('measures can not be empty');
|
1819
|
+
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeFor1D(dataset, dimensions, measures);
|
1820
|
+
return {
|
1821
|
+
...result,
|
1822
|
+
dataset: newDatasets,
|
1823
|
+
datasetReshapeInfo: [
|
1824
|
+
{
|
1825
|
+
id: '1D2M',
|
1826
|
+
foldInfo,
|
1827
|
+
unfoldInfo
|
1828
|
+
}
|
1829
|
+
]
|
1830
|
+
};
|
1831
|
+
};
|
1832
|
+
const pivotReshapeTo2D1M = (advancedVSeed, context)=>{
|
1833
|
+
const result = {
|
1834
|
+
...advancedVSeed
|
1835
|
+
};
|
1836
|
+
const { vseed } = context;
|
1837
|
+
const { dataset } = vseed;
|
1838
|
+
const { measures } = advancedVSeed;
|
1839
|
+
const dimensions = advancedVSeed.dimensions;
|
1840
|
+
if (!measures || !dimensions) return result;
|
1841
|
+
const measureGroups = [];
|
1842
|
+
if (measures) measures.forEach((measure)=>{
|
1843
|
+
if (measure.children && measure.children.length > 0) measureGroups.push(measure);
|
1844
|
+
});
|
1845
|
+
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
1846
|
+
const newDatasets = [];
|
1847
|
+
const datasetReshapeInfo = [];
|
1848
|
+
measureGroups.forEach((measureGroup)=>{
|
1849
|
+
const measures = measureGroup.children;
|
1850
|
+
if (!measures) return;
|
1851
|
+
const groupId = measureGroup.id;
|
1852
|
+
const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeFor2D1M(dataset, commonDimensions, measures, {
|
1853
|
+
foldMeasureId: FoldMeasureId,
|
1854
|
+
foldMeasureName: FoldMeasureName,
|
1855
|
+
foldMeasureValue: FoldMeasureValue + groupId,
|
1856
|
+
unfoldDimensionGroup: UnfoldDimensionGroup
|
1857
|
+
});
|
1858
|
+
const reshapeInfo = {
|
1859
|
+
id: groupId,
|
1860
|
+
foldInfo,
|
1861
|
+
unfoldInfo
|
1862
|
+
};
|
1863
|
+
newDatasets.push(newSubDataset);
|
1864
|
+
datasetReshapeInfo.push(reshapeInfo);
|
1865
|
+
});
|
1866
|
+
return {
|
1867
|
+
...result,
|
1868
|
+
dataset: newDatasets,
|
1869
|
+
datasetReshapeInfo: datasetReshapeInfo
|
1870
|
+
};
|
1871
|
+
};
|
1872
|
+
const pivotReshapeTo2D1M0Name = (advancedVSeed, context)=>{
|
1873
|
+
const result = {
|
1874
|
+
...advancedVSeed
|
1875
|
+
};
|
1876
|
+
const { vseed } = context;
|
1877
|
+
const { dataset } = vseed;
|
1878
|
+
const { measures } = advancedVSeed;
|
1879
|
+
const dimensions = advancedVSeed.dimensions;
|
1880
|
+
if (!measures || !dimensions) return result;
|
1881
|
+
const measureGroups = [];
|
1882
|
+
if (measures) measures.forEach((measure)=>{
|
1883
|
+
if (measure.children && measure.children.length > 0) measureGroups.push(measure);
|
1884
|
+
});
|
1885
|
+
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
1886
|
+
const newDatasets = [];
|
1887
|
+
const datasetReshapeInfo = [];
|
1888
|
+
measureGroups.forEach((measureGroup)=>{
|
1889
|
+
const measures = measureGroup.children;
|
1890
|
+
if (!measures) return;
|
1891
|
+
const groupId = measureGroup.id;
|
1892
|
+
const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeFor2D1M0Name(dataset, commonDimensions, measures, {
|
1893
|
+
foldMeasureId: FoldMeasureId,
|
1894
|
+
foldMeasureName: FoldMeasureName,
|
1895
|
+
foldMeasureValue: FoldMeasureValue + groupId,
|
1896
|
+
unfoldDimensionGroup: UnfoldDimensionGroup
|
1897
|
+
});
|
1898
|
+
const reshapeInfo = {
|
1899
|
+
id: groupId,
|
1900
|
+
foldInfo,
|
1901
|
+
unfoldInfo
|
1902
|
+
};
|
1903
|
+
newDatasets.push(newSubDataset);
|
1904
|
+
datasetReshapeInfo.push(reshapeInfo);
|
1905
|
+
});
|
1906
|
+
return {
|
1907
|
+
...result,
|
1908
|
+
dataset: newDatasets,
|
1909
|
+
datasetReshapeInfo: datasetReshapeInfo
|
1910
|
+
};
|
1911
|
+
};
|
1580
1912
|
const pivotReshapeTo1D1M = (advancedVSeed, context)=>{
|
1581
1913
|
const result = {
|
1582
1914
|
...advancedVSeed
|
@@ -1657,7 +1989,7 @@
|
|
1657
1989
|
datasetReshapeInfo: datasetReshapeInfo
|
1658
1990
|
};
|
1659
1991
|
};
|
1660
|
-
const
|
1992
|
+
const pivotReshapeTo1D = (advancedVSeed, context)=>{
|
1661
1993
|
const result = {
|
1662
1994
|
...advancedVSeed
|
1663
1995
|
};
|
@@ -1670,14 +2002,14 @@
|
|
1670
2002
|
if (measures) measures.forEach((measure)=>{
|
1671
2003
|
if (measure.children && measure.children.length > 0) measureGroups.push(measure);
|
1672
2004
|
});
|
1673
|
-
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
1674
2005
|
const newDatasets = [];
|
1675
2006
|
const datasetReshapeInfo = [];
|
1676
2007
|
measureGroups.forEach((measureGroup)=>{
|
1677
2008
|
const measures = measureGroup.children;
|
1678
2009
|
if (!measures) return;
|
2010
|
+
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
1679
2011
|
const groupId = measureGroup.id;
|
1680
|
-
const { dataset: newSubDataset, foldInfo, unfoldInfo } =
|
2012
|
+
const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeFor1D(dataset, commonDimensions, measures, {
|
1681
2013
|
foldMeasureId: FoldMeasureId,
|
1682
2014
|
foldMeasureName: FoldMeasureName,
|
1683
2015
|
foldMeasureValue: FoldMeasureValue + groupId,
|
@@ -1807,6 +2139,74 @@
|
|
1807
2139
|
encoding
|
1808
2140
|
};
|
1809
2141
|
};
|
2142
|
+
const encodingXYY = (advancedVSeed)=>{
|
2143
|
+
const result = {
|
2144
|
+
...advancedVSeed
|
2145
|
+
};
|
2146
|
+
const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
|
2147
|
+
if (!datasetReshapeInfo || !dimensions || !measures) return result;
|
2148
|
+
const encoding = datasetReshapeInfo.reduce((prev, cur, index)=>{
|
2149
|
+
const measure = measures[index];
|
2150
|
+
if ('children' in measure) {
|
2151
|
+
const m1 = measure.children?.[0];
|
2152
|
+
const m2 = measure.children?.[1] || m1;
|
2153
|
+
const { foldInfo, unfoldInfo } = cur;
|
2154
|
+
const x = [
|
2155
|
+
unfoldInfo.groupId
|
2156
|
+
];
|
2157
|
+
const y = [
|
2158
|
+
m1?.id,
|
2159
|
+
m2?.id
|
2160
|
+
];
|
2161
|
+
const group = [
|
2162
|
+
unfoldInfo.groupId
|
2163
|
+
];
|
2164
|
+
const color = [
|
2165
|
+
foldInfo.measureName
|
2166
|
+
];
|
2167
|
+
return [
|
2168
|
+
...prev,
|
2169
|
+
{
|
2170
|
+
x,
|
2171
|
+
y,
|
2172
|
+
group,
|
2173
|
+
color
|
2174
|
+
}
|
2175
|
+
];
|
2176
|
+
}
|
2177
|
+
{
|
2178
|
+
const m1 = measures[index];
|
2179
|
+
const m2 = measures[index + 1] || m1;
|
2180
|
+
const { foldInfo, unfoldInfo } = cur;
|
2181
|
+
const x = [
|
2182
|
+
unfoldInfo.groupId
|
2183
|
+
];
|
2184
|
+
const y = [
|
2185
|
+
m1.id,
|
2186
|
+
m2.id
|
2187
|
+
];
|
2188
|
+
const group = [
|
2189
|
+
unfoldInfo.groupId
|
2190
|
+
];
|
2191
|
+
const color = [
|
2192
|
+
foldInfo.measureName
|
2193
|
+
];
|
2194
|
+
return [
|
2195
|
+
...prev,
|
2196
|
+
{
|
2197
|
+
x,
|
2198
|
+
y,
|
2199
|
+
group,
|
2200
|
+
color
|
2201
|
+
}
|
2202
|
+
];
|
2203
|
+
}
|
2204
|
+
}, []);
|
2205
|
+
return {
|
2206
|
+
...result,
|
2207
|
+
encoding
|
2208
|
+
};
|
2209
|
+
};
|
1810
2210
|
const encodingRose = (advancedVSeed)=>{
|
1811
2211
|
const result = {
|
1812
2212
|
...advancedVSeed
|
@@ -1880,6 +2280,43 @@
|
|
1880
2280
|
encoding
|
1881
2281
|
};
|
1882
2282
|
};
|
2283
|
+
const encodingAR = (advancedVSeed)=>{
|
2284
|
+
const result = {
|
2285
|
+
...advancedVSeed
|
2286
|
+
};
|
2287
|
+
const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
|
2288
|
+
if (!datasetReshapeInfo || !dimensions || !measures) return result;
|
2289
|
+
const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
2290
|
+
const isZeroDimension = 0 === dimensions.length;
|
2291
|
+
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
2292
|
+
const { foldInfo, unfoldInfo } = cur;
|
2293
|
+
const angle = [
|
2294
|
+
isZeroDimension ? foldInfo.measureName : angleDimension?.id
|
2295
|
+
];
|
2296
|
+
const radius = [
|
2297
|
+
foldInfo.measureValue
|
2298
|
+
];
|
2299
|
+
const group = [
|
2300
|
+
unfoldInfo.groupId
|
2301
|
+
];
|
2302
|
+
const color = [
|
2303
|
+
unfoldInfo.groupId
|
2304
|
+
];
|
2305
|
+
return [
|
2306
|
+
...prev,
|
2307
|
+
{
|
2308
|
+
angle,
|
2309
|
+
radius,
|
2310
|
+
group,
|
2311
|
+
color
|
2312
|
+
}
|
2313
|
+
];
|
2314
|
+
}, []);
|
2315
|
+
return {
|
2316
|
+
...result,
|
2317
|
+
encoding
|
2318
|
+
};
|
2319
|
+
};
|
1883
2320
|
const encodingFunnel = (advancedVSeed)=>{
|
1884
2321
|
const result = {
|
1885
2322
|
...advancedVSeed
|
@@ -2001,6 +2438,8 @@
|
|
2001
2438
|
const roseConfig = pieConfig;
|
2002
2439
|
const roseParallelConfig = pieConfig;
|
2003
2440
|
const funnelConfig = pieConfig;
|
2441
|
+
const heatmapConfig = pieConfig;
|
2442
|
+
const radarConfig = pieConfig;
|
2004
2443
|
function chunk_BZNENX2T_r(o) {
|
2005
2444
|
if ("object" != typeof o || null === o) return !1;
|
2006
2445
|
let e = Object.getPrototypeOf(o);
|
@@ -2190,9 +2629,9 @@
|
|
2190
2629
|
autoMeasures,
|
2191
2630
|
autoDimensions,
|
2192
2631
|
pivotAdapter([
|
2193
|
-
|
2632
|
+
reshapeTo2D1M0Name
|
2194
2633
|
], [
|
2195
|
-
|
2634
|
+
pivotReshapeTo2D1M0Name
|
2196
2635
|
]),
|
2197
2636
|
encodingXY,
|
2198
2637
|
sortXBandAxis,
|
@@ -2309,9 +2748,9 @@
|
|
2309
2748
|
autoMeasures,
|
2310
2749
|
autoDimensions,
|
2311
2750
|
pivotAdapter([
|
2312
|
-
|
2751
|
+
reshapeTo2D1M0Name
|
2313
2752
|
], [
|
2314
|
-
|
2753
|
+
pivotReshapeTo2D1M0Name
|
2315
2754
|
]),
|
2316
2755
|
encodingXY,
|
2317
2756
|
sortXBandAxis,
|
@@ -2326,9 +2765,9 @@
|
|
2326
2765
|
autoMeasures,
|
2327
2766
|
autoDimensions,
|
2328
2767
|
pivotAdapter([
|
2329
|
-
|
2768
|
+
reshapeTo2D1M0Name
|
2330
2769
|
], [
|
2331
|
-
|
2770
|
+
pivotReshapeTo2D1M0Name
|
2332
2771
|
]),
|
2333
2772
|
encodingXY,
|
2334
2773
|
sortXBandAxis,
|
@@ -2338,6 +2777,22 @@
|
|
2338
2777
|
markStyle_markStyle,
|
2339
2778
|
annotation_annotation
|
2340
2779
|
];
|
2780
|
+
const areaRangeAdvancedPipeline = [
|
2781
|
+
initAdvancedVSeed,
|
2782
|
+
autoMeasuresBy2M1Group,
|
2783
|
+
autoDimensions,
|
2784
|
+
pivotAdapter([
|
2785
|
+
reshapeTo1D
|
2786
|
+
], [
|
2787
|
+
pivotReshapeTo1D
|
2788
|
+
]),
|
2789
|
+
encodingXYY,
|
2790
|
+
sortXBandAxis,
|
2791
|
+
areaConfig,
|
2792
|
+
theme_theme,
|
2793
|
+
markStyle_markStyle,
|
2794
|
+
annotation_annotation
|
2795
|
+
];
|
2341
2796
|
const pieAdvancedPipeline = [
|
2342
2797
|
initAdvancedVSeed,
|
2343
2798
|
autoMeasures,
|
@@ -2390,37 +2845,69 @@
|
|
2390
2845
|
], [
|
2391
2846
|
pivotReshapeTo2D1M
|
2392
2847
|
]),
|
2393
|
-
encodingRose,
|
2394
|
-
roseParallelConfig,
|
2848
|
+
encodingRose,
|
2849
|
+
roseParallelConfig,
|
2850
|
+
theme_theme,
|
2851
|
+
markStyle_markStyle,
|
2852
|
+
annotation_annotation
|
2853
|
+
];
|
2854
|
+
const funnelAdvancedPipeline = [
|
2855
|
+
initAdvancedVSeed,
|
2856
|
+
autoMeasures,
|
2857
|
+
autoDimensions,
|
2858
|
+
pivotAdapter([
|
2859
|
+
reshapeTo1D1M
|
2860
|
+
], [
|
2861
|
+
pivotReshapeTo1D1M
|
2862
|
+
]),
|
2863
|
+
encodingFunnel,
|
2864
|
+
funnelConfig,
|
2865
|
+
theme_theme,
|
2866
|
+
annotation_annotation
|
2867
|
+
];
|
2868
|
+
const scatterAdvancedPipeline = [
|
2869
|
+
initAdvancedVSeed,
|
2870
|
+
autoMeasures,
|
2871
|
+
autoDimensions,
|
2872
|
+
pivotAdapter([
|
2873
|
+
reshapeTo1D2M
|
2874
|
+
], [
|
2875
|
+
pivotReshapeTo1D2M
|
2876
|
+
]),
|
2877
|
+
encodingYY,
|
2878
|
+
scatterConfig,
|
2395
2879
|
theme_theme,
|
2396
2880
|
markStyle_markStyle,
|
2397
2881
|
annotation_annotation
|
2398
2882
|
];
|
2399
|
-
const
|
2883
|
+
const heatmapAdvancedPipeline = [
|
2400
2884
|
initAdvancedVSeed,
|
2401
2885
|
autoMeasures,
|
2402
2886
|
autoDimensions,
|
2403
2887
|
pivotAdapter([
|
2404
|
-
|
2888
|
+
reshapeTo2D1M
|
2405
2889
|
], [
|
2406
|
-
|
2890
|
+
pivotReshapeTo2D1M
|
2407
2891
|
]),
|
2408
|
-
|
2409
|
-
|
2892
|
+
encodingXY,
|
2893
|
+
sortXBandAxis,
|
2894
|
+
heatmapConfig,
|
2410
2895
|
theme_theme,
|
2896
|
+
markStyle_markStyle,
|
2411
2897
|
annotation_annotation
|
2412
2898
|
];
|
2413
|
-
const
|
2899
|
+
const radarAdvancedPipeline = [
|
2414
2900
|
initAdvancedVSeed,
|
2415
2901
|
autoMeasures,
|
2416
2902
|
autoDimensions,
|
2417
2903
|
pivotAdapter([
|
2418
|
-
|
2904
|
+
reshapeTo2D1M0Name
|
2419
2905
|
], [
|
2420
|
-
|
2906
|
+
pivotReshapeTo2D1M0Name
|
2421
2907
|
]),
|
2422
|
-
|
2423
|
-
|
2908
|
+
encodingAR,
|
2909
|
+
sort_sortLegend,
|
2910
|
+
radarConfig,
|
2424
2911
|
theme_theme,
|
2425
2912
|
markStyle_markStyle,
|
2426
2913
|
annotation_annotation
|
@@ -2578,7 +3065,7 @@
|
|
2578
3065
|
theme_theme
|
2579
3066
|
];
|
2580
3067
|
const dataset_dataset = (spec, context)=>{
|
2581
|
-
const { advancedVSeed } = context;
|
3068
|
+
const { advancedVSeed, vseed } = context;
|
2582
3069
|
const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
|
2583
3070
|
const { orderMapping = {} } = analysis ?? {};
|
2584
3071
|
const angle = encoding[0]?.angle?.[0];
|
@@ -2627,7 +3114,7 @@
|
|
2627
3114
|
...spec,
|
2628
3115
|
data: {
|
2629
3116
|
id,
|
2630
|
-
values: advancedVSeed.dataset,
|
3117
|
+
values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset,
|
2631
3118
|
fields: fields
|
2632
3119
|
}
|
2633
3120
|
};
|
@@ -2736,6 +3223,88 @@
|
|
2736
3223
|
result.animation = true;
|
2737
3224
|
return result;
|
2738
3225
|
};
|
3226
|
+
const initAreaRange = (spec, context)=>{
|
3227
|
+
const result = {
|
3228
|
+
...spec
|
3229
|
+
};
|
3230
|
+
const { advancedVSeed } = context;
|
3231
|
+
const { encoding } = advancedVSeed;
|
3232
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
3233
|
+
const { color } = advancedVSeed.config.areaRange;
|
3234
|
+
result.type = 'rangeArea';
|
3235
|
+
result.direction = 'vertical';
|
3236
|
+
result.stack = false;
|
3237
|
+
result.xField = encoding[0].x[0];
|
3238
|
+
result.yField = [
|
3239
|
+
encoding[0].y[0],
|
3240
|
+
encoding[0].y[1]
|
3241
|
+
];
|
3242
|
+
result.animation = true;
|
3243
|
+
result.area = {
|
3244
|
+
style: {
|
3245
|
+
fill: color.colorScheme?.[0]
|
3246
|
+
}
|
3247
|
+
};
|
3248
|
+
return result;
|
3249
|
+
};
|
3250
|
+
const initAreaRangeLine1 = (spec, context)=>{
|
3251
|
+
const result = {
|
3252
|
+
...spec
|
3253
|
+
};
|
3254
|
+
const { advancedVSeed } = context;
|
3255
|
+
const { encoding } = advancedVSeed;
|
3256
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
3257
|
+
const { color } = advancedVSeed.config.areaRange;
|
3258
|
+
result.type = 'line';
|
3259
|
+
result.direction = 'vertical';
|
3260
|
+
result.stack = false;
|
3261
|
+
result.xField = encoding[0].x[0];
|
3262
|
+
result.yField = [
|
3263
|
+
encoding[0].y[0]
|
3264
|
+
];
|
3265
|
+
result.animation = true;
|
3266
|
+
result.line = {
|
3267
|
+
style: {
|
3268
|
+
stroke: color.colorScheme?.[0]
|
3269
|
+
}
|
3270
|
+
};
|
3271
|
+
result.point = {
|
3272
|
+
style: {
|
3273
|
+
visible: false,
|
3274
|
+
fill: color.colorScheme?.[0]
|
3275
|
+
}
|
3276
|
+
};
|
3277
|
+
return result;
|
3278
|
+
};
|
3279
|
+
const initAreaRangeLine2 = (spec, context)=>{
|
3280
|
+
const result = {
|
3281
|
+
...spec
|
3282
|
+
};
|
3283
|
+
const { advancedVSeed } = context;
|
3284
|
+
const { encoding } = advancedVSeed;
|
3285
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
3286
|
+
const { color } = advancedVSeed.config.areaRange;
|
3287
|
+
result.type = 'line';
|
3288
|
+
result.direction = 'vertical';
|
3289
|
+
result.stack = false;
|
3290
|
+
result.xField = encoding[0].x[0];
|
3291
|
+
result.yField = [
|
3292
|
+
encoding[0].y[1]
|
3293
|
+
];
|
3294
|
+
result.animation = true;
|
3295
|
+
result.line = {
|
3296
|
+
style: {
|
3297
|
+
stroke: color.colorScheme?.[0]
|
3298
|
+
}
|
3299
|
+
};
|
3300
|
+
result.point = {
|
3301
|
+
style: {
|
3302
|
+
visible: false,
|
3303
|
+
fill: color.colorScheme?.[0]
|
3304
|
+
}
|
3305
|
+
};
|
3306
|
+
return result;
|
3307
|
+
};
|
2739
3308
|
const initLine = (spec, context)=>{
|
2740
3309
|
const result = {
|
2741
3310
|
...spec
|
@@ -2927,21 +3496,46 @@
|
|
2927
3496
|
result.animation = true;
|
2928
3497
|
return result;
|
2929
3498
|
};
|
2930
|
-
const
|
3499
|
+
const initScatter = (spec, context)=>{
|
2931
3500
|
const result = {
|
2932
3501
|
...spec
|
2933
3502
|
};
|
2934
|
-
|
2935
|
-
|
2936
|
-
|
2937
|
-
|
2938
|
-
|
2939
|
-
|
2940
|
-
|
2941
|
-
|
2942
|
-
|
2943
|
-
|
3503
|
+
const { advancedVSeed } = context;
|
3504
|
+
const { encoding } = advancedVSeed;
|
3505
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
3506
|
+
result.type = 'scatter';
|
3507
|
+
result.direction = 'vertical';
|
3508
|
+
result.xField = encoding[0].x[0];
|
3509
|
+
result.yField = encoding[0].y[0];
|
3510
|
+
result.seriesField = encoding[0].group[0];
|
3511
|
+
result.padding = 0;
|
3512
|
+
result.region = [
|
3513
|
+
{
|
3514
|
+
clip: true
|
3515
|
+
}
|
3516
|
+
];
|
3517
|
+
result.animation = true;
|
3518
|
+
return result;
|
3519
|
+
};
|
3520
|
+
const initRadar = (spec, context)=>{
|
3521
|
+
const result = {
|
3522
|
+
...spec
|
2944
3523
|
};
|
3524
|
+
const { advancedVSeed } = context;
|
3525
|
+
const { encoding } = advancedVSeed;
|
3526
|
+
if (!encoding[0].angle || !encoding[0].radius || !encoding[0].group) return result;
|
3527
|
+
result.type = 'radar';
|
3528
|
+
result.angleField = encoding[0].angle[0];
|
3529
|
+
result.radiusField = encoding[0].radius[0];
|
3530
|
+
result.seriesField = encoding[0].group[0];
|
3531
|
+
result.padding = 0;
|
3532
|
+
result.region = [
|
3533
|
+
{
|
3534
|
+
clip: true
|
3535
|
+
}
|
3536
|
+
];
|
3537
|
+
result.animation = true;
|
3538
|
+
return result;
|
2945
3539
|
};
|
2946
3540
|
const initFunnel = (spec, context)=>{
|
2947
3541
|
const result = {
|
@@ -2979,26 +3573,21 @@
|
|
2979
3573
|
result.animation = true;
|
2980
3574
|
return result;
|
2981
3575
|
};
|
2982
|
-
const
|
3576
|
+
const initPivot = (spec)=>{
|
2983
3577
|
const result = {
|
2984
3578
|
...spec
|
2985
3579
|
};
|
2986
|
-
|
2987
|
-
|
2988
|
-
|
2989
|
-
|
2990
|
-
|
2991
|
-
|
2992
|
-
|
2993
|
-
|
2994
|
-
|
2995
|
-
|
2996
|
-
|
2997
|
-
clip: true
|
2998
|
-
}
|
2999
|
-
];
|
3000
|
-
result.animation = true;
|
3001
|
-
return result;
|
3580
|
+
return {
|
3581
|
+
...result,
|
3582
|
+
animation: true,
|
3583
|
+
rows: [],
|
3584
|
+
columns: [],
|
3585
|
+
indicators: [],
|
3586
|
+
records: [],
|
3587
|
+
widthMode: 'adaptive',
|
3588
|
+
heightMode: 'adaptive',
|
3589
|
+
indicatorsAsCol: false
|
3590
|
+
};
|
3002
3591
|
};
|
3003
3592
|
const xBand = (spec, context)=>{
|
3004
3593
|
const result = {
|
@@ -3361,7 +3950,7 @@
|
|
3361
3950
|
};
|
3362
3951
|
const { advancedVSeed } = context;
|
3363
3952
|
const { dimensions, measures } = advancedVSeed;
|
3364
|
-
if (!dimensions || !measures) return
|
3953
|
+
if (!dimensions || !measures) return result;
|
3365
3954
|
const is0D = 0 === dimensions.length;
|
3366
3955
|
const is1M1D = 1 === dimensions.length && 1 === measures.length;
|
3367
3956
|
const showAxis = !(is0D || is1M1D);
|
@@ -3392,7 +3981,7 @@
|
|
3392
3981
|
};
|
3393
3982
|
const { advancedVSeed } = context;
|
3394
3983
|
const { dimensions, measures } = advancedVSeed;
|
3395
|
-
if (!dimensions || !measures) return
|
3984
|
+
if (!dimensions || !measures) return result;
|
3396
3985
|
const is0D = 0 === dimensions.length;
|
3397
3986
|
const is1M1D = 1 === dimensions.length && 1 === measures.length;
|
3398
3987
|
const showAxis = !(is0D || is1M1D);
|
@@ -3428,6 +4017,59 @@
|
|
3428
4017
|
});
|
3429
4018
|
return result;
|
3430
4019
|
};
|
4020
|
+
const radarAngleAxis = (spec, context)=>{
|
4021
|
+
const result = {
|
4022
|
+
...spec
|
4023
|
+
};
|
4024
|
+
const { advancedVSeed } = context;
|
4025
|
+
const { dimensions, measures } = advancedVSeed;
|
4026
|
+
if (!dimensions || !measures) return result;
|
4027
|
+
if (!result.axes) result.axes = [];
|
4028
|
+
result.axes.push({
|
4029
|
+
orient: 'angle',
|
4030
|
+
visible: true,
|
4031
|
+
zero: true,
|
4032
|
+
nice: true,
|
4033
|
+
grid: {
|
4034
|
+
visible: true
|
4035
|
+
},
|
4036
|
+
domainLine: {
|
4037
|
+
visible: true
|
4038
|
+
},
|
4039
|
+
tick: {
|
4040
|
+
visible: true
|
4041
|
+
}
|
4042
|
+
});
|
4043
|
+
return result;
|
4044
|
+
};
|
4045
|
+
const radarRadiusAxis = (spec, context)=>{
|
4046
|
+
const result = {
|
4047
|
+
...spec
|
4048
|
+
};
|
4049
|
+
const { advancedVSeed } = context;
|
4050
|
+
const { dimensions, measures } = advancedVSeed;
|
4051
|
+
if (!dimensions || !measures) return result;
|
4052
|
+
if (!result.axes) result.axes = [];
|
4053
|
+
result.axes.push({
|
4054
|
+
orient: 'radius',
|
4055
|
+
visible: true,
|
4056
|
+
zero: true,
|
4057
|
+
nice: true,
|
4058
|
+
grid: {
|
4059
|
+
visible: true
|
4060
|
+
},
|
4061
|
+
tick: {
|
4062
|
+
visible: true
|
4063
|
+
},
|
4064
|
+
label: {
|
4065
|
+
visible: true
|
4066
|
+
},
|
4067
|
+
domainLine: {
|
4068
|
+
visible: true
|
4069
|
+
}
|
4070
|
+
});
|
4071
|
+
return result;
|
4072
|
+
};
|
3431
4073
|
const percent = (spec, context)=>{
|
3432
4074
|
const result = {
|
3433
4075
|
...spec
|
@@ -3474,7 +4116,9 @@
|
|
3474
4116
|
const { advancedVSeed } = context;
|
3475
4117
|
const { measures, datasetReshapeInfo, chartType } = advancedVSeed;
|
3476
4118
|
const baseConfig = advancedVSeed.config[chartType];
|
3477
|
-
const { tooltip
|
4119
|
+
const { tooltip = {
|
4120
|
+
enable: true
|
4121
|
+
} } = baseConfig;
|
3478
4122
|
const { enable } = tooltip;
|
3479
4123
|
const { measureId, measureValue } = datasetReshapeInfo[0].foldInfo;
|
3480
4124
|
const { groupName } = datasetReshapeInfo[0].unfoldInfo;
|
@@ -5034,6 +5678,21 @@
|
|
5034
5678
|
};
|
5035
5679
|
return result;
|
5036
5680
|
};
|
5681
|
+
const series = (...args)=>{
|
5682
|
+
const result = {
|
5683
|
+
type: 'common',
|
5684
|
+
padding: 0,
|
5685
|
+
region: [
|
5686
|
+
{
|
5687
|
+
clip: true
|
5688
|
+
}
|
5689
|
+
]
|
5690
|
+
};
|
5691
|
+
return (_, context)=>{
|
5692
|
+
result.series = args.map((pipeline)=>execPipeline(pipeline, context, {}));
|
5693
|
+
return result;
|
5694
|
+
};
|
5695
|
+
};
|
5037
5696
|
const line_line = [
|
5038
5697
|
initLine,
|
5039
5698
|
color_color,
|
@@ -5374,11 +6033,65 @@
|
|
5374
6033
|
const barPercentSpecPipeline = [
|
5375
6034
|
pivotAdapter_pivotAdapter(barPercent, pivotBarPercent)
|
5376
6035
|
];
|
5377
|
-
const area_area = [
|
6036
|
+
const area_area = [
|
6037
|
+
initArea,
|
6038
|
+
stackInverse,
|
6039
|
+
color_color,
|
6040
|
+
background_backgroundColor,
|
6041
|
+
dataset_dataset,
|
6042
|
+
xBand,
|
6043
|
+
yLinear,
|
6044
|
+
label_label,
|
6045
|
+
tooltip_tooltip,
|
6046
|
+
verticalCrosshairLine,
|
6047
|
+
discreteLegend,
|
6048
|
+
pointStyle_pointStyle,
|
6049
|
+
pointStateDimensionHover,
|
6050
|
+
lineStyle_lineStyle,
|
6051
|
+
areaStyle_areaStyle,
|
6052
|
+
annotationPoint_annotationPoint,
|
6053
|
+
annotationVerticalLine_annotationVerticalLine,
|
6054
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
6055
|
+
annotationArea_annotationArea
|
6056
|
+
];
|
6057
|
+
const pivotArea = [
|
6058
|
+
initPivot,
|
6059
|
+
pivotGridStyle,
|
6060
|
+
pivotIndicators_pivotIndicatorsAsRow,
|
6061
|
+
datasetPivot,
|
6062
|
+
pivotIndicators([
|
6063
|
+
initArea,
|
6064
|
+
color_color,
|
6065
|
+
background_backgroundColor,
|
6066
|
+
stackInverse,
|
6067
|
+
dataset_dataset,
|
6068
|
+
xBand,
|
6069
|
+
yLinear,
|
6070
|
+
label_label,
|
6071
|
+
tooltip_tooltip,
|
6072
|
+
verticalCrosshairLine,
|
6073
|
+
pointStyle_pointStyle,
|
6074
|
+
pointStateDimensionHover,
|
6075
|
+
lineStyle_lineStyle,
|
6076
|
+
areaStyle_areaStyle,
|
6077
|
+
annotationPoint_annotationPoint,
|
6078
|
+
annotationVerticalLine_annotationVerticalLine,
|
6079
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
6080
|
+
annotationArea_annotationArea
|
6081
|
+
]),
|
6082
|
+
pivotRowDimensions,
|
6083
|
+
pivotColumnDimensions,
|
6084
|
+
pivotDiscreteLegend
|
6085
|
+
];
|
6086
|
+
const areaSpecPipeline = [
|
6087
|
+
pivotAdapter_pivotAdapter(area_area, pivotArea)
|
6088
|
+
];
|
6089
|
+
const areaPercent = [
|
5378
6090
|
initArea,
|
5379
6091
|
stackInverse,
|
5380
6092
|
color_color,
|
5381
6093
|
background_backgroundColor,
|
6094
|
+
percent,
|
5382
6095
|
dataset_dataset,
|
5383
6096
|
xBand,
|
5384
6097
|
yLinear,
|
@@ -5387,7 +6100,6 @@
|
|
5387
6100
|
verticalCrosshairLine,
|
5388
6101
|
discreteLegend,
|
5389
6102
|
pointStyle_pointStyle,
|
5390
|
-
pointStateDimensionHover,
|
5391
6103
|
lineStyle_lineStyle,
|
5392
6104
|
areaStyle_areaStyle,
|
5393
6105
|
annotationPoint_annotationPoint,
|
@@ -5395,16 +6107,17 @@
|
|
5395
6107
|
annotationHorizontalLine_annotationHorizontalLine,
|
5396
6108
|
annotationArea_annotationArea
|
5397
6109
|
];
|
5398
|
-
const
|
6110
|
+
const pivotAreaPercent = [
|
5399
6111
|
initPivot,
|
5400
6112
|
pivotGridStyle,
|
5401
6113
|
pivotIndicators_pivotIndicatorsAsRow,
|
5402
6114
|
datasetPivot,
|
5403
6115
|
pivotIndicators([
|
5404
6116
|
initArea,
|
6117
|
+
stackInverse,
|
5405
6118
|
color_color,
|
5406
6119
|
background_backgroundColor,
|
5407
|
-
|
6120
|
+
percent,
|
5408
6121
|
dataset_dataset,
|
5409
6122
|
xBand,
|
5410
6123
|
yLinear,
|
@@ -5412,7 +6125,6 @@
|
|
5412
6125
|
tooltip_tooltip,
|
5413
6126
|
verticalCrosshairLine,
|
5414
6127
|
pointStyle_pointStyle,
|
5415
|
-
pointStateDimensionHover,
|
5416
6128
|
lineStyle_lineStyle,
|
5417
6129
|
areaStyle_areaStyle,
|
5418
6130
|
annotationPoint_annotationPoint,
|
@@ -5424,50 +6136,109 @@
|
|
5424
6136
|
pivotColumnDimensions,
|
5425
6137
|
pivotDiscreteLegend
|
5426
6138
|
];
|
5427
|
-
const
|
5428
|
-
pivotAdapter_pivotAdapter(
|
6139
|
+
const areaPercentSpecPipeline = [
|
6140
|
+
pivotAdapter_pivotAdapter(areaPercent, pivotAreaPercent)
|
5429
6141
|
];
|
5430
|
-
const
|
5431
|
-
|
5432
|
-
|
6142
|
+
const areaRange = [
|
6143
|
+
series([
|
6144
|
+
initAreaRange,
|
6145
|
+
areaStyle_areaStyle
|
6146
|
+
], [
|
6147
|
+
initAreaRangeLine1,
|
6148
|
+
lineStyle_lineStyle,
|
6149
|
+
pointStyle_pointStyle,
|
6150
|
+
pointStateDimensionHover
|
6151
|
+
], [
|
6152
|
+
initAreaRangeLine2,
|
6153
|
+
lineStyle_lineStyle,
|
6154
|
+
pointStyle_pointStyle,
|
6155
|
+
pointStateDimensionHover
|
6156
|
+
]),
|
6157
|
+
dataset_dataset,
|
6158
|
+
background_backgroundColor,
|
6159
|
+
xBand,
|
6160
|
+
yLinear,
|
6161
|
+
label_label,
|
6162
|
+
verticalCrosshairLine,
|
6163
|
+
annotationPoint_annotationPoint,
|
6164
|
+
annotationVerticalLine_annotationVerticalLine,
|
6165
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
6166
|
+
annotationArea_annotationArea
|
6167
|
+
];
|
6168
|
+
const pivotAreaRange = [
|
6169
|
+
initPivot,
|
6170
|
+
pivotGridStyle,
|
6171
|
+
pivotIndicators_pivotIndicatorsAsRow,
|
6172
|
+
datasetPivot,
|
6173
|
+
pivotIndicators([
|
6174
|
+
series([
|
6175
|
+
initAreaRange,
|
6176
|
+
areaStyle_areaStyle
|
6177
|
+
], [
|
6178
|
+
initAreaRangeLine1,
|
6179
|
+
lineStyle_lineStyle,
|
6180
|
+
pointStyle_pointStyle,
|
6181
|
+
pointStateDimensionHover
|
6182
|
+
], [
|
6183
|
+
initAreaRangeLine2,
|
6184
|
+
lineStyle_lineStyle,
|
6185
|
+
pointStyle_pointStyle,
|
6186
|
+
pointStateDimensionHover
|
6187
|
+
]),
|
6188
|
+
background_backgroundColor,
|
6189
|
+
dataset_dataset,
|
6190
|
+
xBand,
|
6191
|
+
yLinear,
|
6192
|
+
label_label,
|
6193
|
+
verticalCrosshairLine,
|
6194
|
+
annotationPoint_annotationPoint,
|
6195
|
+
annotationVerticalLine_annotationVerticalLine,
|
6196
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
6197
|
+
annotationArea_annotationArea
|
6198
|
+
]),
|
6199
|
+
pivotRowDimensions,
|
6200
|
+
pivotColumnDimensions
|
6201
|
+
];
|
6202
|
+
const areaRangeSpecPipeline = [
|
6203
|
+
pivotAdapter_pivotAdapter(areaRange, pivotAreaRange)
|
6204
|
+
];
|
6205
|
+
const scatter = [
|
6206
|
+
initScatter,
|
5433
6207
|
color_color,
|
5434
6208
|
background_backgroundColor,
|
5435
|
-
percent,
|
5436
6209
|
dataset_dataset,
|
5437
|
-
|
6210
|
+
xLinear,
|
5438
6211
|
yLinear,
|
5439
6212
|
label_label,
|
5440
6213
|
tooltip_tooltip,
|
5441
6214
|
verticalCrosshairLine,
|
6215
|
+
horizontalCrosshairLine,
|
5442
6216
|
discreteLegend,
|
5443
6217
|
pointStyle_pointStyle,
|
5444
|
-
|
5445
|
-
areaStyle_areaStyle,
|
6218
|
+
pointStateHover,
|
5446
6219
|
annotationPoint_annotationPoint,
|
5447
6220
|
annotationVerticalLine_annotationVerticalLine,
|
5448
6221
|
annotationHorizontalLine_annotationHorizontalLine,
|
5449
6222
|
annotationArea_annotationArea
|
5450
6223
|
];
|
5451
|
-
const
|
6224
|
+
const pivotScatter = [
|
5452
6225
|
initPivot,
|
5453
6226
|
pivotGridStyle,
|
5454
6227
|
pivotIndicators_pivotIndicatorsAsRow,
|
5455
6228
|
datasetPivot,
|
5456
6229
|
pivotIndicators([
|
5457
|
-
|
5458
|
-
stackInverse,
|
6230
|
+
initScatter,
|
5459
6231
|
color_color,
|
5460
6232
|
background_backgroundColor,
|
5461
|
-
percent,
|
5462
6233
|
dataset_dataset,
|
5463
|
-
|
6234
|
+
xLinear,
|
5464
6235
|
yLinear,
|
5465
6236
|
label_label,
|
5466
6237
|
tooltip_tooltip,
|
5467
6238
|
verticalCrosshairLine,
|
6239
|
+
horizontalCrosshairLine,
|
5468
6240
|
pointStyle_pointStyle,
|
5469
|
-
|
5470
|
-
areaStyle_areaStyle,
|
6241
|
+
pointStateHover,
|
5471
6242
|
annotationPoint_annotationPoint,
|
5472
6243
|
annotationVerticalLine_annotationVerticalLine,
|
5473
6244
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -5477,8 +6248,8 @@
|
|
5477
6248
|
pivotColumnDimensions,
|
5478
6249
|
pivotDiscreteLegend
|
5479
6250
|
];
|
5480
|
-
const
|
5481
|
-
pivotAdapter_pivotAdapter(
|
6251
|
+
const scatterSpecPipeline = [
|
6252
|
+
pivotAdapter_pivotAdapter(scatter, pivotScatter)
|
5482
6253
|
];
|
5483
6254
|
const pie = [
|
5484
6255
|
initPie,
|
@@ -5638,6 +6409,49 @@
|
|
5638
6409
|
const roseParallelSpecPipeline = [
|
5639
6410
|
pivotAdapter_pivotAdapter(roseParallel, pivotRoseParallel)
|
5640
6411
|
];
|
6412
|
+
const radar = [
|
6413
|
+
initRadar,
|
6414
|
+
color_color,
|
6415
|
+
background_backgroundColor,
|
6416
|
+
dataset_dataset,
|
6417
|
+
radarAngleAxis,
|
6418
|
+
radarRadiusAxis,
|
6419
|
+
label_label,
|
6420
|
+
tooltip_tooltip,
|
6421
|
+
verticalCrosshairLine,
|
6422
|
+
discreteLegend,
|
6423
|
+
pointStyle_pointStyle,
|
6424
|
+
pointStateDimensionHover,
|
6425
|
+
lineStyle_lineStyle,
|
6426
|
+
areaStyle_areaStyle
|
6427
|
+
];
|
6428
|
+
const pivotRadar = [
|
6429
|
+
initPivot,
|
6430
|
+
pivotGridStyle,
|
6431
|
+
pivotIndicators_pivotIndicatorsAsRow,
|
6432
|
+
datasetPivot,
|
6433
|
+
pivotIndicators([
|
6434
|
+
initRadar,
|
6435
|
+
color_color,
|
6436
|
+
background_backgroundColor,
|
6437
|
+
dataset_dataset,
|
6438
|
+
radarAngleAxis,
|
6439
|
+
radarRadiusAxis,
|
6440
|
+
label_label,
|
6441
|
+
tooltip_tooltip,
|
6442
|
+
verticalCrosshairLine,
|
6443
|
+
pointStyle_pointStyle,
|
6444
|
+
pointStateDimensionHover,
|
6445
|
+
lineStyle_lineStyle,
|
6446
|
+
areaStyle_areaStyle
|
6447
|
+
]),
|
6448
|
+
pivotRowDimensions,
|
6449
|
+
pivotColumnDimensions,
|
6450
|
+
pivotDiscreteLegend
|
6451
|
+
];
|
6452
|
+
const radarSpecPipeline = [
|
6453
|
+
pivotAdapter_pivotAdapter(radar, pivotRadar)
|
6454
|
+
];
|
5641
6455
|
const funnel = [
|
5642
6456
|
initFunnel,
|
5643
6457
|
color_color,
|
@@ -5675,43 +6489,43 @@
|
|
5675
6489
|
const funnelSpecPipeline = [
|
5676
6490
|
pivotAdapter_pivotAdapter(funnel, pivotFunnel)
|
5677
6491
|
];
|
5678
|
-
const
|
5679
|
-
|
6492
|
+
const heatmap = [
|
6493
|
+
initLine,
|
5680
6494
|
color_color,
|
5681
6495
|
background_backgroundColor,
|
5682
6496
|
dataset_dataset,
|
5683
|
-
|
6497
|
+
xBand,
|
5684
6498
|
yLinear,
|
5685
6499
|
label_label,
|
5686
6500
|
tooltip_tooltip,
|
5687
6501
|
verticalCrosshairLine,
|
5688
|
-
horizontalCrosshairLine,
|
5689
6502
|
discreteLegend,
|
5690
6503
|
pointStyle_pointStyle,
|
5691
|
-
|
6504
|
+
pointStateDimensionHover,
|
6505
|
+
lineStyle_lineStyle,
|
5692
6506
|
annotationPoint_annotationPoint,
|
5693
6507
|
annotationVerticalLine_annotationVerticalLine,
|
5694
6508
|
annotationHorizontalLine_annotationHorizontalLine,
|
5695
6509
|
annotationArea_annotationArea
|
5696
6510
|
];
|
5697
|
-
const
|
6511
|
+
const pivotHeatmap = [
|
5698
6512
|
initPivot,
|
5699
6513
|
pivotGridStyle,
|
5700
6514
|
pivotIndicators_pivotIndicatorsAsRow,
|
5701
6515
|
datasetPivot,
|
5702
6516
|
pivotIndicators([
|
5703
|
-
|
6517
|
+
initLine,
|
5704
6518
|
color_color,
|
5705
6519
|
background_backgroundColor,
|
5706
6520
|
dataset_dataset,
|
5707
|
-
|
6521
|
+
xBand,
|
5708
6522
|
yLinear,
|
5709
6523
|
label_label,
|
5710
6524
|
tooltip_tooltip,
|
5711
6525
|
verticalCrosshairLine,
|
5712
|
-
horizontalCrosshairLine,
|
5713
6526
|
pointStyle_pointStyle,
|
5714
|
-
|
6527
|
+
pointStateDimensionHover,
|
6528
|
+
lineStyle_lineStyle,
|
5715
6529
|
annotationPoint_annotationPoint,
|
5716
6530
|
annotationVerticalLine_annotationVerticalLine,
|
5717
6531
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -5721,8 +6535,8 @@
|
|
5721
6535
|
pivotColumnDimensions,
|
5722
6536
|
pivotDiscreteLegend
|
5723
6537
|
];
|
5724
|
-
const
|
5725
|
-
pivotAdapter_pivotAdapter(
|
6538
|
+
const heatmapSpecPipeline = [
|
6539
|
+
pivotAdapter_pivotAdapter(heatmap, pivotHeatmap)
|
5726
6540
|
];
|
5727
6541
|
const initTable = (spec, context)=>{
|
5728
6542
|
const { advancedVSeed } = context;
|
@@ -6541,8 +7355,18 @@
|
|
6541
7355
|
build = ()=>build(this);
|
6542
7356
|
buildSpec = (advanced)=>buildSpec(this, advanced);
|
6543
7357
|
buildAdvanced = ()=>buildAdvanced(this);
|
6544
|
-
getAdvancedPipeline = (chartType)=>
|
6545
|
-
|
7358
|
+
getAdvancedPipeline = (chartType)=>{
|
7359
|
+
const customPipe = Builder._customAdvancedPipe[chartType];
|
7360
|
+
const pipeline = Builder._advancedPipelineMap[chartType];
|
7361
|
+
if (customPipe) pipeline.push(customPipe);
|
7362
|
+
return pipeline;
|
7363
|
+
};
|
7364
|
+
getSpecPipeline = (chartType)=>{
|
7365
|
+
const customPipe = Builder._customSpecPipe[chartType];
|
7366
|
+
const pipeline = Builder._specPipelineMap[chartType];
|
7367
|
+
if (customPipe) pipeline.push(customPipe);
|
7368
|
+
return pipeline;
|
7369
|
+
};
|
6546
7370
|
getTheme = (themeKey)=>Builder._themeMap[themeKey];
|
6547
7371
|
getThemeMap = ()=>Builder._themeMap;
|
6548
7372
|
getColorItems = ()=>getColorItems(this);
|
@@ -6567,6 +7391,8 @@
|
|
6567
7391
|
}
|
6568
7392
|
static _advancedPipelineMap = {};
|
6569
7393
|
static _specPipelineMap = {};
|
7394
|
+
static _customAdvancedPipe = {};
|
7395
|
+
static _customSpecPipe = {};
|
6570
7396
|
static _themeMap = {};
|
6571
7397
|
static from = (vseed)=>new Builder(vseed);
|
6572
7398
|
}
|
@@ -6590,6 +7416,10 @@
|
|
6590
7416
|
Builder._advancedPipelineMap.areaPercent = areaPercentAdvancedPipeline;
|
6591
7417
|
Builder._specPipelineMap.areaPercent = areaPercentSpecPipeline;
|
6592
7418
|
};
|
7419
|
+
const registerAreaRange = ()=>{
|
7420
|
+
Builder._advancedPipelineMap.areaRange = areaRangeAdvancedPipeline;
|
7421
|
+
Builder._specPipelineMap.areaRange = areaRangeSpecPipeline;
|
7422
|
+
};
|
6593
7423
|
const registerBarPercent = ()=>{
|
6594
7424
|
Builder._advancedPipelineMap.barPercent = barPercentAdvancedPipeline;
|
6595
7425
|
Builder._specPipelineMap.barPercent = barPercentSpecPipeline;
|
@@ -6638,6 +7468,14 @@
|
|
6638
7468
|
Builder._advancedPipelineMap.pivotTable = pivotTableAdvancedPipeline;
|
6639
7469
|
Builder._specPipelineMap.pivotTable = pivotTableSpecPipeline;
|
6640
7470
|
};
|
7471
|
+
const registerHeatmap = ()=>{
|
7472
|
+
Builder._advancedPipelineMap.heatmap = heatmapAdvancedPipeline;
|
7473
|
+
Builder._specPipelineMap.heatmap = heatmapSpecPipeline;
|
7474
|
+
};
|
7475
|
+
const registerRadar = ()=>{
|
7476
|
+
Builder._advancedPipelineMap.radar = radarAdvancedPipeline;
|
7477
|
+
Builder._specPipelineMap.radar = radarSpecPipeline;
|
7478
|
+
};
|
6641
7479
|
const lightTheme = ()=>{
|
6642
7480
|
const linearAxis = {
|
6643
7481
|
nice: true,
|
@@ -6882,6 +7720,12 @@
|
|
6882
7720
|
yAxis: linearAxis,
|
6883
7721
|
crosshairLine
|
6884
7722
|
},
|
7723
|
+
areaRange: {
|
7724
|
+
...baseConfig,
|
7725
|
+
xAxis: bandAxis,
|
7726
|
+
yAxis: linearAxis,
|
7727
|
+
crosshairLine
|
7728
|
+
},
|
6885
7729
|
scatter: {
|
6886
7730
|
...baseConfig,
|
6887
7731
|
xAxis: {
|
@@ -6906,6 +7750,9 @@
|
|
6906
7750
|
donut: {
|
6907
7751
|
...baseConfig
|
6908
7752
|
},
|
7753
|
+
radar: {
|
7754
|
+
...baseConfig
|
7755
|
+
},
|
6909
7756
|
rose: {
|
6910
7757
|
...baseConfig
|
6911
7758
|
},
|
@@ -7175,6 +8022,12 @@
|
|
7175
8022
|
yAxis: linearAxis,
|
7176
8023
|
crosshairLine: crosshairLine
|
7177
8024
|
},
|
8025
|
+
areaRange: {
|
8026
|
+
...baseConfig,
|
8027
|
+
xAxis: bandAxis,
|
8028
|
+
yAxis: linearAxis,
|
8029
|
+
crosshairLine: crosshairLine
|
8030
|
+
},
|
7178
8031
|
scatter: {
|
7179
8032
|
...baseConfig,
|
7180
8033
|
xAxis: {
|
@@ -7199,6 +8052,9 @@
|
|
7199
8052
|
donut: {
|
7200
8053
|
...baseConfig
|
7201
8054
|
},
|
8055
|
+
radar: {
|
8056
|
+
...baseConfig
|
8057
|
+
},
|
7202
8058
|
rose: {
|
7203
8059
|
...baseConfig
|
7204
8060
|
},
|
@@ -7239,6 +8095,8 @@
|
|
7239
8095
|
registerCustomTheme('dark', darkTheme());
|
7240
8096
|
};
|
7241
8097
|
const registerAll = ()=>{
|
8098
|
+
registerTable();
|
8099
|
+
registerPivotTable();
|
7242
8100
|
registerLine();
|
7243
8101
|
registerColumn();
|
7244
8102
|
registerColumnParallel();
|
@@ -7248,17 +8106,24 @@
|
|
7248
8106
|
registerBarPercent();
|
7249
8107
|
registerArea();
|
7250
8108
|
registerAreaPercent();
|
8109
|
+
registerAreaRange();
|
8110
|
+
registerScatter();
|
7251
8111
|
registerPie();
|
7252
8112
|
registerDonut();
|
7253
8113
|
registerRose();
|
7254
8114
|
registerRoseParallel();
|
8115
|
+
registerRadar();
|
7255
8116
|
registerFunnel();
|
7256
|
-
|
7257
|
-
registerTable();
|
7258
|
-
registerPivotTable();
|
8117
|
+
registerHeatmap();
|
7259
8118
|
registerLightTheme();
|
7260
8119
|
registerDarkTheme();
|
7261
8120
|
};
|
8121
|
+
const updateAdvanced = (chartType, advancedPipe)=>{
|
8122
|
+
Builder._customAdvancedPipe[chartType] = advancedPipe;
|
8123
|
+
};
|
8124
|
+
const updateSpec = (chartType, specPipe)=>{
|
8125
|
+
Builder._customSpecPipe[chartType] = specPipe;
|
8126
|
+
};
|
7262
8127
|
const NEVER = Object.freeze({
|
7263
8128
|
status: "aborted"
|
7264
8129
|
});
|
@@ -12076,13 +12941,16 @@
|
|
12076
12941
|
'barParallel',
|
12077
12942
|
'area',
|
12078
12943
|
'areaPercent',
|
12944
|
+
'areaRange',
|
12945
|
+
'scatter',
|
12946
|
+
'dualAxis',
|
12079
12947
|
'rose',
|
12080
12948
|
'roseParallel',
|
12081
12949
|
'pie',
|
12082
12950
|
'donut',
|
12083
|
-
'
|
12084
|
-
'
|
12085
|
-
'
|
12951
|
+
'radar',
|
12952
|
+
'funnel',
|
12953
|
+
'heatmap'
|
12086
12954
|
]);
|
12087
12955
|
const zDatum = record(schemas_string().or(schemas_number()), any());
|
12088
12956
|
const zDataset = schemas_array(zDatum);
|
@@ -12406,22 +13274,7 @@
|
|
12406
13274
|
crosshairLine: zCrosshairLine.optional()
|
12407
13275
|
});
|
12408
13276
|
const zAreaPercentConfig = zAreaConfig;
|
12409
|
-
const
|
12410
|
-
backgroundColor: zBackgroundColor.optional(),
|
12411
|
-
label: zLabel.optional(),
|
12412
|
-
color: zColor.optional(),
|
12413
|
-
tooltip: zTooltip.optional(),
|
12414
|
-
legend: zLegend.optional()
|
12415
|
-
});
|
12416
|
-
const zRoseParallelConfig = zRoseConfig;
|
12417
|
-
const zPieConfig = schemas_object({
|
12418
|
-
backgroundColor: zBackgroundColor.optional(),
|
12419
|
-
label: zLabel.optional(),
|
12420
|
-
color: zColor.optional(),
|
12421
|
-
tooltip: zTooltip.optional(),
|
12422
|
-
legend: zLegend.optional()
|
12423
|
-
});
|
12424
|
-
const zDonutConfig = zPieConfig;
|
13277
|
+
const zAreaRangeConfig = zAreaConfig;
|
12425
13278
|
const zDualAxisConfig = schemas_object({
|
12426
13279
|
backgroundColor: zBackgroundColor.optional(),
|
12427
13280
|
label: zLabel.optional(),
|
@@ -12439,13 +13292,25 @@
|
|
12439
13292
|
yAxis: zYLinearAxis.optional(),
|
12440
13293
|
crosshairLine: zCrosshairLine.optional()
|
12441
13294
|
});
|
12442
|
-
const
|
13295
|
+
const zRoseConfig = schemas_object({
|
12443
13296
|
backgroundColor: zBackgroundColor.optional(),
|
13297
|
+
label: zLabel.optional(),
|
12444
13298
|
color: zColor.optional(),
|
12445
13299
|
tooltip: zTooltip.optional(),
|
13300
|
+
legend: zLegend.optional()
|
13301
|
+
});
|
13302
|
+
const zRoseParallelConfig = zRoseConfig;
|
13303
|
+
const zPieConfig = schemas_object({
|
13304
|
+
backgroundColor: zBackgroundColor.optional(),
|
12446
13305
|
label: zLabel.optional(),
|
13306
|
+
color: zColor.optional(),
|
13307
|
+
tooltip: zTooltip.optional(),
|
12447
13308
|
legend: zLegend.optional()
|
12448
13309
|
});
|
13310
|
+
const zDonutConfig = zPieConfig;
|
13311
|
+
const zRadarConfig = zPieConfig;
|
13312
|
+
const zFunnelConfig = zPieConfig;
|
13313
|
+
const zHeatmapConfig = zPieConfig;
|
12449
13314
|
const zConfig = schemas_object({
|
12450
13315
|
table: zTableConfig.optional(),
|
12451
13316
|
pivotTable: zPivotTableConfig.optional(),
|
@@ -12458,13 +13323,16 @@
|
|
12458
13323
|
barPercent: zBarPercentConfig.optional(),
|
12459
13324
|
area: zAreaConfig.optional(),
|
12460
13325
|
areaPercent: zAreaPercentConfig.optional(),
|
13326
|
+
areaRange: zAreaRangeConfig.optional(),
|
13327
|
+
dualAxis: zDualAxisConfig.optional(),
|
13328
|
+
scatter: zScatterConfig.optional(),
|
12461
13329
|
rose: zRoseConfig.optional(),
|
12462
13330
|
roseParallel: zRoseParallelConfig.optional(),
|
12463
13331
|
pie: zPieConfig.optional(),
|
12464
13332
|
donut: zDonutConfig.optional(),
|
12465
|
-
|
12466
|
-
|
12467
|
-
|
13333
|
+
radar: zRadarConfig.optional(),
|
13334
|
+
funnel: zFunnelConfig.optional(),
|
13335
|
+
heatmap: zHeatmapConfig.optional()
|
12468
13336
|
});
|
12469
13337
|
const zAxis = schemas_object({
|
12470
13338
|
visible: schemas_boolean().default(true).optional(),
|
@@ -18772,6 +19640,47 @@
|
|
18772
19640
|
annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).optional(),
|
18773
19641
|
locale: zLocale.optional()
|
18774
19642
|
});
|
19643
|
+
const zAreaRange = schemas_object({
|
19644
|
+
chartType: literal('areaRange'),
|
19645
|
+
dataset: zDataset.optional(),
|
19646
|
+
dimensions: zDimensions.optional(),
|
19647
|
+
measures: zMeasureTree.optional(),
|
19648
|
+
backgroundColor: zBackgroundColor.optional(),
|
19649
|
+
label: zLabel.optional(),
|
19650
|
+
xAxis: zXBandAxis.optional(),
|
19651
|
+
yAxis: zYLinearAxis.optional(),
|
19652
|
+
crosshairLine: zCrosshairLine.optional(),
|
19653
|
+
theme: zTheme.optional(),
|
19654
|
+
pointStyle: zPointStyle.optional(),
|
19655
|
+
lineStyle: zLineStyle.optional(),
|
19656
|
+
areaStyle: zAreaStyle.optional(),
|
19657
|
+
annotationPoint: schemas_array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
19658
|
+
annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
19659
|
+
annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
19660
|
+
annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).optional(),
|
19661
|
+
locale: zLocale.optional()
|
19662
|
+
});
|
19663
|
+
const zScatter = schemas_object({
|
19664
|
+
chartType: literal('scatter'),
|
19665
|
+
dataset: zDataset.optional(),
|
19666
|
+
dimensions: zDimensions.optional(),
|
19667
|
+
measures: zMeasureTree.optional(),
|
19668
|
+
backgroundColor: zBackgroundColor.optional(),
|
19669
|
+
color: zColor.optional(),
|
19670
|
+
label: zLabel.optional(),
|
19671
|
+
legend: zLegend.optional(),
|
19672
|
+
tooltip: zTooltip.optional(),
|
19673
|
+
xAxis: zXLinearAxis.optional(),
|
19674
|
+
yAxis: zYLinearAxis.optional(),
|
19675
|
+
crosshairLine: zCrosshairLine.optional(),
|
19676
|
+
theme: zTheme.optional(),
|
19677
|
+
pointStyle: zPointStyle.optional(),
|
19678
|
+
annotationPoint: schemas_array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
19679
|
+
annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
19680
|
+
annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
19681
|
+
annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).optional(),
|
19682
|
+
locale: zLocale.optional()
|
19683
|
+
});
|
18775
19684
|
const zRose = schemas_object({
|
18776
19685
|
chartType: literal('rose'),
|
18777
19686
|
dataset: zDataset.optional(),
|
@@ -18824,8 +19733,8 @@
|
|
18824
19733
|
theme: zTheme.optional(),
|
18825
19734
|
locale: zLocale.optional()
|
18826
19735
|
});
|
18827
|
-
const
|
18828
|
-
chartType: literal('
|
19736
|
+
const zRadar = schemas_object({
|
19737
|
+
chartType: literal('radar'),
|
18829
19738
|
dataset: zDataset.optional(),
|
18830
19739
|
dimensions: zDimensions.optional(),
|
18831
19740
|
measures: zMeasureTree.optional(),
|
@@ -18834,15 +19743,7 @@
|
|
18834
19743
|
label: zLabel.optional(),
|
18835
19744
|
legend: zLegend.optional(),
|
18836
19745
|
tooltip: zTooltip.optional(),
|
18837
|
-
xAxis: zXLinearAxis.optional(),
|
18838
|
-
yAxis: zYLinearAxis.optional(),
|
18839
|
-
crosshairLine: zCrosshairLine.optional(),
|
18840
19746
|
theme: zTheme.optional(),
|
18841
|
-
pointStyle: zPointStyle.optional(),
|
18842
|
-
annotationPoint: schemas_array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
18843
|
-
annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
18844
|
-
annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
18845
|
-
annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).optional(),
|
18846
19747
|
locale: zLocale.optional()
|
18847
19748
|
});
|
18848
19749
|
const zFunnel = schemas_object({
|
@@ -18858,6 +19759,19 @@
|
|
18858
19759
|
theme: zTheme.optional(),
|
18859
19760
|
locale: zLocale.optional()
|
18860
19761
|
});
|
19762
|
+
const zHeatmap = schemas_object({
|
19763
|
+
chartType: literal('heatmap'),
|
19764
|
+
dataset: zDataset.optional(),
|
19765
|
+
dimensions: zDimensions.optional(),
|
19766
|
+
measures: zMeasureTree.optional(),
|
19767
|
+
backgroundColor: zBackgroundColor.optional(),
|
19768
|
+
color: zColor.optional(),
|
19769
|
+
label: zLabel.optional(),
|
19770
|
+
legend: zLegend.optional(),
|
19771
|
+
tooltip: zTooltip.optional(),
|
19772
|
+
theme: zTheme.optional(),
|
19773
|
+
locale: zLocale.optional()
|
19774
|
+
});
|
18861
19775
|
const zVSeed = discriminatedUnion('chartType', [
|
18862
19776
|
zTable,
|
18863
19777
|
zPivotTable,
|
@@ -18870,12 +19784,15 @@
|
|
18870
19784
|
zBarPercent,
|
18871
19785
|
zArea,
|
18872
19786
|
zAreaPercent,
|
19787
|
+
zAreaRange,
|
19788
|
+
zScatter,
|
18873
19789
|
zPie,
|
19790
|
+
zDonut,
|
18874
19791
|
zRose,
|
18875
19792
|
zRoseParallel,
|
18876
|
-
|
18877
|
-
|
18878
|
-
|
19793
|
+
zRadar,
|
19794
|
+
zFunnel,
|
19795
|
+
zHeatmap
|
18879
19796
|
]);
|
18880
19797
|
const zAdvancedVSeed = schemas_object({
|
18881
19798
|
chartType: zChartType,
|