@visactor/vseed 0.0.7 → 0.0.9
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 +5998 -109
- package/dist/dataReshape/constant.d.ts +1 -0
- package/dist/dataReshape/index.d.ts +1 -0
- package/dist/dataSelector/index.d.ts +1 -0
- package/dist/dataSelector/selector.d.ts +7 -0
- package/dist/index.cjs +1468 -241
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1427 -242
- package/dist/index.js.map +1 -1
- package/dist/pipeline/advanced/pipes/config/config.d.ts +11 -0
- package/dist/pipeline/advanced/pipes/config/index.d.ts +1 -0
- package/dist/pipeline/advanced/pipes/index.d.ts +3 -1
- package/dist/pipeline/advanced/pipes/markStyle/index.d.ts +1 -0
- package/dist/pipeline/advanced/pipes/{encoding/encodingXY copy.d.ts → markStyle/markStyle.d.ts} +1 -1
- package/dist/pipeline/spec/pipes/index.d.ts +1 -0
- package/dist/pipeline/spec/pipes/legend/{pivotLegend.d.ts → discreteLegend.d.ts} +1 -1
- package/dist/pipeline/spec/pipes/legend/index.d.ts +2 -2
- package/dist/pipeline/spec/pipes/legend/pivotDiscreteLegend.d.ts +2 -0
- package/dist/pipeline/spec/pipes/{init/line copy.d.ts → markStyle/barStyle.d.ts} +1 -1
- package/dist/pipeline/spec/pipes/markStyle/index.d.ts +1 -0
- package/dist/pipeline/spec/pipes/stack/index.d.ts +1 -1
- package/dist/pipeline/spec/pipes/stack/stack.d.ts +2 -2
- package/dist/types/advancedVSeed.d.ts +1567 -0
- package/dist/types/chartType/area/area.d.ts +11 -1
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +11 -1
- package/dist/types/chartType/bar/bar.d.ts +20 -1
- package/dist/types/chartType/barParallel/barParallel.d.ts +20 -1
- package/dist/types/chartType/barPercent/barPercent.d.ts +20 -1
- package/dist/types/chartType/column/column.d.ts +20 -1
- package/dist/types/chartType/columnParallel/columnParallel.d.ts +20 -1
- package/dist/types/chartType/columnPercent/columnPercent.d.ts +20 -1
- package/dist/types/chartType/donut/donut.d.ts +1 -1
- package/dist/types/chartType/dualAxis/dualAxis.d.ts +1 -1
- package/dist/types/chartType/line/line.d.ts +11 -1
- package/dist/types/chartType/pie/pie.d.ts +4 -4
- package/dist/types/chartType/pivotTable/pivotTable.d.ts +1 -1
- package/dist/types/chartType/rose/rose.d.ts +4 -4
- package/dist/types/chartType/table/table.d.ts +1 -1
- package/dist/types/dataSelector/index.d.ts +1 -0
- package/dist/types/dataSelector/selector.d.ts +34 -0
- package/dist/types/properties/baseConfig/baseConfig.d.ts +102 -0
- package/dist/types/properties/baseConfig/legend.d.ts +101 -4
- package/dist/types/properties/chartType/index.d.ts +2 -2
- package/dist/types/properties/config/axis.d.ts +257 -0
- package/dist/types/properties/config/bandAxis.d.ts +82 -0
- package/dist/types/properties/config/config.d.ts +721 -0
- package/dist/types/properties/config/index.d.ts +4 -0
- package/dist/types/properties/config/linearAxis.d.ts +80 -0
- package/dist/types/properties/index.d.ts +2 -0
- package/dist/types/properties/markStyle/barStyle.d.ts +114 -0
- package/dist/types/properties/markStyle/index.d.ts +2 -0
- package/dist/types/properties/markStyle/markStyle.d.ts +29 -0
- package/dist/types/properties/theme/customTheme.d.ts +1540 -0
- package/package.json +1 -1
- package/dist/pipeline/advanced/pipeline/line copy.d.ts +0 -2
- package/dist/pipeline/spec/pipes/legend/legend.d.ts +0 -2
- package/dist/pipeline/spec/pipes/pivotChart/pivotGridStyle copy.d.ts +0 -2
- package/dist/pipeline/spec/pipes/pivotChart/pivotRowDimensions copy.d.ts +0 -2
- /package/dist/types/properties/chartType/{zChartType.d.ts → chartType.d.ts} +0 -0
package/dist/index.js
CHANGED
@@ -1,10 +1,134 @@
|
|
1
|
-
import { clone as external_remeda_clone, mergeDeep as external_remeda_mergeDeep, pick as external_remeda_pick, unique } from "remeda";
|
1
|
+
import { clone as external_remeda_clone, mergeDeep as external_remeda_mergeDeep, omit, pick as external_remeda_pick, unique } from "remeda";
|
2
2
|
import { z } from "zod";
|
3
|
+
const initAdvancedVSeed = (advancedVSeed, context)=>{
|
4
|
+
const { vseed } = context;
|
5
|
+
const { chartType = 'table' } = vseed;
|
6
|
+
return {
|
7
|
+
...advancedVSeed,
|
8
|
+
chartType
|
9
|
+
};
|
10
|
+
};
|
11
|
+
const execPipeline = (pipeline, context, initialValue = {})=>{
|
12
|
+
const result = pipeline.reduce((prev, cur)=>cur(prev, context), initialValue);
|
13
|
+
return result;
|
14
|
+
};
|
15
|
+
const isVTable = (chartType)=>[
|
16
|
+
'table',
|
17
|
+
'pivotTable'
|
18
|
+
].includes(chartType);
|
19
|
+
const isVChart = (chartType)=>!isVTable(chartType);
|
20
|
+
const isPivotChart = (vseed)=>{
|
21
|
+
const { measures, dimensions } = vseed;
|
22
|
+
const hasRowOrColumnDimension = dimensions && dimensions.some((dimension)=>'rowDimension' === dimension.location || 'columnDimension' === dimension.location);
|
23
|
+
const hasMeasureGroup = measures && measures.find((measure)=>measure && measure.children);
|
24
|
+
return hasRowOrColumnDimension || hasMeasureGroup;
|
25
|
+
};
|
26
|
+
const autoMeasures = (advancedVSeed, context)=>{
|
27
|
+
const result = {
|
28
|
+
...advancedVSeed
|
29
|
+
};
|
30
|
+
const { vseed } = context;
|
31
|
+
const { measures, dataset } = vseed;
|
32
|
+
if (!dataset) throw new Error('dataset is required');
|
33
|
+
if (0 === dataset.length) return result;
|
34
|
+
if (isPivotChart(vseed)) return autoMeasureGroup(advancedVSeed, context);
|
35
|
+
if (measures) {
|
36
|
+
result.measures = measures;
|
37
|
+
return result;
|
38
|
+
}
|
39
|
+
const top100dataset = dataset.slice(0, 100);
|
40
|
+
const sample = top100dataset.reduce((prev, cur)=>({
|
41
|
+
...prev,
|
42
|
+
...cur
|
43
|
+
}), {});
|
44
|
+
result.measures = Object.keys(sample).filter((key)=>top100dataset.some((item)=>'number' == typeof item[key]) && ![
|
45
|
+
'',
|
46
|
+
null,
|
47
|
+
void 0
|
48
|
+
].includes(key)).map((measure)=>({
|
49
|
+
id: measure,
|
50
|
+
alias: measure
|
51
|
+
}));
|
52
|
+
return result;
|
53
|
+
};
|
54
|
+
const autoMeasureGroup = (advancedVSeed, context)=>{
|
55
|
+
const { vseed } = context;
|
56
|
+
const { measures } = vseed;
|
57
|
+
const hasMeasureGroup = measures?.some((measure)=>measure.children);
|
58
|
+
if (!measures) return advancedVSeed;
|
59
|
+
if (!hasMeasureGroup) {
|
60
|
+
const newMeasures = [
|
61
|
+
{
|
62
|
+
id: 'measureGroup',
|
63
|
+
alias: 'measureGroup',
|
64
|
+
children: measures
|
65
|
+
}
|
66
|
+
];
|
67
|
+
return {
|
68
|
+
...advancedVSeed,
|
69
|
+
measures: newMeasures
|
70
|
+
};
|
71
|
+
}
|
72
|
+
let currentGroup = createEmptyMeasureGroup();
|
73
|
+
const measureGroups = [];
|
74
|
+
for (const measure of measures)if ('children' in measure) {
|
75
|
+
if (currentGroup.children?.length) {
|
76
|
+
currentGroup.id = currentGroup.children.map((item)=>item.id).join('-');
|
77
|
+
currentGroup.alias = currentGroup.children.map((item)=>item.alias).join('-');
|
78
|
+
measureGroups.push(currentGroup);
|
79
|
+
currentGroup = createEmptyMeasureGroup();
|
80
|
+
}
|
81
|
+
measureGroups.push(measure);
|
82
|
+
} else currentGroup.children?.push(measure);
|
83
|
+
if (currentGroup.children?.length) {
|
84
|
+
currentGroup.id = currentGroup.children.map((item)=>item.id).join('-');
|
85
|
+
currentGroup.alias = currentGroup.children.map((item)=>item.alias).join('-');
|
86
|
+
measureGroups.push(currentGroup);
|
87
|
+
currentGroup = createEmptyMeasureGroup();
|
88
|
+
}
|
89
|
+
advancedVSeed.measures = measureGroups;
|
90
|
+
return advancedVSeed;
|
91
|
+
};
|
92
|
+
const createEmptyMeasureGroup = ()=>({
|
93
|
+
id: '',
|
94
|
+
alias: '',
|
95
|
+
children: []
|
96
|
+
});
|
97
|
+
const autoDimensions = (advancedVSeed, context)=>{
|
98
|
+
const result = {
|
99
|
+
...advancedVSeed
|
100
|
+
};
|
101
|
+
const { vseed } = context;
|
102
|
+
const { dimensions, dataset } = vseed;
|
103
|
+
const { measures = [] } = advancedVSeed;
|
104
|
+
if (!dataset) throw new Error('dataset is required');
|
105
|
+
if (0 === dataset.length) return result;
|
106
|
+
if (dimensions) {
|
107
|
+
result.dimensions = dimensions;
|
108
|
+
return result;
|
109
|
+
}
|
110
|
+
const top100dataset = dataset.slice(0, 100);
|
111
|
+
const sample = top100dataset.reduce((prev, cur)=>({
|
112
|
+
...prev,
|
113
|
+
...cur
|
114
|
+
}), {});
|
115
|
+
result.dimensions = Object.keys(sample).filter((key)=>top100dataset.some((item)=>'string' == typeof item[key]) && ![
|
116
|
+
'',
|
117
|
+
null,
|
118
|
+
void 0
|
119
|
+
].includes(key) && !measures.some((measure)=>measure.id === key)).map((dim)=>({
|
120
|
+
id: dim,
|
121
|
+
alias: dim,
|
122
|
+
location: 'dimension'
|
123
|
+
}));
|
124
|
+
return result;
|
125
|
+
};
|
3
126
|
const FoldMeasureName = '__MeaName__';
|
4
127
|
const FoldMeasureValue = '__MeaValue__';
|
5
128
|
const FoldMeasureId = '__MeaId__';
|
6
129
|
const UnfoldDimensionGroup = '__DimGroup__';
|
7
130
|
const Separator = '-';
|
131
|
+
const ORIGINAL_DATA = '__OriginalData__';
|
8
132
|
const unfoldDimensions = (dataset, dimensions, measures, unfoldStartIndex = 0, foldGroupName = UnfoldDimensionGroup, dimensionsSeparator = Separator)=>{
|
9
133
|
if (unfoldStartIndex < 0 || unfoldStartIndex >= dimensions.length) throw new Error('unfoldStartIndex is out of range');
|
10
134
|
const dimensionsToBeUnfolded = dimensions.slice(unfoldStartIndex);
|
@@ -42,12 +166,15 @@ const foldMeasures = (dataset, measures, measureId = FoldMeasureId, measureName
|
|
42
166
|
};
|
43
167
|
const result = new Array(dataset.length * measures.length);
|
44
168
|
let index = 0;
|
169
|
+
const ids = measures.map((d)=>d.id);
|
45
170
|
for(let i = 0; i < dataset.length; i++)for(let j = 0; j < measures.length; j++){
|
46
|
-
const datum = {
|
171
|
+
const datum = omit({
|
47
172
|
...dataset[i]
|
48
|
-
};
|
173
|
+
}, ids);
|
174
|
+
datum[ORIGINAL_DATA] = dataset[i];
|
49
175
|
const measure = measures[j];
|
50
176
|
const { id, alias } = measure;
|
177
|
+
datum[id] = dataset[i][id];
|
51
178
|
datum[measureId] = id;
|
52
179
|
datum[measureName] = alias;
|
53
180
|
datum[measureValue] = dataset[i][id];
|
@@ -283,10 +410,10 @@ const pivotReshapeTo2D1M = (advancedVSeed, context)=>{
|
|
283
410
|
if (!measures) return;
|
284
411
|
const groupId = measureGroup.id;
|
285
412
|
const { dataset: newSubDataset, foldInfo, unfoldInfo } = dataReshapeFor2D1M(dataset, commonDimensions, measures, {
|
286
|
-
foldMeasureId: FoldMeasureId
|
287
|
-
foldMeasureName: FoldMeasureName
|
413
|
+
foldMeasureId: FoldMeasureId,
|
414
|
+
foldMeasureName: FoldMeasureName,
|
288
415
|
foldMeasureValue: FoldMeasureValue + groupId,
|
289
|
-
unfoldDimensionGroup: UnfoldDimensionGroup
|
416
|
+
unfoldDimensionGroup: UnfoldDimensionGroup
|
290
417
|
});
|
291
418
|
const reshapeInfo = {
|
292
419
|
id: groupId,
|
@@ -310,15 +437,16 @@ const encodingXY = (advancedVSeed)=>{
|
|
310
437
|
if (!datasetReshapeInfo || !dimensions) return result;
|
311
438
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
312
439
|
const { foldInfo, unfoldInfo } = cur;
|
313
|
-
const isSingleDimension =
|
440
|
+
const isSingleDimension = 1 === dimensions.length;
|
441
|
+
const isZeroDimension = 0 === dimensions.length;
|
314
442
|
const x = [
|
315
|
-
|
443
|
+
isZeroDimension ? foldInfo.measureName : dimensions[0].id
|
316
444
|
];
|
317
445
|
const y = [
|
318
446
|
foldInfo.measureValue
|
319
447
|
];
|
320
448
|
const group = [
|
321
|
-
isSingleDimension ? foldInfo.measureName : unfoldInfo.groupName
|
449
|
+
isSingleDimension || isZeroDimension ? foldInfo.measureName : unfoldInfo.groupName
|
322
450
|
];
|
323
451
|
const color = [
|
324
452
|
foldInfo.measureName
|
@@ -346,15 +474,16 @@ const encodingYX = (advancedVSeed)=>{
|
|
346
474
|
if (!datasetReshapeInfo || !dimensions) return result;
|
347
475
|
const encoding = datasetReshapeInfo.reduce((prev, cur)=>{
|
348
476
|
const { foldInfo, unfoldInfo } = cur;
|
349
|
-
const
|
477
|
+
const isZeroDimension = 0 === dimensions.length;
|
478
|
+
const isSingleDimension = 1 === dimensions.length;
|
350
479
|
const y = [
|
351
|
-
|
480
|
+
isZeroDimension ? foldInfo.measureName : dimensions[0].id
|
352
481
|
];
|
353
482
|
const x = [
|
354
483
|
foldInfo.measureValue
|
355
484
|
];
|
356
485
|
const group = [
|
357
|
-
isSingleDimension ? foldInfo.measureName : unfoldInfo.groupName
|
486
|
+
isSingleDimension || isZeroDimension ? foldInfo.measureName : unfoldInfo.groupName
|
358
487
|
];
|
359
488
|
const color = [
|
360
489
|
foldInfo.measureName
|
@@ -409,162 +538,89 @@ const encodingPolar = (advancedVSeed)=>{
|
|
409
538
|
encoding
|
410
539
|
};
|
411
540
|
};
|
412
|
-
const
|
541
|
+
const vchartBaseConfig = (advancedVSeed, context)=>{
|
413
542
|
const { vseed } = context;
|
414
|
-
const { chartType = 'table' } = vseed;
|
415
|
-
return {
|
416
|
-
...advancedVSeed,
|
417
|
-
chartType
|
418
|
-
};
|
419
|
-
};
|
420
|
-
const execPipeline = (pipeline, context, initialValue = {})=>{
|
421
|
-
const result = pipeline.reduce((prev, cur)=>cur(prev, context), initialValue);
|
422
|
-
return result;
|
423
|
-
};
|
424
|
-
const isVTable = (chartType)=>[
|
425
|
-
'table',
|
426
|
-
'pivotTable'
|
427
|
-
].includes(chartType);
|
428
|
-
const isVChart = (chartType)=>!isVTable(chartType);
|
429
|
-
const isPivotChart = (vseed)=>{
|
430
|
-
const { measures, dimensions } = vseed;
|
431
|
-
const hasRowOrColumnDimension = dimensions && dimensions.some((dimension)=>'rowDimension' === dimension.location || 'columnDimension' === dimension.location);
|
432
|
-
const hasMeasureGroup = measures && measures.find((measure)=>measure && measure.children);
|
433
|
-
return hasRowOrColumnDimension || hasMeasureGroup;
|
434
|
-
};
|
435
|
-
const autoMeasures = (advancedVSeed, context)=>{
|
436
543
|
const result = {
|
437
544
|
...advancedVSeed
|
438
545
|
};
|
439
|
-
const
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
...cur
|
452
|
-
}), {});
|
453
|
-
result.measures = Object.keys(sample).filter((key)=>top100dataset.some((item)=>'number' == typeof item[key]) && ![
|
454
|
-
'',
|
455
|
-
null,
|
456
|
-
void 0
|
457
|
-
].includes(key)).map((measure)=>({
|
458
|
-
id: measure,
|
459
|
-
alias: measure
|
460
|
-
}));
|
546
|
+
const config = external_remeda_pick(vseed, [
|
547
|
+
'backgroundColor',
|
548
|
+
'color',
|
549
|
+
'label',
|
550
|
+
'legend',
|
551
|
+
'tooltip'
|
552
|
+
]);
|
553
|
+
result.baseConfig = {
|
554
|
+
vchart: {
|
555
|
+
...config
|
556
|
+
}
|
557
|
+
};
|
461
558
|
return result;
|
462
559
|
};
|
463
|
-
const
|
560
|
+
const lineConfig = (advancedVSeed, context)=>{
|
464
561
|
const { vseed } = context;
|
465
|
-
const {
|
466
|
-
const hasMeasureGroup = measures?.some((measure)=>measure.children);
|
467
|
-
if (!measures) return advancedVSeed;
|
468
|
-
if (!hasMeasureGroup) {
|
469
|
-
const newMeasures = [
|
470
|
-
{
|
471
|
-
id: 'measureGroup',
|
472
|
-
alias: 'measureGroup',
|
473
|
-
children: measures
|
474
|
-
}
|
475
|
-
];
|
476
|
-
return {
|
477
|
-
...advancedVSeed,
|
478
|
-
measures: newMeasures
|
479
|
-
};
|
480
|
-
}
|
481
|
-
let currentGroup = createEmptyMeasureGroup();
|
482
|
-
const measureGroups = [];
|
483
|
-
for (const measure of measures)if ('children' in measure) {
|
484
|
-
if (currentGroup.children?.length) {
|
485
|
-
currentGroup.id = currentGroup.children.map((item)=>item.id).join('-');
|
486
|
-
currentGroup.alias = currentGroup.children.map((item)=>item.alias).join('-');
|
487
|
-
measureGroups.push(currentGroup);
|
488
|
-
currentGroup = createEmptyMeasureGroup();
|
489
|
-
}
|
490
|
-
measureGroups.push(measure);
|
491
|
-
} else currentGroup.children?.push(measure);
|
492
|
-
if (currentGroup.children?.length) {
|
493
|
-
currentGroup.id = currentGroup.children.map((item)=>item.id).join('-');
|
494
|
-
currentGroup.alias = currentGroup.children.map((item)=>item.alias).join('-');
|
495
|
-
measureGroups.push(currentGroup);
|
496
|
-
currentGroup = createEmptyMeasureGroup();
|
497
|
-
}
|
498
|
-
advancedVSeed.measures = measureGroups;
|
499
|
-
return advancedVSeed;
|
500
|
-
};
|
501
|
-
const createEmptyMeasureGroup = ()=>({
|
502
|
-
id: '',
|
503
|
-
alias: '',
|
504
|
-
children: []
|
505
|
-
});
|
506
|
-
const autoDimensions = (advancedVSeed, context)=>{
|
562
|
+
const { chartType } = vseed;
|
507
563
|
const result = {
|
508
564
|
...advancedVSeed
|
509
565
|
};
|
510
|
-
const
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
const sample = top100dataset.reduce((prev, cur)=>({
|
521
|
-
...prev,
|
522
|
-
...cur
|
523
|
-
}), {});
|
524
|
-
result.dimensions = Object.keys(sample).filter((key)=>top100dataset.some((item)=>'string' == typeof item[key]) && ![
|
525
|
-
'',
|
526
|
-
null,
|
527
|
-
void 0
|
528
|
-
].includes(key) && !measures.some((measure)=>measure.id === key)).map((dim)=>({
|
529
|
-
id: dim,
|
530
|
-
alias: dim,
|
531
|
-
location: 'dimension'
|
532
|
-
}));
|
566
|
+
const config = external_remeda_pick(vseed, [
|
567
|
+
'xAxis',
|
568
|
+
'yAxis'
|
569
|
+
]);
|
570
|
+
result.config = {
|
571
|
+
...result.config || {},
|
572
|
+
[chartType]: {
|
573
|
+
...config
|
574
|
+
}
|
575
|
+
};
|
533
576
|
return result;
|
534
577
|
};
|
535
|
-
const
|
578
|
+
const pieConfig = (advancedVSeed, context)=>{
|
536
579
|
const { vseed } = context;
|
580
|
+
const { chartType } = vseed;
|
537
581
|
const result = {
|
538
582
|
...advancedVSeed
|
539
583
|
};
|
540
|
-
const config = external_remeda_pick(vseed, [
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
'legend',
|
545
|
-
'tooltip'
|
546
|
-
]);
|
547
|
-
result.baseConfig = {
|
548
|
-
vchart: {
|
584
|
+
const config = external_remeda_pick(vseed, []);
|
585
|
+
result.config = {
|
586
|
+
...result.config || {},
|
587
|
+
[chartType]: {
|
549
588
|
...config
|
550
589
|
}
|
551
590
|
};
|
552
591
|
return result;
|
553
592
|
};
|
593
|
+
const barConfig = lineConfig;
|
594
|
+
const barParallelConfig = lineConfig;
|
595
|
+
const barPercentConfig = lineConfig;
|
596
|
+
const columnConfig = lineConfig;
|
597
|
+
const columnParallelConfig = lineConfig;
|
598
|
+
const columnPercentConfig = lineConfig;
|
599
|
+
const areaConfig = lineConfig;
|
600
|
+
const areaPercentConfig = lineConfig;
|
554
601
|
const vchartTheme = (advancedVSeed, context)=>{
|
555
602
|
const { customTheme, vseed } = context;
|
556
|
-
const { theme = 'light' } = vseed;
|
603
|
+
const { theme = 'light', chartType } = vseed;
|
557
604
|
const result = {
|
558
605
|
...advancedVSeed
|
559
606
|
};
|
560
607
|
if (!customTheme || !customTheme[theme]) return result;
|
561
|
-
const
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
608
|
+
const baseConfigVChartTheme = customTheme?.[theme].baseConfig?.vchart;
|
609
|
+
if (baseConfigVChartTheme) {
|
610
|
+
const baseConfigVChart = result.baseConfig?.vchart || {};
|
611
|
+
const mergedConfig = external_remeda_mergeDeep(baseConfigVChartTheme, external_remeda_clone(baseConfigVChart));
|
612
|
+
result.baseConfig = {
|
613
|
+
vchart: mergedConfig
|
614
|
+
};
|
615
|
+
}
|
616
|
+
const chartConfigTheme = customTheme?.[theme].config?.[chartType];
|
617
|
+
if (chartConfigTheme) {
|
618
|
+
const chartConfig = result.config?.[chartType] || {};
|
619
|
+
const mergedConfig = external_remeda_mergeDeep(chartConfigTheme, external_remeda_clone(chartConfig));
|
620
|
+
result.config = {
|
621
|
+
[chartType]: mergedConfig
|
622
|
+
};
|
623
|
+
}
|
568
624
|
return result;
|
569
625
|
};
|
570
626
|
const pivotAdapter = (pipeline, pivotPipeline)=>(advancedVSeed, context)=>{
|
@@ -573,6 +629,16 @@ const pivotAdapter = (pipeline, pivotPipeline)=>(advancedVSeed, context)=>{
|
|
573
629
|
if (usePivotChart) return execPipeline(pivotPipeline, context, advancedVSeed);
|
574
630
|
return execPipeline(pipeline, context, advancedVSeed);
|
575
631
|
};
|
632
|
+
const markStyle_markStyle = (advancedVSeed, context)=>{
|
633
|
+
const { vseed } = context;
|
634
|
+
const markStyle = external_remeda_pick(vseed, [
|
635
|
+
'barStyle'
|
636
|
+
]);
|
637
|
+
return {
|
638
|
+
...advancedVSeed,
|
639
|
+
markStyle
|
640
|
+
};
|
641
|
+
};
|
576
642
|
const lineAdvancedPipeline = [
|
577
643
|
initAdvancedVSeed,
|
578
644
|
autoMeasures,
|
@@ -584,6 +650,7 @@ const lineAdvancedPipeline = [
|
|
584
650
|
]),
|
585
651
|
encodingXY,
|
586
652
|
vchartBaseConfig,
|
653
|
+
lineConfig,
|
587
654
|
vchartTheme
|
588
655
|
];
|
589
656
|
const barAdvancedPipeline = [
|
@@ -596,8 +663,10 @@ const barAdvancedPipeline = [
|
|
596
663
|
pivotReshapeTo2D1M
|
597
664
|
]),
|
598
665
|
encodingYX,
|
666
|
+
barConfig,
|
599
667
|
vchartBaseConfig,
|
600
|
-
vchartTheme
|
668
|
+
vchartTheme,
|
669
|
+
markStyle_markStyle
|
601
670
|
];
|
602
671
|
const barParallelAdvancedPipeline = [
|
603
672
|
initAdvancedVSeed,
|
@@ -609,8 +678,10 @@ const barParallelAdvancedPipeline = [
|
|
609
678
|
pivotReshapeTo2D1M
|
610
679
|
]),
|
611
680
|
encodingYX,
|
681
|
+
barParallelConfig,
|
612
682
|
vchartBaseConfig,
|
613
|
-
vchartTheme
|
683
|
+
vchartTheme,
|
684
|
+
markStyle_markStyle
|
614
685
|
];
|
615
686
|
const barPercentAdvancedPipeline = [
|
616
687
|
initAdvancedVSeed,
|
@@ -622,8 +693,10 @@ const barPercentAdvancedPipeline = [
|
|
622
693
|
pivotReshapeTo2D1M
|
623
694
|
]),
|
624
695
|
encodingYX,
|
696
|
+
barPercentConfig,
|
625
697
|
vchartBaseConfig,
|
626
|
-
vchartTheme
|
698
|
+
vchartTheme,
|
699
|
+
markStyle_markStyle
|
627
700
|
];
|
628
701
|
const columnAdvancedPipeline = [
|
629
702
|
initAdvancedVSeed,
|
@@ -635,8 +708,10 @@ const columnAdvancedPipeline = [
|
|
635
708
|
pivotReshapeTo2D1M
|
636
709
|
]),
|
637
710
|
encodingXY,
|
711
|
+
columnConfig,
|
638
712
|
vchartBaseConfig,
|
639
|
-
vchartTheme
|
713
|
+
vchartTheme,
|
714
|
+
markStyle_markStyle
|
640
715
|
];
|
641
716
|
const columnParallelAdvancedPipeline = [
|
642
717
|
initAdvancedVSeed,
|
@@ -648,8 +723,10 @@ const columnParallelAdvancedPipeline = [
|
|
648
723
|
pivotReshapeTo2D1M
|
649
724
|
]),
|
650
725
|
encodingXY,
|
726
|
+
columnParallelConfig,
|
651
727
|
vchartBaseConfig,
|
652
|
-
vchartTheme
|
728
|
+
vchartTheme,
|
729
|
+
markStyle_markStyle
|
653
730
|
];
|
654
731
|
const columnPercentAdvancedPipeline = [
|
655
732
|
initAdvancedVSeed,
|
@@ -661,8 +738,10 @@ const columnPercentAdvancedPipeline = [
|
|
661
738
|
pivotReshapeTo2D1M
|
662
739
|
]),
|
663
740
|
encodingXY,
|
741
|
+
columnPercentConfig,
|
664
742
|
vchartBaseConfig,
|
665
|
-
vchartTheme
|
743
|
+
vchartTheme,
|
744
|
+
markStyle_markStyle
|
666
745
|
];
|
667
746
|
const areaAdvancedPipeline = [
|
668
747
|
initAdvancedVSeed,
|
@@ -674,6 +753,7 @@ const areaAdvancedPipeline = [
|
|
674
753
|
pivotReshapeTo2D1M
|
675
754
|
]),
|
676
755
|
encodingXY,
|
756
|
+
areaConfig,
|
677
757
|
vchartBaseConfig,
|
678
758
|
vchartTheme
|
679
759
|
];
|
@@ -687,6 +767,7 @@ const areaPercentAdvancedPipeline = [
|
|
687
767
|
pivotReshapeTo2D1M
|
688
768
|
]),
|
689
769
|
encodingXY,
|
770
|
+
areaPercentConfig,
|
690
771
|
vchartBaseConfig,
|
691
772
|
vchartTheme
|
692
773
|
];
|
@@ -700,6 +781,7 @@ const pieAdvancedPipeline = [
|
|
700
781
|
pivotReshapeTo1D1M
|
701
782
|
]),
|
702
783
|
encodingPolar,
|
784
|
+
pieConfig,
|
703
785
|
vchartBaseConfig,
|
704
786
|
vchartTheme
|
705
787
|
];
|
@@ -747,6 +829,11 @@ const initColumn = (spec, context)=>{
|
|
747
829
|
result.yField = encoding[0].y[0];
|
748
830
|
result.seriesField = encoding[0].group[0];
|
749
831
|
result.padding = 0;
|
832
|
+
result.region = [
|
833
|
+
{
|
834
|
+
clip: true
|
835
|
+
}
|
836
|
+
];
|
750
837
|
return result;
|
751
838
|
};
|
752
839
|
const initBar = (spec, context)=>{
|
@@ -762,6 +849,11 @@ const initBar = (spec, context)=>{
|
|
762
849
|
result.xField = encoding[0].x?.[0];
|
763
850
|
result.seriesField = encoding[0].group?.[0];
|
764
851
|
result.padding = 0;
|
852
|
+
result.region = [
|
853
|
+
{
|
854
|
+
clip: true
|
855
|
+
}
|
856
|
+
];
|
765
857
|
return result;
|
766
858
|
};
|
767
859
|
const initBarParallel = (spec, context)=>{
|
@@ -781,6 +873,11 @@ const initBarParallel = (spec, context)=>{
|
|
781
873
|
result.xField = encoding[0].x[0];
|
782
874
|
result.seriesField = encoding[0].group[0];
|
783
875
|
result.padding = 0;
|
876
|
+
result.region = [
|
877
|
+
{
|
878
|
+
clip: true
|
879
|
+
}
|
880
|
+
];
|
784
881
|
return result;
|
785
882
|
};
|
786
883
|
const initArea = (spec, context)=>{
|
@@ -796,6 +893,11 @@ const initArea = (spec, context)=>{
|
|
796
893
|
result.yField = encoding[0].y[0];
|
797
894
|
result.seriesField = encoding[0].group[0];
|
798
895
|
result.padding = 0;
|
896
|
+
result.region = [
|
897
|
+
{
|
898
|
+
clip: true
|
899
|
+
}
|
900
|
+
];
|
799
901
|
return result;
|
800
902
|
};
|
801
903
|
const initLine = (spec, context)=>{
|
@@ -811,6 +913,11 @@ const initLine = (spec, context)=>{
|
|
811
913
|
result.yField = encoding[0].y[0];
|
812
914
|
result.seriesField = encoding[0].group[0];
|
813
915
|
result.padding = 0;
|
916
|
+
result.region = [
|
917
|
+
{
|
918
|
+
clip: true
|
919
|
+
}
|
920
|
+
];
|
814
921
|
return result;
|
815
922
|
};
|
816
923
|
const initColumnParallel = (spec, context)=>{
|
@@ -830,6 +937,11 @@ const initColumnParallel = (spec, context)=>{
|
|
830
937
|
result.yField = encoding[0].y[0];
|
831
938
|
result.seriesField = encoding[0].group[0];
|
832
939
|
result.padding = 0;
|
940
|
+
result.region = [
|
941
|
+
{
|
942
|
+
clip: true
|
943
|
+
}
|
944
|
+
];
|
833
945
|
return result;
|
834
946
|
};
|
835
947
|
const initPie = (spec, context)=>{
|
@@ -846,6 +958,11 @@ const initPie = (spec, context)=>{
|
|
846
958
|
result.categoryField = encoding[0].angle[0];
|
847
959
|
result.seriesField = encoding[0].group[0];
|
848
960
|
result.padding = 0;
|
961
|
+
result.region = [
|
962
|
+
{
|
963
|
+
clip: true
|
964
|
+
}
|
965
|
+
];
|
849
966
|
return result;
|
850
967
|
};
|
851
968
|
const initPivot = (spec)=>{
|
@@ -863,67 +980,328 @@ const initPivot = (spec)=>{
|
|
863
980
|
indicatorsAsCol: false
|
864
981
|
};
|
865
982
|
};
|
866
|
-
const xBand = (spec)=>{
|
983
|
+
const xBand = (spec, context)=>{
|
867
984
|
const result = {
|
868
985
|
...spec
|
869
986
|
};
|
987
|
+
const { advancedVSeed, vseed } = context;
|
988
|
+
const { chartType } = vseed;
|
989
|
+
const config = advancedVSeed.config?.[chartType]?.xAxis;
|
870
990
|
if (!result.axes) result.axes = [];
|
991
|
+
if (!config) {
|
992
|
+
result.axes = [
|
993
|
+
...result.axes,
|
994
|
+
{
|
995
|
+
visible: true,
|
996
|
+
type: 'band',
|
997
|
+
orient: 'bottom'
|
998
|
+
}
|
999
|
+
];
|
1000
|
+
return result;
|
1001
|
+
}
|
1002
|
+
const { visible = true, label, tick, title, grid, line, labelAutoHide, labelAutoHideGap, labelAutoLimit, labelAutoLimitLength, labelAutoRotate, labelAutoRotateAngleRange } = config;
|
1003
|
+
const sampling = !(labelAutoHide || labelAutoRotate || labelAutoLimit);
|
1004
|
+
const bandAxis = {
|
1005
|
+
visible,
|
1006
|
+
type: 'band',
|
1007
|
+
orient: 'bottom',
|
1008
|
+
maxHeight: labelAutoLimitLength,
|
1009
|
+
sampling,
|
1010
|
+
hover: true,
|
1011
|
+
label: {
|
1012
|
+
visible: label?.visible,
|
1013
|
+
flush: true,
|
1014
|
+
space: 8,
|
1015
|
+
style: {
|
1016
|
+
maxLineWidth: labelAutoLimitLength,
|
1017
|
+
fill: label?.labelColor,
|
1018
|
+
angle: label?.labelAngle,
|
1019
|
+
fontSize: label?.labelFontSize,
|
1020
|
+
fontWeight: label?.labelFontWeight
|
1021
|
+
},
|
1022
|
+
minGap: labelAutoHideGap,
|
1023
|
+
autoHide: labelAutoHide,
|
1024
|
+
autoHideMethod: 'greedy',
|
1025
|
+
autoHideSeparation: labelAutoHideGap,
|
1026
|
+
autoLimit: labelAutoLimit,
|
1027
|
+
autoRotate: labelAutoRotate,
|
1028
|
+
autoRotateAngle: labelAutoRotateAngleRange,
|
1029
|
+
lastVisible: true
|
1030
|
+
},
|
1031
|
+
title: {
|
1032
|
+
visible: title?.visible,
|
1033
|
+
text: title?.titleText,
|
1034
|
+
style: {
|
1035
|
+
fill: title?.titleColor,
|
1036
|
+
fontSize: title?.titleFontSize,
|
1037
|
+
fontWeight: title?.titleFontWeight
|
1038
|
+
}
|
1039
|
+
},
|
1040
|
+
tick: {
|
1041
|
+
visible: tick?.visible,
|
1042
|
+
tickSize: tick?.tickSize,
|
1043
|
+
inside: tick?.tickInside,
|
1044
|
+
style: {
|
1045
|
+
stroke: tick?.tickColor
|
1046
|
+
}
|
1047
|
+
},
|
1048
|
+
grid: {
|
1049
|
+
visible: grid?.visible,
|
1050
|
+
style: {
|
1051
|
+
lineWidth: grid?.gridWidth,
|
1052
|
+
stroke: grid?.gridColor
|
1053
|
+
}
|
1054
|
+
},
|
1055
|
+
domainLine: {
|
1056
|
+
visible: line?.visible,
|
1057
|
+
style: {
|
1058
|
+
lineWidth: line?.lineWidth,
|
1059
|
+
stroke: line?.lineColor
|
1060
|
+
}
|
1061
|
+
}
|
1062
|
+
};
|
871
1063
|
result.axes = [
|
872
1064
|
...result.axes,
|
873
|
-
|
874
|
-
visible: true,
|
875
|
-
type: 'band',
|
876
|
-
orient: 'bottom'
|
877
|
-
}
|
1065
|
+
bandAxis
|
878
1066
|
];
|
879
1067
|
return result;
|
880
1068
|
};
|
881
|
-
const xLinear = (spec)=>{
|
1069
|
+
const xLinear = (spec, context)=>{
|
882
1070
|
const result = {
|
883
1071
|
...spec
|
884
1072
|
};
|
1073
|
+
const { advancedVSeed, vseed } = context;
|
1074
|
+
const { chartType } = vseed;
|
1075
|
+
const config = advancedVSeed.config?.[chartType]?.xAxis;
|
885
1076
|
if (!result.axes) result.axes = [];
|
1077
|
+
if (!config) {
|
1078
|
+
result.axes = [
|
1079
|
+
...result.axes,
|
1080
|
+
{
|
1081
|
+
visible: true,
|
1082
|
+
type: 'linear',
|
1083
|
+
orient: 'bottom'
|
1084
|
+
}
|
1085
|
+
];
|
1086
|
+
return result;
|
1087
|
+
}
|
1088
|
+
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min } = config;
|
1089
|
+
const linearAxis = {
|
1090
|
+
visible,
|
1091
|
+
type: 'linear',
|
1092
|
+
orient: 'bottom',
|
1093
|
+
nice,
|
1094
|
+
zero,
|
1095
|
+
inverse,
|
1096
|
+
max,
|
1097
|
+
min,
|
1098
|
+
label: {
|
1099
|
+
visible: label?.visible,
|
1100
|
+
style: {
|
1101
|
+
fill: label?.labelColor,
|
1102
|
+
angle: label?.labelAngle,
|
1103
|
+
fontSize: label?.labelFontSize,
|
1104
|
+
fontWeight: label?.labelFontWeight
|
1105
|
+
}
|
1106
|
+
},
|
1107
|
+
title: {
|
1108
|
+
visible: title?.visible,
|
1109
|
+
text: title?.titleText,
|
1110
|
+
style: {
|
1111
|
+
fill: title?.titleColor,
|
1112
|
+
fontSize: title?.titleFontSize,
|
1113
|
+
fontWeight: title?.titleFontWeight
|
1114
|
+
}
|
1115
|
+
},
|
1116
|
+
tick: {
|
1117
|
+
visible: tick?.visible,
|
1118
|
+
tickSize: tick?.tickSize,
|
1119
|
+
inside: tick?.tickInside,
|
1120
|
+
style: {
|
1121
|
+
stroke: tick?.tickColor
|
1122
|
+
}
|
1123
|
+
},
|
1124
|
+
grid: {
|
1125
|
+
visible: grid?.visible,
|
1126
|
+
style: {
|
1127
|
+
lineWidth: grid?.gridWidth,
|
1128
|
+
stroke: grid?.gridColor
|
1129
|
+
}
|
1130
|
+
},
|
1131
|
+
domainLine: {
|
1132
|
+
visible: line?.visible,
|
1133
|
+
style: {
|
1134
|
+
lineWidth: line?.lineWidth,
|
1135
|
+
stroke: line?.lineColor
|
1136
|
+
}
|
1137
|
+
}
|
1138
|
+
};
|
886
1139
|
result.axes = [
|
887
1140
|
...result.axes,
|
888
|
-
|
889
|
-
visible: true,
|
890
|
-
type: 'linear',
|
891
|
-
orient: 'bottom',
|
892
|
-
nice: true,
|
893
|
-
zero: true
|
894
|
-
}
|
1141
|
+
linearAxis
|
895
1142
|
];
|
896
1143
|
return result;
|
897
1144
|
};
|
898
|
-
const yBand = (spec)=>{
|
1145
|
+
const yBand = (spec, context)=>{
|
899
1146
|
const result = {
|
900
1147
|
...spec
|
901
1148
|
};
|
1149
|
+
const { advancedVSeed, vseed } = context;
|
1150
|
+
const { chartType } = vseed;
|
1151
|
+
const config = advancedVSeed.config?.[chartType]?.yAxis;
|
902
1152
|
if (!result.axes) result.axes = [];
|
1153
|
+
if (!config) {
|
1154
|
+
result.axes = [
|
1155
|
+
...result.axes,
|
1156
|
+
{
|
1157
|
+
visible: true,
|
1158
|
+
type: 'band',
|
1159
|
+
orient: 'left'
|
1160
|
+
}
|
1161
|
+
];
|
1162
|
+
return result;
|
1163
|
+
}
|
1164
|
+
const { visible = true, label, tick, title, grid, line, labelAutoHide, labelAutoHideGap, labelAutoLimit, labelAutoLimitLength, labelAutoRotate, labelAutoRotateAngleRange } = config;
|
1165
|
+
const sampling = !(labelAutoHide || labelAutoRotate || labelAutoLimit);
|
1166
|
+
const bandAxis = {
|
1167
|
+
visible,
|
1168
|
+
type: 'band',
|
1169
|
+
orient: 'left',
|
1170
|
+
maxWidth: labelAutoLimitLength,
|
1171
|
+
sampling,
|
1172
|
+
hover: true,
|
1173
|
+
label: {
|
1174
|
+
visible: label?.visible,
|
1175
|
+
flush: true,
|
1176
|
+
containerAlign: 'left',
|
1177
|
+
space: 8,
|
1178
|
+
style: {
|
1179
|
+
maxLineWidth: labelAutoLimitLength,
|
1180
|
+
fill: label?.labelColor,
|
1181
|
+
angle: label?.labelAngle,
|
1182
|
+
fontSize: label?.labelFontSize,
|
1183
|
+
fontWeight: label?.labelFontWeight
|
1184
|
+
},
|
1185
|
+
minGap: labelAutoHideGap,
|
1186
|
+
autoHide: labelAutoHide,
|
1187
|
+
autoHideMethod: 'greedy',
|
1188
|
+
autoHideSeparation: labelAutoHideGap,
|
1189
|
+
autoLimit: labelAutoLimit,
|
1190
|
+
autoRotate: labelAutoRotate,
|
1191
|
+
autoRotateAngle: labelAutoRotateAngleRange,
|
1192
|
+
lastVisible: true
|
1193
|
+
},
|
1194
|
+
title: {
|
1195
|
+
visible: title?.visible,
|
1196
|
+
text: title?.titleText,
|
1197
|
+
style: {
|
1198
|
+
fill: title?.titleColor,
|
1199
|
+
fontSize: title?.titleFontSize,
|
1200
|
+
fontWeight: title?.titleFontWeight
|
1201
|
+
}
|
1202
|
+
},
|
1203
|
+
tick: {
|
1204
|
+
visible: tick?.visible,
|
1205
|
+
tickSize: tick?.tickSize,
|
1206
|
+
inside: tick?.tickInside,
|
1207
|
+
style: {
|
1208
|
+
stroke: tick?.tickColor
|
1209
|
+
}
|
1210
|
+
},
|
1211
|
+
grid: {
|
1212
|
+
visible: grid?.visible,
|
1213
|
+
style: {
|
1214
|
+
lineWidth: grid?.gridWidth,
|
1215
|
+
stroke: grid?.gridColor
|
1216
|
+
}
|
1217
|
+
},
|
1218
|
+
domainLine: {
|
1219
|
+
visible: line?.visible,
|
1220
|
+
style: {
|
1221
|
+
lineWidth: line?.lineWidth,
|
1222
|
+
stroke: line?.lineColor
|
1223
|
+
}
|
1224
|
+
}
|
1225
|
+
};
|
903
1226
|
result.axes = [
|
904
1227
|
...result.axes,
|
905
|
-
|
906
|
-
visible: true,
|
907
|
-
type: 'band',
|
908
|
-
orient: 'left'
|
909
|
-
}
|
1228
|
+
bandAxis
|
910
1229
|
];
|
911
1230
|
return result;
|
912
1231
|
};
|
913
|
-
const yLinear = (spec)=>{
|
1232
|
+
const yLinear = (spec, context)=>{
|
914
1233
|
const result = {
|
915
1234
|
...spec
|
916
1235
|
};
|
1236
|
+
const { advancedVSeed, vseed } = context;
|
1237
|
+
const { chartType } = vseed;
|
1238
|
+
const config = advancedVSeed.config?.[chartType]?.yAxis;
|
917
1239
|
if (!result.axes) result.axes = [];
|
1240
|
+
if (!config) {
|
1241
|
+
result.axes = [
|
1242
|
+
...result.axes,
|
1243
|
+
{
|
1244
|
+
visible: true,
|
1245
|
+
type: 'linear',
|
1246
|
+
orient: 'left'
|
1247
|
+
}
|
1248
|
+
];
|
1249
|
+
return result;
|
1250
|
+
}
|
1251
|
+
const { visible = true, label, tick, title, grid, line, zero, nice, inverse, max, min } = config;
|
1252
|
+
const linearAxis = {
|
1253
|
+
visible,
|
1254
|
+
type: 'linear',
|
1255
|
+
orient: 'left',
|
1256
|
+
nice,
|
1257
|
+
zero,
|
1258
|
+
inverse,
|
1259
|
+
max,
|
1260
|
+
min,
|
1261
|
+
label: {
|
1262
|
+
visible: label?.visible,
|
1263
|
+
style: {
|
1264
|
+
fill: label?.labelColor,
|
1265
|
+
angle: label?.labelAngle,
|
1266
|
+
fontSize: label?.labelFontSize,
|
1267
|
+
fontWeight: label?.labelFontWeight
|
1268
|
+
}
|
1269
|
+
},
|
1270
|
+
title: {
|
1271
|
+
visible: title?.visible,
|
1272
|
+
text: title?.titleText,
|
1273
|
+
style: {
|
1274
|
+
fill: title?.titleColor,
|
1275
|
+
fontSize: title?.titleFontSize,
|
1276
|
+
fontWeight: title?.titleFontWeight
|
1277
|
+
}
|
1278
|
+
},
|
1279
|
+
tick: {
|
1280
|
+
visible: tick?.visible,
|
1281
|
+
tickSize: tick?.tickSize,
|
1282
|
+
inside: tick?.tickInside,
|
1283
|
+
style: {
|
1284
|
+
stroke: tick?.tickColor
|
1285
|
+
}
|
1286
|
+
},
|
1287
|
+
grid: {
|
1288
|
+
visible: grid?.visible,
|
1289
|
+
style: {
|
1290
|
+
lineWidth: grid?.gridWidth,
|
1291
|
+
stroke: grid?.gridColor
|
1292
|
+
}
|
1293
|
+
},
|
1294
|
+
domainLine: {
|
1295
|
+
visible: line?.visible,
|
1296
|
+
style: {
|
1297
|
+
lineWidth: line?.lineWidth,
|
1298
|
+
stroke: line?.lineColor
|
1299
|
+
}
|
1300
|
+
}
|
1301
|
+
};
|
918
1302
|
result.axes = [
|
919
1303
|
...result.axes,
|
920
|
-
|
921
|
-
visible: true,
|
922
|
-
type: 'linear',
|
923
|
-
orient: 'left',
|
924
|
-
nice: true,
|
925
|
-
zero: true
|
926
|
-
}
|
1304
|
+
linearAxis
|
927
1305
|
];
|
928
1306
|
return result;
|
929
1307
|
};
|
@@ -934,11 +1312,11 @@ const percent = (spec, context)=>{
|
|
934
1312
|
result.percent = true;
|
935
1313
|
return result;
|
936
1314
|
};
|
937
|
-
const
|
1315
|
+
const stackInverse = (spec)=>{
|
938
1316
|
const result = {
|
939
1317
|
...spec
|
940
1318
|
};
|
941
|
-
result.
|
1319
|
+
result.stackInverse = true;
|
942
1320
|
return result;
|
943
1321
|
};
|
944
1322
|
const background_backgroundColor = (spec, context)=>{
|
@@ -984,24 +1362,103 @@ const label_label = (spec, context)=>{
|
|
984
1362
|
};
|
985
1363
|
return result;
|
986
1364
|
};
|
987
|
-
const
|
988
|
-
enable: true
|
989
|
-
};
|
990
|
-
const legend_legend = (spec, context)=>{
|
1365
|
+
const discreteLegend = (spec, context)=>{
|
991
1366
|
const result = {
|
992
1367
|
...spec
|
993
1368
|
};
|
994
1369
|
const { advancedVSeed } = context;
|
995
1370
|
const baseConfig = advancedVSeed.baseConfig.vchart;
|
996
1371
|
if (!baseConfig || !baseConfig.legend) return result;
|
997
|
-
const { legend
|
998
|
-
const { enable } = legend;
|
1372
|
+
const { legend } = baseConfig;
|
1373
|
+
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight, maxSize, border, shapeType = 'rectRound' } = legend || {};
|
1374
|
+
const orient = [
|
1375
|
+
'bottom',
|
1376
|
+
'bottomLeft',
|
1377
|
+
'bottomRight',
|
1378
|
+
'bl',
|
1379
|
+
'br'
|
1380
|
+
].includes(position) ? 'bottom' : [
|
1381
|
+
'top',
|
1382
|
+
'topLeft',
|
1383
|
+
'topRight',
|
1384
|
+
'tl',
|
1385
|
+
'tr'
|
1386
|
+
].includes(position) ? 'top' : [
|
1387
|
+
'left',
|
1388
|
+
'leftTop',
|
1389
|
+
'leftBottom',
|
1390
|
+
'lt',
|
1391
|
+
'lb'
|
1392
|
+
].includes(position) ? 'left' : 'right';
|
1393
|
+
const legendPosition = [
|
1394
|
+
'topLeft',
|
1395
|
+
'bottomLeft',
|
1396
|
+
'leftTop',
|
1397
|
+
'rightTop',
|
1398
|
+
'lt',
|
1399
|
+
'rt',
|
1400
|
+
'tl',
|
1401
|
+
'bl'
|
1402
|
+
].includes(position) ? 'start' : [
|
1403
|
+
'topRight',
|
1404
|
+
'bottomRight',
|
1405
|
+
'leftBottom',
|
1406
|
+
'rightBottom',
|
1407
|
+
'lb',
|
1408
|
+
'rb',
|
1409
|
+
'rt',
|
1410
|
+
'br'
|
1411
|
+
].includes(position) ? 'end' : 'middle';
|
999
1412
|
result.legends = {
|
1000
|
-
|
1413
|
+
type: 'discrete',
|
1414
|
+
visible: enable,
|
1415
|
+
maxCol: maxSize,
|
1416
|
+
maxRow: maxSize,
|
1417
|
+
autoPage: true,
|
1418
|
+
orient,
|
1419
|
+
position: legendPosition,
|
1420
|
+
data: border ? (items)=>items.map((item)=>{
|
1421
|
+
item.shape.outerBorder = {
|
1422
|
+
stroke: item.shape.fill,
|
1423
|
+
distance: 3,
|
1424
|
+
lineWidth: 1
|
1425
|
+
};
|
1426
|
+
return item;
|
1427
|
+
}) : void 0,
|
1428
|
+
item: {
|
1429
|
+
focus: true,
|
1430
|
+
focusIconStyle: {
|
1431
|
+
size: labelFontSize + 2,
|
1432
|
+
fill: labelFontColor,
|
1433
|
+
fontWeight: labelFontWeight
|
1434
|
+
},
|
1435
|
+
shape: {
|
1436
|
+
space: border ? 6 : 4,
|
1437
|
+
style: {
|
1438
|
+
symbolType: shapeType,
|
1439
|
+
size: border ? 8 : 10
|
1440
|
+
}
|
1441
|
+
},
|
1442
|
+
label: {
|
1443
|
+
style: {
|
1444
|
+
fontSize: labelFontSize,
|
1445
|
+
fill: labelFontColor,
|
1446
|
+
fontWeight: labelFontWeight
|
1447
|
+
}
|
1448
|
+
},
|
1449
|
+
background: {
|
1450
|
+
state: {
|
1451
|
+
selectedHover: {
|
1452
|
+
fill: labelFontColor,
|
1453
|
+
fillOpacity: 0.05
|
1454
|
+
}
|
1455
|
+
}
|
1456
|
+
}
|
1457
|
+
}
|
1001
1458
|
};
|
1002
1459
|
return result;
|
1003
1460
|
};
|
1004
|
-
const
|
1461
|
+
const pivotDiscreteLegend = (spec, context)=>{
|
1005
1462
|
const result = {
|
1006
1463
|
...spec
|
1007
1464
|
};
|
@@ -1011,38 +1468,94 @@ const pivotLegend = (spec, context)=>{
|
|
1011
1468
|
const { datasetReshapeInfo } = advancedVSeed;
|
1012
1469
|
const colorItems = unique(datasetReshapeInfo.flatMap((d)=>d.unfoldInfo.colorItems));
|
1013
1470
|
const { legend, color } = baseConfig;
|
1014
|
-
const { enable } = legend;
|
1015
1471
|
const { colorScheme } = color;
|
1472
|
+
const { enable, position = 'bottom', labelFontColor, labelFontSize = 12, labelFontWeight, maxSize, border, shapeType = 'rectRound' } = legend || {};
|
1473
|
+
const orient = [
|
1474
|
+
'bottom',
|
1475
|
+
'bottomLeft',
|
1476
|
+
'bottomRight',
|
1477
|
+
'bl',
|
1478
|
+
'br'
|
1479
|
+
].includes(position) ? 'bottom' : [
|
1480
|
+
'top',
|
1481
|
+
'topLeft',
|
1482
|
+
'topRight',
|
1483
|
+
'tl',
|
1484
|
+
'tr'
|
1485
|
+
].includes(position) ? 'top' : [
|
1486
|
+
'left',
|
1487
|
+
'leftTop',
|
1488
|
+
'leftBottom',
|
1489
|
+
'lt',
|
1490
|
+
'lb'
|
1491
|
+
].includes(position) ? 'left' : 'right';
|
1492
|
+
const legendPosition = [
|
1493
|
+
'topLeft',
|
1494
|
+
'bottomLeft',
|
1495
|
+
'leftTop',
|
1496
|
+
'rightTop',
|
1497
|
+
'lt',
|
1498
|
+
'rt',
|
1499
|
+
'tl',
|
1500
|
+
'bl'
|
1501
|
+
].includes(position) ? 'start' : [
|
1502
|
+
'topRight',
|
1503
|
+
'bottomRight',
|
1504
|
+
'leftBottom',
|
1505
|
+
'rightBottom',
|
1506
|
+
'lb',
|
1507
|
+
'rb',
|
1508
|
+
'rt',
|
1509
|
+
'br'
|
1510
|
+
].includes(position) ? 'end' : 'middle';
|
1016
1511
|
const legends = {
|
1017
1512
|
visible: enable,
|
1018
|
-
alignSelf: 'end',
|
1019
1513
|
type: 'discrete',
|
1020
|
-
|
1514
|
+
orient,
|
1515
|
+
position: legendPosition,
|
1516
|
+
maxCol: maxSize,
|
1517
|
+
maxRow: maxSize,
|
1021
1518
|
data: colorItems.map((d, index)=>({
|
1022
1519
|
label: d,
|
1023
1520
|
shape: {
|
1024
|
-
|
1521
|
+
outerBorder: border ? {
|
1522
|
+
stroke: colorScheme[index],
|
1523
|
+
distance: 3,
|
1524
|
+
lineWidth: 1
|
1525
|
+
} : void 0,
|
1025
1526
|
fill: colorScheme[index]
|
1026
1527
|
}
|
1027
1528
|
})),
|
1028
1529
|
item: {
|
1530
|
+
focus: true,
|
1531
|
+
focusIconStyle: {
|
1532
|
+
size: labelFontSize + 2,
|
1533
|
+
fill: labelFontColor,
|
1534
|
+
fontWeight: labelFontWeight
|
1535
|
+
},
|
1536
|
+
shape: {
|
1537
|
+
space: border ? 6 : 4,
|
1538
|
+
style: {
|
1539
|
+
symbolType: shapeType,
|
1540
|
+
size: border ? 8 : 10
|
1541
|
+
}
|
1542
|
+
},
|
1543
|
+
label: {
|
1544
|
+
style: {
|
1545
|
+
fontSize: labelFontSize,
|
1546
|
+
fill: labelFontColor,
|
1547
|
+
fontWeight: labelFontWeight
|
1548
|
+
}
|
1549
|
+
},
|
1029
1550
|
background: {
|
1030
|
-
visible: true,
|
1031
1551
|
state: {
|
1032
1552
|
selectedHover: {
|
1033
|
-
fill:
|
1553
|
+
fill: labelFontColor,
|
1034
1554
|
fillOpacity: 0.05
|
1035
1555
|
}
|
1036
1556
|
}
|
1037
|
-
},
|
1038
|
-
label: {
|
1039
|
-
style: {
|
1040
|
-
fontSize: 12,
|
1041
|
-
fill: '#6F6F6F'
|
1042
|
-
}
|
1043
1557
|
}
|
1044
|
-
}
|
1045
|
-
orient: 'bottom'
|
1558
|
+
}
|
1046
1559
|
};
|
1047
1560
|
return {
|
1048
1561
|
...result,
|
@@ -1291,7 +1804,123 @@ const pivotRowDimensions = (spec, context)=>{
|
|
1291
1804
|
rows: rows
|
1292
1805
|
};
|
1293
1806
|
};
|
1294
|
-
const
|
1807
|
+
const selector_selector = (datum, selector)=>{
|
1808
|
+
if (!selector) return true;
|
1809
|
+
const selectors = Array.isArray(selector) ? selector : [
|
1810
|
+
selector
|
1811
|
+
];
|
1812
|
+
for (const selector of selectors)if (isValueSelector(selector)) {
|
1813
|
+
if (Object.values(datum).find((v)=>v === selector)) return true;
|
1814
|
+
} else if (isMeasureSelector(selector)) {
|
1815
|
+
const selectorValueArr = Array.isArray(selector.value) ? selector.value : [
|
1816
|
+
selector.value
|
1817
|
+
];
|
1818
|
+
switch(selector.operator){
|
1819
|
+
case '=':
|
1820
|
+
if (datum[selector.field] === selectorValueArr[0]) return true;
|
1821
|
+
break;
|
1822
|
+
case '!=':
|
1823
|
+
if (datum[selector.field] !== selectorValueArr[0]) return true;
|
1824
|
+
break;
|
1825
|
+
case '>':
|
1826
|
+
if (datum[selector.field] > selectorValueArr[0]) return true;
|
1827
|
+
break;
|
1828
|
+
case '<':
|
1829
|
+
if (datum[selector.field] < selectorValueArr[0]) return true;
|
1830
|
+
break;
|
1831
|
+
case '>=':
|
1832
|
+
if (datum[selector.field] >= selectorValueArr[0]) return true;
|
1833
|
+
break;
|
1834
|
+
case '<=':
|
1835
|
+
if (datum[selector.field] <= selectorValueArr[0]) return true;
|
1836
|
+
break;
|
1837
|
+
case 'between':
|
1838
|
+
if (Array.isArray(selector.value) && datum[selector.field] >= selectorValueArr[0] && datum[selector.field] <= selectorValueArr[1]) return true;
|
1839
|
+
break;
|
1840
|
+
default:
|
1841
|
+
break;
|
1842
|
+
}
|
1843
|
+
} else if (isDimensionSelector(selector)) {
|
1844
|
+
const selectorValueArr = Array.isArray(selector.value) ? selector.value : [
|
1845
|
+
selector.value
|
1846
|
+
];
|
1847
|
+
if ('in' === selector.operator && selectorValueArr.includes(datum[selector.field])) return true;
|
1848
|
+
if ('not in' === selector.operator && !selectorValueArr.includes(datum[selector.field])) return true;
|
1849
|
+
} else if (isPartialDatumSelector(selector)) {
|
1850
|
+
if (Object.keys(selector).every((key)=>datum[key] === selector[key])) return true;
|
1851
|
+
}
|
1852
|
+
return false;
|
1853
|
+
};
|
1854
|
+
const isValueSelector = (selector)=>'string' == typeof selector || 'number' == typeof selector;
|
1855
|
+
const isPartialDatumSelector = (selector)=>'object' == typeof selector && null !== selector;
|
1856
|
+
const isMeasureSelector = (selector)=>'object' == typeof selector && null !== selector && 'field' in selector && 'operator' in selector && 'value' in selector && [
|
1857
|
+
'=',
|
1858
|
+
'!=',
|
1859
|
+
'>',
|
1860
|
+
'<',
|
1861
|
+
'>=',
|
1862
|
+
'<=',
|
1863
|
+
'between'
|
1864
|
+
].includes(selector.operator);
|
1865
|
+
const isDimensionSelector = (selector)=>'object' == typeof selector && null !== selector && 'field' in selector && 'operator' in selector && 'value' in selector && [
|
1866
|
+
'in',
|
1867
|
+
'not in'
|
1868
|
+
].includes(selector.operator);
|
1869
|
+
const barStyle_barStyle = (spec, context)=>{
|
1870
|
+
const { advancedVSeed } = context;
|
1871
|
+
const { markStyle, encoding } = advancedVSeed;
|
1872
|
+
const { barStyle } = markStyle;
|
1873
|
+
if (!barStyle) return spec;
|
1874
|
+
const result = {
|
1875
|
+
...spec
|
1876
|
+
};
|
1877
|
+
const { selector: barSelector, barBorderColor, barBorderStyle, barBorderWidth, barColor, barColorOpacity, barRadius } = barStyle;
|
1878
|
+
return {
|
1879
|
+
...result,
|
1880
|
+
bar: {
|
1881
|
+
style: {
|
1882
|
+
fill: (datum, context)=>{
|
1883
|
+
if (selector_selector(datum, barSelector)) return barColor;
|
1884
|
+
return context.seriesColor(datum[encoding[0]?.group?.[0]]);
|
1885
|
+
},
|
1886
|
+
fillOpacity: (datum)=>{
|
1887
|
+
if (selector_selector(datum, barSelector)) return barColorOpacity;
|
1888
|
+
return 1;
|
1889
|
+
},
|
1890
|
+
stroke: (datum, context)=>{
|
1891
|
+
if (selector_selector(datum, barSelector)) return barBorderColor;
|
1892
|
+
return context.seriesColor(datum[encoding[0]?.group?.[0]]);
|
1893
|
+
},
|
1894
|
+
lineWidth: (datum)=>{
|
1895
|
+
if (selector_selector(datum, barSelector)) return barBorderWidth;
|
1896
|
+
return 0;
|
1897
|
+
},
|
1898
|
+
lineDash: (datum)=>{
|
1899
|
+
if (selector_selector(datum, barSelector)) {
|
1900
|
+
if ('solid' === barBorderStyle) ;
|
1901
|
+
else if ('dashed' === barBorderStyle) return [
|
1902
|
+
5,
|
1903
|
+
5
|
1904
|
+
];
|
1905
|
+
else if ('dotted' === barBorderStyle) return [
|
1906
|
+
1,
|
1907
|
+
5
|
1908
|
+
];
|
1909
|
+
}
|
1910
|
+
return [
|
1911
|
+
0,
|
1912
|
+
0
|
1913
|
+
];
|
1914
|
+
},
|
1915
|
+
cornerRadius: (datum)=>{
|
1916
|
+
if (selector_selector(datum, barSelector)) return barRadius;
|
1917
|
+
return 0;
|
1918
|
+
}
|
1919
|
+
}
|
1920
|
+
}
|
1921
|
+
};
|
1922
|
+
};
|
1923
|
+
const line_line = [
|
1295
1924
|
initLine,
|
1296
1925
|
color_color,
|
1297
1926
|
background_backgroundColor,
|
@@ -1300,7 +1929,7 @@ const line = [
|
|
1300
1929
|
yLinear,
|
1301
1930
|
label_label,
|
1302
1931
|
tooltip_tooltip,
|
1303
|
-
|
1932
|
+
discreteLegend
|
1304
1933
|
];
|
1305
1934
|
const pivotLine = [
|
1306
1935
|
initPivot,
|
@@ -1319,13 +1948,14 @@ const pivotLine = [
|
|
1319
1948
|
]),
|
1320
1949
|
pivotRowDimensions,
|
1321
1950
|
pivotColumnDimensions,
|
1322
|
-
|
1951
|
+
pivotDiscreteLegend
|
1323
1952
|
];
|
1324
1953
|
const lineSpecPipeline = [
|
1325
|
-
pivotAdapter_pivotAdapter(
|
1954
|
+
pivotAdapter_pivotAdapter(line_line, pivotLine)
|
1326
1955
|
];
|
1327
1956
|
const column = [
|
1328
1957
|
initColumn,
|
1958
|
+
stackInverse,
|
1329
1959
|
color_color,
|
1330
1960
|
background_backgroundColor,
|
1331
1961
|
dataset_dataset,
|
@@ -1333,7 +1963,8 @@ const column = [
|
|
1333
1963
|
yLinear,
|
1334
1964
|
label_label,
|
1335
1965
|
tooltip_tooltip,
|
1336
|
-
|
1966
|
+
discreteLegend,
|
1967
|
+
barStyle_barStyle
|
1337
1968
|
];
|
1338
1969
|
const pivotColumn = [
|
1339
1970
|
initPivot,
|
@@ -1342,17 +1973,19 @@ const pivotColumn = [
|
|
1342
1973
|
datasetPivot,
|
1343
1974
|
pivotIndicators([
|
1344
1975
|
initColumn,
|
1976
|
+
stackInverse,
|
1345
1977
|
color_color,
|
1346
1978
|
background_backgroundColor,
|
1347
1979
|
datasetPivotPlaceholder,
|
1348
1980
|
xBand,
|
1349
1981
|
yLinear,
|
1350
1982
|
label_label,
|
1351
|
-
tooltip_tooltip
|
1983
|
+
tooltip_tooltip,
|
1984
|
+
barStyle_barStyle
|
1352
1985
|
]),
|
1353
1986
|
pivotRowDimensions,
|
1354
1987
|
pivotColumnDimensions,
|
1355
|
-
|
1988
|
+
pivotDiscreteLegend
|
1356
1989
|
];
|
1357
1990
|
const columnSpecPipeline = [
|
1358
1991
|
pivotAdapter_pivotAdapter(column, pivotColumn)
|
@@ -1366,7 +1999,8 @@ const columnParallel = [
|
|
1366
1999
|
yLinear,
|
1367
2000
|
label_label,
|
1368
2001
|
tooltip_tooltip,
|
1369
|
-
|
2002
|
+
discreteLegend,
|
2003
|
+
barStyle_barStyle
|
1370
2004
|
];
|
1371
2005
|
const pivotColumnParallel = [
|
1372
2006
|
initPivot,
|
@@ -1381,17 +2015,19 @@ const pivotColumnParallel = [
|
|
1381
2015
|
xBand,
|
1382
2016
|
yLinear,
|
1383
2017
|
label_label,
|
1384
|
-
tooltip_tooltip
|
2018
|
+
tooltip_tooltip,
|
2019
|
+
barStyle_barStyle
|
1385
2020
|
]),
|
1386
2021
|
pivotRowDimensions,
|
1387
2022
|
pivotColumnDimensions,
|
1388
|
-
|
2023
|
+
pivotDiscreteLegend
|
1389
2024
|
];
|
1390
2025
|
const columnParallelSpecPipeline = [
|
1391
2026
|
pivotAdapter_pivotAdapter(columnParallel, pivotColumnParallel)
|
1392
2027
|
];
|
1393
2028
|
const columnPercent = [
|
1394
2029
|
initColumn,
|
2030
|
+
stackInverse,
|
1395
2031
|
color_color,
|
1396
2032
|
background_backgroundColor,
|
1397
2033
|
percent,
|
@@ -1400,7 +2036,8 @@ const columnPercent = [
|
|
1400
2036
|
yLinear,
|
1401
2037
|
label_label,
|
1402
2038
|
tooltip_tooltip,
|
1403
|
-
|
2039
|
+
discreteLegend,
|
2040
|
+
barStyle_barStyle
|
1404
2041
|
];
|
1405
2042
|
const pivotColumnPercent = [
|
1406
2043
|
initPivot,
|
@@ -1409,6 +2046,7 @@ const pivotColumnPercent = [
|
|
1409
2046
|
datasetPivot,
|
1410
2047
|
pivotIndicators([
|
1411
2048
|
initColumn,
|
2049
|
+
stackInverse,
|
1412
2050
|
color_color,
|
1413
2051
|
percent,
|
1414
2052
|
background_backgroundColor,
|
@@ -1416,11 +2054,12 @@ const pivotColumnPercent = [
|
|
1416
2054
|
xBand,
|
1417
2055
|
yLinear,
|
1418
2056
|
label_label,
|
1419
|
-
tooltip_tooltip
|
2057
|
+
tooltip_tooltip,
|
2058
|
+
barStyle_barStyle
|
1420
2059
|
]),
|
1421
2060
|
pivotRowDimensions,
|
1422
2061
|
pivotColumnDimensions,
|
1423
|
-
|
2062
|
+
pivotDiscreteLegend
|
1424
2063
|
];
|
1425
2064
|
const columnPercentSpecPipeline = [
|
1426
2065
|
pivotAdapter_pivotAdapter(columnPercent, pivotColumnPercent)
|
@@ -1434,7 +2073,8 @@ const bar = [
|
|
1434
2073
|
yBand,
|
1435
2074
|
label_label,
|
1436
2075
|
tooltip_tooltip,
|
1437
|
-
|
2076
|
+
discreteLegend,
|
2077
|
+
barStyle_barStyle
|
1438
2078
|
];
|
1439
2079
|
const pivotBar = [
|
1440
2080
|
initPivot,
|
@@ -1449,11 +2089,12 @@ const pivotBar = [
|
|
1449
2089
|
yBand,
|
1450
2090
|
label_label,
|
1451
2091
|
label_label,
|
1452
|
-
tooltip_tooltip
|
2092
|
+
tooltip_tooltip,
|
2093
|
+
barStyle_barStyle
|
1453
2094
|
]),
|
1454
2095
|
pivotRowDimensions,
|
1455
2096
|
pivotColumnDimensions,
|
1456
|
-
|
2097
|
+
pivotDiscreteLegend
|
1457
2098
|
];
|
1458
2099
|
const barSpecPipeline = [
|
1459
2100
|
pivotAdapter_pivotAdapter(bar, pivotBar)
|
@@ -1467,7 +2108,8 @@ const barParallel = [
|
|
1467
2108
|
yBand,
|
1468
2109
|
label_label,
|
1469
2110
|
tooltip_tooltip,
|
1470
|
-
|
2111
|
+
discreteLegend,
|
2112
|
+
barStyle_barStyle
|
1471
2113
|
];
|
1472
2114
|
const pivotBarParallel = [
|
1473
2115
|
initPivot,
|
@@ -1482,11 +2124,12 @@ const pivotBarParallel = [
|
|
1482
2124
|
yBand,
|
1483
2125
|
xLinear,
|
1484
2126
|
label_label,
|
1485
|
-
tooltip_tooltip
|
2127
|
+
tooltip_tooltip,
|
2128
|
+
barStyle_barStyle
|
1486
2129
|
]),
|
1487
2130
|
pivotRowDimensions,
|
1488
2131
|
pivotColumnDimensions,
|
1489
|
-
|
2132
|
+
pivotDiscreteLegend
|
1490
2133
|
];
|
1491
2134
|
const barParallelSpecPipeline = [
|
1492
2135
|
pivotAdapter_pivotAdapter(barParallel, pivotBarParallel)
|
@@ -1501,7 +2144,8 @@ const barPercent = [
|
|
1501
2144
|
yBand,
|
1502
2145
|
label_label,
|
1503
2146
|
tooltip_tooltip,
|
1504
|
-
|
2147
|
+
discreteLegend,
|
2148
|
+
barStyle_barStyle
|
1505
2149
|
];
|
1506
2150
|
const pivotBarPercent = [
|
1507
2151
|
initPivot,
|
@@ -1517,26 +2161,27 @@ const pivotBarPercent = [
|
|
1517
2161
|
yBand,
|
1518
2162
|
xLinear,
|
1519
2163
|
label_label,
|
1520
|
-
tooltip_tooltip
|
2164
|
+
tooltip_tooltip,
|
2165
|
+
barStyle_barStyle
|
1521
2166
|
]),
|
1522
2167
|
pivotRowDimensions,
|
1523
2168
|
pivotColumnDimensions,
|
1524
|
-
|
2169
|
+
pivotDiscreteLegend
|
1525
2170
|
];
|
1526
2171
|
const barPercentSpecPipeline = [
|
1527
2172
|
pivotAdapter_pivotAdapter(barPercent, pivotBarPercent)
|
1528
2173
|
];
|
1529
2174
|
const area_area = [
|
1530
2175
|
initArea,
|
2176
|
+
stackInverse,
|
1531
2177
|
color_color,
|
1532
2178
|
background_backgroundColor,
|
1533
|
-
stack,
|
1534
2179
|
dataset_dataset,
|
1535
2180
|
xBand,
|
1536
2181
|
yLinear,
|
1537
2182
|
label_label,
|
1538
2183
|
tooltip_tooltip,
|
1539
|
-
|
2184
|
+
discreteLegend
|
1540
2185
|
];
|
1541
2186
|
const pivotArea = [
|
1542
2187
|
initPivot,
|
@@ -1547,7 +2192,7 @@ const pivotArea = [
|
|
1547
2192
|
initArea,
|
1548
2193
|
color_color,
|
1549
2194
|
background_backgroundColor,
|
1550
|
-
|
2195
|
+
stackInverse,
|
1551
2196
|
datasetPivotPlaceholder,
|
1552
2197
|
xBand,
|
1553
2198
|
yLinear,
|
@@ -1556,13 +2201,14 @@ const pivotArea = [
|
|
1556
2201
|
]),
|
1557
2202
|
pivotRowDimensions,
|
1558
2203
|
pivotColumnDimensions,
|
1559
|
-
|
2204
|
+
pivotDiscreteLegend
|
1560
2205
|
];
|
1561
2206
|
const areaSpecPipeline = [
|
1562
2207
|
pivotAdapter_pivotAdapter(area_area, pivotArea)
|
1563
2208
|
];
|
1564
2209
|
const areaPercent = [
|
1565
2210
|
initArea,
|
2211
|
+
stackInverse,
|
1566
2212
|
color_color,
|
1567
2213
|
background_backgroundColor,
|
1568
2214
|
percent,
|
@@ -1571,7 +2217,7 @@ const areaPercent = [
|
|
1571
2217
|
yLinear,
|
1572
2218
|
label_label,
|
1573
2219
|
tooltip_tooltip,
|
1574
|
-
|
2220
|
+
discreteLegend
|
1575
2221
|
];
|
1576
2222
|
const pivotAreaPercent = [
|
1577
2223
|
initPivot,
|
@@ -1580,6 +2226,7 @@ const pivotAreaPercent = [
|
|
1580
2226
|
datasetPivot,
|
1581
2227
|
pivotIndicators([
|
1582
2228
|
initArea,
|
2229
|
+
stackInverse,
|
1583
2230
|
color_color,
|
1584
2231
|
background_backgroundColor,
|
1585
2232
|
percent,
|
@@ -1591,7 +2238,7 @@ const pivotAreaPercent = [
|
|
1591
2238
|
]),
|
1592
2239
|
pivotRowDimensions,
|
1593
2240
|
pivotColumnDimensions,
|
1594
|
-
|
2241
|
+
pivotDiscreteLegend
|
1595
2242
|
];
|
1596
2243
|
const areaPercentSpecPipeline = [
|
1597
2244
|
pivotAdapter_pivotAdapter(areaPercent, pivotAreaPercent)
|
@@ -1603,7 +2250,7 @@ const pie = [
|
|
1603
2250
|
dataset_dataset,
|
1604
2251
|
label_label,
|
1605
2252
|
tooltip_tooltip,
|
1606
|
-
|
2253
|
+
discreteLegend
|
1607
2254
|
];
|
1608
2255
|
const pivotPie = [
|
1609
2256
|
initPivot,
|
@@ -1620,7 +2267,7 @@ const pivotPie = [
|
|
1620
2267
|
]),
|
1621
2268
|
pivotRowDimensions,
|
1622
2269
|
pivotColumnDimensions,
|
1623
|
-
|
2270
|
+
pivotDiscreteLegend
|
1624
2271
|
];
|
1625
2272
|
const pieSpecPipeline = [
|
1626
2273
|
pivotAdapter_pivotAdapter(pie, pivotPie)
|
@@ -1736,13 +2383,90 @@ const registerPie = ()=>{
|
|
1736
2383
|
Builder._advancedPipelineMap.pie = pieAdvancedPipeline;
|
1737
2384
|
Builder._specPipelineMap.pie = pieSpecPipeline;
|
1738
2385
|
};
|
1739
|
-
const darkTheme = ()=>
|
2386
|
+
const darkTheme = ()=>{
|
2387
|
+
const linearAxis = {
|
2388
|
+
nice: true,
|
2389
|
+
zero: true,
|
2390
|
+
label: {
|
2391
|
+
visible: true,
|
2392
|
+
labelAngle: 0,
|
2393
|
+
labelColor: '#E2E3E6',
|
2394
|
+
labelFontSize: 12,
|
2395
|
+
labelFontWeight: 400
|
2396
|
+
},
|
2397
|
+
title: {
|
2398
|
+
visible: false,
|
2399
|
+
titleText: '',
|
2400
|
+
titleColor: '#FDFDFD',
|
2401
|
+
titleFontSize: 12,
|
2402
|
+
titleFontWeight: 400
|
2403
|
+
},
|
2404
|
+
grid: {
|
2405
|
+
visible: true,
|
2406
|
+
gridColor: '#404349',
|
2407
|
+
gridWidth: 0.5
|
2408
|
+
},
|
2409
|
+
tick: {
|
2410
|
+
visible: false,
|
2411
|
+
tickInside: false,
|
2412
|
+
tickSize: 4,
|
2413
|
+
tickColor: '#4B4F54'
|
2414
|
+
},
|
2415
|
+
line: {
|
2416
|
+
visible: false,
|
2417
|
+
lineColor: '#4B4F54',
|
2418
|
+
lineWidth: 1
|
2419
|
+
}
|
2420
|
+
};
|
2421
|
+
const bandAxis = {
|
2422
|
+
labelAutoHide: true,
|
2423
|
+
labelAutoHideGap: 4,
|
2424
|
+
labelAutoLimit: true,
|
2425
|
+
labelAutoLimitLength: 100,
|
2426
|
+
labelAutoRotate: true,
|
2427
|
+
labelAutoRotateAngleRange: [
|
2428
|
+
0,
|
2429
|
+
-45,
|
2430
|
+
-90
|
2431
|
+
],
|
2432
|
+
label: {
|
2433
|
+
visible: true,
|
2434
|
+
labelAngle: 0,
|
2435
|
+
labelColor: '#E2E3E6',
|
2436
|
+
labelFontSize: 12,
|
2437
|
+
labelFontWeight: 400
|
2438
|
+
},
|
2439
|
+
title: {
|
2440
|
+
visible: false,
|
2441
|
+
titleText: '',
|
2442
|
+
titleColor: '#FDFDFD',
|
2443
|
+
titleFontSize: 12,
|
2444
|
+
titleFontWeight: 400
|
2445
|
+
},
|
2446
|
+
grid: {
|
2447
|
+
visible: false,
|
2448
|
+
gridColor: '#404349',
|
2449
|
+
gridWidth: 0.5
|
2450
|
+
},
|
2451
|
+
tick: {
|
2452
|
+
visible: false,
|
2453
|
+
tickInside: false,
|
2454
|
+
tickSize: 4,
|
2455
|
+
tickColor: '#4B4F54'
|
2456
|
+
},
|
2457
|
+
line: {
|
2458
|
+
visible: true,
|
2459
|
+
lineColor: '#4B4F54',
|
2460
|
+
lineWidth: 1
|
2461
|
+
}
|
2462
|
+
};
|
2463
|
+
return {
|
1740
2464
|
baseConfig: {
|
1741
2465
|
vtable: {
|
1742
|
-
backgroundColor: '
|
2466
|
+
backgroundColor: 'transparent'
|
1743
2467
|
},
|
1744
2468
|
vchart: {
|
1745
|
-
backgroundColor: '
|
2469
|
+
backgroundColor: 'transparent',
|
1746
2470
|
color: {
|
1747
2471
|
colorScheme: [
|
1748
2472
|
'#2E62F1',
|
@@ -1764,18 +2488,155 @@ const darkTheme = ()=>({
|
|
1764
2488
|
enable: true
|
1765
2489
|
},
|
1766
2490
|
legend: {
|
1767
|
-
enable: true
|
2491
|
+
enable: true,
|
2492
|
+
border: true,
|
2493
|
+
maxSize: 1,
|
2494
|
+
position: 'rt',
|
2495
|
+
shapeType: 'rectRound',
|
2496
|
+
labelFontColor: '#FDFDFD',
|
2497
|
+
labelFontSize: 12,
|
2498
|
+
labelFontWeight: 400
|
1768
2499
|
}
|
1769
2500
|
}
|
2501
|
+
},
|
2502
|
+
config: {
|
2503
|
+
line: {
|
2504
|
+
xAxis: bandAxis,
|
2505
|
+
yAxis: linearAxis
|
2506
|
+
},
|
2507
|
+
column: {
|
2508
|
+
xAxis: bandAxis,
|
2509
|
+
yAxis: linearAxis
|
2510
|
+
},
|
2511
|
+
columnParallel: {
|
2512
|
+
xAxis: bandAxis,
|
2513
|
+
yAxis: linearAxis
|
2514
|
+
},
|
2515
|
+
columnPercent: {
|
2516
|
+
xAxis: bandAxis,
|
2517
|
+
yAxis: linearAxis
|
2518
|
+
},
|
2519
|
+
bar: {
|
2520
|
+
xAxis: linearAxis,
|
2521
|
+
yAxis: bandAxis
|
2522
|
+
},
|
2523
|
+
barParallel: {
|
2524
|
+
xAxis: linearAxis,
|
2525
|
+
yAxis: bandAxis
|
2526
|
+
},
|
2527
|
+
barPercent: {
|
2528
|
+
xAxis: linearAxis,
|
2529
|
+
yAxis: bandAxis
|
2530
|
+
},
|
2531
|
+
area: {
|
2532
|
+
xAxis: bandAxis,
|
2533
|
+
yAxis: linearAxis
|
2534
|
+
},
|
2535
|
+
areaPercent: {
|
2536
|
+
xAxis: bandAxis,
|
2537
|
+
yAxis: linearAxis
|
2538
|
+
}
|
1770
2539
|
}
|
1771
|
-
}
|
1772
|
-
|
2540
|
+
};
|
2541
|
+
};
|
2542
|
+
const lightTheme = ()=>{
|
2543
|
+
const linearAxis = {
|
2544
|
+
nice: true,
|
2545
|
+
zero: true,
|
2546
|
+
inverse: false,
|
2547
|
+
label: {
|
2548
|
+
visible: true,
|
2549
|
+
labelAngle: 0,
|
2550
|
+
labelColor: '#797B85',
|
2551
|
+
labelFontSize: 12,
|
2552
|
+
labelFontWeight: 400
|
2553
|
+
},
|
2554
|
+
title: {
|
2555
|
+
visible: false,
|
2556
|
+
titleText: '',
|
2557
|
+
titleColor: '#646A73',
|
2558
|
+
titleFontSize: 12,
|
2559
|
+
titleFontWeight: 400
|
2560
|
+
},
|
2561
|
+
grid: {
|
2562
|
+
visible: true,
|
2563
|
+
gridColor: '#36415926',
|
2564
|
+
gridWidth: 0.5
|
2565
|
+
},
|
2566
|
+
tick: {
|
2567
|
+
visible: false,
|
2568
|
+
tickInside: false,
|
2569
|
+
tickSize: 4,
|
2570
|
+
tickColor: '#3641594d'
|
2571
|
+
},
|
2572
|
+
line: {
|
2573
|
+
visible: false,
|
2574
|
+
lineColor: '#3641594d',
|
2575
|
+
lineWidth: 1
|
2576
|
+
}
|
2577
|
+
};
|
2578
|
+
const bandAxis = {
|
2579
|
+
labelAutoHide: true,
|
2580
|
+
labelAutoHideGap: 4,
|
2581
|
+
labelAutoLimit: true,
|
2582
|
+
labelAutoLimitLength: 100,
|
2583
|
+
labelAutoRotate: true,
|
2584
|
+
labelAutoRotateAngleRange: [
|
2585
|
+
0,
|
2586
|
+
-45,
|
2587
|
+
-90
|
2588
|
+
],
|
2589
|
+
label: {
|
2590
|
+
visible: true,
|
2591
|
+
labelAngle: 0,
|
2592
|
+
labelColor: '#797B85',
|
2593
|
+
labelFontSize: 12,
|
2594
|
+
labelFontWeight: 400
|
2595
|
+
},
|
2596
|
+
title: {
|
2597
|
+
visible: false,
|
2598
|
+
titleText: '',
|
2599
|
+
titleColor: '#646A73',
|
2600
|
+
titleFontSize: 12,
|
2601
|
+
titleFontWeight: 400
|
2602
|
+
},
|
2603
|
+
grid: {
|
2604
|
+
visible: false,
|
2605
|
+
gridColor: '#36415926',
|
2606
|
+
gridWidth: 0.5
|
2607
|
+
},
|
2608
|
+
tick: {
|
2609
|
+
visible: false,
|
2610
|
+
tickInside: false,
|
2611
|
+
tickSize: 4,
|
2612
|
+
tickColor: '#3641594d'
|
2613
|
+
},
|
2614
|
+
line: {
|
2615
|
+
visible: true,
|
2616
|
+
lineColor: '#3641594d',
|
2617
|
+
lineWidth: 1
|
2618
|
+
}
|
2619
|
+
};
|
2620
|
+
const barBandAxis = {
|
2621
|
+
...bandAxis,
|
2622
|
+
labelAutoHide: false,
|
2623
|
+
labelAutoHideGap: 1,
|
2624
|
+
labelAutoLimit: false,
|
2625
|
+
labelAutoLimitLength: void 0,
|
2626
|
+
labelAutoRotate: false,
|
2627
|
+
labelAutoRotateAngleRange: [
|
2628
|
+
0,
|
2629
|
+
-45,
|
2630
|
+
-90
|
2631
|
+
]
|
2632
|
+
};
|
2633
|
+
return {
|
1773
2634
|
baseConfig: {
|
1774
2635
|
vtable: {
|
1775
|
-
backgroundColor: '
|
2636
|
+
backgroundColor: 'transparent'
|
1776
2637
|
},
|
1777
2638
|
vchart: {
|
1778
|
-
backgroundColor: '
|
2639
|
+
backgroundColor: 'transparent',
|
1779
2640
|
color: {
|
1780
2641
|
colorScheme: [
|
1781
2642
|
'#8D72F6',
|
@@ -1797,11 +2658,57 @@ const lightTheme = ()=>({
|
|
1797
2658
|
enable: true
|
1798
2659
|
},
|
1799
2660
|
legend: {
|
1800
|
-
enable: true
|
2661
|
+
enable: true,
|
2662
|
+
border: true,
|
2663
|
+
maxSize: 1,
|
2664
|
+
shapeType: 'rectRound',
|
2665
|
+
position: 'rt',
|
2666
|
+
labelFontColor: '#646A73',
|
2667
|
+
labelFontSize: 12,
|
2668
|
+
labelFontWeight: 400
|
1801
2669
|
}
|
1802
2670
|
}
|
2671
|
+
},
|
2672
|
+
config: {
|
2673
|
+
line: {
|
2674
|
+
xAxis: bandAxis,
|
2675
|
+
yAxis: linearAxis
|
2676
|
+
},
|
2677
|
+
column: {
|
2678
|
+
xAxis: bandAxis,
|
2679
|
+
yAxis: linearAxis
|
2680
|
+
},
|
2681
|
+
columnParallel: {
|
2682
|
+
xAxis: bandAxis,
|
2683
|
+
yAxis: linearAxis
|
2684
|
+
},
|
2685
|
+
columnPercent: {
|
2686
|
+
xAxis: bandAxis,
|
2687
|
+
yAxis: linearAxis
|
2688
|
+
},
|
2689
|
+
bar: {
|
2690
|
+
xAxis: linearAxis,
|
2691
|
+
yAxis: barBandAxis
|
2692
|
+
},
|
2693
|
+
barParallel: {
|
2694
|
+
xAxis: linearAxis,
|
2695
|
+
yAxis: barBandAxis
|
2696
|
+
},
|
2697
|
+
barPercent: {
|
2698
|
+
xAxis: linearAxis,
|
2699
|
+
yAxis: barBandAxis
|
2700
|
+
},
|
2701
|
+
area: {
|
2702
|
+
xAxis: bandAxis,
|
2703
|
+
yAxis: linearAxis
|
2704
|
+
},
|
2705
|
+
areaPercent: {
|
2706
|
+
xAxis: bandAxis,
|
2707
|
+
yAxis: linearAxis
|
2708
|
+
}
|
1803
2709
|
}
|
1804
|
-
}
|
2710
|
+
};
|
2711
|
+
};
|
1805
2712
|
const registerCustomTheme = (key, themeConfig)=>{
|
1806
2713
|
Builder._themeMap[key] = themeConfig;
|
1807
2714
|
};
|
@@ -1924,7 +2831,58 @@ const zTooltip = z.object({
|
|
1924
2831
|
enable: z.boolean().default(true).optional()
|
1925
2832
|
});
|
1926
2833
|
const zLegend = z.object({
|
1927
|
-
enable: z.boolean().default(true).optional()
|
2834
|
+
enable: z.boolean().default(true).optional(),
|
2835
|
+
border: z.boolean().default(true).optional(),
|
2836
|
+
maxSize: z.number().default(1).optional(),
|
2837
|
+
shapeType: z["enum"]([
|
2838
|
+
'circle',
|
2839
|
+
'cross',
|
2840
|
+
'diamond',
|
2841
|
+
'square',
|
2842
|
+
'arrow',
|
2843
|
+
'arrow2Left',
|
2844
|
+
'arrow2Right',
|
2845
|
+
'wedge',
|
2846
|
+
'thinTriangle',
|
2847
|
+
'triangle',
|
2848
|
+
'triangleUp',
|
2849
|
+
'triangleDown',
|
2850
|
+
'triangleRight',
|
2851
|
+
'triangleLeft',
|
2852
|
+
'stroke',
|
2853
|
+
'star',
|
2854
|
+
'wye',
|
2855
|
+
'rect',
|
2856
|
+
'arrowLeft',
|
2857
|
+
'arrowRight',
|
2858
|
+
'rectRound',
|
2859
|
+
'roundLine'
|
2860
|
+
]).default('rectRound').optional(),
|
2861
|
+
position: z["enum"]([
|
2862
|
+
'left',
|
2863
|
+
'leftTop',
|
2864
|
+
'leftBottom',
|
2865
|
+
'lt',
|
2866
|
+
'lb',
|
2867
|
+
'top',
|
2868
|
+
'topLeft',
|
2869
|
+
'topRight',
|
2870
|
+
'tl',
|
2871
|
+
'tr',
|
2872
|
+
'right',
|
2873
|
+
'rightTop',
|
2874
|
+
'rightBottom',
|
2875
|
+
'rt',
|
2876
|
+
'rb',
|
2877
|
+
'bottom',
|
2878
|
+
'bottomLeft',
|
2879
|
+
'bottomRight',
|
2880
|
+
'bl',
|
2881
|
+
'br'
|
2882
|
+
]).default('bottom').optional(),
|
2883
|
+
labelFontSize: z.number().default(12).optional(),
|
2884
|
+
labelFontColor: z.string().default('#fff').optional(),
|
2885
|
+
labelFontWeight: z.number().or(z.string()).default(400).optional()
|
1928
2886
|
});
|
1929
2887
|
const zVChartBaseConfig = z.object({
|
1930
2888
|
backgroundColor: zBackgroundColor,
|
@@ -1940,11 +2898,238 @@ const zBaseConfig = z.object({
|
|
1940
2898
|
vchart: zVChartBaseConfig.optional(),
|
1941
2899
|
vtable: zVTableBaseConfig.optional()
|
1942
2900
|
});
|
2901
|
+
const zAxis = z.object({
|
2902
|
+
visible: z.boolean().default(true).optional(),
|
2903
|
+
min: z.number().optional(),
|
2904
|
+
max: z.number().optional(),
|
2905
|
+
nice: z.boolean().default(true).optional(),
|
2906
|
+
zero: z.boolean().default(true).optional(),
|
2907
|
+
inverse: z.boolean().default(false).optional(),
|
2908
|
+
labelAutoHide: z.boolean().default(true).optional(),
|
2909
|
+
labelAutoHideGap: z.number().default(4).optional(),
|
2910
|
+
labelAutoRotate: z.boolean().default(true).optional(),
|
2911
|
+
labelAutoRotateAngleRange: z.array(z.number()).default([
|
2912
|
+
0,
|
2913
|
+
-45,
|
2914
|
+
-90
|
2915
|
+
]).optional(),
|
2916
|
+
labelAutoLimit: z.boolean().default(true).optional(),
|
2917
|
+
labelAutoLimitLength: z.number().default(100).optional(),
|
2918
|
+
label: z.object({
|
2919
|
+
visible: z.boolean().default(true).optional(),
|
2920
|
+
labelColor: z.string().default('#797B85').optional(),
|
2921
|
+
labelFontSize: z.number().default(12).optional(),
|
2922
|
+
labelFontWeight: z.number().default(400).optional(),
|
2923
|
+
labelAngle: z.number().default(0).optional()
|
2924
|
+
}).optional(),
|
2925
|
+
line: z.object({
|
2926
|
+
visible: z.boolean().default(true).optional(),
|
2927
|
+
lineColor: z.string().default('rgba(54, 65, 89, 0.30)').optional(),
|
2928
|
+
lineWidth: z.number().default(1).optional()
|
2929
|
+
}).optional(),
|
2930
|
+
tick: z.object({
|
2931
|
+
visible: z.boolean().default(true).optional(),
|
2932
|
+
tickInside: z.boolean().default(false).optional(),
|
2933
|
+
tickColor: z.string().default('rgba(54, 65, 89, 0.30)').optional(),
|
2934
|
+
tickSize: z.number().default(4).optional()
|
2935
|
+
}).optional(),
|
2936
|
+
title: z.object({
|
2937
|
+
visible: z.boolean().default(false).optional(),
|
2938
|
+
titleText: z.string().default('').optional(),
|
2939
|
+
titleColor: z.string().default('#646A73').optional(),
|
2940
|
+
titleFontSize: z.number().default(12).optional(),
|
2941
|
+
titleFontWeight: z.number().default(400).optional()
|
2942
|
+
}).optional(),
|
2943
|
+
grid: z.object({
|
2944
|
+
visible: z.boolean().default(false).optional(),
|
2945
|
+
gridColor: z.string().default('rgba(54, 65, 89, 0.15)').optional(),
|
2946
|
+
gridWidth: z.number().default(0.5).optional()
|
2947
|
+
}).optional()
|
2948
|
+
});
|
2949
|
+
const zXBandAxis = z.object({
|
2950
|
+
visible: z.boolean().default(true).optional(),
|
2951
|
+
labelAutoHide: z.boolean().default(true).optional(),
|
2952
|
+
labelAutoHideGap: z.number().default(0).optional(),
|
2953
|
+
labelAutoRotate: z.boolean().default(true).optional(),
|
2954
|
+
labelAutoRotateAngleRange: z.array(z.number()).default([
|
2955
|
+
0,
|
2956
|
+
-45,
|
2957
|
+
-90
|
2958
|
+
]).optional(),
|
2959
|
+
labelAutoLimit: z.boolean().default(true).optional(),
|
2960
|
+
labelAutoLimitLength: z.number().default(100).optional(),
|
2961
|
+
label: z.object({
|
2962
|
+
visible: z.boolean().default(true).optional(),
|
2963
|
+
labelColor: z.string().default('#797B85').optional(),
|
2964
|
+
labelFontSize: z.number().default(12).optional(),
|
2965
|
+
labelFontWeight: z.number().default(400).optional(),
|
2966
|
+
labelAngle: z.number().default(0).optional()
|
2967
|
+
}).optional(),
|
2968
|
+
line: z.object({
|
2969
|
+
visible: z.boolean().default(true).optional(),
|
2970
|
+
lineColor: z.string().default('rgba(54, 65, 89, 0.30)').optional(),
|
2971
|
+
lineWidth: z.number().default(1).optional()
|
2972
|
+
}).optional(),
|
2973
|
+
tick: z.object({
|
2974
|
+
visible: z.boolean().default(true).optional(),
|
2975
|
+
tickInside: z.boolean().default(false).optional(),
|
2976
|
+
tickColor: z.string().default('rgba(54, 65, 89, 0.30)').optional(),
|
2977
|
+
tickSize: z.number().default(4).optional()
|
2978
|
+
}).optional(),
|
2979
|
+
title: z.object({
|
2980
|
+
visible: z.boolean().default(false).optional(),
|
2981
|
+
titleText: z.string().default('').optional(),
|
2982
|
+
titleColor: z.string().default('#646A73').optional(),
|
2983
|
+
titleFontSize: z.number().default(12).optional(),
|
2984
|
+
titleFontWeight: z.number().default(400).optional()
|
2985
|
+
}).optional(),
|
2986
|
+
grid: z.object({
|
2987
|
+
visible: z.boolean().default(false).optional(),
|
2988
|
+
gridColor: z.string().default('rgba(54, 65, 89, 0.15)').optional(),
|
2989
|
+
gridWidth: z.number().default(0.5).optional()
|
2990
|
+
}).optional()
|
2991
|
+
});
|
2992
|
+
const zYBandAxis = zXBandAxis;
|
2993
|
+
const zXLinearAxis = z.object({
|
2994
|
+
visible: z.boolean().default(true).optional(),
|
2995
|
+
min: z.number().optional(),
|
2996
|
+
max: z.number().optional(),
|
2997
|
+
nice: z.boolean().default(true).optional(),
|
2998
|
+
zero: z.boolean().default(true).optional(),
|
2999
|
+
inverse: z.boolean().default(false).optional(),
|
3000
|
+
label: z.object({
|
3001
|
+
visible: z.boolean().default(true).optional(),
|
3002
|
+
labelColor: z.string().default('#797B85').optional(),
|
3003
|
+
labelFontSize: z.number().default(12).optional(),
|
3004
|
+
labelFontWeight: z.number().default(400).optional(),
|
3005
|
+
labelAngle: z.number().default(0).optional()
|
3006
|
+
}).optional(),
|
3007
|
+
line: z.object({
|
3008
|
+
visible: z.boolean().default(true).optional(),
|
3009
|
+
lineColor: z.string().default('rgba(54, 65, 89, 0.30)').optional(),
|
3010
|
+
lineWidth: z.number().default(1).optional()
|
3011
|
+
}).optional(),
|
3012
|
+
tick: z.object({
|
3013
|
+
visible: z.boolean().default(true).optional(),
|
3014
|
+
tickInside: z.boolean().default(false).optional(),
|
3015
|
+
tickColor: z.string().default('rgba(54, 65, 89, 0.30)').optional(),
|
3016
|
+
tickSize: z.number().default(4).optional()
|
3017
|
+
}).optional(),
|
3018
|
+
title: z.object({
|
3019
|
+
visible: z.boolean().default(false).optional(),
|
3020
|
+
titleText: z.string().default('').optional(),
|
3021
|
+
titleColor: z.string().default('#646A73').optional(),
|
3022
|
+
titleFontSize: z.number().default(12).optional(),
|
3023
|
+
titleFontWeight: z.number().default(400).optional()
|
3024
|
+
}).optional(),
|
3025
|
+
grid: z.object({
|
3026
|
+
visible: z.boolean().default(false).optional(),
|
3027
|
+
gridColor: z.string().default('rgba(54, 65, 89, 0.15)').optional(),
|
3028
|
+
gridWidth: z.number().default(0.5).optional()
|
3029
|
+
}).optional()
|
3030
|
+
});
|
3031
|
+
const zYLinearAxis = zXLinearAxis;
|
3032
|
+
const zConfig = z.object({
|
3033
|
+
line: z.object({
|
3034
|
+
xAxis: zXBandAxis,
|
3035
|
+
yAxis: zYLinearAxis
|
3036
|
+
}).optional(),
|
3037
|
+
column: z.object({
|
3038
|
+
xAxis: zXBandAxis,
|
3039
|
+
yAxis: zYLinearAxis
|
3040
|
+
}).optional(),
|
3041
|
+
columnParallel: z.object({
|
3042
|
+
xAxis: zXBandAxis,
|
3043
|
+
yAxis: zYLinearAxis
|
3044
|
+
}).optional(),
|
3045
|
+
columnPercent: z.object({
|
3046
|
+
xAxis: zXBandAxis,
|
3047
|
+
yAxis: zYLinearAxis
|
3048
|
+
}).optional(),
|
3049
|
+
bar: z.object({
|
3050
|
+
xAxis: zXLinearAxis,
|
3051
|
+
yAxis: zYBandAxis
|
3052
|
+
}).optional(),
|
3053
|
+
barParallel: z.object({
|
3054
|
+
xAxis: zXLinearAxis,
|
3055
|
+
yAxis: zYBandAxis
|
3056
|
+
}).optional(),
|
3057
|
+
barPercent: z.object({
|
3058
|
+
xAxis: zXLinearAxis,
|
3059
|
+
yAxis: zYBandAxis
|
3060
|
+
}).optional(),
|
3061
|
+
area: z.object({
|
3062
|
+
xAxis: zXBandAxis,
|
3063
|
+
yAxis: zYLinearAxis
|
3064
|
+
}).optional(),
|
3065
|
+
areaPercent: z.object({
|
3066
|
+
xAxis: zXBandAxis,
|
3067
|
+
yAxis: zYLinearAxis
|
3068
|
+
}).optional(),
|
3069
|
+
pie: z.object({}).optional(),
|
3070
|
+
donut: z.object({}).optional(),
|
3071
|
+
rose: z.object({}).optional(),
|
3072
|
+
dualAxis: z.object({}).optional(),
|
3073
|
+
table: z.object({}).optional(),
|
3074
|
+
pivotTable: z.object({}).optional()
|
3075
|
+
});
|
1943
3076
|
const zCustomThemeConfig = z.object({
|
1944
|
-
baseConfig: zBaseConfig.optional()
|
3077
|
+
baseConfig: zBaseConfig.optional(),
|
3078
|
+
config: zConfig.optional()
|
1945
3079
|
});
|
1946
3080
|
const zCustomTheme = z.record(z.string(), zCustomThemeConfig).optional();
|
1947
3081
|
const zTheme = z.string();
|
1948
|
-
|
3082
|
+
const zSelector = z.union([
|
3083
|
+
z.string(),
|
3084
|
+
z.number(),
|
3085
|
+
z.object({
|
3086
|
+
field: z.string(),
|
3087
|
+
operator: z.string(),
|
3088
|
+
value: z.union([
|
3089
|
+
z.string(),
|
3090
|
+
z.number(),
|
3091
|
+
z.array(z.union([
|
3092
|
+
z.string(),
|
3093
|
+
z.number()
|
3094
|
+
]))
|
3095
|
+
])
|
3096
|
+
}),
|
3097
|
+
z.object({
|
3098
|
+
field: z.string(),
|
3099
|
+
operator: z.string(),
|
3100
|
+
value: z.union([
|
3101
|
+
z.string(),
|
3102
|
+
z.number(),
|
3103
|
+
z.array(z.union([
|
3104
|
+
z.string(),
|
3105
|
+
z.number()
|
3106
|
+
]))
|
3107
|
+
])
|
3108
|
+
})
|
3109
|
+
]);
|
3110
|
+
const zSelectors = z.array(zSelector);
|
3111
|
+
const zBarStyle = z.object({
|
3112
|
+
selector: z.union([
|
3113
|
+
zSelector,
|
3114
|
+
zSelectors
|
3115
|
+
]),
|
3116
|
+
barColor: z.string(),
|
3117
|
+
barColorOpacity: z.number(),
|
3118
|
+
barBorderColor: z.string(),
|
3119
|
+
barBorderWidth: z.number(),
|
3120
|
+
barBorderStyle: z.union([
|
3121
|
+
z.literal('solid'),
|
3122
|
+
z.literal('dashed'),
|
3123
|
+
z.literal('dotted')
|
3124
|
+
]),
|
3125
|
+
barRadius: z.union([
|
3126
|
+
z.number(),
|
3127
|
+
z.array(z.number())
|
3128
|
+
])
|
3129
|
+
});
|
3130
|
+
const zMarkStyle = z.object({
|
3131
|
+
barStyle: zBarStyle.optional()
|
3132
|
+
});
|
3133
|
+
export { Builder, FoldMeasureId, FoldMeasureName, FoldMeasureValue, ORIGINAL_DATA, Separator, UnfoldDimensionGroup, areaAdvancedPipeline, areaPercentAdvancedPipeline, areaPercentSpecPipeline, areaSpecPipeline, barAdvancedPipeline, barParallelAdvancedPipeline, barParallelSpecPipeline, barPercentAdvancedPipeline, barPercentSpecPipeline, barSpecPipeline, columnAdvancedPipeline, columnParallelAdvancedPipeline, columnParallelSpecPipeline, columnPercentAdvancedPipeline, columnPercentSpecPipeline, columnSpecPipeline, darkTheme, dataReshapeFor1D1M, dataReshapeFor2D1M, execPipeline, foldMeasures, isPivotChart, isVChart, isVTable, lightTheme, lineAdvancedPipeline, lineSpecPipeline, pieAdvancedPipeline, pieSpecPipeline, all_registerAll as registerAll, registerArea, registerAreaPercent, registerBar, registerBarParallel, registerBarPercent, registerColumn, registerColumnParallel, registerColumnPercent, registerCustomTheme, registerDarkTheme, registerLightTheme, registerLine, unfoldDimensions, zAxis, zBackgroundColor, zBarStyle, zBaseConfig, zChartType, zColor, zConfig, zCustomTheme, zCustomThemeConfig, zDataset, zDatasetReshapeInfo, zDatum, zDimension, zDimensions, zEncoding, zFoldInfo, zLabel, zLegend, zMarkStyle, zMeasure, zMeasureGroup, zMeasures, zTheme, zTooltip, zUnfoldInfo, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
|
1949
3134
|
|
1950
3135
|
//# sourceMappingURL=index.js.map
|