@visactor/vseed 0.0.37 → 0.0.38
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 +6 -24
- package/dist/index.cjs +98 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +98 -57
- package/dist/index.js.map +1 -1
- package/dist/pipeline/utils/constant.d.ts +2 -0
- package/dist/types/advancedVSeed.d.ts +2 -12
- package/dist/types/chartType/area/area.d.ts +11 -2
- package/dist/types/chartType/area/zArea.d.ts +0 -12
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +4 -0
- package/dist/types/chartType/areaPercent/zAreaPercent.d.ts +0 -12
- package/dist/types/chartType/areaRange/areaRange.d.ts +4 -0
- package/dist/types/chartType/areaRange/zAreaRange.d.ts +0 -12
- package/dist/types/chartType/bar/bar.d.ts +4 -0
- package/dist/types/chartType/bar/zBar.d.ts +0 -12
- package/dist/types/chartType/barParallel/barParallel.d.ts +4 -0
- package/dist/types/chartType/barParallel/zBarParallel.d.ts +0 -12
- package/dist/types/chartType/barPercent/barPercent.d.ts +4 -0
- package/dist/types/chartType/barPercent/zBarPercent.d.ts +0 -12
- package/dist/types/chartType/column/column.d.ts +4 -0
- package/dist/types/chartType/column/zColumn.d.ts +0 -12
- package/dist/types/chartType/columnParallel/columnParallel.d.ts +4 -0
- package/dist/types/chartType/columnParallel/zColumnParallel.d.ts +0 -12
- package/dist/types/chartType/columnPercent/columnPercent.d.ts +4 -0
- package/dist/types/chartType/columnPercent/zColumnPercent.d.ts +0 -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 +1 -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 +0 -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 +4 -0
- 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 +0 -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 +6 -21
- 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/measures/measures.d.ts +3 -0
- package/dist/types/properties/theme/customTheme.d.ts +2 -0
- package/dist/types/vseed.d.ts +1 -144
- package/dist/umd/index.js +98 -57
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -845,6 +845,9 @@ const initPivotTable = (spec, context)=>{
|
|
845
845
|
tooltip: {
|
846
846
|
isShowOverflowTextTooltip: true
|
847
847
|
},
|
848
|
+
corner: {
|
849
|
+
titleOnDimension: 'all'
|
850
|
+
},
|
848
851
|
widthAdaptiveMode: 'all',
|
849
852
|
animationAppear: {
|
850
853
|
duration: 300,
|
@@ -1707,22 +1710,44 @@ const color_color = (spec, context)=>{
|
|
1707
1710
|
const colorIdMap = unfoldInfo.colorIdMap;
|
1708
1711
|
const { color } = baseConfig;
|
1709
1712
|
const { colorScheme, colorMapping } = color;
|
1710
|
-
const mappingList = [];
|
1711
|
-
if (colorMapping) Object.entries(colorMapping).sort((a, b)=>a[0].split(Separator).length - b[0].split(Separator).length).forEach(([key, value])=>{
|
1712
|
-
const idMap = Object.entries(colorIdMap).filter(([_, v])=>v.includes(key));
|
1713
|
-
for (const [colorId] of idMap)mappingList.push([
|
1714
|
-
colorId,
|
1715
|
-
value
|
1716
|
-
]);
|
1717
|
-
});
|
1718
1713
|
result.color = {
|
1719
1714
|
type: 'ordinal',
|
1720
1715
|
domain: colorItems,
|
1721
1716
|
range: colorScheme,
|
1722
|
-
specified:
|
1717
|
+
specified: createSpecifiedForColorMapping(colorMapping, colorIdMap, colorItems)
|
1723
1718
|
};
|
1724
1719
|
return result;
|
1725
1720
|
};
|
1721
|
+
const createSpecifiedForColorMapping = (colorMapping, colorIdMap, colorItems)=>{
|
1722
|
+
if (!colorMapping || !colorIdMap || !colorItems) return;
|
1723
|
+
const matchedList = [];
|
1724
|
+
const colors = Object.entries(colorMapping).sort((a, b)=>b[0].length - a[0].length);
|
1725
|
+
const accurateMap = colors.reduce((prev, cur)=>{
|
1726
|
+
const name = cur[0];
|
1727
|
+
const colorValue = cur[1];
|
1728
|
+
const accurateMatchedList = Object.entries(colorIdMap).filter(([colorKey, colorAlias])=>colorKey === name || colorAlias === name);
|
1729
|
+
accurateMatchedList.forEach((item)=>{
|
1730
|
+
prev[item[0]] = colorValue;
|
1731
|
+
matchedList.push(name);
|
1732
|
+
});
|
1733
|
+
return prev;
|
1734
|
+
}, {});
|
1735
|
+
const fuzzyMap = colors.reduce((prev, cur)=>{
|
1736
|
+
const name = cur[0];
|
1737
|
+
const colorValue = cur[1];
|
1738
|
+
if (matchedList.includes(name)) return prev;
|
1739
|
+
const fuzzyMatchedList = Object.entries(colorIdMap).filter(([colorKey, colorAlias])=>colorKey.includes(name) || colorAlias.includes(name));
|
1740
|
+
fuzzyMatchedList.forEach((item)=>{
|
1741
|
+
if (prev[item[0]]) return;
|
1742
|
+
prev[item[0]] = colorValue;
|
1743
|
+
});
|
1744
|
+
return prev;
|
1745
|
+
}, {});
|
1746
|
+
return {
|
1747
|
+
...fuzzyMap,
|
1748
|
+
...accurateMap
|
1749
|
+
};
|
1750
|
+
};
|
1726
1751
|
const background_backgroundColor = (spec, context)=>{
|
1727
1752
|
const result = {
|
1728
1753
|
...spec
|
@@ -1889,6 +1914,8 @@ const xBand = (spec, context)=>{
|
|
1889
1914
|
};
|
1890
1915
|
const ANNOTATION_Z_INDEX = 1000;
|
1891
1916
|
const LINEAR_AXIS_INNER_OFFSET_TOP = 7;
|
1917
|
+
const DUAL_AXIS_CHART_COLUMN_Z_INDEX = 1000;
|
1918
|
+
const DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX = 1001;
|
1892
1919
|
const yLinear = (spec, context)=>{
|
1893
1920
|
const result = {
|
1894
1921
|
...spec
|
@@ -2382,7 +2409,12 @@ const pointStateDimensionHover = (spec)=>{
|
|
2382
2409
|
...point.state || {},
|
2383
2410
|
dimension_hover: {
|
2384
2411
|
scaleX: 1.4,
|
2385
|
-
scaleY: 1.4
|
2412
|
+
scaleY: 1.4,
|
2413
|
+
outerBorder: {
|
2414
|
+
lineWidth: 4,
|
2415
|
+
strokeOpacity: 0.25,
|
2416
|
+
distance: 2
|
2417
|
+
}
|
2386
2418
|
}
|
2387
2419
|
}
|
2388
2420
|
}
|
@@ -2557,13 +2589,11 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
2557
2589
|
insideEnd: 'insideEndTop'
|
2558
2590
|
};
|
2559
2591
|
const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
|
2560
|
-
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'
|
2592
|
+
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;
|
2561
2593
|
const dataset = advancedVSeed.dataset.flat();
|
2562
2594
|
const generateOneMarkLine = (x)=>({
|
2563
2595
|
x: x,
|
2564
2596
|
zIndex: ANNOTATION_Z_INDEX,
|
2565
|
-
offsetX,
|
2566
|
-
offsetY,
|
2567
2597
|
line: {
|
2568
2598
|
style: {
|
2569
2599
|
visible: lineVisible,
|
@@ -2656,12 +2686,10 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
2656
2686
|
insideEnd: 'insideEndTop'
|
2657
2687
|
};
|
2658
2688
|
const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
|
2659
|
-
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
|
2689
|
+
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;
|
2660
2690
|
const dataset = advancedVSeed.dataset.flat();
|
2661
2691
|
const generateOneMarkLine = (y)=>({
|
2662
2692
|
y,
|
2663
|
-
offsetX,
|
2664
|
-
offsetY,
|
2665
2693
|
zIndex: ANNOTATION_Z_INDEX,
|
2666
2694
|
line: {
|
2667
2695
|
style: {
|
@@ -2757,7 +2785,7 @@ const annotationArea_annotationArea = (spec, context)=>{
|
|
2757
2785
|
right: 'insideRight'
|
2758
2786
|
};
|
2759
2787
|
const markArea = annotationAreaList.flatMap((annotationArea)=>{
|
2760
|
-
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
|
2788
|
+
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;
|
2761
2789
|
const dataset = advancedVSeed.dataset.flat();
|
2762
2790
|
const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
|
2763
2791
|
const labelPosition = positionMap[textPosition || 'top'];
|
@@ -2765,8 +2793,6 @@ const annotationArea_annotationArea = (spec, context)=>{
|
|
2765
2793
|
return {
|
2766
2794
|
zIndex: ANNOTATION_Z_INDEX,
|
2767
2795
|
regionRelative: true,
|
2768
|
-
offsetX,
|
2769
|
-
offsetY,
|
2770
2796
|
positions: (data, context)=>{
|
2771
2797
|
const positionData = data.filter((item)=>selectedData.some((datum)=>isSubset(datum, item)));
|
2772
2798
|
const xyList = positionData.map((datum)=>context.dataToPosition(datum));
|
@@ -3186,11 +3212,11 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
3186
3212
|
label: d,
|
3187
3213
|
shape: {
|
3188
3214
|
outerBorder: border ? {
|
3189
|
-
stroke: colorScheme?.[index],
|
3215
|
+
stroke: colorScheme?.[index % colorScheme.length],
|
3190
3216
|
distance: 3,
|
3191
3217
|
lineWidth: 1
|
3192
3218
|
} : void 0,
|
3193
|
-
fill: colorScheme?.[index]
|
3219
|
+
fill: colorScheme?.[index % colorScheme.length]
|
3194
3220
|
}
|
3195
3221
|
})),
|
3196
3222
|
item: {
|
@@ -3603,14 +3629,12 @@ const annotationAreaBand = (spec, context)=>{
|
|
3603
3629
|
right: 'insideRight'
|
3604
3630
|
};
|
3605
3631
|
const markArea = annotationAreaList.flatMap((annotationArea)=>{
|
3606
|
-
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
|
3632
|
+
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;
|
3607
3633
|
const dataset = advancedVSeed.dataset.flat();
|
3608
3634
|
const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
|
3609
3635
|
return {
|
3610
3636
|
zIndex: ANNOTATION_Z_INDEX,
|
3611
3637
|
regionRelative: true,
|
3612
|
-
offsetX,
|
3613
|
-
offsetY,
|
3614
3638
|
positions: (data, context)=>{
|
3615
3639
|
const positionData = data.filter((item)=>selectedData.some((datum)=>isSubset(datum, item)));
|
3616
3640
|
const xyList = positionData.map((datum)=>context.dataToPosition(datum));
|
@@ -5685,6 +5709,7 @@ const dualAxisConfig = (advancedVSeed, context)=>{
|
|
5685
5709
|
'legend',
|
5686
5710
|
'tooltip',
|
5687
5711
|
'dualChartType',
|
5712
|
+
'alignTicks',
|
5688
5713
|
'primaryYAxis',
|
5689
5714
|
'secondaryYAxis',
|
5690
5715
|
'crosshairLine'
|
@@ -5837,7 +5862,8 @@ const initDualAxisSecondary = (spec, context)=>{
|
|
5837
5862
|
};
|
5838
5863
|
const dualChartTypePrimary = (spec, context)=>{
|
5839
5864
|
const result = {
|
5840
|
-
...spec
|
5865
|
+
...spec,
|
5866
|
+
zIndex: DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX
|
5841
5867
|
};
|
5842
5868
|
const { advancedVSeed, vseed } = context;
|
5843
5869
|
const { chartType } = vseed;
|
@@ -5848,12 +5874,16 @@ const dualChartTypePrimary = (spec, context)=>{
|
|
5848
5874
|
secondary: 'line'
|
5849
5875
|
};
|
5850
5876
|
const primary = Array.isArray(config) ? config[index].primary || config[0].primary : config.primary;
|
5851
|
-
|
5877
|
+
const secondary = Array.isArray(config) ? config[index].secondary || config[0].secondary : config.secondary;
|
5878
|
+
const bothColumn = 'column' === primary && 'column' === secondary;
|
5879
|
+
const type = bothColumn ? 'columnParallel' : primary;
|
5880
|
+
switch(type){
|
5852
5881
|
case 'line':
|
5853
5882
|
result.type = 'line';
|
5854
5883
|
break;
|
5855
5884
|
case 'column':
|
5856
5885
|
result.type = 'bar';
|
5886
|
+
result.zIndex = DUAL_AXIS_CHART_COLUMN_Z_INDEX;
|
5857
5887
|
break;
|
5858
5888
|
case 'columnParallel':
|
5859
5889
|
{
|
@@ -5864,6 +5894,7 @@ const dualChartTypePrimary = (spec, context)=>{
|
|
5864
5894
|
datasetReshapeInfo[0].unfoldInfo.groupId
|
5865
5895
|
];
|
5866
5896
|
columnSpec.type = 'bar';
|
5897
|
+
result.zIndex = DUAL_AXIS_CHART_COLUMN_Z_INDEX;
|
5867
5898
|
break;
|
5868
5899
|
}
|
5869
5900
|
case 'columnPercent':
|
@@ -5887,7 +5918,8 @@ const dualChartTypePrimary = (spec, context)=>{
|
|
5887
5918
|
};
|
5888
5919
|
const dualChartTypeSecondary = (spec, context)=>{
|
5889
5920
|
const result = {
|
5890
|
-
...spec
|
5921
|
+
...spec,
|
5922
|
+
zIndex: DUAL_AXIS_CHART_NON_COLUMN_Z_INDEX
|
5891
5923
|
};
|
5892
5924
|
const { advancedVSeed, vseed } = context;
|
5893
5925
|
const { chartType } = vseed;
|
@@ -5897,13 +5929,17 @@ const dualChartTypeSecondary = (spec, context)=>{
|
|
5897
5929
|
secondary: 'line'
|
5898
5930
|
};
|
5899
5931
|
const index = datasetReshapeInfo[0].index;
|
5932
|
+
const primary = Array.isArray(config) ? config[index].primary || config[0].primary : config.primary;
|
5900
5933
|
const secondary = Array.isArray(config) ? config[index].secondary || config[0].secondary : config.secondary;
|
5901
|
-
|
5934
|
+
const bothColumn = 'column' === primary && 'column' === secondary;
|
5935
|
+
const type = bothColumn ? 'columnParallel' : secondary;
|
5936
|
+
switch(type){
|
5902
5937
|
case 'line':
|
5903
5938
|
result.type = 'line';
|
5904
5939
|
break;
|
5905
5940
|
case 'column':
|
5906
5941
|
result.type = 'bar';
|
5942
|
+
result.zIndex = DUAL_AXIS_CHART_COLUMN_Z_INDEX;
|
5907
5943
|
break;
|
5908
5944
|
case 'columnParallel':
|
5909
5945
|
{
|
@@ -5914,6 +5950,7 @@ const dualChartTypeSecondary = (spec, context)=>{
|
|
5914
5950
|
datasetReshapeInfo[0].unfoldInfo.groupId
|
5915
5951
|
];
|
5916
5952
|
columnSpec.type = 'bar';
|
5953
|
+
result.zIndex = DUAL_AXIS_CHART_COLUMN_Z_INDEX;
|
5917
5954
|
break;
|
5918
5955
|
}
|
5919
5956
|
case 'columnPercent':
|
@@ -6252,12 +6289,18 @@ const yLinearPrimary = (spec, context)=>{
|
|
6252
6289
|
const { locale, datasetReshapeInfo } = advancedVSeed;
|
6253
6290
|
const index = datasetReshapeInfo[0].index;
|
6254
6291
|
const primaryYAxis = advancedVSeed.config?.[chartType]?.primaryYAxis;
|
6255
|
-
const
|
6292
|
+
const yAxisConfig = Array.isArray(primaryYAxis) ? primaryYAxis[index] || primaryYAxis[0] : primaryYAxis;
|
6293
|
+
const alignTicks = advancedVSeed.config?.[chartType]?.alignTicks;
|
6294
|
+
const alignTicksConfig = Array.isArray(alignTicks) ? alignTicks[index] || alignTicks[0] : alignTicks;
|
6256
6295
|
if (datasetReshapeInfo[0].foldInfoList?.[0] && isEmpty(datasetReshapeInfo[0].foldInfoList[0].foldMap)) return result;
|
6257
6296
|
const id = `${datasetReshapeInfo[0].id}-primary-axis`;
|
6258
|
-
const
|
6297
|
+
const seriesIds = [
|
6298
|
+
`${datasetReshapeInfo[0].id}-primary-series`,
|
6299
|
+
`${datasetReshapeInfo[0].id}-secondary-series`
|
6300
|
+
];
|
6301
|
+
const seriesId = alignTicksConfig ? seriesIds : seriesIds[0];
|
6259
6302
|
if (!result.axes) result.axes = [];
|
6260
|
-
if (!
|
6303
|
+
if (!yAxisConfig) {
|
6261
6304
|
result.axes = [
|
6262
6305
|
...result.axes,
|
6263
6306
|
{
|
@@ -6265,26 +6308,16 @@ const yLinearPrimary = (spec, context)=>{
|
|
6265
6308
|
id,
|
6266
6309
|
seriesId,
|
6267
6310
|
type: 'linear',
|
6268
|
-
orient: 'left'
|
6269
|
-
sync: {
|
6270
|
-
axisId: `${datasetReshapeInfo[0].id}-secondary-axis`,
|
6271
|
-
tickAlign: false,
|
6272
|
-
zeroAlign: true
|
6273
|
-
}
|
6311
|
+
orient: 'left'
|
6274
6312
|
}
|
6275
6313
|
];
|
6276
6314
|
return result;
|
6277
6315
|
}
|
6278
|
-
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10 } =
|
6316
|
+
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10 } = yAxisConfig;
|
6279
6317
|
const linearAxis = {
|
6280
6318
|
visible,
|
6281
6319
|
id,
|
6282
6320
|
seriesId,
|
6283
|
-
sync: {
|
6284
|
-
axisId: `${datasetReshapeInfo[0].id}-secondary-axis`,
|
6285
|
-
tickAlign: false,
|
6286
|
-
zeroAlign: true
|
6287
|
-
},
|
6288
6321
|
type: log ? 'log' : 'linear',
|
6289
6322
|
base: logBase,
|
6290
6323
|
orient: 'left',
|
@@ -6353,12 +6386,22 @@ const yLinearSecondary = (spec, context)=>{
|
|
6353
6386
|
const { locale, datasetReshapeInfo } = advancedVSeed;
|
6354
6387
|
const index = datasetReshapeInfo[0].index;
|
6355
6388
|
const secondaryYAxis = advancedVSeed.config?.[chartType]?.secondaryYAxis;
|
6356
|
-
const
|
6389
|
+
const yAxisConfig = Array.isArray(secondaryYAxis) ? secondaryYAxis[index] || secondaryYAxis[0] : secondaryYAxis;
|
6390
|
+
const alignTicks = advancedVSeed.config?.[chartType]?.alignTicks;
|
6391
|
+
const alignTicksConfig = Array.isArray(alignTicks) ? alignTicks[index] || alignTicks[0] : alignTicks;
|
6357
6392
|
if (isNullish(datasetReshapeInfo[0].foldInfoList?.[1])) return result;
|
6393
|
+
const sync = {
|
6394
|
+
axisId: `${datasetReshapeInfo[0].id}-primary-axis`,
|
6395
|
+
zeroAlign: true
|
6396
|
+
};
|
6358
6397
|
const id = `${datasetReshapeInfo[0].id}-secondary-axis`;
|
6359
|
-
const
|
6398
|
+
const seriesIds = [
|
6399
|
+
`${datasetReshapeInfo[0].id}-primary-series`,
|
6400
|
+
`${datasetReshapeInfo[0].id}-secondary-series`
|
6401
|
+
];
|
6402
|
+
const seriesId = alignTicksConfig ? seriesIds : seriesIds[1];
|
6360
6403
|
if (!result.axes) result.axes = [];
|
6361
|
-
if (!
|
6404
|
+
if (!yAxisConfig) {
|
6362
6405
|
result.axes = [
|
6363
6406
|
...result.axes,
|
6364
6407
|
{
|
@@ -6366,16 +6409,18 @@ const yLinearSecondary = (spec, context)=>{
|
|
6366
6409
|
id,
|
6367
6410
|
seriesId,
|
6368
6411
|
type: 'linear',
|
6369
|
-
orient: 'right'
|
6412
|
+
orient: 'right',
|
6413
|
+
sync
|
6370
6414
|
}
|
6371
6415
|
];
|
6372
6416
|
return result;
|
6373
6417
|
}
|
6374
|
-
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10 } =
|
6418
|
+
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min, log, logBase = 10 } = yAxisConfig;
|
6375
6419
|
const linearAxis = {
|
6376
6420
|
visible,
|
6377
6421
|
id,
|
6378
6422
|
seriesId,
|
6423
|
+
sync,
|
6379
6424
|
type: log ? 'log' : 'linear',
|
6380
6425
|
base: logBase,
|
6381
6426
|
orient: 'right',
|
@@ -8842,6 +8887,7 @@ const zDualAxisConfig = z.object({
|
|
8842
8887
|
tooltip: zTooltip.nullish(),
|
8843
8888
|
legend: zLegend.nullish(),
|
8844
8889
|
dualChartType: z.array(zDualChartType).or(zDualChartType).nullish(),
|
8890
|
+
alignTicks: z.array(z.boolean()).or(z.boolean()).nullish(),
|
8845
8891
|
primaryYAxis: z.array(zYLinearAxis).or(zYLinearAxis).nullish(),
|
8846
8892
|
secondaryYAxis: z.array(zYLinearAxis).or(zYLinearAxis).nullish(),
|
8847
8893
|
xAxis: zXBandAxis.nullish(),
|
@@ -9153,9 +9199,7 @@ const zAnnotationVerticalLine = z.object({
|
|
9153
9199
|
z.literal('solid'),
|
9154
9200
|
z.literal('dashed'),
|
9155
9201
|
z.literal('dotted')
|
9156
|
-
]).default('dashed').nullish()
|
9157
|
-
offsetX: z.number().default(0),
|
9158
|
-
offsetY: z.number().default(0)
|
9202
|
+
]).default('dashed').nullish()
|
9159
9203
|
});
|
9160
9204
|
const zAnnotationHorizontalLine = z.object({
|
9161
9205
|
selector: z.union([
|
@@ -9205,9 +9249,7 @@ const zAnnotationHorizontalLine = z.object({
|
|
9205
9249
|
textBackgroundBorderColor: z.string().default('#212121').nullish(),
|
9206
9250
|
textBackgroundBorderRadius: z.number().default(4).nullish(),
|
9207
9251
|
textBackgroundBorderWidth: z.number().default(1).nullish(),
|
9208
|
-
textBackgroundPadding: z.number().default(2).nullish()
|
9209
|
-
offsetX: z.number().default(0),
|
9210
|
-
offsetY: z.number().default(0)
|
9252
|
+
textBackgroundPadding: z.number().default(2).nullish()
|
9211
9253
|
});
|
9212
9254
|
const zAnnotationArea = z.object({
|
9213
9255
|
selector: z.union([
|
@@ -9249,9 +9291,7 @@ const zAnnotationArea = z.object({
|
|
9249
9291
|
areaBorderColor: z.string().default('#888888').nullish(),
|
9250
9292
|
areaBorderWidth: z.number().default(1).nullish(),
|
9251
9293
|
areaBorderRadius: z.number().default(4).nullish(),
|
9252
|
-
outerPadding: z.number().default(4).nullish()
|
9253
|
-
offsetX: z.number().default(0).nullish(),
|
9254
|
-
offsetY: z.number().default(0).nullish()
|
9294
|
+
outerPadding: z.number().default(4).nullish()
|
9255
9295
|
});
|
9256
9296
|
const zAnnotation = z.object({
|
9257
9297
|
annotationPoint: zAnnotationPoint.or(z.array(zAnnotationPoint)).nullish(),
|
@@ -9576,6 +9616,7 @@ const zDualAxis = z.object({
|
|
9576
9616
|
measures: zMeasureTree.nullish(),
|
9577
9617
|
dualMeasures: zDualMeasures.nullish(),
|
9578
9618
|
dualChartType: z.array(zDualChartType).or(zDualChartType).nullish(),
|
9619
|
+
alignTicks: z.array(z.boolean()).or(z.boolean()).nullish(),
|
9579
9620
|
primaryYAxis: z.array(zYLinearAxis).or(zYLinearAxis).nullish(),
|
9580
9621
|
secondaryYAxis: z.array(zYLinearAxis).or(zYLinearAxis).nullish(),
|
9581
9622
|
xAxis: zXBandAxis.nullish(),
|