@visactor/vseed 0.0.37 → 0.0.39
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 +22 -24
- package/dist/index.cjs +132 -71
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +132 -71
- package/dist/index.js.map +1 -1
- package/dist/pipeline/spec/chart/pipes/color/color.d.ts +3 -0
- package/dist/pipeline/spec/chart/pipes/series/series.d.ts +4 -0
- package/dist/pipeline/utils/constant.d.ts +2 -0
- package/dist/types/advancedVSeed.d.ts +10 -12
- package/dist/types/chartType/area/area.d.ts +13 -10
- package/dist/types/chartType/area/zArea.d.ts +6 -12
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +4 -0
- package/dist/types/chartType/areaPercent/zAreaPercent.d.ts +6 -12
- package/dist/types/chartType/areaRange/areaRange.d.ts +4 -0
- package/dist/types/chartType/areaRange/zAreaRange.d.ts +6 -12
- package/dist/types/chartType/bar/bar.d.ts +4 -0
- package/dist/types/chartType/bar/zBar.d.ts +2 -12
- package/dist/types/chartType/barParallel/barParallel.d.ts +4 -0
- package/dist/types/chartType/barParallel/zBarParallel.d.ts +2 -12
- package/dist/types/chartType/barPercent/barPercent.d.ts +4 -0
- package/dist/types/chartType/barPercent/zBarPercent.d.ts +2 -12
- package/dist/types/chartType/column/column.d.ts +4 -0
- package/dist/types/chartType/column/zColumn.d.ts +2 -12
- package/dist/types/chartType/columnParallel/columnParallel.d.ts +4 -0
- package/dist/types/chartType/columnParallel/zColumnParallel.d.ts +2 -12
- package/dist/types/chartType/columnPercent/columnPercent.d.ts +4 -0
- package/dist/types/chartType/columnPercent/zColumnPercent.d.ts +2 -12
- package/dist/types/chartType/donut/donut.d.ts +4 -0
- package/dist/types/chartType/dualAxis/dualAxis.d.ts +9 -0
- package/dist/types/chartType/dualAxis/zDualAxis.d.ts +9 -12
- package/dist/types/chartType/funnel/funnel.d.ts +4 -0
- package/dist/types/chartType/heatmap/heatmap.d.ts +4 -0
- package/dist/types/chartType/line/line.d.ts +8 -2
- package/dist/types/chartType/line/zLine.d.ts +4 -12
- package/dist/types/chartType/pie/pie.d.ts +4 -0
- package/dist/types/chartType/pivotTable/pivotTable.d.ts +4 -0
- package/dist/types/chartType/radar/radar.d.ts +29 -1
- package/dist/types/chartType/rose/rose.d.ts +4 -0
- package/dist/types/chartType/roseParallel/roseParallel.d.ts +4 -0
- package/dist/types/chartType/scatter/scatter.d.ts +4 -0
- package/dist/types/chartType/scatter/zScatter.d.ts +2 -12
- package/dist/types/chartType/table/table.d.ts +4 -0
- package/dist/types/dataSelector/selector.d.ts +54 -0
- package/dist/types/properties/annotation/annotation.d.ts +0 -12
- package/dist/types/properties/annotation/annotationArea.d.ts +17 -32
- package/dist/types/properties/annotation/annotationHorizontalLine.d.ts +0 -14
- package/dist/types/properties/annotation/annotationVerticalLine.d.ts +0 -14
- package/dist/types/properties/annotation/zAnnotationArea.d.ts +0 -2
- package/dist/types/properties/annotation/zAnnotationHorizontalLine.d.ts +0 -2
- package/dist/types/properties/annotation/zAnnotationVerticalLine.d.ts +0 -2
- package/dist/types/properties/config/axes/axis.d.ts +0 -14
- package/dist/types/properties/config/color/color.d.ts +4 -6
- package/dist/types/properties/config/config.d.ts +2 -0
- package/dist/types/properties/config/crosshair/crosshair.d.ts +14 -17
- package/dist/types/properties/config/crosshair/index.d.ts +2 -1
- package/dist/types/properties/config/crosshair/zCrosshair.d.ts +15 -0
- package/dist/types/properties/config/legend/legend.d.ts +0 -4
- package/dist/types/properties/dimensions/dimensions.d.ts +6 -29
- package/dist/types/properties/dimensions/index.d.ts +2 -1
- package/dist/types/properties/dimensions/zDimensions.d.ts +30 -0
- package/dist/types/properties/markStyle/areaStyle.d.ts +5 -76
- package/dist/types/properties/markStyle/barStyle.d.ts +11 -12
- package/dist/types/properties/markStyle/index.d.ts +2 -1
- package/dist/types/properties/markStyle/lineStyle.d.ts +11 -17
- package/dist/types/properties/markStyle/markStyle.d.ts +8 -0
- package/dist/types/properties/markStyle/pointStyle.d.ts +5 -6
- package/dist/types/properties/markStyle/zAreaStyle.d.ts +75 -0
- package/dist/types/properties/measures/measures.d.ts +3 -0
- package/dist/types/properties/theme/customTheme.d.ts +2 -0
- package/dist/types/vseed.d.ts +45 -144
- package/dist/umd/index.js +132 -71
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/umd/index.js
CHANGED
@@ -1259,6 +1259,9 @@
|
|
1259
1259
|
tooltip: {
|
1260
1260
|
isShowOverflowTextTooltip: true
|
1261
1261
|
},
|
1262
|
+
corner: {
|
1263
|
+
titleOnDimension: 'all'
|
1264
|
+
},
|
1262
1265
|
widthAdaptiveMode: 'all',
|
1263
1266
|
animationAppear: {
|
1264
1267
|
duration: 300,
|
@@ -2151,22 +2154,44 @@
|
|
2151
2154
|
const colorIdMap = unfoldInfo.colorIdMap;
|
2152
2155
|
const { color } = baseConfig;
|
2153
2156
|
const { colorScheme, colorMapping } = color;
|
2154
|
-
const mappingList = [];
|
2155
|
-
if (colorMapping) Object.entries(colorMapping).sort((a, b)=>a[0].split(Separator).length - b[0].split(Separator).length).forEach(([key, value])=>{
|
2156
|
-
const idMap = Object.entries(colorIdMap).filter(([_, v])=>v.includes(key));
|
2157
|
-
for (const [colorId] of idMap)mappingList.push([
|
2158
|
-
colorId,
|
2159
|
-
value
|
2160
|
-
]);
|
2161
|
-
});
|
2162
2157
|
result.color = {
|
2163
2158
|
type: 'ordinal',
|
2164
2159
|
domain: colorItems,
|
2165
2160
|
range: colorScheme,
|
2166
|
-
specified:
|
2161
|
+
specified: createSpecifiedForColorMapping(colorMapping, colorIdMap, colorItems)
|
2167
2162
|
};
|
2168
2163
|
return result;
|
2169
2164
|
};
|
2165
|
+
const createSpecifiedForColorMapping = (colorMapping, colorIdMap, colorItems)=>{
|
2166
|
+
if (!colorMapping || !colorIdMap || !colorItems) return;
|
2167
|
+
const matchedList = [];
|
2168
|
+
const colors = Object.entries(colorMapping).sort((a, b)=>b[0].length - a[0].length);
|
2169
|
+
const accurateMap = colors.reduce((prev, cur)=>{
|
2170
|
+
const name = cur[0];
|
2171
|
+
const colorValue = cur[1];
|
2172
|
+
const accurateMatchedList = Object.entries(colorIdMap).filter(([colorKey, colorAlias])=>colorKey === name || colorAlias === name);
|
2173
|
+
accurateMatchedList.forEach((item)=>{
|
2174
|
+
prev[item[0]] = colorValue;
|
2175
|
+
matchedList.push(name);
|
2176
|
+
});
|
2177
|
+
return prev;
|
2178
|
+
}, {});
|
2179
|
+
const fuzzyMap = colors.reduce((prev, cur)=>{
|
2180
|
+
const name = cur[0];
|
2181
|
+
const colorValue = cur[1];
|
2182
|
+
if (matchedList.includes(name)) return prev;
|
2183
|
+
const fuzzyMatchedList = Object.entries(colorIdMap).filter(([colorKey, colorAlias])=>colorKey.includes(name) || colorAlias.includes(name));
|
2184
|
+
fuzzyMatchedList.forEach((item)=>{
|
2185
|
+
if (prev[item[0]]) return;
|
2186
|
+
prev[item[0]] = colorValue;
|
2187
|
+
});
|
2188
|
+
return prev;
|
2189
|
+
}, {});
|
2190
|
+
return {
|
2191
|
+
...fuzzyMap,
|
2192
|
+
...accurateMap
|
2193
|
+
};
|
2194
|
+
};
|
2170
2195
|
const background_backgroundColor = (spec, context)=>{
|
2171
2196
|
const result = {
|
2172
2197
|
...spec
|
@@ -2333,6 +2358,8 @@
|
|
2333
2358
|
};
|
2334
2359
|
const ANNOTATION_Z_INDEX = 1000;
|
2335
2360
|
const LINEAR_AXIS_INNER_OFFSET_TOP = 7;
|
2361
|
+
const DUAL_AXIS_CHART_COLUMN_Z_INDEX = 1000;
|
2362
|
+
const DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX = 1001;
|
2336
2363
|
const yLinear = (spec, context)=>{
|
2337
2364
|
const result = {
|
2338
2365
|
...spec
|
@@ -2774,7 +2801,7 @@
|
|
2774
2801
|
pointStyle
|
2775
2802
|
];
|
2776
2803
|
const customMap = pointStyles.reduce((result, style, index)=>{
|
2777
|
-
const { pointBorderColor, pointBorderStyle, pointBorderWidth = 1, pointColor, pointColorOpacity, pointSize } = style;
|
2804
|
+
const { pointBorderColor, pointBorderStyle, pointBorderWidth = 1, pointColor, pointColorOpacity, pointSize, pointVisible = true } = style;
|
2778
2805
|
const lineDash = 'dashed' === pointBorderStyle ? [
|
2779
2806
|
5,
|
2780
2807
|
2
|
@@ -2794,6 +2821,7 @@
|
|
2794
2821
|
return false;
|
2795
2822
|
},
|
2796
2823
|
style: {
|
2824
|
+
visible: pointVisible,
|
2797
2825
|
size: pointSize,
|
2798
2826
|
fill: pointColor,
|
2799
2827
|
fillOpacity: pointColorOpacity,
|
@@ -2826,7 +2854,12 @@
|
|
2826
2854
|
...point.state || {},
|
2827
2855
|
dimension_hover: {
|
2828
2856
|
scaleX: 1.4,
|
2829
|
-
scaleY: 1.4
|
2857
|
+
scaleY: 1.4,
|
2858
|
+
outerBorder: {
|
2859
|
+
lineWidth: 4,
|
2860
|
+
strokeOpacity: 0.25,
|
2861
|
+
distance: 2
|
2862
|
+
}
|
2830
2863
|
}
|
2831
2864
|
}
|
2832
2865
|
}
|
@@ -2889,9 +2922,9 @@
|
|
2889
2922
|
const group = encoding[0]?.group?.[0];
|
2890
2923
|
const lineGroups = chunk_HVPVHFDT_i(dataset, (d)=>d[group ?? '']);
|
2891
2924
|
const customMap = lineStyles.reduce((result, style, index)=>{
|
2892
|
-
const { lineColor, lineColorOpacity, lineSmooth, lineStyle, lineWidth } = style;
|
2893
|
-
const dashSegment =
|
2894
|
-
const dashGap = lineWidth
|
2925
|
+
const { lineColor, lineColorOpacity, lineSmooth, lineStyle, lineWidth = 2, lineVisible = true } = style;
|
2926
|
+
const dashSegment = 2 * lineWidth;
|
2927
|
+
const dashGap = lineWidth;
|
2895
2928
|
const lineDash = 'dashed' === lineStyle ? [
|
2896
2929
|
dashSegment,
|
2897
2930
|
dashSegment
|
@@ -2913,6 +2946,7 @@
|
|
2913
2946
|
return false;
|
2914
2947
|
},
|
2915
2948
|
style: {
|
2949
|
+
visible: lineVisible,
|
2916
2950
|
curveType: curveType,
|
2917
2951
|
strokeOpacity: lineColorOpacity,
|
2918
2952
|
stroke: lineColor,
|
@@ -3020,13 +3054,11 @@
|
|
3020
3054
|
insideEnd: 'insideEndTop'
|
3021
3055
|
};
|
3022
3056
|
const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
|
3023
|
-
const { selector: selectorPoint, xValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'right', textBaseline = 'top', textBackgroundVisible = true, textBackgroundBorderColor = '#212121', textBackgroundColor = '#212121', textBackgroundBorderRadius = 4, textBackgroundBorderWidth = 1, textBackgroundPadding = 2, lineVisible = true, lineColor = '#212121', lineWidth = 1, lineStyle = 'dashed'
|
3057
|
+
const { selector: selectorPoint, xValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'right', textBaseline = 'top', textBackgroundVisible = true, textBackgroundBorderColor = '#212121', textBackgroundColor = '#212121', textBackgroundBorderRadius = 4, textBackgroundBorderWidth = 1, textBackgroundPadding = 2, lineVisible = true, lineColor = '#212121', lineWidth = 1, lineStyle = 'dashed' } = annotationVerticalLine;
|
3024
3058
|
const dataset = advancedVSeed.dataset.flat();
|
3025
3059
|
const generateOneMarkLine = (x)=>({
|
3026
3060
|
x: x,
|
3027
3061
|
zIndex: ANNOTATION_Z_INDEX,
|
3028
|
-
offsetX,
|
3029
|
-
offsetY,
|
3030
3062
|
line: {
|
3031
3063
|
style: {
|
3032
3064
|
visible: lineVisible,
|
@@ -3119,12 +3151,10 @@
|
|
3119
3151
|
insideEnd: 'insideEndTop'
|
3120
3152
|
};
|
3121
3153
|
const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
|
3122
|
-
const { selector: selectorPoint, yValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'right', textBaseline = 'top', lineColor = '#212121', lineStyle = 'dashed', lineVisible = true, lineWidth = 1, textBackgroundVisible = true, textBackgroundColor = '#212121', textBackgroundBorderColor = '#212121', textBackgroundBorderRadius = 4, textBackgroundBorderWidth = 1, textBackgroundPadding = 2
|
3154
|
+
const { selector: selectorPoint, yValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'right', textBaseline = 'top', lineColor = '#212121', lineStyle = 'dashed', lineVisible = true, lineWidth = 1, textBackgroundVisible = true, textBackgroundColor = '#212121', textBackgroundBorderColor = '#212121', textBackgroundBorderRadius = 4, textBackgroundBorderWidth = 1, textBackgroundPadding = 2 } = annotationVerticalLine;
|
3123
3155
|
const dataset = advancedVSeed.dataset.flat();
|
3124
3156
|
const generateOneMarkLine = (y)=>({
|
3125
3157
|
y,
|
3126
|
-
offsetX,
|
3127
|
-
offsetY,
|
3128
3158
|
zIndex: ANNOTATION_Z_INDEX,
|
3129
3159
|
line: {
|
3130
3160
|
style: {
|
@@ -3220,7 +3250,7 @@
|
|
3220
3250
|
right: 'insideRight'
|
3221
3251
|
};
|
3222
3252
|
const markArea = annotationAreaList.flatMap((annotationArea)=>{
|
3223
|
-
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', textBackgroundVisible = true, textBackgroundColor = '#191d24', textBackgroundBorderColor = '#191d24', textBackgroundBorderWidth = 1, textBackgroundBorderRadius = 4, textBackgroundPadding = 4, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor = '#888888', areaBorderRadius = 4, areaBorderWidth = 1, outerPadding = 4
|
3253
|
+
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', textBackgroundVisible = true, textBackgroundColor = '#191d24', textBackgroundBorderColor = '#191d24', textBackgroundBorderWidth = 1, textBackgroundBorderRadius = 4, textBackgroundPadding = 4, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor = '#888888', areaBorderRadius = 4, areaBorderWidth = 1, outerPadding = 4 } = annotationArea;
|
3224
3254
|
const dataset = advancedVSeed.dataset.flat();
|
3225
3255
|
const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
|
3226
3256
|
const labelPosition = positionMap[textPosition || 'top'];
|
@@ -3228,8 +3258,6 @@
|
|
3228
3258
|
return {
|
3229
3259
|
zIndex: ANNOTATION_Z_INDEX,
|
3230
3260
|
regionRelative: true,
|
3231
|
-
offsetX,
|
3232
|
-
offsetY,
|
3233
3261
|
positions: (data, context)=>{
|
3234
3262
|
const positionData = data.filter((item)=>selectedData.some((datum)=>isSubset(datum, item)));
|
3235
3263
|
const xyList = positionData.map((datum)=>context.dataToPosition(datum));
|
@@ -3469,13 +3497,14 @@
|
|
3469
3497
|
...spec
|
3470
3498
|
};
|
3471
3499
|
const { advancedVSeed } = context;
|
3472
|
-
const { measures, datasetReshapeInfo, encoding } = advancedVSeed;
|
3500
|
+
const { measures, datasetReshapeInfo, encoding, dataset } = advancedVSeed;
|
3473
3501
|
const colorItems = chunk_QJLMYOTX_i(datasetReshapeInfo.flatMap((d)=>d.unfoldInfo.colorItems));
|
3474
3502
|
const indicators = datasetReshapeInfo.map((reshapeInfo, index)=>{
|
3475
3503
|
const measure = measures?.find((d)=>d.id === reshapeInfo.id);
|
3476
3504
|
const newEncoding = [
|
3477
3505
|
encoding[index]
|
3478
3506
|
];
|
3507
|
+
const newDataset = dataset[index];
|
3479
3508
|
const newDatasetReshapeInfo = [
|
3480
3509
|
{
|
3481
3510
|
...reshapeInfo,
|
@@ -3490,6 +3519,7 @@
|
|
3490
3519
|
advancedVSeed: {
|
3491
3520
|
...advancedVSeed,
|
3492
3521
|
datasetReshapeInfo: newDatasetReshapeInfo,
|
3522
|
+
dataset: newDataset,
|
3493
3523
|
encoding: newEncoding
|
3494
3524
|
}
|
3495
3525
|
};
|
@@ -3598,7 +3628,8 @@
|
|
3598
3628
|
...cur.unfoldInfo.colorIdMap
|
3599
3629
|
}), {});
|
3600
3630
|
const { legend, color } = baseConfig;
|
3601
|
-
const { colorScheme } = color;
|
3631
|
+
const { colorScheme, colorMapping } = color;
|
3632
|
+
const colorSpecified = createSpecifiedForColorMapping(colorMapping, colorIdMap, colorItems);
|
3602
3633
|
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
|
3603
3634
|
const orient = [
|
3604
3635
|
'bottom',
|
@@ -3645,17 +3676,20 @@
|
|
3645
3676
|
position: legendPosition,
|
3646
3677
|
maxCol: Math.max(1, maxSize),
|
3647
3678
|
maxRow: Math.max(1, maxSize),
|
3648
|
-
data: colorItems.map((d, index)=>
|
3679
|
+
data: colorItems.map((d, index)=>{
|
3680
|
+
const color = colorSpecified?.[d] ?? colorScheme?.[index % colorScheme.length];
|
3681
|
+
return {
|
3649
3682
|
label: d,
|
3650
3683
|
shape: {
|
3651
3684
|
outerBorder: border ? {
|
3652
|
-
stroke:
|
3685
|
+
stroke: color,
|
3653
3686
|
distance: 3,
|
3654
3687
|
lineWidth: 1
|
3655
3688
|
} : void 0,
|
3656
|
-
fill:
|
3689
|
+
fill: color
|
3657
3690
|
}
|
3658
|
-
}
|
3691
|
+
};
|
3692
|
+
}),
|
3659
3693
|
item: {
|
3660
3694
|
focus: true,
|
3661
3695
|
maxWidth: '30%',
|
@@ -4005,7 +4039,7 @@
|
|
4005
4039
|
barStyle
|
4006
4040
|
];
|
4007
4041
|
const customMap = barStyles.reduce((result, style, index)=>{
|
4008
|
-
const { barBorderColor, barBorderStyle, barBorderWidth = 1, barColor, barColorOpacity, barRadius } = style;
|
4042
|
+
const { barBorderColor, barBorderStyle, barBorderWidth = 1, barColor, barColorOpacity, barRadius, barVisible = true } = style;
|
4009
4043
|
const lineDash = 'dashed' === barBorderStyle ? [
|
4010
4044
|
5,
|
4011
4045
|
2
|
@@ -4025,6 +4059,7 @@
|
|
4025
4059
|
return false;
|
4026
4060
|
},
|
4027
4061
|
style: {
|
4062
|
+
visible: barVisible,
|
4028
4063
|
fill: barColor,
|
4029
4064
|
fillOpacity: barColorOpacity,
|
4030
4065
|
cornerRadius: barRadius,
|
@@ -4066,14 +4101,12 @@
|
|
4066
4101
|
right: 'insideRight'
|
4067
4102
|
};
|
4068
4103
|
const markArea = annotationAreaList.flatMap((annotationArea)=>{
|
4069
|
-
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', textBackgroundVisible = true, textBackgroundColor = '#191d24', textBackgroundBorderColor = '#191d24', textBackgroundBorderWidth = 1, textBackgroundBorderRadius = 4, textBackgroundPadding = 4, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor = '#888888', areaBorderRadius = 4, areaBorderWidth = 1, outerPadding = 4
|
4104
|
+
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', textBackgroundVisible = true, textBackgroundColor = '#191d24', textBackgroundBorderColor = '#191d24', textBackgroundBorderWidth = 1, textBackgroundBorderRadius = 4, textBackgroundPadding = 4, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor = '#888888', areaBorderRadius = 4, areaBorderWidth = 1, outerPadding = 4 } = annotationArea;
|
4070
4105
|
const dataset = advancedVSeed.dataset.flat();
|
4071
4106
|
const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
|
4072
4107
|
return {
|
4073
4108
|
zIndex: ANNOTATION_Z_INDEX,
|
4074
4109
|
regionRelative: true,
|
4075
|
-
offsetX,
|
4076
|
-
offsetY,
|
4077
4110
|
positions: (data, context)=>{
|
4078
4111
|
const positionData = data.filter((item)=>selectedData.some((datum)=>isSubset(datum, item)));
|
4079
4112
|
const xyList = positionData.map((datum)=>context.dataToPosition(datum));
|
@@ -5005,7 +5038,12 @@
|
|
5005
5038
|
const { advancedVSeed } = context;
|
5006
5039
|
const { markStyle, encoding, dataset } = advancedVSeed;
|
5007
5040
|
const { areaStyle } = markStyle;
|
5008
|
-
if (!areaStyle) return
|
5041
|
+
if (!areaStyle) return {
|
5042
|
+
...spec,
|
5043
|
+
area: {
|
5044
|
+
visible: true
|
5045
|
+
}
|
5046
|
+
};
|
5009
5047
|
const result = {
|
5010
5048
|
...spec
|
5011
5049
|
};
|
@@ -5013,19 +5051,20 @@
|
|
5013
5051
|
areaStyle
|
5014
5052
|
];
|
5015
5053
|
const group = encoding[0]?.group?.[0];
|
5016
|
-
const
|
5054
|
+
const areaGroups = chunk_HVPVHFDT_i(dataset, (d)=>d[group ?? '']);
|
5017
5055
|
const customMap = areaStyles.reduce((result, style, index)=>{
|
5018
|
-
const { areaColor, areaColorOpacity } = style;
|
5056
|
+
const { areaColor, areaColorOpacity, areaVisible = true } = style;
|
5019
5057
|
return {
|
5020
5058
|
...result,
|
5021
5059
|
[`custom${index + 1}`]: {
|
5022
5060
|
level: index + 1,
|
5023
5061
|
filter: (datum)=>{
|
5024
|
-
const lineData =
|
5062
|
+
const lineData = areaGroups[datum[group ?? '']];
|
5025
5063
|
for (const d of lineData)if (selector_selector(d, style.selector)) return true;
|
5026
5064
|
return false;
|
5027
5065
|
},
|
5028
5066
|
style: {
|
5067
|
+
visible: areaVisible,
|
5029
5068
|
fill: areaColor,
|
5030
5069
|
fillOpacity: areaColorOpacity
|
5031
5070
|
}
|
@@ -5035,6 +5074,7 @@
|
|
5035
5074
|
return {
|
5036
5075
|
...result,
|
5037
5076
|
area: {
|
5077
|
+
visible: true,
|
5038
5078
|
state: {
|
5039
5079
|
...customMap
|
5040
5080
|
}
|
@@ -6148,6 +6188,7 @@
|
|
6148
6188
|
'legend',
|
6149
6189
|
'tooltip',
|
6150
6190
|
'dualChartType',
|
6191
|
+
'alignTicks',
|
6151
6192
|
'primaryYAxis',
|
6152
6193
|
'secondaryYAxis',
|
6153
6194
|
'crosshairLine'
|
@@ -6300,7 +6341,8 @@
|
|
6300
6341
|
};
|
6301
6342
|
const dualChartTypePrimary = (spec, context)=>{
|
6302
6343
|
const result = {
|
6303
|
-
...spec
|
6344
|
+
...spec,
|
6345
|
+
zIndex: DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX
|
6304
6346
|
};
|
6305
6347
|
const { advancedVSeed, vseed } = context;
|
6306
6348
|
const { chartType } = vseed;
|
@@ -6311,12 +6353,16 @@
|
|
6311
6353
|
secondary: 'line'
|
6312
6354
|
};
|
6313
6355
|
const primary = Array.isArray(config) ? config[index].primary || config[0].primary : config.primary;
|
6314
|
-
|
6356
|
+
const secondary = Array.isArray(config) ? config[index].secondary || config[0].secondary : config.secondary;
|
6357
|
+
const bothColumn = 'column' === primary && 'column' === secondary;
|
6358
|
+
const type = bothColumn ? 'columnParallel' : primary;
|
6359
|
+
switch(type){
|
6315
6360
|
case 'line':
|
6316
6361
|
result.type = 'line';
|
6317
6362
|
break;
|
6318
6363
|
case 'column':
|
6319
6364
|
result.type = 'bar';
|
6365
|
+
result.zIndex = DUAL_AXIS_CHART_COLUMN_Z_INDEX;
|
6320
6366
|
break;
|
6321
6367
|
case 'columnParallel':
|
6322
6368
|
{
|
@@ -6327,6 +6373,7 @@
|
|
6327
6373
|
datasetReshapeInfo[0].unfoldInfo.groupId
|
6328
6374
|
];
|
6329
6375
|
columnSpec.type = 'bar';
|
6376
|
+
result.zIndex = DUAL_AXIS_CHART_COLUMN_Z_INDEX;
|
6330
6377
|
break;
|
6331
6378
|
}
|
6332
6379
|
case 'columnPercent':
|
@@ -6350,7 +6397,8 @@
|
|
6350
6397
|
};
|
6351
6398
|
const dualChartTypeSecondary = (spec, context)=>{
|
6352
6399
|
const result = {
|
6353
|
-
...spec
|
6400
|
+
...spec,
|
6401
|
+
zIndex: DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX
|
6354
6402
|
};
|
6355
6403
|
const { advancedVSeed, vseed } = context;
|
6356
6404
|
const { chartType } = vseed;
|
@@ -6360,13 +6408,17 @@
|
|
6360
6408
|
secondary: 'line'
|
6361
6409
|
};
|
6362
6410
|
const index = datasetReshapeInfo[0].index;
|
6411
|
+
const primary = Array.isArray(config) ? config[index].primary || config[0].primary : config.primary;
|
6363
6412
|
const secondary = Array.isArray(config) ? config[index].secondary || config[0].secondary : config.secondary;
|
6364
|
-
|
6413
|
+
const bothColumn = 'column' === primary && 'column' === secondary;
|
6414
|
+
const type = bothColumn ? 'columnParallel' : secondary;
|
6415
|
+
switch(type){
|
6365
6416
|
case 'line':
|
6366
6417
|
result.type = 'line';
|
6367
6418
|
break;
|
6368
6419
|
case 'column':
|
6369
6420
|
result.type = 'bar';
|
6421
|
+
result.zIndex = DUAL_AXIS_CHART_COLUMN_Z_INDEX;
|
6370
6422
|
break;
|
6371
6423
|
case 'columnParallel':
|
6372
6424
|
{
|
@@ -6377,6 +6429,7 @@
|
|
6377
6429
|
datasetReshapeInfo[0].unfoldInfo.groupId
|
6378
6430
|
];
|
6379
6431
|
columnSpec.type = 'bar';
|
6432
|
+
result.zIndex = DUAL_AXIS_CHART_COLUMN_Z_INDEX;
|
6380
6433
|
break;
|
6381
6434
|
}
|
6382
6435
|
case 'columnPercent':
|
@@ -6715,12 +6768,18 @@
|
|
6715
6768
|
const { locale, datasetReshapeInfo } = advancedVSeed;
|
6716
6769
|
const index = datasetReshapeInfo[0].index;
|
6717
6770
|
const primaryYAxis = advancedVSeed.config?.[chartType]?.primaryYAxis;
|
6718
|
-
const
|
6771
|
+
const yAxisConfig = Array.isArray(primaryYAxis) ? primaryYAxis[index] || primaryYAxis[0] : primaryYAxis;
|
6772
|
+
const alignTicks = advancedVSeed.config?.[chartType]?.alignTicks;
|
6773
|
+
const alignTicksConfig = Array.isArray(alignTicks) ? alignTicks[index] || alignTicks[0] : alignTicks;
|
6719
6774
|
if (datasetReshapeInfo[0].foldInfoList?.[0] && chunk_VCYTMP4D_n(datasetReshapeInfo[0].foldInfoList[0].foldMap)) return result;
|
6720
6775
|
const id = `${datasetReshapeInfo[0].id}-primary-axis`;
|
6721
|
-
const
|
6776
|
+
const seriesIds = [
|
6777
|
+
`${datasetReshapeInfo[0].id}-primary-series`,
|
6778
|
+
`${datasetReshapeInfo[0].id}-secondary-series`
|
6779
|
+
];
|
6780
|
+
const seriesId = alignTicksConfig ? seriesIds : seriesIds[0];
|
6722
6781
|
if (!result.axes) result.axes = [];
|
6723
|
-
if (!
|
6782
|
+
if (!yAxisConfig) {
|
6724
6783
|
result.axes = [
|
6725
6784
|
...result.axes,
|
6726
6785
|
{
|
@@ -6728,26 +6787,16 @@
|
|
6728
6787
|
id,
|
6729
6788
|
seriesId,
|
6730
6789
|
type: 'linear',
|
6731
|
-
orient: 'left'
|
6732
|
-
sync: {
|
6733
|
-
axisId: `${datasetReshapeInfo[0].id}-secondary-axis`,
|
6734
|
-
tickAlign: false,
|
6735
|
-
zeroAlign: true
|
6736
|
-
}
|
6790
|
+
orient: 'left'
|
6737
6791
|
}
|
6738
6792
|
];
|
6739
6793
|
return result;
|
6740
6794
|
}
|
6741
|
-
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10 } =
|
6795
|
+
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10 } = yAxisConfig;
|
6742
6796
|
const linearAxis = {
|
6743
6797
|
visible,
|
6744
6798
|
id,
|
6745
6799
|
seriesId,
|
6746
|
-
sync: {
|
6747
|
-
axisId: `${datasetReshapeInfo[0].id}-secondary-axis`,
|
6748
|
-
tickAlign: false,
|
6749
|
-
zeroAlign: true
|
6750
|
-
},
|
6751
6800
|
type: log ? 'log' : 'linear',
|
6752
6801
|
base: logBase,
|
6753
6802
|
orient: 'left',
|
@@ -6816,12 +6865,22 @@
|
|
6816
6865
|
const { locale, datasetReshapeInfo } = advancedVSeed;
|
6817
6866
|
const index = datasetReshapeInfo[0].index;
|
6818
6867
|
const secondaryYAxis = advancedVSeed.config?.[chartType]?.secondaryYAxis;
|
6819
|
-
const
|
6868
|
+
const yAxisConfig = Array.isArray(secondaryYAxis) ? secondaryYAxis[index] || secondaryYAxis[0] : secondaryYAxis;
|
6869
|
+
const alignTicks = advancedVSeed.config?.[chartType]?.alignTicks;
|
6870
|
+
const alignTicksConfig = Array.isArray(alignTicks) ? alignTicks[index] || alignTicks[0] : alignTicks;
|
6820
6871
|
if (chunk_JK3VNB42_n(datasetReshapeInfo[0].foldInfoList?.[1])) return result;
|
6872
|
+
const sync = {
|
6873
|
+
axisId: `${datasetReshapeInfo[0].id}-primary-axis`,
|
6874
|
+
zeroAlign: true
|
6875
|
+
};
|
6821
6876
|
const id = `${datasetReshapeInfo[0].id}-secondary-axis`;
|
6822
|
-
const
|
6877
|
+
const seriesIds = [
|
6878
|
+
`${datasetReshapeInfo[0].id}-primary-series`,
|
6879
|
+
`${datasetReshapeInfo[0].id}-secondary-series`
|
6880
|
+
];
|
6881
|
+
const seriesId = alignTicksConfig ? seriesIds : seriesIds[1];
|
6823
6882
|
if (!result.axes) result.axes = [];
|
6824
|
-
if (!
|
6883
|
+
if (!yAxisConfig) {
|
6825
6884
|
result.axes = [
|
6826
6885
|
...result.axes,
|
6827
6886
|
{
|
@@ -6829,16 +6888,18 @@
|
|
6829
6888
|
id,
|
6830
6889
|
seriesId,
|
6831
6890
|
type: 'linear',
|
6832
|
-
orient: 'right'
|
6891
|
+
orient: 'right',
|
6892
|
+
sync
|
6833
6893
|
}
|
6834
6894
|
];
|
6835
6895
|
return result;
|
6836
6896
|
}
|
6837
|
-
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10 } =
|
6897
|
+
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10 } = yAxisConfig;
|
6838
6898
|
const linearAxis = {
|
6839
6899
|
visible,
|
6840
6900
|
id,
|
6841
6901
|
seriesId,
|
6902
|
+
sync,
|
6842
6903
|
type: log ? 'log' : 'linear',
|
6843
6904
|
base: logBase,
|
6844
6905
|
orient: 'right',
|
@@ -6942,7 +7003,7 @@
|
|
6942
7003
|
pivotIndicators_pivotIndicatorsAsRow,
|
6943
7004
|
datasetPivot,
|
6944
7005
|
pivotIndicators_pivotIndicators([
|
6945
|
-
|
7006
|
+
series([
|
6946
7007
|
initDualAxisPrimary,
|
6947
7008
|
dualChartTypePrimary,
|
6948
7009
|
datasetPrimary,
|
@@ -12588,6 +12649,7 @@
|
|
12588
12649
|
tooltip: zTooltip.nullish(),
|
12589
12650
|
legend: zLegend.nullish(),
|
12590
12651
|
dualChartType: schemas_array(zDualChartType).or(zDualChartType).nullish(),
|
12652
|
+
alignTicks: schemas_array(schemas_boolean()).or(schemas_boolean()).nullish(),
|
12591
12653
|
primaryYAxis: schemas_array(zYLinearAxis).or(zYLinearAxis).nullish(),
|
12592
12654
|
secondaryYAxis: schemas_array(zYLinearAxis).or(zYLinearAxis).nullish(),
|
12593
12655
|
xAxis: zXBandAxis.nullish(),
|
@@ -12760,6 +12822,7 @@
|
|
12760
12822
|
zSelector,
|
12761
12823
|
zSelectors
|
12762
12824
|
]).nullish(),
|
12825
|
+
barVisible: schemas_boolean().nullish(),
|
12763
12826
|
barColor: schemas_string().nullish(),
|
12764
12827
|
barColorOpacity: schemas_number().nullish(),
|
12765
12828
|
barBorderColor: schemas_string().nullish(),
|
@@ -12779,6 +12842,7 @@
|
|
12779
12842
|
zSelector,
|
12780
12843
|
zSelectors
|
12781
12844
|
]).nullish(),
|
12845
|
+
pointVisible: schemas_boolean().nullish(),
|
12782
12846
|
pointSize: schemas_number().nullish(),
|
12783
12847
|
pointColor: schemas_string().nullish(),
|
12784
12848
|
pointColorOpacity: schemas_number().nullish(),
|
@@ -12797,6 +12861,7 @@
|
|
12797
12861
|
zSelector,
|
12798
12862
|
zSelectors
|
12799
12863
|
]).nullish(),
|
12864
|
+
lineVisible: schemas_boolean().nullish(),
|
12800
12865
|
lineSmooth: schemas_boolean().nullish(),
|
12801
12866
|
lineColor: schemas_string().nullish(),
|
12802
12867
|
lineColorOpacity: schemas_number().nullish(),
|
@@ -12814,6 +12879,7 @@
|
|
12814
12879
|
zSelector,
|
12815
12880
|
zSelectors
|
12816
12881
|
]).nullish(),
|
12882
|
+
areaVisible: schemas_boolean().nullish(),
|
12817
12883
|
areaColor: schemas_string().nullish(),
|
12818
12884
|
areaColorOpacity: schemas_number().nullish()
|
12819
12885
|
});
|
@@ -12899,9 +12965,7 @@
|
|
12899
12965
|
literal('solid'),
|
12900
12966
|
literal('dashed'),
|
12901
12967
|
literal('dotted')
|
12902
|
-
]).default('dashed').nullish()
|
12903
|
-
offsetX: schemas_number().default(0),
|
12904
|
-
offsetY: schemas_number().default(0)
|
12968
|
+
]).default('dashed').nullish()
|
12905
12969
|
});
|
12906
12970
|
const zAnnotationHorizontalLine = schemas_object({
|
12907
12971
|
selector: union([
|
@@ -12951,9 +13015,7 @@
|
|
12951
13015
|
textBackgroundBorderColor: schemas_string().default('#212121').nullish(),
|
12952
13016
|
textBackgroundBorderRadius: schemas_number().default(4).nullish(),
|
12953
13017
|
textBackgroundBorderWidth: schemas_number().default(1).nullish(),
|
12954
|
-
textBackgroundPadding: schemas_number().default(2).nullish()
|
12955
|
-
offsetX: schemas_number().default(0),
|
12956
|
-
offsetY: schemas_number().default(0)
|
13018
|
+
textBackgroundPadding: schemas_number().default(2).nullish()
|
12957
13019
|
});
|
12958
13020
|
const zAnnotationArea = schemas_object({
|
12959
13021
|
selector: union([
|
@@ -12995,9 +13057,7 @@
|
|
12995
13057
|
areaBorderColor: schemas_string().default('#888888').nullish(),
|
12996
13058
|
areaBorderWidth: schemas_number().default(1).nullish(),
|
12997
13059
|
areaBorderRadius: schemas_number().default(4).nullish(),
|
12998
|
-
outerPadding: schemas_number().default(4).nullish()
|
12999
|
-
offsetX: schemas_number().default(0).nullish(),
|
13000
|
-
offsetY: schemas_number().default(0).nullish()
|
13060
|
+
outerPadding: schemas_number().default(4).nullish()
|
13001
13061
|
});
|
13002
13062
|
const zAnnotation = schemas_object({
|
13003
13063
|
annotationPoint: zAnnotationPoint.or(schemas_array(zAnnotationPoint)).nullish(),
|
@@ -13322,6 +13382,7 @@
|
|
13322
13382
|
measures: zMeasureTree.nullish(),
|
13323
13383
|
dualMeasures: zDualMeasures.nullish(),
|
13324
13384
|
dualChartType: schemas_array(zDualChartType).or(zDualChartType).nullish(),
|
13385
|
+
alignTicks: schemas_array(schemas_boolean()).or(schemas_boolean()).nullish(),
|
13325
13386
|
primaryYAxis: schemas_array(zYLinearAxis).or(zYLinearAxis).nullish(),
|
13326
13387
|
secondaryYAxis: schemas_array(zYLinearAxis).or(zYLinearAxis).nullish(),
|
13327
13388
|
xAxis: zXBandAxis.nullish(),
|