@visactor/vseed 0.0.11 → 0.0.12
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 +4336 -477
- package/dist/builder/register/theme.d.ts +4 -1
- package/dist/dataSelector/selector.d.ts +1 -1
- package/dist/index.cjs +907 -174
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +877 -174
- package/dist/index.js.map +1 -1
- package/dist/pipeline/advanced/pipes/config/config.d.ts +3 -3
- package/dist/pipeline/constant.d.ts +2 -0
- package/dist/pipeline/spec/pipes/crosshair/horizontalCrosshairRect.d.ts +2 -0
- package/dist/pipeline/spec/pipes/crosshair/index.d.ts +3 -0
- package/dist/pipeline/spec/pipes/crosshair/verticalCrosshairLine.d.ts +2 -0
- package/dist/pipeline/spec/pipes/crosshair/verticalCrosshairRect.d.ts +2 -0
- package/dist/pipeline/spec/pipes/index.d.ts +1 -0
- package/dist/pipeline/spec/pipes/markStyle/areaStyle.d.ts +2 -0
- package/dist/pipeline/spec/pipes/markStyle/index.d.ts +3 -0
- package/dist/pipeline/spec/pipes/markStyle/lineStyle.d.ts +2 -0
- package/dist/pipeline/spec/pipes/markStyle/pointStyle.d.ts +2 -0
- package/dist/pipeline/spec/pipes/stack/index.d.ts +1 -0
- package/dist/pipeline/spec/pipes/stack/stackCornerRadius.d.ts +2 -0
- package/dist/pipeline/utils/chatType.d.ts +16 -16
- package/dist/pipeline/utils/format/createFormatter.d.ts +2 -0
- package/dist/pipeline/utils/format/createNumFormatter.d.ts +2 -0
- package/dist/pipeline/utils/format/index.d.ts +2 -0
- package/dist/pipeline/utils/index.d.ts +4 -2
- package/dist/pipeline/utils/measures/findMeasureById.d.ts +2 -0
- package/dist/pipeline/utils/measures/index.d.ts +1 -0
- package/dist/types/advancedVSeed.d.ts +2441 -320
- package/dist/types/chartType/area/area.d.ts +33 -1
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +36 -4
- package/dist/types/chartType/bar/bar.d.ts +13 -2
- package/dist/types/chartType/barParallel/barParallel.d.ts +13 -2
- package/dist/types/chartType/barPercent/barPercent.d.ts +13 -2
- package/dist/types/chartType/column/column.d.ts +13 -2
- package/dist/types/chartType/columnParallel/columnParallel.d.ts +13 -2
- package/dist/types/chartType/columnPercent/columnPercent.d.ts +13 -2
- package/dist/types/chartType/line/line.d.ts +27 -4
- package/dist/types/properties/config/config.d.ts +105 -36
- package/dist/types/properties/config/crosshair.d.ts +17 -0
- package/dist/types/properties/config/index.d.ts +2 -0
- package/dist/types/properties/config/stackCornerRadius.d.ts +3 -0
- package/dist/types/properties/markStyle/areaStyle.d.ts +129 -0
- package/dist/types/properties/markStyle/index.d.ts +3 -0
- package/dist/types/properties/markStyle/lineStyle.d.ts +160 -0
- package/dist/types/properties/markStyle/markStyle.d.ts +543 -2
- package/dist/types/properties/markStyle/pointStyle.d.ts +168 -0
- package/dist/types/properties/measures/format/formatter.d.ts +1 -0
- package/dist/types/properties/measures/format/index.d.ts +2 -0
- package/dist/types/properties/measures/format/numFormat.d.ts +20 -0
- package/dist/types/properties/measures/index.d.ts +2 -2
- package/dist/types/properties/measures/measures.d.ts +40 -40
- package/dist/types/properties/theme/customTheme.d.ts +3094 -72
- package/dist/types/vseed.d.ts +20 -20
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { clone as external_remeda_clone, isArray, isNumber, isString, mergeDeep as external_remeda_mergeDeep, omit, pick as external_remeda_pick, unique } from "remeda";
|
1
|
+
import { clone as external_remeda_clone, groupBy, isArray, isNumber, isString, mergeDeep as external_remeda_mergeDeep, omit, pick as external_remeda_pick, unique } from "remeda";
|
2
2
|
import { z } from "zod";
|
3
3
|
const initAdvancedVSeed = (advancedVSeed, context)=>{
|
4
4
|
const { vseed } = context;
|
@@ -23,6 +23,43 @@ const isPivotChart = (vseed)=>{
|
|
23
23
|
const hasMeasureGroup = measures && measures.find((measure)=>measure && measure.children);
|
24
24
|
return hasRowOrColumnDimension || hasMeasureGroup;
|
25
25
|
};
|
26
|
+
const createNumFormatter = (format)=>{
|
27
|
+
const { type = 'number', ratio = 1, symbol = '', thousandSeparator = true, decimalPlaces = 2, round = 'round', prefix = '', suffix = '' } = format || {};
|
28
|
+
return (value)=>{
|
29
|
+
let num = Number(value);
|
30
|
+
let typeSymbol = '';
|
31
|
+
if (Number.isNaN(num)) return num.toString();
|
32
|
+
if ('percent' === type) {
|
33
|
+
num *= 100;
|
34
|
+
typeSymbol = '%';
|
35
|
+
} else if ('permille' === type) {
|
36
|
+
num *= 1000;
|
37
|
+
typeSymbol = "\u2030";
|
38
|
+
} else if ('number' === type) num /= ratio || 1;
|
39
|
+
const multiplier = 10 ** decimalPlaces;
|
40
|
+
num = Math[round](num * multiplier) / multiplier;
|
41
|
+
let numStr = num.toFixed(decimalPlaces);
|
42
|
+
if (thousandSeparator) {
|
43
|
+
const parts = numStr.split('.');
|
44
|
+
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
45
|
+
numStr = parts.join('.');
|
46
|
+
}
|
47
|
+
return `${prefix}${numStr}${typeSymbol}${symbol}${suffix}`;
|
48
|
+
};
|
49
|
+
};
|
50
|
+
const createFormatter = (format)=>createNumFormatter(format);
|
51
|
+
function findMeasureById(measures, id) {
|
52
|
+
if (!measures) return;
|
53
|
+
const stack = [
|
54
|
+
...measures
|
55
|
+
];
|
56
|
+
while(stack.length > 0){
|
57
|
+
const current = stack.pop();
|
58
|
+
if (!current) continue;
|
59
|
+
if (current.id === id && !('children' in current)) return current;
|
60
|
+
if ('children' in current && current.children) stack.push(...current.children);
|
61
|
+
}
|
62
|
+
}
|
26
63
|
const autoMeasures = (advancedVSeed, context)=>{
|
27
64
|
const result = {
|
28
65
|
...advancedVSeed
|
@@ -73,16 +110,16 @@ const autoMeasureGroup = (advancedVSeed, context)=>{
|
|
73
110
|
const measureGroups = [];
|
74
111
|
for (const measure of measures)if ('children' in measure) {
|
75
112
|
if (currentGroup.children?.length) {
|
76
|
-
currentGroup.id = currentGroup.children.map((item)=>item.id).join('-');
|
77
113
|
currentGroup.alias = currentGroup.children.map((item)=>item.alias).join('-');
|
114
|
+
currentGroup.id = currentGroup.alias + currentGroup.children.map((item)=>item.id).join('-');
|
78
115
|
measureGroups.push(currentGroup);
|
79
116
|
currentGroup = createEmptyMeasureGroup();
|
80
117
|
}
|
81
118
|
measureGroups.push(measure);
|
82
119
|
} else currentGroup.children?.push(measure);
|
83
120
|
if (currentGroup.children?.length) {
|
84
|
-
currentGroup.id = currentGroup.children.map((item)=>item.id).join('-');
|
85
121
|
currentGroup.alias = currentGroup.children.map((item)=>item.alias).join('-');
|
122
|
+
currentGroup.id = currentGroup.alias + currentGroup.children.map((item)=>item.id).join('-');
|
86
123
|
measureGroups.push(currentGroup);
|
87
124
|
currentGroup = createEmptyMeasureGroup();
|
88
125
|
}
|
@@ -565,7 +602,28 @@ const lineConfig = (advancedVSeed, context)=>{
|
|
565
602
|
};
|
566
603
|
const config = external_remeda_pick(vseed, [
|
567
604
|
'xAxis',
|
568
|
-
'yAxis'
|
605
|
+
'yAxis',
|
606
|
+
'crosshairLine'
|
607
|
+
]);
|
608
|
+
result.config = {
|
609
|
+
...result.config || {},
|
610
|
+
[chartType]: {
|
611
|
+
...config
|
612
|
+
}
|
613
|
+
};
|
614
|
+
return result;
|
615
|
+
};
|
616
|
+
const columnConfig = (advancedVSeed, context)=>{
|
617
|
+
const { vseed } = context;
|
618
|
+
const { chartType } = vseed;
|
619
|
+
const result = {
|
620
|
+
...advancedVSeed
|
621
|
+
};
|
622
|
+
const config = external_remeda_pick(vseed, [
|
623
|
+
'xAxis',
|
624
|
+
'yAxis',
|
625
|
+
'crosshairRect',
|
626
|
+
'stackCornerRadius'
|
569
627
|
]);
|
570
628
|
result.config = {
|
571
629
|
...result.config || {},
|
@@ -590,14 +648,13 @@ const pieConfig = (advancedVSeed, context)=>{
|
|
590
648
|
};
|
591
649
|
return result;
|
592
650
|
};
|
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
651
|
const areaConfig = lineConfig;
|
600
652
|
const areaPercentConfig = lineConfig;
|
653
|
+
const barConfig = columnConfig;
|
654
|
+
const barParallelConfig = columnConfig;
|
655
|
+
const barPercentConfig = columnConfig;
|
656
|
+
const columnParallelConfig = columnConfig;
|
657
|
+
const columnPercentConfig = columnConfig;
|
601
658
|
const vchartTheme = (advancedVSeed, context)=>{
|
602
659
|
const { customTheme, vseed } = context;
|
603
660
|
const { theme = 'light', chartType } = vseed;
|
@@ -632,7 +689,10 @@ const pivotAdapter = (pipeline, pivotPipeline)=>(advancedVSeed, context)=>{
|
|
632
689
|
const markStyle_markStyle = (advancedVSeed, context)=>{
|
633
690
|
const { vseed } = context;
|
634
691
|
const markStyle = external_remeda_pick(vseed, [
|
635
|
-
'barStyle'
|
692
|
+
'barStyle',
|
693
|
+
'pointStyle',
|
694
|
+
'lineStyle',
|
695
|
+
'areaStyle'
|
636
696
|
]);
|
637
697
|
return {
|
638
698
|
...advancedVSeed,
|
@@ -665,6 +725,7 @@ const lineAdvancedPipeline = [
|
|
665
725
|
vchartBaseConfig,
|
666
726
|
lineConfig,
|
667
727
|
vchartTheme,
|
728
|
+
markStyle_markStyle,
|
668
729
|
annotation_annotation
|
669
730
|
];
|
670
731
|
const barAdvancedPipeline = [
|
@@ -776,6 +837,7 @@ const areaAdvancedPipeline = [
|
|
776
837
|
areaConfig,
|
777
838
|
vchartBaseConfig,
|
778
839
|
vchartTheme,
|
840
|
+
markStyle_markStyle,
|
779
841
|
annotation_annotation
|
780
842
|
];
|
781
843
|
const areaPercentAdvancedPipeline = [
|
@@ -791,6 +853,7 @@ const areaPercentAdvancedPipeline = [
|
|
791
853
|
areaPercentConfig,
|
792
854
|
vchartBaseConfig,
|
793
855
|
vchartTheme,
|
856
|
+
markStyle_markStyle,
|
794
857
|
annotation_annotation
|
795
858
|
];
|
796
859
|
const pieAdvancedPipeline = [
|
@@ -1081,7 +1144,15 @@ const xBand = (spec, context)=>{
|
|
1081
1144
|
lineWidth: line?.lineWidth,
|
1082
1145
|
stroke: line?.lineColor
|
1083
1146
|
}
|
1084
|
-
}
|
1147
|
+
},
|
1148
|
+
paddingInner: [
|
1149
|
+
0.15,
|
1150
|
+
0.1
|
1151
|
+
],
|
1152
|
+
paddingOuter: [
|
1153
|
+
0.075,
|
1154
|
+
0.1
|
1155
|
+
]
|
1085
1156
|
};
|
1086
1157
|
result.axes = [
|
1087
1158
|
...result.axes,
|
@@ -1089,6 +1160,8 @@ const xBand = (spec, context)=>{
|
|
1089
1160
|
];
|
1090
1161
|
return result;
|
1091
1162
|
};
|
1163
|
+
const ANNOTATION_Z_INDEX = 1000;
|
1164
|
+
const LINEAR_AXIS_INNER_OFFSET_TOP = 5;
|
1092
1165
|
const xLinear = (spec, context)=>{
|
1093
1166
|
const result = {
|
1094
1167
|
...spec
|
@@ -1157,6 +1230,9 @@ const xLinear = (spec, context)=>{
|
|
1157
1230
|
lineWidth: line?.lineWidth,
|
1158
1231
|
stroke: line?.lineColor
|
1159
1232
|
}
|
1233
|
+
},
|
1234
|
+
innerOffset: {
|
1235
|
+
top: LINEAR_AXIS_INNER_OFFSET_TOP
|
1160
1236
|
}
|
1161
1237
|
};
|
1162
1238
|
result.axes = [
|
@@ -1244,7 +1320,15 @@ const yBand = (spec, context)=>{
|
|
1244
1320
|
lineWidth: line?.lineWidth,
|
1245
1321
|
stroke: line?.lineColor
|
1246
1322
|
}
|
1247
|
-
}
|
1323
|
+
},
|
1324
|
+
paddingInner: [
|
1325
|
+
0.15,
|
1326
|
+
0.1
|
1327
|
+
],
|
1328
|
+
paddingOuter: [
|
1329
|
+
0.075,
|
1330
|
+
0.1
|
1331
|
+
]
|
1248
1332
|
};
|
1249
1333
|
result.axes = [
|
1250
1334
|
...result.axes,
|
@@ -1320,6 +1404,9 @@ const yLinear = (spec, context)=>{
|
|
1320
1404
|
lineWidth: line?.lineWidth,
|
1321
1405
|
stroke: line?.lineColor
|
1322
1406
|
}
|
1407
|
+
},
|
1408
|
+
innerOffset: {
|
1409
|
+
top: LINEAR_AXIS_INNER_OFFSET_TOP
|
1323
1410
|
}
|
1324
1411
|
};
|
1325
1412
|
result.axes = [
|
@@ -1342,6 +1429,15 @@ const stackInverse = (spec)=>{
|
|
1342
1429
|
result.stackInverse = true;
|
1343
1430
|
return result;
|
1344
1431
|
};
|
1432
|
+
const stackCornerRadius_stackCornerRadius = (spec, context)=>{
|
1433
|
+
const { advancedVSeed, vseed } = context;
|
1434
|
+
const { chartType } = vseed;
|
1435
|
+
const stackCornerRadius = advancedVSeed.config?.[chartType]?.stackCornerRadius;
|
1436
|
+
return {
|
1437
|
+
...spec,
|
1438
|
+
stackCornerRadius
|
1439
|
+
};
|
1440
|
+
};
|
1345
1441
|
const background_backgroundColor = (spec, context)=>{
|
1346
1442
|
const result = {
|
1347
1443
|
...spec
|
@@ -1363,11 +1459,55 @@ const tooltip_tooltip = (spec, context)=>{
|
|
1363
1459
|
...spec
|
1364
1460
|
};
|
1365
1461
|
const { advancedVSeed } = context;
|
1462
|
+
const { measures, datasetReshapeInfo } = advancedVSeed;
|
1366
1463
|
const baseConfig = advancedVSeed.baseConfig.vchart;
|
1367
1464
|
const { tooltip = defaultTooltip } = baseConfig;
|
1368
1465
|
const { enable } = tooltip;
|
1466
|
+
const { measureId, measureName, measureValue } = datasetReshapeInfo[0].foldInfo;
|
1369
1467
|
result.tooltip = {
|
1370
|
-
visible: enable
|
1468
|
+
visible: enable,
|
1469
|
+
mark: {
|
1470
|
+
content: [
|
1471
|
+
{
|
1472
|
+
visible: true,
|
1473
|
+
key: (datum)=>datum && datum[measureName] || '',
|
1474
|
+
value: (datum)=>{
|
1475
|
+
if (!datum) return '';
|
1476
|
+
const value = datum[measureValue];
|
1477
|
+
const id = datum[measureId];
|
1478
|
+
const measure = findMeasureById(measures, id);
|
1479
|
+
if (!measure) return String(value);
|
1480
|
+
const { format = {}, autoFormat = true } = measure;
|
1481
|
+
if (format || autoFormat) {
|
1482
|
+
const formatter = createFormatter(format);
|
1483
|
+
return formatter(value);
|
1484
|
+
}
|
1485
|
+
return String(value);
|
1486
|
+
}
|
1487
|
+
}
|
1488
|
+
]
|
1489
|
+
},
|
1490
|
+
dimension: {
|
1491
|
+
content: [
|
1492
|
+
{
|
1493
|
+
visible: true,
|
1494
|
+
key: (datum)=>datum && datum[measureName] || '',
|
1495
|
+
value: (datum)=>{
|
1496
|
+
if (!datum) return '';
|
1497
|
+
const value = datum[measureValue];
|
1498
|
+
const id = datum[measureId];
|
1499
|
+
const measure = findMeasureById(measures, id);
|
1500
|
+
if (!measure) return String(value);
|
1501
|
+
const { format = {}, autoFormat = true } = measure;
|
1502
|
+
if (format || autoFormat) {
|
1503
|
+
const formatter = createFormatter(format);
|
1504
|
+
return formatter(value);
|
1505
|
+
}
|
1506
|
+
return String(value);
|
1507
|
+
}
|
1508
|
+
}
|
1509
|
+
]
|
1510
|
+
}
|
1371
1511
|
};
|
1372
1512
|
return result;
|
1373
1513
|
};
|
@@ -1376,12 +1516,24 @@ const label_label = (spec, context)=>{
|
|
1376
1516
|
...spec
|
1377
1517
|
};
|
1378
1518
|
const { advancedVSeed } = context;
|
1519
|
+
const { measures, datasetReshapeInfo } = advancedVSeed;
|
1379
1520
|
const baseConfig = advancedVSeed.baseConfig.vchart;
|
1380
1521
|
if (!baseConfig || !baseConfig.label) return result;
|
1522
|
+
const { measureId } = datasetReshapeInfo[0].foldInfo;
|
1381
1523
|
const { label } = baseConfig;
|
1382
1524
|
const { enable } = label;
|
1383
1525
|
result.label = {
|
1384
|
-
visible: enable
|
1526
|
+
visible: enable,
|
1527
|
+
formatMethod: (value, datum)=>{
|
1528
|
+
const id = datum[measureId];
|
1529
|
+
const measure = findMeasureById(measures, id);
|
1530
|
+
if (!measure) return value;
|
1531
|
+
const { format = {}, autoFormat = true } = measure;
|
1532
|
+
if (format || autoFormat) {
|
1533
|
+
const formatter = createFormatter(format);
|
1534
|
+
return formatter(value);
|
1535
|
+
}
|
1536
|
+
}
|
1385
1537
|
};
|
1386
1538
|
return result;
|
1387
1539
|
};
|
@@ -1684,6 +1836,7 @@ const pivotGridStyle = (spec)=>{
|
|
1684
1836
|
...spec
|
1685
1837
|
};
|
1686
1838
|
const transparent = 'rgba(0,0,0,0)';
|
1839
|
+
const hoverBackgroundColor = 'rgba(178,186,207, 0.2)';
|
1687
1840
|
return {
|
1688
1841
|
...result,
|
1689
1842
|
theme: {
|
@@ -1702,7 +1855,10 @@ const pivotGridStyle = (spec)=>{
|
|
1702
1855
|
0,
|
1703
1856
|
1,
|
1704
1857
|
0
|
1705
|
-
]
|
1858
|
+
],
|
1859
|
+
hover: {
|
1860
|
+
cellBgColor: 'transparent'
|
1861
|
+
}
|
1706
1862
|
},
|
1707
1863
|
headerStyle: {
|
1708
1864
|
borderColor: 'rgba(0,4,20,0.2)',
|
@@ -1712,7 +1868,7 @@ const pivotGridStyle = (spec)=>{
|
|
1712
1868
|
borderLineWidth: 0,
|
1713
1869
|
bgColor: transparent,
|
1714
1870
|
hover: {
|
1715
|
-
cellBgColor:
|
1871
|
+
cellBgColor: hoverBackgroundColor
|
1716
1872
|
}
|
1717
1873
|
},
|
1718
1874
|
rowHeaderStyle: {
|
@@ -1722,7 +1878,7 @@ const pivotGridStyle = (spec)=>{
|
|
1722
1878
|
borderLineWidth: 0,
|
1723
1879
|
bgColor: transparent,
|
1724
1880
|
hover: {
|
1725
|
-
cellBgColor:
|
1881
|
+
cellBgColor: hoverBackgroundColor
|
1726
1882
|
}
|
1727
1883
|
},
|
1728
1884
|
cornerHeaderStyle: {
|
@@ -1739,7 +1895,7 @@ const pivotGridStyle = (spec)=>{
|
|
1739
1895
|
],
|
1740
1896
|
bgColor: transparent,
|
1741
1897
|
hover: {
|
1742
|
-
cellBgColor:
|
1898
|
+
cellBgColor: hoverBackgroundColor
|
1743
1899
|
}
|
1744
1900
|
},
|
1745
1901
|
cornerRightTopCellStyle: {
|
@@ -1747,7 +1903,7 @@ const pivotGridStyle = (spec)=>{
|
|
1747
1903
|
borderLineWidth: 0,
|
1748
1904
|
bgColor: transparent,
|
1749
1905
|
hover: {
|
1750
|
-
cellBgColor:
|
1906
|
+
cellBgColor: hoverBackgroundColor
|
1751
1907
|
}
|
1752
1908
|
},
|
1753
1909
|
cornerLeftBottomCellStyle: {
|
@@ -1755,7 +1911,7 @@ const pivotGridStyle = (spec)=>{
|
|
1755
1911
|
borderLineWidth: 0,
|
1756
1912
|
bgColor: transparent,
|
1757
1913
|
hover: {
|
1758
|
-
cellBgColor:
|
1914
|
+
cellBgColor: hoverBackgroundColor
|
1759
1915
|
}
|
1760
1916
|
},
|
1761
1917
|
cornerRightBottomCellStyle: {
|
@@ -1763,7 +1919,7 @@ const pivotGridStyle = (spec)=>{
|
|
1763
1919
|
borderLineWidth: 0,
|
1764
1920
|
bgColor: transparent,
|
1765
1921
|
hover: {
|
1766
|
-
cellBgColor:
|
1922
|
+
cellBgColor: hoverBackgroundColor
|
1767
1923
|
}
|
1768
1924
|
},
|
1769
1925
|
rightFrozenStyle: {
|
@@ -1771,7 +1927,7 @@ const pivotGridStyle = (spec)=>{
|
|
1771
1927
|
borderLineWidth: 0,
|
1772
1928
|
bgColor: transparent,
|
1773
1929
|
hover: {
|
1774
|
-
cellBgColor:
|
1930
|
+
cellBgColor: hoverBackgroundColor
|
1775
1931
|
}
|
1776
1932
|
},
|
1777
1933
|
bottomFrozenStyle: {
|
@@ -1779,7 +1935,7 @@ const pivotGridStyle = (spec)=>{
|
|
1779
1935
|
borderLineWidth: 0,
|
1780
1936
|
bgColor: transparent,
|
1781
1937
|
hover: {
|
1782
|
-
cellBgColor:
|
1938
|
+
cellBgColor: hoverBackgroundColor
|
1783
1939
|
}
|
1784
1940
|
},
|
1785
1941
|
selectionStyle: {
|
@@ -1827,8 +1983,10 @@ const pivotRowDimensions = (spec, context)=>{
|
|
1827
1983
|
rows: rows
|
1828
1984
|
};
|
1829
1985
|
};
|
1830
|
-
const selector_selector = (
|
1986
|
+
const selector_selector = (vchartDatum, selector)=>{
|
1831
1987
|
if (!selector) return true;
|
1988
|
+
const vchartKeys = Object.keys(vchartDatum).filter((k)=>k.toLocaleLowerCase().startsWith('__vchart'));
|
1989
|
+
const datum = omit(vchartDatum, vchartKeys);
|
1832
1990
|
const selectors = Array.isArray(selector) ? selector : [
|
1833
1991
|
selector
|
1834
1992
|
];
|
@@ -1917,52 +2075,218 @@ const barStyle_barStyle = (spec, context)=>{
|
|
1917
2075
|
const { advancedVSeed } = context;
|
1918
2076
|
const { markStyle, encoding } = advancedVSeed;
|
1919
2077
|
const { barStyle } = markStyle;
|
1920
|
-
if (!barStyle) return spec;
|
1921
2078
|
const result = {
|
1922
|
-
...spec
|
2079
|
+
...spec,
|
2080
|
+
bar: {
|
2081
|
+
state: {
|
2082
|
+
hover: {
|
2083
|
+
stroke: (datum, context)=>{
|
2084
|
+
const field = encoding[0]?.group?.[0];
|
2085
|
+
const color = context.seriesColor(datum[field]);
|
2086
|
+
return color;
|
2087
|
+
},
|
2088
|
+
lineWidth: 4,
|
2089
|
+
fillOpacity: 0.6
|
2090
|
+
}
|
2091
|
+
}
|
2092
|
+
}
|
1923
2093
|
};
|
1924
|
-
|
2094
|
+
if (!barStyle) return result;
|
2095
|
+
const barStyles = Array.isArray(barStyle) ? barStyle : [
|
2096
|
+
barStyle
|
2097
|
+
];
|
2098
|
+
const customMap = barStyles.reduce((result, style, index)=>{
|
2099
|
+
const { barBorderColor, barBorderStyle, barBorderWidth, barColor, barColorOpacity, barRadius } = style;
|
2100
|
+
const lineDash = 'dashed' === barBorderStyle ? [
|
2101
|
+
5,
|
2102
|
+
2
|
2103
|
+
] : 'dotted' === barBorderStyle ? [
|
2104
|
+
2,
|
2105
|
+
5
|
2106
|
+
] : [
|
2107
|
+
0,
|
2108
|
+
0
|
2109
|
+
];
|
2110
|
+
return {
|
2111
|
+
...result,
|
2112
|
+
[`custom${index + 1}`]: {
|
2113
|
+
level: index + 1,
|
2114
|
+
filter: (datum)=>{
|
2115
|
+
if (selector_selector(datum, style.selector)) return true;
|
2116
|
+
return false;
|
2117
|
+
},
|
2118
|
+
style: {
|
2119
|
+
fill: barColor,
|
2120
|
+
fillOpacity: barColorOpacity,
|
2121
|
+
stroke: barBorderColor,
|
2122
|
+
lineWidth: barBorderWidth,
|
2123
|
+
lineDash: lineDash,
|
2124
|
+
cornerRadius: barRadius
|
2125
|
+
}
|
2126
|
+
}
|
2127
|
+
};
|
2128
|
+
}, {});
|
1925
2129
|
return {
|
1926
2130
|
...result,
|
1927
2131
|
bar: {
|
1928
|
-
|
1929
|
-
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
1934
|
-
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
|
1950
|
-
|
1951
|
-
|
1952
|
-
|
1953
|
-
|
1954
|
-
|
1955
|
-
|
1956
|
-
|
1957
|
-
|
1958
|
-
|
1959
|
-
|
1960
|
-
|
1961
|
-
|
1962
|
-
|
1963
|
-
|
1964
|
-
|
1965
|
-
|
2132
|
+
state: {
|
2133
|
+
...customMap
|
2134
|
+
}
|
2135
|
+
}
|
2136
|
+
};
|
2137
|
+
};
|
2138
|
+
const pointStyle_pointStyle = (spec, context)=>{
|
2139
|
+
const { advancedVSeed } = context;
|
2140
|
+
const { markStyle } = advancedVSeed;
|
2141
|
+
const { pointStyle } = markStyle;
|
2142
|
+
const result = {
|
2143
|
+
...spec,
|
2144
|
+
point: {
|
2145
|
+
state: {
|
2146
|
+
dimension_hover: {
|
2147
|
+
scaleX: 1.4,
|
2148
|
+
scaleY: 1.4
|
2149
|
+
}
|
2150
|
+
}
|
2151
|
+
}
|
2152
|
+
};
|
2153
|
+
if (!pointStyle) return result;
|
2154
|
+
const pointStyles = Array.isArray(pointStyle) ? pointStyle : [
|
2155
|
+
pointStyle
|
2156
|
+
];
|
2157
|
+
const customMap = pointStyles.reduce((result, style, index)=>{
|
2158
|
+
const { pointBorderColor, pointBorderStyle, pointBorderWidth, pointColor, pointColorOpacity, pointSize } = style;
|
2159
|
+
const lineDash = 'dashed' === pointBorderStyle ? [
|
2160
|
+
5,
|
2161
|
+
2
|
2162
|
+
] : 'dotted' === pointBorderStyle ? [
|
2163
|
+
2,
|
2164
|
+
5
|
2165
|
+
] : [
|
2166
|
+
0,
|
2167
|
+
0
|
2168
|
+
];
|
2169
|
+
return {
|
2170
|
+
...result,
|
2171
|
+
[`custom${index + 1}`]: {
|
2172
|
+
level: index + 1,
|
2173
|
+
filter: (datum)=>{
|
2174
|
+
if (selector_selector(datum, style.selector)) return true;
|
2175
|
+
return false;
|
2176
|
+
},
|
2177
|
+
style: {
|
2178
|
+
size: pointSize,
|
2179
|
+
fill: pointColor,
|
2180
|
+
fillOpacity: pointColorOpacity,
|
2181
|
+
stroke: pointBorderColor,
|
2182
|
+
lineWidth: pointBorderWidth,
|
2183
|
+
lineDash: lineDash
|
2184
|
+
}
|
2185
|
+
}
|
2186
|
+
};
|
2187
|
+
}, {});
|
2188
|
+
return {
|
2189
|
+
...result,
|
2190
|
+
point: {
|
2191
|
+
state: {
|
2192
|
+
...customMap
|
2193
|
+
}
|
2194
|
+
}
|
2195
|
+
};
|
2196
|
+
};
|
2197
|
+
const lineStyle_lineStyle = (spec, context)=>{
|
2198
|
+
const { advancedVSeed } = context;
|
2199
|
+
const { markStyle, encoding, dataset } = advancedVSeed;
|
2200
|
+
const { lineStyle } = markStyle;
|
2201
|
+
if (!lineStyle) return spec;
|
2202
|
+
const result = {
|
2203
|
+
...spec
|
2204
|
+
};
|
2205
|
+
const lineStyles = Array.isArray(lineStyle) ? lineStyle : [
|
2206
|
+
lineStyle
|
2207
|
+
];
|
2208
|
+
const group = encoding[0]?.group?.[0];
|
2209
|
+
const lineGroups = groupBy(dataset, (d)=>d[group ?? '']);
|
2210
|
+
const customMap = lineStyles.reduce((result, style, index)=>{
|
2211
|
+
const { lineColor, lineColorOpacity, lineSmooth, lineStyle, lineWidth } = style;
|
2212
|
+
const dashSegment = (lineWidth ?? 2) * 2;
|
2213
|
+
const dashGap = lineWidth ?? 2;
|
2214
|
+
const lineDash = 'dashed' === lineStyle ? [
|
2215
|
+
dashSegment,
|
2216
|
+
dashSegment
|
2217
|
+
] : 'dotted' === lineStyle ? [
|
2218
|
+
dashGap / 2,
|
2219
|
+
2 * dashGap
|
2220
|
+
] : [
|
2221
|
+
0,
|
2222
|
+
0
|
2223
|
+
];
|
2224
|
+
const curveType = lineSmooth ? 'monotone' : 'linear';
|
2225
|
+
return {
|
2226
|
+
...result,
|
2227
|
+
[`custom${index + 1}`]: {
|
2228
|
+
level: index + 1,
|
2229
|
+
filter: (datum)=>{
|
2230
|
+
const lineData = lineGroups[datum[group ?? '']];
|
2231
|
+
for (const d of lineData)if (selector_selector(d, style.selector)) return true;
|
2232
|
+
return false;
|
2233
|
+
},
|
2234
|
+
style: {
|
2235
|
+
curveType: curveType,
|
2236
|
+
fill: lineColor,
|
2237
|
+
fillOpacity: lineColorOpacity,
|
2238
|
+
stroke: lineColor,
|
2239
|
+
lineWidth: lineWidth,
|
2240
|
+
lineDash: lineDash
|
2241
|
+
}
|
2242
|
+
}
|
2243
|
+
};
|
2244
|
+
}, {});
|
2245
|
+
return {
|
2246
|
+
...result,
|
2247
|
+
line: {
|
2248
|
+
state: {
|
2249
|
+
...customMap
|
2250
|
+
}
|
2251
|
+
}
|
2252
|
+
};
|
2253
|
+
};
|
2254
|
+
const areaStyle_areaStyle = (spec, context)=>{
|
2255
|
+
const { advancedVSeed } = context;
|
2256
|
+
const { markStyle, encoding, dataset } = advancedVSeed;
|
2257
|
+
const { areaStyle } = markStyle;
|
2258
|
+
if (!areaStyle) return spec;
|
2259
|
+
const result = {
|
2260
|
+
...spec
|
2261
|
+
};
|
2262
|
+
const areaStyles = Array.isArray(areaStyle) ? areaStyle : [
|
2263
|
+
areaStyle
|
2264
|
+
];
|
2265
|
+
const group = encoding[0]?.group?.[0];
|
2266
|
+
const lineGroups = groupBy(dataset, (d)=>d[group ?? '']);
|
2267
|
+
const customMap = areaStyles.reduce((result, style, index)=>{
|
2268
|
+
const { areaColor, areaColorOpacity } = style;
|
2269
|
+
return {
|
2270
|
+
...result,
|
2271
|
+
[`custom${index + 1}`]: {
|
2272
|
+
level: index + 1,
|
2273
|
+
filter: (datum)=>{
|
2274
|
+
const lineData = lineGroups[datum[group ?? '']];
|
2275
|
+
for (const d of lineData)if (selector_selector(d, style.selector)) return true;
|
2276
|
+
return false;
|
2277
|
+
},
|
2278
|
+
style: {
|
2279
|
+
fill: areaColor,
|
2280
|
+
fillOpacity: areaColorOpacity
|
2281
|
+
}
|
2282
|
+
}
|
2283
|
+
};
|
2284
|
+
}, {});
|
2285
|
+
return {
|
2286
|
+
...result,
|
2287
|
+
area: {
|
2288
|
+
state: {
|
2289
|
+
...customMap
|
1966
2290
|
}
|
1967
2291
|
}
|
1968
2292
|
};
|
@@ -1985,20 +2309,15 @@ const annotationPoint_annotationPoint = (spec, context)=>{
|
|
1985
2309
|
const dataset = advancedVSeed.dataset.flat();
|
1986
2310
|
const selectedData = dataset.filter((datum)=>selector_selector(datum, selectorPoint));
|
1987
2311
|
return selectedData.map((datum)=>({
|
2312
|
+
zIndex: ANNOTATION_Z_INDEX,
|
1988
2313
|
regionRelative: true,
|
1989
2314
|
position: (data, context)=>{
|
1990
2315
|
const targetDatum = data.find((item)=>isSubset(datum, item));
|
1991
2316
|
if (targetDatum) {
|
1992
2317
|
const { x, y } = context.dataToPosition(targetDatum);
|
1993
|
-
|
1994
|
-
const yBandWidth = context.scaleY?.bandwidth?.();
|
1995
|
-
if (xBandWidth) return {
|
1996
|
-
x: x,
|
1997
|
-
y: y
|
1998
|
-
};
|
1999
|
-
if (yBandWidth) return {
|
2318
|
+
return {
|
2000
2319
|
x,
|
2001
|
-
y
|
2320
|
+
y
|
2002
2321
|
};
|
2003
2322
|
}
|
2004
2323
|
},
|
@@ -2058,6 +2377,7 @@ const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
|
2058
2377
|
const dataset = advancedVSeed.dataset.flat();
|
2059
2378
|
const generateOneMarkLine = (x)=>({
|
2060
2379
|
x: x,
|
2380
|
+
zIndex: ANNOTATION_Z_INDEX,
|
2061
2381
|
line: {
|
2062
2382
|
visible: lineVisible,
|
2063
2383
|
style: {
|
@@ -2154,6 +2474,7 @@ const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
|
2154
2474
|
const dataset = advancedVSeed.dataset.flat();
|
2155
2475
|
const generateOneMarkLine = (y)=>({
|
2156
2476
|
y,
|
2477
|
+
zIndex: ANNOTATION_Z_INDEX,
|
2157
2478
|
line: {
|
2158
2479
|
visible: lineVisible,
|
2159
2480
|
style: {
|
@@ -2248,20 +2569,19 @@ const annotationArea_annotationArea = (spec, context)=>{
|
|
2248
2569
|
right: 'insideRight'
|
2249
2570
|
};
|
2250
2571
|
const markArea = annotationAreaList.flatMap((annotationArea)=>{
|
2251
|
-
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#191d24', backgroundPadding = 4, backgroundVisible = true, outerPadding =
|
2572
|
+
const { selector: selectorPoint, text = '', textPosition = 'top', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#191d24', backgroundPadding = 4, backgroundVisible = true, outerPadding = 0, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor, areaBorderRadius, areaBorderWidth } = annotationArea;
|
2252
2573
|
const dataset = advancedVSeed.dataset.flat();
|
2253
2574
|
const selectedData = dataset.filter((datum)=>selector_selector(datum, selectorPoint));
|
2254
2575
|
return {
|
2576
|
+
zIndex: ANNOTATION_Z_INDEX,
|
2255
2577
|
regionRelative: true,
|
2256
2578
|
positions: (data, context)=>{
|
2257
|
-
console.log('debug selectedData', selectedData);
|
2258
2579
|
const positionData = data.filter((item)=>selectedData.some((datum)=>isSubset(datum, item)));
|
2259
2580
|
const xyList = positionData.map((datum)=>context.dataToPosition(datum));
|
2260
|
-
const
|
2261
|
-
const
|
2262
|
-
|
2263
|
-
|
2264
|
-
if (xBandWidth) {
|
2581
|
+
const yAxisHelper = context.getYAxisHelper();
|
2582
|
+
const xAxisHelper = context.getXAxisHelper();
|
2583
|
+
if ('function' == typeof xAxisHelper?.getBandwidth) {
|
2584
|
+
const yScale = yAxisHelper.getScale();
|
2265
2585
|
const minX = Math.min(...xyList.map((item)=>item.x)) - outerPadding;
|
2266
2586
|
const maxX = Math.max(...xyList.map((item)=>item.x)) + outerPadding;
|
2267
2587
|
const minY = Math.min(...yScale.range());
|
@@ -2285,7 +2605,8 @@ const annotationArea_annotationArea = (spec, context)=>{
|
|
2285
2605
|
}
|
2286
2606
|
];
|
2287
2607
|
}
|
2288
|
-
if (
|
2608
|
+
if ('function' == typeof yAxisHelper?.getBandwidth) {
|
2609
|
+
const xScale = xAxisHelper.getScale();
|
2289
2610
|
const minY = Math.min(...xyList.map((item)=>item.y)) - outerPadding;
|
2290
2611
|
const maxY = Math.max(...xyList.map((item)=>item.y)) + outerPadding;
|
2291
2612
|
const minX = Math.min(...xScale.range());
|
@@ -2373,15 +2694,17 @@ const annotationAreaBand = (spec, context)=>{
|
|
2373
2694
|
const dataset = advancedVSeed.dataset.flat();
|
2374
2695
|
const selectedData = dataset.filter((datum)=>selector_selector(datum, selectorPoint));
|
2375
2696
|
return {
|
2697
|
+
zIndex: ANNOTATION_Z_INDEX,
|
2376
2698
|
regionRelative: true,
|
2377
2699
|
positions: (data, context)=>{
|
2378
2700
|
const positionData = data.filter((item)=>selectedData.some((datum)=>isSubset(datum, item)));
|
2379
2701
|
const xyList = positionData.map((datum)=>context.dataToPosition(datum));
|
2380
|
-
const
|
2381
|
-
const
|
2382
|
-
|
2383
|
-
|
2384
|
-
|
2702
|
+
const yAxisHelper = context.getYAxisHelper();
|
2703
|
+
const xAxisHelper = context.getXAxisHelper();
|
2704
|
+
if ('function' == typeof xAxisHelper?.getBandwidth) {
|
2705
|
+
const depth = context.fieldX.length ?? 0;
|
2706
|
+
const xBandWidth = xAxisHelper?.getBandwidth?.(depth - 1);
|
2707
|
+
const yScale = yAxisHelper.getScale();
|
2385
2708
|
const minX = Math.min(...xyList.map((item)=>item.x)) - outerPadding;
|
2386
2709
|
const maxX = Math.max(...xyList.map((item)=>item.x)) + xBandWidth + outerPadding;
|
2387
2710
|
const minY = Math.min(...yScale.range());
|
@@ -2405,7 +2728,10 @@ const annotationAreaBand = (spec, context)=>{
|
|
2405
2728
|
}
|
2406
2729
|
];
|
2407
2730
|
}
|
2408
|
-
if (
|
2731
|
+
if ('function' == typeof yAxisHelper?.getBandwidth) {
|
2732
|
+
const depth = context.fieldY.length ?? 0;
|
2733
|
+
const yBandWidth = yAxisHelper?.getBandwidth?.(depth - 1);
|
2734
|
+
const xScale = xAxisHelper.getScale();
|
2409
2735
|
const minY = Math.min(...xyList.map((item)=>item.y)) - outerPadding;
|
2410
2736
|
const maxY = Math.max(...xyList.map((item)=>item.y)) + yBandWidth + outerPadding;
|
2411
2737
|
const minX = Math.min(...xScale.range());
|
@@ -2470,6 +2796,118 @@ const annotationAreaBand = (spec, context)=>{
|
|
2470
2796
|
markArea: markArea
|
2471
2797
|
};
|
2472
2798
|
};
|
2799
|
+
const verticalCrosshairLine = (spec, context)=>{
|
2800
|
+
const result = {
|
2801
|
+
...spec
|
2802
|
+
};
|
2803
|
+
const { advancedVSeed, vseed } = context;
|
2804
|
+
const { chartType } = vseed;
|
2805
|
+
const config = advancedVSeed.config?.[chartType]?.crosshairLine;
|
2806
|
+
if (!config) return result;
|
2807
|
+
if (!result.crosshair) result.crosshair = {};
|
2808
|
+
const { visible = true, lineColor, labelColor, labelVisible, labelBackgroundColor } = config;
|
2809
|
+
const crosshair = result.crosshair;
|
2810
|
+
crosshair.xField = {
|
2811
|
+
visible,
|
2812
|
+
line: {
|
2813
|
+
type: 'line',
|
2814
|
+
style: {
|
2815
|
+
lineWidth: 1,
|
2816
|
+
opacity: 1,
|
2817
|
+
stroke: lineColor,
|
2818
|
+
lineDash: [
|
2819
|
+
4,
|
2820
|
+
2
|
2821
|
+
]
|
2822
|
+
}
|
2823
|
+
},
|
2824
|
+
label: {
|
2825
|
+
visible: labelVisible,
|
2826
|
+
labelBackground: {
|
2827
|
+
visible: labelVisible,
|
2828
|
+
style: {
|
2829
|
+
fill: labelBackgroundColor
|
2830
|
+
}
|
2831
|
+
},
|
2832
|
+
style: {
|
2833
|
+
fill: labelColor
|
2834
|
+
}
|
2835
|
+
}
|
2836
|
+
};
|
2837
|
+
return result;
|
2838
|
+
};
|
2839
|
+
const verticalCrosshairRect = (spec, context)=>{
|
2840
|
+
const result = {
|
2841
|
+
...spec
|
2842
|
+
};
|
2843
|
+
const { advancedVSeed, vseed } = context;
|
2844
|
+
const { chartType } = vseed;
|
2845
|
+
const config = advancedVSeed.config?.[chartType]?.crosshairRect;
|
2846
|
+
if (!config) return result;
|
2847
|
+
if (!result.crosshair) result.crosshair = {};
|
2848
|
+
const { visible = true, rectColor, labelColor, labelVisible, labelBackgroundColor } = config;
|
2849
|
+
const crosshair = result.crosshair;
|
2850
|
+
crosshair.xField = {
|
2851
|
+
visible,
|
2852
|
+
line: {
|
2853
|
+
type: 'rect',
|
2854
|
+
style: {
|
2855
|
+
lineWidth: 0,
|
2856
|
+
opacity: 0.2,
|
2857
|
+
fill: rectColor
|
2858
|
+
}
|
2859
|
+
},
|
2860
|
+
label: {
|
2861
|
+
visible: labelVisible,
|
2862
|
+
labelBackground: {
|
2863
|
+
visible: labelVisible,
|
2864
|
+
style: {
|
2865
|
+
fill: labelBackgroundColor
|
2866
|
+
}
|
2867
|
+
},
|
2868
|
+
style: {
|
2869
|
+
fill: labelColor
|
2870
|
+
}
|
2871
|
+
}
|
2872
|
+
};
|
2873
|
+
return result;
|
2874
|
+
};
|
2875
|
+
const horizontalCrosshairRect = (spec, context)=>{
|
2876
|
+
const result = {
|
2877
|
+
...spec
|
2878
|
+
};
|
2879
|
+
const { advancedVSeed, vseed } = context;
|
2880
|
+
const { chartType } = vseed;
|
2881
|
+
const config = advancedVSeed.config?.[chartType]?.crosshairRect;
|
2882
|
+
if (!config) return result;
|
2883
|
+
if (!result.crosshair) result.crosshair = {};
|
2884
|
+
const { visible = true, rectColor, labelColor, labelVisible, labelBackgroundColor } = config;
|
2885
|
+
const crosshair = result.crosshair;
|
2886
|
+
crosshair.yField = {
|
2887
|
+
visible,
|
2888
|
+
line: {
|
2889
|
+
type: 'rect',
|
2890
|
+
style: {
|
2891
|
+
lineWidth: 0,
|
2892
|
+
opacity: 0.2,
|
2893
|
+
fill: rectColor
|
2894
|
+
}
|
2895
|
+
},
|
2896
|
+
label: {
|
2897
|
+
visible: labelVisible,
|
2898
|
+
labelBackground: {
|
2899
|
+
visible: labelVisible,
|
2900
|
+
style: {
|
2901
|
+
fill: labelBackgroundColor
|
2902
|
+
}
|
2903
|
+
},
|
2904
|
+
style: {
|
2905
|
+
fill: labelColor
|
2906
|
+
}
|
2907
|
+
}
|
2908
|
+
};
|
2909
|
+
return result;
|
2910
|
+
};
|
2473
2911
|
const line_line = [
|
2474
2912
|
initLine,
|
2475
2913
|
color_color,
|
@@ -2479,7 +2917,10 @@ const line_line = [
|
|
2479
2917
|
yLinear,
|
2480
2918
|
label_label,
|
2481
2919
|
tooltip_tooltip,
|
2920
|
+
verticalCrosshairLine,
|
2482
2921
|
discreteLegend,
|
2922
|
+
pointStyle_pointStyle,
|
2923
|
+
lineStyle_lineStyle,
|
2483
2924
|
annotationPoint_annotationPoint,
|
2484
2925
|
annotationVerticalLine_annotationVerticalLine,
|
2485
2926
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -2499,6 +2940,9 @@ const pivotLine = [
|
|
2499
2940
|
yLinear,
|
2500
2941
|
label_label,
|
2501
2942
|
tooltip_tooltip,
|
2943
|
+
verticalCrosshairLine,
|
2944
|
+
pointStyle_pointStyle,
|
2945
|
+
lineStyle_lineStyle,
|
2502
2946
|
annotationPoint_annotationPoint,
|
2503
2947
|
annotationVerticalLine_annotationVerticalLine,
|
2504
2948
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -2513,6 +2957,7 @@ const lineSpecPipeline = [
|
|
2513
2957
|
];
|
2514
2958
|
const column = [
|
2515
2959
|
initColumn,
|
2960
|
+
stackCornerRadius_stackCornerRadius,
|
2516
2961
|
stackInverse,
|
2517
2962
|
color_color,
|
2518
2963
|
background_backgroundColor,
|
@@ -2521,6 +2966,7 @@ const column = [
|
|
2521
2966
|
yLinear,
|
2522
2967
|
label_label,
|
2523
2968
|
tooltip_tooltip,
|
2969
|
+
verticalCrosshairRect,
|
2524
2970
|
discreteLegend,
|
2525
2971
|
barStyle_barStyle,
|
2526
2972
|
annotationPoint_annotationPoint,
|
@@ -2535,6 +2981,7 @@ const pivotColumn = [
|
|
2535
2981
|
datasetPivot,
|
2536
2982
|
pivotIndicators([
|
2537
2983
|
initColumn,
|
2984
|
+
stackCornerRadius_stackCornerRadius,
|
2538
2985
|
stackInverse,
|
2539
2986
|
color_color,
|
2540
2987
|
background_backgroundColor,
|
@@ -2543,6 +2990,7 @@ const pivotColumn = [
|
|
2543
2990
|
yLinear,
|
2544
2991
|
label_label,
|
2545
2992
|
tooltip_tooltip,
|
2993
|
+
verticalCrosshairRect,
|
2546
2994
|
barStyle_barStyle,
|
2547
2995
|
annotationPoint_annotationPoint,
|
2548
2996
|
annotationVerticalLine_annotationVerticalLine,
|
@@ -2558,6 +3006,7 @@ const columnSpecPipeline = [
|
|
2558
3006
|
];
|
2559
3007
|
const columnParallel = [
|
2560
3008
|
initColumnParallel,
|
3009
|
+
stackCornerRadius_stackCornerRadius,
|
2561
3010
|
color_color,
|
2562
3011
|
background_backgroundColor,
|
2563
3012
|
dataset_dataset,
|
@@ -2566,6 +3015,7 @@ const columnParallel = [
|
|
2566
3015
|
label_label,
|
2567
3016
|
tooltip_tooltip,
|
2568
3017
|
discreteLegend,
|
3018
|
+
verticalCrosshairRect,
|
2569
3019
|
barStyle_barStyle,
|
2570
3020
|
annotationPoint_annotationPoint,
|
2571
3021
|
annotationVerticalLine_annotationVerticalLine,
|
@@ -2579,6 +3029,7 @@ const pivotColumnParallel = [
|
|
2579
3029
|
datasetPivot,
|
2580
3030
|
pivotIndicators([
|
2581
3031
|
initColumnParallel,
|
3032
|
+
stackCornerRadius_stackCornerRadius,
|
2582
3033
|
color_color,
|
2583
3034
|
background_backgroundColor,
|
2584
3035
|
datasetPivotPlaceholder,
|
@@ -2586,6 +3037,7 @@ const pivotColumnParallel = [
|
|
2586
3037
|
yLinear,
|
2587
3038
|
label_label,
|
2588
3039
|
tooltip_tooltip,
|
3040
|
+
verticalCrosshairRect,
|
2589
3041
|
barStyle_barStyle,
|
2590
3042
|
annotationPoint_annotationPoint,
|
2591
3043
|
annotationVerticalLine_annotationVerticalLine,
|
@@ -2601,6 +3053,7 @@ const columnParallelSpecPipeline = [
|
|
2601
3053
|
];
|
2602
3054
|
const columnPercent = [
|
2603
3055
|
initColumn,
|
3056
|
+
stackCornerRadius_stackCornerRadius,
|
2604
3057
|
stackInverse,
|
2605
3058
|
color_color,
|
2606
3059
|
background_backgroundColor,
|
@@ -2610,6 +3063,7 @@ const columnPercent = [
|
|
2610
3063
|
yLinear,
|
2611
3064
|
label_label,
|
2612
3065
|
tooltip_tooltip,
|
3066
|
+
verticalCrosshairRect,
|
2613
3067
|
discreteLegend,
|
2614
3068
|
barStyle_barStyle,
|
2615
3069
|
annotationPoint_annotationPoint,
|
@@ -2624,6 +3078,7 @@ const pivotColumnPercent = [
|
|
2624
3078
|
datasetPivot,
|
2625
3079
|
pivotIndicators([
|
2626
3080
|
initColumn,
|
3081
|
+
stackCornerRadius_stackCornerRadius,
|
2627
3082
|
stackInverse,
|
2628
3083
|
color_color,
|
2629
3084
|
percent,
|
@@ -2633,6 +3088,7 @@ const pivotColumnPercent = [
|
|
2633
3088
|
yLinear,
|
2634
3089
|
label_label,
|
2635
3090
|
tooltip_tooltip,
|
3091
|
+
verticalCrosshairRect,
|
2636
3092
|
barStyle_barStyle,
|
2637
3093
|
annotationPoint_annotationPoint,
|
2638
3094
|
annotationVerticalLine_annotationVerticalLine,
|
@@ -2648,6 +3104,7 @@ const columnPercentSpecPipeline = [
|
|
2648
3104
|
];
|
2649
3105
|
const bar = [
|
2650
3106
|
initBar,
|
3107
|
+
stackCornerRadius_stackCornerRadius,
|
2651
3108
|
color_color,
|
2652
3109
|
background_backgroundColor,
|
2653
3110
|
dataset_dataset,
|
@@ -2655,6 +3112,7 @@ const bar = [
|
|
2655
3112
|
yBand,
|
2656
3113
|
label_label,
|
2657
3114
|
tooltip_tooltip,
|
3115
|
+
horizontalCrosshairRect,
|
2658
3116
|
discreteLegend,
|
2659
3117
|
barStyle_barStyle,
|
2660
3118
|
annotationPoint_annotationPoint,
|
@@ -2669,6 +3127,7 @@ const pivotBar = [
|
|
2669
3127
|
datasetPivot,
|
2670
3128
|
pivotIndicators([
|
2671
3129
|
initBar,
|
3130
|
+
stackCornerRadius_stackCornerRadius,
|
2672
3131
|
color_color,
|
2673
3132
|
background_backgroundColor,
|
2674
3133
|
datasetPivotPlaceholder,
|
@@ -2676,6 +3135,7 @@ const pivotBar = [
|
|
2676
3135
|
label_label,
|
2677
3136
|
label_label,
|
2678
3137
|
tooltip_tooltip,
|
3138
|
+
horizontalCrosshairRect,
|
2679
3139
|
barStyle_barStyle,
|
2680
3140
|
annotationPoint_annotationPoint,
|
2681
3141
|
annotationVerticalLine_annotationVerticalLine,
|
@@ -2691,6 +3151,7 @@ const barSpecPipeline = [
|
|
2691
3151
|
];
|
2692
3152
|
const barParallel = [
|
2693
3153
|
initBarParallel,
|
3154
|
+
stackCornerRadius_stackCornerRadius,
|
2694
3155
|
color_color,
|
2695
3156
|
background_backgroundColor,
|
2696
3157
|
dataset_dataset,
|
@@ -2698,6 +3159,7 @@ const barParallel = [
|
|
2698
3159
|
yBand,
|
2699
3160
|
label_label,
|
2700
3161
|
tooltip_tooltip,
|
3162
|
+
horizontalCrosshairRect,
|
2701
3163
|
discreteLegend,
|
2702
3164
|
barStyle_barStyle,
|
2703
3165
|
annotationPoint_annotationPoint,
|
@@ -2712,6 +3174,7 @@ const pivotBarParallel = [
|
|
2712
3174
|
datasetPivot,
|
2713
3175
|
pivotIndicators([
|
2714
3176
|
initBarParallel,
|
3177
|
+
stackCornerRadius_stackCornerRadius,
|
2715
3178
|
color_color,
|
2716
3179
|
background_backgroundColor,
|
2717
3180
|
datasetPivotPlaceholder,
|
@@ -2719,6 +3182,7 @@ const pivotBarParallel = [
|
|
2719
3182
|
xLinear,
|
2720
3183
|
label_label,
|
2721
3184
|
tooltip_tooltip,
|
3185
|
+
horizontalCrosshairRect,
|
2722
3186
|
barStyle_barStyle,
|
2723
3187
|
annotationPoint_annotationPoint,
|
2724
3188
|
annotationVerticalLine_annotationVerticalLine,
|
@@ -2734,6 +3198,7 @@ const barParallelSpecPipeline = [
|
|
2734
3198
|
];
|
2735
3199
|
const barPercent = [
|
2736
3200
|
initBar,
|
3201
|
+
stackCornerRadius_stackCornerRadius,
|
2737
3202
|
color_color,
|
2738
3203
|
background_backgroundColor,
|
2739
3204
|
percent,
|
@@ -2742,6 +3207,7 @@ const barPercent = [
|
|
2742
3207
|
yBand,
|
2743
3208
|
label_label,
|
2744
3209
|
tooltip_tooltip,
|
3210
|
+
horizontalCrosshairRect,
|
2745
3211
|
discreteLegend,
|
2746
3212
|
barStyle_barStyle,
|
2747
3213
|
annotationPoint_annotationPoint,
|
@@ -2756,6 +3222,7 @@ const pivotBarPercent = [
|
|
2756
3222
|
datasetPivot,
|
2757
3223
|
pivotIndicators([
|
2758
3224
|
initBar,
|
3225
|
+
stackCornerRadius_stackCornerRadius,
|
2759
3226
|
color_color,
|
2760
3227
|
background_backgroundColor,
|
2761
3228
|
percent,
|
@@ -2764,6 +3231,7 @@ const pivotBarPercent = [
|
|
2764
3231
|
xLinear,
|
2765
3232
|
label_label,
|
2766
3233
|
tooltip_tooltip,
|
3234
|
+
horizontalCrosshairRect,
|
2767
3235
|
barStyle_barStyle,
|
2768
3236
|
annotationPoint_annotationPoint,
|
2769
3237
|
annotationVerticalLine_annotationVerticalLine,
|
@@ -2787,7 +3255,11 @@ const area_area = [
|
|
2787
3255
|
yLinear,
|
2788
3256
|
label_label,
|
2789
3257
|
tooltip_tooltip,
|
3258
|
+
verticalCrosshairLine,
|
2790
3259
|
discreteLegend,
|
3260
|
+
pointStyle_pointStyle,
|
3261
|
+
lineStyle_lineStyle,
|
3262
|
+
areaStyle_areaStyle,
|
2791
3263
|
annotationPoint_annotationPoint,
|
2792
3264
|
annotationVerticalLine_annotationVerticalLine,
|
2793
3265
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -2808,6 +3280,10 @@ const pivotArea = [
|
|
2808
3280
|
yLinear,
|
2809
3281
|
label_label,
|
2810
3282
|
tooltip_tooltip,
|
3283
|
+
verticalCrosshairLine,
|
3284
|
+
pointStyle_pointStyle,
|
3285
|
+
lineStyle_lineStyle,
|
3286
|
+
areaStyle_areaStyle,
|
2811
3287
|
annotationPoint_annotationPoint,
|
2812
3288
|
annotationVerticalLine_annotationVerticalLine,
|
2813
3289
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -2831,7 +3307,11 @@ const areaPercent = [
|
|
2831
3307
|
yLinear,
|
2832
3308
|
label_label,
|
2833
3309
|
tooltip_tooltip,
|
3310
|
+
verticalCrosshairLine,
|
2834
3311
|
discreteLegend,
|
3312
|
+
pointStyle_pointStyle,
|
3313
|
+
lineStyle_lineStyle,
|
3314
|
+
areaStyle_areaStyle,
|
2835
3315
|
annotationPoint_annotationPoint,
|
2836
3316
|
annotationVerticalLine_annotationVerticalLine,
|
2837
3317
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -2853,6 +3333,10 @@ const pivotAreaPercent = [
|
|
2853
3333
|
yLinear,
|
2854
3334
|
label_label,
|
2855
3335
|
tooltip_tooltip,
|
3336
|
+
verticalCrosshairLine,
|
3337
|
+
pointStyle_pointStyle,
|
3338
|
+
lineStyle_lineStyle,
|
3339
|
+
areaStyle_areaStyle,
|
2856
3340
|
annotationPoint_annotationPoint,
|
2857
3341
|
annotationVerticalLine_annotationVerticalLine,
|
2858
3342
|
annotationHorizontalLine_annotationHorizontalLine,
|
@@ -3059,7 +3543,7 @@ const darkTheme = ()=>{
|
|
3059
3543
|
labelAutoHideGap: 4,
|
3060
3544
|
labelAutoLimit: true,
|
3061
3545
|
labelAutoLimitLength: 100,
|
3062
|
-
labelAutoRotate:
|
3546
|
+
labelAutoRotate: false,
|
3063
3547
|
labelAutoRotateAngleRange: [
|
3064
3548
|
0,
|
3065
3549
|
-45,
|
@@ -3096,6 +3580,33 @@ const darkTheme = ()=>{
|
|
3096
3580
|
lineWidth: 1
|
3097
3581
|
}
|
3098
3582
|
};
|
3583
|
+
const barBandAxis = {
|
3584
|
+
...bandAxis,
|
3585
|
+
labelAutoHide: false,
|
3586
|
+
labelAutoHideGap: 1,
|
3587
|
+
labelAutoLimit: false,
|
3588
|
+
labelAutoLimitLength: void 0,
|
3589
|
+
labelAutoRotate: false,
|
3590
|
+
labelAutoRotateAngleRange: [
|
3591
|
+
0,
|
3592
|
+
-45,
|
3593
|
+
-90
|
3594
|
+
]
|
3595
|
+
};
|
3596
|
+
const crosshairLine = {
|
3597
|
+
visible: true,
|
3598
|
+
labelVisible: true,
|
3599
|
+
lineColor: '#E2E3E6',
|
3600
|
+
labelColor: '#4B4F54',
|
3601
|
+
labelBackgroundColor: '#ffffff'
|
3602
|
+
};
|
3603
|
+
const crosshairRect = {
|
3604
|
+
visible: true,
|
3605
|
+
labelVisible: true,
|
3606
|
+
lineColor: '#E2E3E6',
|
3607
|
+
labelColor: '#4B4F54',
|
3608
|
+
labelBackgroundColor: '#ffffff'
|
3609
|
+
};
|
3099
3610
|
return {
|
3100
3611
|
baseConfig: {
|
3101
3612
|
vtable: {
|
@@ -3138,39 +3649,84 @@ const darkTheme = ()=>{
|
|
3138
3649
|
config: {
|
3139
3650
|
line: {
|
3140
3651
|
xAxis: bandAxis,
|
3141
|
-
yAxis: linearAxis
|
3652
|
+
yAxis: linearAxis,
|
3653
|
+
crosshairLine: crosshairLine
|
3142
3654
|
},
|
3143
3655
|
column: {
|
3144
3656
|
xAxis: bandAxis,
|
3145
|
-
yAxis: linearAxis
|
3657
|
+
yAxis: linearAxis,
|
3658
|
+
crosshairRect: crosshairRect,
|
3659
|
+
stackCornerRadius: [
|
3660
|
+
4,
|
3661
|
+
4,
|
3662
|
+
0,
|
3663
|
+
0
|
3664
|
+
]
|
3146
3665
|
},
|
3147
3666
|
columnParallel: {
|
3148
3667
|
xAxis: bandAxis,
|
3149
|
-
yAxis: linearAxis
|
3668
|
+
yAxis: linearAxis,
|
3669
|
+
crosshairRect: crosshairRect,
|
3670
|
+
stackCornerRadius: [
|
3671
|
+
4,
|
3672
|
+
4,
|
3673
|
+
0,
|
3674
|
+
0
|
3675
|
+
]
|
3150
3676
|
},
|
3151
3677
|
columnPercent: {
|
3152
3678
|
xAxis: bandAxis,
|
3153
|
-
yAxis: linearAxis
|
3679
|
+
yAxis: linearAxis,
|
3680
|
+
crosshairRect: crosshairRect,
|
3681
|
+
stackCornerRadius: [
|
3682
|
+
4,
|
3683
|
+
4,
|
3684
|
+
0,
|
3685
|
+
0
|
3686
|
+
]
|
3154
3687
|
},
|
3155
3688
|
bar: {
|
3156
3689
|
xAxis: linearAxis,
|
3157
|
-
yAxis:
|
3690
|
+
yAxis: barBandAxis,
|
3691
|
+
crosshairRect: crosshairRect,
|
3692
|
+
stackCornerRadius: [
|
3693
|
+
0,
|
3694
|
+
4,
|
3695
|
+
4,
|
3696
|
+
0
|
3697
|
+
]
|
3158
3698
|
},
|
3159
3699
|
barParallel: {
|
3160
3700
|
xAxis: linearAxis,
|
3161
|
-
yAxis:
|
3701
|
+
yAxis: barBandAxis,
|
3702
|
+
crosshairRect: crosshairRect,
|
3703
|
+
stackCornerRadius: [
|
3704
|
+
0,
|
3705
|
+
4,
|
3706
|
+
4,
|
3707
|
+
0
|
3708
|
+
]
|
3162
3709
|
},
|
3163
3710
|
barPercent: {
|
3164
3711
|
xAxis: linearAxis,
|
3165
|
-
yAxis:
|
3712
|
+
yAxis: barBandAxis,
|
3713
|
+
crosshairRect: crosshairRect,
|
3714
|
+
stackCornerRadius: [
|
3715
|
+
0,
|
3716
|
+
4,
|
3717
|
+
4,
|
3718
|
+
0
|
3719
|
+
]
|
3166
3720
|
},
|
3167
3721
|
area: {
|
3168
3722
|
xAxis: bandAxis,
|
3169
|
-
yAxis: linearAxis
|
3723
|
+
yAxis: linearAxis,
|
3724
|
+
crosshairLine: crosshairLine
|
3170
3725
|
},
|
3171
3726
|
areaPercent: {
|
3172
3727
|
xAxis: bandAxis,
|
3173
|
-
yAxis: linearAxis
|
3728
|
+
yAxis: linearAxis,
|
3729
|
+
crosshairLine: crosshairLine
|
3174
3730
|
}
|
3175
3731
|
}
|
3176
3732
|
};
|
@@ -3216,7 +3772,7 @@ const lightTheme = ()=>{
|
|
3216
3772
|
labelAutoHideGap: 4,
|
3217
3773
|
labelAutoLimit: true,
|
3218
3774
|
labelAutoLimitLength: 100,
|
3219
|
-
labelAutoRotate:
|
3775
|
+
labelAutoRotate: false,
|
3220
3776
|
labelAutoRotateAngleRange: [
|
3221
3777
|
0,
|
3222
3778
|
-45,
|
@@ -3266,6 +3822,20 @@ const lightTheme = ()=>{
|
|
3266
3822
|
-90
|
3267
3823
|
]
|
3268
3824
|
};
|
3825
|
+
const crosshairLine = {
|
3826
|
+
visible: true,
|
3827
|
+
labelVisible: true,
|
3828
|
+
lineColor: '#3641594d',
|
3829
|
+
labelColor: '#ffffff',
|
3830
|
+
labelBackgroundColor: '#364159'
|
3831
|
+
};
|
3832
|
+
const crosshairRect = {
|
3833
|
+
visible: true,
|
3834
|
+
labelVisible: true,
|
3835
|
+
rectColor: '#3641594d',
|
3836
|
+
labelColor: '#ffffff',
|
3837
|
+
labelBackgroundColor: '#364159'
|
3838
|
+
};
|
3269
3839
|
return {
|
3270
3840
|
baseConfig: {
|
3271
3841
|
vtable: {
|
@@ -3308,45 +3878,94 @@ const lightTheme = ()=>{
|
|
3308
3878
|
config: {
|
3309
3879
|
line: {
|
3310
3880
|
xAxis: bandAxis,
|
3311
|
-
yAxis: linearAxis
|
3881
|
+
yAxis: linearAxis,
|
3882
|
+
crosshairLine
|
3312
3883
|
},
|
3313
3884
|
column: {
|
3314
3885
|
xAxis: bandAxis,
|
3315
|
-
yAxis: linearAxis
|
3886
|
+
yAxis: linearAxis,
|
3887
|
+
crosshairRect,
|
3888
|
+
stackCornerRadius: [
|
3889
|
+
4,
|
3890
|
+
4,
|
3891
|
+
0,
|
3892
|
+
0
|
3893
|
+
]
|
3316
3894
|
},
|
3317
3895
|
columnParallel: {
|
3318
3896
|
xAxis: bandAxis,
|
3319
|
-
yAxis: linearAxis
|
3897
|
+
yAxis: linearAxis,
|
3898
|
+
crosshairRect,
|
3899
|
+
stackCornerRadius: [
|
3900
|
+
4,
|
3901
|
+
4,
|
3902
|
+
0,
|
3903
|
+
0
|
3904
|
+
]
|
3320
3905
|
},
|
3321
3906
|
columnPercent: {
|
3322
3907
|
xAxis: bandAxis,
|
3323
|
-
yAxis: linearAxis
|
3908
|
+
yAxis: linearAxis,
|
3909
|
+
crosshairRect,
|
3910
|
+
stackCornerRadius: [
|
3911
|
+
4,
|
3912
|
+
4,
|
3913
|
+
0,
|
3914
|
+
0
|
3915
|
+
]
|
3324
3916
|
},
|
3325
3917
|
bar: {
|
3326
3918
|
xAxis: linearAxis,
|
3327
|
-
yAxis: barBandAxis
|
3919
|
+
yAxis: barBandAxis,
|
3920
|
+
crosshairRect,
|
3921
|
+
stackCornerRadius: [
|
3922
|
+
0,
|
3923
|
+
4,
|
3924
|
+
4,
|
3925
|
+
0
|
3926
|
+
]
|
3328
3927
|
},
|
3329
3928
|
barParallel: {
|
3330
3929
|
xAxis: linearAxis,
|
3331
|
-
yAxis: barBandAxis
|
3930
|
+
yAxis: barBandAxis,
|
3931
|
+
crosshairRect,
|
3932
|
+
stackCornerRadius: [
|
3933
|
+
0,
|
3934
|
+
4,
|
3935
|
+
4,
|
3936
|
+
0
|
3937
|
+
]
|
3332
3938
|
},
|
3333
3939
|
barPercent: {
|
3334
3940
|
xAxis: linearAxis,
|
3335
|
-
yAxis: barBandAxis
|
3941
|
+
yAxis: barBandAxis,
|
3942
|
+
crosshairRect,
|
3943
|
+
stackCornerRadius: [
|
3944
|
+
0,
|
3945
|
+
4,
|
3946
|
+
4,
|
3947
|
+
0
|
3948
|
+
]
|
3336
3949
|
},
|
3337
3950
|
area: {
|
3338
3951
|
xAxis: bandAxis,
|
3339
|
-
yAxis: linearAxis
|
3952
|
+
yAxis: linearAxis,
|
3953
|
+
crosshairLine
|
3340
3954
|
},
|
3341
3955
|
areaPercent: {
|
3342
3956
|
xAxis: bandAxis,
|
3343
|
-
yAxis: linearAxis
|
3957
|
+
yAxis: linearAxis,
|
3958
|
+
crosshairLine
|
3344
3959
|
}
|
3345
3960
|
}
|
3346
3961
|
};
|
3347
3962
|
};
|
3348
3963
|
const registerCustomTheme = (key, themeConfig)=>{
|
3349
|
-
|
3964
|
+
const customTheme = 'function' == typeof themeConfig ? themeConfig({
|
3965
|
+
lightTheme: lightTheme(),
|
3966
|
+
darkTheme: darkTheme()
|
3967
|
+
}) : themeConfig;
|
3968
|
+
Builder._themeMap[key] = customTheme;
|
3350
3969
|
};
|
3351
3970
|
const registerLightTheme = ()=>{
|
3352
3971
|
registerCustomTheme('light', lightTheme());
|
@@ -3398,29 +4017,30 @@ const zDimension = z.object({
|
|
3398
4017
|
])
|
3399
4018
|
});
|
3400
4019
|
const zDimensions = z.array(zDimension).optional();
|
4020
|
+
const zNumFormat = z.object({
|
4021
|
+
type: z["enum"]([
|
4022
|
+
'number',
|
4023
|
+
'percent',
|
4024
|
+
'permille'
|
4025
|
+
]).default('number').optional(),
|
4026
|
+
ratio: z.number().default(1).optional(),
|
4027
|
+
symbol: z.string().default('').optional(),
|
4028
|
+
thousandSeparator: z.boolean().default(false).optional(),
|
4029
|
+
decimalPlaces: z.number().default(2).optional(),
|
4030
|
+
round: z["enum"]([
|
4031
|
+
'round',
|
4032
|
+
'floor',
|
4033
|
+
'ceil'
|
4034
|
+
]).default('round').optional(),
|
4035
|
+
prefix: z.string().default('').optional(),
|
4036
|
+
suffix: z.string().default('').optional()
|
4037
|
+
}).optional();
|
3401
4038
|
const zMeasure = z.object({
|
3402
4039
|
id: z.string(),
|
3403
4040
|
alias: z.string().optional(),
|
3404
4041
|
visible: z.boolean().default(true).optional(),
|
3405
4042
|
autoFormat: z.boolean().default(true).optional(),
|
3406
|
-
format:
|
3407
|
-
type: z["enum"]([
|
3408
|
-
'number',
|
3409
|
-
'percent',
|
3410
|
-
'permille'
|
3411
|
-
]).optional().default('number'),
|
3412
|
-
ratio: z.number().optional().default(1),
|
3413
|
-
symbol: z.string().optional().default(''),
|
3414
|
-
thousandSeparator: z.boolean().optional().default(false),
|
3415
|
-
decimalPlaces: z.number().optional().default(2),
|
3416
|
-
round: z["enum"]([
|
3417
|
-
'round',
|
3418
|
-
'floor',
|
3419
|
-
'ceil'
|
3420
|
-
]).optional().default('round'),
|
3421
|
-
prefix: z.string().optional().default(''),
|
3422
|
-
suffix: z.string().optional().default('')
|
3423
|
-
}).optional()
|
4043
|
+
format: zNumFormat.optional()
|
3424
4044
|
});
|
3425
4045
|
const zMeasureGroup = z.object({
|
3426
4046
|
id: z.string(),
|
@@ -3665,42 +4285,77 @@ const zXLinearAxis = z.object({
|
|
3665
4285
|
}).optional()
|
3666
4286
|
});
|
3667
4287
|
const zYLinearAxis = zXLinearAxis;
|
4288
|
+
const zCrosshairLine = z.object({
|
4289
|
+
visible: z.boolean().optional(),
|
4290
|
+
lineColor: z.string().optional(),
|
4291
|
+
labelColor: z.string().optional(),
|
4292
|
+
labelVisible: z.boolean().optional(),
|
4293
|
+
labelBackgroundColor: z.string().optional()
|
4294
|
+
});
|
4295
|
+
const zCrosshairRect = z.object({
|
4296
|
+
visible: z.boolean().optional(),
|
4297
|
+
rectColor: z.string().optional(),
|
4298
|
+
labelColor: z.string().optional(),
|
4299
|
+
labelVisible: z.boolean().optional(),
|
4300
|
+
labelBackgroundColor: z.string().optional()
|
4301
|
+
});
|
4302
|
+
const zStackCornerRadius = z.number().or(z.array(z.number())).default([
|
4303
|
+
3,
|
4304
|
+
3,
|
4305
|
+
0,
|
4306
|
+
0
|
4307
|
+
]);
|
3668
4308
|
const zConfig = z.object({
|
3669
4309
|
line: z.object({
|
3670
|
-
xAxis: zXBandAxis,
|
3671
|
-
yAxis: zYLinearAxis
|
4310
|
+
xAxis: zXBandAxis.optional(),
|
4311
|
+
yAxis: zYLinearAxis.optional(),
|
4312
|
+
crosshairLine: zCrosshairLine.optional()
|
3672
4313
|
}).optional(),
|
3673
4314
|
column: z.object({
|
3674
|
-
xAxis: zXBandAxis,
|
3675
|
-
yAxis: zYLinearAxis
|
4315
|
+
xAxis: zXBandAxis.optional(),
|
4316
|
+
yAxis: zYLinearAxis.optional(),
|
4317
|
+
crosshairRect: zCrosshairRect.optional(),
|
4318
|
+
stackCornerRadius: zStackCornerRadius.optional()
|
3676
4319
|
}).optional(),
|
3677
4320
|
columnParallel: z.object({
|
3678
|
-
xAxis: zXBandAxis,
|
3679
|
-
yAxis: zYLinearAxis
|
4321
|
+
xAxis: zXBandAxis.optional(),
|
4322
|
+
yAxis: zYLinearAxis.optional(),
|
4323
|
+
crosshairRect: zCrosshairRect.optional(),
|
4324
|
+
stackCornerRadius: zStackCornerRadius.optional()
|
3680
4325
|
}).optional(),
|
3681
4326
|
columnPercent: z.object({
|
3682
|
-
xAxis: zXBandAxis,
|
3683
|
-
yAxis: zYLinearAxis
|
4327
|
+
xAxis: zXBandAxis.optional(),
|
4328
|
+
yAxis: zYLinearAxis.optional(),
|
4329
|
+
crosshairRect: zCrosshairRect.optional(),
|
4330
|
+
stackCornerRadius: zStackCornerRadius.optional()
|
3684
4331
|
}).optional(),
|
3685
4332
|
bar: z.object({
|
3686
|
-
xAxis: zXLinearAxis,
|
3687
|
-
yAxis: zYBandAxis
|
4333
|
+
xAxis: zXLinearAxis.optional(),
|
4334
|
+
yAxis: zYBandAxis.optional(),
|
4335
|
+
crosshairRect: zCrosshairRect.optional(),
|
4336
|
+
stackCornerRadius: zStackCornerRadius.optional()
|
3688
4337
|
}).optional(),
|
3689
4338
|
barParallel: z.object({
|
3690
|
-
xAxis: zXLinearAxis,
|
3691
|
-
yAxis: zYBandAxis
|
4339
|
+
xAxis: zXLinearAxis.optional(),
|
4340
|
+
yAxis: zYBandAxis.optional(),
|
4341
|
+
crosshairRect: zCrosshairRect.optional(),
|
4342
|
+
stackCornerRadius: zStackCornerRadius.optional()
|
3692
4343
|
}).optional(),
|
3693
4344
|
barPercent: z.object({
|
3694
|
-
xAxis: zXLinearAxis,
|
3695
|
-
yAxis: zYBandAxis
|
4345
|
+
xAxis: zXLinearAxis.optional(),
|
4346
|
+
yAxis: zYBandAxis.optional(),
|
4347
|
+
crosshairRect: zCrosshairRect.optional(),
|
4348
|
+
stackCornerRadius: zStackCornerRadius.optional()
|
3696
4349
|
}).optional(),
|
3697
4350
|
area: z.object({
|
3698
|
-
xAxis: zXBandAxis,
|
3699
|
-
yAxis: zYLinearAxis
|
4351
|
+
xAxis: zXBandAxis.optional(),
|
4352
|
+
yAxis: zYLinearAxis.optional(),
|
4353
|
+
crosshairLine: zCrosshairLine.optional()
|
3700
4354
|
}).optional(),
|
3701
4355
|
areaPercent: z.object({
|
3702
|
-
xAxis: zXBandAxis,
|
3703
|
-
yAxis: zYLinearAxis
|
4356
|
+
xAxis: zXBandAxis.optional(),
|
4357
|
+
yAxis: zYLinearAxis.optional(),
|
4358
|
+
crosshairLine: zCrosshairLine.optional()
|
3704
4359
|
}).optional(),
|
3705
4360
|
pie: z.object({}).optional(),
|
3706
4361
|
donut: z.object({}).optional(),
|
@@ -3709,12 +4364,6 @@ const zConfig = z.object({
|
|
3709
4364
|
table: z.object({}).optional(),
|
3710
4365
|
pivotTable: z.object({}).optional()
|
3711
4366
|
});
|
3712
|
-
const zCustomThemeConfig = z.object({
|
3713
|
-
baseConfig: zBaseConfig.optional(),
|
3714
|
-
config: zConfig.optional()
|
3715
|
-
});
|
3716
|
-
const zCustomTheme = z.record(z.string(), zCustomThemeConfig).optional();
|
3717
|
-
const zTheme = z.string();
|
3718
4367
|
const zSelector = z.union([
|
3719
4368
|
z.string(),
|
3720
4369
|
z.number(),
|
@@ -3770,28 +4419,6 @@ const zSelector = z.union([
|
|
3770
4419
|
})
|
3771
4420
|
]);
|
3772
4421
|
const zSelectors = z.array(zSelector);
|
3773
|
-
const zBarStyle = z.object({
|
3774
|
-
selector: z.union([
|
3775
|
-
zSelector,
|
3776
|
-
zSelectors
|
3777
|
-
]).optional(),
|
3778
|
-
barColor: z.string().optional(),
|
3779
|
-
barColorOpacity: z.number().optional(),
|
3780
|
-
barBorderColor: z.string().optional(),
|
3781
|
-
barBorderWidth: z.number().optional(),
|
3782
|
-
barBorderStyle: z.union([
|
3783
|
-
z.literal('solid'),
|
3784
|
-
z.literal('dashed'),
|
3785
|
-
z.literal('dotted')
|
3786
|
-
]).optional(),
|
3787
|
-
barRadius: z.union([
|
3788
|
-
z.number(),
|
3789
|
-
z.array(z.number())
|
3790
|
-
]).optional()
|
3791
|
-
});
|
3792
|
-
const zMarkStyle = z.object({
|
3793
|
-
barStyle: zBarStyle.optional()
|
3794
|
-
});
|
3795
4422
|
const zAnnotationPoint = z.object({
|
3796
4423
|
selector: z.union([
|
3797
4424
|
zSelector,
|
@@ -3972,6 +4599,82 @@ const zAnnotation = z.object({
|
|
3972
4599
|
annotationHorizontalLine: zAnnotationHorizontalLine.or(z.array(zAnnotationHorizontalLine)).optional(),
|
3973
4600
|
annotationArea: zAnnotationArea.or(z.array(zAnnotationArea)).optional()
|
3974
4601
|
});
|
3975
|
-
|
4602
|
+
const zBarStyle = z.object({
|
4603
|
+
selector: z.union([
|
4604
|
+
zSelector,
|
4605
|
+
zSelectors
|
4606
|
+
]).optional(),
|
4607
|
+
barColor: z.string().optional(),
|
4608
|
+
barColorOpacity: z.number().optional(),
|
4609
|
+
barBorderColor: z.string().optional(),
|
4610
|
+
barBorderWidth: z.number().optional(),
|
4611
|
+
barBorderStyle: z.union([
|
4612
|
+
z.literal('solid'),
|
4613
|
+
z.literal('dashed'),
|
4614
|
+
z.literal('dotted')
|
4615
|
+
]).optional(),
|
4616
|
+
barRadius: z.union([
|
4617
|
+
z.number(),
|
4618
|
+
z.array(z.number())
|
4619
|
+
]).optional()
|
4620
|
+
});
|
4621
|
+
const zPointStyle = z.object({
|
4622
|
+
selector: z.union([
|
4623
|
+
zSelector,
|
4624
|
+
zSelectors
|
4625
|
+
]).optional(),
|
4626
|
+
pointSize: z.number().optional(),
|
4627
|
+
pointColor: z.string().optional(),
|
4628
|
+
pointColorOpacity: z.number().optional(),
|
4629
|
+
pointBorderColor: z.string().optional(),
|
4630
|
+
pointBorderWidth: z.number().optional(),
|
4631
|
+
pointBorderStyle: z.union([
|
4632
|
+
z["enum"]([
|
4633
|
+
'solid',
|
4634
|
+
'dashed',
|
4635
|
+
'dotted'
|
4636
|
+
])
|
4637
|
+
]).optional()
|
4638
|
+
});
|
4639
|
+
const zLineStyle = z.object({
|
4640
|
+
selector: z.union([
|
4641
|
+
zSelector,
|
4642
|
+
zSelectors
|
4643
|
+
]).optional(),
|
4644
|
+
lineSmooth: z.boolean().default(true).optional(),
|
4645
|
+
lineColor: z.string().optional(),
|
4646
|
+
lineColorOpacity: z.number().optional(),
|
4647
|
+
lineWidth: z.number().optional(),
|
4648
|
+
lineStyle: z.union([
|
4649
|
+
z["enum"]([
|
4650
|
+
'solid',
|
4651
|
+
'dashed',
|
4652
|
+
'dotted'
|
4653
|
+
])
|
4654
|
+
]).optional()
|
4655
|
+
});
|
4656
|
+
const zAreaStyle = z.object({
|
4657
|
+
selector: z.union([
|
4658
|
+
zSelector,
|
4659
|
+
zSelectors
|
4660
|
+
]).optional(),
|
4661
|
+
areaColor: z.string().optional(),
|
4662
|
+
areaColorOpacity: z.number().optional()
|
4663
|
+
});
|
4664
|
+
const zMarkStyle = z.object({
|
4665
|
+
barStyle: zBarStyle.or(z.array(zBarStyle)).optional(),
|
4666
|
+
pointStyle: zPointStyle.or(z.array(zPointStyle)).optional(),
|
4667
|
+
lineStyle: zLineStyle.or(z.array(zLineStyle)).optional(),
|
4668
|
+
areaStyle: zAreaStyle.or(z.array(zAreaStyle)).optional()
|
4669
|
+
});
|
4670
|
+
const zCustomThemeConfig = z.object({
|
4671
|
+
baseConfig: zBaseConfig.optional(),
|
4672
|
+
config: zConfig.optional(),
|
4673
|
+
annotation: zAnnotation.optional(),
|
4674
|
+
markStyle: zMarkStyle.optional()
|
4675
|
+
});
|
4676
|
+
const zCustomTheme = z.record(z.string(), zCustomThemeConfig).optional();
|
4677
|
+
const zTheme = z.string();
|
4678
|
+
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, createFormatter, createNumFormatter, darkTheme, dataReshapeFor1D1M, dataReshapeFor2D1M, execPipeline, findMeasureById, 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, zAnnotation, zAnnotationArea, zAnnotationHorizontalLine, zAnnotationPoint, zAnnotationVerticalLine, zAreaStyle, zAxis, zBackgroundColor, zBarStyle, zBaseConfig, zChartType, zColor, zConfig, zCrosshairLine, zCrosshairRect, zCustomTheme, zCustomThemeConfig, zDataset, zDatasetReshapeInfo, zDatum, zDimension, zDimensions, zEncoding, zFoldInfo, zLabel, zLegend, zLineStyle, zMarkStyle, zMeasure, zMeasureGroup, zMeasures, zNumFormat, zPointStyle, zStackCornerRadius, zTheme, zTooltip, zUnfoldInfo, zXBandAxis, zXLinearAxis, zYBandAxis, zYLinearAxis };
|
3976
4679
|
|
3977
4680
|
//# sourceMappingURL=index.js.map
|