@visactor/vseed 0.1.1 → 0.1.2
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 +116 -0
- package/dist/dataReshape/constant.d.ts +0 -8
- package/dist/dataReshape/foldMeasures.d.ts +6 -24
- package/dist/index.cjs +495 -266
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +478 -228
- package/dist/index.js.map +1 -1
- package/dist/pipeline/advanced/chart/pipes/encoding/index.d.ts +1 -0
- package/dist/pipeline/advanced/chart/pipes/encoding/line.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/color/colorAdapter.d.ts +3 -0
- package/dist/pipeline/spec/chart/pipes/color/colorAreaStyleFill.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/color/colorBarStyleFill.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/color/colorLineStyleFill.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/color/colorPointStyleFill.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/color/index.d.ts +6 -0
- package/dist/pipeline/spec/chart/pipes/{tooltip/tooltipDisable.d.ts → color/linearColor.d.ts} +1 -1
- package/dist/pipeline/spec/chart/pipes/legend/colorLegend.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/legend/index.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/legend/pivotColorLegend.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/tooltip/index.d.ts +0 -1
- package/dist/pipeline/utils/dimensions/find.d.ts +0 -2
- package/dist/pipeline/utils/dimensions/index.d.ts +0 -1
- package/dist/pipeline/utils/dimensions/typeGuard.d.ts +0 -4
- package/dist/types/advancedVSeed.d.ts +40 -0
- package/dist/types/chartType/area/zArea.d.ts +1 -0
- package/dist/types/chartType/areaPercent/zAreaPercent.d.ts +1 -0
- package/dist/types/chartType/bar/zBar.d.ts +1 -0
- package/dist/types/chartType/barParallel/zBarParallel.d.ts +1 -0
- package/dist/types/chartType/barPercent/zBarPercent.d.ts +1 -0
- package/dist/types/chartType/column/zColumn.d.ts +1 -0
- package/dist/types/chartType/columnParallel/zColumnParallel.d.ts +1 -0
- package/dist/types/chartType/columnPercent/zColumnPercent.d.ts +1 -0
- package/dist/types/chartType/donut/zDonut.d.ts +1 -0
- package/dist/types/chartType/dualAxis/zDualAxis.d.ts +1 -0
- package/dist/types/chartType/funnel/zFunnel.d.ts +2 -0
- package/dist/types/chartType/heatmap/zHeatmap.d.ts +2 -0
- package/dist/types/chartType/line/zLine.d.ts +1 -0
- package/dist/types/chartType/pie/zPie.d.ts +1 -0
- package/dist/types/chartType/radar/zRadar.d.ts +1 -0
- package/dist/types/chartType/rose/zRose.d.ts +1 -0
- package/dist/types/chartType/roseParallel/zRoseParallel.d.ts +1 -0
- package/dist/types/chartType/scatter/zScatter.d.ts +1 -0
- package/dist/types/properties/config/color/color.d.ts +8 -2
- package/dist/types/properties/config/config.d.ts +36 -0
- package/dist/types/properties/config/legend/legend.d.ts +9 -5
- package/dist/types/properties/datasetReshapeInfo/datasetReshapeInfo.d.ts +2 -0
- package/dist/types/properties/datasetReshapeInfo/zDatasetReshapeInfo.d.ts +6 -0
- package/dist/types/properties/theme/customTheme.d.ts +36 -0
- package/dist/types/zVseed.d.ts +20 -0
- package/dist/umd/index.js +495 -252
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -24,7 +24,6 @@ var __webpack_require__ = {};
|
|
24
24
|
var __webpack_exports__ = {};
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
27
|
-
zTooltip: ()=>zTooltip,
|
28
27
|
funnelAdvancedPipeline: ()=>funnelAdvancedPipeline,
|
29
28
|
zHeatmapConfig: ()=>zHeatmapConfig,
|
30
29
|
zBar: ()=>zBar,
|
@@ -74,12 +73,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
74
73
|
zRoseParallel: ()=>zRoseParallel,
|
75
74
|
MeasureName: ()=>MeasureName,
|
76
75
|
zDataset: ()=>zDataset,
|
77
|
-
UnfoldDimensionGroupId: ()=>UnfoldDimensionGroupId,
|
78
76
|
zNumFormat: ()=>zNumFormat,
|
79
77
|
barPercentAdvancedPipeline: ()=>barPercentAdvancedPipeline,
|
80
78
|
findAllDimensions: ()=>findAllDimensions,
|
81
79
|
FoldYMeasureValue: ()=>FoldYMeasureValue,
|
82
|
-
findDimensionById: ()=>findDimensionById,
|
83
80
|
zPivotTableConfig: ()=>zPivotTableConfig,
|
84
81
|
zArea: ()=>zArea,
|
85
82
|
zColumnParallel: ()=>zColumnParallel,
|
@@ -105,31 +102,31 @@ __webpack_require__.d(__webpack_exports__, {
|
|
105
102
|
registerLightTheme: ()=>registerLightTheme,
|
106
103
|
roseAdvancedPipeline: ()=>roseAdvancedPipeline,
|
107
104
|
zBarParallel: ()=>zBarParallel,
|
108
|
-
registerDarkTheme: ()=>registerDarkTheme,
|
109
|
-
registerPivotTable: ()=>registerPivotTable,
|
110
105
|
isPartialDatumSelector: ()=>isPartialDatumSelector,
|
111
|
-
|
112
|
-
isDimensionGroup: ()=>isDimensionGroup,
|
113
|
-
dualAxisSpecPipeline: ()=>dualAxisSpecPipeline,
|
106
|
+
registerPivotTable: ()=>registerPivotTable,
|
114
107
|
tableAdvancedPipeline: ()=>tableAdvancedPipeline,
|
115
|
-
|
108
|
+
registerDarkTheme: ()=>registerDarkTheme,
|
109
|
+
dualAxisSpecPipeline: ()=>dualAxisSpecPipeline,
|
110
|
+
pieSpecPipeline: ()=>pieSpecPipeline,
|
116
111
|
zAnnotationVerticalLine: ()=>zAnnotationVerticalLine,
|
117
|
-
|
112
|
+
barSpecPipeline: ()=>barSpecPipeline,
|
118
113
|
zChartType: ()=>zChartType,
|
114
|
+
registerRose: ()=>registerRose,
|
115
|
+
zMeasureTree: ()=>zMeasureTree,
|
119
116
|
unfoldDimensions: ()=>unfoldDimensions,
|
120
117
|
roseParallelAdvancedPipeline: ()=>roseParallelAdvancedPipeline,
|
121
118
|
registerTable: ()=>registerTable,
|
122
|
-
Builder: ()=>Builder,
|
123
119
|
isMeasureGroup: ()=>isMeasureGroup,
|
120
|
+
autoFormatter: ()=>autoFormatter,
|
124
121
|
YEncoding: ()=>YEncoding,
|
125
122
|
registerAll: ()=>registerAll,
|
126
123
|
registerBar: ()=>registerBar,
|
127
124
|
isVChart: ()=>isVChart,
|
128
125
|
radarSpecPipeline: ()=>radarSpecPipeline,
|
129
|
-
|
130
|
-
autoFormatter: ()=>autoFormatter,
|
131
|
-
zMeasureTree: ()=>zMeasureTree,
|
126
|
+
Builder: ()=>Builder,
|
132
127
|
zPieConfig: ()=>zPieConfig,
|
128
|
+
zPivotTable: ()=>zPivotTable,
|
129
|
+
zRadar: ()=>zRadar,
|
133
130
|
registerLine: ()=>registerLine,
|
134
131
|
registerCustomTheme: ()=>registerCustomTheme,
|
135
132
|
zColor: ()=>zColor,
|
@@ -149,21 +146,19 @@ __webpack_require__.d(__webpack_exports__, {
|
|
149
146
|
zAxis: ()=>zAxis,
|
150
147
|
isVTable: ()=>isVTable,
|
151
148
|
zMeasures: ()=>zMeasures,
|
152
|
-
|
149
|
+
zRadarConfig: ()=>zRadarConfig,
|
153
150
|
zLine: ()=>zLine,
|
154
151
|
columnSpecPipeline: ()=>columnSpecPipeline,
|
155
|
-
UnfoldDimensionGroup: ()=>UnfoldDimensionGroup,
|
156
|
-
zDatasetReshapeInfo: ()=>zDatasetReshapeInfo,
|
157
152
|
zFoldInfo: ()=>zFoldInfo,
|
153
|
+
zDatasetReshapeInfo: ()=>zDatasetReshapeInfo,
|
158
154
|
zLinearColor: ()=>zLinearColor,
|
155
|
+
zStackCornerRadius: ()=>zStackCornerRadius,
|
159
156
|
zAreaStyle: ()=>zAreaStyle,
|
160
157
|
ORIGINAL_DATA: ()=>ORIGINAL_DATA,
|
161
|
-
|
158
|
+
zUnfoldInfo: ()=>zUnfoldInfo,
|
162
159
|
zAnnotationArea: ()=>zAnnotationArea,
|
163
|
-
zStackCornerRadius: ()=>zStackCornerRadius,
|
164
160
|
DetailEncoding: ()=>DetailEncoding,
|
165
161
|
zRose: ()=>zRose,
|
166
|
-
zUnfoldInfo: ()=>zUnfoldInfo,
|
167
162
|
columnParallelSpecPipeline: ()=>columnParallelSpecPipeline,
|
168
163
|
i18n: ()=>i18n,
|
169
164
|
zPointStyle: ()=>zPointStyle,
|
@@ -172,7 +167,6 @@ __webpack_require__.d(__webpack_exports__, {
|
|
172
167
|
registerColumnParallel: ()=>registerColumnParallel,
|
173
168
|
updateAdvanced: ()=>updateAdvanced,
|
174
169
|
zDimension: ()=>zDimension,
|
175
|
-
zRadar: ()=>zRadar,
|
176
170
|
zTable: ()=>zTable,
|
177
171
|
isMeasure: ()=>isMeasure,
|
178
172
|
FoldSecondaryMeasureValue: ()=>FoldSecondaryMeasureValue,
|
@@ -196,9 +190,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
196
190
|
registerBarParallel: ()=>registerBarParallel,
|
197
191
|
registerRadar: ()=>registerRadar,
|
198
192
|
zEncodings: ()=>zEncodings,
|
199
|
-
isDimension: ()=>isDimension,
|
200
193
|
pivotTableSpecPipeline: ()=>pivotTableSpecPipeline,
|
201
194
|
zLocale: ()=>zLocale,
|
195
|
+
zMeasure: ()=>zMeasure,
|
202
196
|
FoldXMeasureValue: ()=>FoldXMeasureValue,
|
203
197
|
dualAxisAdvancedPipeline: ()=>dualAxisAdvancedPipeline,
|
204
198
|
registerScatter: ()=>registerScatter,
|
@@ -210,10 +204,9 @@ __webpack_require__.d(__webpack_exports__, {
|
|
210
204
|
zAdvancedVSeed: ()=>zAdvancedVSeed,
|
211
205
|
zConfig: ()=>zConfig,
|
212
206
|
zBarStyle: ()=>zBarStyle,
|
213
|
-
zMeasure: ()=>zMeasure,
|
214
207
|
zRoseParallelConfig: ()=>zRoseParallelConfig,
|
215
|
-
zAreaPercent: ()=>zAreaPercent,
|
216
208
|
zXLinearAxis: ()=>zXLinearAxis,
|
209
|
+
zAreaPercent: ()=>zAreaPercent,
|
217
210
|
columnParallelAdvancedPipeline: ()=>columnParallelAdvancedPipeline,
|
218
211
|
isValueSelector: ()=>isValueSelector,
|
219
212
|
donutAdvancedPipeline: ()=>donutAdvancedPipeline,
|
@@ -231,8 +224,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
231
224
|
lineAdvancedPipeline: ()=>lineAdvancedPipeline,
|
232
225
|
dataReshapeByEncoding: ()=>dataReshapeByEncoding,
|
233
226
|
lineSpecPipeline: ()=>lineSpecPipeline,
|
234
|
-
isDimensions: ()=>isDimensions,
|
235
227
|
zBarPercentConfig: ()=>zBarPercentConfig,
|
228
|
+
zTooltip: ()=>zTooltip,
|
236
229
|
createFormatter: ()=>createFormatter,
|
237
230
|
zDimensionGroup: ()=>zDimensionGroup,
|
238
231
|
isMeasureSelector: ()=>isMeasureSelector,
|
@@ -956,32 +949,6 @@ const autoPivotMeasures = (advancedVSeed, context)=>{
|
|
956
949
|
}));
|
957
950
|
return result;
|
958
951
|
};
|
959
|
-
const findDimensionById = (dimensions = [], id)=>{
|
960
|
-
if (!dimensions) return;
|
961
|
-
let result;
|
962
|
-
preorderTraverse(dimensions, (node)=>{
|
963
|
-
if (!('children' in node)) {
|
964
|
-
if (node.id === id) {
|
965
|
-
result = node;
|
966
|
-
return true;
|
967
|
-
}
|
968
|
-
}
|
969
|
-
return false;
|
970
|
-
});
|
971
|
-
return result;
|
972
|
-
};
|
973
|
-
const findFirstDimension = (dimensions = [])=>{
|
974
|
-
if (!dimensions) return;
|
975
|
-
let result;
|
976
|
-
preorderTraverse(dimensions, (node)=>{
|
977
|
-
if (!('children' in node)) {
|
978
|
-
result = node;
|
979
|
-
return true;
|
980
|
-
}
|
981
|
-
return false;
|
982
|
-
});
|
983
|
-
return result;
|
984
|
-
};
|
985
952
|
const findAllDimensions = (dimensions = [])=>{
|
986
953
|
if (!dimensions) return [];
|
987
954
|
const result = [];
|
@@ -1437,8 +1404,6 @@ const AngleEncoding = '__Dim_Angle__';
|
|
1437
1404
|
const DetailEncoding = '__Dim_Detail__';
|
1438
1405
|
const ColorEncoding = '__Dim_Color__';
|
1439
1406
|
const ColorIdEncoding = '__Dim_ColorId__';
|
1440
|
-
const UnfoldDimensionGroup = '__DimGroup__';
|
1441
|
-
const UnfoldDimensionGroupId = '__DimGroupID__';
|
1442
1407
|
const autoDimensions_autoDimensions = (advancedVSeed, context)=>{
|
1443
1408
|
const result = {
|
1444
1409
|
...advancedVSeed
|
@@ -1478,7 +1443,7 @@ const autoDimensions_autoDimensions = (advancedVSeed, context)=>{
|
|
1478
1443
|
result.dimensions.push(MeaName);
|
1479
1444
|
return result;
|
1480
1445
|
};
|
1481
|
-
const
|
1446
|
+
const encodingForLine = (advancedVSeed, context)=>{
|
1482
1447
|
const { vseed } = context;
|
1483
1448
|
const { dimensions } = advancedVSeed;
|
1484
1449
|
if (!dimensions) return advancedVSeed;
|
@@ -1491,10 +1456,7 @@ const encodingForColumn = (advancedVSeed, context)=>{
|
|
1491
1456
|
(dimensions[1] || dimensions[0]).id
|
1492
1457
|
];
|
1493
1458
|
const detail = encoding.detail || [];
|
1494
|
-
const mergedDetail =
|
1495
|
-
...color,
|
1496
|
-
...detail
|
1497
|
-
]);
|
1459
|
+
const mergedDetail = 0 === detail.length ? dimensions.map((d)=>d.id).filter((id)=>!x.includes(id)) : encoding.detail;
|
1498
1460
|
return {
|
1499
1461
|
...advancedVSeed,
|
1500
1462
|
encoding: {
|
@@ -1526,11 +1488,21 @@ const pivotAdapter = (pipeline, pivotPipeline)=>(advancedVSeed, context)=>{
|
|
1526
1488
|
if (usePivotChart) return execPipeline(pivotPipeline, context, advancedVSeed);
|
1527
1489
|
return execPipeline(pipeline, context, advancedVSeed);
|
1528
1490
|
};
|
1529
|
-
const foldMeasures = (dataset, measures,
|
1491
|
+
const foldMeasures = (dataset, measures, encoding, options)=>{
|
1492
|
+
const { measureId = FoldMeasureId, measureName = FoldMeasureName, measureValue = FoldMeasureValue } = options || {};
|
1493
|
+
const colorMeasureId = encoding?.color?.length === 1 && measures.some((m)=>m.id === encoding?.color?.[0]) ? encoding?.color?.[0] : void 0;
|
1530
1494
|
const foldInfo = {
|
1531
1495
|
measureId,
|
1532
1496
|
measureName,
|
1533
1497
|
measureValue,
|
1498
|
+
colorRange: [
|
1499
|
+
0,
|
1500
|
+
1
|
1501
|
+
],
|
1502
|
+
measureRange: [
|
1503
|
+
0,
|
1504
|
+
1
|
1505
|
+
],
|
1534
1506
|
foldMap: {}
|
1535
1507
|
};
|
1536
1508
|
const result = new Array(dataset.length * measures.length);
|
@@ -1547,6 +1519,19 @@ const foldMeasures = (dataset, measures, measureId = FoldMeasureId, measureName
|
|
1547
1519
|
datum[measureId] = id;
|
1548
1520
|
datum[measureName] = alias || id;
|
1549
1521
|
datum[measureValue] = dataset[i][id];
|
1522
|
+
if (colorMeasureId) {
|
1523
|
+
const value = datum[ORIGINAL_DATA][colorMeasureId];
|
1524
|
+
datum[ColorEncoding] = value;
|
1525
|
+
datum[ColorIdEncoding] = colorMeasureId;
|
1526
|
+
foldInfo.colorRange = [
|
1527
|
+
Math.min(foldInfo.colorRange[0] || 1 / 0, Number(value)),
|
1528
|
+
Math.max(foldInfo.colorRange[1] || -1 / 0, Number(value))
|
1529
|
+
];
|
1530
|
+
}
|
1531
|
+
foldInfo.measureRange = [
|
1532
|
+
Math.min(foldInfo.measureRange[0] || 1 / 0, Number(datum[id])),
|
1533
|
+
Math.max(foldInfo.measureRange[1] || -1 / 0, Number(datum[id]))
|
1534
|
+
];
|
1550
1535
|
foldInfo.foldMap[id] = alias;
|
1551
1536
|
result[index++] = datum;
|
1552
1537
|
}
|
@@ -1582,7 +1567,7 @@ const unfoldDimensions = (dataset, dimensions, encoding, options)=>{
|
|
1582
1567
|
applyEncoding(YEncoding, yDimensions, datum, separator);
|
1583
1568
|
applyEncoding(ColorEncoding, colorDimensions, datum, separator);
|
1584
1569
|
applyEncoding(DetailEncoding, detailDimensions, datum, separator);
|
1585
|
-
if (!datum[ColorEncoding]) continue;
|
1570
|
+
if (!colorDimensions.length || !datum[ColorEncoding]) continue;
|
1586
1571
|
const measureId = String(datum[foldMeasureId]);
|
1587
1572
|
const colorItem = String(datum[ColorEncoding]);
|
1588
1573
|
const colorId = colorItemAsId ? colorItem : measureId ? [
|
@@ -1603,29 +1588,13 @@ const unfoldDimensions = (dataset, dimensions, encoding, options)=>{
|
|
1603
1588
|
const applyEncoding = (encoding, dimensions, datum, separator)=>{
|
1604
1589
|
if (encoding && dimensions.length) datum[encoding] = dimensions.map((dim)=>String(datum[dim.id])).join(separator);
|
1605
1590
|
};
|
1606
|
-
const emptyReshapeResult = {
|
1607
|
-
dataset: [],
|
1608
|
-
foldInfo: {
|
1609
|
-
foldMap: {},
|
1610
|
-
measureId: '',
|
1611
|
-
measureName: '',
|
1612
|
-
measureValue: ''
|
1613
|
-
},
|
1614
|
-
unfoldInfo: {
|
1615
|
-
encodingAngle: AngleEncoding,
|
1616
|
-
encodingX: XEncoding,
|
1617
|
-
encodingY: YEncoding,
|
1618
|
-
encodingDetail: DetailEncoding,
|
1619
|
-
encodingColor: ColorEncoding,
|
1620
|
-
encodingColorId: ColorIdEncoding,
|
1621
|
-
colorItems: [],
|
1622
|
-
colorIdMap: {}
|
1623
|
-
}
|
1624
|
-
};
|
1625
1591
|
const dataReshapeByEncoding = (dataset, dimensions, measures, encoding, options)=>{
|
1626
1592
|
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, colorItemAsId = false } = options || {};
|
1627
|
-
|
1628
|
-
|
1593
|
+
const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures, encoding, {
|
1594
|
+
measureId: foldMeasureId,
|
1595
|
+
measureName: foldMeasureName,
|
1596
|
+
measureValue: foldMeasureValue
|
1597
|
+
});
|
1629
1598
|
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, dimensions, encoding, {
|
1630
1599
|
foldMeasureId,
|
1631
1600
|
separator: Separator,
|
@@ -1891,7 +1860,7 @@ const lineAdvancedPipeline = [
|
|
1891
1860
|
initAdvancedVSeed_initAdvancedVSeed,
|
1892
1861
|
autoMeasures_autoMeasures,
|
1893
1862
|
autoDimensions_autoDimensions,
|
1894
|
-
|
1863
|
+
encodingForLine,
|
1895
1864
|
pivotAdapter([
|
1896
1865
|
reshapeWithEncoding
|
1897
1866
|
], [
|
@@ -1904,6 +1873,17 @@ const lineAdvancedPipeline = [
|
|
1904
1873
|
markStyle_markStyle,
|
1905
1874
|
annotation_annotation
|
1906
1875
|
];
|
1876
|
+
const colorAdapter = (ordinalPipe, linearPipe)=>(spec, context)=>{
|
1877
|
+
const { advancedVSeed } = context;
|
1878
|
+
if (isLinearColor(advancedVSeed)) return linearPipe(spec, context);
|
1879
|
+
return ordinalPipe(spec, context);
|
1880
|
+
};
|
1881
|
+
const isLinearColor = (advancedVSeed)=>{
|
1882
|
+
const { encoding, measures } = advancedVSeed;
|
1883
|
+
const measureIdList = findAllMeasures(measures).map((measure)=>measure.id);
|
1884
|
+
const { color } = encoding;
|
1885
|
+
return color?.length === 1 && measureIdList.includes(color[0]);
|
1886
|
+
};
|
1907
1887
|
const initLine = (spec, context)=>{
|
1908
1888
|
const result = {
|
1909
1889
|
...spec
|
@@ -1915,7 +1895,7 @@ const initLine = (spec, context)=>{
|
|
1915
1895
|
result.direction = 'vertical';
|
1916
1896
|
result.xField = unfoldInfo.encodingX;
|
1917
1897
|
result.yField = foldInfo.measureValue;
|
1918
|
-
result.seriesField = unfoldInfo.encodingColorId;
|
1898
|
+
result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
|
1919
1899
|
result.padding = 0;
|
1920
1900
|
result.region = [
|
1921
1901
|
{
|
@@ -1976,6 +1956,31 @@ const createSpecifiedForColorMapping = (colorMapping, colorIdMap, colorItems)=>{
|
|
1976
1956
|
...accurateMap
|
1977
1957
|
};
|
1978
1958
|
};
|
1959
|
+
const linearColor = (spec, context)=>{
|
1960
|
+
const result = {
|
1961
|
+
...spec
|
1962
|
+
};
|
1963
|
+
const { advancedVSeed } = context;
|
1964
|
+
const { datasetReshapeInfo, chartType } = advancedVSeed;
|
1965
|
+
const { unfoldInfo, id } = datasetReshapeInfo[0];
|
1966
|
+
const baseConfig = advancedVSeed.config[chartType];
|
1967
|
+
if (!baseConfig || !baseConfig.color) return result;
|
1968
|
+
const { color } = baseConfig;
|
1969
|
+
const { colorScheme, linearColorScheme } = color;
|
1970
|
+
result.color = {
|
1971
|
+
type: 'linear',
|
1972
|
+
range: linearColorScheme || colorScheme || [],
|
1973
|
+
domain: [
|
1974
|
+
{
|
1975
|
+
dataId: id,
|
1976
|
+
fields: [
|
1977
|
+
unfoldInfo.encodingColor
|
1978
|
+
]
|
1979
|
+
}
|
1980
|
+
]
|
1981
|
+
};
|
1982
|
+
return result;
|
1983
|
+
};
|
1979
1984
|
const background_backgroundColor = (spec, context)=>{
|
1980
1985
|
const result = {
|
1981
1986
|
...spec
|
@@ -2483,6 +2488,95 @@ const discreteLegend = (spec, context)=>{
|
|
2483
2488
|
};
|
2484
2489
|
return result;
|
2485
2490
|
};
|
2491
|
+
const colorLegend = (spec, context)=>{
|
2492
|
+
const result = {
|
2493
|
+
...spec
|
2494
|
+
};
|
2495
|
+
const { advancedVSeed } = context;
|
2496
|
+
const { datasetReshapeInfo, chartType } = advancedVSeed;
|
2497
|
+
const { unfoldInfo } = datasetReshapeInfo[0];
|
2498
|
+
const baseConfig = advancedVSeed.config[chartType];
|
2499
|
+
if (!baseConfig || !baseConfig.legend) return result;
|
2500
|
+
const { legend } = baseConfig;
|
2501
|
+
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight } = legend || {};
|
2502
|
+
const orient = [
|
2503
|
+
'bottom',
|
2504
|
+
'bottomLeft',
|
2505
|
+
'bottomRight',
|
2506
|
+
'bl',
|
2507
|
+
'br'
|
2508
|
+
].includes(position) ? 'bottom' : [
|
2509
|
+
'top',
|
2510
|
+
'topLeft',
|
2511
|
+
'topRight',
|
2512
|
+
'tl',
|
2513
|
+
'tr'
|
2514
|
+
].includes(position) ? 'top' : [
|
2515
|
+
'left',
|
2516
|
+
'leftTop',
|
2517
|
+
'leftBottom',
|
2518
|
+
'lt',
|
2519
|
+
'lb'
|
2520
|
+
].includes(position) ? 'left' : 'right';
|
2521
|
+
const legendPosition = [
|
2522
|
+
'topLeft',
|
2523
|
+
'bottomLeft',
|
2524
|
+
'leftTop',
|
2525
|
+
'rightTop',
|
2526
|
+
'lt',
|
2527
|
+
'rt',
|
2528
|
+
'tl',
|
2529
|
+
'bl'
|
2530
|
+
].includes(position) ? 'start' : [
|
2531
|
+
'topRight',
|
2532
|
+
'bottomRight',
|
2533
|
+
'leftBottom',
|
2534
|
+
'rightBottom',
|
2535
|
+
'lb',
|
2536
|
+
'rb',
|
2537
|
+
'rt',
|
2538
|
+
'br'
|
2539
|
+
].includes(position) ? 'end' : 'middle';
|
2540
|
+
result.legends = {
|
2541
|
+
type: 'color',
|
2542
|
+
visible: enable,
|
2543
|
+
orient,
|
2544
|
+
position: legendPosition,
|
2545
|
+
padding: 0,
|
2546
|
+
field: unfoldInfo.encodingColor,
|
2547
|
+
maxWidth: '30%',
|
2548
|
+
startText: {
|
2549
|
+
visible: true,
|
2550
|
+
style: {
|
2551
|
+
fill: labelFontColor,
|
2552
|
+
fontSize: labelFontSize,
|
2553
|
+
fontWeight: labelFontWeight
|
2554
|
+
}
|
2555
|
+
},
|
2556
|
+
endText: {
|
2557
|
+
visible: true,
|
2558
|
+
style: {
|
2559
|
+
fill: labelFontColor,
|
2560
|
+
fontSize: labelFontSize,
|
2561
|
+
fontWeight: labelFontWeight
|
2562
|
+
}
|
2563
|
+
}
|
2564
|
+
};
|
2565
|
+
return result;
|
2566
|
+
};
|
2567
|
+
const colorPointStyleFill = (stylePipe)=>(spec, context)=>{
|
2568
|
+
const result = stylePipe(spec, context);
|
2569
|
+
const { advancedVSeed } = context;
|
2570
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
2571
|
+
const { unfoldInfo } = datasetReshapeInfo[0];
|
2572
|
+
if (isLinearColor(advancedVSeed)) {
|
2573
|
+
if (result?.point?.style) result.point.style.fill = {
|
2574
|
+
field: unfoldInfo.encodingColor,
|
2575
|
+
scale: 'color'
|
2576
|
+
};
|
2577
|
+
}
|
2578
|
+
return result;
|
2579
|
+
};
|
2486
2580
|
const selector_selector = (vchartDatum, selector)=>{
|
2487
2581
|
if (!selector) return true;
|
2488
2582
|
const selectorMode = 'And';
|
@@ -2579,7 +2673,10 @@ const pointStyle_pointStyle = (spec, context)=>{
|
|
2579
2673
|
const { markStyle } = advancedVSeed;
|
2580
2674
|
const { pointStyle } = markStyle;
|
2581
2675
|
const result = {
|
2582
|
-
...spec
|
2676
|
+
...spec,
|
2677
|
+
point: {
|
2678
|
+
style: {}
|
2679
|
+
}
|
2583
2680
|
};
|
2584
2681
|
if (!pointStyle) return result;
|
2585
2682
|
const pointStyles = Array.isArray(pointStyle) ? pointStyle : [
|
@@ -2623,6 +2720,7 @@ const pointStyle_pointStyle = (spec, context)=>{
|
|
2623
2720
|
return {
|
2624
2721
|
...result,
|
2625
2722
|
point: {
|
2723
|
+
...result.point,
|
2626
2724
|
state: {
|
2627
2725
|
...customMap
|
2628
2726
|
}
|
@@ -2678,15 +2776,31 @@ const pointStateHover = (spec, context)=>{
|
|
2678
2776
|
};
|
2679
2777
|
return result;
|
2680
2778
|
};
|
2779
|
+
const colorLineStyleFill = (stylePipe)=>(spec, context)=>{
|
2780
|
+
const result = stylePipe(spec, context);
|
2781
|
+
const { advancedVSeed } = context;
|
2782
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
2783
|
+
const { unfoldInfo } = datasetReshapeInfo[0];
|
2784
|
+
if (isLinearColor(advancedVSeed)) {
|
2785
|
+
if (result?.line?.style) result.line.style.stroke = {
|
2786
|
+
field: unfoldInfo.encodingColor,
|
2787
|
+
scale: 'color'
|
2788
|
+
};
|
2789
|
+
}
|
2790
|
+
return result;
|
2791
|
+
};
|
2681
2792
|
const lineStyle_lineStyle = (spec, context)=>{
|
2682
2793
|
const { advancedVSeed } = context;
|
2683
2794
|
const { markStyle, datasetReshapeInfo, dataset } = advancedVSeed;
|
2684
2795
|
const { unfoldInfo } = datasetReshapeInfo[0];
|
2685
2796
|
const { lineStyle } = markStyle;
|
2686
|
-
if (!lineStyle) return spec;
|
2687
2797
|
const result = {
|
2688
|
-
...spec
|
2798
|
+
...spec,
|
2799
|
+
line: {
|
2800
|
+
style: {}
|
2801
|
+
}
|
2689
2802
|
};
|
2803
|
+
if (!lineStyle) return result;
|
2690
2804
|
const lineStyles = Array.isArray(lineStyle) ? lineStyle : [
|
2691
2805
|
lineStyle
|
2692
2806
|
];
|
@@ -2730,6 +2844,7 @@ const lineStyle_lineStyle = (spec, context)=>{
|
|
2730
2844
|
return {
|
2731
2845
|
...result,
|
2732
2846
|
line: {
|
2847
|
+
...result.line,
|
2733
2848
|
state: {
|
2734
2849
|
...customMap
|
2735
2850
|
}
|
@@ -3502,7 +3617,7 @@ const pivotAdapter_pivotAdapter = (pipeline, pivotPipeline)=>(spec, context)=>{
|
|
3502
3617
|
};
|
3503
3618
|
const line_line = [
|
3504
3619
|
initLine,
|
3505
|
-
color_color,
|
3620
|
+
colorAdapter(color_color, linearColor),
|
3506
3621
|
background_backgroundColor,
|
3507
3622
|
datasetXY,
|
3508
3623
|
progressive,
|
@@ -3511,10 +3626,10 @@ const line_line = [
|
|
3511
3626
|
label_label,
|
3512
3627
|
tooltip_tooltip,
|
3513
3628
|
verticalCrosshairLine,
|
3514
|
-
discreteLegend,
|
3515
|
-
pointStyle_pointStyle,
|
3629
|
+
colorAdapter(discreteLegend, colorLegend),
|
3630
|
+
colorPointStyleFill(pointStyle_pointStyle),
|
3516
3631
|
pointStateDimensionHover,
|
3517
|
-
lineStyle_lineStyle,
|
3632
|
+
colorLineStyleFill(lineStyle_lineStyle),
|
3518
3633
|
annotationPoint_annotationPoint,
|
3519
3634
|
annotationVerticalLine_annotationVerticalLine,
|
3520
3635
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -3555,6 +3670,48 @@ const registerLine = ()=>{
|
|
3555
3670
|
Builder._advancedPipelineMap.line = lineAdvancedPipeline;
|
3556
3671
|
Builder._specPipelineMap.line = lineSpecPipeline;
|
3557
3672
|
};
|
3673
|
+
const encodingForColumn = (advancedVSeed, context)=>{
|
3674
|
+
const { vseed } = context;
|
3675
|
+
const { dimensions } = advancedVSeed;
|
3676
|
+
if (!dimensions) return advancedVSeed;
|
3677
|
+
const encoding = vseed.encoding;
|
3678
|
+
if (encoding) {
|
3679
|
+
const x = encoding.x || [
|
3680
|
+
dimensions[0].id
|
3681
|
+
];
|
3682
|
+
const color = encoding.color || [
|
3683
|
+
(dimensions[1] || dimensions[0]).id
|
3684
|
+
];
|
3685
|
+
const detail = encoding.detail || [];
|
3686
|
+
const mergedDetail = 0 === detail.length ? (0, external_remeda_namespaceObject.unique)([
|
3687
|
+
...color,
|
3688
|
+
...detail
|
3689
|
+
]) : detail;
|
3690
|
+
return {
|
3691
|
+
...advancedVSeed,
|
3692
|
+
encoding: {
|
3693
|
+
...encoding,
|
3694
|
+
x,
|
3695
|
+
color,
|
3696
|
+
detail: mergedDetail
|
3697
|
+
}
|
3698
|
+
};
|
3699
|
+
}
|
3700
|
+
const onlyMeasureName = 1 === dimensions.length && dimensions.find((item)=>item.id === MeasureName);
|
3701
|
+
const mergedEncoding = {
|
3702
|
+
x: dimensions.slice(0, 1).map((item)=>item.id),
|
3703
|
+
color: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
|
3704
|
+
detail: dimensions.slice(onlyMeasureName ? 0 : 1).map((item)=>item.id),
|
3705
|
+
tooltip: dimensions.map((item)=>item.id),
|
3706
|
+
label: [],
|
3707
|
+
row: [],
|
3708
|
+
column: []
|
3709
|
+
};
|
3710
|
+
return {
|
3711
|
+
...advancedVSeed,
|
3712
|
+
encoding: mergedEncoding
|
3713
|
+
};
|
3714
|
+
};
|
3558
3715
|
const columnAdvancedPipeline = [
|
3559
3716
|
initAdvancedVSeed_initAdvancedVSeed,
|
3560
3717
|
autoMeasures_autoMeasures,
|
@@ -3597,9 +3754,14 @@ const stackCornerRadius_stackCornerRadius = (spec, context)=>{
|
|
3597
3754
|
const { advancedVSeed, vseed } = context;
|
3598
3755
|
const { chartType } = vseed;
|
3599
3756
|
const stackCornerRadius = advancedVSeed.config?.[chartType]?.stackCornerRadius;
|
3757
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
3758
|
+
const { foldInfo } = datasetReshapeInfo[0];
|
3600
3759
|
return {
|
3601
3760
|
...spec,
|
3602
|
-
stackCornerRadius
|
3761
|
+
stackCornerRadius: (_, datum)=>{
|
3762
|
+
if (datum[foldInfo.measureValue] > 0) return stackCornerRadius;
|
3763
|
+
return 0;
|
3764
|
+
}
|
3603
3765
|
};
|
3604
3766
|
};
|
3605
3767
|
const stackInverse = (spec)=>{
|
@@ -3649,6 +3811,19 @@ const verticalCrosshairRect = (spec, context)=>{
|
|
3649
3811
|
};
|
3650
3812
|
return result;
|
3651
3813
|
};
|
3814
|
+
const colorBarStyleFill = (stylePipe)=>(spec, context)=>{
|
3815
|
+
const result = stylePipe(spec, context);
|
3816
|
+
const { advancedVSeed } = context;
|
3817
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
3818
|
+
const { unfoldInfo } = datasetReshapeInfo[0];
|
3819
|
+
if (isLinearColor(advancedVSeed)) {
|
3820
|
+
if (result?.bar?.style) result.bar.style.fill = {
|
3821
|
+
field: unfoldInfo.encodingColor,
|
3822
|
+
scale: 'color'
|
3823
|
+
};
|
3824
|
+
}
|
3825
|
+
return result;
|
3826
|
+
};
|
3652
3827
|
const barStyle_barStyle = (spec, context)=>{
|
3653
3828
|
const { advancedVSeed } = context;
|
3654
3829
|
const { markStyle, dataset = [] } = advancedVSeed;
|
@@ -3844,11 +4019,98 @@ const annotationAreaBand = (spec, context)=>{
|
|
3844
4019
|
markArea: markArea
|
3845
4020
|
};
|
3846
4021
|
};
|
4022
|
+
const pivotColorLegend = (spec, context)=>{
|
4023
|
+
const result = {
|
4024
|
+
...spec
|
4025
|
+
};
|
4026
|
+
const { advancedVSeed } = context;
|
4027
|
+
const { chartType } = advancedVSeed;
|
4028
|
+
const baseConfig = advancedVSeed.config[chartType];
|
4029
|
+
if (!baseConfig || !baseConfig.legend) return result;
|
4030
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
4031
|
+
const max = Math.max(...datasetReshapeInfo.map((d)=>d.foldInfo.colorRange[1]));
|
4032
|
+
const min = Math.min(...datasetReshapeInfo.map((d)=>d.foldInfo.colorRange[0]));
|
4033
|
+
const { legend, color } = baseConfig;
|
4034
|
+
const { colorScheme, linearColorScheme } = color;
|
4035
|
+
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400 } = legend || {};
|
4036
|
+
const orient = [
|
4037
|
+
'bottom',
|
4038
|
+
'bottomLeft',
|
4039
|
+
'bottomRight',
|
4040
|
+
'bl',
|
4041
|
+
'br'
|
4042
|
+
].includes(position) ? 'bottom' : [
|
4043
|
+
'top',
|
4044
|
+
'topLeft',
|
4045
|
+
'topRight',
|
4046
|
+
'tl',
|
4047
|
+
'tr'
|
4048
|
+
].includes(position) ? 'top' : [
|
4049
|
+
'left',
|
4050
|
+
'leftTop',
|
4051
|
+
'leftBottom',
|
4052
|
+
'lt',
|
4053
|
+
'lb'
|
4054
|
+
].includes(position) ? 'left' : 'right';
|
4055
|
+
const legendPosition = [
|
4056
|
+
'topLeft',
|
4057
|
+
'bottomLeft',
|
4058
|
+
'leftTop',
|
4059
|
+
'rightTop',
|
4060
|
+
'lt',
|
4061
|
+
'rt',
|
4062
|
+
'tl',
|
4063
|
+
'bl'
|
4064
|
+
].includes(position) ? 'start' : [
|
4065
|
+
'topRight',
|
4066
|
+
'bottomRight',
|
4067
|
+
'leftBottom',
|
4068
|
+
'rightBottom',
|
4069
|
+
'lb',
|
4070
|
+
'rb',
|
4071
|
+
'rt',
|
4072
|
+
'br'
|
4073
|
+
].includes(position) ? 'end' : 'middle';
|
4074
|
+
const legends = {
|
4075
|
+
visible: enable,
|
4076
|
+
type: 'color',
|
4077
|
+
orient,
|
4078
|
+
position: legendPosition,
|
4079
|
+
colors: linearColorScheme || colorScheme || [],
|
4080
|
+
value: [
|
4081
|
+
min,
|
4082
|
+
max
|
4083
|
+
],
|
4084
|
+
min: min,
|
4085
|
+
max: max,
|
4086
|
+
maxWidth: '30%',
|
4087
|
+
startText: {
|
4088
|
+
visible: true,
|
4089
|
+
style: {
|
4090
|
+
fill: labelFontColor,
|
4091
|
+
fontSize: labelFontSize,
|
4092
|
+
fontWeight: labelFontWeight
|
4093
|
+
}
|
4094
|
+
},
|
4095
|
+
endText: {
|
4096
|
+
visible: true,
|
4097
|
+
style: {
|
4098
|
+
fill: labelFontColor,
|
4099
|
+
fontSize: labelFontSize,
|
4100
|
+
fontWeight: labelFontWeight
|
4101
|
+
}
|
4102
|
+
}
|
4103
|
+
};
|
4104
|
+
return {
|
4105
|
+
...result,
|
4106
|
+
legends
|
4107
|
+
};
|
4108
|
+
};
|
3847
4109
|
const column = [
|
3848
4110
|
initColumn,
|
3849
4111
|
stackCornerRadius_stackCornerRadius,
|
3850
4112
|
stackInverse,
|
3851
|
-
color_color,
|
4113
|
+
colorAdapter(color_color, linearColor),
|
3852
4114
|
background_backgroundColor,
|
3853
4115
|
datasetXY,
|
3854
4116
|
progressive,
|
@@ -3857,8 +4119,8 @@ const column = [
|
|
3857
4119
|
label_label,
|
3858
4120
|
tooltip_tooltip,
|
3859
4121
|
verticalCrosshairRect,
|
3860
|
-
discreteLegend,
|
3861
|
-
barStyle_barStyle,
|
4122
|
+
colorAdapter(discreteLegend, colorLegend),
|
4123
|
+
colorBarStyleFill(barStyle_barStyle),
|
3862
4124
|
annotationPoint_annotationPoint,
|
3863
4125
|
annotationVerticalLine_annotationVerticalLine,
|
3864
4126
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -3873,7 +4135,7 @@ const pivotColumn = [
|
|
3873
4135
|
initColumn,
|
3874
4136
|
stackCornerRadius_stackCornerRadius,
|
3875
4137
|
stackInverse,
|
3876
|
-
color_color,
|
4138
|
+
colorAdapter(color_color, linearColor),
|
3877
4139
|
background_backgroundColor,
|
3878
4140
|
datasetXY,
|
3879
4141
|
progressive,
|
@@ -3882,7 +4144,7 @@ const pivotColumn = [
|
|
3882
4144
|
label_label,
|
3883
4145
|
tooltip_tooltip,
|
3884
4146
|
verticalCrosshairRect,
|
3885
|
-
barStyle_barStyle,
|
4147
|
+
colorBarStyleFill(barStyle_barStyle),
|
3886
4148
|
annotationPoint_annotationPoint,
|
3887
4149
|
annotationVerticalLine_annotationVerticalLine,
|
3888
4150
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -3890,7 +4152,7 @@ const pivotColumn = [
|
|
3890
4152
|
]),
|
3891
4153
|
pivotRowDimensions,
|
3892
4154
|
pivotColumnDimensions,
|
3893
|
-
pivotDiscreteLegend
|
4155
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
3894
4156
|
];
|
3895
4157
|
const columnSpecPipeline = [
|
3896
4158
|
pivotAdapter_pivotAdapter(column, pivotColumn)
|
@@ -3946,7 +4208,7 @@ const initColumnParallel = (spec, context)=>{
|
|
3946
4208
|
const columnParallel = [
|
3947
4209
|
initColumnParallel,
|
3948
4210
|
stackCornerRadius_stackCornerRadius,
|
3949
|
-
color_color,
|
4211
|
+
colorAdapter(color_color, linearColor),
|
3950
4212
|
background_backgroundColor,
|
3951
4213
|
datasetXY,
|
3952
4214
|
progressive,
|
@@ -3954,9 +4216,9 @@ const columnParallel = [
|
|
3954
4216
|
yLinear,
|
3955
4217
|
label_label,
|
3956
4218
|
tooltip_tooltip,
|
3957
|
-
discreteLegend,
|
4219
|
+
colorAdapter(discreteLegend, colorLegend),
|
3958
4220
|
verticalCrosshairRect,
|
3959
|
-
barStyle_barStyle,
|
4221
|
+
colorBarStyleFill(barStyle_barStyle),
|
3960
4222
|
annotationPoint_annotationPoint,
|
3961
4223
|
annotationVerticalLine_annotationVerticalLine,
|
3962
4224
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -3970,7 +4232,7 @@ const pivotColumnParallel = [
|
|
3970
4232
|
pivotIndicators_pivotIndicators([
|
3971
4233
|
initColumnParallel,
|
3972
4234
|
stackCornerRadius_stackCornerRadius,
|
3973
|
-
color_color,
|
4235
|
+
colorAdapter(color_color, linearColor),
|
3974
4236
|
background_backgroundColor,
|
3975
4237
|
datasetXY,
|
3976
4238
|
progressive,
|
@@ -3979,7 +4241,7 @@ const pivotColumnParallel = [
|
|
3979
4241
|
label_label,
|
3980
4242
|
tooltip_tooltip,
|
3981
4243
|
verticalCrosshairRect,
|
3982
|
-
barStyle_barStyle,
|
4244
|
+
colorBarStyleFill(barStyle_barStyle),
|
3983
4245
|
annotationPoint_annotationPoint,
|
3984
4246
|
annotationVerticalLine_annotationVerticalLine,
|
3985
4247
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -3987,7 +4249,7 @@ const pivotColumnParallel = [
|
|
3987
4249
|
]),
|
3988
4250
|
pivotRowDimensions,
|
3989
4251
|
pivotColumnDimensions,
|
3990
|
-
pivotDiscreteLegend
|
4252
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
3991
4253
|
];
|
3992
4254
|
const columnParallelSpecPipeline = [
|
3993
4255
|
pivotAdapter_pivotAdapter(columnParallel, pivotColumnParallel)
|
@@ -4024,7 +4286,7 @@ const columnPercent = [
|
|
4024
4286
|
initColumn,
|
4025
4287
|
stackCornerRadius_stackCornerRadius,
|
4026
4288
|
stackInverse,
|
4027
|
-
color_color,
|
4289
|
+
colorAdapter(color_color, linearColor),
|
4028
4290
|
background_backgroundColor,
|
4029
4291
|
percent,
|
4030
4292
|
datasetXY,
|
@@ -4033,9 +4295,9 @@ const columnPercent = [
|
|
4033
4295
|
yLinear,
|
4034
4296
|
label_label,
|
4035
4297
|
tooltip_tooltip,
|
4298
|
+
colorAdapter(discreteLegend, colorLegend),
|
4036
4299
|
verticalCrosshairRect,
|
4037
|
-
|
4038
|
-
barStyle_barStyle,
|
4300
|
+
colorBarStyleFill(barStyle_barStyle),
|
4039
4301
|
annotationPoint_annotationPoint,
|
4040
4302
|
annotationVerticalLine_annotationVerticalLine,
|
4041
4303
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -4050,7 +4312,7 @@ const pivotColumnPercent = [
|
|
4050
4312
|
initColumn,
|
4051
4313
|
stackCornerRadius_stackCornerRadius,
|
4052
4314
|
stackInverse,
|
4053
|
-
color_color,
|
4315
|
+
colorAdapter(color_color, linearColor),
|
4054
4316
|
percent,
|
4055
4317
|
background_backgroundColor,
|
4056
4318
|
datasetXY,
|
@@ -4060,7 +4322,7 @@ const pivotColumnPercent = [
|
|
4060
4322
|
label_label,
|
4061
4323
|
tooltip_tooltip,
|
4062
4324
|
verticalCrosshairRect,
|
4063
|
-
barStyle_barStyle,
|
4325
|
+
colorBarStyleFill(barStyle_barStyle),
|
4064
4326
|
annotationPoint_annotationPoint,
|
4065
4327
|
annotationVerticalLine_annotationVerticalLine,
|
4066
4328
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -4068,7 +4330,7 @@ const pivotColumnPercent = [
|
|
4068
4330
|
]),
|
4069
4331
|
pivotRowDimensions,
|
4070
4332
|
pivotColumnDimensions,
|
4071
|
-
pivotDiscreteLegend
|
4333
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
4072
4334
|
];
|
4073
4335
|
const columnPercentSpecPipeline = [
|
4074
4336
|
pivotAdapter_pivotAdapter(columnPercent, pivotColumnPercent)
|
@@ -4090,10 +4352,10 @@ const encodingForBar = (advancedVSeed, context)=>{
|
|
4090
4352
|
(dimensions[1] || dimensions[0]).id
|
4091
4353
|
];
|
4092
4354
|
const detail = encoding.detail || [];
|
4093
|
-
const mergedDetail = (0, external_remeda_namespaceObject.unique)([
|
4355
|
+
const mergedDetail = 0 === detail.length ? (0, external_remeda_namespaceObject.unique)([
|
4094
4356
|
...color,
|
4095
4357
|
...detail
|
4096
|
-
]);
|
4358
|
+
]) : detail;
|
4097
4359
|
return {
|
4098
4360
|
...advancedVSeed,
|
4099
4361
|
encoding: {
|
@@ -4437,7 +4699,7 @@ const horizontalCrosshairRect = (spec, context)=>{
|
|
4437
4699
|
const bar = [
|
4438
4700
|
initBar,
|
4439
4701
|
stackCornerRadius_stackCornerRadius,
|
4440
|
-
color_color,
|
4702
|
+
colorAdapter(color_color, linearColor),
|
4441
4703
|
background_backgroundColor,
|
4442
4704
|
datasetYX,
|
4443
4705
|
progressive,
|
@@ -4445,9 +4707,9 @@ const bar = [
|
|
4445
4707
|
yBand,
|
4446
4708
|
label_label,
|
4447
4709
|
tooltip_tooltip,
|
4710
|
+
colorAdapter(discreteLegend, colorLegend),
|
4448
4711
|
horizontalCrosshairRect,
|
4449
|
-
|
4450
|
-
barStyle_barStyle,
|
4712
|
+
colorBarStyleFill(barStyle_barStyle),
|
4451
4713
|
annotationPoint_annotationPoint,
|
4452
4714
|
annotationVerticalLine_annotationVerticalLine,
|
4453
4715
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -4461,7 +4723,7 @@ const pivotBar = [
|
|
4461
4723
|
pivotIndicators_pivotIndicators([
|
4462
4724
|
initBar,
|
4463
4725
|
stackCornerRadius_stackCornerRadius,
|
4464
|
-
color_color,
|
4726
|
+
colorAdapter(color_color, linearColor),
|
4465
4727
|
background_backgroundColor,
|
4466
4728
|
datasetYX,
|
4467
4729
|
progressive,
|
@@ -4470,8 +4732,8 @@ const pivotBar = [
|
|
4470
4732
|
label_label,
|
4471
4733
|
label_label,
|
4472
4734
|
tooltip_tooltip,
|
4735
|
+
colorBarStyleFill(barStyle_barStyle),
|
4473
4736
|
horizontalCrosshairRect,
|
4474
|
-
barStyle_barStyle,
|
4475
4737
|
annotationPoint_annotationPoint,
|
4476
4738
|
annotationVerticalLine_annotationVerticalLine,
|
4477
4739
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -4479,7 +4741,7 @@ const pivotBar = [
|
|
4479
4741
|
]),
|
4480
4742
|
pivotRowDimensions,
|
4481
4743
|
pivotColumnDimensions,
|
4482
|
-
pivotDiscreteLegend
|
4744
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
4483
4745
|
];
|
4484
4746
|
const barSpecPipeline = [
|
4485
4747
|
pivotAdapter_pivotAdapter(bar, pivotBar)
|
@@ -4535,7 +4797,7 @@ const initBarParallel = (spec, context)=>{
|
|
4535
4797
|
const barParallel = [
|
4536
4798
|
initBarParallel,
|
4537
4799
|
stackCornerRadius_stackCornerRadius,
|
4538
|
-
color_color,
|
4800
|
+
colorAdapter(color_color, linearColor),
|
4539
4801
|
background_backgroundColor,
|
4540
4802
|
datasetYX,
|
4541
4803
|
progressive,
|
@@ -4543,9 +4805,9 @@ const barParallel = [
|
|
4543
4805
|
yBand,
|
4544
4806
|
label_label,
|
4545
4807
|
tooltip_tooltip,
|
4808
|
+
colorAdapter(discreteLegend, colorLegend),
|
4546
4809
|
horizontalCrosshairRect,
|
4547
|
-
|
4548
|
-
barStyle_barStyle,
|
4810
|
+
colorBarStyleFill(barStyle_barStyle),
|
4549
4811
|
annotationPoint_annotationPoint,
|
4550
4812
|
annotationVerticalLine_annotationVerticalLine,
|
4551
4813
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -4559,15 +4821,15 @@ const pivotBarParallel = [
|
|
4559
4821
|
pivotIndicators_pivotIndicators([
|
4560
4822
|
initBarParallel,
|
4561
4823
|
stackCornerRadius_stackCornerRadius,
|
4562
|
-
color_color,
|
4824
|
+
colorAdapter(color_color, linearColor),
|
4563
4825
|
background_backgroundColor,
|
4564
4826
|
datasetYX,
|
4565
4827
|
xLinear,
|
4566
4828
|
yBand,
|
4567
4829
|
label_label,
|
4568
4830
|
tooltip_tooltip,
|
4831
|
+
colorBarStyleFill(barStyle_barStyle),
|
4569
4832
|
horizontalCrosshairRect,
|
4570
|
-
barStyle_barStyle,
|
4571
4833
|
annotationPoint_annotationPoint,
|
4572
4834
|
annotationVerticalLine_annotationVerticalLine,
|
4573
4835
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -4575,7 +4837,7 @@ const pivotBarParallel = [
|
|
4575
4837
|
]),
|
4576
4838
|
pivotRowDimensions,
|
4577
4839
|
pivotColumnDimensions,
|
4578
|
-
pivotDiscreteLegend
|
4840
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
4579
4841
|
];
|
4580
4842
|
const barParallelSpecPipeline = [
|
4581
4843
|
pivotAdapter_pivotAdapter(barParallel, pivotBarParallel)
|
@@ -4604,7 +4866,7 @@ const barPercentAdvancedPipeline = [
|
|
4604
4866
|
const barPercent = [
|
4605
4867
|
initBar,
|
4606
4868
|
stackCornerRadius_stackCornerRadius,
|
4607
|
-
color_color,
|
4869
|
+
colorAdapter(color_color, linearColor),
|
4608
4870
|
background_backgroundColor,
|
4609
4871
|
percent,
|
4610
4872
|
datasetYX,
|
@@ -4613,9 +4875,9 @@ const barPercent = [
|
|
4613
4875
|
yBand,
|
4614
4876
|
label_label,
|
4615
4877
|
tooltip_tooltip,
|
4878
|
+
colorAdapter(discreteLegend, colorLegend),
|
4616
4879
|
horizontalCrosshairRect,
|
4617
|
-
|
4618
|
-
barStyle_barStyle,
|
4880
|
+
colorBarStyleFill(barStyle_barStyle),
|
4619
4881
|
annotationPoint_annotationPoint,
|
4620
4882
|
annotationVerticalLine_annotationVerticalLine,
|
4621
4883
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -4629,7 +4891,7 @@ const pivotBarPercent = [
|
|
4629
4891
|
pivotIndicators_pivotIndicators([
|
4630
4892
|
initBar,
|
4631
4893
|
stackCornerRadius_stackCornerRadius,
|
4632
|
-
color_color,
|
4894
|
+
colorAdapter(color_color, linearColor),
|
4633
4895
|
background_backgroundColor,
|
4634
4896
|
percent,
|
4635
4897
|
datasetYX,
|
@@ -4637,8 +4899,8 @@ const pivotBarPercent = [
|
|
4637
4899
|
xLinear,
|
4638
4900
|
label_label,
|
4639
4901
|
tooltip_tooltip,
|
4902
|
+
colorBarStyleFill(barStyle_barStyle),
|
4640
4903
|
horizontalCrosshairRect,
|
4641
|
-
barStyle_barStyle,
|
4642
4904
|
annotationPoint_annotationPoint,
|
4643
4905
|
annotationVerticalLine_annotationVerticalLine,
|
4644
4906
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -4646,7 +4908,7 @@ const pivotBarPercent = [
|
|
4646
4908
|
]),
|
4647
4909
|
pivotRowDimensions,
|
4648
4910
|
pivotColumnDimensions,
|
4649
|
-
pivotDiscreteLegend
|
4911
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
4650
4912
|
];
|
4651
4913
|
const barPercentSpecPipeline = [
|
4652
4914
|
pivotAdapter_pivotAdapter(barPercent, pivotBarPercent)
|
@@ -4683,7 +4945,7 @@ const initArea = (spec, context)=>{
|
|
4683
4945
|
result.direction = 'vertical';
|
4684
4946
|
result.yField = foldInfo.measureValue;
|
4685
4947
|
result.xField = unfoldInfo.encodingX;
|
4686
|
-
result.seriesField = unfoldInfo.encodingColorId;
|
4948
|
+
result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
|
4687
4949
|
result.padding = 0;
|
4688
4950
|
result.region = [
|
4689
4951
|
{
|
@@ -4693,20 +4955,32 @@ const initArea = (spec, context)=>{
|
|
4693
4955
|
result.animation = true;
|
4694
4956
|
return result;
|
4695
4957
|
};
|
4958
|
+
const colorAreaStyleFill = (stylePipe)=>(spec, context)=>{
|
4959
|
+
const result = stylePipe(spec, context);
|
4960
|
+
const { advancedVSeed } = context;
|
4961
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
4962
|
+
const { unfoldInfo } = datasetReshapeInfo[0];
|
4963
|
+
if (isLinearColor(advancedVSeed)) {
|
4964
|
+
if (result?.area?.style) result.area.style.fill = {
|
4965
|
+
field: unfoldInfo.encodingColor,
|
4966
|
+
scale: 'color'
|
4967
|
+
};
|
4968
|
+
}
|
4969
|
+
return result;
|
4970
|
+
};
|
4696
4971
|
const areaStyle_areaStyle = (spec, context)=>{
|
4697
4972
|
const { advancedVSeed } = context;
|
4698
4973
|
const { markStyle, datasetReshapeInfo, dataset } = advancedVSeed;
|
4699
4974
|
const { areaStyle } = markStyle;
|
4700
4975
|
const { unfoldInfo } = datasetReshapeInfo[0];
|
4701
|
-
|
4976
|
+
const result = {
|
4702
4977
|
...spec,
|
4703
4978
|
area: {
|
4704
|
-
visible: true
|
4979
|
+
visible: true,
|
4980
|
+
style: {}
|
4705
4981
|
}
|
4706
4982
|
};
|
4707
|
-
|
4708
|
-
...spec
|
4709
|
-
};
|
4983
|
+
if (!areaStyle) return result;
|
4710
4984
|
const areaStyles = Array.isArray(areaStyle) ? areaStyle : [
|
4711
4985
|
areaStyle
|
4712
4986
|
];
|
@@ -4734,6 +5008,7 @@ const areaStyle_areaStyle = (spec, context)=>{
|
|
4734
5008
|
return {
|
4735
5009
|
...result,
|
4736
5010
|
area: {
|
5011
|
+
...result.area,
|
4737
5012
|
visible: true,
|
4738
5013
|
state: {
|
4739
5014
|
...customMap
|
@@ -4744,7 +5019,7 @@ const areaStyle_areaStyle = (spec, context)=>{
|
|
4744
5019
|
const area_area = [
|
4745
5020
|
initArea,
|
4746
5021
|
stackInverse,
|
4747
|
-
color_color,
|
5022
|
+
colorAdapter(color_color, linearColor),
|
4748
5023
|
background_backgroundColor,
|
4749
5024
|
datasetXY,
|
4750
5025
|
progressive,
|
@@ -4752,12 +5027,12 @@ const area_area = [
|
|
4752
5027
|
yLinear,
|
4753
5028
|
label_label,
|
4754
5029
|
tooltip_tooltip,
|
5030
|
+
colorAdapter(discreteLegend, colorLegend),
|
4755
5031
|
verticalCrosshairLine,
|
4756
|
-
|
4757
|
-
pointStyle_pointStyle,
|
5032
|
+
colorPointStyleFill(pointStyle_pointStyle),
|
4758
5033
|
pointStateDimensionHover,
|
4759
|
-
lineStyle_lineStyle,
|
4760
|
-
areaStyle_areaStyle,
|
5034
|
+
colorLineStyleFill(lineStyle_lineStyle),
|
5035
|
+
colorAreaStyleFill(areaStyle_areaStyle),
|
4761
5036
|
annotationPoint_annotationPoint,
|
4762
5037
|
annotationVerticalLine_annotationVerticalLine,
|
4763
5038
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -4770,7 +5045,7 @@ const pivotArea = [
|
|
4770
5045
|
datasetPivot,
|
4771
5046
|
pivotIndicators_pivotIndicators([
|
4772
5047
|
initArea,
|
4773
|
-
color_color,
|
5048
|
+
colorAdapter(color_color, linearColor),
|
4774
5049
|
background_backgroundColor,
|
4775
5050
|
stackInverse,
|
4776
5051
|
datasetXY,
|
@@ -4780,10 +5055,10 @@ const pivotArea = [
|
|
4780
5055
|
label_label,
|
4781
5056
|
tooltip_tooltip,
|
4782
5057
|
verticalCrosshairLine,
|
4783
|
-
pointStyle_pointStyle,
|
5058
|
+
colorPointStyleFill(pointStyle_pointStyle),
|
4784
5059
|
pointStateDimensionHover,
|
4785
|
-
lineStyle_lineStyle,
|
4786
|
-
areaStyle_areaStyle,
|
5060
|
+
colorLineStyleFill(lineStyle_lineStyle),
|
5061
|
+
colorAreaStyleFill(areaStyle_areaStyle),
|
4787
5062
|
annotationPoint_annotationPoint,
|
4788
5063
|
annotationVerticalLine_annotationVerticalLine,
|
4789
5064
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -4791,7 +5066,7 @@ const pivotArea = [
|
|
4791
5066
|
]),
|
4792
5067
|
pivotRowDimensions,
|
4793
5068
|
pivotColumnDimensions,
|
4794
|
-
pivotDiscreteLegend
|
5069
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
4795
5070
|
];
|
4796
5071
|
const areaSpecPipeline = [
|
4797
5072
|
pivotAdapter_pivotAdapter(area_area, pivotArea)
|
@@ -4820,7 +5095,7 @@ const areaPercentAdvancedPipeline = [
|
|
4820
5095
|
const areaPercent = [
|
4821
5096
|
initArea,
|
4822
5097
|
stackInverse,
|
4823
|
-
color_color,
|
5098
|
+
colorAdapter(color_color, linearColor),
|
4824
5099
|
background_backgroundColor,
|
4825
5100
|
percent,
|
4826
5101
|
datasetXY,
|
@@ -4829,11 +5104,12 @@ const areaPercent = [
|
|
4829
5104
|
yLinear,
|
4830
5105
|
label_label,
|
4831
5106
|
tooltip_tooltip,
|
5107
|
+
colorAdapter(discreteLegend, colorLegend),
|
4832
5108
|
verticalCrosshairLine,
|
4833
|
-
|
4834
|
-
|
4835
|
-
lineStyle_lineStyle,
|
4836
|
-
areaStyle_areaStyle,
|
5109
|
+
colorPointStyleFill(pointStyle_pointStyle),
|
5110
|
+
pointStateDimensionHover,
|
5111
|
+
colorLineStyleFill(lineStyle_lineStyle),
|
5112
|
+
colorAreaStyleFill(areaStyle_areaStyle),
|
4837
5113
|
annotationPoint_annotationPoint,
|
4838
5114
|
annotationVerticalLine_annotationVerticalLine,
|
4839
5115
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -4847,7 +5123,7 @@ const pivotAreaPercent = [
|
|
4847
5123
|
pivotIndicators_pivotIndicators([
|
4848
5124
|
initArea,
|
4849
5125
|
stackInverse,
|
4850
|
-
color_color,
|
5126
|
+
colorAdapter(color_color, linearColor),
|
4851
5127
|
background_backgroundColor,
|
4852
5128
|
percent,
|
4853
5129
|
datasetXY,
|
@@ -4857,9 +5133,10 @@ const pivotAreaPercent = [
|
|
4857
5133
|
label_label,
|
4858
5134
|
tooltip_tooltip,
|
4859
5135
|
verticalCrosshairLine,
|
4860
|
-
pointStyle_pointStyle,
|
4861
|
-
|
4862
|
-
|
5136
|
+
colorPointStyleFill(pointStyle_pointStyle),
|
5137
|
+
pointStateDimensionHover,
|
5138
|
+
colorLineStyleFill(lineStyle_lineStyle),
|
5139
|
+
colorAreaStyleFill(areaStyle_areaStyle),
|
4863
5140
|
annotationPoint_annotationPoint,
|
4864
5141
|
annotationVerticalLine_annotationVerticalLine,
|
4865
5142
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -4867,7 +5144,7 @@ const pivotAreaPercent = [
|
|
4867
5144
|
]),
|
4868
5145
|
pivotRowDimensions,
|
4869
5146
|
pivotColumnDimensions,
|
4870
|
-
pivotDiscreteLegend
|
5147
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
4871
5148
|
];
|
4872
5149
|
const areaPercentSpecPipeline = [
|
4873
5150
|
pivotAdapter_pivotAdapter(areaPercent, pivotAreaPercent)
|
@@ -4975,10 +5252,10 @@ const encodingForScatter = (advancedVSeed, context)=>{
|
|
4975
5252
|
const color = encoding.color || [
|
4976
5253
|
(dimensions[1] || dimensions[0]).id
|
4977
5254
|
];
|
4978
|
-
const mergedDetail = (0, external_remeda_namespaceObject.unique)([
|
5255
|
+
const mergedDetail = 0 === detail.length ? (0, external_remeda_namespaceObject.unique)([
|
4979
5256
|
...color,
|
4980
5257
|
...detail
|
4981
|
-
]);
|
5258
|
+
]) : detail;
|
4982
5259
|
return {
|
4983
5260
|
...advancedVSeed,
|
4984
5261
|
encoding: {
|
@@ -5222,7 +5499,7 @@ const horizontalCrosshairLine = (spec, context)=>{
|
|
5222
5499
|
};
|
5223
5500
|
const scatter = [
|
5224
5501
|
initScatter,
|
5225
|
-
color_color,
|
5502
|
+
colorAdapter(color_color, linearColor),
|
5226
5503
|
background_backgroundColor,
|
5227
5504
|
datasetScatter,
|
5228
5505
|
progressive,
|
@@ -5230,10 +5507,10 @@ const scatter = [
|
|
5230
5507
|
yLinear,
|
5231
5508
|
label_label,
|
5232
5509
|
tooltip_tooltip,
|
5510
|
+
colorAdapter(discreteLegend, colorLegend),
|
5233
5511
|
verticalCrosshairLine,
|
5234
5512
|
horizontalCrosshairLine,
|
5235
|
-
|
5236
|
-
pointStyle_pointStyle,
|
5513
|
+
colorPointStyleFill(pointStyle_pointStyle),
|
5237
5514
|
pointStateHover,
|
5238
5515
|
annotationPoint_annotationPoint,
|
5239
5516
|
annotationVerticalLine_annotationVerticalLine,
|
@@ -5247,7 +5524,7 @@ const pivotScatter = [
|
|
5247
5524
|
datasetPivot,
|
5248
5525
|
pivotIndicators_pivotIndicators([
|
5249
5526
|
initScatter,
|
5250
|
-
color_color,
|
5527
|
+
colorAdapter(color_color, linearColor),
|
5251
5528
|
background_backgroundColor,
|
5252
5529
|
datasetScatter,
|
5253
5530
|
progressive,
|
@@ -5257,7 +5534,7 @@ const pivotScatter = [
|
|
5257
5534
|
tooltip_tooltip,
|
5258
5535
|
verticalCrosshairLine,
|
5259
5536
|
horizontalCrosshairLine,
|
5260
|
-
pointStyle_pointStyle,
|
5537
|
+
colorPointStyleFill(pointStyle_pointStyle),
|
5261
5538
|
pointStateHover,
|
5262
5539
|
annotationPoint_annotationPoint,
|
5263
5540
|
annotationVerticalLine_annotationVerticalLine,
|
@@ -5377,10 +5654,10 @@ const encodingForDualAxis = (advancedVSeed, context)=>{
|
|
5377
5654
|
(dimensions[1] || dimensions[0]).id
|
5378
5655
|
];
|
5379
5656
|
const detail = encoding.detail || [];
|
5380
|
-
const mergedDetail = (0, external_remeda_namespaceObject.unique)([
|
5657
|
+
const mergedDetail = 0 === detail.length ? (0, external_remeda_namespaceObject.unique)([
|
5381
5658
|
...color,
|
5382
5659
|
...detail
|
5383
|
-
]);
|
5660
|
+
]) : detail;
|
5384
5661
|
return {
|
5385
5662
|
...advancedVSeed,
|
5386
5663
|
encoding: {
|
@@ -6572,10 +6849,10 @@ const encodingForRose = (advancedVSeed, context)=>{
|
|
6572
6849
|
(dimensions[1] || dimensions[0]).id
|
6573
6850
|
];
|
6574
6851
|
const detail = encoding.detail || [];
|
6575
|
-
const mergedDetail = (0, external_remeda_namespaceObject.unique)([
|
6852
|
+
const mergedDetail = 0 === detail.length ? (0, external_remeda_namespaceObject.unique)([
|
6576
6853
|
...color,
|
6577
6854
|
...detail
|
6578
|
-
]);
|
6855
|
+
]) : detail;
|
6579
6856
|
return {
|
6580
6857
|
...advancedVSeed,
|
6581
6858
|
encoding: {
|
@@ -6891,10 +7168,10 @@ const encodingForRadar = (advancedVSeed, context)=>{
|
|
6891
7168
|
(dimensions[1] || dimensions[0]).id
|
6892
7169
|
];
|
6893
7170
|
const detail = encoding.detail || [];
|
6894
|
-
const mergedDetail = (0, external_remeda_namespaceObject.unique)([
|
7171
|
+
const mergedDetail = 0 === detail.length ? (0, external_remeda_namespaceObject.unique)([
|
6895
7172
|
...color,
|
6896
7173
|
...detail
|
6897
|
-
]);
|
7174
|
+
]) : detail;
|
6898
7175
|
return {
|
6899
7176
|
...advancedVSeed,
|
6900
7177
|
encoding: {
|
@@ -6945,7 +7222,7 @@ const initRadar = (spec, context)=>{
|
|
6945
7222
|
result.type = 'radar';
|
6946
7223
|
result.angleField = unfoldInfo.encodingAngle;
|
6947
7224
|
result.radiusField = foldInfo.measureValue;
|
6948
|
-
result.seriesField = unfoldInfo.encodingColorId;
|
7225
|
+
result.seriesField = isLinearColor(advancedVSeed) ? unfoldInfo.encodingDetail : unfoldInfo.encodingColorId;
|
6949
7226
|
result.padding = 0;
|
6950
7227
|
result.region = [
|
6951
7228
|
{
|
@@ -7010,7 +7287,7 @@ const radarRadiusAxis = (spec, context)=>{
|
|
7010
7287
|
};
|
7011
7288
|
const radar = [
|
7012
7289
|
initRadar,
|
7013
|
-
color_color,
|
7290
|
+
colorAdapter(color_color, linearColor),
|
7014
7291
|
background_backgroundColor,
|
7015
7292
|
datasetXY,
|
7016
7293
|
progressive,
|
@@ -7018,12 +7295,12 @@ const radar = [
|
|
7018
7295
|
radarRadiusAxis,
|
7019
7296
|
label_label,
|
7020
7297
|
tooltip_tooltip,
|
7298
|
+
colorAdapter(discreteLegend, colorLegend),
|
7021
7299
|
verticalCrosshairLine,
|
7022
|
-
|
7023
|
-
pointStyle_pointStyle,
|
7300
|
+
colorPointStyleFill(pointStyle_pointStyle),
|
7024
7301
|
pointStateDimensionHover,
|
7025
|
-
lineStyle_lineStyle,
|
7026
|
-
areaStyle_areaStyle
|
7302
|
+
colorLineStyleFill(lineStyle_lineStyle),
|
7303
|
+
colorAreaStyleFill(areaStyle_areaStyle)
|
7027
7304
|
];
|
7028
7305
|
const pivotRadar = [
|
7029
7306
|
initPivot,
|
@@ -7032,7 +7309,7 @@ const pivotRadar = [
|
|
7032
7309
|
datasetPivot,
|
7033
7310
|
pivotIndicators_pivotIndicators([
|
7034
7311
|
initRadar,
|
7035
|
-
color_color,
|
7312
|
+
colorAdapter(color_color, linearColor),
|
7036
7313
|
background_backgroundColor,
|
7037
7314
|
datasetXY,
|
7038
7315
|
progressive,
|
@@ -7041,14 +7318,14 @@ const pivotRadar = [
|
|
7041
7318
|
label_label,
|
7042
7319
|
tooltip_tooltip,
|
7043
7320
|
verticalCrosshairLine,
|
7044
|
-
pointStyle_pointStyle,
|
7321
|
+
colorPointStyleFill(pointStyle_pointStyle),
|
7045
7322
|
pointStateDimensionHover,
|
7046
|
-
lineStyle_lineStyle,
|
7047
|
-
areaStyle_areaStyle
|
7323
|
+
colorLineStyleFill(lineStyle_lineStyle),
|
7324
|
+
colorAreaStyleFill(areaStyle_areaStyle)
|
7048
7325
|
]),
|
7049
7326
|
pivotRowDimensions,
|
7050
7327
|
pivotColumnDimensions,
|
7051
|
-
pivotDiscreteLegend
|
7328
|
+
colorAdapter(pivotDiscreteLegend, pivotColorLegend)
|
7052
7329
|
];
|
7053
7330
|
const radarSpecPipeline = [
|
7054
7331
|
pivotAdapter_pivotAdapter(radar, pivotRadar)
|
@@ -7436,6 +7713,10 @@ const lightTheme = ()=>{
|
|
7436
7713
|
const baseConfig = {
|
7437
7714
|
backgroundColor: 'transparent',
|
7438
7715
|
color: {
|
7716
|
+
linearColorScheme: [
|
7717
|
+
'#C2CEFF',
|
7718
|
+
'#5766EC'
|
7719
|
+
],
|
7439
7720
|
colorScheme: [
|
7440
7721
|
'#8D72F6',
|
7441
7722
|
'#5766EC',
|
@@ -7500,8 +7781,8 @@ const lightTheme = ()=>{
|
|
7500
7781
|
stackCornerRadius: [
|
7501
7782
|
4,
|
7502
7783
|
4,
|
7503
|
-
|
7504
|
-
|
7784
|
+
0,
|
7785
|
+
0
|
7505
7786
|
]
|
7506
7787
|
},
|
7507
7788
|
columnParallel: {
|
@@ -7512,8 +7793,8 @@ const lightTheme = ()=>{
|
|
7512
7793
|
stackCornerRadius: [
|
7513
7794
|
4,
|
7514
7795
|
4,
|
7515
|
-
|
7516
|
-
|
7796
|
+
0,
|
7797
|
+
0
|
7517
7798
|
]
|
7518
7799
|
},
|
7519
7800
|
columnPercent: {
|
@@ -7524,8 +7805,8 @@ const lightTheme = ()=>{
|
|
7524
7805
|
stackCornerRadius: [
|
7525
7806
|
4,
|
7526
7807
|
4,
|
7527
|
-
|
7528
|
-
|
7808
|
+
0,
|
7809
|
+
0
|
7529
7810
|
]
|
7530
7811
|
},
|
7531
7812
|
bar: {
|
@@ -7534,10 +7815,10 @@ const lightTheme = ()=>{
|
|
7534
7815
|
yAxis: barBandAxis,
|
7535
7816
|
crosshairRect,
|
7536
7817
|
stackCornerRadius: [
|
7818
|
+
0,
|
7537
7819
|
4,
|
7538
7820
|
4,
|
7539
|
-
|
7540
|
-
4
|
7821
|
+
0
|
7541
7822
|
]
|
7542
7823
|
},
|
7543
7824
|
barParallel: {
|
@@ -7546,10 +7827,10 @@ const lightTheme = ()=>{
|
|
7546
7827
|
yAxis: barBandAxis,
|
7547
7828
|
crosshairRect,
|
7548
7829
|
stackCornerRadius: [
|
7830
|
+
0,
|
7549
7831
|
4,
|
7550
7832
|
4,
|
7551
|
-
|
7552
|
-
4
|
7833
|
+
0
|
7553
7834
|
]
|
7554
7835
|
},
|
7555
7836
|
barPercent: {
|
@@ -7558,10 +7839,10 @@ const lightTheme = ()=>{
|
|
7558
7839
|
yAxis: barBandAxis,
|
7559
7840
|
crosshairRect,
|
7560
7841
|
stackCornerRadius: [
|
7842
|
+
0,
|
7561
7843
|
4,
|
7562
7844
|
4,
|
7563
|
-
|
7564
|
-
4
|
7845
|
+
0
|
7565
7846
|
]
|
7566
7847
|
},
|
7567
7848
|
area: {
|
@@ -7626,38 +7907,10 @@ const lightTheme = ()=>{
|
|
7626
7907
|
...baseConfig
|
7627
7908
|
},
|
7628
7909
|
funnel: {
|
7629
|
-
...baseConfig
|
7630
|
-
color: {
|
7631
|
-
colorScheme: [
|
7632
|
-
'#5766EC',
|
7633
|
-
'#6372F0',
|
7634
|
-
'#7080F4',
|
7635
|
-
'#7C8CFA',
|
7636
|
-
'#8998FF',
|
7637
|
-
'#95A3FF',
|
7638
|
-
'#A0AEFF',
|
7639
|
-
'#ACB9FF',
|
7640
|
-
'#B7C4FF',
|
7641
|
-
'#C2CEFF'
|
7642
|
-
].reverse()
|
7643
|
-
}
|
7910
|
+
...baseConfig
|
7644
7911
|
},
|
7645
7912
|
heatmap: {
|
7646
|
-
...baseConfig
|
7647
|
-
color: {
|
7648
|
-
colorScheme: [
|
7649
|
-
'#5766EC',
|
7650
|
-
'#6372F0',
|
7651
|
-
'#7080F4',
|
7652
|
-
'#7C8CFA',
|
7653
|
-
'#8998FF',
|
7654
|
-
'#95A3FF',
|
7655
|
-
'#A0AEFF',
|
7656
|
-
'#ACB9FF',
|
7657
|
-
'#B7C4FF',
|
7658
|
-
'#C2CEFF'
|
7659
|
-
].reverse()
|
7660
|
-
}
|
7913
|
+
...baseConfig
|
7661
7914
|
}
|
7662
7915
|
}
|
7663
7916
|
};
|
@@ -7769,6 +8022,10 @@ const darkTheme = ()=>{
|
|
7769
8022
|
const baseConfig = {
|
7770
8023
|
backgroundColor: 'transparent',
|
7771
8024
|
color: {
|
8025
|
+
linearColorScheme: [
|
8026
|
+
'#A0CEFF',
|
8027
|
+
'#2E62F1'
|
8028
|
+
],
|
7772
8029
|
colorScheme: [
|
7773
8030
|
'#2E62F1',
|
7774
8031
|
'#4DC36A',
|
@@ -7832,8 +8089,8 @@ const darkTheme = ()=>{
|
|
7832
8089
|
stackCornerRadius: [
|
7833
8090
|
4,
|
7834
8091
|
4,
|
7835
|
-
|
7836
|
-
|
8092
|
+
0,
|
8093
|
+
0
|
7837
8094
|
]
|
7838
8095
|
},
|
7839
8096
|
columnParallel: {
|
@@ -7844,8 +8101,8 @@ const darkTheme = ()=>{
|
|
7844
8101
|
stackCornerRadius: [
|
7845
8102
|
4,
|
7846
8103
|
4,
|
7847
|
-
|
7848
|
-
|
8104
|
+
0,
|
8105
|
+
0
|
7849
8106
|
]
|
7850
8107
|
},
|
7851
8108
|
columnPercent: {
|
@@ -7856,8 +8113,8 @@ const darkTheme = ()=>{
|
|
7856
8113
|
stackCornerRadius: [
|
7857
8114
|
4,
|
7858
8115
|
4,
|
7859
|
-
|
7860
|
-
|
8116
|
+
0,
|
8117
|
+
0
|
7861
8118
|
]
|
7862
8119
|
},
|
7863
8120
|
bar: {
|
@@ -7878,10 +8135,10 @@ const darkTheme = ()=>{
|
|
7878
8135
|
yAxis: barBandAxis,
|
7879
8136
|
crosshairRect: crosshairRect,
|
7880
8137
|
stackCornerRadius: [
|
8138
|
+
0,
|
7881
8139
|
4,
|
7882
8140
|
4,
|
7883
|
-
|
7884
|
-
4
|
8141
|
+
0
|
7885
8142
|
]
|
7886
8143
|
},
|
7887
8144
|
barPercent: {
|
@@ -7890,10 +8147,10 @@ const darkTheme = ()=>{
|
|
7890
8147
|
yAxis: barBandAxis,
|
7891
8148
|
crosshairRect: crosshairRect,
|
7892
8149
|
stackCornerRadius: [
|
8150
|
+
0,
|
7893
8151
|
4,
|
7894
8152
|
4,
|
7895
|
-
|
7896
|
-
4
|
8153
|
+
0
|
7897
8154
|
]
|
7898
8155
|
},
|
7899
8156
|
area: {
|
@@ -7958,21 +8215,7 @@ const darkTheme = ()=>{
|
|
7958
8215
|
...baseConfig
|
7959
8216
|
},
|
7960
8217
|
funnel: {
|
7961
|
-
...baseConfig
|
7962
|
-
color: {
|
7963
|
-
colorScheme: [
|
7964
|
-
'#2E62F1',
|
7965
|
-
'#3A6EF6',
|
7966
|
-
'#4780FA',
|
7967
|
-
'#548CFE',
|
7968
|
-
'#6198FF',
|
7969
|
-
'#6FA3FF',
|
7970
|
-
'#7CACFF',
|
7971
|
-
'#88B7FF',
|
7972
|
-
'#94C2FF',
|
7973
|
-
'#A0CEFF'
|
7974
|
-
]
|
7975
|
-
}
|
8218
|
+
...baseConfig
|
7976
8219
|
},
|
7977
8220
|
heatmap: {
|
7978
8221
|
...baseConfig
|
@@ -8023,9 +8266,6 @@ const updateAdvanced = (chartType, advancedPipe)=>{
|
|
8023
8266
|
const updateSpec = (chartType, specPipe)=>{
|
8024
8267
|
Builder._customSpecPipe[chartType] = specPipe;
|
8025
8268
|
};
|
8026
|
-
const isDimension = (dimension)=>!('children' in dimension);
|
8027
|
-
const isDimensionGroup = (dimension)=>'children' in dimension;
|
8028
|
-
const isDimensions = (dimensions)=>dimensions.every(isDimension);
|
8029
8269
|
const external_zod_namespaceObject = require("zod");
|
8030
8270
|
const zChartType = external_zod_namespaceObject.z["enum"]([
|
8031
8271
|
'table',
|
@@ -8144,6 +8384,8 @@ const zScatterMeasure = external_zod_namespaceObject.z.object({
|
|
8144
8384
|
const zScatterMeasures = external_zod_namespaceObject.z.array(zScatterMeasure);
|
8145
8385
|
const zFoldInfo = external_zod_namespaceObject.z.object({
|
8146
8386
|
foldMap: external_zod_namespaceObject.z.record(external_zod_namespaceObject.z.string(), external_zod_namespaceObject.z.string().or(external_zod_namespaceObject.z.undefined())),
|
8387
|
+
colorRange: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.number()),
|
8388
|
+
measureRange: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.number()),
|
8147
8389
|
measureId: external_zod_namespaceObject.z.string(),
|
8148
8390
|
measureName: external_zod_namespaceObject.z.string(),
|
8149
8391
|
measureValue: external_zod_namespaceObject.z.string()
|
@@ -8288,10 +8530,11 @@ const zStackCornerRadius = external_zod_namespaceObject.z.number().or(external_z
|
|
8288
8530
|
const zBackgroundColor = external_zod_namespaceObject.z.string().default('transparent').nullish();
|
8289
8531
|
const zColor = external_zod_namespaceObject.z.object({
|
8290
8532
|
colorScheme: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()).nullish(),
|
8533
|
+
linearColorScheme: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()).nullish(),
|
8291
8534
|
colorMapping: external_zod_namespaceObject.z.record(external_zod_namespaceObject.z.string(), external_zod_namespaceObject.z.string()).nullish()
|
8292
8535
|
});
|
8293
8536
|
const zLinearColor = external_zod_namespaceObject.z.object({
|
8294
|
-
|
8537
|
+
linearColorScheme: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()).nullish()
|
8295
8538
|
});
|
8296
8539
|
const zLabel = external_zod_namespaceObject.z.object({
|
8297
8540
|
enable: external_zod_namespaceObject.z.boolean().default(true).nullish()
|
@@ -9272,7 +9515,7 @@ const zFunnel = external_zod_namespaceObject.z.object({
|
|
9272
9515
|
dimensions: zDimensions.nullish(),
|
9273
9516
|
measures: zMeasureTree.nullish(),
|
9274
9517
|
backgroundColor: zBackgroundColor.nullish(),
|
9275
|
-
color:
|
9518
|
+
color: zColor.nullish(),
|
9276
9519
|
label: zLabel.nullish(),
|
9277
9520
|
legend: zColorLegend.nullish(),
|
9278
9521
|
tooltip: zTooltip.nullish(),
|
@@ -9285,7 +9528,7 @@ const zHeatmap = external_zod_namespaceObject.z.object({
|
|
9285
9528
|
dimensions: zDimensions.nullish(),
|
9286
9529
|
measures: zMeasureTree.nullish(),
|
9287
9530
|
backgroundColor: zBackgroundColor.nullish(),
|
9288
|
-
color:
|
9531
|
+
color: zColor.nullish(),
|
9289
9532
|
label: zLabel.nullish(),
|
9290
9533
|
legend: zColorLegend.nullish(),
|
9291
9534
|
tooltip: zTooltip.nullish(),
|
@@ -9345,8 +9588,6 @@ exports.FoldYMeasureValue = __webpack_exports__.FoldYMeasureValue;
|
|
9345
9588
|
exports.MeasureName = __webpack_exports__.MeasureName;
|
9346
9589
|
exports.ORIGINAL_DATA = __webpack_exports__.ORIGINAL_DATA;
|
9347
9590
|
exports.Separator = __webpack_exports__.Separator;
|
9348
|
-
exports.UnfoldDimensionGroup = __webpack_exports__.UnfoldDimensionGroup;
|
9349
|
-
exports.UnfoldDimensionGroupId = __webpack_exports__.UnfoldDimensionGroupId;
|
9350
9591
|
exports.XEncoding = __webpack_exports__.XEncoding;
|
9351
9592
|
exports.YEncoding = __webpack_exports__.YEncoding;
|
9352
9593
|
exports.areaAdvancedPipeline = __webpack_exports__.areaAdvancedPipeline;
|
@@ -9378,8 +9619,6 @@ exports.dualAxisSpecPipeline = __webpack_exports__.dualAxisSpecPipeline;
|
|
9378
9619
|
exports.execPipeline = __webpack_exports__.execPipeline;
|
9379
9620
|
exports.findAllDimensions = __webpack_exports__.findAllDimensions;
|
9380
9621
|
exports.findAllMeasures = __webpack_exports__.findAllMeasures;
|
9381
|
-
exports.findDimensionById = __webpack_exports__.findDimensionById;
|
9382
|
-
exports.findFirstDimension = __webpack_exports__.findFirstDimension;
|
9383
9622
|
exports.findFirstMeasure = __webpack_exports__.findFirstMeasure;
|
9384
9623
|
exports.findMeasureById = __webpack_exports__.findMeasureById;
|
9385
9624
|
exports.foldMeasures = __webpack_exports__.foldMeasures;
|
@@ -9389,10 +9628,7 @@ exports.heatmapAdvancedPipeline = __webpack_exports__.heatmapAdvancedPipeline;
|
|
9389
9628
|
exports.heatmapSpecPipeline = __webpack_exports__.heatmapSpecPipeline;
|
9390
9629
|
exports.i18n = __webpack_exports__.i18n;
|
9391
9630
|
exports.intl = __webpack_exports__.intl;
|
9392
|
-
exports.isDimension = __webpack_exports__.isDimension;
|
9393
|
-
exports.isDimensionGroup = __webpack_exports__.isDimensionGroup;
|
9394
9631
|
exports.isDimensionSelector = __webpack_exports__.isDimensionSelector;
|
9395
|
-
exports.isDimensions = __webpack_exports__.isDimensions;
|
9396
9632
|
exports.isMeasure = __webpack_exports__.isMeasure;
|
9397
9633
|
exports.isMeasureGroup = __webpack_exports__.isMeasureGroup;
|
9398
9634
|
exports.isMeasureSelector = __webpack_exports__.isMeasureSelector;
|
@@ -9563,8 +9799,6 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
9563
9799
|
"MeasureName",
|
9564
9800
|
"ORIGINAL_DATA",
|
9565
9801
|
"Separator",
|
9566
|
-
"UnfoldDimensionGroup",
|
9567
|
-
"UnfoldDimensionGroupId",
|
9568
9802
|
"XEncoding",
|
9569
9803
|
"YEncoding",
|
9570
9804
|
"areaAdvancedPipeline",
|
@@ -9596,8 +9830,6 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
9596
9830
|
"execPipeline",
|
9597
9831
|
"findAllDimensions",
|
9598
9832
|
"findAllMeasures",
|
9599
|
-
"findDimensionById",
|
9600
|
-
"findFirstDimension",
|
9601
9833
|
"findFirstMeasure",
|
9602
9834
|
"findMeasureById",
|
9603
9835
|
"foldMeasures",
|
@@ -9607,10 +9839,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
9607
9839
|
"heatmapSpecPipeline",
|
9608
9840
|
"i18n",
|
9609
9841
|
"intl",
|
9610
|
-
"isDimension",
|
9611
|
-
"isDimensionGroup",
|
9612
9842
|
"isDimensionSelector",
|
9613
|
-
"isDimensions",
|
9614
9843
|
"isMeasure",
|
9615
9844
|
"isMeasureGroup",
|
9616
9845
|
"isMeasureSelector",
|