@visactor/vseed 0.0.10 → 0.0.11
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 +837 -39
- package/dist/index.cjs +753 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +742 -41
- package/dist/index.js.map +1 -1
- package/dist/pipeline/spec/pipes/annotation/annotationArea.d.ts +2 -0
- package/dist/pipeline/spec/pipes/annotation/annotationAreaBand.d.ts +2 -0
- package/dist/pipeline/spec/pipes/annotation/annotationHorizontalLine.d.ts +2 -0
- package/dist/pipeline/spec/pipes/annotation/annotationVerticalLine.d.ts +2 -0
- package/dist/pipeline/spec/pipes/annotation/index.d.ts +4 -0
- package/dist/pipeline/spec/pipes/annotation/utils.d.ts +2 -0
- package/dist/types/advancedVSeed.d.ts +803 -12
- package/dist/types/builder/builder.d.ts +3 -0
- package/dist/types/chartType/area/area.d.ts +16 -1
- package/dist/types/chartType/areaPercent/areaPercent.d.ts +16 -1
- package/dist/types/chartType/bar/bar.d.ts +16 -1
- package/dist/types/chartType/barParallel/barParallel.d.ts +16 -1
- package/dist/types/chartType/barPercent/barPercent.d.ts +16 -1
- package/dist/types/chartType/column/column.d.ts +16 -1
- package/dist/types/chartType/columnParallel/columnParallel.d.ts +16 -1
- package/dist/types/chartType/columnPercent/columnPercent.d.ts +16 -1
- package/dist/types/chartType/line/line.d.ts +16 -1
- package/dist/types/dataSelector/selector.d.ts +60 -6
- package/dist/types/properties/annotation/annotation.d.ts +747 -8
- package/dist/types/properties/annotation/annotationArea.d.ts +248 -0
- package/dist/types/properties/annotation/annotationHorizontalLine.d.ts +253 -0
- package/dist/types/properties/annotation/annotationPoint.d.ts +56 -4
- package/dist/types/properties/annotation/annotationVerticalLine.d.ts +253 -0
- package/dist/types/properties/annotation/index.d.ts +3 -0
- package/dist/types/properties/markStyle/barStyle.d.ts +56 -4
- package/dist/types/properties/markStyle/markStyle.d.ts +56 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -26,7 +26,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
27
27
|
registerBar: ()=>registerBar,
|
28
28
|
isVChart: ()=>isVChart,
|
29
|
-
|
29
|
+
zBaseConfig: ()=>zBaseConfig,
|
30
30
|
pieAdvancedPipeline: ()=>pieAdvancedPipeline,
|
31
31
|
execPipeline: ()=>execPipeline,
|
32
32
|
areaSpecPipeline: ()=>areaSpecPipeline,
|
@@ -48,8 +48,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
48
48
|
zFoldInfo: ()=>zFoldInfo,
|
49
49
|
zYBandAxis: ()=>zYBandAxis,
|
50
50
|
ORIGINAL_DATA: ()=>ORIGINAL_DATA,
|
51
|
-
|
51
|
+
zAnnotationHorizontalLine: ()=>zAnnotationHorizontalLine,
|
52
|
+
zAnnotationArea: ()=>zAnnotationArea,
|
52
53
|
zMarkStyle: ()=>zMarkStyle,
|
54
|
+
zYLinearAxis: ()=>zYLinearAxis,
|
53
55
|
Separator: ()=>Separator,
|
54
56
|
columnAdvancedPipeline: ()=>columnAdvancedPipeline,
|
55
57
|
columnParallelSpecPipeline: ()=>columnParallelSpecPipeline,
|
@@ -88,8 +90,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
88
90
|
foldMeasures: ()=>foldMeasures,
|
89
91
|
dataReshapeFor2D1M: ()=>dataReshapeFor2D1M,
|
90
92
|
registerLightTheme: ()=>registerLightTheme,
|
93
|
+
zAnnotationVerticalLine: ()=>zAnnotationVerticalLine,
|
91
94
|
registerDarkTheme: ()=>registerDarkTheme,
|
92
|
-
zChartType: ()=>zChartType,
|
93
95
|
barParallelAdvancedPipeline: ()=>barParallelAdvancedPipeline,
|
94
96
|
FoldMeasureValue: ()=>FoldMeasureValue,
|
95
97
|
barPercentSpecPipeline: ()=>barPercentSpecPipeline,
|
@@ -97,13 +99,14 @@ __webpack_require__.d(__webpack_exports__, {
|
|
97
99
|
pieSpecPipeline: ()=>pieSpecPipeline,
|
98
100
|
barSpecPipeline: ()=>barSpecPipeline,
|
99
101
|
lineSpecPipeline: ()=>lineSpecPipeline,
|
102
|
+
zChartType: ()=>zChartType,
|
100
103
|
zTooltip: ()=>zTooltip,
|
101
|
-
zBaseConfig: ()=>zBaseConfig,
|
102
104
|
unfoldDimensions: ()=>unfoldDimensions,
|
103
105
|
areaAdvancedPipeline: ()=>areaAdvancedPipeline,
|
104
106
|
areaPercentSpecPipeline: ()=>areaPercentSpecPipeline,
|
105
107
|
Builder: ()=>Builder,
|
106
108
|
barParallelSpecPipeline: ()=>barParallelSpecPipeline,
|
109
|
+
columnPercentSpecPipeline: ()=>columnPercentSpecPipeline,
|
107
110
|
registerAll: ()=>all_registerAll
|
108
111
|
});
|
109
112
|
const initAdvancedVSeed = (advancedVSeed, context)=>{
|
@@ -749,7 +752,10 @@ const markStyle_markStyle = (advancedVSeed, context)=>{
|
|
749
752
|
const annotation_annotation = (advancedVSeed, context)=>{
|
750
753
|
const { vseed } = context;
|
751
754
|
const annotation = (0, external_remeda_namespaceObject.pick)(vseed, [
|
752
|
-
'annotationPoint'
|
755
|
+
'annotationPoint',
|
756
|
+
'annotationHorizontalLine',
|
757
|
+
'annotationVerticalLine',
|
758
|
+
'annotationArea'
|
753
759
|
]);
|
754
760
|
return {
|
755
761
|
...advancedVSeed,
|
@@ -1939,11 +1945,13 @@ const selector_selector = (datum, selector)=>{
|
|
1939
1945
|
for (const selector of selectors)if (isValueSelector(selector)) {
|
1940
1946
|
if (Object.values(datum).find((v)=>v === selector)) return true;
|
1941
1947
|
} else if (isMeasureSelector(selector)) {
|
1948
|
+
const op = selector.operator || selector.op;
|
1942
1949
|
const selectorValueArr = Array.isArray(selector.value) ? selector.value : [
|
1943
1950
|
selector.value
|
1944
1951
|
];
|
1945
|
-
switch(
|
1952
|
+
switch(op){
|
1946
1953
|
case '=':
|
1954
|
+
case '==':
|
1947
1955
|
if (datum[selector.field] === selectorValueArr[0]) return true;
|
1948
1956
|
break;
|
1949
1957
|
case '!=':
|
@@ -1968,11 +1976,20 @@ const selector_selector = (datum, selector)=>{
|
|
1968
1976
|
break;
|
1969
1977
|
}
|
1970
1978
|
} else if (isDimensionSelector(selector)) {
|
1979
|
+
const op = selector.operator || selector.op;
|
1971
1980
|
const selectorValueArr = Array.isArray(selector.value) ? selector.value : [
|
1972
1981
|
selector.value
|
1973
1982
|
];
|
1974
|
-
|
1975
|
-
|
1983
|
+
switch(op){
|
1984
|
+
case 'in':
|
1985
|
+
if (selectorValueArr.includes(datum[selector.field])) return true;
|
1986
|
+
break;
|
1987
|
+
case 'not in':
|
1988
|
+
if (!selectorValueArr.includes(datum[selector.field])) return true;
|
1989
|
+
break;
|
1990
|
+
default:
|
1991
|
+
break;
|
1992
|
+
}
|
1976
1993
|
} else if (isPartialDatumSelector(selector)) {
|
1977
1994
|
if (Object.keys(selector).every((key)=>datum[key] === selector[key])) return true;
|
1978
1995
|
}
|
@@ -1980,19 +1997,32 @@ const selector_selector = (datum, selector)=>{
|
|
1980
1997
|
};
|
1981
1998
|
const isValueSelector = (selector)=>'string' == typeof selector || 'number' == typeof selector;
|
1982
1999
|
const isPartialDatumSelector = (selector)=>'object' == typeof selector && null !== selector;
|
1983
|
-
const isMeasureSelector = (selector)=>'object' == typeof selector && null !== selector && 'field' in selector && 'operator' in selector && 'value' in selector && [
|
2000
|
+
const isMeasureSelector = (selector)=>'object' == typeof selector && null !== selector && 'field' in selector && ('operator' in selector || 'op' in selector) && 'value' in selector && ([
|
1984
2001
|
'=',
|
2002
|
+
'==',
|
1985
2003
|
'!=',
|
1986
2004
|
'>',
|
1987
2005
|
'<',
|
1988
2006
|
'>=',
|
1989
2007
|
'<=',
|
1990
2008
|
'between'
|
1991
|
-
].includes(selector.operator)
|
1992
|
-
|
2009
|
+
].includes(selector.operator) || [
|
2010
|
+
'=',
|
2011
|
+
'==',
|
2012
|
+
'!=',
|
2013
|
+
'>',
|
2014
|
+
'<',
|
2015
|
+
'>=',
|
2016
|
+
'<=',
|
2017
|
+
'between'
|
2018
|
+
].includes(selector.op));
|
2019
|
+
const isDimensionSelector = (selector)=>'object' == typeof selector && null !== selector && 'field' in selector && ('operator' in selector || 'op' in selector) && 'value' in selector && ([
|
2020
|
+
'in',
|
2021
|
+
'not in'
|
2022
|
+
].includes(selector.operator) || [
|
1993
2023
|
'in',
|
1994
2024
|
'not in'
|
1995
|
-
].includes(selector.
|
2025
|
+
].includes(selector.op));
|
1996
2026
|
const barStyle_barStyle = (spec, context)=>{
|
1997
2027
|
const { advancedVSeed } = context;
|
1998
2028
|
const { markStyle, encoding } = advancedVSeed;
|
@@ -2047,6 +2077,11 @@ const barStyle_barStyle = (spec, context)=>{
|
|
2047
2077
|
}
|
2048
2078
|
};
|
2049
2079
|
};
|
2080
|
+
const isSubset = (sub, obj)=>Object.entries(sub).every(([key, value])=>{
|
2081
|
+
if ('string' == typeof value) return obj[key] === value;
|
2082
|
+
if ('number' == typeof value) return obj[key] === value;
|
2083
|
+
return true;
|
2084
|
+
});
|
2050
2085
|
const annotationPoint_annotationPoint = (spec, context)=>{
|
2051
2086
|
const { advancedVSeed } = context;
|
2052
2087
|
const { annotation } = advancedVSeed;
|
@@ -2056,7 +2091,7 @@ const annotationPoint_annotationPoint = (spec, context)=>{
|
|
2056
2091
|
annotationPoint
|
2057
2092
|
];
|
2058
2093
|
const markPoint = annotationPointList.flatMap((annotationPoint)=>{
|
2059
|
-
const { selector: selectorPoint, text = '', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'middle', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding =
|
2094
|
+
const { selector: selectorPoint, text = '', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'middle', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true, offsetX = 0, offsetY = 0 } = annotationPoint;
|
2060
2095
|
const dataset = advancedVSeed.dataset.flat();
|
2061
2096
|
const selectedData = dataset.filter((datum)=>selector_selector(datum, selectorPoint));
|
2062
2097
|
return selectedData.map((datum)=>({
|
@@ -2112,11 +2147,439 @@ const annotationPoint_annotationPoint = (spec, context)=>{
|
|
2112
2147
|
markPoint
|
2113
2148
|
};
|
2114
2149
|
};
|
2115
|
-
const
|
2116
|
-
|
2117
|
-
|
2118
|
-
|
2150
|
+
const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
|
2151
|
+
const { advancedVSeed } = context;
|
2152
|
+
const { annotation, encoding } = advancedVSeed;
|
2153
|
+
if (!annotation || !annotation.annotationVerticalLine) return spec;
|
2154
|
+
const { annotationVerticalLine } = annotation;
|
2155
|
+
const annotationVerticalLineList = Array.isArray(annotationVerticalLine) ? annotationVerticalLine : [
|
2156
|
+
annotationVerticalLine
|
2157
|
+
];
|
2158
|
+
const positionMap = {
|
2159
|
+
outsideStart: 'start',
|
2160
|
+
outsideEnd: 'end',
|
2161
|
+
outsideMiddle: 'middle',
|
2162
|
+
insideStart: 'insideStartTop',
|
2163
|
+
insideMiddle: 'insideMiddleTop',
|
2164
|
+
insideEnd: 'insideEndTop'
|
2165
|
+
};
|
2166
|
+
const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
|
2167
|
+
const { selector: selectorPoint, xValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'right', textBaseline = 'top', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true, offsetX = 0, offsetY = 0, lineColor = '#212121', lineStyle = 'dashed', lineVisible = true, lineWidth = 1 } = annotationVerticalLine;
|
2168
|
+
const dataset = advancedVSeed.dataset.flat();
|
2169
|
+
const generateOneMarkLine = (x)=>({
|
2170
|
+
x: x,
|
2171
|
+
line: {
|
2172
|
+
visible: lineVisible,
|
2173
|
+
style: {
|
2174
|
+
offsetX,
|
2175
|
+
offsetY,
|
2176
|
+
stroke: lineColor,
|
2177
|
+
lineStyle: lineStyle,
|
2178
|
+
lineWidth: lineWidth,
|
2179
|
+
lineDash: 'dashed' === lineStyle ? [
|
2180
|
+
5,
|
2181
|
+
2
|
2182
|
+
] : 'dotted' === lineStyle ? [
|
2183
|
+
2,
|
2184
|
+
5
|
2185
|
+
] : [
|
2186
|
+
0
|
2187
|
+
]
|
2188
|
+
}
|
2189
|
+
},
|
2190
|
+
label: {
|
2191
|
+
text: text,
|
2192
|
+
position: positionMap[textPosition],
|
2193
|
+
style: {
|
2194
|
+
offsetX,
|
2195
|
+
offsetY,
|
2196
|
+
visible: true,
|
2197
|
+
textAlign: textAlign,
|
2198
|
+
textBaseline: textBaseline,
|
2199
|
+
fill: textColor,
|
2200
|
+
fontSize: textFontSize,
|
2201
|
+
fontWeight: textFontWeight
|
2202
|
+
},
|
2203
|
+
labelBackground: {
|
2204
|
+
visible: backgroundVisible,
|
2205
|
+
padding: backgroundPadding,
|
2206
|
+
style: {
|
2207
|
+
offsetX,
|
2208
|
+
offsetY,
|
2209
|
+
cornerRadius: backgroundBorderRadius ?? 4,
|
2210
|
+
fill: backgroundColor,
|
2211
|
+
stroke: backgroundBorderColor,
|
2212
|
+
strokeWidth: backgroundBorderWidth
|
2213
|
+
}
|
2214
|
+
}
|
2215
|
+
},
|
2216
|
+
endSymbol: {
|
2217
|
+
visible: true,
|
2218
|
+
style: {
|
2219
|
+
fill: lineColor
|
2220
|
+
}
|
2221
|
+
}
|
2222
|
+
});
|
2223
|
+
if (!selectorPoint && (0, external_remeda_namespaceObject.isArray)(xValue) || (0, external_remeda_namespaceObject.isString)(xValue) || (0, external_remeda_namespaceObject.isNumber)(xValue)) {
|
2224
|
+
const xValueArr = Array.isArray(xValue) ? xValue : [
|
2225
|
+
xValue
|
2226
|
+
];
|
2227
|
+
return xValueArr.map(generateOneMarkLine);
|
2228
|
+
}
|
2229
|
+
const selectedData = dataset.filter((datum)=>selector_selector(datum, selectorPoint));
|
2230
|
+
return selectedData.map((datum)=>{
|
2231
|
+
const x = encoding[0]?.x?.[0];
|
2232
|
+
if (!x) return {};
|
2233
|
+
return generateOneMarkLine(datum[x]);
|
2234
|
+
});
|
2119
2235
|
});
|
2236
|
+
const specMarkLine = spec.markLine || [];
|
2237
|
+
const newMarkLine = [
|
2238
|
+
...specMarkLine,
|
2239
|
+
...markLine || []
|
2240
|
+
];
|
2241
|
+
return {
|
2242
|
+
...spec,
|
2243
|
+
markLine: newMarkLine
|
2244
|
+
};
|
2245
|
+
};
|
2246
|
+
const annotationHorizontalLine_annotationHorizontalLine = (spec, context)=>{
|
2247
|
+
const { advancedVSeed } = context;
|
2248
|
+
const { annotation, encoding } = advancedVSeed;
|
2249
|
+
if (!annotation || !annotation.annotationHorizontalLine) return spec;
|
2250
|
+
const { annotationHorizontalLine } = annotation;
|
2251
|
+
const annotationVerticalLineList = Array.isArray(annotationHorizontalLine) ? annotationHorizontalLine : [
|
2252
|
+
annotationHorizontalLine
|
2253
|
+
];
|
2254
|
+
const positionMap = {
|
2255
|
+
outsideStart: 'start',
|
2256
|
+
outsideEnd: 'end',
|
2257
|
+
outsideMiddle: 'middle',
|
2258
|
+
insideStart: 'insideStartTop',
|
2259
|
+
insideMiddle: 'insideMiddleTop',
|
2260
|
+
insideEnd: 'insideEndTop'
|
2261
|
+
};
|
2262
|
+
const markLine = annotationVerticalLineList.flatMap((annotationVerticalLine)=>{
|
2263
|
+
const { selector: selectorPoint, yValue, text = '', textPosition = 'insideEnd', textColor = '#ffffff', textFontSize = 12, textFontWeight = 400, textAlign = 'center', textBaseline = 'bottom', backgroundBorderColor, backgroundBorderRadius = 4, backgroundBorderWidth = 1, backgroundColor = '#212121', backgroundPadding = 2, backgroundVisible = true, offsetX = 0, offsetY = 0, lineColor = '#212121', lineStyle = 'dashed', lineVisible = true, lineWidth = 1 } = annotationVerticalLine;
|
2264
|
+
const dataset = advancedVSeed.dataset.flat();
|
2265
|
+
const generateOneMarkLine = (y)=>({
|
2266
|
+
y,
|
2267
|
+
line: {
|
2268
|
+
visible: lineVisible,
|
2269
|
+
style: {
|
2270
|
+
offsetX,
|
2271
|
+
offsetY,
|
2272
|
+
stroke: lineColor,
|
2273
|
+
lineStyle: lineStyle,
|
2274
|
+
lineWidth: lineWidth,
|
2275
|
+
lineDash: 'dashed' === lineStyle ? [
|
2276
|
+
5,
|
2277
|
+
2
|
2278
|
+
] : 'dotted' === lineStyle ? [
|
2279
|
+
2,
|
2280
|
+
5
|
2281
|
+
] : [
|
2282
|
+
0
|
2283
|
+
]
|
2284
|
+
}
|
2285
|
+
},
|
2286
|
+
label: {
|
2287
|
+
text: text,
|
2288
|
+
position: positionMap[textPosition],
|
2289
|
+
style: {
|
2290
|
+
offsetX,
|
2291
|
+
offsetY,
|
2292
|
+
visible: true,
|
2293
|
+
textAlign: textAlign,
|
2294
|
+
textBaseline: textBaseline,
|
2295
|
+
fill: textColor,
|
2296
|
+
fontSize: textFontSize,
|
2297
|
+
fontWeight: textFontWeight
|
2298
|
+
},
|
2299
|
+
labelBackground: {
|
2300
|
+
visible: backgroundVisible,
|
2301
|
+
padding: backgroundPadding,
|
2302
|
+
style: {
|
2303
|
+
offsetX,
|
2304
|
+
offsetY,
|
2305
|
+
cornerRadius: backgroundBorderRadius ?? 4,
|
2306
|
+
fill: backgroundColor,
|
2307
|
+
stroke: backgroundBorderColor,
|
2308
|
+
strokeWidth: backgroundBorderWidth
|
2309
|
+
}
|
2310
|
+
}
|
2311
|
+
},
|
2312
|
+
endSymbol: {
|
2313
|
+
visible: true,
|
2314
|
+
style: {
|
2315
|
+
fill: lineColor
|
2316
|
+
}
|
2317
|
+
}
|
2318
|
+
});
|
2319
|
+
if (!selectorPoint && (0, external_remeda_namespaceObject.isArray)(yValue) || (0, external_remeda_namespaceObject.isString)(yValue) || (0, external_remeda_namespaceObject.isNumber)(yValue)) {
|
2320
|
+
const yValueArr = Array.isArray(yValue) ? yValue : [
|
2321
|
+
yValue
|
2322
|
+
];
|
2323
|
+
return yValueArr.map(generateOneMarkLine);
|
2324
|
+
}
|
2325
|
+
const selectedData = dataset.filter((datum)=>selector_selector(datum, selectorPoint));
|
2326
|
+
return selectedData.map((datum)=>{
|
2327
|
+
const y = encoding[0]?.y?.[0];
|
2328
|
+
if (!y) return {};
|
2329
|
+
return generateOneMarkLine(datum[y]);
|
2330
|
+
});
|
2331
|
+
});
|
2332
|
+
const specMarkLine = spec.markLine || [];
|
2333
|
+
const newMarkLine = [
|
2334
|
+
...specMarkLine,
|
2335
|
+
...markLine || []
|
2336
|
+
];
|
2337
|
+
return {
|
2338
|
+
...spec,
|
2339
|
+
markLine: newMarkLine
|
2340
|
+
};
|
2341
|
+
};
|
2342
|
+
const annotationArea_annotationArea = (spec, context)=>{
|
2343
|
+
const { advancedVSeed } = context;
|
2344
|
+
const { annotation } = advancedVSeed;
|
2345
|
+
if (!annotation || !annotation.annotationArea) return spec;
|
2346
|
+
const { annotationArea } = annotation;
|
2347
|
+
const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [
|
2348
|
+
annotationArea
|
2349
|
+
];
|
2350
|
+
const positionMap = {
|
2351
|
+
top: 'insideTop',
|
2352
|
+
topRight: 'insideTopRight',
|
2353
|
+
topLeft: 'insideTopLeft',
|
2354
|
+
bottom: 'insideBottom',
|
2355
|
+
bottomLeft: 'insideBottomLeft',
|
2356
|
+
bottomRight: 'insideBottomRight',
|
2357
|
+
left: 'insideLeft',
|
2358
|
+
right: 'insideRight'
|
2359
|
+
};
|
2360
|
+
const markArea = annotationAreaList.flatMap((annotationArea)=>{
|
2361
|
+
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 = 8, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor, areaBorderRadius, areaBorderWidth } = annotationArea;
|
2362
|
+
const dataset = advancedVSeed.dataset.flat();
|
2363
|
+
const selectedData = dataset.filter((datum)=>selector_selector(datum, selectorPoint));
|
2364
|
+
return {
|
2365
|
+
regionRelative: true,
|
2366
|
+
positions: (data, context)=>{
|
2367
|
+
console.log('debug selectedData', selectedData);
|
2368
|
+
const positionData = data.filter((item)=>selectedData.some((datum)=>isSubset(datum, item)));
|
2369
|
+
const xyList = positionData.map((datum)=>context.dataToPosition(datum));
|
2370
|
+
const xScale = context.scaleX;
|
2371
|
+
const yScale = context.scaleY;
|
2372
|
+
const xBandWidth = xScale?.bandwidth?.();
|
2373
|
+
const yBandWidth = yScale?.bandwidth?.();
|
2374
|
+
if (xBandWidth) {
|
2375
|
+
const minX = Math.min(...xyList.map((item)=>item.x)) - outerPadding;
|
2376
|
+
const maxX = Math.max(...xyList.map((item)=>item.x)) + outerPadding;
|
2377
|
+
const minY = Math.min(...yScale.range());
|
2378
|
+
const maxY = Math.max(...yScale.range());
|
2379
|
+
return [
|
2380
|
+
{
|
2381
|
+
x: minX,
|
2382
|
+
y: minY
|
2383
|
+
},
|
2384
|
+
{
|
2385
|
+
x: maxX,
|
2386
|
+
y: minY
|
2387
|
+
},
|
2388
|
+
{
|
2389
|
+
x: maxX,
|
2390
|
+
y: maxY
|
2391
|
+
},
|
2392
|
+
{
|
2393
|
+
x: minX,
|
2394
|
+
y: maxY
|
2395
|
+
}
|
2396
|
+
];
|
2397
|
+
}
|
2398
|
+
if (yBandWidth) {
|
2399
|
+
const minY = Math.min(...xyList.map((item)=>item.y)) - outerPadding;
|
2400
|
+
const maxY = Math.max(...xyList.map((item)=>item.y)) + outerPadding;
|
2401
|
+
const minX = Math.min(...xScale.range());
|
2402
|
+
const maxX = Math.max(...xScale.range());
|
2403
|
+
return [
|
2404
|
+
{
|
2405
|
+
x: minX,
|
2406
|
+
y: minY
|
2407
|
+
},
|
2408
|
+
{
|
2409
|
+
x: maxX,
|
2410
|
+
y: minY
|
2411
|
+
},
|
2412
|
+
{
|
2413
|
+
x: maxX,
|
2414
|
+
y: maxY
|
2415
|
+
},
|
2416
|
+
{
|
2417
|
+
x: minX,
|
2418
|
+
y: maxY
|
2419
|
+
}
|
2420
|
+
];
|
2421
|
+
}
|
2422
|
+
return [];
|
2423
|
+
},
|
2424
|
+
label: {
|
2425
|
+
position: positionMap[textPosition],
|
2426
|
+
visible: true,
|
2427
|
+
text: text,
|
2428
|
+
style: {
|
2429
|
+
textAlign: textAlign,
|
2430
|
+
textBaseline: textBaseline,
|
2431
|
+
fill: textColor,
|
2432
|
+
fontSize: textFontSize,
|
2433
|
+
fontWeight: textFontWeight
|
2434
|
+
},
|
2435
|
+
labelBackground: {
|
2436
|
+
visible: backgroundVisible,
|
2437
|
+
padding: backgroundPadding,
|
2438
|
+
style: {
|
2439
|
+
cornerRadius: backgroundBorderRadius ?? 4,
|
2440
|
+
fill: backgroundColor,
|
2441
|
+
stroke: backgroundBorderColor,
|
2442
|
+
strokeWidth: backgroundBorderWidth
|
2443
|
+
}
|
2444
|
+
}
|
2445
|
+
},
|
2446
|
+
area: {
|
2447
|
+
style: {
|
2448
|
+
visible: true,
|
2449
|
+
fill: areaColor,
|
2450
|
+
fillOpacity: areaColorOpacity,
|
2451
|
+
stroke: areaBorderColor,
|
2452
|
+
strokeWidth: areaBorderWidth,
|
2453
|
+
cornerRadius: areaBorderRadius
|
2454
|
+
}
|
2455
|
+
}
|
2456
|
+
};
|
2457
|
+
});
|
2458
|
+
return {
|
2459
|
+
...spec,
|
2460
|
+
markArea: markArea
|
2461
|
+
};
|
2462
|
+
};
|
2463
|
+
const annotationAreaBand = (spec, context)=>{
|
2464
|
+
const { advancedVSeed } = context;
|
2465
|
+
const { annotation } = advancedVSeed;
|
2466
|
+
if (!annotation || !annotation.annotationArea) return spec;
|
2467
|
+
const { annotationArea } = annotation;
|
2468
|
+
const annotationAreaList = Array.isArray(annotationArea) ? annotationArea : [
|
2469
|
+
annotationArea
|
2470
|
+
];
|
2471
|
+
const positionMap = {
|
2472
|
+
top: 'insideTop',
|
2473
|
+
topRight: 'insideTopRight',
|
2474
|
+
topLeft: 'insideTopLeft',
|
2475
|
+
bottom: 'insideBottom',
|
2476
|
+
bottomLeft: 'insideBottomLeft',
|
2477
|
+
bottomRight: 'insideBottomRight',
|
2478
|
+
left: 'insideLeft',
|
2479
|
+
right: 'insideRight'
|
2480
|
+
};
|
2481
|
+
const markArea = annotationAreaList.flatMap((annotationArea)=>{
|
2482
|
+
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 = 8, areaColor = '#888888', areaColorOpacity = 0.15, areaBorderColor, areaBorderRadius, areaBorderWidth } = annotationArea;
|
2483
|
+
const dataset = advancedVSeed.dataset.flat();
|
2484
|
+
const selectedData = dataset.filter((datum)=>selector_selector(datum, selectorPoint));
|
2485
|
+
return {
|
2486
|
+
regionRelative: true,
|
2487
|
+
positions: (data, context)=>{
|
2488
|
+
const positionData = data.filter((item)=>selectedData.some((datum)=>isSubset(datum, item)));
|
2489
|
+
const xyList = positionData.map((datum)=>context.dataToPosition(datum));
|
2490
|
+
const xScale = context.scaleX;
|
2491
|
+
const yScale = context.scaleY;
|
2492
|
+
const xBandWidth = xScale?.bandwidth?.();
|
2493
|
+
const yBandWidth = yScale?.bandwidth?.();
|
2494
|
+
if (xBandWidth) {
|
2495
|
+
const minX = Math.min(...xyList.map((item)=>item.x)) - outerPadding;
|
2496
|
+
const maxX = Math.max(...xyList.map((item)=>item.x)) + xBandWidth + outerPadding;
|
2497
|
+
const minY = Math.min(...yScale.range());
|
2498
|
+
const maxY = Math.max(...yScale.range());
|
2499
|
+
return [
|
2500
|
+
{
|
2501
|
+
x: minX,
|
2502
|
+
y: minY
|
2503
|
+
},
|
2504
|
+
{
|
2505
|
+
x: maxX,
|
2506
|
+
y: minY
|
2507
|
+
},
|
2508
|
+
{
|
2509
|
+
x: maxX,
|
2510
|
+
y: maxY
|
2511
|
+
},
|
2512
|
+
{
|
2513
|
+
x: minX,
|
2514
|
+
y: maxY
|
2515
|
+
}
|
2516
|
+
];
|
2517
|
+
}
|
2518
|
+
if (yBandWidth) {
|
2519
|
+
const minY = Math.min(...xyList.map((item)=>item.y)) - outerPadding;
|
2520
|
+
const maxY = Math.max(...xyList.map((item)=>item.y)) + yBandWidth + outerPadding;
|
2521
|
+
const minX = Math.min(...xScale.range());
|
2522
|
+
const maxX = Math.max(...xScale.range());
|
2523
|
+
return [
|
2524
|
+
{
|
2525
|
+
x: minX,
|
2526
|
+
y: minY
|
2527
|
+
},
|
2528
|
+
{
|
2529
|
+
x: maxX,
|
2530
|
+
y: minY
|
2531
|
+
},
|
2532
|
+
{
|
2533
|
+
x: maxX,
|
2534
|
+
y: maxY
|
2535
|
+
},
|
2536
|
+
{
|
2537
|
+
x: minX,
|
2538
|
+
y: maxY
|
2539
|
+
}
|
2540
|
+
];
|
2541
|
+
}
|
2542
|
+
return [];
|
2543
|
+
},
|
2544
|
+
label: {
|
2545
|
+
position: positionMap[textPosition],
|
2546
|
+
visible: true,
|
2547
|
+
text: text,
|
2548
|
+
style: {
|
2549
|
+
textAlign: textAlign,
|
2550
|
+
textBaseline: textBaseline,
|
2551
|
+
fill: textColor,
|
2552
|
+
fontSize: textFontSize,
|
2553
|
+
fontWeight: textFontWeight
|
2554
|
+
},
|
2555
|
+
labelBackground: {
|
2556
|
+
visible: backgroundVisible,
|
2557
|
+
padding: backgroundPadding,
|
2558
|
+
style: {
|
2559
|
+
cornerRadius: backgroundBorderRadius ?? 4,
|
2560
|
+
fill: backgroundColor,
|
2561
|
+
stroke: backgroundBorderColor,
|
2562
|
+
strokeWidth: backgroundBorderWidth
|
2563
|
+
}
|
2564
|
+
}
|
2565
|
+
},
|
2566
|
+
area: {
|
2567
|
+
style: {
|
2568
|
+
visible: true,
|
2569
|
+
fill: areaColor,
|
2570
|
+
fillOpacity: areaColorOpacity,
|
2571
|
+
stroke: areaBorderColor,
|
2572
|
+
strokeWidth: areaBorderWidth,
|
2573
|
+
cornerRadius: areaBorderRadius
|
2574
|
+
}
|
2575
|
+
}
|
2576
|
+
};
|
2577
|
+
});
|
2578
|
+
return {
|
2579
|
+
...spec,
|
2580
|
+
markArea: markArea
|
2581
|
+
};
|
2582
|
+
};
|
2120
2583
|
const line_line = [
|
2121
2584
|
initLine,
|
2122
2585
|
color_color,
|
@@ -2127,7 +2590,10 @@ const line_line = [
|
|
2127
2590
|
label_label,
|
2128
2591
|
tooltip_tooltip,
|
2129
2592
|
discreteLegend,
|
2130
|
-
annotationPoint_annotationPoint
|
2593
|
+
annotationPoint_annotationPoint,
|
2594
|
+
annotationVerticalLine_annotationVerticalLine,
|
2595
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2596
|
+
annotationArea_annotationArea
|
2131
2597
|
];
|
2132
2598
|
const pivotLine = [
|
2133
2599
|
initPivot,
|
@@ -2143,7 +2609,10 @@ const pivotLine = [
|
|
2143
2609
|
yLinear,
|
2144
2610
|
label_label,
|
2145
2611
|
tooltip_tooltip,
|
2146
|
-
annotationPoint_annotationPoint
|
2612
|
+
annotationPoint_annotationPoint,
|
2613
|
+
annotationVerticalLine_annotationVerticalLine,
|
2614
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2615
|
+
annotationArea_annotationArea
|
2147
2616
|
]),
|
2148
2617
|
pivotRowDimensions,
|
2149
2618
|
pivotColumnDimensions,
|
@@ -2164,7 +2633,10 @@ const column = [
|
|
2164
2633
|
tooltip_tooltip,
|
2165
2634
|
discreteLegend,
|
2166
2635
|
barStyle_barStyle,
|
2167
|
-
annotationPoint_annotationPoint
|
2636
|
+
annotationPoint_annotationPoint,
|
2637
|
+
annotationVerticalLine_annotationVerticalLine,
|
2638
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2639
|
+
annotationAreaBand
|
2168
2640
|
];
|
2169
2641
|
const pivotColumn = [
|
2170
2642
|
initPivot,
|
@@ -2182,7 +2654,10 @@ const pivotColumn = [
|
|
2182
2654
|
label_label,
|
2183
2655
|
tooltip_tooltip,
|
2184
2656
|
barStyle_barStyle,
|
2185
|
-
annotationPoint_annotationPoint
|
2657
|
+
annotationPoint_annotationPoint,
|
2658
|
+
annotationVerticalLine_annotationVerticalLine,
|
2659
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2660
|
+
annotationAreaBand
|
2186
2661
|
]),
|
2187
2662
|
pivotRowDimensions,
|
2188
2663
|
pivotColumnDimensions,
|
@@ -2202,7 +2677,10 @@ const columnParallel = [
|
|
2202
2677
|
tooltip_tooltip,
|
2203
2678
|
discreteLegend,
|
2204
2679
|
barStyle_barStyle,
|
2205
|
-
annotationPoint_annotationPoint
|
2680
|
+
annotationPoint_annotationPoint,
|
2681
|
+
annotationVerticalLine_annotationVerticalLine,
|
2682
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2683
|
+
annotationAreaBand
|
2206
2684
|
];
|
2207
2685
|
const pivotColumnParallel = [
|
2208
2686
|
initPivot,
|
@@ -2219,7 +2697,10 @@ const pivotColumnParallel = [
|
|
2219
2697
|
label_label,
|
2220
2698
|
tooltip_tooltip,
|
2221
2699
|
barStyle_barStyle,
|
2222
|
-
annotationPoint_annotationPoint
|
2700
|
+
annotationPoint_annotationPoint,
|
2701
|
+
annotationVerticalLine_annotationVerticalLine,
|
2702
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2703
|
+
annotationAreaBand
|
2223
2704
|
]),
|
2224
2705
|
pivotRowDimensions,
|
2225
2706
|
pivotColumnDimensions,
|
@@ -2241,7 +2722,10 @@ const columnPercent = [
|
|
2241
2722
|
tooltip_tooltip,
|
2242
2723
|
discreteLegend,
|
2243
2724
|
barStyle_barStyle,
|
2244
|
-
annotationPoint_annotationPoint
|
2725
|
+
annotationPoint_annotationPoint,
|
2726
|
+
annotationVerticalLine_annotationVerticalLine,
|
2727
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2728
|
+
annotationAreaBand
|
2245
2729
|
];
|
2246
2730
|
const pivotColumnPercent = [
|
2247
2731
|
initPivot,
|
@@ -2260,7 +2744,10 @@ const pivotColumnPercent = [
|
|
2260
2744
|
label_label,
|
2261
2745
|
tooltip_tooltip,
|
2262
2746
|
barStyle_barStyle,
|
2263
|
-
annotationPoint_annotationPoint
|
2747
|
+
annotationPoint_annotationPoint,
|
2748
|
+
annotationVerticalLine_annotationVerticalLine,
|
2749
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2750
|
+
annotationAreaBand
|
2264
2751
|
]),
|
2265
2752
|
pivotRowDimensions,
|
2266
2753
|
pivotColumnDimensions,
|
@@ -2280,7 +2767,10 @@ const bar = [
|
|
2280
2767
|
tooltip_tooltip,
|
2281
2768
|
discreteLegend,
|
2282
2769
|
barStyle_barStyle,
|
2283
|
-
annotationPoint_annotationPoint
|
2770
|
+
annotationPoint_annotationPoint,
|
2771
|
+
annotationVerticalLine_annotationVerticalLine,
|
2772
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2773
|
+
annotationAreaBand
|
2284
2774
|
];
|
2285
2775
|
const pivotBar = [
|
2286
2776
|
initPivot,
|
@@ -2297,7 +2787,10 @@ const pivotBar = [
|
|
2297
2787
|
label_label,
|
2298
2788
|
tooltip_tooltip,
|
2299
2789
|
barStyle_barStyle,
|
2300
|
-
annotationPoint_annotationPoint
|
2790
|
+
annotationPoint_annotationPoint,
|
2791
|
+
annotationVerticalLine_annotationVerticalLine,
|
2792
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2793
|
+
annotationAreaBand
|
2301
2794
|
]),
|
2302
2795
|
pivotRowDimensions,
|
2303
2796
|
pivotColumnDimensions,
|
@@ -2317,7 +2810,10 @@ const barParallel = [
|
|
2317
2810
|
tooltip_tooltip,
|
2318
2811
|
discreteLegend,
|
2319
2812
|
barStyle_barStyle,
|
2320
|
-
annotationPoint_annotationPoint
|
2813
|
+
annotationPoint_annotationPoint,
|
2814
|
+
annotationVerticalLine_annotationVerticalLine,
|
2815
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2816
|
+
annotationAreaBand
|
2321
2817
|
];
|
2322
2818
|
const pivotBarParallel = [
|
2323
2819
|
initPivot,
|
@@ -2334,7 +2830,10 @@ const pivotBarParallel = [
|
|
2334
2830
|
label_label,
|
2335
2831
|
tooltip_tooltip,
|
2336
2832
|
barStyle_barStyle,
|
2337
|
-
annotationPoint_annotationPoint
|
2833
|
+
annotationPoint_annotationPoint,
|
2834
|
+
annotationVerticalLine_annotationVerticalLine,
|
2835
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2836
|
+
annotationAreaBand
|
2338
2837
|
]),
|
2339
2838
|
pivotRowDimensions,
|
2340
2839
|
pivotColumnDimensions,
|
@@ -2355,7 +2854,10 @@ const barPercent = [
|
|
2355
2854
|
tooltip_tooltip,
|
2356
2855
|
discreteLegend,
|
2357
2856
|
barStyle_barStyle,
|
2358
|
-
annotationPoint_annotationPoint
|
2857
|
+
annotationPoint_annotationPoint,
|
2858
|
+
annotationVerticalLine_annotationVerticalLine,
|
2859
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2860
|
+
annotationAreaBand
|
2359
2861
|
];
|
2360
2862
|
const pivotBarPercent = [
|
2361
2863
|
initPivot,
|
@@ -2373,7 +2875,10 @@ const pivotBarPercent = [
|
|
2373
2875
|
label_label,
|
2374
2876
|
tooltip_tooltip,
|
2375
2877
|
barStyle_barStyle,
|
2376
|
-
annotationPoint_annotationPoint
|
2878
|
+
annotationPoint_annotationPoint,
|
2879
|
+
annotationVerticalLine_annotationVerticalLine,
|
2880
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2881
|
+
annotationAreaBand
|
2377
2882
|
]),
|
2378
2883
|
pivotRowDimensions,
|
2379
2884
|
pivotColumnDimensions,
|
@@ -2393,7 +2898,10 @@ const area_area = [
|
|
2393
2898
|
label_label,
|
2394
2899
|
tooltip_tooltip,
|
2395
2900
|
discreteLegend,
|
2396
|
-
annotationPoint_annotationPoint
|
2901
|
+
annotationPoint_annotationPoint,
|
2902
|
+
annotationVerticalLine_annotationVerticalLine,
|
2903
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2904
|
+
annotationArea_annotationArea
|
2397
2905
|
];
|
2398
2906
|
const pivotArea = [
|
2399
2907
|
initPivot,
|
@@ -2410,7 +2918,10 @@ const pivotArea = [
|
|
2410
2918
|
yLinear,
|
2411
2919
|
label_label,
|
2412
2920
|
tooltip_tooltip,
|
2413
|
-
annotationPoint_annotationPoint
|
2921
|
+
annotationPoint_annotationPoint,
|
2922
|
+
annotationVerticalLine_annotationVerticalLine,
|
2923
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2924
|
+
annotationArea_annotationArea
|
2414
2925
|
]),
|
2415
2926
|
pivotRowDimensions,
|
2416
2927
|
pivotColumnDimensions,
|
@@ -2431,7 +2942,10 @@ const areaPercent = [
|
|
2431
2942
|
label_label,
|
2432
2943
|
tooltip_tooltip,
|
2433
2944
|
discreteLegend,
|
2434
|
-
annotationPoint_annotationPoint
|
2945
|
+
annotationPoint_annotationPoint,
|
2946
|
+
annotationVerticalLine_annotationVerticalLine,
|
2947
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2948
|
+
annotationArea_annotationArea
|
2435
2949
|
];
|
2436
2950
|
const pivotAreaPercent = [
|
2437
2951
|
initPivot,
|
@@ -2449,7 +2963,10 @@ const pivotAreaPercent = [
|
|
2449
2963
|
yLinear,
|
2450
2964
|
label_label,
|
2451
2965
|
tooltip_tooltip,
|
2452
|
-
annotationPoint_annotationPoint
|
2966
|
+
annotationPoint_annotationPoint,
|
2967
|
+
annotationVerticalLine_annotationVerticalLine,
|
2968
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2969
|
+
annotationArea_annotationArea
|
2453
2970
|
]),
|
2454
2971
|
pivotRowDimensions,
|
2455
2972
|
pivotColumnDimensions,
|
@@ -2466,7 +2983,10 @@ const pie = [
|
|
2466
2983
|
label_label,
|
2467
2984
|
tooltip_tooltip,
|
2468
2985
|
discreteLegend,
|
2469
|
-
annotationPoint_annotationPoint
|
2986
|
+
annotationPoint_annotationPoint,
|
2987
|
+
annotationVerticalLine_annotationVerticalLine,
|
2988
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
2989
|
+
annotationArea_annotationArea
|
2470
2990
|
];
|
2471
2991
|
const pivotPie = [
|
2472
2992
|
initPivot,
|
@@ -2480,7 +3000,10 @@ const pivotPie = [
|
|
2480
3000
|
datasetPivotPlaceholder,
|
2481
3001
|
label_label,
|
2482
3002
|
tooltip_tooltip,
|
2483
|
-
annotationPoint_annotationPoint
|
3003
|
+
annotationPoint_annotationPoint,
|
3004
|
+
annotationVerticalLine_annotationVerticalLine,
|
3005
|
+
annotationHorizontalLine_annotationHorizontalLine,
|
3006
|
+
annotationArea_annotationArea
|
2484
3007
|
]),
|
2485
3008
|
pivotRowDimensions,
|
2486
3009
|
pivotColumnDimensions,
|
@@ -2522,17 +3045,17 @@ const buildSpec = (builder, advancedVSeed)=>{
|
|
2522
3045
|
}
|
2523
3046
|
};
|
2524
3047
|
const build = (builder)=>{
|
2525
|
-
console.log('debug vseed', builder.vseed);
|
2526
3048
|
const advancedVSeed = builder.buildAdvanced();
|
2527
|
-
|
3049
|
+
builder.advancedVSeed = advancedVSeed;
|
2528
3050
|
if (!advancedVSeed) throw new Error('advancedVSeed is null');
|
2529
3051
|
const spec = builder.buildSpec(advancedVSeed);
|
2530
|
-
|
3052
|
+
builder.spec = spec;
|
2531
3053
|
return spec;
|
2532
3054
|
};
|
2533
3055
|
class Builder {
|
2534
3056
|
_vseed;
|
2535
3057
|
_advancedVSeed = null;
|
3058
|
+
_spec = null;
|
2536
3059
|
constructor(vseed){
|
2537
3060
|
this._vseed = vseed;
|
2538
3061
|
}
|
@@ -2555,6 +3078,12 @@ class Builder {
|
|
2555
3078
|
set advancedVSeed(value) {
|
2556
3079
|
this._advancedVSeed = value;
|
2557
3080
|
}
|
3081
|
+
get spec() {
|
3082
|
+
return this._spec;
|
3083
|
+
}
|
3084
|
+
set spec(value) {
|
3085
|
+
this._spec = value;
|
3086
|
+
}
|
2558
3087
|
static _advancedPipelineMap = {};
|
2559
3088
|
static _specPipelineMap = {};
|
2560
3089
|
static _themeMap = {};
|
@@ -3302,7 +3831,26 @@ const zSelector = external_zod_namespaceObject.z.union([
|
|
3302
3831
|
external_zod_namespaceObject.z.number(),
|
3303
3832
|
external_zod_namespaceObject.z.object({
|
3304
3833
|
field: external_zod_namespaceObject.z.string(),
|
3305
|
-
operator: external_zod_namespaceObject.z
|
3834
|
+
operator: external_zod_namespaceObject.z["enum"]([
|
3835
|
+
'=',
|
3836
|
+
'==',
|
3837
|
+
'!=',
|
3838
|
+
'>',
|
3839
|
+
'<',
|
3840
|
+
'>=',
|
3841
|
+
'<=',
|
3842
|
+
'between'
|
3843
|
+
]).optional(),
|
3844
|
+
op: external_zod_namespaceObject.z["enum"]([
|
3845
|
+
'=',
|
3846
|
+
'==',
|
3847
|
+
'!=',
|
3848
|
+
'>',
|
3849
|
+
'<',
|
3850
|
+
'>=',
|
3851
|
+
'<=',
|
3852
|
+
'between'
|
3853
|
+
]).optional(),
|
3306
3854
|
value: external_zod_namespaceObject.z.union([
|
3307
3855
|
external_zod_namespaceObject.z.string(),
|
3308
3856
|
external_zod_namespaceObject.z.number(),
|
@@ -3314,7 +3862,14 @@ const zSelector = external_zod_namespaceObject.z.union([
|
|
3314
3862
|
}),
|
3315
3863
|
external_zod_namespaceObject.z.object({
|
3316
3864
|
field: external_zod_namespaceObject.z.string(),
|
3317
|
-
operator: external_zod_namespaceObject.z
|
3865
|
+
operator: external_zod_namespaceObject.z["enum"]([
|
3866
|
+
'in',
|
3867
|
+
'not in'
|
3868
|
+
]).optional(),
|
3869
|
+
op: external_zod_namespaceObject.z["enum"]([
|
3870
|
+
'in',
|
3871
|
+
'not in'
|
3872
|
+
]).optional(),
|
3318
3873
|
value: external_zod_namespaceObject.z.union([
|
3319
3874
|
external_zod_namespaceObject.z.string(),
|
3320
3875
|
external_zod_namespaceObject.z.number(),
|
@@ -3376,8 +3931,157 @@ const zAnnotationPoint = external_zod_namespaceObject.z.object({
|
|
3376
3931
|
offsetY: external_zod_namespaceObject.z.number().default(0).optional(),
|
3377
3932
|
offsetX: external_zod_namespaceObject.z.number().default(0).optional()
|
3378
3933
|
});
|
3934
|
+
const zAnnotationVerticalLine = external_zod_namespaceObject.z.object({
|
3935
|
+
selector: external_zod_namespaceObject.z.union([
|
3936
|
+
zSelector,
|
3937
|
+
zSelectors
|
3938
|
+
]).optional(),
|
3939
|
+
xValue: external_zod_namespaceObject.z.union([
|
3940
|
+
external_zod_namespaceObject.z.number(),
|
3941
|
+
external_zod_namespaceObject.z.string(),
|
3942
|
+
external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.union([
|
3943
|
+
external_zod_namespaceObject.z.number(),
|
3944
|
+
external_zod_namespaceObject.z.string()
|
3945
|
+
]))
|
3946
|
+
]).optional(),
|
3947
|
+
text: external_zod_namespaceObject.z.string().or(external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string())).optional(),
|
3948
|
+
textPosition: external_zod_namespaceObject.z["enum"]([
|
3949
|
+
'outsideStart',
|
3950
|
+
'outsideEnd',
|
3951
|
+
'outsideMiddle',
|
3952
|
+
'insideStart',
|
3953
|
+
'insideMiddle',
|
3954
|
+
'insideEnd'
|
3955
|
+
]).default('insideEnd').optional(),
|
3956
|
+
textColor: external_zod_namespaceObject.z.string().default('#ffffff').optional(),
|
3957
|
+
textFontSize: external_zod_namespaceObject.z.number().default(12).optional(),
|
3958
|
+
textFontWeight: external_zod_namespaceObject.z.number().default(400).optional(),
|
3959
|
+
textAlign: external_zod_namespaceObject.z["enum"]([
|
3960
|
+
'left',
|
3961
|
+
'right',
|
3962
|
+
'center'
|
3963
|
+
]).default('right').optional(),
|
3964
|
+
textBaseline: external_zod_namespaceObject.z["enum"]([
|
3965
|
+
'top',
|
3966
|
+
'middle',
|
3967
|
+
'bottom'
|
3968
|
+
]).default('top').optional(),
|
3969
|
+
lineVisible: external_zod_namespaceObject.z.boolean().optional(),
|
3970
|
+
lineColor: external_zod_namespaceObject.z.string().optional(),
|
3971
|
+
lineWidth: external_zod_namespaceObject.z.number().optional(),
|
3972
|
+
lineStyle: external_zod_namespaceObject.z.union([
|
3973
|
+
external_zod_namespaceObject.z.literal('solid'),
|
3974
|
+
external_zod_namespaceObject.z.literal('dashed'),
|
3975
|
+
external_zod_namespaceObject.z.literal('dotted')
|
3976
|
+
]).optional(),
|
3977
|
+
backgroundVisible: external_zod_namespaceObject.z.boolean().default(true).optional(),
|
3978
|
+
backgroundColor: external_zod_namespaceObject.z.string().default('#212121').optional(),
|
3979
|
+
backgroundBorderColor: external_zod_namespaceObject.z.string().optional(),
|
3980
|
+
backgroundBorderWidth: external_zod_namespaceObject.z.number().default(1).optional(),
|
3981
|
+
backgroundBorderRadius: external_zod_namespaceObject.z.number().default(4).optional(),
|
3982
|
+
backgroundPadding: external_zod_namespaceObject.z.number().optional(),
|
3983
|
+
offsetY: external_zod_namespaceObject.z.number().default(0).optional(),
|
3984
|
+
offsetX: external_zod_namespaceObject.z.number().default(0).optional()
|
3985
|
+
});
|
3986
|
+
const zAnnotationHorizontalLine = external_zod_namespaceObject.z.object({
|
3987
|
+
selector: external_zod_namespaceObject.z.union([
|
3988
|
+
zSelector,
|
3989
|
+
zSelectors
|
3990
|
+
]).optional(),
|
3991
|
+
yValue: external_zod_namespaceObject.z.union([
|
3992
|
+
external_zod_namespaceObject.z.number(),
|
3993
|
+
external_zod_namespaceObject.z.string(),
|
3994
|
+
external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.union([
|
3995
|
+
external_zod_namespaceObject.z.number(),
|
3996
|
+
external_zod_namespaceObject.z.string()
|
3997
|
+
]))
|
3998
|
+
]).optional(),
|
3999
|
+
text: external_zod_namespaceObject.z.string().or(external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string())).optional(),
|
4000
|
+
textPosition: external_zod_namespaceObject.z["enum"]([
|
4001
|
+
'outsideStart',
|
4002
|
+
'outsideEnd',
|
4003
|
+
'outsideMiddle',
|
4004
|
+
'insideStart',
|
4005
|
+
'insideMiddle',
|
4006
|
+
'insideEnd'
|
4007
|
+
]).default('insideMiddle').optional(),
|
4008
|
+
textColor: external_zod_namespaceObject.z.string().default('#ffffff').optional(),
|
4009
|
+
textFontSize: external_zod_namespaceObject.z.number().default(12).optional(),
|
4010
|
+
textFontWeight: external_zod_namespaceObject.z.number().default(400).optional(),
|
4011
|
+
textAlign: external_zod_namespaceObject.z["enum"]([
|
4012
|
+
'left',
|
4013
|
+
'right',
|
4014
|
+
'center'
|
4015
|
+
]).default('center').optional(),
|
4016
|
+
textBaseline: external_zod_namespaceObject.z["enum"]([
|
4017
|
+
'top',
|
4018
|
+
'middle',
|
4019
|
+
'bottom'
|
4020
|
+
]).default('bottom').optional(),
|
4021
|
+
lineVisible: external_zod_namespaceObject.z.boolean().optional(),
|
4022
|
+
lineColor: external_zod_namespaceObject.z.string().optional(),
|
4023
|
+
lineWidth: external_zod_namespaceObject.z.number().optional(),
|
4024
|
+
lineStyle: external_zod_namespaceObject.z.union([
|
4025
|
+
external_zod_namespaceObject.z.literal('solid'),
|
4026
|
+
external_zod_namespaceObject.z.literal('dashed'),
|
4027
|
+
external_zod_namespaceObject.z.literal('dotted')
|
4028
|
+
]).optional(),
|
4029
|
+
backgroundVisible: external_zod_namespaceObject.z.boolean().default(true).optional(),
|
4030
|
+
backgroundColor: external_zod_namespaceObject.z.string().default('#212121').optional(),
|
4031
|
+
backgroundBorderColor: external_zod_namespaceObject.z.string().optional(),
|
4032
|
+
backgroundBorderWidth: external_zod_namespaceObject.z.number().default(1).optional(),
|
4033
|
+
backgroundBorderRadius: external_zod_namespaceObject.z.number().default(4).optional(),
|
4034
|
+
backgroundPadding: external_zod_namespaceObject.z.number().optional(),
|
4035
|
+
offsetY: external_zod_namespaceObject.z.number().default(0).optional(),
|
4036
|
+
offsetX: external_zod_namespaceObject.z.number().default(0).optional()
|
4037
|
+
});
|
4038
|
+
const zAnnotationArea = external_zod_namespaceObject.z.object({
|
4039
|
+
selector: external_zod_namespaceObject.z.union([
|
4040
|
+
zSelector,
|
4041
|
+
zSelectors
|
4042
|
+
]),
|
4043
|
+
textPosition: external_zod_namespaceObject.z["enum"]([
|
4044
|
+
'top',
|
4045
|
+
'topRight',
|
4046
|
+
'topLeft',
|
4047
|
+
'bottom',
|
4048
|
+
'bottomLeft',
|
4049
|
+
'bottomRight',
|
4050
|
+
'left',
|
4051
|
+
'right'
|
4052
|
+
]).default('top').optional(),
|
4053
|
+
text: external_zod_namespaceObject.z.string().or(external_zod_namespaceObject.z.array(external_zod_namespaceObject.z.string())).optional(),
|
4054
|
+
textColor: external_zod_namespaceObject.z.string().default('#ffffff').optional(),
|
4055
|
+
textFontSize: external_zod_namespaceObject.z.number().default(12).optional(),
|
4056
|
+
textFontWeight: external_zod_namespaceObject.z.number().default(400).optional(),
|
4057
|
+
textAlign: external_zod_namespaceObject.z["enum"]([
|
4058
|
+
'left',
|
4059
|
+
'right',
|
4060
|
+
'center'
|
4061
|
+
]).default('center').optional(),
|
4062
|
+
textBaseline: external_zod_namespaceObject.z["enum"]([
|
4063
|
+
'top',
|
4064
|
+
'middle',
|
4065
|
+
'bottom'
|
4066
|
+
]).default('middle').optional(),
|
4067
|
+
backgroundVisible: external_zod_namespaceObject.z.boolean().default(true).optional(),
|
4068
|
+
backgroundColor: external_zod_namespaceObject.z.string().default('#212121').optional(),
|
4069
|
+
backgroundBorderColor: external_zod_namespaceObject.z.string().optional(),
|
4070
|
+
backgroundBorderWidth: external_zod_namespaceObject.z.number().default(1).optional(),
|
4071
|
+
backgroundBorderRadius: external_zod_namespaceObject.z.number().default(4).optional(),
|
4072
|
+
backgroundPadding: external_zod_namespaceObject.z.number().optional(),
|
4073
|
+
areaColor: external_zod_namespaceObject.z.string().default('red').optional(),
|
4074
|
+
areaColorOpacity: external_zod_namespaceObject.z.number().default(0.5).optional(),
|
4075
|
+
areaBorderColor: external_zod_namespaceObject.z.number().optional(),
|
4076
|
+
areaBorderWidth: external_zod_namespaceObject.z.number().default(2).optional(),
|
4077
|
+
areaBorderRadius: external_zod_namespaceObject.z.number().default(4).optional(),
|
4078
|
+
outerPadding: external_zod_namespaceObject.z.number().optional()
|
4079
|
+
});
|
3379
4080
|
const zAnnotation = external_zod_namespaceObject.z.object({
|
3380
|
-
annotationPoint: zAnnotationPoint.or(external_zod_namespaceObject.z.array(zAnnotationPoint)).optional()
|
4081
|
+
annotationPoint: zAnnotationPoint.or(external_zod_namespaceObject.z.array(zAnnotationPoint)).optional(),
|
4082
|
+
annotationVerticalLine: zAnnotationVerticalLine.or(external_zod_namespaceObject.z.array(zAnnotationVerticalLine)).optional(),
|
4083
|
+
annotationHorizontalLine: zAnnotationHorizontalLine.or(external_zod_namespaceObject.z.array(zAnnotationHorizontalLine)).optional(),
|
4084
|
+
annotationArea: zAnnotationArea.or(external_zod_namespaceObject.z.array(zAnnotationArea)).optional()
|
3381
4085
|
});
|
3382
4086
|
exports.Builder = __webpack_exports__.Builder;
|
3383
4087
|
exports.FoldMeasureId = __webpack_exports__.FoldMeasureId;
|
@@ -3430,7 +4134,10 @@ exports.registerLightTheme = __webpack_exports__.registerLightTheme;
|
|
3430
4134
|
exports.registerLine = __webpack_exports__.registerLine;
|
3431
4135
|
exports.unfoldDimensions = __webpack_exports__.unfoldDimensions;
|
3432
4136
|
exports.zAnnotation = __webpack_exports__.zAnnotation;
|
4137
|
+
exports.zAnnotationArea = __webpack_exports__.zAnnotationArea;
|
4138
|
+
exports.zAnnotationHorizontalLine = __webpack_exports__.zAnnotationHorizontalLine;
|
3433
4139
|
exports.zAnnotationPoint = __webpack_exports__.zAnnotationPoint;
|
4140
|
+
exports.zAnnotationVerticalLine = __webpack_exports__.zAnnotationVerticalLine;
|
3434
4141
|
exports.zAxis = __webpack_exports__.zAxis;
|
3435
4142
|
exports.zBackgroundColor = __webpack_exports__.zBackgroundColor;
|
3436
4143
|
exports.zBarStyle = __webpack_exports__.zBarStyle;
|
@@ -3512,7 +4219,10 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
3512
4219
|
"registerLine",
|
3513
4220
|
"unfoldDimensions",
|
3514
4221
|
"zAnnotation",
|
4222
|
+
"zAnnotationArea",
|
4223
|
+
"zAnnotationHorizontalLine",
|
3515
4224
|
"zAnnotationPoint",
|
4225
|
+
"zAnnotationVerticalLine",
|
3516
4226
|
"zAxis",
|
3517
4227
|
"zBackgroundColor",
|
3518
4228
|
"zBarStyle",
|