@visactor/vseed 0.0.31 → 0.0.33
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 +18 -18
- package/dist/index.cjs +68 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +68 -58
- package/dist/index.js.map +1 -1
- package/dist/types/advancedVSeed.d.ts +40 -40
- package/dist/types/chartType/area/area.d.ts +40 -40
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +40 -40
- package/dist/types/chartType/areaRange/areaRange.d.ts +40 -40
- package/dist/types/chartType/bar/bar.d.ts +40 -40
- package/dist/types/chartType/barParallel/barParallel.d.ts +40 -40
- package/dist/types/chartType/barPercent/barPercent.d.ts +40 -40
- package/dist/types/chartType/column/column.d.ts +40 -40
- package/dist/types/chartType/columnParallel/columnParallel.d.ts +40 -40
- package/dist/types/chartType/columnPercent/columnPercent.d.ts +40 -40
- package/dist/types/chartType/line/line.d.ts +40 -40
- package/dist/types/chartType/scatter/scatter.d.ts +40 -40
- package/dist/types/properties/annotation/annotation.d.ts +40 -40
- package/dist/types/properties/annotation/annotationArea.d.ts +27 -34
- package/dist/types/properties/annotation/annotationHorizontalLine.d.ts +32 -34
- package/dist/types/properties/annotation/annotationPoint.d.ts +24 -22
- package/dist/types/properties/annotation/annotationVerticalLine.d.ts +33 -38
- package/dist/types/vseed.d.ts +440 -440
- package/dist/umd/index.js +68 -58
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
@@ -3240,8 +3240,8 @@ export declare class Builder implements VSeedBuilder {
|
|
3240
3240
|
backgroundVisible?: boolean | undefined;
|
3241
3241
|
backgroundColor?: string | undefined;
|
3242
3242
|
backgroundBorderColor?: string | undefined;
|
3243
|
-
backgroundBorderWidth?: number | undefined;
|
3244
3243
|
backgroundBorderRadius?: number | undefined;
|
3244
|
+
backgroundBorderWidth?: number | undefined;
|
3245
3245
|
backgroundPadding?: number | undefined;
|
3246
3246
|
} | {
|
3247
3247
|
offsetX: number;
|
@@ -3282,8 +3282,8 @@ export declare class Builder implements VSeedBuilder {
|
|
3282
3282
|
backgroundVisible?: boolean | undefined;
|
3283
3283
|
backgroundColor?: string | undefined;
|
3284
3284
|
backgroundBorderColor?: string | undefined;
|
3285
|
-
backgroundBorderWidth?: number | undefined;
|
3286
3285
|
backgroundBorderRadius?: number | undefined;
|
3286
|
+
backgroundBorderWidth?: number | undefined;
|
3287
3287
|
backgroundPadding?: number | undefined;
|
3288
3288
|
}[] | undefined;
|
3289
3289
|
annotationHorizontalLine?: {
|
@@ -3325,8 +3325,8 @@ export declare class Builder implements VSeedBuilder {
|
|
3325
3325
|
backgroundVisible?: boolean | undefined;
|
3326
3326
|
backgroundColor?: string | undefined;
|
3327
3327
|
backgroundBorderColor?: string | undefined;
|
3328
|
-
backgroundBorderWidth?: number | undefined;
|
3329
3328
|
backgroundBorderRadius?: number | undefined;
|
3329
|
+
backgroundBorderWidth?: number | undefined;
|
3330
3330
|
backgroundPadding?: number | undefined;
|
3331
3331
|
} | {
|
3332
3332
|
offsetX: number;
|
@@ -3367,8 +3367,8 @@ export declare class Builder implements VSeedBuilder {
|
|
3367
3367
|
backgroundVisible?: boolean | undefined;
|
3368
3368
|
backgroundColor?: string | undefined;
|
3369
3369
|
backgroundBorderColor?: string | undefined;
|
3370
|
-
backgroundBorderWidth?: number | undefined;
|
3371
3370
|
backgroundBorderRadius?: number | undefined;
|
3371
|
+
backgroundBorderWidth?: number | undefined;
|
3372
3372
|
backgroundPadding?: number | undefined;
|
3373
3373
|
}[] | undefined;
|
3374
3374
|
annotationArea?: {
|
@@ -3408,7 +3408,7 @@ export declare class Builder implements VSeedBuilder {
|
|
3408
3408
|
backgroundPadding?: number | undefined;
|
3409
3409
|
areaColor?: string | undefined;
|
3410
3410
|
areaColorOpacity?: number | undefined;
|
3411
|
-
areaBorderColor?:
|
3411
|
+
areaBorderColor?: string | undefined;
|
3412
3412
|
areaBorderWidth?: number | undefined;
|
3413
3413
|
areaBorderRadius?: number | undefined;
|
3414
3414
|
outerPadding?: number | undefined;
|
@@ -3451,7 +3451,7 @@ export declare class Builder implements VSeedBuilder {
|
|
3451
3451
|
backgroundPadding?: number | undefined;
|
3452
3452
|
areaColor?: string | undefined;
|
3453
3453
|
areaColorOpacity?: number | undefined;
|
3454
|
-
areaBorderColor?:
|
3454
|
+
areaBorderColor?: string | undefined;
|
3455
3455
|
areaBorderWidth?: number | undefined;
|
3456
3456
|
areaBorderRadius?: number | undefined;
|
3457
3457
|
outerPadding?: number | undefined;
|
@@ -9548,8 +9548,8 @@ export declare class Builder implements VSeedBuilder {
|
|
9548
9548
|
backgroundVisible?: boolean | undefined;
|
9549
9549
|
backgroundColor?: string | undefined;
|
9550
9550
|
backgroundBorderColor?: string | undefined;
|
9551
|
-
backgroundBorderWidth?: number | undefined;
|
9552
9551
|
backgroundBorderRadius?: number | undefined;
|
9552
|
+
backgroundBorderWidth?: number | undefined;
|
9553
9553
|
backgroundPadding?: number | undefined;
|
9554
9554
|
} | {
|
9555
9555
|
offsetX: number;
|
@@ -9590,8 +9590,8 @@ export declare class Builder implements VSeedBuilder {
|
|
9590
9590
|
backgroundVisible?: boolean | undefined;
|
9591
9591
|
backgroundColor?: string | undefined;
|
9592
9592
|
backgroundBorderColor?: string | undefined;
|
9593
|
-
backgroundBorderWidth?: number | undefined;
|
9594
9593
|
backgroundBorderRadius?: number | undefined;
|
9594
|
+
backgroundBorderWidth?: number | undefined;
|
9595
9595
|
backgroundPadding?: number | undefined;
|
9596
9596
|
}[] | undefined;
|
9597
9597
|
annotationHorizontalLine?: {
|
@@ -9633,8 +9633,8 @@ export declare class Builder implements VSeedBuilder {
|
|
9633
9633
|
backgroundVisible?: boolean | undefined;
|
9634
9634
|
backgroundColor?: string | undefined;
|
9635
9635
|
backgroundBorderColor?: string | undefined;
|
9636
|
-
backgroundBorderWidth?: number | undefined;
|
9637
9636
|
backgroundBorderRadius?: number | undefined;
|
9637
|
+
backgroundBorderWidth?: number | undefined;
|
9638
9638
|
backgroundPadding?: number | undefined;
|
9639
9639
|
} | {
|
9640
9640
|
offsetX: number;
|
@@ -9675,8 +9675,8 @@ export declare class Builder implements VSeedBuilder {
|
|
9675
9675
|
backgroundVisible?: boolean | undefined;
|
9676
9676
|
backgroundColor?: string | undefined;
|
9677
9677
|
backgroundBorderColor?: string | undefined;
|
9678
|
-
backgroundBorderWidth?: number | undefined;
|
9679
9678
|
backgroundBorderRadius?: number | undefined;
|
9679
|
+
backgroundBorderWidth?: number | undefined;
|
9680
9680
|
backgroundPadding?: number | undefined;
|
9681
9681
|
}[] | undefined;
|
9682
9682
|
annotationArea?: {
|
@@ -9716,7 +9716,7 @@ export declare class Builder implements VSeedBuilder {
|
|
9716
9716
|
backgroundPadding?: number | undefined;
|
9717
9717
|
areaColor?: string | undefined;
|
9718
9718
|
areaColorOpacity?: number | undefined;
|
9719
|
-
areaBorderColor?:
|
9719
|
+
areaBorderColor?: string | undefined;
|
9720
9720
|
areaBorderWidth?: number | undefined;
|
9721
9721
|
areaBorderRadius?: number | undefined;
|
9722
9722
|
outerPadding?: number | undefined;
|
@@ -9759,7 +9759,7 @@ export declare class Builder implements VSeedBuilder {
|
|
9759
9759
|
backgroundPadding?: number | undefined;
|
9760
9760
|
areaColor?: string | undefined;
|
9761
9761
|
areaColorOpacity?: number | undefined;
|
9762
|
-
areaBorderColor?:
|
9762
|
+
areaBorderColor?: string | undefined;
|
9763
9763
|
areaBorderWidth?: number | undefined;
|
9764
9764
|
areaBorderRadius?: number | undefined;
|
9765
9765
|
outerPadding?: number | undefined;
|
@@ -13002,8 +13002,8 @@ export declare class Builder implements VSeedBuilder {
|
|
13002
13002
|
backgroundVisible?: boolean | undefined;
|
13003
13003
|
backgroundColor?: string | undefined;
|
13004
13004
|
backgroundBorderColor?: string | undefined;
|
13005
|
-
backgroundBorderWidth?: number | undefined;
|
13006
13005
|
backgroundBorderRadius?: number | undefined;
|
13006
|
+
backgroundBorderWidth?: number | undefined;
|
13007
13007
|
backgroundPadding?: number | undefined;
|
13008
13008
|
} | {
|
13009
13009
|
offsetX: number;
|
@@ -13044,8 +13044,8 @@ export declare class Builder implements VSeedBuilder {
|
|
13044
13044
|
backgroundVisible?: boolean | undefined;
|
13045
13045
|
backgroundColor?: string | undefined;
|
13046
13046
|
backgroundBorderColor?: string | undefined;
|
13047
|
-
backgroundBorderWidth?: number | undefined;
|
13048
13047
|
backgroundBorderRadius?: number | undefined;
|
13048
|
+
backgroundBorderWidth?: number | undefined;
|
13049
13049
|
backgroundPadding?: number | undefined;
|
13050
13050
|
}[] | undefined;
|
13051
13051
|
annotationHorizontalLine?: {
|
@@ -13087,8 +13087,8 @@ export declare class Builder implements VSeedBuilder {
|
|
13087
13087
|
backgroundVisible?: boolean | undefined;
|
13088
13088
|
backgroundColor?: string | undefined;
|
13089
13089
|
backgroundBorderColor?: string | undefined;
|
13090
|
-
backgroundBorderWidth?: number | undefined;
|
13091
13090
|
backgroundBorderRadius?: number | undefined;
|
13091
|
+
backgroundBorderWidth?: number | undefined;
|
13092
13092
|
backgroundPadding?: number | undefined;
|
13093
13093
|
} | {
|
13094
13094
|
offsetX: number;
|
@@ -13129,8 +13129,8 @@ export declare class Builder implements VSeedBuilder {
|
|
13129
13129
|
backgroundVisible?: boolean | undefined;
|
13130
13130
|
backgroundColor?: string | undefined;
|
13131
13131
|
backgroundBorderColor?: string | undefined;
|
13132
|
-
backgroundBorderWidth?: number | undefined;
|
13133
13132
|
backgroundBorderRadius?: number | undefined;
|
13133
|
+
backgroundBorderWidth?: number | undefined;
|
13134
13134
|
backgroundPadding?: number | undefined;
|
13135
13135
|
}[] | undefined;
|
13136
13136
|
annotationArea?: {
|
@@ -13170,7 +13170,7 @@ export declare class Builder implements VSeedBuilder {
|
|
13170
13170
|
backgroundPadding?: number | undefined;
|
13171
13171
|
areaColor?: string | undefined;
|
13172
13172
|
areaColorOpacity?: number | undefined;
|
13173
|
-
areaBorderColor?:
|
13173
|
+
areaBorderColor?: string | undefined;
|
13174
13174
|
areaBorderWidth?: number | undefined;
|
13175
13175
|
areaBorderRadius?: number | undefined;
|
13176
13176
|
outerPadding?: number | undefined;
|
@@ -13213,7 +13213,7 @@ export declare class Builder implements VSeedBuilder {
|
|
13213
13213
|
backgroundPadding?: number | undefined;
|
13214
13214
|
areaColor?: string | undefined;
|
13215
13215
|
areaColorOpacity?: number | undefined;
|
13216
|
-
areaBorderColor?:
|
13216
|
+
areaBorderColor?: string | undefined;
|
13217
13217
|
areaBorderWidth?: number | undefined;
|
13218
13218
|
areaBorderRadius?: number | undefined;
|
13219
13219
|
outerPadding?: number | undefined;
|
package/dist/index.cjs
CHANGED
@@ -400,7 +400,7 @@ const autoMeasures = (advancedVSeed, context)=>{
|
|
400
400
|
const { measures, dataset } = vseed;
|
401
401
|
if (!dataset) throw new Error('dataset is required');
|
402
402
|
if (0 === dataset.length) return result;
|
403
|
-
if (measures
|
403
|
+
if (measures) {
|
404
404
|
result.measures = measures;
|
405
405
|
return result;
|
406
406
|
}
|
@@ -480,7 +480,7 @@ const autoDimensions = (advancedVSeed, context)=>{
|
|
480
480
|
const measures = findAllMeasures(advancedVSeed.measures);
|
481
481
|
if (!dataset) throw new Error('dataset is required');
|
482
482
|
if (0 === dataset.length) return result;
|
483
|
-
if (dimensions
|
483
|
+
if (dimensions) {
|
484
484
|
result.dimensions = dimensions;
|
485
485
|
return result;
|
486
486
|
}
|
@@ -777,7 +777,7 @@ const autoPivotMeasures = (advancedVSeed, context)=>{
|
|
777
777
|
const measures = findAllMeasures(vseed.measures);
|
778
778
|
if (!dataset) throw new Error('dataset is required');
|
779
779
|
if (0 === dataset.length) return result;
|
780
|
-
if (measures
|
780
|
+
if (measures) {
|
781
781
|
result.measures = findAllMeasures(measures);
|
782
782
|
return result;
|
783
783
|
}
|
@@ -840,7 +840,7 @@ const autoPivotDimensions = (advancedVSeed, context)=>{
|
|
840
840
|
const measures = findAllMeasures(advancedVSeed.measures);
|
841
841
|
if (!dataset) throw new Error('dataset is required');
|
842
842
|
if (0 === dataset.length) return result;
|
843
|
-
if (dimensions
|
843
|
+
if (dimensions) {
|
844
844
|
const newDimensions = findAllDimensions(dimensions);
|
845
845
|
result.dimensions = newDimensions.map((item, index)=>{
|
846
846
|
if ('rowDimension' === item.location || 'columnDimension' === item.location) return item;
|
@@ -1431,7 +1431,7 @@ const encodingXY = (advancedVSeed)=>{
|
|
1431
1431
|
};
|
1432
1432
|
const { datasetReshapeInfo, dimensions } = advancedVSeed;
|
1433
1433
|
if (!datasetReshapeInfo || !dimensions) return result;
|
1434
|
-
const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
1434
|
+
const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location) || dimensions[0];
|
1435
1435
|
const isZeroDimension = 0 === dimensions.length;
|
1436
1436
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
1437
1437
|
const { foldInfo, unfoldInfo } = cur;
|
@@ -2179,7 +2179,7 @@ const discreteLegend = (spec, context)=>{
|
|
2179
2179
|
const baseConfig = advancedVSeed.config[chartType];
|
2180
2180
|
if (!baseConfig || !baseConfig.legend) return result;
|
2181
2181
|
const { legend } = baseConfig;
|
2182
|
-
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight, maxSize, border, shapeType = 'rectRound' } = legend || {};
|
2182
|
+
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
|
2183
2183
|
const orient = [
|
2184
2184
|
'bottom',
|
2185
2185
|
'bottomLeft',
|
@@ -2221,8 +2221,8 @@ const discreteLegend = (spec, context)=>{
|
|
2221
2221
|
result.legends = {
|
2222
2222
|
type: 'discrete',
|
2223
2223
|
visible: enable,
|
2224
|
-
maxCol: maxSize,
|
2225
|
-
maxRow: maxSize,
|
2224
|
+
maxCol: Math.max(1, maxSize),
|
2225
|
+
maxRow: Math.max(1, maxSize),
|
2226
2226
|
autoPage: true,
|
2227
2227
|
orient,
|
2228
2228
|
position: legendPosition,
|
@@ -2236,7 +2236,7 @@ const discreteLegend = (spec, context)=>{
|
|
2236
2236
|
}) : void 0,
|
2237
2237
|
item: {
|
2238
2238
|
focus: true,
|
2239
|
-
maxWidth:
|
2239
|
+
maxWidth: '30%',
|
2240
2240
|
focusIconStyle: {
|
2241
2241
|
size: labelFontSize + 2,
|
2242
2242
|
fill: labelFontColor,
|
@@ -2528,7 +2528,7 @@ const annotationPoint_annotationPoint = (spec, context)=>{
|
|
2528
2528
|
annotationPoint
|
2529
2529
|
];
|
2530
2530
|
const markPoint = annotationPointList.flatMap((annotationPoint)=>{
|
2531
|
-
const { selector: selectorPoint, text = '', textColor = '#
|
2531
|
+
const { selector: selectorPoint, text = '', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true, offsetX = 0, offsetY = 0 } = annotationPoint;
|
2532
2532
|
const dataset = advancedVSeed.dataset.flat();
|
2533
2533
|
const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
|
2534
2534
|
return selectedData.map((datum)=>({
|
@@ -2560,7 +2560,8 @@ const annotationPoint_annotationPoint = (spec, context)=>{
|
|
2560
2560
|
stroke: backgroundColor,
|
2561
2561
|
lineWidth: 1,
|
2562
2562
|
fontSize: textFontSize,
|
2563
|
-
fontWeight: textFontWeight
|
2563
|
+
fontWeight: textFontWeight,
|
2564
|
+
dy: textFontSize
|
2564
2565
|
},
|
2565
2566
|
labelBackground: {
|
2566
2567
|
visible: backgroundVisible,
|
@@ -2569,7 +2570,8 @@ const annotationPoint_annotationPoint = (spec, context)=>{
|
|
2569
2570
|
cornerRadius: backgroundBorderRadius ?? 4,
|
2570
2571
|
fill: backgroundColor,
|
2571
2572
|
stroke: backgroundBorderColor,
|
2572
|
-
lineWidth: backgroundBorderWidth
|
2573
|
+
lineWidth: backgroundBorderWidth,
|
2574
|
+
dy: textFontSize
|
2573
2575
|
}
|
2574
2576
|
}
|
2575
2577
|
}
|
@@ -2598,7 +2600,7 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
2598
2600
|
insideEnd: 'insideEndTop'
|
2599
2601
|
};
|
2600
2602
|
const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
|
2601
|
-
const { selector: selectorPoint, xValue, text = '', textPosition = 'insideEnd', textColor = '#
|
2603
|
+
const { selector: selectorPoint, xValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'right', textBaseline = 'top', backgroundVisible = true, backgroundBorderColor = '#212121', backgroundColor = '#212121', backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundPadding = 2, lineVisible = true, lineColor = '#212121', lineWidth = 1, lineStyle = 'dashed', offsetX = 0, offsetY = 0 } = annotationVerticalLine;
|
2602
2604
|
const dataset = advancedVSeed.dataset.flat();
|
2603
2605
|
const generateOneMarkLine = (x)=>({
|
2604
2606
|
x: x,
|
@@ -2640,6 +2642,7 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
2640
2642
|
visible: backgroundVisible,
|
2641
2643
|
padding: backgroundPadding,
|
2642
2644
|
style: {
|
2645
|
+
dy: textFontSize,
|
2643
2646
|
cornerRadius: backgroundBorderRadius ?? 4,
|
2644
2647
|
fill: backgroundColor,
|
2645
2648
|
stroke: backgroundBorderColor,
|
@@ -2649,6 +2652,7 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
2649
2652
|
},
|
2650
2653
|
endSymbol: {
|
2651
2654
|
visible: true,
|
2655
|
+
size: 10 + lineWidth,
|
2652
2656
|
style: {
|
2653
2657
|
dy: 4,
|
2654
2658
|
fill: lineColor
|
@@ -2695,7 +2699,7 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
2695
2699
|
insideEnd: 'insideEndTop'
|
2696
2700
|
};
|
2697
2701
|
const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
|
2698
|
-
const { selector: selectorPoint, yValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = '
|
2702
|
+
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, backgroundVisible = true, backgroundColor = '#212121', backgroundBorderColor = '#212121', backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundPadding = 2, offsetX = 0, offsetY = 0 } = annotationVerticalLine;
|
2699
2703
|
const dataset = advancedVSeed.dataset.flat();
|
2700
2704
|
const generateOneMarkLine = (y)=>({
|
2701
2705
|
y,
|
@@ -2737,6 +2741,7 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
2737
2741
|
visible: backgroundVisible,
|
2738
2742
|
padding: backgroundPadding,
|
2739
2743
|
style: {
|
2744
|
+
dy: textFontSize,
|
2740
2745
|
cornerRadius: backgroundBorderRadius ?? 4,
|
2741
2746
|
fill: backgroundColor,
|
2742
2747
|
stroke: backgroundBorderColor,
|
@@ -2746,6 +2751,7 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
2746
2751
|
},
|
2747
2752
|
endSymbol: {
|
2748
2753
|
visible: true,
|
2754
|
+
size: 10 + lineWidth,
|
2749
2755
|
style: {
|
2750
2756
|
dx: -4,
|
2751
2757
|
fill: lineColor
|
@@ -2794,7 +2800,7 @@ const annotationArea_annotationArea = (spec, context)=>{
|
|
2794
2800
|
right: 'insideRight'
|
2795
2801
|
};
|
2796
2802
|
const markArea = annotationAreaList.flatMap((annotationArea)=>{
|
2797
|
-
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top',
|
2803
|
+
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundVisible = true, backgroundColor = '#191d24', backgroundBorderColor = '#191d24', backgroundBorderWidth = 1, backgroundBorderRadius = 4, backgroundPadding = 4, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor = '#888888', areaBorderRadius = 4, areaBorderWidth = 1, outerPadding = 4, offsetX = 0, offsetY = 0 } = annotationArea;
|
2798
2804
|
const dataset = advancedVSeed.dataset.flat();
|
2799
2805
|
const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
|
2800
2806
|
return {
|
@@ -2864,6 +2870,7 @@ const annotationArea_annotationArea = (spec, context)=>{
|
|
2864
2870
|
visible: true,
|
2865
2871
|
text: text,
|
2866
2872
|
style: {
|
2873
|
+
dy: textFontSize,
|
2867
2874
|
textAlign: textAlign,
|
2868
2875
|
textBaseline: textBaseline,
|
2869
2876
|
fill: textColor,
|
@@ -2876,6 +2883,7 @@ const annotationArea_annotationArea = (spec, context)=>{
|
|
2876
2883
|
visible: backgroundVisible,
|
2877
2884
|
padding: backgroundPadding,
|
2878
2885
|
style: {
|
2886
|
+
dy: textFontSize,
|
2879
2887
|
cornerRadius: backgroundBorderRadius ?? 4,
|
2880
2888
|
fill: backgroundColor,
|
2881
2889
|
stroke: backgroundBorderColor,
|
@@ -3169,7 +3177,7 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
3169
3177
|
}), {});
|
3170
3178
|
const { legend, color } = baseConfig;
|
3171
3179
|
const { colorScheme } = color;
|
3172
|
-
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400, maxSize, border, shapeType = 'rectRound' } = legend || {};
|
3180
|
+
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight = 400, maxSize = 1, border, shapeType = 'rectRound' } = legend || {};
|
3173
3181
|
const orient = [
|
3174
3182
|
'bottom',
|
3175
3183
|
'bottomLeft',
|
@@ -3213,8 +3221,8 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
3213
3221
|
type: 'discrete',
|
3214
3222
|
orient,
|
3215
3223
|
position: legendPosition,
|
3216
|
-
maxCol: maxSize,
|
3217
|
-
maxRow: maxSize,
|
3224
|
+
maxCol: Math.max(1, maxSize),
|
3225
|
+
maxRow: Math.max(1, maxSize),
|
3218
3226
|
data: colorItems.map((d, index)=>({
|
3219
3227
|
label: d,
|
3220
3228
|
shape: {
|
@@ -3228,7 +3236,7 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
3228
3236
|
})),
|
3229
3237
|
item: {
|
3230
3238
|
focus: true,
|
3231
|
-
maxWidth:
|
3239
|
+
maxWidth: '30%',
|
3232
3240
|
focusIconStyle: {
|
3233
3241
|
size: labelFontSize + 2,
|
3234
3242
|
fill: labelFontColor,
|
@@ -3631,7 +3639,7 @@ const annotationAreaBand = (spec, context)=>{
|
|
3631
3639
|
right: 'insideRight'
|
3632
3640
|
};
|
3633
3641
|
const markArea = annotationAreaList.flatMap((annotationArea)=>{
|
3634
|
-
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top',
|
3642
|
+
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundVisible = true, backgroundColor = '#191d24', backgroundBorderColor = '#191d24', backgroundBorderWidth = 1, backgroundBorderRadius = 4, backgroundPadding = 4, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor = '#888888', areaBorderRadius = 4, areaBorderWidth = 1, outerPadding = 4, offsetX = 0, offsetY = 0 } = annotationArea;
|
3635
3643
|
const dataset = advancedVSeed.dataset.flat();
|
3636
3644
|
const selectedData = selectorPoint ? dataset.filter((datum)=>selector_selector(datum, selectorPoint)) : [];
|
3637
3645
|
return {
|
@@ -3705,6 +3713,7 @@ const annotationAreaBand = (spec, context)=>{
|
|
3705
3713
|
visible: true,
|
3706
3714
|
text: text,
|
3707
3715
|
style: {
|
3716
|
+
dy: textFontSize,
|
3708
3717
|
textAlign: textAlign,
|
3709
3718
|
textBaseline: textBaseline,
|
3710
3719
|
stroke: backgroundColor,
|
@@ -3717,6 +3726,7 @@ const annotationAreaBand = (spec, context)=>{
|
|
3717
3726
|
visible: backgroundVisible,
|
3718
3727
|
padding: backgroundPadding,
|
3719
3728
|
style: {
|
3729
|
+
dy: textFontSize,
|
3720
3730
|
cornerRadius: backgroundBorderRadius ?? 4,
|
3721
3731
|
fill: backgroundColor,
|
3722
3732
|
stroke: backgroundBorderColor,
|
@@ -3978,7 +3988,7 @@ const encodingYX = (advancedVSeed)=>{
|
|
3978
3988
|
};
|
3979
3989
|
const { datasetReshapeInfo, dimensions } = advancedVSeed;
|
3980
3990
|
if (!datasetReshapeInfo || !dimensions) return result;
|
3981
|
-
const yDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
3991
|
+
const yDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location) || dimensions[0];
|
3982
3992
|
const isZeroDimension = 0 === dimensions.length;
|
3983
3993
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
3984
3994
|
const { foldInfo, unfoldInfo } = cur;
|
@@ -4898,8 +4908,8 @@ const encodingXYY = (advancedVSeed)=>{
|
|
4898
4908
|
const result = {
|
4899
4909
|
...advancedVSeed
|
4900
4910
|
};
|
4901
|
-
const { datasetReshapeInfo,
|
4902
|
-
if (!datasetReshapeInfo || !
|
4911
|
+
const { datasetReshapeInfo, measures } = advancedVSeed;
|
4912
|
+
if (!datasetReshapeInfo || !measures) return result;
|
4903
4913
|
const encoding = datasetReshapeInfo.reduce((prev, cur, index)=>{
|
4904
4914
|
const measure = measures[index];
|
4905
4915
|
if ('children' in measure) {
|
@@ -5634,8 +5644,8 @@ const encodingPie = (advancedVSeed)=>{
|
|
5634
5644
|
const result = {
|
5635
5645
|
...advancedVSeed
|
5636
5646
|
};
|
5637
|
-
const { datasetReshapeInfo
|
5638
|
-
if (!datasetReshapeInfo
|
5647
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
5648
|
+
if (!datasetReshapeInfo) return result;
|
5639
5649
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
5640
5650
|
const { foldInfo, unfoldInfo } = cur;
|
5641
5651
|
const radius = [
|
@@ -5854,7 +5864,7 @@ const encodingRose = (advancedVSeed)=>{
|
|
5854
5864
|
};
|
5855
5865
|
const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
|
5856
5866
|
if (!datasetReshapeInfo || !dimensions || !measures) return result;
|
5857
|
-
const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
5867
|
+
const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location) || dimensions[0];
|
5858
5868
|
const is1D1M = 1 === dimensions.length && 1 === measures.length;
|
5859
5869
|
const isZeroDimension = 0 === dimensions.length;
|
5860
5870
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
@@ -6168,7 +6178,7 @@ const encodingAR = (advancedVSeed)=>{
|
|
6168
6178
|
};
|
6169
6179
|
const { datasetReshapeInfo, dimensions, measures } = advancedVSeed;
|
6170
6180
|
if (!datasetReshapeInfo || !dimensions || !measures) return result;
|
6171
|
-
const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
6181
|
+
const angleDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location) || dimensions[0];
|
6172
6182
|
const isZeroDimension = 0 === dimensions.length;
|
6173
6183
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
6174
6184
|
const { foldInfo, unfoldInfo } = cur;
|
@@ -6341,8 +6351,8 @@ const encodingFunnel = (advancedVSeed)=>{
|
|
6341
6351
|
const result = {
|
6342
6352
|
...advancedVSeed
|
6343
6353
|
};
|
6344
|
-
const { datasetReshapeInfo
|
6345
|
-
if (!datasetReshapeInfo
|
6354
|
+
const { datasetReshapeInfo } = advancedVSeed;
|
6355
|
+
if (!datasetReshapeInfo) return result;
|
6346
6356
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
6347
6357
|
const { foldInfo, unfoldInfo } = cur;
|
6348
6358
|
const size = [
|
@@ -6554,7 +6564,7 @@ const encodingMatrix = (advancedVSeed)=>{
|
|
6554
6564
|
};
|
6555
6565
|
const { datasetReshapeInfo, dimensions } = advancedVSeed;
|
6556
6566
|
if (!datasetReshapeInfo || !dimensions) return result;
|
6557
|
-
const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
6567
|
+
const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location) || dimensions[0];
|
6558
6568
|
const isZeroDimension = 0 === dimensions.length;
|
6559
6569
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
6560
6570
|
const { foldInfo, unfoldInfo } = cur;
|
@@ -8052,20 +8062,20 @@ const zAnnotationVerticalLine = external_zod_namespaceObject.z.object({
|
|
8052
8062
|
'middle',
|
8053
8063
|
'bottom'
|
8054
8064
|
]).default('top').optional(),
|
8055
|
-
lineVisible: external_zod_namespaceObject.z.boolean().optional(),
|
8056
|
-
lineColor: external_zod_namespaceObject.z.string().optional(),
|
8057
|
-
lineWidth: external_zod_namespaceObject.z.number().optional(),
|
8065
|
+
lineVisible: external_zod_namespaceObject.z.boolean().default(true).optional(),
|
8066
|
+
lineColor: external_zod_namespaceObject.z.string().default('#212121').optional(),
|
8067
|
+
lineWidth: external_zod_namespaceObject.z.number().default(1).optional(),
|
8058
8068
|
lineStyle: external_zod_namespaceObject.z.union([
|
8059
8069
|
external_zod_namespaceObject.z.literal('solid'),
|
8060
8070
|
external_zod_namespaceObject.z.literal('dashed'),
|
8061
8071
|
external_zod_namespaceObject.z.literal('dotted')
|
8062
|
-
]).optional(),
|
8072
|
+
]).default('dashed').optional(),
|
8063
8073
|
backgroundVisible: external_zod_namespaceObject.z.boolean().default(true).optional(),
|
8064
8074
|
backgroundColor: external_zod_namespaceObject.z.string().default('#212121').optional(),
|
8065
|
-
backgroundBorderColor: external_zod_namespaceObject.z.string().optional(),
|
8066
|
-
backgroundBorderWidth: external_zod_namespaceObject.z.number().default(1).optional(),
|
8075
|
+
backgroundBorderColor: external_zod_namespaceObject.z.string().default('#212121').optional(),
|
8067
8076
|
backgroundBorderRadius: external_zod_namespaceObject.z.number().default(4).optional(),
|
8068
|
-
|
8077
|
+
backgroundBorderWidth: external_zod_namespaceObject.z.number().default(1).optional(),
|
8078
|
+
backgroundPadding: external_zod_namespaceObject.z.number().default(2).optional(),
|
8069
8079
|
offsetX: external_zod_namespaceObject.z.number().default(0),
|
8070
8080
|
offsetY: external_zod_namespaceObject.z.number().default(0)
|
8071
8081
|
});
|
@@ -8090,7 +8100,7 @@ const zAnnotationHorizontalLine = external_zod_namespaceObject.z.object({
|
|
8090
8100
|
'insideStart',
|
8091
8101
|
'insideMiddle',
|
8092
8102
|
'insideEnd'
|
8093
|
-
]).default('
|
8103
|
+
]).default('insideEnd').optional(),
|
8094
8104
|
textColor: external_zod_namespaceObject.z.string().default('#ffffff').optional(),
|
8095
8105
|
textFontSize: external_zod_namespaceObject.z.number().default(12).optional(),
|
8096
8106
|
textFontWeight: external_zod_namespaceObject.z.number().default(400).optional(),
|
@@ -8098,26 +8108,26 @@ const zAnnotationHorizontalLine = external_zod_namespaceObject.z.object({
|
|
8098
8108
|
'left',
|
8099
8109
|
'right',
|
8100
8110
|
'center'
|
8101
|
-
]).default('
|
8111
|
+
]).default('right').optional(),
|
8102
8112
|
textBaseline: external_zod_namespaceObject.z["enum"]([
|
8103
8113
|
'top',
|
8104
8114
|
'middle',
|
8105
8115
|
'bottom'
|
8106
|
-
]).default('
|
8107
|
-
lineVisible: external_zod_namespaceObject.z.boolean().optional(),
|
8108
|
-
lineColor: external_zod_namespaceObject.z.string().optional(),
|
8109
|
-
lineWidth: external_zod_namespaceObject.z.number().optional(),
|
8116
|
+
]).default('top').optional(),
|
8117
|
+
lineVisible: external_zod_namespaceObject.z.boolean().default(true).optional(),
|
8118
|
+
lineColor: external_zod_namespaceObject.z.string().default('#212121').optional(),
|
8119
|
+
lineWidth: external_zod_namespaceObject.z.number().default(1).optional(),
|
8110
8120
|
lineStyle: external_zod_namespaceObject.z.union([
|
8111
8121
|
external_zod_namespaceObject.z.literal('solid'),
|
8112
8122
|
external_zod_namespaceObject.z.literal('dashed'),
|
8113
8123
|
external_zod_namespaceObject.z.literal('dotted')
|
8114
|
-
]).optional(),
|
8124
|
+
]).default('dashed').optional(),
|
8115
8125
|
backgroundVisible: external_zod_namespaceObject.z.boolean().default(true).optional(),
|
8116
8126
|
backgroundColor: external_zod_namespaceObject.z.string().default('#212121').optional(),
|
8117
|
-
backgroundBorderColor: external_zod_namespaceObject.z.string().optional(),
|
8118
|
-
backgroundBorderWidth: external_zod_namespaceObject.z.number().default(1).optional(),
|
8127
|
+
backgroundBorderColor: external_zod_namespaceObject.z.string().default('#212121').optional(),
|
8119
8128
|
backgroundBorderRadius: external_zod_namespaceObject.z.number().default(4).optional(),
|
8120
|
-
|
8129
|
+
backgroundBorderWidth: external_zod_namespaceObject.z.number().default(1).optional(),
|
8130
|
+
backgroundPadding: external_zod_namespaceObject.z.number().default(2).optional(),
|
8121
8131
|
offsetX: external_zod_namespaceObject.z.number().default(0),
|
8122
8132
|
offsetY: external_zod_namespaceObject.z.number().default(0)
|
8123
8133
|
});
|
@@ -8149,21 +8159,21 @@ const zAnnotationArea = external_zod_namespaceObject.z.object({
|
|
8149
8159
|
'top',
|
8150
8160
|
'middle',
|
8151
8161
|
'bottom'
|
8152
|
-
]).default('
|
8162
|
+
]).default('top').optional(),
|
8153
8163
|
backgroundVisible: external_zod_namespaceObject.z.boolean().default(true).optional(),
|
8154
|
-
backgroundColor: external_zod_namespaceObject.z.string().default('#
|
8155
|
-
backgroundBorderColor: external_zod_namespaceObject.z.string().optional(),
|
8164
|
+
backgroundColor: external_zod_namespaceObject.z.string().default('#191d24').optional(),
|
8165
|
+
backgroundBorderColor: external_zod_namespaceObject.z.string().default('#191d24').optional(),
|
8156
8166
|
backgroundBorderWidth: external_zod_namespaceObject.z.number().default(1).optional(),
|
8157
8167
|
backgroundBorderRadius: external_zod_namespaceObject.z.number().default(4).optional(),
|
8158
|
-
backgroundPadding: external_zod_namespaceObject.z.number().optional(),
|
8159
|
-
areaColor: external_zod_namespaceObject.z.string().default('
|
8160
|
-
areaColorOpacity: external_zod_namespaceObject.z.number().default(0.
|
8161
|
-
areaBorderColor: external_zod_namespaceObject.z.
|
8162
|
-
areaBorderWidth: external_zod_namespaceObject.z.number().default(
|
8168
|
+
backgroundPadding: external_zod_namespaceObject.z.number().default(4).optional(),
|
8169
|
+
areaColor: external_zod_namespaceObject.z.string().default('#888888').optional(),
|
8170
|
+
areaColorOpacity: external_zod_namespaceObject.z.number().default(0.15).optional(),
|
8171
|
+
areaBorderColor: external_zod_namespaceObject.z.string().default('#888888').optional(),
|
8172
|
+
areaBorderWidth: external_zod_namespaceObject.z.number().default(1).optional(),
|
8163
8173
|
areaBorderRadius: external_zod_namespaceObject.z.number().default(4).optional(),
|
8164
|
-
outerPadding: external_zod_namespaceObject.z.number().optional(),
|
8165
|
-
offsetX: external_zod_namespaceObject.z.number().optional(),
|
8166
|
-
offsetY: external_zod_namespaceObject.z.number().optional()
|
8174
|
+
outerPadding: external_zod_namespaceObject.z.number().default(4).optional(),
|
8175
|
+
offsetX: external_zod_namespaceObject.z.number().default(0).optional(),
|
8176
|
+
offsetY: external_zod_namespaceObject.z.number().default(0).optional()
|
8167
8177
|
});
|
8168
8178
|
const zAnnotation = external_zod_namespaceObject.z.object({
|
8169
8179
|
annotationPoint: zAnnotationPoint.or(external_zod_namespaceObject.z.array(zAnnotationPoint)).optional(),
|