@visactor/vseed 0.0.23 → 0.0.25
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 +1125 -757
- package/dist/builder/register/chartType.d.ts +2 -0
- package/dist/dataReshape/dataReshapeFor2D1M0Name.d.ts +19 -0
- package/dist/dataReshape/index.d.ts +1 -0
- package/dist/dataReshape/unfoldZeroDimensions.d.ts +10 -0
- package/dist/index.cjs +921 -193
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +870 -181
- package/dist/index.js.map +1 -1
- package/dist/pipeline/advanced/chart/pipeline/heatmap.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipeline/index.d.ts +2 -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/encodingMatrix.d.ts +2 -0
- package/dist/pipeline/advanced/chart/pipes/encoding/index.d.ts +1 -0
- package/dist/pipeline/advanced/chart/pipes/reshape/index.d.ts +3 -1
- package/dist/pipeline/advanced/chart/pipes/reshape/pivotReshapeTo2D1M0Name.d.ts +8 -0
- package/dist/pipeline/advanced/chart/pipes/reshape/reshapeTo2D1M0Name.d.ts +8 -0
- package/dist/pipeline/spec/chart/pipeline/heatmap.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipeline/index.d.ts +3 -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/color/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/color/linearColor.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/dataset/{dataset.d.ts → datasetXY.d.ts} +1 -1
- package/dist/pipeline/spec/chart/pipes/{axes/a.d.ts → dataset/datasetYX.d.ts} +1 -1
- package/dist/pipeline/spec/chart/pipes/dataset/index.d.ts +2 -1
- package/dist/pipeline/spec/chart/pipes/init/heatmap.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/init/index.d.ts +3 -2
- package/dist/pipeline/spec/chart/pipes/init/radar.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/label/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/label/labelColorInversion.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/legend/colorLegend.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/legend/index.d.ts +1 -0
- package/dist/types/advancedVSeed.d.ts +457 -187
- package/dist/types/chartType/area/area.d.ts +1 -1
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +1 -1
- package/dist/types/chartType/areaRange/areaRange.d.ts +1 -1
- package/dist/types/chartType/funnel/funnel.d.ts +6 -39
- package/dist/types/chartType/heatmap/heatmap.d.ts +176 -0
- package/dist/types/chartType/heatmap/index.d.ts +1 -0
- package/dist/types/chartType/index.d.ts +4 -2
- package/dist/types/chartType/line/line.d.ts +1 -1
- 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 +10 -6
- package/dist/types/properties/config/color/color.d.ts +11 -0
- package/dist/types/properties/config/config.d.ts +519 -238
- package/dist/types/properties/config/legend/legend.d.ts +26 -0
- package/dist/types/properties/markStyle/areaStyle.d.ts +0 -2
- package/dist/types/properties/markStyle/barStyle.d.ts +0 -6
- package/dist/types/properties/markStyle/lineStyle.d.ts +1 -6
- package/dist/types/properties/markStyle/markStyle.d.ts +2 -2
- package/dist/types/properties/markStyle/pointStyle.d.ts +0 -6
- package/dist/types/properties/theme/customTheme.d.ts +496 -228
- package/dist/types/vseed.d.ts +838 -664
- package/dist/umd/index.js +895 -193
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/umd/index.js
CHANGED
@@ -31,13 +31,14 @@
|
|
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,
|
@@ -63,6 +64,7 @@
|
|
63
64
|
findAllMeasures: ()=>findAllMeasures,
|
64
65
|
funnelSpecPipeline: ()=>funnelSpecPipeline,
|
65
66
|
zAnalysis: ()=>zAnalysis,
|
67
|
+
zColorLegend: ()=>zColorLegend,
|
66
68
|
preorderTraverse: ()=>preorderTraverse,
|
67
69
|
zDimensionTree: ()=>zDimensionTree,
|
68
70
|
roseParallelSpecPipeline: ()=>roseParallelSpecPipeline,
|
@@ -86,31 +88,32 @@
|
|
86
88
|
zColumnParallelConfig: ()=>zColumnParallelConfig,
|
87
89
|
donutSpecPipeline: ()=>donutSpecPipeline,
|
88
90
|
registerAreaPercent: ()=>registerAreaPercent,
|
89
|
-
|
91
|
+
zHeatmap: ()=>zHeatmap,
|
90
92
|
zBarPercent: ()=>zBarPercent,
|
93
|
+
zTheme: ()=>zTheme,
|
91
94
|
zDatum: ()=>zDatum,
|
92
95
|
barAdvancedPipeline: ()=>barAdvancedPipeline,
|
93
96
|
zCustomThemeConfig: ()=>zCustomThemeConfig,
|
94
97
|
registerColumnPercent: ()=>registerColumnPercent,
|
95
|
-
|
98
|
+
registerHeatmap: ()=>registerHeatmap,
|
96
99
|
registerAreaRange: ()=>registerAreaRange,
|
97
100
|
roseSpecPipeline: ()=>roseSpecPipeline,
|
101
|
+
dataReshapeFor2D1M0Name: ()=>dataReshapeFor2D1M0Name,
|
98
102
|
registerBarPercent: ()=>registerBarPercent,
|
99
|
-
zPivotTable: ()=>zPivotTable,
|
100
103
|
registerLightTheme: ()=>registerLightTheme,
|
101
104
|
roseAdvancedPipeline: ()=>roseAdvancedPipeline,
|
102
105
|
zBarParallel: ()=>zBarParallel,
|
103
106
|
zAnnotationVerticalLine: ()=>zAnnotationVerticalLine,
|
104
|
-
|
107
|
+
registerPivotTable: ()=>registerPivotTable,
|
105
108
|
tableAdvancedPipeline: ()=>tableAdvancedPipeline,
|
109
|
+
registerDarkTheme: ()=>registerDarkTheme,
|
106
110
|
pieSpecPipeline: ()=>pieSpecPipeline,
|
107
|
-
registerPivotTable: ()=>registerPivotTable,
|
108
111
|
zChartType: ()=>zChartType,
|
109
|
-
|
112
|
+
zCrosshairLine: ()=>zCrosshairLine,
|
110
113
|
barSpecPipeline: ()=>barSpecPipeline,
|
111
|
-
|
114
|
+
zMeasureTree: ()=>zMeasureTree,
|
112
115
|
registerRose: ()=>registerRose,
|
113
|
-
|
116
|
+
zPivotTable: ()=>zPivotTable,
|
114
117
|
unfoldDimensions: ()=>unfoldDimensions,
|
115
118
|
roseParallelAdvancedPipeline: ()=>roseParallelAdvancedPipeline,
|
116
119
|
registerTable: ()=>registerTable,
|
@@ -120,32 +123,40 @@
|
|
120
123
|
registerAll: ()=>registerAll,
|
121
124
|
registerBar: ()=>registerBar,
|
122
125
|
isVChart: ()=>isVChart,
|
126
|
+
radarSpecPipeline: ()=>radarSpecPipeline,
|
123
127
|
zPieConfig: ()=>zPieConfig,
|
128
|
+
zRadar: ()=>zRadar,
|
129
|
+
zRose: ()=>zRose,
|
124
130
|
zStackCornerRadius: ()=>zStackCornerRadius,
|
125
|
-
zTable: ()=>zTable,
|
126
131
|
registerLine: ()=>registerLine,
|
127
132
|
registerCustomTheme: ()=>registerCustomTheme,
|
128
133
|
zColor: ()=>zColor,
|
129
134
|
registerRoseParallel: ()=>registerRoseParallel,
|
130
135
|
registerDonut: ()=>registerDonut,
|
136
|
+
heatmapSpecPipeline: ()=>heatmapSpecPipeline,
|
137
|
+
heatmapAdvancedPipeline: ()=>heatmapAdvancedPipeline,
|
131
138
|
zDonutConfig: ()=>zDonutConfig,
|
132
|
-
zMeasureGroup: ()=>zMeasureGroup,
|
133
|
-
zUnfoldInfo: ()=>zUnfoldInfo,
|
134
139
|
zFunnelConfig: ()=>zFunnelConfig,
|
140
|
+
zMeasureGroup: ()=>zMeasureGroup,
|
135
141
|
zMeasures: ()=>zMeasures,
|
136
142
|
FoldMeasureName: ()=>FoldMeasureName,
|
143
|
+
zRadarConfig: ()=>zRadarConfig,
|
137
144
|
darkTheme: ()=>darkTheme,
|
138
145
|
createNumFormatter: ()=>createNumFormatter,
|
139
146
|
zAreaConfig: ()=>zAreaConfig,
|
140
147
|
zAxis: ()=>zAxis,
|
141
148
|
isVTable: ()=>isVTable,
|
149
|
+
zSortAxis: ()=>zSortAxis,
|
150
|
+
zTable: ()=>zTable,
|
142
151
|
zLine: ()=>zLine,
|
143
152
|
columnSpecPipeline: ()=>columnSpecPipeline,
|
144
153
|
UnfoldDimensionGroup: ()=>UnfoldDimensionGroup,
|
145
154
|
zDatasetReshapeInfo: ()=>zDatasetReshapeInfo,
|
146
155
|
zFoldInfo: ()=>zFoldInfo,
|
156
|
+
zLinearColor: ()=>zLinearColor,
|
147
157
|
zAreaStyle: ()=>zAreaStyle,
|
148
158
|
ORIGINAL_DATA: ()=>ORIGINAL_DATA,
|
159
|
+
zUnfoldInfo: ()=>zUnfoldInfo,
|
149
160
|
zAnnotationArea: ()=>zAnnotationArea,
|
150
161
|
columnParallelSpecPipeline: ()=>columnParallelSpecPipeline,
|
151
162
|
i18n: ()=>i18n,
|
@@ -167,12 +178,14 @@
|
|
167
178
|
findMeasureById: ()=>findMeasureById,
|
168
179
|
zVSeed: ()=>zVSeed,
|
169
180
|
areaPercentAdvancedPipeline: ()=>areaPercentAdvancedPipeline,
|
181
|
+
radarAdvancedPipeline: ()=>radarAdvancedPipeline,
|
170
182
|
zBackgroundColor: ()=>zBackgroundColor,
|
171
183
|
zAreaPercentConfig: ()=>zAreaPercentConfig,
|
172
184
|
registerBarParallel: ()=>registerBarParallel,
|
173
|
-
|
185
|
+
registerRadar: ()=>registerRadar,
|
174
186
|
zLocale: ()=>zLocale,
|
175
187
|
pivotTableSpecPipeline: ()=>pivotTableSpecPipeline,
|
188
|
+
zMeasure: ()=>zMeasure,
|
176
189
|
areaRangeSpecPipeline: ()=>areaRangeSpecPipeline,
|
177
190
|
areaRangeAdvancedPipeline: ()=>areaRangeAdvancedPipeline,
|
178
191
|
zAreaRange: ()=>zAreaRange,
|
@@ -1614,6 +1627,96 @@
|
|
1614
1627
|
};
|
1615
1628
|
}
|
1616
1629
|
};
|
1630
|
+
const unfoldZeroDimensions = (dataset, measures, measureName, unfoldGroupName = UnfoldDimensionGroup, unfoldGroupId = UnfoldDimensionGroupId)=>{
|
1631
|
+
const unfoldInfo = {
|
1632
|
+
groupName: unfoldGroupName,
|
1633
|
+
groupId: unfoldGroupId,
|
1634
|
+
colorItems: [],
|
1635
|
+
colorIdMap: {}
|
1636
|
+
};
|
1637
|
+
if (0 === measures.length) return {
|
1638
|
+
dataset,
|
1639
|
+
unfoldInfo: {
|
1640
|
+
groupName: unfoldGroupName,
|
1641
|
+
groupId: unfoldGroupId,
|
1642
|
+
colorItems: [],
|
1643
|
+
colorIdMap: {}
|
1644
|
+
}
|
1645
|
+
};
|
1646
|
+
const colorItems = [];
|
1647
|
+
const colorMap = {};
|
1648
|
+
for(let i = 0; i < dataset.length; i++){
|
1649
|
+
const datum = dataset[i];
|
1650
|
+
const colorName = measureName;
|
1651
|
+
const colorId = measureName;
|
1652
|
+
datum[unfoldGroupName] = colorName;
|
1653
|
+
datum[unfoldGroupId] = colorId;
|
1654
|
+
colorItems.push(colorId);
|
1655
|
+
colorMap[colorId] = colorName;
|
1656
|
+
}
|
1657
|
+
unfoldInfo.colorItems = chunk_QJLMYOTX_i(colorItems);
|
1658
|
+
unfoldInfo.colorIdMap = colorMap;
|
1659
|
+
return {
|
1660
|
+
dataset,
|
1661
|
+
unfoldInfo
|
1662
|
+
};
|
1663
|
+
};
|
1664
|
+
const dataReshapeFor2D1M0Name_emptyReshapeResult = {
|
1665
|
+
dataset: [],
|
1666
|
+
foldInfo: {
|
1667
|
+
foldMap: {},
|
1668
|
+
measureId: '',
|
1669
|
+
measureName: '',
|
1670
|
+
measureValue: ''
|
1671
|
+
},
|
1672
|
+
unfoldInfo: {
|
1673
|
+
groupName: '',
|
1674
|
+
groupId: '',
|
1675
|
+
colorItems: [],
|
1676
|
+
colorIdMap: {}
|
1677
|
+
}
|
1678
|
+
};
|
1679
|
+
const dataReshapeFor2D1M0Name = (dataset, dimensions, measures, options)=>{
|
1680
|
+
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup, unfoldDimensionGroupId = UnfoldDimensionGroupId } = options || {};
|
1681
|
+
if (0 === dimensions.length && 0 === measures.length) return dataReshapeFor2D1M0Name_emptyReshapeResult;
|
1682
|
+
const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, foldMeasureId, foldMeasureName, foldMeasureValue);
|
1683
|
+
if (0 === dimensions.length) {
|
1684
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldZeroDimensions(foldedDataset, [
|
1685
|
+
{
|
1686
|
+
id: foldMeasureValue,
|
1687
|
+
alias: i18n`指标值`
|
1688
|
+
}
|
1689
|
+
], i18n`指标名称`, unfoldDimensionGroup, unfoldDimensionGroupId);
|
1690
|
+
return {
|
1691
|
+
dataset: finalDataset,
|
1692
|
+
foldInfo,
|
1693
|
+
unfoldInfo
|
1694
|
+
};
|
1695
|
+
}
|
1696
|
+
{
|
1697
|
+
const onlyOneMeasure = 1 === measures.length;
|
1698
|
+
const onlyOneDimension = 1 === dimensions.length;
|
1699
|
+
const dims = [
|
1700
|
+
...dimensions
|
1701
|
+
];
|
1702
|
+
if (!onlyOneMeasure || onlyOneDimension) dims.push({
|
1703
|
+
id: foldMeasureName,
|
1704
|
+
alias: i18n`指标名称`,
|
1705
|
+
location: 'dimension'
|
1706
|
+
});
|
1707
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, dims, [
|
1708
|
+
{
|
1709
|
+
id: foldMeasureValue,
|
1710
|
+
alias: i18n`指标值`
|
1711
|
+
}
|
1712
|
+
], 1, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
1713
|
+
return {
|
1714
|
+
dataset: finalDataset,
|
1715
|
+
foldInfo,
|
1716
|
+
unfoldInfo
|
1717
|
+
};
|
1718
|
+
}
|
1719
|
+
};
|
1617
1720
|
const reshapeTo2D1M = (advancedVSeed, context)=>{
|
1618
1721
|
const result = {
|
1619
1722
|
...advancedVSeed
|
@@ -1638,6 +1741,30 @@
|
|
1638
1741
|
measures
|
1639
1742
|
};
|
1640
1743
|
};
|
1744
|
+
const reshapeTo2D1M0Name = (advancedVSeed, context)=>{
|
1745
|
+
const result = {
|
1746
|
+
...advancedVSeed
|
1747
|
+
};
|
1748
|
+
const { vseed } = context;
|
1749
|
+
const { dataset } = vseed;
|
1750
|
+
const { dimensions, measures } = advancedVSeed;
|
1751
|
+
if (!measures || !dimensions || !dataset) return result;
|
1752
|
+
if (0 === measures.length) throw new Error('measures can not be empty');
|
1753
|
+
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeFor2D1M0Name(dataset, dimensions, measures);
|
1754
|
+
return {
|
1755
|
+
...result,
|
1756
|
+
dataset: newDatasets,
|
1757
|
+
datasetReshapeInfo: [
|
1758
|
+
{
|
1759
|
+
id: '2D1M',
|
1760
|
+
foldInfo,
|
1761
|
+
unfoldInfo
|
1762
|
+
}
|
1763
|
+
],
|
1764
|
+
dimensions,
|
1765
|
+
measures
|
1766
|
+
};
|
1767
|
+
};
|
1641
1768
|
const reshapeTo1D1M = (advancedVSeed, context)=>{
|
1642
1769
|
const result = {
|
1643
1770
|
...advancedVSeed
|
@@ -1704,7 +1831,7 @@
|
|
1704
1831
|
]
|
1705
1832
|
};
|
1706
1833
|
};
|
1707
|
-
const
|
1834
|
+
const pivotReshapeTo2D1M = (advancedVSeed, context)=>{
|
1708
1835
|
const result = {
|
1709
1836
|
...advancedVSeed
|
1710
1837
|
};
|
@@ -1717,14 +1844,14 @@
|
|
1717
1844
|
if (measures) measures.forEach((measure)=>{
|
1718
1845
|
if (measure.children && measure.children.length > 0) measureGroups.push(measure);
|
1719
1846
|
});
|
1847
|
+
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
1720
1848
|
const newDatasets = [];
|
1721
1849
|
const datasetReshapeInfo = [];
|
1722
1850
|
measureGroups.forEach((measureGroup)=>{
|
1723
1851
|
const measures = measureGroup.children;
|
1724
1852
|
if (!measures) return;
|
1725
|
-
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
1726
1853
|
const groupId = measureGroup.id;
|
1727
|
-
const { dataset: newSubDataset, foldInfo, unfoldInfo } =
|
1854
|
+
const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeFor2D1M(dataset, commonDimensions, measures, {
|
1728
1855
|
foldMeasureId: FoldMeasureId,
|
1729
1856
|
foldMeasureName: FoldMeasureName,
|
1730
1857
|
foldMeasureValue: FoldMeasureValue + groupId,
|
@@ -1744,7 +1871,47 @@
|
|
1744
1871
|
datasetReshapeInfo: datasetReshapeInfo
|
1745
1872
|
};
|
1746
1873
|
};
|
1747
|
-
const
|
1874
|
+
const pivotReshapeTo2D1M0Name = (advancedVSeed, context)=>{
|
1875
|
+
const result = {
|
1876
|
+
...advancedVSeed
|
1877
|
+
};
|
1878
|
+
const { vseed } = context;
|
1879
|
+
const { dataset } = vseed;
|
1880
|
+
const { measures } = advancedVSeed;
|
1881
|
+
const dimensions = advancedVSeed.dimensions;
|
1882
|
+
if (!measures || !dimensions) return result;
|
1883
|
+
const measureGroups = [];
|
1884
|
+
if (measures) measures.forEach((measure)=>{
|
1885
|
+
if (measure.children && measure.children.length > 0) measureGroups.push(measure);
|
1886
|
+
});
|
1887
|
+
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
1888
|
+
const newDatasets = [];
|
1889
|
+
const datasetReshapeInfo = [];
|
1890
|
+
measureGroups.forEach((measureGroup)=>{
|
1891
|
+
const measures = measureGroup.children;
|
1892
|
+
if (!measures) return;
|
1893
|
+
const groupId = measureGroup.id;
|
1894
|
+
const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeFor2D1M0Name(dataset, commonDimensions, measures, {
|
1895
|
+
foldMeasureId: FoldMeasureId,
|
1896
|
+
foldMeasureName: FoldMeasureName,
|
1897
|
+
foldMeasureValue: FoldMeasureValue + groupId,
|
1898
|
+
unfoldDimensionGroup: UnfoldDimensionGroup
|
1899
|
+
});
|
1900
|
+
const reshapeInfo = {
|
1901
|
+
id: groupId,
|
1902
|
+
foldInfo,
|
1903
|
+
unfoldInfo
|
1904
|
+
};
|
1905
|
+
newDatasets.push(newSubDataset);
|
1906
|
+
datasetReshapeInfo.push(reshapeInfo);
|
1907
|
+
});
|
1908
|
+
return {
|
1909
|
+
...result,
|
1910
|
+
dataset: newDatasets,
|
1911
|
+
datasetReshapeInfo: datasetReshapeInfo
|
1912
|
+
};
|
1913
|
+
};
|
1914
|
+
const pivotReshapeTo1D1M = (advancedVSeed, context)=>{
|
1748
1915
|
const result = {
|
1749
1916
|
...advancedVSeed
|
1750
1917
|
};
|
@@ -1764,7 +1931,7 @@
|
|
1764
1931
|
if (!measures) return;
|
1765
1932
|
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
1766
1933
|
const groupId = measureGroup.id;
|
1767
|
-
const { dataset: newSubDataset, foldInfo, unfoldInfo } =
|
1934
|
+
const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeFor1D1M(dataset, commonDimensions, measures, {
|
1768
1935
|
foldMeasureId: FoldMeasureId,
|
1769
1936
|
foldMeasureName: FoldMeasureName,
|
1770
1937
|
foldMeasureValue: FoldMeasureValue + groupId,
|
@@ -1784,7 +1951,7 @@
|
|
1784
1951
|
datasetReshapeInfo: datasetReshapeInfo
|
1785
1952
|
};
|
1786
1953
|
};
|
1787
|
-
const
|
1954
|
+
const pivotReshapeTo1D2M = (advancedVSeed, context)=>{
|
1788
1955
|
const result = {
|
1789
1956
|
...advancedVSeed
|
1790
1957
|
};
|
@@ -1797,14 +1964,14 @@
|
|
1797
1964
|
if (measures) measures.forEach((measure)=>{
|
1798
1965
|
if (measure.children && measure.children.length > 0) measureGroups.push(measure);
|
1799
1966
|
});
|
1800
|
-
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
1801
1967
|
const newDatasets = [];
|
1802
1968
|
const datasetReshapeInfo = [];
|
1803
1969
|
measureGroups.forEach((measureGroup)=>{
|
1804
1970
|
const measures = measureGroup.children;
|
1805
1971
|
if (!measures) return;
|
1972
|
+
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
1806
1973
|
const groupId = measureGroup.id;
|
1807
|
-
const { dataset: newSubDataset, foldInfo, unfoldInfo } =
|
1974
|
+
const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeFor1D2M(dataset, commonDimensions, measures, {
|
1808
1975
|
foldMeasureId: FoldMeasureId,
|
1809
1976
|
foldMeasureName: FoldMeasureName,
|
1810
1977
|
foldMeasureValue: FoldMeasureValue + groupId,
|
@@ -2115,6 +2282,43 @@
|
|
2115
2282
|
encoding
|
2116
2283
|
};
|
2117
2284
|
};
|
2285
|
+
const encodingAR = (advancedVSeed)=>{
|
2286
|
+
const result = {
|
2287
|
+
...advancedVSeed
|
2288
|
+
};
|
2289
|
+
const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
|
2290
|
+
if (!datasetReshapeInfo || !dimensions || !measures) return result;
|
2291
|
+
const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
2292
|
+
const isZeroDimension = 0 === dimensions.length;
|
2293
|
+
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
2294
|
+
const { foldInfo, unfoldInfo } = cur;
|
2295
|
+
const angle = [
|
2296
|
+
isZeroDimension ? foldInfo.measureName : angleDimension?.id
|
2297
|
+
];
|
2298
|
+
const radius = [
|
2299
|
+
foldInfo.measureValue
|
2300
|
+
];
|
2301
|
+
const group = [
|
2302
|
+
unfoldInfo.groupId
|
2303
|
+
];
|
2304
|
+
const color = [
|
2305
|
+
unfoldInfo.groupId
|
2306
|
+
];
|
2307
|
+
return [
|
2308
|
+
...prev,
|
2309
|
+
{
|
2310
|
+
angle,
|
2311
|
+
radius,
|
2312
|
+
group,
|
2313
|
+
color
|
2314
|
+
}
|
2315
|
+
];
|
2316
|
+
}, []);
|
2317
|
+
return {
|
2318
|
+
...result,
|
2319
|
+
encoding
|
2320
|
+
};
|
2321
|
+
};
|
2118
2322
|
const encodingFunnel = (advancedVSeed)=>{
|
2119
2323
|
const result = {
|
2120
2324
|
...advancedVSeed
|
@@ -2130,7 +2334,7 @@
|
|
2130
2334
|
unfoldInfo.groupId
|
2131
2335
|
];
|
2132
2336
|
const color = [
|
2133
|
-
|
2337
|
+
foldInfo.measureValue
|
2134
2338
|
];
|
2135
2339
|
return [
|
2136
2340
|
...prev,
|
@@ -2236,6 +2440,8 @@
|
|
2236
2440
|
const roseConfig = pieConfig;
|
2237
2441
|
const roseParallelConfig = pieConfig;
|
2238
2442
|
const funnelConfig = pieConfig;
|
2443
|
+
const heatmapConfig = pieConfig;
|
2444
|
+
const radarConfig = pieConfig;
|
2239
2445
|
function chunk_BZNENX2T_r(o) {
|
2240
2446
|
if ("object" != typeof o || null === o) return !1;
|
2241
2447
|
let e = Object.getPrototypeOf(o);
|
@@ -2425,9 +2631,9 @@
|
|
2425
2631
|
autoMeasures,
|
2426
2632
|
autoDimensions,
|
2427
2633
|
pivotAdapter([
|
2428
|
-
|
2634
|
+
reshapeTo2D1M0Name
|
2429
2635
|
], [
|
2430
|
-
|
2636
|
+
pivotReshapeTo2D1M0Name
|
2431
2637
|
]),
|
2432
2638
|
encodingXY,
|
2433
2639
|
sortXBandAxis,
|
@@ -2544,9 +2750,9 @@
|
|
2544
2750
|
autoMeasures,
|
2545
2751
|
autoDimensions,
|
2546
2752
|
pivotAdapter([
|
2547
|
-
|
2753
|
+
reshapeTo2D1M0Name
|
2548
2754
|
], [
|
2549
|
-
|
2755
|
+
pivotReshapeTo2D1M0Name
|
2550
2756
|
]),
|
2551
2757
|
encodingXY,
|
2552
2758
|
sortXBandAxis,
|
@@ -2561,9 +2767,9 @@
|
|
2561
2767
|
autoMeasures,
|
2562
2768
|
autoDimensions,
|
2563
2769
|
pivotAdapter([
|
2564
|
-
|
2770
|
+
reshapeTo2D1M0Name
|
2565
2771
|
], [
|
2566
|
-
|
2772
|
+
pivotReshapeTo2D1M0Name
|
2567
2773
|
]),
|
2568
2774
|
encodingXY,
|
2569
2775
|
sortXBandAxis,
|
@@ -2676,6 +2882,71 @@
|
|
2676
2882
|
markStyle_markStyle,
|
2677
2883
|
annotation_annotation
|
2678
2884
|
];
|
2885
|
+
const encodingMatrix = (advancedVSeed)=>{
|
2886
|
+
const result = {
|
2887
|
+
...advancedVSeed
|
2888
|
+
};
|
2889
|
+
const { datasetReshapeInfo, dimensions } = advancedVSeed;
|
2890
|
+
if (!datasetReshapeInfo || !dimensions) return result;
|
2891
|
+
const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
2892
|
+
const isZeroDimension = 0 === dimensions.length;
|
2893
|
+
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
2894
|
+
const { foldInfo, unfoldInfo } = cur;
|
2895
|
+
const x = [
|
2896
|
+
isZeroDimension ? foldInfo.measureName : xDimension?.id
|
2897
|
+
];
|
2898
|
+
const y = [
|
2899
|
+
unfoldInfo.groupName
|
2900
|
+
];
|
2901
|
+
const color = [
|
2902
|
+
foldInfo.measureValue
|
2903
|
+
];
|
2904
|
+
return [
|
2905
|
+
...prev,
|
2906
|
+
{
|
2907
|
+
x,
|
2908
|
+
y,
|
2909
|
+
color
|
2910
|
+
}
|
2911
|
+
];
|
2912
|
+
}, []);
|
2913
|
+
return {
|
2914
|
+
...result,
|
2915
|
+
encoding
|
2916
|
+
};
|
2917
|
+
};
|
2918
|
+
const heatmapAdvancedPipeline = [
|
2919
|
+
initAdvancedVSeed,
|
2920
|
+
autoMeasures,
|
2921
|
+
autoDimensions,
|
2922
|
+
pivotAdapter([
|
2923
|
+
reshapeTo2D1M
|
2924
|
+
], [
|
2925
|
+
pivotReshapeTo2D1M
|
2926
|
+
]),
|
2927
|
+
encodingMatrix,
|
2928
|
+
sortXBandAxis,
|
2929
|
+
heatmapConfig,
|
2930
|
+
theme_theme,
|
2931
|
+
markStyle_markStyle,
|
2932
|
+
annotation_annotation
|
2933
|
+
];
|
2934
|
+
const radarAdvancedPipeline = [
|
2935
|
+
initAdvancedVSeed,
|
2936
|
+
autoMeasures,
|
2937
|
+
autoDimensions,
|
2938
|
+
pivotAdapter([
|
2939
|
+
reshapeTo2D1M0Name
|
2940
|
+
], [
|
2941
|
+
pivotReshapeTo2D1M0Name
|
2942
|
+
]),
|
2943
|
+
encodingAR,
|
2944
|
+
sort_sortLegend,
|
2945
|
+
radarConfig,
|
2946
|
+
theme_theme,
|
2947
|
+
markStyle_markStyle,
|
2948
|
+
annotation_annotation
|
2949
|
+
];
|
2679
2950
|
const autoMeasures_autoMeasures = (advancedVSeed, context)=>{
|
2680
2951
|
const result = {
|
2681
2952
|
...advancedVSeed
|
@@ -2828,12 +3099,11 @@
|
|
2828
3099
|
records_records,
|
2829
3100
|
theme_theme
|
2830
3101
|
];
|
2831
|
-
const
|
3102
|
+
const datasetYX = (spec, context)=>{
|
2832
3103
|
const { advancedVSeed, vseed } = context;
|
2833
3104
|
const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
|
2834
3105
|
const { orderMapping = {} } = analysis ?? {};
|
2835
3106
|
const angle = encoding[0]?.angle?.[0];
|
2836
|
-
const x = encoding[0]?.x?.[0];
|
2837
3107
|
const y = encoding[0]?.y?.[0];
|
2838
3108
|
const group = encoding[0]?.group?.[0];
|
2839
3109
|
const id = datasetReshapeInfo[0].id;
|
@@ -2841,25 +3111,57 @@
|
|
2841
3111
|
if (angle) fields[angle] = {
|
2842
3112
|
sortIndex: 0
|
2843
3113
|
};
|
2844
|
-
if (
|
2845
|
-
const order = orderMapping[
|
2846
|
-
if (order) fields[
|
3114
|
+
if (y) {
|
3115
|
+
const order = orderMapping[y];
|
3116
|
+
if (order) fields[y] = {
|
2847
3117
|
sortIndex: 0,
|
2848
3118
|
domain: order,
|
2849
3119
|
lockStatisticsByDomain: true
|
2850
3120
|
};
|
2851
|
-
else fields[
|
3121
|
+
else fields[y] = {
|
2852
3122
|
sortIndex: 0
|
2853
3123
|
};
|
2854
3124
|
}
|
2855
|
-
if (
|
2856
|
-
const order = orderMapping[
|
2857
|
-
if (order) fields[
|
3125
|
+
if (group) {
|
3126
|
+
const order = orderMapping[group];
|
3127
|
+
if (order) fields[group] = {
|
3128
|
+
sortIndex: 0,
|
3129
|
+
domain: order,
|
3130
|
+
lockStatisticsByDomain: true
|
3131
|
+
};
|
3132
|
+
else fields[group] = {
|
3133
|
+
sortIndex: 0
|
3134
|
+
};
|
3135
|
+
}
|
3136
|
+
return {
|
3137
|
+
...spec,
|
3138
|
+
data: {
|
3139
|
+
id,
|
3140
|
+
values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset,
|
3141
|
+
fields: fields
|
3142
|
+
}
|
3143
|
+
};
|
3144
|
+
};
|
3145
|
+
const datasetXY = (spec, context)=>{
|
3146
|
+
const { advancedVSeed, vseed } = context;
|
3147
|
+
const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
|
3148
|
+
const { orderMapping = {} } = analysis ?? {};
|
3149
|
+
const angle = encoding[0]?.angle?.[0];
|
3150
|
+
const x = encoding[0]?.x?.[0];
|
3151
|
+
const group = encoding[0]?.group?.[0];
|
3152
|
+
const id = datasetReshapeInfo[0].id;
|
3153
|
+
const fields = {};
|
3154
|
+
if (angle) fields[angle] = {
|
3155
|
+
sortIndex: 0
|
3156
|
+
};
|
3157
|
+
if (x) {
|
3158
|
+
const order = orderMapping[x];
|
3159
|
+
if (order) fields[x] = {
|
2858
3160
|
sortIndex: 0,
|
2859
3161
|
domain: order,
|
2860
3162
|
lockStatisticsByDomain: true
|
2861
3163
|
};
|
2862
|
-
else fields[
|
3164
|
+
else fields[x] = {
|
2863
3165
|
sortIndex: 0
|
2864
3166
|
};
|
2865
3167
|
}
|
@@ -3120,8 +3422,9 @@
|
|
3120
3422
|
...spec
|
3121
3423
|
};
|
3122
3424
|
const { advancedVSeed } = context;
|
3123
|
-
const { encoding } = advancedVSeed;
|
3425
|
+
const { encoding, dataset } = advancedVSeed;
|
3124
3426
|
if (!encoding[0].angle || !encoding[0].radius || !encoding[0].group) return result;
|
3427
|
+
const showStroke = dataset.length > 20;
|
3125
3428
|
result.type = 'pie';
|
3126
3429
|
result.outerRadius = 0.8;
|
3127
3430
|
result.innerRadius = 0;
|
@@ -3137,7 +3440,7 @@
|
|
3137
3440
|
result.pie = {
|
3138
3441
|
style: {
|
3139
3442
|
stroke: '#ffffff',
|
3140
|
-
lineWidth: 1,
|
3443
|
+
lineWidth: showStroke ? 1 : 0,
|
3141
3444
|
centerOffset: 0
|
3142
3445
|
},
|
3143
3446
|
state: {
|
@@ -3155,8 +3458,9 @@
|
|
3155
3458
|
...spec
|
3156
3459
|
};
|
3157
3460
|
const { advancedVSeed } = context;
|
3158
|
-
const { encoding } = advancedVSeed;
|
3461
|
+
const { encoding, dataset } = advancedVSeed;
|
3159
3462
|
if (!encoding[0].angle || !encoding[0].radius || !encoding[0].group) return result;
|
3463
|
+
const showStroke = dataset.length > 20;
|
3160
3464
|
result.type = 'pie';
|
3161
3465
|
result.outerRadius = 0.8;
|
3162
3466
|
result.innerRadius = 0.8 * result.outerRadius;
|
@@ -3172,7 +3476,7 @@
|
|
3172
3476
|
result.pie = {
|
3173
3477
|
style: {
|
3174
3478
|
stroke: '#ffffff',
|
3175
|
-
lineWidth: 1
|
3479
|
+
lineWidth: showStroke ? 1 : 0
|
3176
3480
|
},
|
3177
3481
|
state: {
|
3178
3482
|
hover: {
|
@@ -3260,21 +3564,46 @@
|
|
3260
3564
|
result.animation = true;
|
3261
3565
|
return result;
|
3262
3566
|
};
|
3263
|
-
const
|
3567
|
+
const initScatter = (spec, context)=>{
|
3264
3568
|
const result = {
|
3265
3569
|
...spec
|
3266
3570
|
};
|
3267
|
-
|
3268
|
-
|
3269
|
-
|
3270
|
-
|
3271
|
-
|
3272
|
-
|
3273
|
-
|
3274
|
-
|
3275
|
-
|
3276
|
-
|
3571
|
+
const { advancedVSeed } = context;
|
3572
|
+
const { encoding } = advancedVSeed;
|
3573
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
3574
|
+
result.type = 'scatter';
|
3575
|
+
result.direction = 'vertical';
|
3576
|
+
result.xField = encoding[0].x[0];
|
3577
|
+
result.yField = encoding[0].y[0];
|
3578
|
+
result.seriesField = encoding[0].group[0];
|
3579
|
+
result.padding = 0;
|
3580
|
+
result.region = [
|
3581
|
+
{
|
3582
|
+
clip: true
|
3583
|
+
}
|
3584
|
+
];
|
3585
|
+
result.animation = true;
|
3586
|
+
return result;
|
3587
|
+
};
|
3588
|
+
const initRadar = (spec, context)=>{
|
3589
|
+
const result = {
|
3590
|
+
...spec
|
3277
3591
|
};
|
3592
|
+
const { advancedVSeed } = context;
|
3593
|
+
const { encoding } = advancedVSeed;
|
3594
|
+
if (!encoding[0].angle || !encoding[0].radius || !encoding[0].group) return result;
|
3595
|
+
result.type = 'radar';
|
3596
|
+
result.angleField = encoding[0].angle[0];
|
3597
|
+
result.radiusField = encoding[0].radius[0];
|
3598
|
+
result.seriesField = encoding[0].group[0];
|
3599
|
+
result.padding = 0;
|
3600
|
+
result.region = [
|
3601
|
+
{
|
3602
|
+
clip: true
|
3603
|
+
}
|
3604
|
+
];
|
3605
|
+
result.animation = true;
|
3606
|
+
return result;
|
3278
3607
|
};
|
3279
3608
|
const initFunnel = (spec, context)=>{
|
3280
3609
|
const result = {
|
@@ -3298,7 +3627,11 @@
|
|
3298
3627
|
];
|
3299
3628
|
result.funnel = {
|
3300
3629
|
style: {
|
3301
|
-
cornerRadius: 4
|
3630
|
+
cornerRadius: 4,
|
3631
|
+
fill: {
|
3632
|
+
field: encoding[0].color[0],
|
3633
|
+
scale: 'color'
|
3634
|
+
}
|
3302
3635
|
},
|
3303
3636
|
state: {
|
3304
3637
|
hover: {
|
@@ -3312,26 +3645,21 @@
|
|
3312
3645
|
result.animation = true;
|
3313
3646
|
return result;
|
3314
3647
|
};
|
3315
|
-
const
|
3648
|
+
const initPivot = (spec)=>{
|
3316
3649
|
const result = {
|
3317
3650
|
...spec
|
3318
3651
|
};
|
3319
|
-
|
3320
|
-
|
3321
|
-
|
3322
|
-
|
3323
|
-
|
3324
|
-
|
3325
|
-
|
3326
|
-
|
3327
|
-
|
3328
|
-
|
3329
|
-
|
3330
|
-
clip: true
|
3331
|
-
}
|
3332
|
-
];
|
3333
|
-
result.animation = true;
|
3334
|
-
return result;
|
3652
|
+
return {
|
3653
|
+
...result,
|
3654
|
+
animation: true,
|
3655
|
+
rows: [],
|
3656
|
+
columns: [],
|
3657
|
+
indicators: [],
|
3658
|
+
records: [],
|
3659
|
+
widthMode: 'adaptive',
|
3660
|
+
heightMode: 'adaptive',
|
3661
|
+
indicatorsAsCol: false
|
3662
|
+
};
|
3335
3663
|
};
|
3336
3664
|
const xBand = (spec, context)=>{
|
3337
3665
|
const result = {
|
@@ -3694,7 +4022,7 @@
|
|
3694
4022
|
};
|
3695
4023
|
const { advancedVSeed } = context;
|
3696
4024
|
const { dimensions, measures } = advancedVSeed;
|
3697
|
-
if (!dimensions || !measures) return
|
4025
|
+
if (!dimensions || !measures) return result;
|
3698
4026
|
const is0D = 0 === dimensions.length;
|
3699
4027
|
const is1M1D = 1 === dimensions.length && 1 === measures.length;
|
3700
4028
|
const showAxis = !(is0D || is1M1D);
|
@@ -3725,7 +4053,7 @@
|
|
3725
4053
|
};
|
3726
4054
|
const { advancedVSeed } = context;
|
3727
4055
|
const { dimensions, measures } = advancedVSeed;
|
3728
|
-
if (!dimensions || !measures) return
|
4056
|
+
if (!dimensions || !measures) return result;
|
3729
4057
|
const is0D = 0 === dimensions.length;
|
3730
4058
|
const is1M1D = 1 === dimensions.length && 1 === measures.length;
|
3731
4059
|
const showAxis = !(is0D || is1M1D);
|
@@ -3761,6 +4089,59 @@
|
|
3761
4089
|
});
|
3762
4090
|
return result;
|
3763
4091
|
};
|
4092
|
+
const radarAngleAxis = (spec, context)=>{
|
4093
|
+
const result = {
|
4094
|
+
...spec
|
4095
|
+
};
|
4096
|
+
const { advancedVSeed } = context;
|
4097
|
+
const { dimensions, measures } = advancedVSeed;
|
4098
|
+
if (!dimensions || !measures) return result;
|
4099
|
+
if (!result.axes) result.axes = [];
|
4100
|
+
result.axes.push({
|
4101
|
+
orient: 'angle',
|
4102
|
+
visible: true,
|
4103
|
+
zero: true,
|
4104
|
+
nice: true,
|
4105
|
+
grid: {
|
4106
|
+
visible: true
|
4107
|
+
},
|
4108
|
+
domainLine: {
|
4109
|
+
visible: true
|
4110
|
+
},
|
4111
|
+
tick: {
|
4112
|
+
visible: true
|
4113
|
+
}
|
4114
|
+
});
|
4115
|
+
return result;
|
4116
|
+
};
|
4117
|
+
const radarRadiusAxis = (spec, context)=>{
|
4118
|
+
const result = {
|
4119
|
+
...spec
|
4120
|
+
};
|
4121
|
+
const { advancedVSeed } = context;
|
4122
|
+
const { dimensions, measures } = advancedVSeed;
|
4123
|
+
if (!dimensions || !measures) return result;
|
4124
|
+
if (!result.axes) result.axes = [];
|
4125
|
+
result.axes.push({
|
4126
|
+
orient: 'radius',
|
4127
|
+
visible: true,
|
4128
|
+
zero: true,
|
4129
|
+
nice: true,
|
4130
|
+
grid: {
|
4131
|
+
visible: true
|
4132
|
+
},
|
4133
|
+
tick: {
|
4134
|
+
visible: true
|
4135
|
+
},
|
4136
|
+
label: {
|
4137
|
+
visible: true
|
4138
|
+
},
|
4139
|
+
domainLine: {
|
4140
|
+
visible: true
|
4141
|
+
}
|
4142
|
+
});
|
4143
|
+
return result;
|
4144
|
+
};
|
3764
4145
|
const percent = (spec, context)=>{
|
3765
4146
|
const result = {
|
3766
4147
|
...spec
|
@@ -3807,7 +4188,9 @@
|
|
3807
4188
|
const { advancedVSeed } = context;
|
3808
4189
|
const { measures, datasetReshapeInfo, chartType } = advancedVSeed;
|
3809
4190
|
const baseConfig = advancedVSeed.config[chartType];
|
3810
|
-
const { tooltip
|
4191
|
+
const { tooltip = {
|
4192
|
+
enable: true
|
4193
|
+
} } = baseConfig;
|
3811
4194
|
const { enable } = tooltip;
|
3812
4195
|
const { measureId, measureValue } = datasetReshapeInfo[0].foldInfo;
|
3813
4196
|
const { groupName } = datasetReshapeInfo[0].unfoldInfo;
|
@@ -3897,6 +4280,16 @@
|
|
3897
4280
|
};
|
3898
4281
|
return result;
|
3899
4282
|
};
|
4283
|
+
const labelColorInversion = (spec)=>{
|
4284
|
+
const result = {
|
4285
|
+
...spec
|
4286
|
+
};
|
4287
|
+
if (result.label) result.label.smartInvert = true;
|
4288
|
+
else result.label = {
|
4289
|
+
smartInvert: true
|
4290
|
+
};
|
4291
|
+
return result;
|
4292
|
+
};
|
3900
4293
|
const discreteLegend = (spec, context)=>{
|
3901
4294
|
const result = {
|
3902
4295
|
...spec
|
@@ -4106,6 +4499,69 @@
|
|
4106
4499
|
legends
|
4107
4500
|
};
|
4108
4501
|
};
|
4502
|
+
const colorLegend = (spec, context)=>{
|
4503
|
+
const result = {
|
4504
|
+
...spec
|
4505
|
+
};
|
4506
|
+
const { advancedVSeed } = context;
|
4507
|
+
const { chartType } = advancedVSeed;
|
4508
|
+
const baseConfig = advancedVSeed.config[chartType];
|
4509
|
+
const { encoding } = advancedVSeed;
|
4510
|
+
if (!encoding[0].color) return result;
|
4511
|
+
if (!baseConfig || !baseConfig.legend) return result;
|
4512
|
+
const { legend } = baseConfig;
|
4513
|
+
const { enable, position = 'bottom' } = legend || {};
|
4514
|
+
const orient = [
|
4515
|
+
'bottom',
|
4516
|
+
'bottomLeft',
|
4517
|
+
'bottomRight',
|
4518
|
+
'bl',
|
4519
|
+
'br'
|
4520
|
+
].includes(position) ? 'bottom' : [
|
4521
|
+
'top',
|
4522
|
+
'topLeft',
|
4523
|
+
'topRight',
|
4524
|
+
'tl',
|
4525
|
+
'tr'
|
4526
|
+
].includes(position) ? 'top' : [
|
4527
|
+
'left',
|
4528
|
+
'leftTop',
|
4529
|
+
'leftBottom',
|
4530
|
+
'lt',
|
4531
|
+
'lb'
|
4532
|
+
].includes(position) ? 'left' : 'right';
|
4533
|
+
const legendPosition = [
|
4534
|
+
'topLeft',
|
4535
|
+
'bottomLeft',
|
4536
|
+
'leftTop',
|
4537
|
+
'rightTop',
|
4538
|
+
'lt',
|
4539
|
+
'rt',
|
4540
|
+
'tl',
|
4541
|
+
'bl'
|
4542
|
+
].includes(position) ? 'start' : [
|
4543
|
+
'topRight',
|
4544
|
+
'bottomRight',
|
4545
|
+
'leftBottom',
|
4546
|
+
'rightBottom',
|
4547
|
+
'lb',
|
4548
|
+
'rb',
|
4549
|
+
'rt',
|
4550
|
+
'br'
|
4551
|
+
].includes(position) ? 'end' : 'middle';
|
4552
|
+
result.legends = {
|
4553
|
+
type: 'color',
|
4554
|
+
visible: enable,
|
4555
|
+
orient,
|
4556
|
+
position: legendPosition,
|
4557
|
+
field: encoding[0].color[0],
|
4558
|
+
inverse: !![
|
4559
|
+
'left',
|
4560
|
+
'right'
|
4561
|
+
].includes(orient)
|
4562
|
+
};
|
4563
|
+
return result;
|
4564
|
+
};
|
4109
4565
|
const color_color = (spec, context)=>{
|
4110
4566
|
const result = {
|
4111
4567
|
...spec
|
@@ -4133,6 +4589,28 @@
|
|
4133
4589
|
};
|
4134
4590
|
return result;
|
4135
4591
|
};
|
4592
|
+
const linearColor = (spec, context)=>{
|
4593
|
+
const result = {
|
4594
|
+
...spec
|
4595
|
+
};
|
4596
|
+
const { advancedVSeed } = context;
|
4597
|
+
const { datasetReshapeInfo, chartType, encoding } = advancedVSeed;
|
4598
|
+
const baseConfig = advancedVSeed.config[chartType];
|
4599
|
+
if (!baseConfig || !baseConfig.color) return result;
|
4600
|
+
const { color } = baseConfig;
|
4601
|
+
const { colorScheme } = color;
|
4602
|
+
result.color = {
|
4603
|
+
type: 'linear',
|
4604
|
+
domain: [
|
4605
|
+
{
|
4606
|
+
dataId: datasetReshapeInfo[0].id,
|
4607
|
+
fields: encoding?.[0]?.color
|
4608
|
+
}
|
4609
|
+
],
|
4610
|
+
range: colorScheme
|
4611
|
+
};
|
4612
|
+
return result;
|
4613
|
+
};
|
4136
4614
|
const pivotAdapter_pivotAdapter = (pipeline, pivotPipeline)=>(spec, context)=>{
|
4137
4615
|
const { vseed } = context;
|
4138
4616
|
const usePivotChart = isPivotChart(vseed);
|
@@ -5386,7 +5864,7 @@
|
|
5386
5864
|
initLine,
|
5387
5865
|
color_color,
|
5388
5866
|
background_backgroundColor,
|
5389
|
-
|
5867
|
+
datasetXY,
|
5390
5868
|
xBand,
|
5391
5869
|
yLinear,
|
5392
5870
|
label_label,
|
@@ -5410,7 +5888,7 @@
|
|
5410
5888
|
initLine,
|
5411
5889
|
color_color,
|
5412
5890
|
background_backgroundColor,
|
5413
|
-
|
5891
|
+
datasetXY,
|
5414
5892
|
xBand,
|
5415
5893
|
yLinear,
|
5416
5894
|
label_label,
|
@@ -5437,7 +5915,7 @@
|
|
5437
5915
|
stackInverse,
|
5438
5916
|
color_color,
|
5439
5917
|
background_backgroundColor,
|
5440
|
-
|
5918
|
+
datasetXY,
|
5441
5919
|
xBand,
|
5442
5920
|
yLinear,
|
5443
5921
|
label_label,
|
@@ -5461,7 +5939,7 @@
|
|
5461
5939
|
stackInverse,
|
5462
5940
|
color_color,
|
5463
5941
|
background_backgroundColor,
|
5464
|
-
|
5942
|
+
datasetXY,
|
5465
5943
|
xBand,
|
5466
5944
|
yLinear,
|
5467
5945
|
label_label,
|
@@ -5485,7 +5963,7 @@
|
|
5485
5963
|
stackCornerRadius_stackCornerRadius,
|
5486
5964
|
color_color,
|
5487
5965
|
background_backgroundColor,
|
5488
|
-
|
5966
|
+
datasetXY,
|
5489
5967
|
xBand,
|
5490
5968
|
yLinear,
|
5491
5969
|
label_label,
|
@@ -5508,7 +5986,7 @@
|
|
5508
5986
|
stackCornerRadius_stackCornerRadius,
|
5509
5987
|
color_color,
|
5510
5988
|
background_backgroundColor,
|
5511
|
-
|
5989
|
+
datasetXY,
|
5512
5990
|
xBand,
|
5513
5991
|
yLinear,
|
5514
5992
|
label_label,
|
@@ -5534,7 +6012,7 @@
|
|
5534
6012
|
color_color,
|
5535
6013
|
background_backgroundColor,
|
5536
6014
|
percent,
|
5537
|
-
|
6015
|
+
datasetXY,
|
5538
6016
|
xBand,
|
5539
6017
|
yLinear,
|
5540
6018
|
label_label,
|
@@ -5559,7 +6037,7 @@
|
|
5559
6037
|
color_color,
|
5560
6038
|
percent,
|
5561
6039
|
background_backgroundColor,
|
5562
|
-
|
6040
|
+
datasetXY,
|
5563
6041
|
xBand,
|
5564
6042
|
yLinear,
|
5565
6043
|
label_label,
|
@@ -5583,7 +6061,7 @@
|
|
5583
6061
|
stackCornerRadius_stackCornerRadius,
|
5584
6062
|
color_color,
|
5585
6063
|
background_backgroundColor,
|
5586
|
-
|
6064
|
+
datasetYX,
|
5587
6065
|
xLinear,
|
5588
6066
|
yBand,
|
5589
6067
|
label_label,
|
@@ -5606,7 +6084,7 @@
|
|
5606
6084
|
stackCornerRadius_stackCornerRadius,
|
5607
6085
|
color_color,
|
5608
6086
|
background_backgroundColor,
|
5609
|
-
|
6087
|
+
datasetYX,
|
5610
6088
|
xLinear,
|
5611
6089
|
yBand,
|
5612
6090
|
label_label,
|
@@ -5631,7 +6109,7 @@
|
|
5631
6109
|
stackCornerRadius_stackCornerRadius,
|
5632
6110
|
color_color,
|
5633
6111
|
background_backgroundColor,
|
5634
|
-
|
6112
|
+
datasetYX,
|
5635
6113
|
xLinear,
|
5636
6114
|
yBand,
|
5637
6115
|
label_label,
|
@@ -5654,7 +6132,7 @@
|
|
5654
6132
|
stackCornerRadius_stackCornerRadius,
|
5655
6133
|
color_color,
|
5656
6134
|
background_backgroundColor,
|
5657
|
-
|
6135
|
+
datasetYX,
|
5658
6136
|
xLinear,
|
5659
6137
|
yBand,
|
5660
6138
|
label_label,
|
@@ -5679,7 +6157,7 @@
|
|
5679
6157
|
color_color,
|
5680
6158
|
background_backgroundColor,
|
5681
6159
|
percent,
|
5682
|
-
|
6160
|
+
datasetYX,
|
5683
6161
|
xLinear,
|
5684
6162
|
yBand,
|
5685
6163
|
label_label,
|
@@ -5703,7 +6181,7 @@
|
|
5703
6181
|
color_color,
|
5704
6182
|
background_backgroundColor,
|
5705
6183
|
percent,
|
5706
|
-
|
6184
|
+
datasetYX,
|
5707
6185
|
yBand,
|
5708
6186
|
xLinear,
|
5709
6187
|
label_label,
|
@@ -5727,7 +6205,7 @@
|
|
5727
6205
|
stackInverse,
|
5728
6206
|
color_color,
|
5729
6207
|
background_backgroundColor,
|
5730
|
-
|
6208
|
+
datasetXY,
|
5731
6209
|
xBand,
|
5732
6210
|
yLinear,
|
5733
6211
|
label_label,
|
@@ -5753,7 +6231,7 @@
|
|
5753
6231
|
color_color,
|
5754
6232
|
background_backgroundColor,
|
5755
6233
|
stackInverse,
|
5756
|
-
|
6234
|
+
datasetXY,
|
5757
6235
|
xBand,
|
5758
6236
|
yLinear,
|
5759
6237
|
label_label,
|
@@ -5781,7 +6259,7 @@
|
|
5781
6259
|
color_color,
|
5782
6260
|
background_backgroundColor,
|
5783
6261
|
percent,
|
5784
|
-
|
6262
|
+
datasetXY,
|
5785
6263
|
xBand,
|
5786
6264
|
yLinear,
|
5787
6265
|
label_label,
|
@@ -5807,7 +6285,7 @@
|
|
5807
6285
|
color_color,
|
5808
6286
|
background_backgroundColor,
|
5809
6287
|
percent,
|
5810
|
-
|
6288
|
+
datasetXY,
|
5811
6289
|
xBand,
|
5812
6290
|
yLinear,
|
5813
6291
|
label_label,
|
@@ -5843,7 +6321,7 @@
|
|
5843
6321
|
pointStyle_pointStyle,
|
5844
6322
|
pointStateDimensionHover
|
5845
6323
|
]),
|
5846
|
-
|
6324
|
+
datasetXY,
|
5847
6325
|
background_backgroundColor,
|
5848
6326
|
xBand,
|
5849
6327
|
yLinear,
|
@@ -5860,42 +6338,91 @@
|
|
5860
6338
|
pivotIndicators_pivotIndicatorsAsRow,
|
5861
6339
|
datasetPivot,
|
5862
6340
|
pivotIndicators([
|
5863
|
-
series([
|
5864
|
-
initAreaRange,
|
5865
|
-
areaStyle_areaStyle
|
5866
|
-
], [
|
5867
|
-
initAreaRangeLine1,
|
5868
|
-
lineStyle_lineStyle,
|
5869
|
-
pointStyle_pointStyle,
|
5870
|
-
pointStateDimensionHover
|
5871
|
-
], [
|
5872
|
-
initAreaRangeLine2,
|
5873
|
-
lineStyle_lineStyle,
|
5874
|
-
pointStyle_pointStyle,
|
5875
|
-
pointStateDimensionHover
|
5876
|
-
]),
|
6341
|
+
series([
|
6342
|
+
initAreaRange,
|
6343
|
+
areaStyle_areaStyle
|
6344
|
+
], [
|
6345
|
+
initAreaRangeLine1,
|
6346
|
+
lineStyle_lineStyle,
|
6347
|
+
pointStyle_pointStyle,
|
6348
|
+
pointStateDimensionHover
|
6349
|
+
], [
|
6350
|
+
initAreaRangeLine2,
|
6351
|
+
lineStyle_lineStyle,
|
6352
|
+
pointStyle_pointStyle,
|
6353
|
+
pointStateDimensionHover
|
6354
|
+
]),
|
6355
|
+
background_backgroundColor,
|
6356
|
+
datasetXY,
|
6357
|
+
xBand,
|
6358
|
+
yLinear,
|
6359
|
+
label_label,
|
6360
|
+
verticalCrosshairLine,
|
6361
|
+
annotationPoint_annotationPoint,
|
6362
|
+
annotationVerticalLine_annotationVerticalLine,
|
6363
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
6364
|
+
annotationArea_annotationArea
|
6365
|
+
]),
|
6366
|
+
pivotRowDimensions,
|
6367
|
+
pivotColumnDimensions
|
6368
|
+
];
|
6369
|
+
const areaRangeSpecPipeline = [
|
6370
|
+
pivotAdapter_pivotAdapter(areaRange, pivotAreaRange)
|
6371
|
+
];
|
6372
|
+
const scatter = [
|
6373
|
+
initScatter,
|
6374
|
+
color_color,
|
6375
|
+
background_backgroundColor,
|
6376
|
+
datasetXY,
|
6377
|
+
xLinear,
|
6378
|
+
yLinear,
|
6379
|
+
label_label,
|
6380
|
+
tooltip_tooltip,
|
6381
|
+
verticalCrosshairLine,
|
6382
|
+
horizontalCrosshairLine,
|
6383
|
+
discreteLegend,
|
6384
|
+
pointStyle_pointStyle,
|
6385
|
+
pointStateHover,
|
6386
|
+
annotationPoint_annotationPoint,
|
6387
|
+
annotationVerticalLine_annotationVerticalLine,
|
6388
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
6389
|
+
annotationArea_annotationArea
|
6390
|
+
];
|
6391
|
+
const pivotScatter = [
|
6392
|
+
initPivot,
|
6393
|
+
pivotGridStyle,
|
6394
|
+
pivotIndicators_pivotIndicatorsAsRow,
|
6395
|
+
datasetPivot,
|
6396
|
+
pivotIndicators([
|
6397
|
+
initScatter,
|
6398
|
+
color_color,
|
5877
6399
|
background_backgroundColor,
|
5878
|
-
|
5879
|
-
|
6400
|
+
datasetXY,
|
6401
|
+
xLinear,
|
5880
6402
|
yLinear,
|
5881
6403
|
label_label,
|
6404
|
+
tooltip_tooltip,
|
5882
6405
|
verticalCrosshairLine,
|
6406
|
+
horizontalCrosshairLine,
|
6407
|
+
pointStyle_pointStyle,
|
6408
|
+
pointStateHover,
|
5883
6409
|
annotationPoint_annotationPoint,
|
5884
6410
|
annotationVerticalLine_annotationVerticalLine,
|
5885
6411
|
annotationHorizontalLine_annotationHorizontalLine,
|
5886
6412
|
annotationArea_annotationArea
|
5887
6413
|
]),
|
5888
6414
|
pivotRowDimensions,
|
5889
|
-
pivotColumnDimensions
|
6415
|
+
pivotColumnDimensions,
|
6416
|
+
pivotDiscreteLegend
|
5890
6417
|
];
|
5891
|
-
const
|
5892
|
-
pivotAdapter_pivotAdapter(
|
6418
|
+
const scatterSpecPipeline = [
|
6419
|
+
pivotAdapter_pivotAdapter(scatter, pivotScatter)
|
5893
6420
|
];
|
5894
6421
|
const pie = [
|
5895
6422
|
initPie,
|
5896
6423
|
color_color,
|
5897
6424
|
background_backgroundColor,
|
5898
|
-
|
6425
|
+
datasetXY,
|
5899
6426
|
label_label,
|
5900
6427
|
tooltip_tooltip,
|
5901
6428
|
discreteLegend,
|
@@ -5913,7 +6440,7 @@
|
|
5913
6440
|
initPie,
|
5914
6441
|
color_color,
|
5915
6442
|
background_backgroundColor,
|
5916
|
-
|
6443
|
+
datasetXY,
|
5917
6444
|
label_label,
|
5918
6445
|
tooltip_tooltip,
|
5919
6446
|
annotationPoint_annotationPoint,
|
@@ -5932,7 +6459,7 @@
|
|
5932
6459
|
initDonut,
|
5933
6460
|
color_color,
|
5934
6461
|
background_backgroundColor,
|
5935
|
-
|
6462
|
+
datasetXY,
|
5936
6463
|
label_label,
|
5937
6464
|
tooltip_tooltip,
|
5938
6465
|
discreteLegend,
|
@@ -5950,7 +6477,7 @@
|
|
5950
6477
|
initDonut,
|
5951
6478
|
color_color,
|
5952
6479
|
background_backgroundColor,
|
5953
|
-
|
6480
|
+
datasetXY,
|
5954
6481
|
label_label,
|
5955
6482
|
tooltip_tooltip,
|
5956
6483
|
annotationPoint_annotationPoint,
|
@@ -5971,7 +6498,7 @@
|
|
5971
6498
|
stackInverse,
|
5972
6499
|
color_color,
|
5973
6500
|
background_backgroundColor,
|
5974
|
-
|
6501
|
+
datasetXY,
|
5975
6502
|
radiusAxis,
|
5976
6503
|
angleAxis,
|
5977
6504
|
label_label,
|
@@ -5990,7 +6517,7 @@
|
|
5990
6517
|
stackInverse,
|
5991
6518
|
color_color,
|
5992
6519
|
background_backgroundColor,
|
5993
|
-
|
6520
|
+
datasetXY,
|
5994
6521
|
radiusAxis,
|
5995
6522
|
angleAxis,
|
5996
6523
|
label_label,
|
@@ -6009,7 +6536,7 @@
|
|
6009
6536
|
stackCornerRadius_stackCornerRadius,
|
6010
6537
|
color_color,
|
6011
6538
|
background_backgroundColor,
|
6012
|
-
|
6539
|
+
datasetXY,
|
6013
6540
|
radiusAxis,
|
6014
6541
|
angleAxis,
|
6015
6542
|
label_label,
|
@@ -6031,7 +6558,7 @@
|
|
6031
6558
|
stackCornerRadius_stackCornerRadius,
|
6032
6559
|
color_color,
|
6033
6560
|
background_backgroundColor,
|
6034
|
-
|
6561
|
+
datasetXY,
|
6035
6562
|
radiusAxis,
|
6036
6563
|
angleAxis,
|
6037
6564
|
label_label,
|
@@ -6049,14 +6576,57 @@
|
|
6049
6576
|
const roseParallelSpecPipeline = [
|
6050
6577
|
pivotAdapter_pivotAdapter(roseParallel, pivotRoseParallel)
|
6051
6578
|
];
|
6052
|
-
const
|
6053
|
-
|
6579
|
+
const radar = [
|
6580
|
+
initRadar,
|
6054
6581
|
color_color,
|
6055
6582
|
background_backgroundColor,
|
6056
|
-
|
6583
|
+
datasetXY,
|
6584
|
+
radarAngleAxis,
|
6585
|
+
radarRadiusAxis,
|
6057
6586
|
label_label,
|
6058
6587
|
tooltip_tooltip,
|
6588
|
+
verticalCrosshairLine,
|
6059
6589
|
discreteLegend,
|
6590
|
+
pointStyle_pointStyle,
|
6591
|
+
pointStateDimensionHover,
|
6592
|
+
lineStyle_lineStyle,
|
6593
|
+
areaStyle_areaStyle
|
6594
|
+
];
|
6595
|
+
const pivotRadar = [
|
6596
|
+
initPivot,
|
6597
|
+
pivotGridStyle,
|
6598
|
+
pivotIndicators_pivotIndicatorsAsRow,
|
6599
|
+
datasetPivot,
|
6600
|
+
pivotIndicators([
|
6601
|
+
initRadar,
|
6602
|
+
color_color,
|
6603
|
+
background_backgroundColor,
|
6604
|
+
datasetXY,
|
6605
|
+
radarAngleAxis,
|
6606
|
+
radarRadiusAxis,
|
6607
|
+
label_label,
|
6608
|
+
tooltip_tooltip,
|
6609
|
+
verticalCrosshairLine,
|
6610
|
+
pointStyle_pointStyle,
|
6611
|
+
pointStateDimensionHover,
|
6612
|
+
lineStyle_lineStyle,
|
6613
|
+
areaStyle_areaStyle
|
6614
|
+
]),
|
6615
|
+
pivotRowDimensions,
|
6616
|
+
pivotColumnDimensions,
|
6617
|
+
pivotDiscreteLegend
|
6618
|
+
];
|
6619
|
+
const radarSpecPipeline = [
|
6620
|
+
pivotAdapter_pivotAdapter(radar, pivotRadar)
|
6621
|
+
];
|
6622
|
+
const funnel = [
|
6623
|
+
initFunnel,
|
6624
|
+
linearColor,
|
6625
|
+
background_backgroundColor,
|
6626
|
+
datasetXY,
|
6627
|
+
label_label,
|
6628
|
+
tooltip_tooltip,
|
6629
|
+
colorLegend,
|
6060
6630
|
annotationPoint_annotationPoint,
|
6061
6631
|
annotationVerticalLine_annotationVerticalLine,
|
6062
6632
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -6069,71 +6639,111 @@
|
|
6069
6639
|
datasetPivot,
|
6070
6640
|
pivotIndicators([
|
6071
6641
|
initFunnel,
|
6072
|
-
|
6642
|
+
linearColor,
|
6073
6643
|
background_backgroundColor,
|
6074
|
-
|
6644
|
+
datasetXY,
|
6075
6645
|
label_label,
|
6076
6646
|
tooltip_tooltip,
|
6647
|
+
colorLegend,
|
6077
6648
|
annotationPoint_annotationPoint,
|
6078
6649
|
annotationVerticalLine_annotationVerticalLine,
|
6079
6650
|
annotationHorizontalLine_annotationHorizontalLine,
|
6080
6651
|
annotationArea_annotationArea
|
6081
6652
|
]),
|
6082
6653
|
pivotRowDimensions,
|
6083
|
-
pivotColumnDimensions
|
6084
|
-
pivotDiscreteLegend
|
6654
|
+
pivotColumnDimensions
|
6085
6655
|
];
|
6086
6656
|
const funnelSpecPipeline = [
|
6087
6657
|
pivotAdapter_pivotAdapter(funnel, pivotFunnel)
|
6088
6658
|
];
|
6089
|
-
const
|
6090
|
-
|
6091
|
-
|
6659
|
+
const initHeatmap = (spec, context)=>{
|
6660
|
+
const result = {
|
6661
|
+
...spec
|
6662
|
+
};
|
6663
|
+
const { advancedVSeed } = context;
|
6664
|
+
const { encoding } = advancedVSeed;
|
6665
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].color) return result;
|
6666
|
+
result.type = 'heatmap';
|
6667
|
+
result.direction = 'vertical';
|
6668
|
+
result.xField = encoding[0].x[0];
|
6669
|
+
result.yField = encoding[0].y[0];
|
6670
|
+
result.valueField = encoding[0].color[0];
|
6671
|
+
result.padding = 0;
|
6672
|
+
result.cell = {
|
6673
|
+
style: {
|
6674
|
+
shape: 'rect',
|
6675
|
+
stroke: '#ffffff',
|
6676
|
+
lineWidth: 1,
|
6677
|
+
fill: {
|
6678
|
+
field: encoding[0].color[0],
|
6679
|
+
scale: 'color'
|
6680
|
+
}
|
6681
|
+
}
|
6682
|
+
};
|
6683
|
+
result.axes = [
|
6684
|
+
{
|
6685
|
+
type: 'band',
|
6686
|
+
orient: 'left',
|
6687
|
+
bandPadding: 0
|
6688
|
+
},
|
6689
|
+
{
|
6690
|
+
type: 'band',
|
6691
|
+
orient: 'bottom',
|
6692
|
+
bandPadding: 0
|
6693
|
+
}
|
6694
|
+
];
|
6695
|
+
result.region = [
|
6696
|
+
{
|
6697
|
+
clip: true
|
6698
|
+
}
|
6699
|
+
];
|
6700
|
+
result.animation = true;
|
6701
|
+
return result;
|
6702
|
+
};
|
6703
|
+
const heatmap = [
|
6704
|
+
initHeatmap,
|
6705
|
+
linearColor,
|
6092
6706
|
background_backgroundColor,
|
6093
|
-
|
6094
|
-
xLinear,
|
6095
|
-
yLinear,
|
6707
|
+
datasetXY,
|
6096
6708
|
label_label,
|
6709
|
+
labelColorInversion,
|
6710
|
+
colorLegend,
|
6097
6711
|
tooltip_tooltip,
|
6098
|
-
verticalCrosshairLine,
|
6099
|
-
horizontalCrosshairLine,
|
6100
|
-
discreteLegend,
|
6101
6712
|
pointStyle_pointStyle,
|
6102
|
-
|
6713
|
+
pointStateDimensionHover,
|
6714
|
+
lineStyle_lineStyle,
|
6103
6715
|
annotationPoint_annotationPoint,
|
6104
6716
|
annotationVerticalLine_annotationVerticalLine,
|
6105
6717
|
annotationHorizontalLine_annotationHorizontalLine,
|
6106
6718
|
annotationArea_annotationArea
|
6107
6719
|
];
|
6108
|
-
const
|
6720
|
+
const pivotHeatmap = [
|
6109
6721
|
initPivot,
|
6110
6722
|
pivotGridStyle,
|
6111
6723
|
pivotIndicators_pivotIndicatorsAsRow,
|
6112
6724
|
datasetPivot,
|
6113
6725
|
pivotIndicators([
|
6114
|
-
|
6115
|
-
|
6726
|
+
initHeatmap,
|
6727
|
+
linearColor,
|
6116
6728
|
background_backgroundColor,
|
6117
|
-
|
6118
|
-
xLinear,
|
6119
|
-
yLinear,
|
6729
|
+
datasetXY,
|
6120
6730
|
label_label,
|
6731
|
+
labelColorInversion,
|
6732
|
+
colorLegend,
|
6121
6733
|
tooltip_tooltip,
|
6122
|
-
verticalCrosshairLine,
|
6123
|
-
horizontalCrosshairLine,
|
6124
6734
|
pointStyle_pointStyle,
|
6125
|
-
|
6735
|
+
pointStateDimensionHover,
|
6736
|
+
lineStyle_lineStyle,
|
6126
6737
|
annotationPoint_annotationPoint,
|
6127
6738
|
annotationVerticalLine_annotationVerticalLine,
|
6128
6739
|
annotationHorizontalLine_annotationHorizontalLine,
|
6129
6740
|
annotationArea_annotationArea
|
6130
6741
|
]),
|
6131
6742
|
pivotRowDimensions,
|
6132
|
-
pivotColumnDimensions
|
6133
|
-
pivotDiscreteLegend
|
6743
|
+
pivotColumnDimensions
|
6134
6744
|
];
|
6135
|
-
const
|
6136
|
-
pivotAdapter_pivotAdapter(
|
6745
|
+
const heatmapSpecPipeline = [
|
6746
|
+
pivotAdapter_pivotAdapter(heatmap, pivotHeatmap)
|
6137
6747
|
];
|
6138
6748
|
const initTable = (spec, context)=>{
|
6139
6749
|
const { advancedVSeed } = context;
|
@@ -7065,6 +7675,14 @@
|
|
7065
7675
|
Builder._advancedPipelineMap.pivotTable = pivotTableAdvancedPipeline;
|
7066
7676
|
Builder._specPipelineMap.pivotTable = pivotTableSpecPipeline;
|
7067
7677
|
};
|
7678
|
+
const registerHeatmap = ()=>{
|
7679
|
+
Builder._advancedPipelineMap.heatmap = heatmapAdvancedPipeline;
|
7680
|
+
Builder._specPipelineMap.heatmap = heatmapSpecPipeline;
|
7681
|
+
};
|
7682
|
+
const registerRadar = ()=>{
|
7683
|
+
Builder._advancedPipelineMap.radar = radarAdvancedPipeline;
|
7684
|
+
Builder._specPipelineMap.radar = radarSpecPipeline;
|
7685
|
+
};
|
7068
7686
|
const lightTheme = ()=>{
|
7069
7687
|
const linearAxis = {
|
7070
7688
|
nice: true,
|
@@ -7339,6 +7957,9 @@
|
|
7339
7957
|
donut: {
|
7340
7958
|
...baseConfig
|
7341
7959
|
},
|
7960
|
+
radar: {
|
7961
|
+
...baseConfig
|
7962
|
+
},
|
7342
7963
|
rose: {
|
7343
7964
|
...baseConfig
|
7344
7965
|
},
|
@@ -7359,7 +7980,24 @@
|
|
7359
7980
|
'#ACB9FF',
|
7360
7981
|
'#B7C4FF',
|
7361
7982
|
'#C2CEFF'
|
7362
|
-
]
|
7983
|
+
].reverse()
|
7984
|
+
}
|
7985
|
+
},
|
7986
|
+
heatmap: {
|
7987
|
+
...baseConfig,
|
7988
|
+
color: {
|
7989
|
+
colorScheme: [
|
7990
|
+
'#5766EC',
|
7991
|
+
'#6372F0',
|
7992
|
+
'#7080F4',
|
7993
|
+
'#7C8CFA',
|
7994
|
+
'#8998FF',
|
7995
|
+
'#95A3FF',
|
7996
|
+
'#A0AEFF',
|
7997
|
+
'#ACB9FF',
|
7998
|
+
'#B7C4FF',
|
7999
|
+
'#C2CEFF'
|
8000
|
+
].reverse()
|
7363
8001
|
}
|
7364
8002
|
}
|
7365
8003
|
}
|
@@ -7638,6 +8276,9 @@
|
|
7638
8276
|
donut: {
|
7639
8277
|
...baseConfig
|
7640
8278
|
},
|
8279
|
+
radar: {
|
8280
|
+
...baseConfig
|
8281
|
+
},
|
7641
8282
|
rose: {
|
7642
8283
|
...baseConfig
|
7643
8284
|
},
|
@@ -7660,6 +8301,9 @@
|
|
7660
8301
|
'#A0CEFF'
|
7661
8302
|
]
|
7662
8303
|
}
|
8304
|
+
},
|
8305
|
+
heatmap: {
|
8306
|
+
...baseConfig
|
7663
8307
|
}
|
7664
8308
|
}
|
7665
8309
|
};
|
@@ -7678,6 +8322,8 @@
|
|
7678
8322
|
registerCustomTheme('dark', darkTheme());
|
7679
8323
|
};
|
7680
8324
|
const registerAll = ()=>{
|
8325
|
+
registerTable();
|
8326
|
+
registerPivotTable();
|
7681
8327
|
registerLine();
|
7682
8328
|
registerColumn();
|
7683
8329
|
registerColumnParallel();
|
@@ -7688,14 +8334,14 @@
|
|
7688
8334
|
registerArea();
|
7689
8335
|
registerAreaPercent();
|
7690
8336
|
registerAreaRange();
|
8337
|
+
registerScatter();
|
7691
8338
|
registerPie();
|
7692
8339
|
registerDonut();
|
7693
8340
|
registerRose();
|
7694
8341
|
registerRoseParallel();
|
8342
|
+
registerRadar();
|
7695
8343
|
registerFunnel();
|
7696
|
-
|
7697
|
-
registerTable();
|
7698
|
-
registerPivotTable();
|
8344
|
+
registerHeatmap();
|
7699
8345
|
registerLightTheme();
|
7700
8346
|
registerDarkTheme();
|
7701
8347
|
};
|
@@ -12523,13 +13169,15 @@
|
|
12523
13169
|
'area',
|
12524
13170
|
'areaPercent',
|
12525
13171
|
'areaRange',
|
13172
|
+
'scatter',
|
13173
|
+
'dualAxis',
|
12526
13174
|
'rose',
|
12527
13175
|
'roseParallel',
|
12528
13176
|
'pie',
|
12529
13177
|
'donut',
|
12530
|
-
'
|
12531
|
-
'
|
12532
|
-
'
|
13178
|
+
'radar',
|
13179
|
+
'funnel',
|
13180
|
+
'heatmap'
|
12533
13181
|
]);
|
12534
13182
|
const zDatum = record(schemas_string().or(schemas_number()), any());
|
12535
13183
|
const zDataset = schemas_array(zDatum);
|
@@ -12733,6 +13381,9 @@
|
|
12733
13381
|
colorScheme: schemas_array(schemas_string()).optional(),
|
12734
13382
|
colorMapping: record(schemas_string(), schemas_string()).optional()
|
12735
13383
|
});
|
13384
|
+
const zLinearColor = schemas_object({
|
13385
|
+
colorScheme: schemas_array(schemas_string()).optional()
|
13386
|
+
});
|
12736
13387
|
const zLabel = schemas_object({
|
12737
13388
|
enable: schemas_boolean().default(true).optional()
|
12738
13389
|
});
|
@@ -12790,6 +13441,31 @@
|
|
12790
13441
|
labelFontColor: schemas_string().default('#fff').optional(),
|
12791
13442
|
labelFontWeight: schemas_number().or(schemas_string()).default(400).optional()
|
12792
13443
|
});
|
13444
|
+
const zColorLegend = schemas_object({
|
13445
|
+
position: schemas_enum([
|
13446
|
+
'left',
|
13447
|
+
'leftTop',
|
13448
|
+
'leftBottom',
|
13449
|
+
'lt',
|
13450
|
+
'lb',
|
13451
|
+
'top',
|
13452
|
+
'topLeft',
|
13453
|
+
'topRight',
|
13454
|
+
'tl',
|
13455
|
+
'tr',
|
13456
|
+
'right',
|
13457
|
+
'rightTop',
|
13458
|
+
'rightBottom',
|
13459
|
+
'rt',
|
13460
|
+
'rb',
|
13461
|
+
'bottom',
|
13462
|
+
'bottomLeft',
|
13463
|
+
'bottomRight',
|
13464
|
+
'bl',
|
13465
|
+
'br'
|
13466
|
+
]).default('bottom').optional(),
|
13467
|
+
enable: schemas_boolean().default(true).optional()
|
13468
|
+
});
|
12793
13469
|
const zTooltip = schemas_object({
|
12794
13470
|
enable: schemas_boolean().default(true).optional()
|
12795
13471
|
});
|
@@ -12854,22 +13530,6 @@
|
|
12854
13530
|
});
|
12855
13531
|
const zAreaPercentConfig = zAreaConfig;
|
12856
13532
|
const zAreaRangeConfig = zAreaConfig;
|
12857
|
-
const zRoseConfig = schemas_object({
|
12858
|
-
backgroundColor: zBackgroundColor.optional(),
|
12859
|
-
label: zLabel.optional(),
|
12860
|
-
color: zColor.optional(),
|
12861
|
-
tooltip: zTooltip.optional(),
|
12862
|
-
legend: zLegend.optional()
|
12863
|
-
});
|
12864
|
-
const zRoseParallelConfig = zRoseConfig;
|
12865
|
-
const zPieConfig = schemas_object({
|
12866
|
-
backgroundColor: zBackgroundColor.optional(),
|
12867
|
-
label: zLabel.optional(),
|
12868
|
-
color: zColor.optional(),
|
12869
|
-
tooltip: zTooltip.optional(),
|
12870
|
-
legend: zLegend.optional()
|
12871
|
-
});
|
12872
|
-
const zDonutConfig = zPieConfig;
|
12873
13533
|
const zDualAxisConfig = schemas_object({
|
12874
13534
|
backgroundColor: zBackgroundColor.optional(),
|
12875
13535
|
label: zLabel.optional(),
|
@@ -12887,13 +13547,25 @@
|
|
12887
13547
|
yAxis: zYLinearAxis.optional(),
|
12888
13548
|
crosshairLine: zCrosshairLine.optional()
|
12889
13549
|
});
|
12890
|
-
const
|
13550
|
+
const zRoseConfig = schemas_object({
|
12891
13551
|
backgroundColor: zBackgroundColor.optional(),
|
13552
|
+
label: zLabel.optional(),
|
12892
13553
|
color: zColor.optional(),
|
12893
13554
|
tooltip: zTooltip.optional(),
|
13555
|
+
legend: zLegend.optional()
|
13556
|
+
});
|
13557
|
+
const zRoseParallelConfig = zRoseConfig;
|
13558
|
+
const zPieConfig = schemas_object({
|
13559
|
+
backgroundColor: zBackgroundColor.optional(),
|
12894
13560
|
label: zLabel.optional(),
|
13561
|
+
color: zColor.optional(),
|
13562
|
+
tooltip: zTooltip.optional(),
|
12895
13563
|
legend: zLegend.optional()
|
12896
13564
|
});
|
13565
|
+
const zDonutConfig = zPieConfig;
|
13566
|
+
const zRadarConfig = zPieConfig;
|
13567
|
+
const zFunnelConfig = zPieConfig;
|
13568
|
+
const zHeatmapConfig = zPieConfig;
|
12897
13569
|
const zConfig = schemas_object({
|
12898
13570
|
table: zTableConfig.optional(),
|
12899
13571
|
pivotTable: zPivotTableConfig.optional(),
|
@@ -12907,13 +13579,15 @@
|
|
12907
13579
|
area: zAreaConfig.optional(),
|
12908
13580
|
areaPercent: zAreaPercentConfig.optional(),
|
12909
13581
|
areaRange: zAreaRangeConfig.optional(),
|
13582
|
+
dualAxis: zDualAxisConfig.optional(),
|
13583
|
+
scatter: zScatterConfig.optional(),
|
12910
13584
|
rose: zRoseConfig.optional(),
|
12911
13585
|
roseParallel: zRoseParallelConfig.optional(),
|
12912
13586
|
pie: zPieConfig.optional(),
|
12913
13587
|
donut: zDonutConfig.optional(),
|
12914
|
-
|
12915
|
-
|
12916
|
-
|
13588
|
+
radar: zRadarConfig.optional(),
|
13589
|
+
funnel: zFunnelConfig.optional(),
|
13590
|
+
heatmap: zHeatmapConfig.optional()
|
12917
13591
|
});
|
12918
13592
|
const zAxis = schemas_object({
|
12919
13593
|
visible: schemas_boolean().default(true).optional(),
|
@@ -13067,7 +13741,7 @@
|
|
13067
13741
|
zSelector,
|
13068
13742
|
zSelectors
|
13069
13743
|
]).optional(),
|
13070
|
-
lineSmooth: schemas_boolean().
|
13744
|
+
lineSmooth: schemas_boolean().optional(),
|
13071
13745
|
lineColor: schemas_string().optional(),
|
13072
13746
|
lineColorOpacity: schemas_number().optional(),
|
13073
13747
|
lineWidth: schemas_number().optional(),
|
@@ -19241,6 +19915,27 @@
|
|
19241
19915
|
annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).optional(),
|
19242
19916
|
locale: zLocale.optional()
|
19243
19917
|
});
|
19918
|
+
const zScatter = schemas_object({
|
19919
|
+
chartType: literal('scatter'),
|
19920
|
+
dataset: zDataset.optional(),
|
19921
|
+
dimensions: zDimensions.optional(),
|
19922
|
+
measures: zMeasureTree.optional(),
|
19923
|
+
backgroundColor: zBackgroundColor.optional(),
|
19924
|
+
color: zColor.optional(),
|
19925
|
+
label: zLabel.optional(),
|
19926
|
+
legend: zLegend.optional(),
|
19927
|
+
tooltip: zTooltip.optional(),
|
19928
|
+
xAxis: zXLinearAxis.optional(),
|
19929
|
+
yAxis: zYLinearAxis.optional(),
|
19930
|
+
crosshairLine: zCrosshairLine.optional(),
|
19931
|
+
theme: zTheme.optional(),
|
19932
|
+
pointStyle: zPointStyle.optional(),
|
19933
|
+
annotationPoint: schemas_array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
19934
|
+
annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
19935
|
+
annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
19936
|
+
annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).optional(),
|
19937
|
+
locale: zLocale.optional()
|
19938
|
+
});
|
19244
19939
|
const zRose = schemas_object({
|
19245
19940
|
chartType: literal('rose'),
|
19246
19941
|
dataset: zDataset.optional(),
|
@@ -19293,8 +19988,8 @@
|
|
19293
19988
|
theme: zTheme.optional(),
|
19294
19989
|
locale: zLocale.optional()
|
19295
19990
|
});
|
19296
|
-
const
|
19297
|
-
chartType: literal('
|
19991
|
+
const zRadar = schemas_object({
|
19992
|
+
chartType: literal('radar'),
|
19298
19993
|
dataset: zDataset.optional(),
|
19299
19994
|
dimensions: zDimensions.optional(),
|
19300
19995
|
measures: zMeasureTree.optional(),
|
@@ -19303,15 +19998,7 @@
|
|
19303
19998
|
label: zLabel.optional(),
|
19304
19999
|
legend: zLegend.optional(),
|
19305
20000
|
tooltip: zTooltip.optional(),
|
19306
|
-
xAxis: zXLinearAxis.optional(),
|
19307
|
-
yAxis: zYLinearAxis.optional(),
|
19308
|
-
crosshairLine: zCrosshairLine.optional(),
|
19309
20001
|
theme: zTheme.optional(),
|
19310
|
-
pointStyle: zPointStyle.optional(),
|
19311
|
-
annotationPoint: schemas_array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
19312
|
-
annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
19313
|
-
annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
19314
|
-
annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).optional(),
|
19315
20002
|
locale: zLocale.optional()
|
19316
20003
|
});
|
19317
20004
|
const zFunnel = schemas_object({
|
@@ -19320,9 +20007,22 @@
|
|
19320
20007
|
dimensions: zDimensions.optional(),
|
19321
20008
|
measures: zMeasureTree.optional(),
|
19322
20009
|
backgroundColor: zBackgroundColor.optional(),
|
19323
|
-
color:
|
20010
|
+
color: zLinearColor.optional(),
|
19324
20011
|
label: zLabel.optional(),
|
19325
|
-
legend:
|
20012
|
+
legend: zColorLegend.optional(),
|
20013
|
+
tooltip: zTooltip.optional(),
|
20014
|
+
theme: zTheme.optional(),
|
20015
|
+
locale: zLocale.optional()
|
20016
|
+
});
|
20017
|
+
const zHeatmap = schemas_object({
|
20018
|
+
chartType: literal('heatmap'),
|
20019
|
+
dataset: zDataset.optional(),
|
20020
|
+
dimensions: zDimensions.optional(),
|
20021
|
+
measures: zMeasureTree.optional(),
|
20022
|
+
backgroundColor: zBackgroundColor.optional(),
|
20023
|
+
color: zLinearColor.optional(),
|
20024
|
+
label: zLabel.optional(),
|
20025
|
+
legend: zColorLegend.optional(),
|
19326
20026
|
tooltip: zTooltip.optional(),
|
19327
20027
|
theme: zTheme.optional(),
|
19328
20028
|
locale: zLocale.optional()
|
@@ -19340,12 +20040,14 @@
|
|
19340
20040
|
zArea,
|
19341
20041
|
zAreaPercent,
|
19342
20042
|
zAreaRange,
|
20043
|
+
zScatter,
|
19343
20044
|
zPie,
|
20045
|
+
zDonut,
|
19344
20046
|
zRose,
|
19345
20047
|
zRoseParallel,
|
19346
|
-
|
19347
|
-
|
19348
|
-
|
20048
|
+
zRadar,
|
20049
|
+
zFunnel,
|
20050
|
+
zHeatmap
|
19349
20051
|
]);
|
19350
20052
|
const zAdvancedVSeed = schemas_object({
|
19351
20053
|
chartType: zChartType,
|