@visactor/vseed 0.0.39 → 0.0.40
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/index.cjs +20 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -6
- package/dist/index.js.map +1 -1
- package/dist/umd/index.js +20 -6
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -1484,6 +1484,7 @@ const foldMeasures = (dataset, measures, measureId = FoldMeasureId, measureName
|
|
1484
1484
|
const unfoldDimensions = (dataset, dimensions, measures, unfoldStartIndex = 0, unfoldGroupName = UnfoldDimensionGroup, unfoldGroupId = UnfoldDimensionGroupId, foldMeasureId = FoldMeasureId, dimensionsSeparator = Separator)=>{
|
1485
1485
|
if (unfoldStartIndex < 0 || unfoldStartIndex >= dimensions.length) throw new Error('unfoldStartIndex is out of range');
|
1486
1486
|
const dimensionsToBeUnfolded = dimensions.slice(unfoldStartIndex);
|
1487
|
+
const dimensionsToBeRemain = dimensions.slice(0, unfoldStartIndex);
|
1487
1488
|
const unfoldInfo = {
|
1488
1489
|
groupName: unfoldGroupName,
|
1489
1490
|
groupId: unfoldGroupId,
|
@@ -1512,6 +1513,10 @@ const unfoldDimensions = (dataset, dimensions, measures, unfoldStartIndex = 0, u
|
|
1512
1513
|
datum[unfoldGroupId] = colorId;
|
1513
1514
|
colorItems.push(colorId);
|
1514
1515
|
colorMap[colorId] = colorName;
|
1516
|
+
if (dimensionsToBeRemain.length > 0) for (const dim of dimensionsToBeRemain){
|
1517
|
+
const dimValue = datum[dim.id];
|
1518
|
+
if ('number' == typeof dimValue) datum[dim.id] = String(dimValue);
|
1519
|
+
}
|
1515
1520
|
}
|
1516
1521
|
unfoldInfo.colorItems = (0, external_remeda_namespaceObject.unique)(colorItems);
|
1517
1522
|
unfoldInfo.colorIdMap = colorMap;
|
@@ -4065,12 +4070,15 @@ const initColumnParallel = (spec, context)=>{
|
|
4065
4070
|
...spec
|
4066
4071
|
};
|
4067
4072
|
const { advancedVSeed } = context;
|
4068
|
-
const { encoding, datasetReshapeInfo } = advancedVSeed;
|
4073
|
+
const { encoding, datasetReshapeInfo, dimensions } = advancedVSeed;
|
4069
4074
|
const { unfoldInfo } = datasetReshapeInfo[0];
|
4070
4075
|
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
4076
|
+
const sameDimensionsMode = dimensions.length > 1 && dimensions.every((dim)=>dim.id === dimensions[0].id);
|
4071
4077
|
result.type = 'bar';
|
4072
4078
|
result.direction = 'vertical';
|
4073
|
-
result.xField = [
|
4079
|
+
result.xField = sameDimensionsMode ? [
|
4080
|
+
encoding[0].x[0]
|
4081
|
+
] : [
|
4074
4082
|
encoding[0].x[0],
|
4075
4083
|
unfoldInfo.groupId
|
4076
4084
|
];
|
@@ -4630,12 +4638,15 @@ const initBarParallel = (spec, context)=>{
|
|
4630
4638
|
...spec
|
4631
4639
|
};
|
4632
4640
|
const { advancedVSeed } = context;
|
4633
|
-
const { encoding, datasetReshapeInfo } = advancedVSeed;
|
4641
|
+
const { encoding, datasetReshapeInfo, dimensions } = advancedVSeed;
|
4634
4642
|
const { unfoldInfo } = datasetReshapeInfo[0];
|
4635
4643
|
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
4644
|
+
const sameDimensionsMode = dimensions.length > 1 && dimensions.every((dim)=>dim.id === dimensions[0].id);
|
4636
4645
|
result.type = 'bar';
|
4637
4646
|
result.direction = 'horizontal';
|
4638
|
-
result.yField = [
|
4647
|
+
result.yField = sameDimensionsMode ? [
|
4648
|
+
encoding[0].y[0]
|
4649
|
+
] : [
|
4639
4650
|
encoding[0].y[0],
|
4640
4651
|
unfoldInfo.groupId
|
4641
4652
|
];
|
@@ -7399,11 +7410,14 @@ const initRoseParallel = (spec, context)=>{
|
|
7399
7410
|
...spec
|
7400
7411
|
};
|
7401
7412
|
const { advancedVSeed } = context;
|
7402
|
-
const { encoding, datasetReshapeInfo, dataset } = advancedVSeed;
|
7413
|
+
const { encoding, datasetReshapeInfo, dataset, dimensions } = advancedVSeed;
|
7403
7414
|
const { unfoldInfo, foldInfo } = datasetReshapeInfo[0];
|
7404
7415
|
if (!encoding[0].radius || !encoding[0].angle || !encoding[0].group) return result;
|
7416
|
+
const sameDimensionsMode = dimensions.length > 1 && dimensions.every((dim)=>dim.id === dimensions[0].id);
|
7405
7417
|
result.type = 'rose';
|
7406
|
-
result.categoryField = [
|
7418
|
+
result.categoryField = sameDimensionsMode ? [
|
7419
|
+
encoding[0].angle[0]
|
7420
|
+
] : [
|
7407
7421
|
encoding[0].angle[0],
|
7408
7422
|
unfoldInfo.groupId
|
7409
7423
|
];
|