@visactor/vseed 0.4.25 → 0.4.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/cjs/index.cjs +2 -2
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/pipeline/advanced/chart/pipes/config/column.js +1 -0
  4. package/dist/esm/pipeline/advanced/chart/pipes/config/column.js.map +1 -1
  5. package/dist/esm/pipeline/advanced/chart/pipes/config/line.js +1 -0
  6. package/dist/esm/pipeline/advanced/chart/pipes/config/line.js.map +1 -1
  7. package/dist/esm/pipeline/spec/chart/pipeline/area.js +5 -1
  8. package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
  9. package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js +3 -1
  10. package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
  11. package/dist/esm/pipeline/spec/chart/pipeline/bar.js +3 -1
  12. package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
  13. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +3 -1
  14. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
  15. package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js +3 -1
  16. package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
  17. package/dist/esm/pipeline/spec/chart/pipeline/column.js +3 -1
  18. package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
  19. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +3 -1
  20. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
  21. package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js +3 -1
  22. package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
  23. package/dist/esm/pipeline/spec/chart/pipeline/line.js +5 -1
  24. package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
  25. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js +157 -73
  26. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js.map +1 -1
  27. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLineCommon.d.ts +19 -4
  28. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLineCommon.js +56 -10
  29. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLineCommon.js.map +1 -1
  30. package/dist/esm/pipeline/spec/chart/pipes/region/index.d.ts +1 -0
  31. package/dist/esm/pipeline/spec/chart/pipes/region/index.js +1 -0
  32. package/dist/esm/pipeline/spec/chart/pipes/region/regionPadding.d.ts +2 -0
  33. package/dist/esm/pipeline/spec/chart/pipes/region/regionPadding.js +20 -0
  34. package/dist/esm/pipeline/spec/chart/pipes/region/regionPadding.js.map +1 -0
  35. package/dist/esm/types/chartType/area/area.d.ts +11 -1
  36. package/dist/esm/types/chartType/area/zArea.d.ts +309 -0
  37. package/dist/esm/types/chartType/area/zArea.js +3 -1
  38. package/dist/esm/types/chartType/area/zArea.js.map +1 -1
  39. package/dist/esm/types/chartType/areaPercent/areaPercent.d.ts +6 -1
  40. package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +6 -0
  41. package/dist/esm/types/chartType/areaPercent/zAreaPercent.js +2 -1
  42. package/dist/esm/types/chartType/areaPercent/zAreaPercent.js.map +1 -1
  43. package/dist/esm/types/chartType/bar/bar.d.ts +6 -1
  44. package/dist/esm/types/chartType/bar/zBar.d.ts +6 -0
  45. package/dist/esm/types/chartType/bar/zBar.js +2 -1
  46. package/dist/esm/types/chartType/bar/zBar.js.map +1 -1
  47. package/dist/esm/types/chartType/barParallel/barParallel.d.ts +6 -1
  48. package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +6 -0
  49. package/dist/esm/types/chartType/barParallel/zBarParallel.js +2 -1
  50. package/dist/esm/types/chartType/barParallel/zBarParallel.js.map +1 -1
  51. package/dist/esm/types/chartType/barPercent/barPercent.d.ts +6 -1
  52. package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +6 -0
  53. package/dist/esm/types/chartType/barPercent/zBarPercent.js +2 -1
  54. package/dist/esm/types/chartType/barPercent/zBarPercent.js.map +1 -1
  55. package/dist/esm/types/chartType/column/column.d.ts +6 -1
  56. package/dist/esm/types/chartType/column/zColumn.d.ts +6 -0
  57. package/dist/esm/types/chartType/column/zColumn.js +2 -1
  58. package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
  59. package/dist/esm/types/chartType/columnParallel/columnParallel.d.ts +6 -1
  60. package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +6 -0
  61. package/dist/esm/types/chartType/columnParallel/zColumnParallel.js +2 -1
  62. package/dist/esm/types/chartType/columnParallel/zColumnParallel.js.map +1 -1
  63. package/dist/esm/types/chartType/columnPercent/columnPercent.d.ts +6 -1
  64. package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +6 -0
  65. package/dist/esm/types/chartType/columnPercent/zColumnPercent.js +2 -1
  66. package/dist/esm/types/chartType/columnPercent/zColumnPercent.js.map +1 -1
  67. package/dist/esm/types/chartType/line/line.d.ts +11 -1
  68. package/dist/esm/types/chartType/line/zLine.d.ts +309 -0
  69. package/dist/esm/types/chartType/line/zLine.js +3 -1
  70. package/dist/esm/types/chartType/line/zLine.js.map +1 -1
  71. package/dist/esm/types/properties/config/area.d.ts +12 -0
  72. package/dist/esm/types/properties/config/area.js +2 -0
  73. package/dist/esm/types/properties/config/area.js.map +1 -1
  74. package/dist/esm/types/properties/config/bar.d.ts +18 -0
  75. package/dist/esm/types/properties/config/bar.js +2 -0
  76. package/dist/esm/types/properties/config/bar.js.map +1 -1
  77. package/dist/esm/types/properties/config/column.d.ts +18 -0
  78. package/dist/esm/types/properties/config/column.js +2 -0
  79. package/dist/esm/types/properties/config/column.js.map +1 -1
  80. package/dist/esm/types/properties/config/config.d.ts +66 -0
  81. package/dist/esm/types/properties/config/line.d.ts +6 -0
  82. package/dist/esm/types/properties/config/line.js +2 -0
  83. package/dist/esm/types/properties/config/line.js.map +1 -1
  84. package/dist/esm/types/properties/config/race.d.ts +12 -0
  85. package/dist/esm/types/properties/index.d.ts +1 -0
  86. package/dist/esm/types/properties/index.js +1 -0
  87. package/dist/esm/types/properties/regionPadding/index.d.ts +2 -0
  88. package/dist/esm/types/properties/regionPadding/index.js +1 -0
  89. package/dist/esm/types/properties/regionPadding/regionPadding.d.ts +6 -0
  90. package/dist/esm/types/properties/regionPadding/regionPadding.js +0 -0
  91. package/dist/esm/types/properties/regionPadding/zRegionPadding.d.ts +7 -0
  92. package/dist/esm/types/properties/regionPadding/zRegionPadding.js +11 -0
  93. package/dist/esm/types/properties/regionPadding/zRegionPadding.js.map +1 -0
  94. package/dist/esm/types/properties/theme/customTheme.d.ts +132 -0
  95. package/dist/umd/index.js +485 -291
  96. package/dist/umd/index.js.map +1 -1
  97. package/package.json +1 -1
package/dist/umd/index.js CHANGED
@@ -1029,6 +1029,7 @@
1029
1029
  FoldPrimaryMeasureValue: ()=>FoldPrimaryMeasureValue,
1030
1030
  donutSpecPipeline: ()=>donutSpecPipeline,
1031
1031
  registerTokenThemes: ()=>registerTokenThemes,
1032
+ zRegionPadding: ()=>zRegionPadding,
1032
1033
  zSortLegend: ()=>zSortLegend,
1033
1034
  registerTable: ()=>registerTable,
1034
1035
  zCrosshairRect: ()=>zCrosshairRect,
@@ -5578,6 +5579,7 @@ self.R = R;
5578
5579
  'color',
5579
5580
  'label',
5580
5581
  'legend',
5582
+ 'regionPadding',
5581
5583
  'tooltip',
5582
5584
  'xAxis',
5583
5585
  'yAxis',
@@ -5692,6 +5694,23 @@ self.R = R;
5692
5694
  result.animation = true;
5693
5695
  return result;
5694
5696
  };
5697
+ const regionPadding = (spec, context)=>{
5698
+ const chartConfig = context.advancedVSeed.config?.[context.vseed.chartType];
5699
+ const padding = chartConfig?.regionPadding;
5700
+ if (null == padding || !Array.isArray(spec.region)) return spec;
5701
+ const region = spec.region;
5702
+ if (0 === region.length) return spec;
5703
+ return {
5704
+ ...spec,
5705
+ region: [
5706
+ {
5707
+ ...region[0],
5708
+ padding
5709
+ },
5710
+ ...region.slice(1)
5711
+ ]
5712
+ };
5713
+ };
5695
5714
  const color_color = (spec, context)=>{
5696
5715
  const result = {
5697
5716
  ...spec
@@ -7075,7 +7094,427 @@ self.R = R;
7075
7094
  };
7076
7095
  };
7077
7096
  };
7078
- const annotationPoint_annotationPoint = generateAnnotationPointPipe({});
7097
+ const annotationPoint_annotationPoint = generateAnnotationPointPipe({});
7098
+ const STACK_END_FIELD = '__VCHART_STACK_END';
7099
+ const toArray = (value)=>{
7100
+ if (Array.isArray(value)) return value;
7101
+ return null == value ? [] : [
7102
+ value
7103
+ ];
7104
+ };
7105
+ const getDifferenceBandFields = (spec)=>toArray('horizontal' === spec.direction ? spec.yField : spec.xField);
7106
+ const getDifferenceValueField = (spec)=>{
7107
+ const valueField = toArray('horizontal' === spec.direction ? spec.xField : spec.yField)[0];
7108
+ if (!valueField) throw new Error('annotationDifferenceLine requires a value field in the target chart spec');
7109
+ return valueField;
7110
+ };
7111
+ const normalizeDifferenceValue = (value, selectorLabel, field)=>{
7112
+ const numberValue = Number(value);
7113
+ if (Number.isNaN(numberValue)) throw new Error(`annotationDifferenceLine ${selectorLabel} selector resolved to a non-numeric value on field "${field}"`);
7114
+ return numberValue;
7115
+ };
7116
+ const buildStackGroupDatum = (datum, bandFields)=>Object.fromEntries(bandFields.map((field)=>[
7117
+ field,
7118
+ datum[field]
7119
+ ]));
7120
+ const resolveBandIndex = (dataset, bandDatum)=>{
7121
+ const bandIndex = dataset.findIndex((datum)=>isSubset(bandDatum, datum));
7122
+ return bandIndex >= 0 ? bandIndex : void 0;
7123
+ };
7124
+ const buildFallbackSelectorDatum = (selectorValue)=>{
7125
+ const selectorList = Array.isArray(selectorValue) ? selectorValue : [
7126
+ selectorValue
7127
+ ];
7128
+ const fallbackDatum = {};
7129
+ for (const currentSelector of selectorList){
7130
+ if (isValueSelector(currentSelector) || isFieldSelector(currentSelector)) return;
7131
+ if (isMeasureSelector(currentSelector)) {
7132
+ const operator = currentSelector.operator || currentSelector.op;
7133
+ const selectorValues = Array.isArray(currentSelector.value) ? currentSelector.value : [
7134
+ currentSelector.value
7135
+ ];
7136
+ if (![
7137
+ '=',
7138
+ '=='
7139
+ ].includes(operator) || 1 !== selectorValues.length) return;
7140
+ fallbackDatum[currentSelector.field] = selectorValues[0];
7141
+ continue;
7142
+ }
7143
+ if (isDimensionSelector(currentSelector)) {
7144
+ const operator = currentSelector.operator || currentSelector.op;
7145
+ const selectorValues = Array.isArray(currentSelector.value) ? currentSelector.value : [
7146
+ currentSelector.value
7147
+ ];
7148
+ if ('in' !== operator || 1 !== selectorValues.length) return;
7149
+ fallbackDatum[currentSelector.field] = selectorValues[0];
7150
+ continue;
7151
+ }
7152
+ if (isPartialDatumSelector(currentSelector)) {
7153
+ Object.assign(fallbackDatum, currentSelector);
7154
+ continue;
7155
+ }
7156
+ return;
7157
+ }
7158
+ return Object.keys(fallbackDatum).length > 0 ? fallbackDatum : void 0;
7159
+ };
7160
+ const inferFallbackValue = (fallbackDatum, valueField, bandFields)=>{
7161
+ if (valueField in fallbackDatum) return fallbackDatum[valueField];
7162
+ const numericCandidateKeys = Object.keys(fallbackDatum).filter((key)=>{
7163
+ if (key === valueField || bandFields.includes(key)) return false;
7164
+ return 'number' == typeof fallbackDatum[key];
7165
+ });
7166
+ if (1 !== numericCandidateKeys.length) return;
7167
+ return fallbackDatum[numericCandidateKeys[0]];
7168
+ };
7169
+ const resolveFallbackAnchor = (options)=>{
7170
+ const { dataset, selectorLabel, selectorValue, valueField, bandFields } = options;
7171
+ const fallbackDatum = buildFallbackSelectorDatum(selectorValue);
7172
+ if (!fallbackDatum) return;
7173
+ const inferredValue = inferFallbackValue(fallbackDatum, valueField, bandFields);
7174
+ if (void 0 === inferredValue) return;
7175
+ const coordinateDatum = {
7176
+ ...fallbackDatum,
7177
+ [valueField]: inferredValue
7178
+ };
7179
+ const bandDatum = buildStackGroupDatum(coordinateDatum, bandFields);
7180
+ try {
7181
+ return {
7182
+ mode: 'element',
7183
+ selectorLabel,
7184
+ coordinateDatum,
7185
+ matchedDatum: fallbackDatum,
7186
+ bandDatum,
7187
+ bandIndex: resolveBandIndex(dataset, bandDatum),
7188
+ value: normalizeDifferenceValue(inferredValue, selectorLabel, valueField)
7189
+ };
7190
+ } catch {
7191
+ return;
7192
+ }
7193
+ };
7194
+ const hasMixedSigns = (values)=>{
7195
+ const nonZeroValues = values.filter((value)=>0 !== value);
7196
+ return nonZeroValues.some((value)=>value > 0) && nonZeroValues.some((value)=>value < 0);
7197
+ };
7198
+ const getDifferenceLineStackResolveMode = (vseed, advancedVSeed)=>{
7199
+ const hasMultipleMeasure = hasMultipleMeasureInSingleView(advancedVSeed.reshapeMeasures ?? []);
7200
+ if (!hasMultipleMeasure) return 'none';
7201
+ if ('column' === vseed.chartType) return 'auto';
7202
+ if ('bar' === vseed.chartType) return 'auto';
7203
+ return 'none';
7204
+ };
7205
+ const usesDifferenceLineElementStackEnd = (vseed, advancedVSeed)=>'area' === vseed.chartType && hasMultipleMeasureInSingleView(advancedVSeed.reshapeMeasures ?? []);
7206
+ const resolveDifferenceAnchor = (options)=>{
7207
+ const { dataset, selectorLabel, selectorValue, spec, stackResolveMode, allowSelectorFallback = true } = options;
7208
+ const matches = dataset.filter((datum)=>selector_selector(datum, selectorValue));
7209
+ const valueField = getDifferenceValueField(spec);
7210
+ const bandFields = getDifferenceBandFields(spec);
7211
+ if (0 === matches.length) return 'none' === stackResolveMode && allowSelectorFallback ? resolveFallbackAnchor({
7212
+ dataset,
7213
+ selectorLabel,
7214
+ selectorValue,
7215
+ valueField,
7216
+ bandFields
7217
+ }) : void 0;
7218
+ if ('none' === stackResolveMode || 'auto' === stackResolveMode && 1 === matches.length) {
7219
+ if (1 !== matches.length) throw new Error(`annotationDifferenceLine ${selectorLabel} selector must resolve to exactly one datum, got ${matches.length}`);
7220
+ const bandDatum = buildStackGroupDatum(matches[0], bandFields);
7221
+ return {
7222
+ mode: 'element',
7223
+ selectorLabel,
7224
+ coordinateDatum: matches[0],
7225
+ matchedDatum: matches[0],
7226
+ bandDatum,
7227
+ bandIndex: resolveBandIndex(dataset, bandDatum),
7228
+ value: normalizeDifferenceValue(matches[0][valueField], selectorLabel, valueField)
7229
+ };
7230
+ }
7231
+ const stackGroups = new Map();
7232
+ matches.forEach((datum)=>{
7233
+ const stackGroupDatum = buildStackGroupDatum(datum, bandFields);
7234
+ stackGroups.set(JSON.stringify(stackGroupDatum), stackGroupDatum);
7235
+ });
7236
+ if (1 !== stackGroups.size) throw new Error(`annotationDifferenceLine ${selectorLabel} selector must resolve to exactly one stack group, got ${stackGroups.size}`);
7237
+ const stackGroupDatum = Array.from(stackGroups.values())[0];
7238
+ const groupRows = dataset.filter((datum)=>isSubset(stackGroupDatum, datum));
7239
+ if ('auto' === stackResolveMode && groupRows.length !== matches.length) throw new Error(`annotationDifferenceLine ${selectorLabel} selector must resolve to exactly one stack element or one full stack group`);
7240
+ const groupValues = groupRows.map((datum)=>normalizeDifferenceValue(datum[valueField], selectorLabel, valueField));
7241
+ if (hasMixedSigns(groupValues)) throw new Error('annotationDifferenceLine does not support mixed-sign stack totals in v1');
7242
+ return {
7243
+ mode: 'stackTotal',
7244
+ selectorLabel,
7245
+ coordinateDatum: stackGroupDatum,
7246
+ matchedDatum: matches[0],
7247
+ stackGroupDatum,
7248
+ bandDatum: stackGroupDatum,
7249
+ bandIndex: resolveBandIndex(dataset, stackGroupDatum),
7250
+ value: groupValues.reduce((sum, value)=>sum + value, 0)
7251
+ };
7252
+ };
7253
+ const getStackRuntimeTotal = (runtimeMatches)=>{
7254
+ const stackEndValues = runtimeMatches.map((datum)=>Number(datum[STACK_END_FIELD]));
7255
+ if (stackEndValues.some((value)=>Number.isNaN(value))) return;
7256
+ if (hasMixedSigns(stackEndValues)) throw new Error('annotationDifferenceLine does not support mixed-sign runtime stack totals in v1');
7257
+ return stackEndValues.some((value)=>value < 0) ? Math.min(...stackEndValues) : Math.max(...stackEndValues);
7258
+ };
7259
+ const buildDifferenceCoordinateDatum = (options)=>{
7260
+ const { anchor, seriesData, relativeSeries, useElementStackEnd = false } = options;
7261
+ if (!anchor.stackGroupDatum) {
7262
+ const runtimeMatches = anchor.matchedDatum ? seriesData.filter((datum)=>isSubset(anchor.matchedDatum, datum)) : [];
7263
+ if (!useElementStackEnd) return runtimeMatches[0] ?? anchor.coordinateDatum;
7264
+ const runtimeMatch = runtimeMatches[0];
7265
+ const runtimeStackEnd = Number(runtimeMatch?.[STACK_END_FIELD]);
7266
+ return {
7267
+ ...runtimeMatch ?? anchor.coordinateDatum,
7268
+ [relativeSeries.getStackValueField()]: Number.isNaN(runtimeStackEnd) ? anchor.value : runtimeStackEnd
7269
+ };
7270
+ }
7271
+ const runtimeMatches = seriesData.filter((datum)=>isSubset(anchor.stackGroupDatum, datum));
7272
+ const runtimeStackTotal = getStackRuntimeTotal(runtimeMatches);
7273
+ return {
7274
+ ...runtimeMatches[0] ?? anchor.coordinateDatum,
7275
+ [relativeSeries.getStackValueField()]: runtimeStackTotal ?? anchor.value
7276
+ };
7277
+ };
7278
+ const getRuntimeDifferenceValue = (options)=>{
7279
+ const { anchor, seriesData, useElementStackEnd = false } = options;
7280
+ if (anchor.stackGroupDatum) {
7281
+ const runtimeMatches = seriesData.filter((datum)=>isSubset(anchor.stackGroupDatum, datum));
7282
+ return getStackRuntimeTotal(runtimeMatches) ?? anchor.value;
7283
+ }
7284
+ if (!useElementStackEnd || !anchor.matchedDatum) return anchor.value;
7285
+ const runtimeMatch = seriesData.find((datum)=>isSubset(anchor.matchedDatum, datum));
7286
+ const runtimeStackEnd = Number(runtimeMatch?.[STACK_END_FIELD]);
7287
+ return Number.isNaN(runtimeStackEnd) ? anchor.value : runtimeStackEnd;
7288
+ };
7289
+ const buildDifferenceText = (startValue, endValue, differenceType = 'absolute')=>{
7290
+ if ('percent' === differenceType) {
7291
+ if (0 === startValue) throw new Error('annotationDifferenceLine percent difference cannot be computed because start value is 0');
7292
+ return `${((endValue - startValue) / startValue * 100).toFixed(0)}%`;
7293
+ }
7294
+ return `${endValue - startValue}`;
7295
+ };
7296
+ const inferDifferenceConnectDirection = (vseed, values)=>{
7297
+ const isNegativeSide = values.every((value)=>value < 0);
7298
+ if (isBarLikeChart(vseed)) return isNegativeSide ? 'left' : 'right';
7299
+ return isNegativeSide ? 'bottom' : 'top';
7300
+ };
7301
+ const inferDifferenceBracketDirection = (start, end)=>{
7302
+ if (void 0 === start.bandIndex || void 0 === end.bandIndex) return 'right';
7303
+ return start.bandIndex <= end.bandIndex ? 'right' : 'left';
7304
+ };
7305
+ const DEFAULT_LINE_COLOR = '#BCC1CB';
7306
+ const DEFAULT_TEXT_COLOR = '#ffffff';
7307
+ const DEFAULT_TEXT_BACKGROUND_COLOR = '#BCC1CB';
7308
+ const DEFAULT_TEXT_FONT_SIZE = 12;
7309
+ const DEFAULT_EXPAND_DISTANCE = 24;
7310
+ const DEFAULT_LINE_WIDTH = 2;
7311
+ const DEFAULT_CORNER_RADIUS = 4;
7312
+ const DEFAULT_LABEL_PADDING = 4;
7313
+ const DEFAULT_END_SYMBOL_SIZE = 12;
7314
+ const DEFAULT_END_SYMBOL_REF_X = -4;
7315
+ const DEFAULT_BRACKET_EXPAND_DISTANCE = 80;
7316
+ const DEFAULT_BRACKET_LINE_DASH = [
7317
+ 2,
7318
+ 2
7319
+ ];
7320
+ const getDifferenceLinePath = (index, total)=>1 === total ? 'annotationDifferenceLine' : `annotationDifferenceLine[${index}]`;
7321
+ const assertDifferenceLineConfig = (value, path)=>{
7322
+ if ('object' != typeof value || null === value || Array.isArray(value)) throw new Error(`${path} must be an object`);
7323
+ const start = value.start;
7324
+ if ('object' != typeof start || null === start || Array.isArray(start)) throw new Error(`${path}.start is required`);
7325
+ if (null == start.selector) throw new Error(`${path}.start.selector is required`);
7326
+ const end = value.end;
7327
+ if ('object' != typeof end || null === end || Array.isArray(end)) throw new Error(`${path}.end is required`);
7328
+ if (null == end.selector) throw new Error(`${path}.end.selector is required`);
7329
+ };
7330
+ const annotationDifferenceLine_annotationDifferenceLine = (spec, context)=>{
7331
+ const { advancedVSeed, vseed } = context;
7332
+ const annotationDifferenceLine = advancedVSeed.annotation?.annotationDifferenceLine;
7333
+ if (!annotationDifferenceLine) return spec;
7334
+ const theme = advancedVSeed.config?.[vseed.chartType]?.annotation?.annotationDifferenceLine;
7335
+ const annotationDifferenceLineList = Array.isArray(annotationDifferenceLine) ? annotationDifferenceLine : [
7336
+ annotationDifferenceLine
7337
+ ];
7338
+ const dataset = advancedVSeed.dataset.flat();
7339
+ const chartSpec = spec;
7340
+ const stackResolveMode = getDifferenceLineStackResolveMode(vseed, advancedVSeed);
7341
+ const useElementStackEnd = usesDifferenceLineElementStackEnd(vseed, advancedVSeed);
7342
+ const isBracketChart = 'line' === vseed.chartType || 'area' === vseed.chartType;
7343
+ const markLine = annotationDifferenceLineList.flatMap((annotationDifferenceLine, index)=>{
7344
+ try {
7345
+ assertDifferenceLineConfig(annotationDifferenceLine, getDifferenceLinePath(index, annotationDifferenceLineList.length));
7346
+ const start = resolveDifferenceAnchor({
7347
+ dataset,
7348
+ selectorLabel: 'start',
7349
+ selectorValue: annotationDifferenceLine.start.selector,
7350
+ spec: chartSpec,
7351
+ stackResolveMode,
7352
+ allowSelectorFallback: !useElementStackEnd
7353
+ });
7354
+ const end = resolveDifferenceAnchor({
7355
+ dataset,
7356
+ selectorLabel: 'end',
7357
+ selectorValue: annotationDifferenceLine.end.selector,
7358
+ spec: chartSpec,
7359
+ stackResolveMode,
7360
+ allowSelectorFallback: !useElementStackEnd
7361
+ });
7362
+ if (!start || !end) return [];
7363
+ if (start.mode !== end.mode) return [];
7364
+ const usesRuntimeStackEnd = useElementStackEnd || ('column' === vseed.chartType || 'bar' === vseed.chartType) && 'element' === start.mode && 'auto' === stackResolveMode;
7365
+ const useBracketStyle = isBracketChart || ('column' === vseed.chartType || 'bar' === vseed.chartType) && 'element' === start.mode && 'auto' === stackResolveMode;
7366
+ const isStackedBarElementBracket = 'bar' === vseed.chartType && 'element' === start.mode && 'auto' === stackResolveMode;
7367
+ const connectDirection = useBracketStyle ? isStackedBarElementBracket ? 'top' : inferDifferenceBracketDirection(start, end) : inferDifferenceConnectDirection(vseed, [
7368
+ start.value,
7369
+ end.value
7370
+ ]);
7371
+ const lineColor = annotationDifferenceLine.lineColor ?? theme?.lineColor ?? DEFAULT_LINE_COLOR;
7372
+ const textColor = annotationDifferenceLine.textColor ?? theme?.textColor ?? DEFAULT_TEXT_COLOR;
7373
+ const textBackgroundColor = annotationDifferenceLine.textBackgroundColor ?? theme?.textBackgroundColor ?? DEFAULT_TEXT_BACKGROUND_COLOR;
7374
+ const textFontSize = annotationDifferenceLine.textFontSize ?? theme?.textFontSize ?? DEFAULT_TEXT_FONT_SIZE;
7375
+ const differenceType = annotationDifferenceLine.differenceType ?? 'absolute';
7376
+ const label = usesRuntimeStackEnd ? {
7377
+ visible: true,
7378
+ position: 'middle',
7379
+ refY: 0,
7380
+ formatMethod: (_markData, seriesData)=>{
7381
+ try {
7382
+ return buildDifferenceText(getRuntimeDifferenceValue({
7383
+ anchor: start,
7384
+ seriesData,
7385
+ useElementStackEnd: usesRuntimeStackEnd
7386
+ }), getRuntimeDifferenceValue({
7387
+ anchor: end,
7388
+ seriesData,
7389
+ useElementStackEnd: usesRuntimeStackEnd
7390
+ }), differenceType);
7391
+ } catch {
7392
+ return '';
7393
+ }
7394
+ },
7395
+ style: {
7396
+ fill: textColor,
7397
+ fontSize: textFontSize
7398
+ },
7399
+ labelBackground: {
7400
+ visible: true,
7401
+ padding: DEFAULT_LABEL_PADDING,
7402
+ style: {
7403
+ fill: textBackgroundColor,
7404
+ fillOpacity: 1,
7405
+ stroke: lineColor,
7406
+ lineWidth: 1,
7407
+ cornerRadius: DEFAULT_CORNER_RADIUS
7408
+ }
7409
+ }
7410
+ } : {
7411
+ visible: true,
7412
+ position: 'middle',
7413
+ refY: 0,
7414
+ text: buildDifferenceText(start.value, end.value, differenceType),
7415
+ style: {
7416
+ fill: textColor,
7417
+ fontSize: textFontSize
7418
+ },
7419
+ labelBackground: {
7420
+ visible: true,
7421
+ padding: DEFAULT_LABEL_PADDING,
7422
+ style: {
7423
+ fill: textBackgroundColor,
7424
+ fillOpacity: 1,
7425
+ stroke: lineColor,
7426
+ lineWidth: 1,
7427
+ cornerRadius: DEFAULT_CORNER_RADIUS
7428
+ }
7429
+ }
7430
+ };
7431
+ return [
7432
+ {
7433
+ type: 'type-step',
7434
+ autoRange: true,
7435
+ zIndex: 1000,
7436
+ connectDirection,
7437
+ expandDistance: useBracketStyle ? DEFAULT_BRACKET_EXPAND_DISTANCE : DEFAULT_EXPAND_DISTANCE,
7438
+ coordinates: (seriesData, relativeSeries)=>{
7439
+ try {
7440
+ return [
7441
+ buildDifferenceCoordinateDatum({
7442
+ anchor: start,
7443
+ seriesData,
7444
+ relativeSeries,
7445
+ useElementStackEnd: usesRuntimeStackEnd
7446
+ }),
7447
+ buildDifferenceCoordinateDatum({
7448
+ anchor: end,
7449
+ seriesData,
7450
+ relativeSeries,
7451
+ useElementStackEnd: usesRuntimeStackEnd
7452
+ })
7453
+ ];
7454
+ } catch {
7455
+ return [];
7456
+ }
7457
+ },
7458
+ line: useBracketStyle ? {
7459
+ multiSegment: true,
7460
+ mainSegmentIndex: 1,
7461
+ style: [
7462
+ {
7463
+ visible: true,
7464
+ stroke: lineColor,
7465
+ lineWidth: DEFAULT_LINE_WIDTH,
7466
+ lineDash: DEFAULT_BRACKET_LINE_DASH
7467
+ },
7468
+ {
7469
+ visible: true,
7470
+ stroke: lineColor,
7471
+ lineWidth: DEFAULT_LINE_WIDTH
7472
+ },
7473
+ {
7474
+ visible: true,
7475
+ stroke: lineColor,
7476
+ lineWidth: DEFAULT_LINE_WIDTH,
7477
+ lineDash: DEFAULT_BRACKET_LINE_DASH
7478
+ }
7479
+ ]
7480
+ } : {
7481
+ style: {
7482
+ visible: true,
7483
+ stroke: lineColor,
7484
+ lineWidth: DEFAULT_LINE_WIDTH,
7485
+ lineDash: [
7486
+ 0
7487
+ ],
7488
+ cornerRadius: DEFAULT_CORNER_RADIUS
7489
+ }
7490
+ },
7491
+ label,
7492
+ startSymbol: {
7493
+ visible: false
7494
+ },
7495
+ endSymbol: {
7496
+ visible: true,
7497
+ size: DEFAULT_END_SYMBOL_SIZE,
7498
+ refX: DEFAULT_END_SYMBOL_REF_X,
7499
+ style: {
7500
+ fill: lineColor
7501
+ }
7502
+ }
7503
+ }
7504
+ ];
7505
+ } catch {
7506
+ return [];
7507
+ }
7508
+ });
7509
+ const specMarkLine = chartSpec.markLine || [];
7510
+ return {
7511
+ ...spec,
7512
+ markLine: [
7513
+ ...specMarkLine,
7514
+ ...markLine
7515
+ ]
7516
+ };
7517
+ };
7079
7518
  const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
7080
7519
  const { advancedVSeed, vseed } = context;
7081
7520
  const { annotation, config } = advancedVSeed;
@@ -8719,6 +9158,7 @@ self.R = R;
8719
9158
  const line_line = [
8720
9159
  fontFamilyTheme,
8721
9160
  initLine,
9161
+ regionPadding,
8722
9162
  colorAdapter(color_color, linearColor),
8723
9163
  background_backgroundColor,
8724
9164
  datasetXY,
@@ -8736,6 +9176,7 @@ self.R = R;
8736
9176
  titleEncoding: 'x'
8737
9177
  }),
8738
9178
  annotationPoint_annotationPoint,
9179
+ annotationDifferenceLine_annotationDifferenceLine,
8739
9180
  annotationVerticalLine_annotationVerticalLine,
8740
9181
  annotationHorizontalLine_annotationHorizontalLine,
8741
9182
  annotationArea_annotationArea,
@@ -8749,6 +9190,7 @@ self.R = R;
8749
9190
  pivotIndicators_pivotIndicators([
8750
9191
  fontFamilyTheme,
8751
9192
  initLine,
9193
+ regionPadding,
8752
9194
  colorAdapter(color_color, linearColor),
8753
9195
  background_backgroundColor,
8754
9196
  datasetXY,
@@ -8765,6 +9207,7 @@ self.R = R;
8765
9207
  titleEncoding: 'x'
8766
9208
  }),
8767
9209
  annotationPoint_annotationPoint,
9210
+ annotationDifferenceLine_annotationDifferenceLine,
8768
9211
  annotationVerticalLine_annotationVerticalLine,
8769
9212
  annotationHorizontalLine_annotationHorizontalLine,
8770
9213
  annotationArea_annotationArea,
@@ -8862,6 +9305,7 @@ self.R = R;
8862
9305
  'color',
8863
9306
  'label',
8864
9307
  'legend',
9308
+ 'regionPadding',
8865
9309
  'tooltip',
8866
9310
  'xAxis',
8867
9311
  'yAxis',
@@ -9153,296 +9597,6 @@ self.R = R;
9153
9597
  };
9154
9598
  return result;
9155
9599
  };
9156
- const toArray = (value)=>{
9157
- if (Array.isArray(value)) return value;
9158
- return null == value ? [] : [
9159
- value
9160
- ];
9161
- };
9162
- const getDifferenceBandFields = (spec)=>toArray('horizontal' === spec.direction ? spec.yField : spec.xField);
9163
- const getDifferenceValueField = (spec)=>{
9164
- const valueField = toArray('horizontal' === spec.direction ? spec.xField : spec.yField)[0];
9165
- if (!valueField) throw new Error('annotationDifferenceLine requires a value field in the target chart spec');
9166
- return valueField;
9167
- };
9168
- const normalizeDifferenceValue = (value, selectorLabel, field)=>{
9169
- const numberValue = Number(value);
9170
- if (Number.isNaN(numberValue)) throw new Error(`annotationDifferenceLine ${selectorLabel} selector resolved to a non-numeric value on field "${field}"`);
9171
- return numberValue;
9172
- };
9173
- const buildStackGroupDatum = (datum, bandFields)=>Object.fromEntries(bandFields.map((field)=>[
9174
- field,
9175
- datum[field]
9176
- ]));
9177
- const buildFallbackSelectorDatum = (selectorValue)=>{
9178
- const selectorList = Array.isArray(selectorValue) ? selectorValue : [
9179
- selectorValue
9180
- ];
9181
- const fallbackDatum = {};
9182
- for (const currentSelector of selectorList){
9183
- if (isValueSelector(currentSelector) || isFieldSelector(currentSelector)) return;
9184
- if (isMeasureSelector(currentSelector)) {
9185
- const operator = currentSelector.operator || currentSelector.op;
9186
- const selectorValues = Array.isArray(currentSelector.value) ? currentSelector.value : [
9187
- currentSelector.value
9188
- ];
9189
- if (![
9190
- '=',
9191
- '=='
9192
- ].includes(operator) || 1 !== selectorValues.length) return;
9193
- fallbackDatum[currentSelector.field] = selectorValues[0];
9194
- continue;
9195
- }
9196
- if (isDimensionSelector(currentSelector)) {
9197
- const operator = currentSelector.operator || currentSelector.op;
9198
- const selectorValues = Array.isArray(currentSelector.value) ? currentSelector.value : [
9199
- currentSelector.value
9200
- ];
9201
- if ('in' !== operator || 1 !== selectorValues.length) return;
9202
- fallbackDatum[currentSelector.field] = selectorValues[0];
9203
- continue;
9204
- }
9205
- if (isPartialDatumSelector(currentSelector)) {
9206
- Object.assign(fallbackDatum, currentSelector);
9207
- continue;
9208
- }
9209
- return;
9210
- }
9211
- return Object.keys(fallbackDatum).length > 0 ? fallbackDatum : void 0;
9212
- };
9213
- const inferFallbackValue = (fallbackDatum, valueField, bandFields)=>{
9214
- if (valueField in fallbackDatum) return fallbackDatum[valueField];
9215
- const numericCandidateKeys = Object.keys(fallbackDatum).filter((key)=>{
9216
- if (key === valueField || bandFields.includes(key)) return false;
9217
- return 'number' == typeof fallbackDatum[key];
9218
- });
9219
- if (1 !== numericCandidateKeys.length) return;
9220
- return fallbackDatum[numericCandidateKeys[0]];
9221
- };
9222
- const resolveFallbackAnchor = (options)=>{
9223
- const { selectorLabel, selectorValue, valueField, bandFields } = options;
9224
- const fallbackDatum = buildFallbackSelectorDatum(selectorValue);
9225
- if (!fallbackDatum) return;
9226
- const inferredValue = inferFallbackValue(fallbackDatum, valueField, bandFields);
9227
- if (void 0 === inferredValue) return;
9228
- const coordinateDatum = {
9229
- ...fallbackDatum,
9230
- [valueField]: inferredValue
9231
- };
9232
- try {
9233
- return {
9234
- selectorLabel,
9235
- coordinateDatum,
9236
- matchedDatum: fallbackDatum,
9237
- value: normalizeDifferenceValue(inferredValue, selectorLabel, valueField)
9238
- };
9239
- } catch {
9240
- return;
9241
- }
9242
- };
9243
- const hasMixedSigns = (values)=>{
9244
- const nonZeroValues = values.filter((value)=>0 !== value);
9245
- return nonZeroValues.some((value)=>value > 0) && nonZeroValues.some((value)=>value < 0);
9246
- };
9247
- const isDifferenceLineStacked = (vseed, advancedVSeed)=>('column' === vseed.chartType || 'bar' === vseed.chartType) && hasMultipleMeasureInSingleView(advancedVSeed.reshapeMeasures ?? []);
9248
- const resolveDifferenceAnchor = (options)=>{
9249
- const { dataset, selectorLabel, selectorValue, spec, isStacked } = options;
9250
- const matches = dataset.filter((datum)=>selector_selector(datum, selectorValue));
9251
- const valueField = getDifferenceValueField(spec);
9252
- const bandFields = getDifferenceBandFields(spec);
9253
- if (0 === matches.length) return isStacked ? void 0 : resolveFallbackAnchor({
9254
- selectorLabel,
9255
- selectorValue,
9256
- valueField,
9257
- bandFields
9258
- });
9259
- if (!isStacked) {
9260
- if (1 !== matches.length) throw new Error(`annotationDifferenceLine ${selectorLabel} selector must resolve to exactly one datum, got ${matches.length}`);
9261
- return {
9262
- selectorLabel,
9263
- coordinateDatum: matches[0],
9264
- matchedDatum: matches[0],
9265
- value: normalizeDifferenceValue(matches[0][valueField], selectorLabel, valueField)
9266
- };
9267
- }
9268
- const stackGroups = new Map();
9269
- matches.forEach((datum)=>{
9270
- const stackGroupDatum = buildStackGroupDatum(datum, bandFields);
9271
- stackGroups.set(JSON.stringify(stackGroupDatum), stackGroupDatum);
9272
- });
9273
- if (1 !== stackGroups.size) throw new Error(`annotationDifferenceLine ${selectorLabel} selector must resolve to exactly one stack group, got ${stackGroups.size}`);
9274
- const stackGroupDatum = Array.from(stackGroups.values())[0];
9275
- const groupRows = dataset.filter((datum)=>isSubset(stackGroupDatum, datum));
9276
- const groupValues = groupRows.map((datum)=>normalizeDifferenceValue(datum[valueField], selectorLabel, valueField));
9277
- if (hasMixedSigns(groupValues)) throw new Error('annotationDifferenceLine does not support mixed-sign stack totals in v1');
9278
- return {
9279
- selectorLabel,
9280
- coordinateDatum: stackGroupDatum,
9281
- matchedDatum: matches[0],
9282
- stackGroupDatum,
9283
- value: groupValues.reduce((sum, value)=>sum + value, 0)
9284
- };
9285
- };
9286
- const getStackRuntimeTotal = (runtimeMatches)=>{
9287
- const stackEndValues = runtimeMatches.map((datum)=>Number(datum.__VCHART_STACK_END));
9288
- if (stackEndValues.some((value)=>Number.isNaN(value))) return;
9289
- if (hasMixedSigns(stackEndValues)) throw new Error('annotationDifferenceLine does not support mixed-sign runtime stack totals in v1');
9290
- return stackEndValues.some((value)=>value < 0) ? Math.min(...stackEndValues) : Math.max(...stackEndValues);
9291
- };
9292
- const buildDifferenceCoordinateDatum = (options)=>{
9293
- const { anchor, seriesData, relativeSeries } = options;
9294
- if (!anchor.stackGroupDatum) {
9295
- const runtimeMatches = anchor.matchedDatum ? seriesData.filter((datum)=>isSubset(anchor.matchedDatum, datum)) : [];
9296
- return runtimeMatches[0] ?? anchor.coordinateDatum;
9297
- }
9298
- const runtimeMatches = seriesData.filter((datum)=>isSubset(anchor.stackGroupDatum, datum));
9299
- const runtimeStackTotal = getStackRuntimeTotal(runtimeMatches);
9300
- return {
9301
- ...runtimeMatches[0] ?? anchor.coordinateDatum,
9302
- [relativeSeries.getStackValueField()]: runtimeStackTotal ?? anchor.value
9303
- };
9304
- };
9305
- const buildDifferenceText = (startValue, endValue, differenceType = 'absolute')=>{
9306
- if ('percent' === differenceType) {
9307
- if (0 === startValue) throw new Error('annotationDifferenceLine percent difference cannot be computed because start value is 0');
9308
- return `${((endValue - startValue) / startValue * 100).toFixed(0)}%`;
9309
- }
9310
- return `${endValue - startValue}`;
9311
- };
9312
- const inferDifferenceConnectDirection = (vseed, values)=>{
9313
- const isNegativeSide = values.every((value)=>value < 0);
9314
- if (isBarLikeChart(vseed)) return isNegativeSide ? 'left' : 'right';
9315
- return isNegativeSide ? 'bottom' : 'top';
9316
- };
9317
- const DEFAULT_LINE_COLOR = '#BCC1CB';
9318
- const DEFAULT_TEXT_COLOR = '#ffffff';
9319
- const DEFAULT_TEXT_BACKGROUND_COLOR = '#BCC1CB';
9320
- const DEFAULT_TEXT_FONT_SIZE = 12;
9321
- const DEFAULT_EXPAND_DISTANCE = 24;
9322
- const DEFAULT_LINE_WIDTH = 2;
9323
- const DEFAULT_CORNER_RADIUS = 4;
9324
- const DEFAULT_LABEL_PADDING = 4;
9325
- const DEFAULT_END_SYMBOL_SIZE = 12;
9326
- const DEFAULT_END_SYMBOL_REF_X = -4;
9327
- const getDifferenceLinePath = (index, total)=>1 === total ? 'annotationDifferenceLine' : `annotationDifferenceLine[${index}]`;
9328
- const assertDifferenceLineConfig = (value, path)=>{
9329
- if ('object' != typeof value || null === value || Array.isArray(value)) throw new Error(`${path} must be an object`);
9330
- const start = value.start;
9331
- if ('object' != typeof start || null === start || Array.isArray(start)) throw new Error(`${path}.start is required`);
9332
- if (null == start.selector) throw new Error(`${path}.start.selector is required`);
9333
- const end = value.end;
9334
- if ('object' != typeof end || null === end || Array.isArray(end)) throw new Error(`${path}.end is required`);
9335
- if (null == end.selector) throw new Error(`${path}.end.selector is required`);
9336
- };
9337
- const annotationDifferenceLine_annotationDifferenceLine = (spec, context)=>{
9338
- const { advancedVSeed, vseed } = context;
9339
- const annotationDifferenceLine = advancedVSeed.annotation?.annotationDifferenceLine;
9340
- if (!annotationDifferenceLine) return spec;
9341
- const theme = advancedVSeed.config?.[vseed.chartType]?.annotation?.annotationDifferenceLine;
9342
- const annotationDifferenceLineList = Array.isArray(annotationDifferenceLine) ? annotationDifferenceLine : [
9343
- annotationDifferenceLine
9344
- ];
9345
- const dataset = advancedVSeed.dataset.flat();
9346
- const barSpec = spec;
9347
- const isStacked = isDifferenceLineStacked(vseed, advancedVSeed);
9348
- const markLine = annotationDifferenceLineList.flatMap((annotationDifferenceLine, index)=>{
9349
- assertDifferenceLineConfig(annotationDifferenceLine, getDifferenceLinePath(index, annotationDifferenceLineList.length));
9350
- const start = resolveDifferenceAnchor({
9351
- dataset,
9352
- selectorLabel: 'start',
9353
- selectorValue: annotationDifferenceLine.start.selector,
9354
- spec: barSpec,
9355
- isStacked
9356
- });
9357
- const end = resolveDifferenceAnchor({
9358
- dataset,
9359
- selectorLabel: 'end',
9360
- selectorValue: annotationDifferenceLine.end.selector,
9361
- spec: barSpec,
9362
- isStacked
9363
- });
9364
- if (!start || !end) return [];
9365
- const lineColor = annotationDifferenceLine.lineColor ?? theme?.lineColor ?? DEFAULT_LINE_COLOR;
9366
- const textColor = annotationDifferenceLine.textColor ?? theme?.textColor ?? DEFAULT_TEXT_COLOR;
9367
- const textBackgroundColor = annotationDifferenceLine.textBackgroundColor ?? theme?.textBackgroundColor ?? DEFAULT_TEXT_BACKGROUND_COLOR;
9368
- const textFontSize = annotationDifferenceLine.textFontSize ?? theme?.textFontSize ?? DEFAULT_TEXT_FONT_SIZE;
9369
- return [
9370
- {
9371
- type: 'type-step',
9372
- autoRange: true,
9373
- zIndex: 1000,
9374
- connectDirection: inferDifferenceConnectDirection(vseed, [
9375
- start.value,
9376
- end.value
9377
- ]),
9378
- expandDistance: DEFAULT_EXPAND_DISTANCE,
9379
- coordinates: (seriesData, relativeSeries)=>[
9380
- buildDifferenceCoordinateDatum({
9381
- anchor: start,
9382
- seriesData,
9383
- relativeSeries
9384
- }),
9385
- buildDifferenceCoordinateDatum({
9386
- anchor: end,
9387
- seriesData,
9388
- relativeSeries
9389
- })
9390
- ],
9391
- line: {
9392
- style: {
9393
- visible: true,
9394
- stroke: lineColor,
9395
- lineWidth: DEFAULT_LINE_WIDTH,
9396
- lineDash: [
9397
- 0
9398
- ],
9399
- cornerRadius: DEFAULT_CORNER_RADIUS
9400
- }
9401
- },
9402
- label: {
9403
- confine: true,
9404
- visible: true,
9405
- position: 'middle',
9406
- text: buildDifferenceText(start.value, end.value, annotationDifferenceLine.differenceType ?? 'absolute'),
9407
- style: {
9408
- fill: textColor,
9409
- fontSize: textFontSize
9410
- },
9411
- labelBackground: {
9412
- visible: true,
9413
- padding: DEFAULT_LABEL_PADDING,
9414
- style: {
9415
- fill: textBackgroundColor,
9416
- fillOpacity: 1,
9417
- stroke: lineColor,
9418
- lineWidth: 1,
9419
- cornerRadius: DEFAULT_CORNER_RADIUS
9420
- }
9421
- }
9422
- },
9423
- startSymbol: {
9424
- visible: false
9425
- },
9426
- endSymbol: {
9427
- visible: true,
9428
- size: DEFAULT_END_SYMBOL_SIZE,
9429
- refX: DEFAULT_END_SYMBOL_REF_X,
9430
- style: {
9431
- fill: lineColor
9432
- }
9433
- }
9434
- }
9435
- ];
9436
- });
9437
- const specMarkLine = barSpec.markLine || [];
9438
- return {
9439
- ...spec,
9440
- markLine: [
9441
- ...specMarkLine,
9442
- ...markLine
9443
- ]
9444
- };
9445
- };
9446
9600
  const annotationAreaBand = (spec, context)=>{
9447
9601
  const { advancedVSeed, vseed } = context;
9448
9602
  const { annotation, config } = advancedVSeed;
@@ -10038,6 +10192,7 @@ self.R = R;
10038
10192
  const column_column = [
10039
10193
  fontFamilyTheme,
10040
10194
  initColumn,
10195
+ regionPadding,
10041
10196
  stackCornerRadius_stackCornerRadius,
10042
10197
  barMaxWidth_barMaxWidth,
10043
10198
  stackInverse,
@@ -10070,6 +10225,7 @@ self.R = R;
10070
10225
  pivotIndicators_pivotIndicators([
10071
10226
  fontFamilyTheme,
10072
10227
  initColumn,
10228
+ regionPadding,
10073
10229
  stackCornerRadius_stackCornerRadius,
10074
10230
  barMaxWidth_barMaxWidth,
10075
10231
  stackInverse,
@@ -10255,6 +10411,7 @@ self.R = R;
10255
10411
  const columnParallel = [
10256
10412
  fontFamilyTheme,
10257
10413
  initColumnParallel,
10414
+ regionPadding,
10258
10415
  stackCornerRadius_stackCornerRadius,
10259
10416
  barMaxWidth_barMaxWidth,
10260
10417
  barGapInGroup_barGapInGroup,
@@ -10286,6 +10443,7 @@ self.R = R;
10286
10443
  pivotIndicators_pivotIndicators([
10287
10444
  fontFamilyTheme,
10288
10445
  initColumnParallel,
10446
+ regionPadding,
10289
10447
  stackCornerRadius_stackCornerRadius,
10290
10448
  barMaxWidth_barMaxWidth,
10291
10449
  colorAdapter(color_color, linearColor),
@@ -10362,6 +10520,7 @@ self.R = R;
10362
10520
  const columnPercent = [
10363
10521
  fontFamilyTheme,
10364
10522
  initColumn,
10523
+ regionPadding,
10365
10524
  stackCornerRadius_stackCornerRadius,
10366
10525
  stackInverse,
10367
10526
  barMaxWidth_barMaxWidth,
@@ -10393,6 +10552,7 @@ self.R = R;
10393
10552
  pivotIndicators_pivotIndicators([
10394
10553
  fontFamilyTheme,
10395
10554
  initColumn,
10555
+ regionPadding,
10396
10556
  stackCornerRadius_stackCornerRadius,
10397
10557
  stackInverse,
10398
10558
  barMaxWidth_barMaxWidth,
@@ -10742,6 +10902,7 @@ self.R = R;
10742
10902
  const bar = [
10743
10903
  fontFamilyTheme,
10744
10904
  initBar,
10905
+ regionPadding,
10745
10906
  stackCornerRadius_stackCornerRadius,
10746
10907
  barMaxWidth_barMaxWidth,
10747
10908
  colorAdapter(color_color, linearColor),
@@ -10772,6 +10933,7 @@ self.R = R;
10772
10933
  pivotIndicators_pivotIndicators([
10773
10934
  fontFamilyTheme,
10774
10935
  initBar,
10936
+ regionPadding,
10775
10937
  stackCornerRadius_stackCornerRadius,
10776
10938
  barMaxWidth_barMaxWidth,
10777
10939
  colorAdapter(color_color, linearColor),
@@ -13493,6 +13655,7 @@ self.R = R;
13493
13655
  const barParallel = [
13494
13656
  fontFamilyTheme,
13495
13657
  initBarParallel,
13658
+ regionPadding,
13496
13659
  stackCornerRadius_stackCornerRadius,
13497
13660
  barMaxWidth_barMaxWidth,
13498
13661
  barGapInGroup_barGapInGroup,
@@ -13524,6 +13687,7 @@ self.R = R;
13524
13687
  pivotIndicators_pivotIndicators([
13525
13688
  fontFamilyTheme,
13526
13689
  initBarParallel,
13690
+ regionPadding,
13527
13691
  stackCornerRadius_stackCornerRadius,
13528
13692
  barMaxWidth_barMaxWidth,
13529
13693
  colorAdapter(color_color, linearColor),
@@ -13592,6 +13756,7 @@ self.R = R;
13592
13756
  const barPercent = [
13593
13757
  fontFamilyTheme,
13594
13758
  initBar,
13759
+ regionPadding,
13595
13760
  stackCornerRadius_stackCornerRadius,
13596
13761
  barMaxWidth_barMaxWidth,
13597
13762
  colorAdapter(color_color, linearColor),
@@ -13622,6 +13787,7 @@ self.R = R;
13622
13787
  pivotIndicators_pivotIndicators([
13623
13788
  fontFamilyTheme,
13624
13789
  initBar,
13790
+ regionPadding,
13625
13791
  stackCornerRadius_stackCornerRadius,
13626
13792
  barMaxWidth_barMaxWidth,
13627
13793
  colorAdapter(color_color, linearColor),
@@ -13779,6 +13945,7 @@ self.R = R;
13779
13945
  const area_area = [
13780
13946
  fontFamilyTheme,
13781
13947
  initArea,
13948
+ regionPadding,
13782
13949
  stackInverse,
13783
13950
  colorAdapter(color_color, linearColor),
13784
13951
  background_backgroundColor,
@@ -13798,6 +13965,7 @@ self.R = R;
13798
13965
  colorLineStyleFill(lineStyle_lineStyle),
13799
13966
  colorAreaStyleFill(areaStyle_areaStyle),
13800
13967
  annotationPoint_annotationPoint,
13968
+ annotationDifferenceLine_annotationDifferenceLine,
13801
13969
  annotationVerticalLine_annotationVerticalLine,
13802
13970
  annotationHorizontalLine_annotationHorizontalLine,
13803
13971
  annotationArea_annotationArea,
@@ -13811,6 +13979,7 @@ self.R = R;
13811
13979
  pivotIndicators_pivotIndicators([
13812
13980
  fontFamilyTheme,
13813
13981
  initArea,
13982
+ regionPadding,
13814
13983
  colorAdapter(color_color, linearColor),
13815
13984
  background_backgroundColor,
13816
13985
  stackInverse,
@@ -13829,6 +13998,7 @@ self.R = R;
13829
13998
  colorLineStyleFill(lineStyle_lineStyle),
13830
13999
  colorAreaStyleFill(areaStyle_areaStyle),
13831
14000
  annotationPoint_annotationPoint,
14001
+ annotationDifferenceLine_annotationDifferenceLine,
13832
14002
  annotationVerticalLine_annotationVerticalLine,
13833
14003
  annotationHorizontalLine_annotationHorizontalLine,
13834
14004
  annotationArea_annotationArea,
@@ -13882,6 +14052,7 @@ self.R = R;
13882
14052
  const areaPercent = [
13883
14053
  fontFamilyTheme,
13884
14054
  initArea,
14055
+ regionPadding,
13885
14056
  stackInverse,
13886
14057
  colorAdapter(color_color, linearColor),
13887
14058
  background_backgroundColor,
@@ -13914,6 +14085,7 @@ self.R = R;
13914
14085
  pivotIndicators_pivotIndicators([
13915
14086
  fontFamilyTheme,
13916
14087
  initArea,
14088
+ regionPadding,
13917
14089
  stackInverse,
13918
14090
  colorAdapter(color_color, linearColor),
13919
14091
  background_backgroundColor,
@@ -25612,6 +25784,13 @@ self.R = R;
25612
25784
  showTooltip: schemas_boolean().nullish(),
25613
25785
  showLabel: schemas_boolean().nullish()
25614
25786
  });
25787
+ const zRegionPaddingObject = schemas_object({
25788
+ top: schemas_number().nonnegative().nullish(),
25789
+ right: schemas_number().nonnegative().nullish(),
25790
+ bottom: schemas_number().nonnegative().nullish(),
25791
+ left: schemas_number().nonnegative().nullish()
25792
+ }).partial();
25793
+ const zRegionPadding = schemas_number().nonnegative().or(zRegionPaddingObject);
25615
25794
  const zBrushStyleConfig = schemas_object({
25616
25795
  opacity: schemas_number().optional(),
25617
25796
  stroke: schemas_string().optional(),
@@ -25644,6 +25823,7 @@ self.R = R;
25644
25823
  color: zColor.nullish(),
25645
25824
  tooltip: zTooltip.nullish(),
25646
25825
  legend: zLegend.nullish(),
25826
+ regionPadding: zRegionPadding.nullish(),
25647
25827
  xAxis: zXBandAxis.nullish(),
25648
25828
  yAxis: zYLinearAxis.nullish(),
25649
25829
  crosshairLine: zCrosshairLine.nullish(),
@@ -25699,6 +25879,7 @@ self.R = R;
25699
25879
  color: zColor.nullish(),
25700
25880
  tooltip: zTooltip.nullish(),
25701
25881
  legend: zLegend.nullish(),
25882
+ regionPadding: zRegionPadding.nullish(),
25702
25883
  xAxis: zXBandAxis.nullish(),
25703
25884
  yAxis: zYLinearAxis.nullish(),
25704
25885
  crosshairRect: zCrosshairRect.nullish(),
@@ -25720,6 +25901,7 @@ self.R = R;
25720
25901
  color: zColor.nullish(),
25721
25902
  tooltip: zTooltip.nullish(),
25722
25903
  legend: zLegend.nullish(),
25904
+ regionPadding: zRegionPadding.nullish(),
25723
25905
  xAxis: zXLinearAxis.nullish(),
25724
25906
  yAxis: zYBandAxis.nullish(),
25725
25907
  crosshairRect: zCrosshairRect.nullish(),
@@ -25737,6 +25919,7 @@ self.R = R;
25737
25919
  color: zColor.nullish(),
25738
25920
  tooltip: zTooltip.nullish(),
25739
25921
  legend: zLegend.nullish(),
25922
+ regionPadding: zRegionPadding.nullish(),
25740
25923
  xAxis: zXBandAxis.nullish(),
25741
25924
  yAxis: zYLinearAxis.nullish(),
25742
25925
  crosshairLine: zCrosshairLine.nullish(),
@@ -26273,6 +26456,7 @@ self.R = R;
26273
26456
  color: zColor.nullish(),
26274
26457
  label: zLabel.nullish(),
26275
26458
  legend: zLegend.nullish(),
26459
+ regionPadding: zRegionPadding.nullish(),
26276
26460
  tooltip: zTooltip.nullish(),
26277
26461
  brush: zBrush.nullish(),
26278
26462
  xAxis: zXBandAxis.nullish(),
@@ -26287,6 +26471,7 @@ self.R = R;
26287
26471
  annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).nullish(),
26288
26472
  annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).nullish(),
26289
26473
  annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).nullish(),
26474
+ annotationDifferenceLine: schemas_array(zAnnotationDifferenceLine).or(zAnnotationDifferenceLine).nullish(),
26290
26475
  dimensionLinkage: zDimensionLinkage.nullish(),
26291
26476
  locale: zLocale.nullish()
26292
26477
  });
@@ -26302,6 +26487,7 @@ self.R = R;
26302
26487
  color: zColor.nullish(),
26303
26488
  label: zLabel.nullish(),
26304
26489
  legend: zLegend.nullish(),
26490
+ regionPadding: zRegionPadding.nullish(),
26305
26491
  tooltip: zTooltip.nullish(),
26306
26492
  brush: zBrush.nullish(),
26307
26493
  xAxis: zXBandAxis.nullish(),
@@ -26334,6 +26520,7 @@ self.R = R;
26334
26520
  color: zColor.nullish(),
26335
26521
  label: zLabel.nullish(),
26336
26522
  legend: zLegend.nullish(),
26523
+ regionPadding: zRegionPadding.nullish(),
26337
26524
  tooltip: zTooltip.nullish(),
26338
26525
  brush: zBrush.nullish(),
26339
26526
  xAxis: zXBandAxis.nullish(),
@@ -26363,6 +26550,7 @@ self.R = R;
26363
26550
  color: zColor.nullish(),
26364
26551
  label: zLabel.nullish(),
26365
26552
  legend: zLegend.nullish(),
26553
+ regionPadding: zRegionPadding.nullish(),
26366
26554
  tooltip: zTooltip.nullish(),
26367
26555
  brush: zBrush.nullish(),
26368
26556
  xAxis: zXBandAxis.nullish(),
@@ -26390,6 +26578,7 @@ self.R = R;
26390
26578
  color: zColor.nullish(),
26391
26579
  label: zLabel.nullish(),
26392
26580
  legend: zLegend.nullish(),
26581
+ regionPadding: zRegionPadding.nullish(),
26393
26582
  tooltip: zTooltip.nullish(),
26394
26583
  brush: zBrush.nullish(),
26395
26584
  xAxis: zXLinearAxis.nullish(),
@@ -26535,6 +26724,7 @@ self.R = R;
26535
26724
  color: zColor.nullish(),
26536
26725
  label: zLabel.nullish(),
26537
26726
  legend: zLegend.nullish(),
26727
+ regionPadding: zRegionPadding.nullish(),
26538
26728
  tooltip: zTooltip.nullish(),
26539
26729
  brush: zBrush.nullish(),
26540
26730
  xAxis: zXLinearAxis.nullish(),
@@ -26565,6 +26755,7 @@ self.R = R;
26565
26755
  color: zColor.nullish(),
26566
26756
  label: zLabel.nullish(),
26567
26757
  legend: zLegend.nullish(),
26758
+ regionPadding: zRegionPadding.nullish(),
26568
26759
  tooltip: zTooltip.nullish(),
26569
26760
  brush: zBrush.nullish(),
26570
26761
  xAxis: zXLinearAxis.nullish(),
@@ -26592,6 +26783,7 @@ self.R = R;
26592
26783
  color: zColor.nullish(),
26593
26784
  label: zLabel.nullish(),
26594
26785
  legend: zLegend.nullish(),
26786
+ regionPadding: zRegionPadding.nullish(),
26595
26787
  tooltip: zTooltip.nullish(),
26596
26788
  brush: zBrush.nullish(),
26597
26789
  xAxis: zXBandAxis.nullish(),
@@ -26605,6 +26797,7 @@ self.R = R;
26605
26797
  annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).nullish(),
26606
26798
  annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).nullish(),
26607
26799
  annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).nullish(),
26800
+ annotationDifferenceLine: schemas_array(zAnnotationDifferenceLine).or(zAnnotationDifferenceLine).nullish(),
26608
26801
  dimensionLinkage: zDimensionLinkage.nullish(),
26609
26802
  locale: zLocale.nullish()
26610
26803
  });
@@ -26619,6 +26812,7 @@ self.R = R;
26619
26812
  color: zColor.nullish(),
26620
26813
  label: zLabel.nullish(),
26621
26814
  legend: zLegend.nullish(),
26815
+ regionPadding: zRegionPadding.nullish(),
26622
26816
  tooltip: zTooltip.nullish(),
26623
26817
  brush: zBrush.nullish(),
26624
26818
  xAxis: zXBandAxis.nullish(),