@visactor/vseed 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +340 -81
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +334 -81
- package/dist/index.js.map +1 -1
- package/dist/pipeline/advanced/chart/pipes/encoding/encodingMatrix.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/color/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/color/linearColor.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/dataset/{dataset.d.ts → datasetXY.d.ts} +1 -1
- package/dist/pipeline/spec/chart/pipes/dataset/datasetYX.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/dataset/index.d.ts +2 -1
- package/dist/pipeline/spec/chart/pipes/init/heatmap.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/label/index.d.ts +1 -0
- package/dist/pipeline/spec/chart/pipes/label/labelColorInversion.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/legend/colorLegend.d.ts +2 -0
- package/dist/pipeline/spec/chart/pipes/legend/index.d.ts +1 -0
- package/dist/types/advancedVSeed.d.ts +2 -2
- package/dist/types/chartType/area/area.d.ts +1 -1
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +1 -1
- package/dist/types/chartType/areaRange/areaRange.d.ts +1 -1
- package/dist/types/chartType/funnel/funnel.d.ts +6 -39
- package/dist/types/chartType/heatmap/heatmap.d.ts +6 -37
- package/dist/types/chartType/line/line.d.ts +1 -1
- package/dist/types/properties/config/color/color.d.ts +11 -0
- package/dist/types/properties/config/legend/legend.d.ts +26 -0
- package/dist/types/properties/markStyle/areaStyle.d.ts +0 -2
- package/dist/types/properties/markStyle/barStyle.d.ts +0 -6
- package/dist/types/properties/markStyle/lineStyle.d.ts +1 -6
- package/dist/types/properties/markStyle/markStyle.d.ts +2 -2
- package/dist/types/properties/markStyle/pointStyle.d.ts +0 -6
- package/dist/types/vseed.d.ts +6 -66
- package/dist/umd/index.js +336 -81
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -67,6 +67,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
67
67
|
findAllMeasures: ()=>findAllMeasures,
|
68
68
|
funnelSpecPipeline: ()=>funnelSpecPipeline,
|
69
69
|
zAnalysis: ()=>zAnalysis,
|
70
|
+
zColorLegend: ()=>zColorLegend,
|
70
71
|
preorderTraverse: ()=>preorderTraverse,
|
71
72
|
zDimensionTree: ()=>zDimensionTree,
|
72
73
|
roseParallelSpecPipeline: ()=>roseParallelSpecPipeline,
|
@@ -155,9 +156,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
155
156
|
UnfoldDimensionGroup: ()=>UnfoldDimensionGroup,
|
156
157
|
zDatasetReshapeInfo: ()=>zDatasetReshapeInfo,
|
157
158
|
zFoldInfo: ()=>zFoldInfo,
|
158
|
-
|
159
|
+
zLinearColor: ()=>zLinearColor,
|
159
160
|
zAreaStyle: ()=>zAreaStyle,
|
160
161
|
ORIGINAL_DATA: ()=>ORIGINAL_DATA,
|
162
|
+
zUnfoldInfo: ()=>zUnfoldInfo,
|
161
163
|
zAnnotationArea: ()=>zAnnotationArea,
|
162
164
|
columnParallelSpecPipeline: ()=>columnParallelSpecPipeline,
|
163
165
|
i18n: ()=>i18n,
|
@@ -1588,7 +1590,7 @@ const encodingFunnel = (advancedVSeed)=>{
|
|
1588
1590
|
unfoldInfo.groupId
|
1589
1591
|
];
|
1590
1592
|
const color = [
|
1591
|
-
|
1593
|
+
foldInfo.measureValue
|
1592
1594
|
];
|
1593
1595
|
return [
|
1594
1596
|
...prev,
|
@@ -2074,6 +2076,39 @@ const scatterAdvancedPipeline = [
|
|
2074
2076
|
markStyle_markStyle,
|
2075
2077
|
annotation_annotation
|
2076
2078
|
];
|
2079
|
+
const encodingMatrix = (advancedVSeed)=>{
|
2080
|
+
const result = {
|
2081
|
+
...advancedVSeed
|
2082
|
+
};
|
2083
|
+
const { datasetReshapeInfo, dimensions } = advancedVSeed;
|
2084
|
+
if (!datasetReshapeInfo || !dimensions) return result;
|
2085
|
+
const xDimension = dimensions.find((item)=>'rowDimension' !== item.location && 'columnDimension' !== item.location);
|
2086
|
+
const isZeroDimension = 0 === dimensions.length;
|
2087
|
+
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
2088
|
+
const { foldInfo, unfoldInfo } = cur;
|
2089
|
+
const x = [
|
2090
|
+
isZeroDimension ? foldInfo.measureName : xDimension?.id
|
2091
|
+
];
|
2092
|
+
const y = [
|
2093
|
+
unfoldInfo.groupName
|
2094
|
+
];
|
2095
|
+
const color = [
|
2096
|
+
foldInfo.measureValue
|
2097
|
+
];
|
2098
|
+
return [
|
2099
|
+
...prev,
|
2100
|
+
{
|
2101
|
+
x,
|
2102
|
+
y,
|
2103
|
+
color
|
2104
|
+
}
|
2105
|
+
];
|
2106
|
+
}, []);
|
2107
|
+
return {
|
2108
|
+
...result,
|
2109
|
+
encoding
|
2110
|
+
};
|
2111
|
+
};
|
2077
2112
|
const heatmapAdvancedPipeline = [
|
2078
2113
|
initAdvancedVSeed,
|
2079
2114
|
autoMeasures,
|
@@ -2083,7 +2118,7 @@ const heatmapAdvancedPipeline = [
|
|
2083
2118
|
], [
|
2084
2119
|
pivotReshapeTo2D1M
|
2085
2120
|
]),
|
2086
|
-
|
2121
|
+
encodingMatrix,
|
2087
2122
|
sortXBandAxis,
|
2088
2123
|
heatmapConfig,
|
2089
2124
|
theme_theme,
|
@@ -2258,12 +2293,11 @@ const tableAdvancedPipeline = [
|
|
2258
2293
|
records_records,
|
2259
2294
|
theme_theme
|
2260
2295
|
];
|
2261
|
-
const
|
2296
|
+
const datasetYX = (spec, context)=>{
|
2262
2297
|
const { advancedVSeed, vseed } = context;
|
2263
2298
|
const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
|
2264
2299
|
const { orderMapping = {} } = analysis ?? {};
|
2265
2300
|
const angle = encoding[0]?.angle?.[0];
|
2266
|
-
const x = encoding[0]?.x?.[0];
|
2267
2301
|
const y = encoding[0]?.y?.[0];
|
2268
2302
|
const group = encoding[0]?.group?.[0];
|
2269
2303
|
const id = datasetReshapeInfo[0].id;
|
@@ -2271,25 +2305,57 @@ const dataset_dataset = (spec, context)=>{
|
|
2271
2305
|
if (angle) fields[angle] = {
|
2272
2306
|
sortIndex: 0
|
2273
2307
|
};
|
2274
|
-
if (
|
2275
|
-
const order = orderMapping[
|
2276
|
-
if (order) fields[
|
2308
|
+
if (y) {
|
2309
|
+
const order = orderMapping[y];
|
2310
|
+
if (order) fields[y] = {
|
2277
2311
|
sortIndex: 0,
|
2278
2312
|
domain: order,
|
2279
2313
|
lockStatisticsByDomain: true
|
2280
2314
|
};
|
2281
|
-
else fields[
|
2315
|
+
else fields[y] = {
|
2282
2316
|
sortIndex: 0
|
2283
2317
|
};
|
2284
2318
|
}
|
2285
|
-
if (
|
2286
|
-
const order = orderMapping[
|
2287
|
-
if (order) fields[
|
2319
|
+
if (group) {
|
2320
|
+
const order = orderMapping[group];
|
2321
|
+
if (order) fields[group] = {
|
2288
2322
|
sortIndex: 0,
|
2289
2323
|
domain: order,
|
2290
2324
|
lockStatisticsByDomain: true
|
2291
2325
|
};
|
2292
|
-
else fields[
|
2326
|
+
else fields[group] = {
|
2327
|
+
sortIndex: 0
|
2328
|
+
};
|
2329
|
+
}
|
2330
|
+
return {
|
2331
|
+
...spec,
|
2332
|
+
data: {
|
2333
|
+
id,
|
2334
|
+
values: isPivotChart(vseed) ? void 0 : advancedVSeed.dataset,
|
2335
|
+
fields: fields
|
2336
|
+
}
|
2337
|
+
};
|
2338
|
+
};
|
2339
|
+
const datasetXY = (spec, context)=>{
|
2340
|
+
const { advancedVSeed, vseed } = context;
|
2341
|
+
const { encoding, analysis, datasetReshapeInfo } = advancedVSeed;
|
2342
|
+
const { orderMapping = {} } = analysis ?? {};
|
2343
|
+
const angle = encoding[0]?.angle?.[0];
|
2344
|
+
const x = encoding[0]?.x?.[0];
|
2345
|
+
const group = encoding[0]?.group?.[0];
|
2346
|
+
const id = datasetReshapeInfo[0].id;
|
2347
|
+
const fields = {};
|
2348
|
+
if (angle) fields[angle] = {
|
2349
|
+
sortIndex: 0
|
2350
|
+
};
|
2351
|
+
if (x) {
|
2352
|
+
const order = orderMapping[x];
|
2353
|
+
if (order) fields[x] = {
|
2354
|
+
sortIndex: 0,
|
2355
|
+
domain: order,
|
2356
|
+
lockStatisticsByDomain: true
|
2357
|
+
};
|
2358
|
+
else fields[x] = {
|
2293
2359
|
sortIndex: 0
|
2294
2360
|
};
|
2295
2361
|
}
|
@@ -2383,7 +2449,7 @@ const initBarParallel = (spec, context)=>{
|
|
2383
2449
|
result.direction = 'horizontal';
|
2384
2450
|
result.yField = [
|
2385
2451
|
encoding[0].y[0],
|
2386
|
-
unfoldInfo.
|
2452
|
+
unfoldInfo.groupId
|
2387
2453
|
];
|
2388
2454
|
result.xField = encoding[0].x[0];
|
2389
2455
|
result.seriesField = encoding[0].group[0];
|
@@ -2532,7 +2598,7 @@ const initColumnParallel = (spec, context)=>{
|
|
2532
2598
|
result.direction = 'vertical';
|
2533
2599
|
result.xField = [
|
2534
2600
|
encoding[0].x[0],
|
2535
|
-
unfoldInfo.
|
2601
|
+
unfoldInfo.groupId
|
2536
2602
|
];
|
2537
2603
|
result.yField = encoding[0].y[0];
|
2538
2604
|
result.seriesField = encoding[0].group[0];
|
@@ -2550,8 +2616,9 @@ const initPie = (spec, context)=>{
|
|
2550
2616
|
...spec
|
2551
2617
|
};
|
2552
2618
|
const { advancedVSeed } = context;
|
2553
|
-
const { encoding } = advancedVSeed;
|
2619
|
+
const { encoding, dataset } = advancedVSeed;
|
2554
2620
|
if (!encoding[0].angle || !encoding[0].radius || !encoding[0].group) return result;
|
2621
|
+
const showStroke = dataset.length > 20;
|
2555
2622
|
result.type = 'pie';
|
2556
2623
|
result.outerRadius = 0.8;
|
2557
2624
|
result.innerRadius = 0;
|
@@ -2567,7 +2634,7 @@ const initPie = (spec, context)=>{
|
|
2567
2634
|
result.pie = {
|
2568
2635
|
style: {
|
2569
2636
|
stroke: '#ffffff',
|
2570
|
-
lineWidth: 1,
|
2637
|
+
lineWidth: showStroke ? 1 : 0,
|
2571
2638
|
centerOffset: 0
|
2572
2639
|
},
|
2573
2640
|
state: {
|
@@ -2585,8 +2652,9 @@ const initDonut = (spec, context)=>{
|
|
2585
2652
|
...spec
|
2586
2653
|
};
|
2587
2654
|
const { advancedVSeed } = context;
|
2588
|
-
const { encoding } = advancedVSeed;
|
2655
|
+
const { encoding, dataset } = advancedVSeed;
|
2589
2656
|
if (!encoding[0].angle || !encoding[0].radius || !encoding[0].group) return result;
|
2657
|
+
const showStroke = dataset.length > 20;
|
2590
2658
|
result.type = 'pie';
|
2591
2659
|
result.outerRadius = 0.8;
|
2592
2660
|
result.innerRadius = 0.8 * result.outerRadius;
|
@@ -2602,7 +2670,7 @@ const initDonut = (spec, context)=>{
|
|
2602
2670
|
result.pie = {
|
2603
2671
|
style: {
|
2604
2672
|
stroke: '#ffffff',
|
2605
|
-
lineWidth: 1
|
2673
|
+
lineWidth: showStroke ? 1 : 0
|
2606
2674
|
},
|
2607
2675
|
state: {
|
2608
2676
|
hover: {
|
@@ -2661,7 +2729,7 @@ const initRoseParallel = (spec, context)=>{
|
|
2661
2729
|
result.type = 'rose';
|
2662
2730
|
result.categoryField = [
|
2663
2731
|
encoding[0].angle[0],
|
2664
|
-
unfoldInfo.
|
2732
|
+
unfoldInfo.groupId
|
2665
2733
|
];
|
2666
2734
|
result.valueField = encoding[0].radius[0];
|
2667
2735
|
result.seriesField = encoding[0].group[0];
|
@@ -2753,7 +2821,11 @@ const initFunnel = (spec, context)=>{
|
|
2753
2821
|
];
|
2754
2822
|
result.funnel = {
|
2755
2823
|
style: {
|
2756
|
-
cornerRadius: 4
|
2824
|
+
cornerRadius: 4,
|
2825
|
+
fill: {
|
2826
|
+
field: encoding[0].color[0],
|
2827
|
+
scale: 'color'
|
2828
|
+
}
|
2757
2829
|
},
|
2758
2830
|
state: {
|
2759
2831
|
hover: {
|
@@ -3399,6 +3471,16 @@ const label_label = (spec, context)=>{
|
|
3399
3471
|
};
|
3400
3472
|
return result;
|
3401
3473
|
};
|
3474
|
+
const labelColorInversion = (spec)=>{
|
3475
|
+
const result = {
|
3476
|
+
...spec
|
3477
|
+
};
|
3478
|
+
if (result.label) result.label.smartInvert = true;
|
3479
|
+
else result.label = {
|
3480
|
+
smartInvert: true
|
3481
|
+
};
|
3482
|
+
return result;
|
3483
|
+
};
|
3402
3484
|
const discreteLegend = (spec, context)=>{
|
3403
3485
|
const result = {
|
3404
3486
|
...spec
|
@@ -3608,6 +3690,69 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
3608
3690
|
legends
|
3609
3691
|
};
|
3610
3692
|
};
|
3693
|
+
const colorLegend = (spec, context)=>{
|
3694
|
+
const result = {
|
3695
|
+
...spec
|
3696
|
+
};
|
3697
|
+
const { advancedVSeed } = context;
|
3698
|
+
const { chartType } = advancedVSeed;
|
3699
|
+
const baseConfig = advancedVSeed.config[chartType];
|
3700
|
+
const { encoding } = advancedVSeed;
|
3701
|
+
if (!encoding[0].color) return result;
|
3702
|
+
if (!baseConfig || !baseConfig.legend) return result;
|
3703
|
+
const { legend } = baseConfig;
|
3704
|
+
const { enable, position = 'bottom' } = legend || {};
|
3705
|
+
const orient = [
|
3706
|
+
'bottom',
|
3707
|
+
'bottomLeft',
|
3708
|
+
'bottomRight',
|
3709
|
+
'bl',
|
3710
|
+
'br'
|
3711
|
+
].includes(position) ? 'bottom' : [
|
3712
|
+
'top',
|
3713
|
+
'topLeft',
|
3714
|
+
'topRight',
|
3715
|
+
'tl',
|
3716
|
+
'tr'
|
3717
|
+
].includes(position) ? 'top' : [
|
3718
|
+
'left',
|
3719
|
+
'leftTop',
|
3720
|
+
'leftBottom',
|
3721
|
+
'lt',
|
3722
|
+
'lb'
|
3723
|
+
].includes(position) ? 'left' : 'right';
|
3724
|
+
const legendPosition = [
|
3725
|
+
'topLeft',
|
3726
|
+
'bottomLeft',
|
3727
|
+
'leftTop',
|
3728
|
+
'rightTop',
|
3729
|
+
'lt',
|
3730
|
+
'rt',
|
3731
|
+
'tl',
|
3732
|
+
'bl'
|
3733
|
+
].includes(position) ? 'start' : [
|
3734
|
+
'topRight',
|
3735
|
+
'bottomRight',
|
3736
|
+
'leftBottom',
|
3737
|
+
'rightBottom',
|
3738
|
+
'lb',
|
3739
|
+
'rb',
|
3740
|
+
'rt',
|
3741
|
+
'br'
|
3742
|
+
].includes(position) ? 'end' : 'middle';
|
3743
|
+
result.legends = {
|
3744
|
+
type: 'color',
|
3745
|
+
visible: enable,
|
3746
|
+
orient,
|
3747
|
+
position: legendPosition,
|
3748
|
+
field: encoding[0].color[0],
|
3749
|
+
inverse: !![
|
3750
|
+
'left',
|
3751
|
+
'right'
|
3752
|
+
].includes(orient)
|
3753
|
+
};
|
3754
|
+
return result;
|
3755
|
+
};
|
3611
3756
|
const color_color = (spec, context)=>{
|
3612
3757
|
const result = {
|
3613
3758
|
...spec
|
@@ -3635,6 +3780,28 @@ const color_color = (spec, context)=>{
|
|
3635
3780
|
};
|
3636
3781
|
return result;
|
3637
3782
|
};
|
3783
|
+
const linearColor = (spec, context)=>{
|
3784
|
+
const result = {
|
3785
|
+
...spec
|
3786
|
+
};
|
3787
|
+
const { advancedVSeed } = context;
|
3788
|
+
const { datasetReshapeInfo, chartType, encoding } = advancedVSeed;
|
3789
|
+
const baseConfig = advancedVSeed.config[chartType];
|
3790
|
+
if (!baseConfig || !baseConfig.color) return result;
|
3791
|
+
const { color } = baseConfig;
|
3792
|
+
const { colorScheme } = color;
|
3793
|
+
result.color = {
|
3794
|
+
type: 'linear',
|
3795
|
+
domain: [
|
3796
|
+
{
|
3797
|
+
dataId: datasetReshapeInfo[0].id,
|
3798
|
+
fields: encoding?.[0]?.color
|
3799
|
+
}
|
3800
|
+
],
|
3801
|
+
range: colorScheme
|
3802
|
+
};
|
3803
|
+
return result;
|
3804
|
+
};
|
3638
3805
|
const pivotAdapter_pivotAdapter = (pipeline, pivotPipeline)=>(spec, context)=>{
|
3639
3806
|
const { vseed } = context;
|
3640
3807
|
const usePivotChart = isPivotChart(vseed);
|
@@ -4866,7 +5033,7 @@ const line_line = [
|
|
4866
5033
|
initLine,
|
4867
5034
|
color_color,
|
4868
5035
|
background_backgroundColor,
|
4869
|
-
|
5036
|
+
datasetXY,
|
4870
5037
|
xBand,
|
4871
5038
|
yLinear,
|
4872
5039
|
label_label,
|
@@ -4890,7 +5057,7 @@ const pivotLine = [
|
|
4890
5057
|
initLine,
|
4891
5058
|
color_color,
|
4892
5059
|
background_backgroundColor,
|
4893
|
-
|
5060
|
+
datasetXY,
|
4894
5061
|
xBand,
|
4895
5062
|
yLinear,
|
4896
5063
|
label_label,
|
@@ -4917,7 +5084,7 @@ const column = [
|
|
4917
5084
|
stackInverse,
|
4918
5085
|
color_color,
|
4919
5086
|
background_backgroundColor,
|
4920
|
-
|
5087
|
+
datasetXY,
|
4921
5088
|
xBand,
|
4922
5089
|
yLinear,
|
4923
5090
|
label_label,
|
@@ -4941,7 +5108,7 @@ const pivotColumn = [
|
|
4941
5108
|
stackInverse,
|
4942
5109
|
color_color,
|
4943
5110
|
background_backgroundColor,
|
4944
|
-
|
5111
|
+
datasetXY,
|
4945
5112
|
xBand,
|
4946
5113
|
yLinear,
|
4947
5114
|
label_label,
|
@@ -4965,7 +5132,7 @@ const columnParallel = [
|
|
4965
5132
|
stackCornerRadius_stackCornerRadius,
|
4966
5133
|
color_color,
|
4967
5134
|
background_backgroundColor,
|
4968
|
-
|
5135
|
+
datasetXY,
|
4969
5136
|
xBand,
|
4970
5137
|
yLinear,
|
4971
5138
|
label_label,
|
@@ -4988,7 +5155,7 @@ const pivotColumnParallel = [
|
|
4988
5155
|
stackCornerRadius_stackCornerRadius,
|
4989
5156
|
color_color,
|
4990
5157
|
background_backgroundColor,
|
4991
|
-
|
5158
|
+
datasetXY,
|
4992
5159
|
xBand,
|
4993
5160
|
yLinear,
|
4994
5161
|
label_label,
|
@@ -5014,7 +5181,7 @@ const columnPercent = [
|
|
5014
5181
|
color_color,
|
5015
5182
|
background_backgroundColor,
|
5016
5183
|
percent,
|
5017
|
-
|
5184
|
+
datasetXY,
|
5018
5185
|
xBand,
|
5019
5186
|
yLinear,
|
5020
5187
|
label_label,
|
@@ -5039,7 +5206,7 @@ const pivotColumnPercent = [
|
|
5039
5206
|
color_color,
|
5040
5207
|
percent,
|
5041
5208
|
background_backgroundColor,
|
5042
|
-
|
5209
|
+
datasetXY,
|
5043
5210
|
xBand,
|
5044
5211
|
yLinear,
|
5045
5212
|
label_label,
|
@@ -5063,7 +5230,7 @@ const bar = [
|
|
5063
5230
|
stackCornerRadius_stackCornerRadius,
|
5064
5231
|
color_color,
|
5065
5232
|
background_backgroundColor,
|
5066
|
-
|
5233
|
+
datasetYX,
|
5067
5234
|
xLinear,
|
5068
5235
|
yBand,
|
5069
5236
|
label_label,
|
@@ -5086,7 +5253,7 @@ const pivotBar = [
|
|
5086
5253
|
stackCornerRadius_stackCornerRadius,
|
5087
5254
|
color_color,
|
5088
5255
|
background_backgroundColor,
|
5089
|
-
|
5256
|
+
datasetYX,
|
5090
5257
|
xLinear,
|
5091
5258
|
yBand,
|
5092
5259
|
label_label,
|
@@ -5111,7 +5278,7 @@ const barParallel = [
|
|
5111
5278
|
stackCornerRadius_stackCornerRadius,
|
5112
5279
|
color_color,
|
5113
5280
|
background_backgroundColor,
|
5114
|
-
|
5281
|
+
datasetYX,
|
5115
5282
|
xLinear,
|
5116
5283
|
yBand,
|
5117
5284
|
label_label,
|
@@ -5134,7 +5301,7 @@ const pivotBarParallel = [
|
|
5134
5301
|
stackCornerRadius_stackCornerRadius,
|
5135
5302
|
color_color,
|
5136
5303
|
background_backgroundColor,
|
5137
|
-
|
5304
|
+
datasetYX,
|
5138
5305
|
xLinear,
|
5139
5306
|
yBand,
|
5140
5307
|
label_label,
|
@@ -5159,7 +5326,7 @@ const barPercent = [
|
|
5159
5326
|
color_color,
|
5160
5327
|
background_backgroundColor,
|
5161
5328
|
percent,
|
5162
|
-
|
5329
|
+
datasetYX,
|
5163
5330
|
xLinear,
|
5164
5331
|
yBand,
|
5165
5332
|
label_label,
|
@@ -5183,7 +5350,7 @@ const pivotBarPercent = [
|
|
5183
5350
|
color_color,
|
5184
5351
|
background_backgroundColor,
|
5185
5352
|
percent,
|
5186
|
-
|
5353
|
+
datasetYX,
|
5187
5354
|
yBand,
|
5188
5355
|
xLinear,
|
5189
5356
|
label_label,
|
@@ -5207,7 +5374,7 @@ const area_area = [
|
|
5207
5374
|
stackInverse,
|
5208
5375
|
color_color,
|
5209
5376
|
background_backgroundColor,
|
5210
|
-
|
5377
|
+
datasetXY,
|
5211
5378
|
xBand,
|
5212
5379
|
yLinear,
|
5213
5380
|
label_label,
|
@@ -5233,7 +5400,7 @@ const pivotArea = [
|
|
5233
5400
|
color_color,
|
5234
5401
|
background_backgroundColor,
|
5235
5402
|
stackInverse,
|
5236
|
-
|
5403
|
+
datasetXY,
|
5237
5404
|
xBand,
|
5238
5405
|
yLinear,
|
5239
5406
|
label_label,
|
@@ -5261,7 +5428,7 @@ const areaPercent = [
|
|
5261
5428
|
color_color,
|
5262
5429
|
background_backgroundColor,
|
5263
5430
|
percent,
|
5264
|
-
|
5431
|
+
datasetXY,
|
5265
5432
|
xBand,
|
5266
5433
|
yLinear,
|
5267
5434
|
label_label,
|
@@ -5287,7 +5454,7 @@ const pivotAreaPercent = [
|
|
5287
5454
|
color_color,
|
5288
5455
|
background_backgroundColor,
|
5289
5456
|
percent,
|
5290
|
-
|
5457
|
+
datasetXY,
|
5291
5458
|
xBand,
|
5292
5459
|
yLinear,
|
5293
5460
|
label_label,
|
@@ -5323,7 +5490,7 @@ const areaRange = [
|
|
5323
5490
|
pointStyle_pointStyle,
|
5324
5491
|
pointStateDimensionHover
|
5325
5492
|
]),
|
5326
|
-
|
5493
|
+
datasetXY,
|
5327
5494
|
background_backgroundColor,
|
5328
5495
|
xBand,
|
5329
5496
|
yLinear,
|
@@ -5355,7 +5522,7 @@ const pivotAreaRange = [
|
|
5355
5522
|
pointStateDimensionHover
|
5356
5523
|
]),
|
5357
5524
|
background_backgroundColor,
|
5358
|
-
|
5525
|
+
datasetXY,
|
5359
5526
|
xBand,
|
5360
5527
|
yLinear,
|
5361
5528
|
label_label,
|
@@ -5375,7 +5542,7 @@ const scatter = [
|
|
5375
5542
|
initScatter,
|
5376
5543
|
color_color,
|
5377
5544
|
background_backgroundColor,
|
5378
|
-
|
5545
|
+
datasetXY,
|
5379
5546
|
xLinear,
|
5380
5547
|
yLinear,
|
5381
5548
|
label_label,
|
@@ -5399,7 +5566,7 @@ const pivotScatter = [
|
|
5399
5566
|
initScatter,
|
5400
5567
|
color_color,
|
5401
5568
|
background_backgroundColor,
|
5402
|
-
|
5569
|
+
datasetXY,
|
5403
5570
|
xLinear,
|
5404
5571
|
yLinear,
|
5405
5572
|
label_label,
|
@@ -5424,7 +5591,7 @@ const pie = [
|
|
5424
5591
|
initPie,
|
5425
5592
|
color_color,
|
5426
5593
|
background_backgroundColor,
|
5427
|
-
|
5594
|
+
datasetXY,
|
5428
5595
|
label_label,
|
5429
5596
|
tooltip_tooltip,
|
5430
5597
|
discreteLegend,
|
@@ -5442,7 +5609,7 @@ const pivotPie = [
|
|
5442
5609
|
initPie,
|
5443
5610
|
color_color,
|
5444
5611
|
background_backgroundColor,
|
5445
|
-
|
5612
|
+
datasetXY,
|
5446
5613
|
label_label,
|
5447
5614
|
tooltip_tooltip,
|
5448
5615
|
annotationPoint_annotationPoint,
|
@@ -5461,7 +5628,7 @@ const donut = [
|
|
5461
5628
|
initDonut,
|
5462
5629
|
color_color,
|
5463
5630
|
background_backgroundColor,
|
5464
|
-
|
5631
|
+
datasetXY,
|
5465
5632
|
label_label,
|
5466
5633
|
tooltip_tooltip,
|
5467
5634
|
discreteLegend,
|
@@ -5479,7 +5646,7 @@ const pivotDonut = [
|
|
5479
5646
|
initDonut,
|
5480
5647
|
color_color,
|
5481
5648
|
background_backgroundColor,
|
5482
|
-
|
5649
|
+
datasetXY,
|
5483
5650
|
label_label,
|
5484
5651
|
tooltip_tooltip,
|
5485
5652
|
annotationPoint_annotationPoint,
|
@@ -5500,7 +5667,7 @@ const rose = [
|
|
5500
5667
|
stackInverse,
|
5501
5668
|
color_color,
|
5502
5669
|
background_backgroundColor,
|
5503
|
-
|
5670
|
+
datasetXY,
|
5504
5671
|
radiusAxis,
|
5505
5672
|
angleAxis,
|
5506
5673
|
label_label,
|
@@ -5519,7 +5686,7 @@ const pivotRose = [
|
|
5519
5686
|
stackInverse,
|
5520
5687
|
color_color,
|
5521
5688
|
background_backgroundColor,
|
5522
|
-
|
5689
|
+
datasetXY,
|
5523
5690
|
radiusAxis,
|
5524
5691
|
angleAxis,
|
5525
5692
|
label_label,
|
@@ -5538,7 +5705,7 @@ const roseParallel = [
|
|
5538
5705
|
stackCornerRadius_stackCornerRadius,
|
5539
5706
|
color_color,
|
5540
5707
|
background_backgroundColor,
|
5541
|
-
|
5708
|
+
datasetXY,
|
5542
5709
|
radiusAxis,
|
5543
5710
|
angleAxis,
|
5544
5711
|
label_label,
|
@@ -5560,7 +5727,7 @@ const pivotRoseParallel = [
|
|
5560
5727
|
stackCornerRadius_stackCornerRadius,
|
5561
5728
|
color_color,
|
5562
5729
|
background_backgroundColor,
|
5563
|
-
|
5730
|
+
datasetXY,
|
5564
5731
|
radiusAxis,
|
5565
5732
|
angleAxis,
|
5566
5733
|
label_label,
|
@@ -5582,7 +5749,7 @@ const radar = [
|
|
5582
5749
|
initRadar,
|
5583
5750
|
color_color,
|
5584
5751
|
background_backgroundColor,
|
5585
|
-
|
5752
|
+
datasetXY,
|
5586
5753
|
radarAngleAxis,
|
5587
5754
|
radarRadiusAxis,
|
5588
5755
|
label_label,
|
@@ -5603,7 +5770,7 @@ const pivotRadar = [
|
|
5603
5770
|
initRadar,
|
5604
5771
|
color_color,
|
5605
5772
|
background_backgroundColor,
|
5606
|
-
|
5773
|
+
datasetXY,
|
5607
5774
|
radarAngleAxis,
|
5608
5775
|
radarRadiusAxis,
|
5609
5776
|
label_label,
|
@@ -5623,12 +5790,12 @@ const radarSpecPipeline = [
|
|
5623
5790
|
];
|
5624
5791
|
const funnel = [
|
5625
5792
|
initFunnel,
|
5626
|
-
|
5793
|
+
linearColor,
|
5627
5794
|
background_backgroundColor,
|
5628
|
-
|
5795
|
+
datasetXY,
|
5629
5796
|
label_label,
|
5630
5797
|
tooltip_tooltip,
|
5631
|
-
|
5798
|
+
colorLegend,
|
5632
5799
|
annotationPoint_annotationPoint,
|
5633
5800
|
annotationVerticalLine_annotationVerticalLine,
|
5634
5801
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -5641,34 +5808,76 @@ const pivotFunnel = [
|
|
5641
5808
|
datasetPivot,
|
5642
5809
|
pivotIndicators([
|
5643
5810
|
initFunnel,
|
5644
|
-
|
5811
|
+
linearColor,
|
5645
5812
|
background_backgroundColor,
|
5646
|
-
|
5813
|
+
datasetXY,
|
5647
5814
|
label_label,
|
5648
5815
|
tooltip_tooltip,
|
5816
|
+
colorLegend,
|
5649
5817
|
annotationPoint_annotationPoint,
|
5650
5818
|
annotationVerticalLine_annotationVerticalLine,
|
5651
5819
|
annotationHorizontalLine_annotationHorizontalLine,
|
5652
5820
|
annotationArea_annotationArea
|
5653
5821
|
]),
|
5654
5822
|
pivotRowDimensions,
|
5655
|
-
pivotColumnDimensions
|
5656
|
-
pivotDiscreteLegend
|
5823
|
+
pivotColumnDimensions
|
5657
5824
|
];
|
5658
5825
|
const funnelSpecPipeline = [
|
5659
5826
|
pivotAdapter_pivotAdapter(funnel, pivotFunnel)
|
5660
5827
|
];
|
5828
|
+
const initHeatmap = (spec, context)=>{
|
5829
|
+
const result = {
|
5830
|
+
...spec
|
5831
|
+
};
|
5832
|
+
const { advancedVSeed } = context;
|
5833
|
+
const { encoding } = advancedVSeed;
|
5834
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].color) return result;
|
5835
|
+
result.type = 'heatmap';
|
5836
|
+
result.direction = 'vertical';
|
5837
|
+
result.xField = encoding[0].x[0];
|
5838
|
+
result.yField = encoding[0].y[0];
|
5839
|
+
result.valueField = encoding[0].color[0];
|
5840
|
+
result.padding = 0;
|
5841
|
+
result.cell = {
|
5842
|
+
style: {
|
5843
|
+
shape: 'rect',
|
5844
|
+
stroke: '#ffffff',
|
5845
|
+
lineWidth: 1,
|
5846
|
+
fill: {
|
5847
|
+
field: encoding[0].color[0],
|
5848
|
+
scale: 'color'
|
5849
|
+
}
|
5850
|
+
}
|
5851
|
+
};
|
5852
|
+
result.axes = [
|
5853
|
+
{
|
5854
|
+
type: 'band',
|
5855
|
+
orient: 'left',
|
5856
|
+
bandPadding: 0
|
5857
|
+
},
|
5858
|
+
{
|
5859
|
+
type: 'band',
|
5860
|
+
orient: 'bottom',
|
5861
|
+
bandPadding: 0
|
5862
|
+
}
|
5863
|
+
];
|
5864
|
+
result.region = [
|
5865
|
+
{
|
5866
|
+
clip: true
|
5867
|
+
}
|
5868
|
+
];
|
5869
|
+
result.animation = true;
|
5870
|
+
return result;
|
5871
|
+
};
|
5661
5872
|
const heatmap = [
|
5662
|
-
|
5663
|
-
|
5873
|
+
initHeatmap,
|
5874
|
+
linearColor,
|
5664
5875
|
background_backgroundColor,
|
5665
|
-
|
5666
|
-
xBand,
|
5667
|
-
yLinear,
|
5876
|
+
datasetXY,
|
5668
5877
|
label_label,
|
5878
|
+
labelColorInversion,
|
5879
|
+
colorLegend,
|
5669
5880
|
tooltip_tooltip,
|
5670
|
-
verticalCrosshairLine,
|
5671
|
-
discreteLegend,
|
5672
5881
|
pointStyle_pointStyle,
|
5673
5882
|
pointStateDimensionHover,
|
5674
5883
|
lineStyle_lineStyle,
|
@@ -5683,15 +5892,14 @@ const pivotHeatmap = [
|
|
5683
5892
|
pivotIndicators_pivotIndicatorsAsRow,
|
5684
5893
|
datasetPivot,
|
5685
5894
|
pivotIndicators([
|
5686
|
-
|
5687
|
-
|
5895
|
+
initHeatmap,
|
5896
|
+
linearColor,
|
5688
5897
|
background_backgroundColor,
|
5689
|
-
|
5690
|
-
xBand,
|
5691
|
-
yLinear,
|
5898
|
+
datasetXY,
|
5692
5899
|
label_label,
|
5900
|
+
labelColorInversion,
|
5901
|
+
colorLegend,
|
5693
5902
|
tooltip_tooltip,
|
5694
|
-
verticalCrosshairLine,
|
5695
5903
|
pointStyle_pointStyle,
|
5696
5904
|
pointStateDimensionHover,
|
5697
5905
|
lineStyle_lineStyle,
|
@@ -5701,8 +5909,7 @@ const pivotHeatmap = [
|
|
5701
5909
|
annotationArea_annotationArea
|
5702
5910
|
]),
|
5703
5911
|
pivotRowDimensions,
|
5704
|
-
pivotColumnDimensions
|
5705
|
-
pivotDiscreteLegend
|
5912
|
+
pivotColumnDimensions
|
5706
5913
|
];
|
5707
5914
|
const heatmapSpecPipeline = [
|
5708
5915
|
pivotAdapter_pivotAdapter(heatmap, pivotHeatmap)
|
@@ -6620,7 +6827,24 @@ const lightTheme = ()=>{
|
|
6620
6827
|
'#ACB9FF',
|
6621
6828
|
'#B7C4FF',
|
6622
6829
|
'#C2CEFF'
|
6623
|
-
]
|
6830
|
+
].reverse()
|
6831
|
+
}
|
6832
|
+
},
|
6833
|
+
heatmap: {
|
6834
|
+
...baseConfig,
|
6835
|
+
color: {
|
6836
|
+
colorScheme: [
|
6837
|
+
'#5766EC',
|
6838
|
+
'#6372F0',
|
6839
|
+
'#7080F4',
|
6840
|
+
'#7C8CFA',
|
6841
|
+
'#8998FF',
|
6842
|
+
'#95A3FF',
|
6843
|
+
'#A0AEFF',
|
6844
|
+
'#ACB9FF',
|
6845
|
+
'#B7C4FF',
|
6846
|
+
'#C2CEFF'
|
6847
|
+
].reverse()
|
6624
6848
|
}
|
6625
6849
|
}
|
6626
6850
|
}
|
@@ -6924,6 +7148,9 @@ const darkTheme = ()=>{
|
|
6924
7148
|
'#A0CEFF'
|
6925
7149
|
]
|
6926
7150
|
}
|
7151
|
+
},
|
7152
|
+
heatmap: {
|
7153
|
+
...baseConfig
|
6927
7154
|
}
|
6928
7155
|
}
|
6929
7156
|
};
|
@@ -7198,6 +7425,9 @@ const zColor = external_zod_namespaceObject.z.object({
|
|
7198
7425
|
colorScheme: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()).optional(),
|
7199
7426
|
colorMapping: external_zod_namespaceObject.z.record(external_zod_namespaceObject.z.string(), external_zod_namespaceObject.z.string()).optional()
|
7200
7427
|
});
|
7428
|
+
const zLinearColor = external_zod_namespaceObject.z.object({
|
7429
|
+
colorScheme: external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string()).optional()
|
7430
|
+
});
|
7201
7431
|
const zLabel = external_zod_namespaceObject.z.object({
|
7202
7432
|
enable: external_zod_namespaceObject.z.boolean().default(true).optional()
|
7203
7433
|
});
|
@@ -7255,6 +7485,31 @@ const zLegend = external_zod_namespaceObject.z.object({
|
|
7255
7485
|
labelFontColor: external_zod_namespaceObject.z.string().default('#fff').optional(),
|
7256
7486
|
labelFontWeight: external_zod_namespaceObject.z.number().or(external_zod_namespaceObject.z.string()).default(400).optional()
|
7257
7487
|
});
|
7488
|
+
const zColorLegend = external_zod_namespaceObject.z.object({
|
7489
|
+
position: external_zod_namespaceObject.z["enum"]([
|
7490
|
+
'left',
|
7491
|
+
'leftTop',
|
7492
|
+
'leftBottom',
|
7493
|
+
'lt',
|
7494
|
+
'lb',
|
7495
|
+
'top',
|
7496
|
+
'topLeft',
|
7497
|
+
'topRight',
|
7498
|
+
'tl',
|
7499
|
+
'tr',
|
7500
|
+
'right',
|
7501
|
+
'rightTop',
|
7502
|
+
'rightBottom',
|
7503
|
+
'rt',
|
7504
|
+
'rb',
|
7505
|
+
'bottom',
|
7506
|
+
'bottomLeft',
|
7507
|
+
'bottomRight',
|
7508
|
+
'bl',
|
7509
|
+
'br'
|
7510
|
+
]).default('bottom').optional(),
|
7511
|
+
enable: external_zod_namespaceObject.z.boolean().default(true).optional()
|
7512
|
+
});
|
7258
7513
|
const zTooltip = external_zod_namespaceObject.z.object({
|
7259
7514
|
enable: external_zod_namespaceObject.z.boolean().default(true).optional()
|
7260
7515
|
});
|
@@ -7530,7 +7785,7 @@ const zLineStyle = external_zod_namespaceObject.z.object({
|
|
7530
7785
|
zSelector,
|
7531
7786
|
zSelectors
|
7532
7787
|
]).optional(),
|
7533
|
-
lineSmooth: external_zod_namespaceObject.z.boolean().
|
7788
|
+
lineSmooth: external_zod_namespaceObject.z.boolean().optional(),
|
7534
7789
|
lineColor: external_zod_namespaceObject.z.string().optional(),
|
7535
7790
|
lineColorOpacity: external_zod_namespaceObject.z.number().optional(),
|
7536
7791
|
lineWidth: external_zod_namespaceObject.z.number().optional(),
|
@@ -8087,9 +8342,9 @@ const zFunnel = external_zod_namespaceObject.z.object({
|
|
8087
8342
|
dimensions: zDimensions.optional(),
|
8088
8343
|
measures: zMeasureTree.optional(),
|
8089
8344
|
backgroundColor: zBackgroundColor.optional(),
|
8090
|
-
color:
|
8345
|
+
color: zLinearColor.optional(),
|
8091
8346
|
label: zLabel.optional(),
|
8092
|
-
legend:
|
8347
|
+
legend: zColorLegend.optional(),
|
8093
8348
|
tooltip: zTooltip.optional(),
|
8094
8349
|
theme: zTheme.optional(),
|
8095
8350
|
locale: zLocale.optional()
|
@@ -8100,9 +8355,9 @@ const zHeatmap = external_zod_namespaceObject.z.object({
|
|
8100
8355
|
dimensions: zDimensions.optional(),
|
8101
8356
|
measures: zMeasureTree.optional(),
|
8102
8357
|
backgroundColor: zBackgroundColor.optional(),
|
8103
|
-
color:
|
8358
|
+
color: zLinearColor.optional(),
|
8104
8359
|
label: zLabel.optional(),
|
8105
|
-
legend:
|
8360
|
+
legend: zColorLegend.optional(),
|
8106
8361
|
tooltip: zTooltip.optional(),
|
8107
8362
|
theme: zTheme.optional(),
|
8108
8363
|
locale: zLocale.optional()
|
@@ -8271,6 +8526,7 @@ exports.zBarPercentConfig = __webpack_exports__.zBarPercentConfig;
|
|
8271
8526
|
exports.zBarStyle = __webpack_exports__.zBarStyle;
|
8272
8527
|
exports.zChartType = __webpack_exports__.zChartType;
|
8273
8528
|
exports.zColor = __webpack_exports__.zColor;
|
8529
|
+
exports.zColorLegend = __webpack_exports__.zColorLegend;
|
8274
8530
|
exports.zColumn = __webpack_exports__.zColumn;
|
8275
8531
|
exports.zColumnConfig = __webpack_exports__.zColumnConfig;
|
8276
8532
|
exports.zColumnParallel = __webpack_exports__.zColumnParallel;
|
@@ -8303,6 +8559,7 @@ exports.zLegend = __webpack_exports__.zLegend;
|
|
8303
8559
|
exports.zLine = __webpack_exports__.zLine;
|
8304
8560
|
exports.zLineConfig = __webpack_exports__.zLineConfig;
|
8305
8561
|
exports.zLineStyle = __webpack_exports__.zLineStyle;
|
8562
|
+
exports.zLinearColor = __webpack_exports__.zLinearColor;
|
8306
8563
|
exports.zLocale = __webpack_exports__.zLocale;
|
8307
8564
|
exports.zMarkStyle = __webpack_exports__.zMarkStyle;
|
8308
8565
|
exports.zMeasure = __webpack_exports__.zMeasure;
|
@@ -8464,6 +8721,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
8464
8721
|
"zBarStyle",
|
8465
8722
|
"zChartType",
|
8466
8723
|
"zColor",
|
8724
|
+
"zColorLegend",
|
8467
8725
|
"zColumn",
|
8468
8726
|
"zColumnConfig",
|
8469
8727
|
"zColumnParallel",
|
@@ -8496,6 +8754,7 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
8496
8754
|
"zLine",
|
8497
8755
|
"zLineConfig",
|
8498
8756
|
"zLineStyle",
|
8757
|
+
"zLinearColor",
|
8499
8758
|
"zLocale",
|
8500
8759
|
"zMarkStyle",
|
8501
8760
|
"zMeasure",
|