@visactor/vseed 0.0.16 → 0.0.18
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 +801 -174
- package/dist/builder/builder/builder.d.ts.map +1 -1
- package/dist/builder/register/all.d.ts.map +1 -1
- package/dist/builder/register/chartType.d.ts +2 -0
- package/dist/builder/register/chartType.d.ts.map +1 -1
- package/dist/dataReshape/dataReshapeFor1D1M.d.ts.map +1 -1
- package/dist/dataReshape/dataReshapeFor1D2M.d.ts +20 -0
- package/dist/dataReshape/dataReshapeFor1D2M.d.ts.map +1 -0
- package/dist/dataReshape/dataReshapeFor2D1M.d.ts.map +1 -1
- package/dist/dataReshape/index.d.ts +1 -0
- package/dist/dataReshape/index.d.ts.map +1 -1
- package/dist/index.cjs +866 -187
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +744 -134
- package/dist/index.js.map +1 -1
- package/dist/pipeline/advanced/pipeline/funnel.d.ts +3 -0
- package/dist/pipeline/advanced/pipeline/funnel.d.ts.map +1 -0
- package/dist/pipeline/advanced/pipeline/index.d.ts +2 -0
- package/dist/pipeline/advanced/pipeline/index.d.ts.map +1 -1
- package/dist/pipeline/advanced/pipeline/scatter.d.ts +3 -0
- package/dist/pipeline/advanced/pipeline/scatter.d.ts.map +1 -0
- package/dist/pipeline/advanced/pipes/config/config.d.ts +2 -0
- package/dist/pipeline/advanced/pipes/config/config.d.ts.map +1 -1
- package/dist/pipeline/advanced/pipes/encoding/encodingFunnel.d.ts +3 -0
- package/dist/pipeline/advanced/pipes/encoding/encodingFunnel.d.ts.map +1 -0
- package/dist/pipeline/advanced/pipes/encoding/encodingYY.d.ts +3 -0
- package/dist/pipeline/advanced/pipes/encoding/encodingYY.d.ts.map +1 -0
- package/dist/pipeline/advanced/pipes/encoding/index.d.ts +1 -0
- package/dist/pipeline/advanced/pipes/encoding/index.d.ts.map +1 -1
- package/dist/pipeline/advanced/pipes/reshape/index.d.ts +2 -0
- package/dist/pipeline/advanced/pipes/reshape/index.d.ts.map +1 -1
- package/dist/pipeline/advanced/pipes/reshape/pivotReshapeTo1D2M.d.ts +9 -0
- package/dist/pipeline/advanced/pipes/reshape/pivotReshapeTo1D2M.d.ts.map +1 -0
- package/dist/pipeline/advanced/pipes/reshape/reshapeTo1D2M.d.ts +9 -0
- package/dist/pipeline/advanced/pipes/reshape/reshapeTo1D2M.d.ts.map +1 -0
- package/dist/pipeline/spec/pipeline/area.d.ts.map +1 -1
- package/dist/pipeline/spec/pipeline/funnel.d.ts +3 -0
- package/dist/pipeline/spec/pipeline/funnel.d.ts.map +1 -0
- package/dist/pipeline/spec/pipeline/index.d.ts +2 -0
- package/dist/pipeline/spec/pipeline/index.d.ts.map +1 -1
- package/dist/pipeline/spec/pipeline/line.d.ts.map +1 -1
- package/dist/pipeline/spec/pipeline/roseParallel.d.ts.map +1 -1
- package/dist/pipeline/spec/pipeline/scatter.d.ts +3 -0
- package/dist/pipeline/spec/pipeline/scatter.d.ts.map +1 -0
- package/dist/pipeline/spec/pipes/vchart/annotation/annotationHorizontalLine.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/annotation/annotationVerticalLine.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/axes/xLinear.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/axes/yLinear.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/color/color.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/crosshair/horizontalCrosshairLine.d.ts +3 -0
- package/dist/pipeline/spec/pipes/vchart/crosshair/horizontalCrosshairLine.d.ts.map +1 -0
- package/dist/pipeline/spec/pipes/vchart/crosshair/index.d.ts +1 -0
- package/dist/pipeline/spec/pipes/vchart/crosshair/index.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/dataset/dataset.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/init/funnel.d.ts +3 -0
- package/dist/pipeline/spec/pipes/vchart/init/funnel.d.ts.map +1 -0
- package/dist/pipeline/spec/pipes/vchart/init/index.d.ts +1 -0
- package/dist/pipeline/spec/pipes/vchart/init/index.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/init/pie.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/init/roseParallel.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/init/scatter.d.ts +3 -0
- package/dist/pipeline/spec/pipes/vchart/init/scatter.d.ts.map +1 -0
- package/dist/pipeline/spec/pipes/vchart/markStyle/barStyle.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/markStyle/index.d.ts +1 -0
- package/dist/pipeline/spec/pipes/vchart/markStyle/index.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/markStyle/pointState.d.ts +4 -0
- package/dist/pipeline/spec/pipes/vchart/markStyle/pointState.d.ts.map +1 -0
- package/dist/pipeline/spec/pipes/vchart/markStyle/pointStyle.d.ts.map +1 -1
- package/dist/pipeline/spec/pipes/vchart/tooltip/tooltip.d.ts.map +1 -1
- package/dist/pipeline/utils/measures/findMeasureById.d.ts +2 -1
- package/dist/pipeline/utils/measures/findMeasureById.d.ts.map +1 -1
- package/dist/pipeline/utils/measures/index.d.ts +1 -1
- package/dist/pipeline/utils/measures/index.d.ts.map +1 -1
- package/dist/theme/dark.d.ts.map +1 -1
- package/dist/theme/light.d.ts.map +1 -1
- package/dist/types/advancedVSeed.d.ts +181 -22
- package/dist/types/advancedVSeed.d.ts.map +1 -1
- package/dist/types/chartType/area/area.d.ts +414 -14
- package/dist/types/chartType/area/area.d.ts.map +1 -1
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +414 -14
- package/dist/types/chartType/areaPercent/areaPercent.d.ts.map +1 -1
- package/dist/types/chartType/bar/bar.d.ts +414 -14
- package/dist/types/chartType/bar/bar.d.ts.map +1 -1
- package/dist/types/chartType/barParallel/barParallel.d.ts +414 -14
- package/dist/types/chartType/barParallel/barParallel.d.ts.map +1 -1
- package/dist/types/chartType/barPercent/barPercent.d.ts +414 -14
- package/dist/types/chartType/barPercent/barPercent.d.ts.map +1 -1
- package/dist/types/chartType/column/column.d.ts +414 -14
- package/dist/types/chartType/column/column.d.ts.map +1 -1
- package/dist/types/chartType/columnParallel/columnParallel.d.ts +414 -14
- package/dist/types/chartType/columnParallel/columnParallel.d.ts.map +1 -1
- package/dist/types/chartType/columnPercent/columnPercent.d.ts +414 -14
- package/dist/types/chartType/columnPercent/columnPercent.d.ts.map +1 -1
- package/dist/types/chartType/donut/donut.d.ts +2 -2
- package/dist/types/chartType/funnel/funnel.d.ts +224 -0
- package/dist/types/chartType/funnel/funnel.d.ts.map +1 -0
- package/dist/types/chartType/funnel/index.d.ts +2 -0
- package/dist/types/chartType/funnel/index.d.ts.map +1 -0
- package/dist/types/chartType/index.d.ts +2 -0
- package/dist/types/chartType/index.d.ts.map +1 -1
- package/dist/types/chartType/line/line.d.ts +414 -14
- package/dist/types/chartType/line/line.d.ts.map +1 -1
- package/dist/types/chartType/pie/pie.d.ts +2 -2
- package/dist/types/chartType/rose/rose.d.ts +2 -2
- package/dist/types/chartType/roseParallel/roseParallel.d.ts +2 -2
- package/dist/types/chartType/scatter/index.d.ts +2 -0
- package/dist/types/chartType/scatter/index.d.ts.map +1 -0
- package/dist/types/chartType/scatter/scatter.d.ts +1243 -0
- package/dist/types/chartType/scatter/scatter.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/properties/annotation/annotation.d.ts +0 -8
- package/dist/types/properties/annotation/annotation.d.ts.map +1 -1
- package/dist/types/properties/annotation/annotationHorizontalLine.d.ts +0 -2
- package/dist/types/properties/annotation/annotationHorizontalLine.d.ts.map +1 -1
- package/dist/types/properties/annotation/annotationVerticalLine.d.ts +0 -2
- package/dist/types/properties/annotation/annotationVerticalLine.d.ts.map +1 -1
- package/dist/types/properties/baseConfig/color.d.ts +2 -2
- package/dist/types/properties/baseConfig/color.d.ts.map +1 -1
- package/dist/types/properties/chartType/chartType.d.ts +6 -2
- package/dist/types/properties/chartType/chartType.d.ts.map +1 -1
- package/dist/types/properties/config/axis.d.ts +1 -1
- package/dist/types/properties/config/config.d.ts +88 -2
- package/dist/types/properties/config/config.d.ts.map +1 -1
- package/dist/types/properties/dimensions/dimensions.d.ts +4 -4
- package/dist/types/properties/encoding/encoding.d.ts +2 -0
- package/dist/types/properties/encoding/encoding.d.ts.map +1 -1
- package/dist/types/properties/theme/customTheme.d.ts +176 -20
- package/dist/types/properties/theme/customTheme.d.ts.map +1 -1
- package/dist/types/vseed.d.ts +6803 -1552
- package/dist/types/vseed.d.ts.map +1 -1
- package/dist/umd/999.js +3574 -0
- package/dist/umd/999.js.map +1 -0
- package/dist/umd/index.js +6170 -8933
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -150,7 +150,7 @@ const NUMBER_FORMAT_RULES = {
|
|
150
150
|
};
|
151
151
|
const createFormatter = (format)=>createNumFormatter(format);
|
152
152
|
const autoFormatter = (value, locale)=>autoNumFormatter(value, locale);
|
153
|
-
|
153
|
+
const findMeasureById = (measures, id)=>{
|
154
154
|
if (!measures) return;
|
155
155
|
const stack = [
|
156
156
|
...measures
|
@@ -161,7 +161,22 @@ function findMeasureById(measures, id) {
|
|
161
161
|
if (current.id === id && !('children' in current)) return current;
|
162
162
|
if ('children' in current && current.children) stack.push(...current.children);
|
163
163
|
}
|
164
|
-
}
|
164
|
+
};
|
165
|
+
const findFirstMeasure = (measures)=>{
|
166
|
+
if (!measures) return;
|
167
|
+
const stack = [
|
168
|
+
...measures
|
169
|
+
].reverse();
|
170
|
+
while(stack.length > 0){
|
171
|
+
const current = stack.pop();
|
172
|
+
if (!current) continue;
|
173
|
+
if (!('children' in current)) return current;
|
174
|
+
if ('children' in current && current.children) {
|
175
|
+
const children = (current.children || []).reverse();
|
176
|
+
stack.push(...children);
|
177
|
+
}
|
178
|
+
}
|
179
|
+
};
|
165
180
|
const autoMeasures = (advancedVSeed, context)=>{
|
166
181
|
const result = {
|
167
182
|
...advancedVSeed
|
@@ -379,14 +394,17 @@ const dataReshapeFor2D1M = (dataset, dimensions, measures, options)=>{
|
|
379
394
|
};
|
380
395
|
}
|
381
396
|
{
|
382
|
-
const
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
397
|
+
const onlyOneMeasure = 1 === measures.length;
|
398
|
+
const onlyOneDimension = 1 === dimensions.length;
|
399
|
+
const dims = [
|
400
|
+
...dimensions
|
401
|
+
];
|
402
|
+
if (!onlyOneMeasure || onlyOneDimension) dims.push({
|
403
|
+
id: foldMeasureName,
|
404
|
+
alias: i18n`指标名称`,
|
405
|
+
location: 'dimension'
|
406
|
+
});
|
407
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, dims, [
|
390
408
|
{
|
391
409
|
id: foldMeasureValue,
|
392
410
|
alias: i18n`指标值`
|
@@ -438,13 +456,70 @@ const dataReshapeFor1D1M = (dataset, dimensions, measures, options)=>{
|
|
438
456
|
};
|
439
457
|
}
|
440
458
|
{
|
441
|
-
const
|
459
|
+
const dims = 1 === measures.length ? [
|
460
|
+
...dimensions
|
461
|
+
] : [
|
442
462
|
...dimensions,
|
443
463
|
{
|
444
464
|
id: foldMeasureName,
|
445
465
|
alias: i18n`指标名称`,
|
446
466
|
location: 'dimension'
|
447
467
|
}
|
468
|
+
];
|
469
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, dims, [
|
470
|
+
{
|
471
|
+
id: foldMeasureValue,
|
472
|
+
alias: i18n`指标值`
|
473
|
+
}
|
474
|
+
], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
475
|
+
return {
|
476
|
+
dataset: finalDataset,
|
477
|
+
foldInfo,
|
478
|
+
unfoldInfo
|
479
|
+
};
|
480
|
+
}
|
481
|
+
};
|
482
|
+
const dataReshapeFor1D2M_emptyReshapeResult = {
|
483
|
+
dataset: [],
|
484
|
+
foldInfo: {
|
485
|
+
foldMap: {},
|
486
|
+
measureId: '',
|
487
|
+
measureName: '',
|
488
|
+
measureValue: ''
|
489
|
+
},
|
490
|
+
unfoldInfo: {
|
491
|
+
groupName: '',
|
492
|
+
groupId: '',
|
493
|
+
colorItems: [],
|
494
|
+
colorIdMap: {}
|
495
|
+
}
|
496
|
+
};
|
497
|
+
const dataReshapeFor1D2M = (dataset, dimensions, measures, options)=>{
|
498
|
+
const { foldMeasureId = FoldMeasureId, foldMeasureName = FoldMeasureName, foldMeasureValue = FoldMeasureValue, unfoldDimensionGroup = UnfoldDimensionGroup, unfoldDimensionGroupId = UnfoldDimensionGroupId } = options || {};
|
499
|
+
if (0 === dimensions.length && 0 === measures.length) return dataReshapeFor1D2M_emptyReshapeResult;
|
500
|
+
const { dataset: foldedDataset, foldInfo } = foldMeasures(dataset, measures.length > 1 ? measures.slice(1) : measures, foldMeasureId, foldMeasureName, foldMeasureValue);
|
501
|
+
if (0 === dimensions.length) {
|
502
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, [
|
503
|
+
{
|
504
|
+
id: foldMeasureValue,
|
505
|
+
alias: i18n`指标值`,
|
506
|
+
location: 'dimension'
|
507
|
+
}
|
508
|
+
], [
|
509
|
+
{
|
510
|
+
id: foldMeasureValue,
|
511
|
+
alias: i18n`指标值`
|
512
|
+
}
|
513
|
+
], 0, unfoldDimensionGroup, unfoldDimensionGroupId, foldMeasureId);
|
514
|
+
return {
|
515
|
+
dataset: finalDataset,
|
516
|
+
foldInfo,
|
517
|
+
unfoldInfo
|
518
|
+
};
|
519
|
+
}
|
520
|
+
{
|
521
|
+
const { dataset: finalDataset, unfoldInfo } = unfoldDimensions(foldedDataset, [
|
522
|
+
...dimensions
|
448
523
|
], [
|
449
524
|
{
|
450
525
|
id: foldMeasureValue,
|
@@ -504,6 +579,28 @@ const reshapeTo1D1M = (advancedVSeed, context)=>{
|
|
504
579
|
]
|
505
580
|
};
|
506
581
|
};
|
582
|
+
const reshapeTo1D2M = (advancedVSeed, context)=>{
|
583
|
+
const result = {
|
584
|
+
...advancedVSeed
|
585
|
+
};
|
586
|
+
const { vseed } = context;
|
587
|
+
const { dataset } = vseed;
|
588
|
+
const { dimensions, measures } = advancedVSeed;
|
589
|
+
if (!measures || !dimensions || !dataset) return result;
|
590
|
+
if (0 === measures.length) throw new Error('measures can not be empty');
|
591
|
+
const { dataset: newDatasets, foldInfo, unfoldInfo } = dataReshapeFor1D2M(dataset, dimensions, measures);
|
592
|
+
return {
|
593
|
+
...result,
|
594
|
+
dataset: newDatasets,
|
595
|
+
datasetReshapeInfo: [
|
596
|
+
{
|
597
|
+
id: '1D2M',
|
598
|
+
foldInfo,
|
599
|
+
unfoldInfo
|
600
|
+
}
|
601
|
+
]
|
602
|
+
};
|
603
|
+
};
|
507
604
|
const pivotReshapeTo1D1M = (advancedVSeed, context)=>{
|
508
605
|
const result = {
|
509
606
|
...advancedVSeed
|
@@ -543,6 +640,45 @@ const pivotReshapeTo1D1M = (advancedVSeed, context)=>{
|
|
543
640
|
datasetReshapeInfo: datasetReshapeInfo
|
544
641
|
};
|
545
642
|
};
|
643
|
+
const pivotReshapeTo1D2M = (advancedVSeed, context)=>{
|
644
|
+
const result = {
|
645
|
+
...advancedVSeed
|
646
|
+
};
|
647
|
+
const { vseed } = context;
|
648
|
+
const { dataset } = vseed;
|
649
|
+
const { dimensions, measures } = advancedVSeed;
|
650
|
+
if (!measures || !dimensions) return result;
|
651
|
+
const measureGroups = [];
|
652
|
+
if (measures) measures.forEach((measure)=>{
|
653
|
+
if (measure.children && measure.children.length > 0) measureGroups.push(measure);
|
654
|
+
});
|
655
|
+
const newDatasets = [];
|
656
|
+
const datasetReshapeInfo = [];
|
657
|
+
measureGroups.forEach((measureGroup)=>{
|
658
|
+
const measures = measureGroup.children;
|
659
|
+
if (!measures) return;
|
660
|
+
const commonDimensions = dimensions.filter((dim)=>'dimension' === dim.location);
|
661
|
+
const groupId = measureGroup.id;
|
662
|
+
const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeFor1D2M(dataset, commonDimensions, measures, {
|
663
|
+
foldMeasureId: FoldMeasureId,
|
664
|
+
foldMeasureName: FoldMeasureName,
|
665
|
+
foldMeasureValue: FoldMeasureValue + groupId,
|
666
|
+
unfoldDimensionGroup: UnfoldDimensionGroup
|
667
|
+
});
|
668
|
+
const reshapeInfo = {
|
669
|
+
id: groupId,
|
670
|
+
foldInfo,
|
671
|
+
unfoldInfo
|
672
|
+
};
|
673
|
+
newDatasets.push(newSubDataset);
|
674
|
+
datasetReshapeInfo.push(reshapeInfo);
|
675
|
+
});
|
676
|
+
return {
|
677
|
+
...result,
|
678
|
+
dataset: newDatasets,
|
679
|
+
datasetReshapeInfo: datasetReshapeInfo
|
680
|
+
};
|
681
|
+
};
|
546
682
|
const pivotReshapeTo2D1M = (advancedVSeed, context)=>{
|
547
683
|
const result = {
|
548
684
|
...advancedVSeed
|
@@ -726,6 +862,37 @@ const encodingPie = (advancedVSeed)=>{
|
|
726
862
|
encoding
|
727
863
|
};
|
728
864
|
};
|
865
|
+
const encodingFunnel = (advancedVSeed)=>{
|
866
|
+
const result = {
|
867
|
+
...advancedVSeed
|
868
|
+
};
|
869
|
+
const { datasetReshapeInfo, dimensions } = advancedVSeed;
|
870
|
+
if (!datasetReshapeInfo || !dimensions) return result;
|
871
|
+
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
872
|
+
const { foldInfo, unfoldInfo } = cur;
|
873
|
+
const size = [
|
874
|
+
foldInfo.measureValue
|
875
|
+
];
|
876
|
+
const group = [
|
877
|
+
unfoldInfo.groupId
|
878
|
+
];
|
879
|
+
const color = [
|
880
|
+
unfoldInfo.groupId
|
881
|
+
];
|
882
|
+
return [
|
883
|
+
...prev,
|
884
|
+
{
|
885
|
+
size,
|
886
|
+
group,
|
887
|
+
color
|
888
|
+
}
|
889
|
+
];
|
890
|
+
}, []);
|
891
|
+
return {
|
892
|
+
...result,
|
893
|
+
encoding
|
894
|
+
};
|
895
|
+
};
|
729
896
|
const vchartBaseConfig = (advancedVSeed, context)=>{
|
730
897
|
const { vseed } = context;
|
731
898
|
const result = {
|
@@ -801,6 +968,7 @@ const pieConfig = (advancedVSeed, context)=>{
|
|
801
968
|
};
|
802
969
|
const areaConfig = lineConfig;
|
803
970
|
const areaPercentConfig = lineConfig;
|
971
|
+
const scatterConfig = lineConfig;
|
804
972
|
const barConfig = columnConfig;
|
805
973
|
const barParallelConfig = columnConfig;
|
806
974
|
const barPercentConfig = columnConfig;
|
@@ -809,6 +977,7 @@ const columnPercentConfig = columnConfig;
|
|
809
977
|
const donutConfig = pieConfig;
|
810
978
|
const roseConfig = pieConfig;
|
811
979
|
const roseParallelConfig = pieConfig;
|
980
|
+
const funnelConfig = pieConfig;
|
812
981
|
const vchartTheme = (advancedVSeed, context)=>{
|
813
982
|
const { customTheme, vseed } = context;
|
814
983
|
const { theme = 'light', chartType } = vseed;
|
@@ -1093,12 +1262,96 @@ const roseParallelAdvancedPipeline = [
|
|
1093
1262
|
markStyle_markStyle,
|
1094
1263
|
annotation_annotation
|
1095
1264
|
];
|
1265
|
+
const funnelAdvancedPipeline = [
|
1266
|
+
initAdvancedVSeed,
|
1267
|
+
locale_locale,
|
1268
|
+
autoMeasures,
|
1269
|
+
autoDimensions,
|
1270
|
+
pivotAdapter([
|
1271
|
+
reshapeTo1D1M
|
1272
|
+
], [
|
1273
|
+
pivotReshapeTo1D1M
|
1274
|
+
]),
|
1275
|
+
encodingFunnel,
|
1276
|
+
funnelConfig,
|
1277
|
+
vchartBaseConfig,
|
1278
|
+
vchartTheme,
|
1279
|
+
annotation_annotation
|
1280
|
+
];
|
1281
|
+
const encodingYY = (advancedVSeed)=>{
|
1282
|
+
const result = {
|
1283
|
+
...advancedVSeed
|
1284
|
+
};
|
1285
|
+
const { datasetReshapeInfo, measures } = advancedVSeed;
|
1286
|
+
if (!datasetReshapeInfo || !measures) return result;
|
1287
|
+
const firstMeasure = findFirstMeasure(measures);
|
1288
|
+
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
1289
|
+
const { foldInfo, unfoldInfo } = cur;
|
1290
|
+
const x = [
|
1291
|
+
firstMeasure?.id
|
1292
|
+
];
|
1293
|
+
const y = [
|
1294
|
+
foldInfo.measureValue
|
1295
|
+
];
|
1296
|
+
const group = [
|
1297
|
+
unfoldInfo.groupId
|
1298
|
+
];
|
1299
|
+
const color = [
|
1300
|
+
unfoldInfo.groupId
|
1301
|
+
];
|
1302
|
+
return [
|
1303
|
+
...prev,
|
1304
|
+
{
|
1305
|
+
x,
|
1306
|
+
y,
|
1307
|
+
group,
|
1308
|
+
color
|
1309
|
+
}
|
1310
|
+
];
|
1311
|
+
}, []);
|
1312
|
+
return {
|
1313
|
+
...result,
|
1314
|
+
encoding
|
1315
|
+
};
|
1316
|
+
};
|
1317
|
+
const scatterAdvancedPipeline = [
|
1318
|
+
initAdvancedVSeed,
|
1319
|
+
locale_locale,
|
1320
|
+
autoMeasures,
|
1321
|
+
autoDimensions,
|
1322
|
+
pivotAdapter([
|
1323
|
+
reshapeTo1D2M
|
1324
|
+
], [
|
1325
|
+
pivotReshapeTo1D2M
|
1326
|
+
]),
|
1327
|
+
encodingYY,
|
1328
|
+
vchartBaseConfig,
|
1329
|
+
scatterConfig,
|
1330
|
+
vchartTheme,
|
1331
|
+
markStyle_markStyle,
|
1332
|
+
annotation_annotation
|
1333
|
+
];
|
1096
1334
|
const dataset_dataset = (spec, context)=>{
|
1097
1335
|
const { advancedVSeed } = context;
|
1336
|
+
const { encoding } = advancedVSeed;
|
1337
|
+
const angle = encoding[0]?.angle?.[0];
|
1338
|
+
const x = encoding[0]?.x?.[0];
|
1339
|
+
const group = encoding[0]?.group?.[0];
|
1340
|
+
const fields = {};
|
1341
|
+
if (angle) fields[angle] = {
|
1342
|
+
sortIndex: 0
|
1343
|
+
};
|
1344
|
+
if (x) fields[x] = {
|
1345
|
+
sortIndex: 0
|
1346
|
+
};
|
1347
|
+
if (group) fields[group] = {
|
1348
|
+
sortIndex: 1
|
1349
|
+
};
|
1098
1350
|
return {
|
1099
1351
|
...spec,
|
1100
1352
|
data: {
|
1101
|
-
values: advancedVSeed.dataset
|
1353
|
+
values: advancedVSeed.dataset,
|
1354
|
+
fields: fields
|
1102
1355
|
}
|
1103
1356
|
};
|
1104
1357
|
};
|
@@ -1280,7 +1533,8 @@ const initPie = (spec, context)=>{
|
|
1280
1533
|
result.pie = {
|
1281
1534
|
style: {
|
1282
1535
|
stroke: '#ffffff',
|
1283
|
-
lineWidth: 1
|
1536
|
+
lineWidth: 1,
|
1537
|
+
centerOffset: 0
|
1284
1538
|
},
|
1285
1539
|
state: {
|
1286
1540
|
hover: {
|
@@ -1350,7 +1604,7 @@ const initRose = (spec, context)=>{
|
|
1350
1604
|
state: {
|
1351
1605
|
hover: {
|
1352
1606
|
lineWidth: 1,
|
1353
|
-
fillOpacity: 0.
|
1607
|
+
fillOpacity: 0.6
|
1354
1608
|
}
|
1355
1609
|
}
|
1356
1610
|
};
|
@@ -1386,6 +1640,12 @@ const initRoseParallel = (spec, context)=>{
|
|
1386
1640
|
style: {
|
1387
1641
|
stroke: '#ffffff',
|
1388
1642
|
lineWidth: 1
|
1643
|
+
},
|
1644
|
+
state: {
|
1645
|
+
hover: {
|
1646
|
+
lineWidth: 1,
|
1647
|
+
fillOpacity: 0.6
|
1648
|
+
}
|
1389
1649
|
}
|
1390
1650
|
};
|
1391
1651
|
result.region = [
|
@@ -1412,6 +1672,42 @@ const initPivot = (spec)=>{
|
|
1412
1672
|
indicatorsAsCol: false
|
1413
1673
|
};
|
1414
1674
|
};
|
1675
|
+
const initFunnel = (spec, context)=>{
|
1676
|
+
const result = {
|
1677
|
+
...spec
|
1678
|
+
};
|
1679
|
+
const { advancedVSeed } = context;
|
1680
|
+
const { encoding } = advancedVSeed;
|
1681
|
+
if (!encoding[0].size || !encoding[0].group || !encoding[0].color) return result;
|
1682
|
+
result.type = 'funnel';
|
1683
|
+
result.valueField = encoding[0].size[0];
|
1684
|
+
result.categoryField = encoding[0].group[0];
|
1685
|
+
result.padding = 0;
|
1686
|
+
result.isTransform = true;
|
1687
|
+
result.shape = 'rect';
|
1688
|
+
result.maxSize = '75%';
|
1689
|
+
result.minSize = '10%';
|
1690
|
+
result.region = [
|
1691
|
+
{
|
1692
|
+
clip: true
|
1693
|
+
}
|
1694
|
+
];
|
1695
|
+
result.funnel = {
|
1696
|
+
style: {
|
1697
|
+
cornerRadius: 4
|
1698
|
+
},
|
1699
|
+
state: {
|
1700
|
+
hover: {
|
1701
|
+
fillOpacity: 0.6
|
1702
|
+
}
|
1703
|
+
}
|
1704
|
+
};
|
1705
|
+
result.transformLabel = {
|
1706
|
+
visible: true
|
1707
|
+
};
|
1708
|
+
result.animation = true;
|
1709
|
+
return result;
|
1710
|
+
};
|
1415
1711
|
const xBand = (spec, context)=>{
|
1416
1712
|
const result = {
|
1417
1713
|
...spec
|
@@ -1580,7 +1876,7 @@ const xLinear = (spec, context)=>{
|
|
1580
1876
|
}
|
1581
1877
|
},
|
1582
1878
|
innerOffset: {
|
1583
|
-
|
1879
|
+
right: LINEAR_AXIS_INNER_OFFSET_TOP
|
1584
1880
|
}
|
1585
1881
|
};
|
1586
1882
|
result.axes = [
|
@@ -1891,6 +2187,9 @@ const tooltip_tooltip = (spec, context)=>{
|
|
1891
2187
|
result.tooltip = {
|
1892
2188
|
visible: enable,
|
1893
2189
|
mark: {
|
2190
|
+
title: {
|
2191
|
+
value: (datum)=>datum && datum[groupName] || ''
|
2192
|
+
},
|
1894
2193
|
content: [
|
1895
2194
|
{
|
1896
2195
|
visible: true,
|
@@ -2134,11 +2433,11 @@ const pivotDiscreteLegend = (spec, context)=>{
|
|
2134
2433
|
label: d,
|
2135
2434
|
shape: {
|
2136
2435
|
outerBorder: border ? {
|
2137
|
-
stroke: colorScheme[index],
|
2436
|
+
stroke: colorScheme?.[index],
|
2138
2437
|
distance: 3,
|
2139
2438
|
lineWidth: 1
|
2140
2439
|
} : void 0,
|
2141
|
-
fill: colorScheme[index]
|
2440
|
+
fill: colorScheme?.[index]
|
2142
2441
|
}
|
2143
2442
|
})),
|
2144
2443
|
item: {
|
@@ -2190,8 +2489,8 @@ const color_color = (spec, context)=>{
|
|
2190
2489
|
const { color } = baseConfig;
|
2191
2490
|
const { colorScheme, colorMapping } = color;
|
2192
2491
|
const mappingList = [];
|
2193
|
-
if (colorMapping) Object.entries(colorMapping).forEach(([key, value])=>{
|
2194
|
-
const idMap = Object.entries(unfoldInfo.colorIdMap).filter(([_, v])=>key
|
2492
|
+
if (colorMapping) Object.entries(colorMapping).sort((a, b)=>a[0].split(Separator).length - b[0].split(Separator).length).forEach(([key, value])=>{
|
2493
|
+
const idMap = Object.entries(unfoldInfo.colorIdMap).filter(([_, v])=>v.includes(key));
|
2195
2494
|
for (const [colorId] of idMap)mappingList.push([
|
2196
2495
|
colorId,
|
2197
2496
|
value
|
@@ -2522,19 +2821,17 @@ const isDimensionSelector = (selector)=>'object' == typeof selector && null !==
|
|
2522
2821
|
].includes(selector.op));
|
2523
2822
|
const barStyle_barStyle = (spec, context)=>{
|
2524
2823
|
const { advancedVSeed } = context;
|
2525
|
-
const { markStyle
|
2824
|
+
const { markStyle } = advancedVSeed;
|
2526
2825
|
const { barStyle } = markStyle;
|
2527
2826
|
const result = {
|
2528
2827
|
...spec,
|
2529
2828
|
bar: {
|
2829
|
+
style: {
|
2830
|
+
stroke: '#fff',
|
2831
|
+
lineWidth: 1
|
2832
|
+
},
|
2530
2833
|
state: {
|
2531
2834
|
hover: {
|
2532
|
-
stroke: (datum, context)=>{
|
2533
|
-
const field = encoding[0]?.group?.[0];
|
2534
|
-
const color = context.seriesColor(datum[field]);
|
2535
|
-
return color;
|
2536
|
-
},
|
2537
|
-
lineWidth: 4,
|
2538
2835
|
fillOpacity: 0.6
|
2539
2836
|
}
|
2540
2837
|
}
|
@@ -2590,14 +2887,7 @@ const pointStyle_pointStyle = (spec, context)=>{
|
|
2590
2887
|
const { pointStyle } = markStyle;
|
2591
2888
|
const result = {
|
2592
2889
|
...spec,
|
2593
|
-
point: {
|
2594
|
-
state: {
|
2595
|
-
dimension_hover: {
|
2596
|
-
scaleX: 1.4,
|
2597
|
-
scaleY: 1.4
|
2598
|
-
}
|
2599
|
-
}
|
2600
|
-
}
|
2890
|
+
point: {}
|
2601
2891
|
};
|
2602
2892
|
if (!pointStyle) return result;
|
2603
2893
|
const pointStyles = Array.isArray(pointStyle) ? pointStyle : [
|
@@ -2643,6 +2933,47 @@ const pointStyle_pointStyle = (spec, context)=>{
|
|
2643
2933
|
}
|
2644
2934
|
};
|
2645
2935
|
};
|
2936
|
+
const pointStateDimensionHover = (spec)=>{
|
2937
|
+
const point = spec.point || {};
|
2938
|
+
const result = {
|
2939
|
+
...spec,
|
2940
|
+
point: {
|
2941
|
+
...point,
|
2942
|
+
state: {
|
2943
|
+
dimension_hover: {
|
2944
|
+
scaleX: 1.4,
|
2945
|
+
scaleY: 1.4
|
2946
|
+
}
|
2947
|
+
}
|
2948
|
+
}
|
2949
|
+
};
|
2950
|
+
return result;
|
2951
|
+
};
|
2952
|
+
const pointStateHover = (spec, context)=>{
|
2953
|
+
const point = spec.point || {};
|
2954
|
+
const { advancedVSeed } = context;
|
2955
|
+
const { encoding } = advancedVSeed;
|
2956
|
+
const result = {
|
2957
|
+
...spec,
|
2958
|
+
point: {
|
2959
|
+
...point,
|
2960
|
+
state: {
|
2961
|
+
hover: {
|
2962
|
+
scaleX: 1.4,
|
2963
|
+
scaleY: 1.4,
|
2964
|
+
stroke: (datum, context)=>{
|
2965
|
+
const field = encoding[0]?.group?.[0];
|
2966
|
+
const color = context.seriesColor(datum[field]);
|
2967
|
+
return color;
|
2968
|
+
},
|
2969
|
+
fillOpacity: 0.6,
|
2970
|
+
lineWidth: 1
|
2971
|
+
}
|
2972
|
+
}
|
2973
|
+
}
|
2974
|
+
};
|
2975
|
+
return result;
|
2976
|
+
};
|
2646
2977
|
const lineStyle_lineStyle = (spec, context)=>{
|
2647
2978
|
const { advancedVSeed } = context;
|
2648
2979
|
const { markStyle, encoding, dataset } = advancedVSeed;
|
@@ -2821,7 +3152,7 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
2821
3152
|
insideEnd: 'insideEndTop'
|
2822
3153
|
};
|
2823
3154
|
const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
|
2824
|
-
const { selector: selectorPoint, xValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'right', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true,
|
3155
|
+
const { selector: selectorPoint, xValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'right', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true, lineColor = '#212121', lineStyle = 'dashed', lineVisible = true, lineWidth = 1 } = annotationVerticalLine;
|
2825
3156
|
const dataset = advancedVSeed.dataset.flat();
|
2826
3157
|
const generateOneMarkLine = (x)=>({
|
2827
3158
|
x: x,
|
@@ -2829,8 +3160,6 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
2829
3160
|
line: {
|
2830
3161
|
visible: lineVisible,
|
2831
3162
|
style: {
|
2832
|
-
offsetX,
|
2833
|
-
offsetY,
|
2834
3163
|
stroke: lineColor,
|
2835
3164
|
lineStyle: lineStyle,
|
2836
3165
|
lineWidth: lineWidth,
|
@@ -2849,8 +3178,6 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
2849
3178
|
text: text,
|
2850
3179
|
position: positionMap[textPosition],
|
2851
3180
|
style: {
|
2852
|
-
offsetX,
|
2853
|
-
offsetY,
|
2854
3181
|
visible: true,
|
2855
3182
|
textAlign: textAlign,
|
2856
3183
|
textBaseline: textBaseline,
|
@@ -2862,8 +3189,6 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
2862
3189
|
visible: backgroundVisible,
|
2863
3190
|
padding: backgroundPadding,
|
2864
3191
|
style: {
|
2865
|
-
offsetX,
|
2866
|
-
offsetY,
|
2867
3192
|
cornerRadius: backgroundBorderRadius ?? 4,
|
2868
3193
|
fill: backgroundColor,
|
2869
3194
|
stroke: backgroundBorderColor,
|
@@ -2918,7 +3243,7 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
2918
3243
|
insideEnd: 'insideEndTop'
|
2919
3244
|
};
|
2920
3245
|
const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
|
2921
|
-
const { selector: selectorPoint, yValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'bottom', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true,
|
3246
|
+
const { selector: selectorPoint, yValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'bottom', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true, lineColor = '#212121', lineStyle = 'dashed', lineVisible = true, lineWidth = 1 } = annotationVerticalLine;
|
2922
3247
|
const dataset = advancedVSeed.dataset.flat();
|
2923
3248
|
const generateOneMarkLine = (y)=>({
|
2924
3249
|
y,
|
@@ -2926,8 +3251,6 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
2926
3251
|
line: {
|
2927
3252
|
visible: lineVisible,
|
2928
3253
|
style: {
|
2929
|
-
offsetX,
|
2930
|
-
offsetY,
|
2931
3254
|
stroke: lineColor,
|
2932
3255
|
lineStyle: lineStyle,
|
2933
3256
|
lineWidth: lineWidth,
|
@@ -2946,8 +3269,6 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
2946
3269
|
text: text,
|
2947
3270
|
position: positionMap[textPosition],
|
2948
3271
|
style: {
|
2949
|
-
offsetX,
|
2950
|
-
offsetY,
|
2951
3272
|
visible: true,
|
2952
3273
|
textAlign: textAlign,
|
2953
3274
|
textBaseline: textBaseline,
|
@@ -2959,8 +3280,6 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
2959
3280
|
visible: backgroundVisible,
|
2960
3281
|
padding: backgroundPadding,
|
2961
3282
|
style: {
|
2962
|
-
offsetX,
|
2963
|
-
offsetY,
|
2964
3283
|
cornerRadius: backgroundBorderRadius ?? 4,
|
2965
3284
|
fill: backgroundColor,
|
2966
3285
|
stroke: backgroundBorderColor,
|
@@ -3356,6 +3675,46 @@ const horizontalCrosshairRect = (spec, context)=>{
|
|
3356
3675
|
};
|
3357
3676
|
return result;
|
3358
3677
|
};
|
3678
|
+
const horizontalCrosshairLine = (spec, context)=>{
|
3679
|
+
const result = {
|
3680
|
+
...spec
|
3681
|
+
};
|
3682
|
+
const { advancedVSeed, vseed } = context;
|
3683
|
+
const { chartType } = vseed;
|
3684
|
+
const config = advancedVSeed.config?.[chartType]?.crosshairLine;
|
3685
|
+
if (!config) return result;
|
3686
|
+
if (!result.crosshair) result.crosshair = {};
|
3687
|
+
const { visible = true, lineColor, labelColor, labelVisible, labelBackgroundColor } = config;
|
3688
|
+
const crosshair = result.crosshair;
|
3689
|
+
crosshair.yField = {
|
3690
|
+
visible,
|
3691
|
+
line: {
|
3692
|
+
type: 'line',
|
3693
|
+
style: {
|
3694
|
+
lineWidth: 1,
|
3695
|
+
opacity: 1,
|
3696
|
+
stroke: lineColor,
|
3697
|
+
lineDash: [
|
3698
|
+
4,
|
3699
|
+
2
|
3700
|
+
]
|
3701
|
+
}
|
3702
|
+
},
|
3703
|
+
label: {
|
3704
|
+
visible: labelVisible,
|
3705
|
+
labelBackground: {
|
3706
|
+
visible: labelVisible,
|
3707
|
+
style: {
|
3708
|
+
fill: labelBackgroundColor
|
3709
|
+
}
|
3710
|
+
},
|
3711
|
+
style: {
|
3712
|
+
fill: labelColor
|
3713
|
+
}
|
3714
|
+
}
|
3715
|
+
};
|
3716
|
+
return result;
|
3717
|
+
};
|
3359
3718
|
const line_line = [
|
3360
3719
|
initLine,
|
3361
3720
|
color_color,
|
@@ -3368,6 +3727,7 @@ const line_line = [
|
|
3368
3727
|
verticalCrosshairLine,
|
3369
3728
|
discreteLegend,
|
3370
3729
|
pointStyle_pointStyle,
|
3730
|
+
pointStateDimensionHover,
|
3371
3731
|
lineStyle_lineStyle,
|
3372
3732
|
annotationPoint_annotationPoint,
|
3373
3733
|
annotationVerticalLine_annotationVerticalLine,
|
@@ -3390,6 +3750,7 @@ const pivotLine = [
|
|
3390
3750
|
tooltip_tooltip,
|
3391
3751
|
verticalCrosshairLine,
|
3392
3752
|
pointStyle_pointStyle,
|
3753
|
+
pointStateDimensionHover,
|
3393
3754
|
lineStyle_lineStyle,
|
3394
3755
|
annotationPoint_annotationPoint,
|
3395
3756
|
annotationVerticalLine_annotationVerticalLine,
|
@@ -3706,6 +4067,7 @@ const area_area = [
|
|
3706
4067
|
verticalCrosshairLine,
|
3707
4068
|
discreteLegend,
|
3708
4069
|
pointStyle_pointStyle,
|
4070
|
+
pointStateDimensionHover,
|
3709
4071
|
lineStyle_lineStyle,
|
3710
4072
|
areaStyle_areaStyle,
|
3711
4073
|
annotationPoint_annotationPoint,
|
@@ -3730,6 +4092,7 @@ const pivotArea = [
|
|
3730
4092
|
tooltip_tooltip,
|
3731
4093
|
verticalCrosshairLine,
|
3732
4094
|
pointStyle_pointStyle,
|
4095
|
+
pointStateDimensionHover,
|
3733
4096
|
lineStyle_lineStyle,
|
3734
4097
|
areaStyle_areaStyle,
|
3735
4098
|
annotationPoint_annotationPoint,
|
@@ -3922,7 +4285,6 @@ const roseParallel = [
|
|
3922
4285
|
tooltip_tooltip,
|
3923
4286
|
discreteLegend,
|
3924
4287
|
verticalCrosshairRect,
|
3925
|
-
barStyle_barStyle,
|
3926
4288
|
annotationPoint_annotationPoint,
|
3927
4289
|
annotationVerticalLine_annotationVerticalLine,
|
3928
4290
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -3944,7 +4306,6 @@ const pivotRoseParallel = [
|
|
3944
4306
|
label_label,
|
3945
4307
|
tooltip_tooltip,
|
3946
4308
|
verticalCrosshairRect,
|
3947
|
-
barStyle_barStyle,
|
3948
4309
|
annotationPoint_annotationPoint,
|
3949
4310
|
annotationVerticalLine_annotationVerticalLine,
|
3950
4311
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -3957,6 +4318,113 @@ const pivotRoseParallel = [
|
|
3957
4318
|
const roseParallelSpecPipeline = [
|
3958
4319
|
pivotAdapter_pivotAdapter(roseParallel, pivotRoseParallel)
|
3959
4320
|
];
|
4321
|
+
const funnel = [
|
4322
|
+
initFunnel,
|
4323
|
+
color_color,
|
4324
|
+
background_backgroundColor,
|
4325
|
+
dataset_dataset,
|
4326
|
+
label_label,
|
4327
|
+
tooltip_tooltip,
|
4328
|
+
discreteLegend,
|
4329
|
+
annotationPoint_annotationPoint,
|
4330
|
+
annotationVerticalLine_annotationVerticalLine,
|
4331
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
4332
|
+
annotationArea_annotationArea
|
4333
|
+
];
|
4334
|
+
const pivotFunnel = [
|
4335
|
+
initPivot,
|
4336
|
+
pivotGridStyle,
|
4337
|
+
pivotIndicators_pivotIndicatorsAsRow,
|
4338
|
+
datasetPivot,
|
4339
|
+
pivotIndicators([
|
4340
|
+
initFunnel,
|
4341
|
+
color_color,
|
4342
|
+
background_backgroundColor,
|
4343
|
+
datasetPivotPlaceholder,
|
4344
|
+
label_label,
|
4345
|
+
tooltip_tooltip,
|
4346
|
+
annotationPoint_annotationPoint,
|
4347
|
+
annotationVerticalLine_annotationVerticalLine,
|
4348
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
4349
|
+
annotationArea_annotationArea
|
4350
|
+
]),
|
4351
|
+
pivotRowDimensions,
|
4352
|
+
pivotColumnDimensions,
|
4353
|
+
pivotDiscreteLegend
|
4354
|
+
];
|
4355
|
+
const funnelSpecPipeline = [
|
4356
|
+
pivotAdapter_pivotAdapter(funnel, pivotFunnel)
|
4357
|
+
];
|
4358
|
+
const initScatter = (spec, context)=>{
|
4359
|
+
const result = {
|
4360
|
+
...spec
|
4361
|
+
};
|
4362
|
+
const { advancedVSeed } = context;
|
4363
|
+
const { encoding } = advancedVSeed;
|
4364
|
+
if (!encoding[0].y || !encoding[0].x || !encoding[0].group) return result;
|
4365
|
+
result.type = 'scatter';
|
4366
|
+
result.direction = 'vertical';
|
4367
|
+
result.xField = encoding[0].x[0];
|
4368
|
+
result.yField = encoding[0].y[0];
|
4369
|
+
result.seriesField = encoding[0].group[0];
|
4370
|
+
result.padding = 0;
|
4371
|
+
result.region = [
|
4372
|
+
{
|
4373
|
+
clip: true
|
4374
|
+
}
|
4375
|
+
];
|
4376
|
+
result.animation = true;
|
4377
|
+
return result;
|
4378
|
+
};
|
4379
|
+
const scatter = [
|
4380
|
+
initScatter,
|
4381
|
+
color_color,
|
4382
|
+
background_backgroundColor,
|
4383
|
+
dataset_dataset,
|
4384
|
+
xLinear,
|
4385
|
+
yLinear,
|
4386
|
+
label_label,
|
4387
|
+
tooltip_tooltip,
|
4388
|
+
verticalCrosshairLine,
|
4389
|
+
horizontalCrosshairLine,
|
4390
|
+
discreteLegend,
|
4391
|
+
pointStyle_pointStyle,
|
4392
|
+
pointStateHover,
|
4393
|
+
annotationPoint_annotationPoint,
|
4394
|
+
annotationVerticalLine_annotationVerticalLine,
|
4395
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
4396
|
+
annotationArea_annotationArea
|
4397
|
+
];
|
4398
|
+
const pivotScatter = [
|
4399
|
+
initPivot,
|
4400
|
+
pivotGridStyle,
|
4401
|
+
pivotIndicators_pivotIndicatorsAsRow,
|
4402
|
+
datasetPivot,
|
4403
|
+
pivotIndicators([
|
4404
|
+
initScatter,
|
4405
|
+
color_color,
|
4406
|
+
background_backgroundColor,
|
4407
|
+
datasetPivotPlaceholder,
|
4408
|
+
xLinear,
|
4409
|
+
yLinear,
|
4410
|
+
label_label,
|
4411
|
+
tooltip_tooltip,
|
4412
|
+
verticalCrosshairLine,
|
4413
|
+
horizontalCrosshairLine,
|
4414
|
+
pointStyle_pointStyle,
|
4415
|
+
pointStateHover,
|
4416
|
+
annotationPoint_annotationPoint,
|
4417
|
+
annotationVerticalLine_annotationVerticalLine,
|
4418
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
4419
|
+
annotationArea_annotationArea
|
4420
|
+
]),
|
4421
|
+
pivotRowDimensions,
|
4422
|
+
pivotColumnDimensions,
|
4423
|
+
pivotDiscreteLegend
|
4424
|
+
];
|
4425
|
+
const scatterSpecPipeline = [
|
4426
|
+
pivotAdapter_pivotAdapter(scatter, pivotScatter)
|
4427
|
+
];
|
3960
4428
|
const buildAdvanced = (builder)=>{
|
3961
4429
|
const { chartType } = builder.vseed;
|
3962
4430
|
if (!chartType) throw new Error('chartType is nil in buildAdvanced');
|
@@ -4087,6 +4555,14 @@ const registerRoseParallel = ()=>{
|
|
4087
4555
|
Builder._advancedPipelineMap.roseParallel = roseParallelAdvancedPipeline;
|
4088
4556
|
Builder._specPipelineMap.roseParallel = roseParallelSpecPipeline;
|
4089
4557
|
};
|
4558
|
+
const registerFunnel = ()=>{
|
4559
|
+
Builder._advancedPipelineMap.funnel = funnelAdvancedPipeline;
|
4560
|
+
Builder._specPipelineMap.funnel = funnelSpecPipeline;
|
4561
|
+
};
|
4562
|
+
const registerScatter = ()=>{
|
4563
|
+
Builder._advancedPipelineMap.scatter = scatterAdvancedPipeline;
|
4564
|
+
Builder._specPipelineMap.scatter = scatterSpecPipeline;
|
4565
|
+
};
|
4090
4566
|
const darkTheme = ()=>{
|
4091
4567
|
const linearAxis = {
|
4092
4568
|
nice: true,
|
@@ -4311,6 +4787,23 @@ const darkTheme = ()=>{
|
|
4311
4787
|
xAxis: bandAxis,
|
4312
4788
|
yAxis: linearAxis,
|
4313
4789
|
crosshairLine: crosshairLine
|
4790
|
+
},
|
4791
|
+
scatter: {
|
4792
|
+
xAxis: {
|
4793
|
+
...linearAxis,
|
4794
|
+
line: {
|
4795
|
+
...linearAxis.line,
|
4796
|
+
visible: true
|
4797
|
+
}
|
4798
|
+
},
|
4799
|
+
yAxis: {
|
4800
|
+
...linearAxis,
|
4801
|
+
line: {
|
4802
|
+
...linearAxis.line,
|
4803
|
+
visible: true
|
4804
|
+
}
|
4805
|
+
},
|
4806
|
+
crosshairLine
|
4314
4807
|
}
|
4315
4808
|
}
|
4316
4809
|
};
|
@@ -4540,6 +5033,23 @@ const lightTheme = ()=>{
|
|
4540
5033
|
xAxis: bandAxis,
|
4541
5034
|
yAxis: linearAxis,
|
4542
5035
|
crosshairLine
|
5036
|
+
},
|
5037
|
+
scatter: {
|
5038
|
+
xAxis: {
|
5039
|
+
...linearAxis,
|
5040
|
+
line: {
|
5041
|
+
...linearAxis.line,
|
5042
|
+
visible: true
|
5043
|
+
}
|
5044
|
+
},
|
5045
|
+
yAxis: {
|
5046
|
+
...linearAxis,
|
5047
|
+
line: {
|
5048
|
+
...linearAxis.line,
|
5049
|
+
visible: true
|
5050
|
+
}
|
5051
|
+
},
|
5052
|
+
crosshairLine
|
4543
5053
|
}
|
4544
5054
|
}
|
4545
5055
|
};
|
@@ -4571,6 +5081,8 @@ const registerAll = ()=>{
|
|
4571
5081
|
registerDonut();
|
4572
5082
|
registerRose();
|
4573
5083
|
registerRoseParallel();
|
5084
|
+
registerFunnel();
|
5085
|
+
registerScatter();
|
4574
5086
|
registerLightTheme();
|
4575
5087
|
registerDarkTheme();
|
4576
5088
|
};
|
@@ -4590,7 +5102,9 @@ const zChartType = z["enum"]([
|
|
4590
5102
|
'roseParallel',
|
4591
5103
|
'pie',
|
4592
5104
|
'donut',
|
4593
|
-
'dualAxis'
|
5105
|
+
'dualAxis',
|
5106
|
+
'scatter',
|
5107
|
+
'funnel'
|
4594
5108
|
]);
|
4595
5109
|
const zDatum = z.record(z.string().or(z.number()), z.any());
|
4596
5110
|
const zDataset = z.array(zDatum);
|
@@ -4602,7 +5116,7 @@ const zDimension = z.object({
|
|
4602
5116
|
'dimension',
|
4603
5117
|
'rowDimension',
|
4604
5118
|
'columnDimension'
|
4605
|
-
])
|
5119
|
+
]).default('dimension').optional()
|
4606
5120
|
});
|
4607
5121
|
const zDimensions = z.array(zDimension).optional();
|
4608
5122
|
const zNumFormat = z.object({
|
@@ -4663,7 +5177,8 @@ const zEncoding = z.array(z.object({
|
|
4663
5177
|
group: z.array(z.string()).optional(),
|
4664
5178
|
angle: z.array(z.string()).optional(),
|
4665
5179
|
radius: z.array(z.string()).optional(),
|
4666
|
-
tooltip: z.array(z.string()).optional()
|
5180
|
+
tooltip: z.array(z.string()).optional(),
|
5181
|
+
size: z.array(z.string()).optional()
|
4667
5182
|
}));
|
4668
5183
|
const zBackgroundColor = z.string().default('transparent').optional();
|
4669
5184
|
const zLabel = z.object({
|
@@ -4896,6 +5411,8 @@ const zStackCornerRadius = z.number().or(z.array(z.number())).default([
|
|
4896
5411
|
0
|
4897
5412
|
]);
|
4898
5413
|
const zConfig = z.object({
|
5414
|
+
table: z.object({}).optional(),
|
5415
|
+
pivotTable: z.object({}).optional(),
|
4899
5416
|
line: z.object({
|
4900
5417
|
xAxis: zXBandAxis.optional(),
|
4901
5418
|
yAxis: zYLinearAxis.optional(),
|
@@ -4952,8 +5469,12 @@ const zConfig = z.object({
|
|
4952
5469
|
pie: z.object({}).optional(),
|
4953
5470
|
donut: z.object({}).optional(),
|
4954
5471
|
dualAxis: z.object({}).optional(),
|
4955
|
-
|
4956
|
-
|
5472
|
+
scatter: z.object({
|
5473
|
+
xAxis: zXLinearAxis.optional(),
|
5474
|
+
yAxis: zYLinearAxis.optional(),
|
5475
|
+
crosshairLine: zCrosshairLine.optional()
|
5476
|
+
}).optional(),
|
5477
|
+
funnel: z.object({}).optional()
|
4957
5478
|
});
|
4958
5479
|
const zSelector = z.union([
|
4959
5480
|
z.string(),
|
@@ -5086,9 +5607,7 @@ const zAnnotationVerticalLine = z.object({
|
|
5086
5607
|
backgroundBorderColor: z.string().optional(),
|
5087
5608
|
backgroundBorderWidth: z.number().default(1).optional(),
|
5088
5609
|
backgroundBorderRadius: z.number().default(4).optional(),
|
5089
|
-
backgroundPadding: z.number().optional()
|
5090
|
-
offsetY: z.number().default(0).optional(),
|
5091
|
-
offsetX: z.number().default(0).optional()
|
5610
|
+
backgroundPadding: z.number().optional()
|
5092
5611
|
});
|
5093
5612
|
const zAnnotationHorizontalLine = z.object({
|
5094
5613
|
selector: z.union([
|
@@ -5138,9 +5657,7 @@ const zAnnotationHorizontalLine = z.object({
|
|
5138
5657
|
backgroundBorderColor: z.string().optional(),
|
5139
5658
|
backgroundBorderWidth: z.number().default(1).optional(),
|
5140
5659
|
backgroundBorderRadius: z.number().default(4).optional(),
|
5141
|
-
backgroundPadding: z.number().optional()
|
5142
|
-
offsetY: z.number().default(0).optional(),
|
5143
|
-
offsetX: z.number().default(0).optional()
|
5660
|
+
backgroundPadding: z.number().optional()
|
5144
5661
|
});
|
5145
5662
|
const zAnnotationArea = z.object({
|
5146
5663
|
selector: z.union([
|
@@ -5270,8 +5787,8 @@ const zLocale = z["enum"]([
|
|
5270
5787
|
'zh-CN',
|
5271
5788
|
'en-US'
|
5272
5789
|
]).default('zh-CN');
|
5273
|
-
const
|
5274
|
-
chartType: z.literal('
|
5790
|
+
const zLine = z.object({
|
5791
|
+
chartType: z.literal('line'),
|
5275
5792
|
dataset: zDataset.optional(),
|
5276
5793
|
dimensions: zDimensions.optional(),
|
5277
5794
|
measures: zMeasures.optional(),
|
@@ -5280,20 +5797,20 @@ const zBar = z.object({
|
|
5280
5797
|
label: zLabel.optional(),
|
5281
5798
|
legend: zLegend.optional(),
|
5282
5799
|
tooltip: zTooltip.optional(),
|
5283
|
-
xAxis:
|
5284
|
-
yAxis:
|
5285
|
-
|
5286
|
-
stackCornerRadius: zStackCornerRadius.optional(),
|
5800
|
+
xAxis: zXBandAxis.optional(),
|
5801
|
+
yAxis: zYLinearAxis.optional(),
|
5802
|
+
crosshairLine: zCrosshairLine.optional(),
|
5287
5803
|
theme: zTheme.optional(),
|
5288
|
-
|
5289
|
-
|
5290
|
-
|
5291
|
-
|
5292
|
-
|
5804
|
+
pointStyle: zPointStyle.optional(),
|
5805
|
+
lineStyle: zLineStyle.optional(),
|
5806
|
+
annotationPoint: z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
5807
|
+
annotationVerticalLine: z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
5808
|
+
annotationHorizontalLine: z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
5809
|
+
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
5293
5810
|
locale: zLocale.optional()
|
5294
5811
|
});
|
5295
|
-
const
|
5296
|
-
chartType: z.literal('
|
5812
|
+
const zColumn = z.object({
|
5813
|
+
chartType: z.literal('column'),
|
5297
5814
|
dataset: zDataset.optional(),
|
5298
5815
|
dimensions: zDimensions.optional(),
|
5299
5816
|
measures: zMeasures.optional(),
|
@@ -5302,20 +5819,20 @@ const zBarParallel = z.object({
|
|
5302
5819
|
label: zLabel.optional(),
|
5303
5820
|
legend: zLegend.optional(),
|
5304
5821
|
tooltip: zTooltip.optional(),
|
5305
|
-
xAxis:
|
5306
|
-
yAxis:
|
5822
|
+
xAxis: zXBandAxis.optional(),
|
5823
|
+
yAxis: zYLinearAxis.optional(),
|
5307
5824
|
crosshairRect: zCrosshairRect.optional(),
|
5308
5825
|
stackCornerRadius: zStackCornerRadius.optional(),
|
5309
5826
|
theme: zTheme.optional(),
|
5310
5827
|
barStyle: zBarStyle.optional(),
|
5311
|
-
annotationPoint: zAnnotationPoint.optional(),
|
5312
|
-
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5313
|
-
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5314
|
-
annotationArea: zAnnotationArea.optional(),
|
5828
|
+
annotationPoint: z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
5829
|
+
annotationVerticalLine: z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
5830
|
+
annotationHorizontalLine: z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
5831
|
+
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
5315
5832
|
locale: zLocale.optional()
|
5316
5833
|
});
|
5317
|
-
const
|
5318
|
-
chartType: z.literal('
|
5834
|
+
const zColumnParallel = z.object({
|
5835
|
+
chartType: z.literal('columnParallel'),
|
5319
5836
|
dataset: zDataset.optional(),
|
5320
5837
|
dimensions: zDimensions.optional(),
|
5321
5838
|
measures: zMeasures.optional(),
|
@@ -5330,14 +5847,14 @@ const zColumn = z.object({
|
|
5330
5847
|
stackCornerRadius: zStackCornerRadius.optional(),
|
5331
5848
|
theme: zTheme.optional(),
|
5332
5849
|
barStyle: zBarStyle.optional(),
|
5333
|
-
annotationPoint: zAnnotationPoint.optional(),
|
5334
|
-
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5335
|
-
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5336
|
-
annotationArea: zAnnotationArea.optional(),
|
5850
|
+
annotationPoint: z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
5851
|
+
annotationVerticalLine: z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
5852
|
+
annotationHorizontalLine: z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
5853
|
+
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
5337
5854
|
locale: zLocale.optional()
|
5338
5855
|
});
|
5339
|
-
const
|
5340
|
-
chartType: z.literal('
|
5856
|
+
const zColumnPercent = z.object({
|
5857
|
+
chartType: z.literal('columnPercent'),
|
5341
5858
|
dataset: zDataset.optional(),
|
5342
5859
|
dimensions: zDimensions.optional(),
|
5343
5860
|
measures: zMeasures.optional(),
|
@@ -5352,14 +5869,14 @@ const zColumnParallel = z.object({
|
|
5352
5869
|
stackCornerRadius: zStackCornerRadius.optional(),
|
5353
5870
|
theme: zTheme.optional(),
|
5354
5871
|
barStyle: zBarStyle.optional(),
|
5355
|
-
annotationPoint: zAnnotationPoint.optional(),
|
5356
|
-
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5357
|
-
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5358
|
-
annotationArea: zAnnotationArea.optional(),
|
5872
|
+
annotationPoint: z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
5873
|
+
annotationVerticalLine: z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
5874
|
+
annotationHorizontalLine: z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
5875
|
+
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
5359
5876
|
locale: zLocale.optional()
|
5360
5877
|
});
|
5361
|
-
const
|
5362
|
-
chartType: z.literal('
|
5878
|
+
const zBar = z.object({
|
5879
|
+
chartType: z.literal('bar'),
|
5363
5880
|
dataset: zDataset.optional(),
|
5364
5881
|
dimensions: zDimensions.optional(),
|
5365
5882
|
measures: zMeasures.optional(),
|
@@ -5368,20 +5885,20 @@ const zColumnPercent = z.object({
|
|
5368
5885
|
label: zLabel.optional(),
|
5369
5886
|
legend: zLegend.optional(),
|
5370
5887
|
tooltip: zTooltip.optional(),
|
5371
|
-
xAxis:
|
5372
|
-
yAxis:
|
5888
|
+
xAxis: zXLinearAxis.optional(),
|
5889
|
+
yAxis: zYBandAxis.optional(),
|
5373
5890
|
crosshairRect: zCrosshairRect.optional(),
|
5374
5891
|
stackCornerRadius: zStackCornerRadius.optional(),
|
5375
5892
|
theme: zTheme.optional(),
|
5376
5893
|
barStyle: zBarStyle.optional(),
|
5377
|
-
annotationPoint: zAnnotationPoint.optional(),
|
5378
|
-
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5379
|
-
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5380
|
-
annotationArea: zAnnotationArea.optional(),
|
5894
|
+
annotationPoint: z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
5895
|
+
annotationVerticalLine: z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
5896
|
+
annotationHorizontalLine: z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
5897
|
+
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
5381
5898
|
locale: zLocale.optional()
|
5382
5899
|
});
|
5383
|
-
const
|
5384
|
-
chartType: z.literal('
|
5900
|
+
const zBarParallel = z.object({
|
5901
|
+
chartType: z.literal('barParallel'),
|
5385
5902
|
dataset: zDataset.optional(),
|
5386
5903
|
dimensions: zDimensions.optional(),
|
5387
5904
|
measures: zMeasures.optional(),
|
@@ -5390,16 +5907,16 @@ const zLine = z.object({
|
|
5390
5907
|
label: zLabel.optional(),
|
5391
5908
|
legend: zLegend.optional(),
|
5392
5909
|
tooltip: zTooltip.optional(),
|
5393
|
-
xAxis:
|
5394
|
-
yAxis:
|
5395
|
-
|
5910
|
+
xAxis: zXLinearAxis.optional(),
|
5911
|
+
yAxis: zYBandAxis.optional(),
|
5912
|
+
crosshairRect: zCrosshairRect.optional(),
|
5913
|
+
stackCornerRadius: zStackCornerRadius.optional(),
|
5396
5914
|
theme: zTheme.optional(),
|
5397
|
-
|
5398
|
-
|
5399
|
-
|
5400
|
-
|
5401
|
-
|
5402
|
-
annotationArea: zAnnotationArea.optional(),
|
5915
|
+
barStyle: zBarStyle.optional(),
|
5916
|
+
annotationPoint: z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
5917
|
+
annotationVerticalLine: z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
5918
|
+
annotationHorizontalLine: z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
5919
|
+
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
5403
5920
|
locale: zLocale.optional()
|
5404
5921
|
});
|
5405
5922
|
const zBarPercent = z.object({
|
@@ -5418,14 +5935,14 @@ const zBarPercent = z.object({
|
|
5418
5935
|
stackCornerRadius: zStackCornerRadius.optional(),
|
5419
5936
|
theme: zTheme.optional(),
|
5420
5937
|
barStyle: zBarStyle.optional(),
|
5421
|
-
annotationPoint: zAnnotationPoint.optional(),
|
5422
|
-
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5423
|
-
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5424
|
-
annotationArea: zAnnotationArea.optional(),
|
5938
|
+
annotationPoint: z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
5939
|
+
annotationVerticalLine: z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
5940
|
+
annotationHorizontalLine: z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
5941
|
+
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
5425
5942
|
locale: zLocale.optional()
|
5426
5943
|
});
|
5427
|
-
const
|
5428
|
-
chartType: z.literal('
|
5944
|
+
const zArea = z.object({
|
5945
|
+
chartType: z.literal('area'),
|
5429
5946
|
dataset: zDataset.optional(),
|
5430
5947
|
dimensions: zDimensions.optional(),
|
5431
5948
|
measures: zMeasures.optional(),
|
@@ -5434,11 +5951,21 @@ const zPie = z.object({
|
|
5434
5951
|
label: zLabel.optional(),
|
5435
5952
|
legend: zLegend.optional(),
|
5436
5953
|
tooltip: zTooltip.optional(),
|
5954
|
+
xAxis: zXBandAxis.optional(),
|
5955
|
+
yAxis: zYLinearAxis.optional(),
|
5956
|
+
crosshairLine: zCrosshairLine.optional(),
|
5437
5957
|
theme: zTheme.optional(),
|
5958
|
+
pointStyle: zPointStyle.optional(),
|
5959
|
+
lineStyle: zLineStyle.optional(),
|
5960
|
+
areaStyle: zAreaStyle.optional(),
|
5961
|
+
annotationPoint: z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
5962
|
+
annotationVerticalLine: z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
5963
|
+
annotationHorizontalLine: z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
5964
|
+
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
5438
5965
|
locale: zLocale.optional()
|
5439
5966
|
});
|
5440
|
-
const
|
5441
|
-
chartType: z.literal('
|
5967
|
+
const zAreaPercent = z.object({
|
5968
|
+
chartType: z.literal('areaPercent'),
|
5442
5969
|
dataset: zDataset.optional(),
|
5443
5970
|
dimensions: zDimensions.optional(),
|
5444
5971
|
measures: zMeasures.optional(),
|
@@ -5454,14 +5981,14 @@ const zArea = z.object({
|
|
5454
5981
|
pointStyle: zPointStyle.optional(),
|
5455
5982
|
lineStyle: zLineStyle.optional(),
|
5456
5983
|
areaStyle: zAreaStyle.optional(),
|
5457
|
-
annotationPoint: zAnnotationPoint.optional(),
|
5458
|
-
annotationVerticalLine: zAnnotationVerticalLine.optional(),
|
5459
|
-
annotationHorizontalLine: zAnnotationHorizontalLine.optional(),
|
5460
|
-
annotationArea: zAnnotationArea.optional(),
|
5984
|
+
annotationPoint: z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
5985
|
+
annotationVerticalLine: z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
5986
|
+
annotationHorizontalLine: z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
5987
|
+
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
5461
5988
|
locale: zLocale.optional()
|
5462
5989
|
});
|
5463
|
-
const
|
5464
|
-
chartType: z.literal('
|
5990
|
+
const zRose = z.object({
|
5991
|
+
chartType: z.literal('rose'),
|
5465
5992
|
dataset: zDataset.optional(),
|
5466
5993
|
dimensions: zDimensions.optional(),
|
5467
5994
|
measures: zMeasures.optional(),
|
@@ -5470,17 +5997,80 @@ const zAreaPercent = z.object({
|
|
5470
5997
|
label: zLabel.optional(),
|
5471
5998
|
legend: zLegend.optional(),
|
5472
5999
|
tooltip: zTooltip.optional(),
|
5473
|
-
|
6000
|
+
theme: zTheme.optional(),
|
6001
|
+
locale: zLocale.optional()
|
6002
|
+
});
|
6003
|
+
const zRoseParallel = z.object({
|
6004
|
+
chartType: z.literal('roseParallel'),
|
6005
|
+
dataset: zDataset.optional(),
|
6006
|
+
dimensions: zDimensions.optional(),
|
6007
|
+
measures: zMeasures.optional(),
|
6008
|
+
backgroundColor: zBackgroundColor.optional(),
|
6009
|
+
color: zColor.optional(),
|
6010
|
+
label: zLabel.optional(),
|
6011
|
+
legend: zLegend.optional(),
|
6012
|
+
tooltip: zTooltip.optional(),
|
6013
|
+
theme: zTheme.optional(),
|
6014
|
+
locale: zLocale.optional()
|
6015
|
+
});
|
6016
|
+
const zPie = z.object({
|
6017
|
+
chartType: z.literal('pie'),
|
6018
|
+
dataset: zDataset.optional(),
|
6019
|
+
dimensions: zDimensions.optional(),
|
6020
|
+
measures: zMeasures.optional(),
|
6021
|
+
backgroundColor: zBackgroundColor.optional(),
|
6022
|
+
color: zColor.optional(),
|
6023
|
+
label: zLabel.optional(),
|
6024
|
+
legend: zLegend.optional(),
|
6025
|
+
tooltip: zTooltip.optional(),
|
6026
|
+
theme: zTheme.optional(),
|
6027
|
+
locale: zLocale.optional()
|
6028
|
+
});
|
6029
|
+
const zDonut = z.object({
|
6030
|
+
chartType: z.literal('donut'),
|
6031
|
+
dataset: zDataset.optional(),
|
6032
|
+
dimensions: zDimensions.optional(),
|
6033
|
+
measures: zMeasures.optional(),
|
6034
|
+
backgroundColor: zBackgroundColor.optional(),
|
6035
|
+
color: zColor.optional(),
|
6036
|
+
label: zLabel.optional(),
|
6037
|
+
legend: zLegend.optional(),
|
6038
|
+
tooltip: zTooltip.optional(),
|
6039
|
+
theme: zTheme.optional(),
|
6040
|
+
locale: zLocale.optional()
|
6041
|
+
});
|
6042
|
+
const zScatter = z.object({
|
6043
|
+
chartType: z.literal('scatter'),
|
6044
|
+
dataset: zDataset.optional(),
|
6045
|
+
dimensions: zDimensions.optional(),
|
6046
|
+
measures: zMeasures.optional(),
|
6047
|
+
backgroundColor: zBackgroundColor.optional(),
|
6048
|
+
color: zColor.optional(),
|
6049
|
+
label: zLabel.optional(),
|
6050
|
+
legend: zLegend.optional(),
|
6051
|
+
tooltip: zTooltip.optional(),
|
6052
|
+
xAxis: zXLinearAxis.optional(),
|
5474
6053
|
yAxis: zYLinearAxis.optional(),
|
5475
6054
|
crosshairLine: zCrosshairLine.optional(),
|
5476
6055
|
theme: zTheme.optional(),
|
5477
6056
|
pointStyle: zPointStyle.optional(),
|
5478
|
-
|
5479
|
-
|
5480
|
-
|
5481
|
-
|
5482
|
-
|
5483
|
-
|
6057
|
+
annotationPoint: z.array(zAnnotationPoint).or(zAnnotationPoint).optional(),
|
6058
|
+
annotationVerticalLine: z.array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).optional(),
|
6059
|
+
annotationHorizontalLine: z.array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).optional(),
|
6060
|
+
annotationArea: z.array(zAnnotationArea).or(zAnnotationArea).optional(),
|
6061
|
+
locale: zLocale.optional()
|
6062
|
+
});
|
6063
|
+
const zFunnel = z.object({
|
6064
|
+
chartType: z.literal('funnel'),
|
6065
|
+
dataset: zDataset.optional(),
|
6066
|
+
dimensions: zDimensions.optional(),
|
6067
|
+
measures: zMeasures.optional(),
|
6068
|
+
backgroundColor: zBackgroundColor.optional(),
|
6069
|
+
color: zColor.optional(),
|
6070
|
+
label: zLabel.optional(),
|
6071
|
+
legend: zLegend.optional(),
|
6072
|
+
tooltip: zTooltip.optional(),
|
6073
|
+
theme: zTheme.optional(),
|
5484
6074
|
locale: zLocale.optional()
|
5485
6075
|
});
|
5486
6076
|
const zVSeed = z.discriminatedUnion('chartType', [
|
@@ -5493,8 +6083,28 @@ const zVSeed = z.discriminatedUnion('chartType', [
|
|
5493
6083
|
zBarPercent,
|
5494
6084
|
zArea,
|
5495
6085
|
zAreaPercent,
|
5496
|
-
zPie
|
6086
|
+
zPie,
|
6087
|
+
zRose,
|
6088
|
+
zRoseParallel,
|
6089
|
+
zScatter,
|
6090
|
+
zDonut,
|
6091
|
+
zFunnel
|
5497
6092
|
]);
|
5498
|
-
|
6093
|
+
const zAdvancedVSeed = z.object({
|
6094
|
+
chartType: zChartType,
|
6095
|
+
dataset: zDataset,
|
6096
|
+
datasetReshapeInfo: zDatasetReshapeInfo,
|
6097
|
+
dimensions: zDimensions,
|
6098
|
+
measures: zMeasures,
|
6099
|
+
encoding: zEncoding,
|
6100
|
+
baseConfig: zBaseConfig,
|
6101
|
+
config: zConfig,
|
6102
|
+
theme: zTheme,
|
6103
|
+
markStyle: zMarkStyle,
|
6104
|
+
customTheme: zCustomTheme,
|
6105
|
+
annotation: zAnnotation,
|
6106
|
+
locale: zLocale
|
6107
|
+
});
|
6108
|
+
export { Builder, FoldMeasureId, FoldMeasureName, FoldMeasureValue, ORIGINAL_DATA, Separator, UnfoldDimensionGroup, UnfoldDimensionGroupId, areaAdvancedPipeline, areaPercentAdvancedPipeline, areaPercentSpecPipeline, areaSpecPipeline, autoFormatter, autoNumFormatter, barAdvancedPipeline, barParallelAdvancedPipeline, barParallelSpecPipeline, barPercentAdvancedPipeline, barPercentSpecPipeline, barSpecPipeline, columnAdvancedPipeline, columnParallelAdvancedPipeline, columnParallelSpecPipeline, columnPercentAdvancedPipeline, columnPercentSpecPipeline, columnSpecPipeline, createFormatter, createNumFormatter, darkTheme, dataReshapeFor1D1M, dataReshapeFor1D2M, dataReshapeFor2D1M, donutAdvancedPipeline, donutSpecPipeline, execPipeline, findFirstMeasure, findMeasureById, foldMeasures, funnelAdvancedPipeline, funnelSpecPipeline, i18n, intl, isPivotChart, isVChart, isVTable, lightTheme, lineAdvancedPipeline, lineSpecPipeline, pieAdvancedPipeline, pieSpecPipeline, registerAll, registerArea, registerAreaPercent, registerBar, registerBarParallel, registerBarPercent, registerColumn, registerColumnParallel, registerColumnPercent, registerCustomTheme, registerDarkTheme, registerLightTheme, registerLine, roseAdvancedPipeline, roseParallelAdvancedPipeline, roseParallelSpecPipeline, roseSpecPipeline, scatterAdvancedPipeline, scatterSpecPipeline, unfoldDimensions, zAdvancedVSeed, zAnnotation, zAnnotationArea, zAnnotationHorizontalLine, zAnnotationPoint, zAnnotationVerticalLine, zArea, zAreaPercent, zAreaStyle, zAxis, zBackgroundColor, zBar, zBarParallel, zBarPercent, zBarStyle, zBaseConfig, zChartType, zColor, zColumn, zColumnParallel, zColumnPercent, zConfig, zCrosshairLine, zCrosshairRect, zCustomTheme, zCustomThemeConfig, zDataset, zDatasetReshapeInfo, zDatum, zDimension, zDimensions, zDonut, zEncoding, zFoldInfo, zFunnel, zLabel, zLegend, zLine, zLineStyle, zLocale, zMarkStyle, zMeasure, zMeasureGroup, zMeasures, zNumFormat, zPie, zPointStyle, zRose, zRoseParallel, zScatter, zStackCornerRadius, zTheme, zTooltip, zUnfoldInfo, zVSeed, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
|
5499
6109
|
|
5500
6110
|
//# sourceMappingURL=index.js.map
|