@visactor/vseed 0.4.24 → 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 (145) 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/annotation/annotation.js +2 -1
  4. package/dist/esm/pipeline/advanced/chart/pipes/annotation/annotation.js.map +1 -1
  5. package/dist/esm/pipeline/advanced/chart/pipes/config/column.js +1 -0
  6. package/dist/esm/pipeline/advanced/chart/pipes/config/column.js.map +1 -1
  7. package/dist/esm/pipeline/advanced/chart/pipes/config/line.js +1 -0
  8. package/dist/esm/pipeline/advanced/chart/pipes/config/line.js.map +1 -1
  9. package/dist/esm/pipeline/spec/chart/pipeline/area.js +5 -1
  10. package/dist/esm/pipeline/spec/chart/pipeline/area.js.map +1 -1
  11. package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js +3 -1
  12. package/dist/esm/pipeline/spec/chart/pipeline/areaPercent.js.map +1 -1
  13. package/dist/esm/pipeline/spec/chart/pipeline/bar.js +5 -1
  14. package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
  15. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +5 -1
  16. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
  17. package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js +3 -1
  18. package/dist/esm/pipeline/spec/chart/pipeline/barPercent.js.map +1 -1
  19. package/dist/esm/pipeline/spec/chart/pipeline/column.js +5 -1
  20. package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
  21. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +5 -1
  22. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
  23. package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js +3 -1
  24. package/dist/esm/pipeline/spec/chart/pipeline/columnPercent.js.map +1 -1
  25. package/dist/esm/pipeline/spec/chart/pipeline/line.js +5 -1
  26. package/dist/esm/pipeline/spec/chart/pipeline/line.js.map +1 -1
  27. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.d.ts +2 -0
  28. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js +218 -0
  29. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js.map +1 -0
  30. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLineCommon.d.ts +42 -0
  31. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLineCommon.js +213 -0
  32. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLineCommon.js.map +1 -0
  33. package/dist/esm/pipeline/spec/chart/pipes/annotation/index.d.ts +1 -0
  34. package/dist/esm/pipeline/spec/chart/pipes/annotation/index.js +1 -0
  35. package/dist/esm/pipeline/spec/chart/pipes/region/index.d.ts +1 -0
  36. package/dist/esm/pipeline/spec/chart/pipes/region/index.js +1 -0
  37. package/dist/esm/pipeline/spec/chart/pipes/region/regionPadding.d.ts +2 -0
  38. package/dist/esm/pipeline/spec/chart/pipes/region/regionPadding.js +20 -0
  39. package/dist/esm/pipeline/spec/chart/pipes/region/regionPadding.js.map +1 -0
  40. package/dist/esm/theme/common/annotaion.d.ts +6 -1
  41. package/dist/esm/theme/common/annotaion.js +18 -1
  42. package/dist/esm/theme/common/annotaion.js.map +1 -1
  43. package/dist/esm/theme/dark/area.d.ts +2 -0
  44. package/dist/esm/theme/dark/bar.d.ts +3 -0
  45. package/dist/esm/theme/dark/boxPlot.d.ts +1 -0
  46. package/dist/esm/theme/dark/column.d.ts +3 -0
  47. package/dist/esm/theme/dark/dualAxis.d.ts +1 -0
  48. package/dist/esm/theme/dark/histogram.d.ts +1 -0
  49. package/dist/esm/theme/dark/line.d.ts +1 -0
  50. package/dist/esm/theme/dark/race.d.ts +3 -0
  51. package/dist/esm/theme/dark/raceLine.d.ts +1 -0
  52. package/dist/esm/theme/dark/scatter.d.ts +1 -0
  53. package/dist/esm/theme/light/area.d.ts +2 -0
  54. package/dist/esm/theme/light/bar.d.ts +3 -0
  55. package/dist/esm/theme/light/boxPlot.d.ts +1 -0
  56. package/dist/esm/theme/light/column.d.ts +3 -0
  57. package/dist/esm/theme/light/dualAxis.d.ts +1 -0
  58. package/dist/esm/theme/light/histogram.d.ts +1 -0
  59. package/dist/esm/theme/light/line.d.ts +1 -0
  60. package/dist/esm/theme/light/race.d.ts +3 -0
  61. package/dist/esm/theme/light/raceLine.d.ts +1 -0
  62. package/dist/esm/theme/light/scatter.d.ts +1 -0
  63. package/dist/esm/theme/tokenTheme.js +3 -0
  64. package/dist/esm/theme/tokenTheme.js.map +1 -1
  65. package/dist/esm/types/chartType/area/area.d.ts +11 -1
  66. package/dist/esm/types/chartType/area/zArea.d.ts +309 -0
  67. package/dist/esm/types/chartType/area/zArea.js +3 -1
  68. package/dist/esm/types/chartType/area/zArea.js.map +1 -1
  69. package/dist/esm/types/chartType/areaPercent/areaPercent.d.ts +6 -1
  70. package/dist/esm/types/chartType/areaPercent/zAreaPercent.d.ts +6 -0
  71. package/dist/esm/types/chartType/areaPercent/zAreaPercent.js +2 -1
  72. package/dist/esm/types/chartType/areaPercent/zAreaPercent.js.map +1 -1
  73. package/dist/esm/types/chartType/bar/bar.d.ts +11 -2
  74. package/dist/esm/types/chartType/bar/zBar.d.ts +309 -0
  75. package/dist/esm/types/chartType/bar/zBar.js +3 -1
  76. package/dist/esm/types/chartType/bar/zBar.js.map +1 -1
  77. package/dist/esm/types/chartType/barParallel/barParallel.d.ts +10 -1
  78. package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +309 -0
  79. package/dist/esm/types/chartType/barParallel/zBarParallel.js +3 -1
  80. package/dist/esm/types/chartType/barParallel/zBarParallel.js.map +1 -1
  81. package/dist/esm/types/chartType/barPercent/barPercent.d.ts +6 -1
  82. package/dist/esm/types/chartType/barPercent/zBarPercent.d.ts +6 -0
  83. package/dist/esm/types/chartType/barPercent/zBarPercent.js +2 -1
  84. package/dist/esm/types/chartType/barPercent/zBarPercent.js.map +1 -1
  85. package/dist/esm/types/chartType/column/column.d.ts +10 -1
  86. package/dist/esm/types/chartType/column/zColumn.d.ts +309 -0
  87. package/dist/esm/types/chartType/column/zColumn.js +3 -1
  88. package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
  89. package/dist/esm/types/chartType/columnParallel/columnParallel.d.ts +10 -1
  90. package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +309 -0
  91. package/dist/esm/types/chartType/columnParallel/zColumnParallel.js +3 -1
  92. package/dist/esm/types/chartType/columnParallel/zColumnParallel.js.map +1 -1
  93. package/dist/esm/types/chartType/columnPercent/columnPercent.d.ts +6 -1
  94. package/dist/esm/types/chartType/columnPercent/zColumnPercent.d.ts +6 -0
  95. package/dist/esm/types/chartType/columnPercent/zColumnPercent.js +2 -1
  96. package/dist/esm/types/chartType/columnPercent/zColumnPercent.js.map +1 -1
  97. package/dist/esm/types/chartType/line/line.d.ts +11 -1
  98. package/dist/esm/types/chartType/line/zLine.d.ts +309 -0
  99. package/dist/esm/types/chartType/line/zLine.js +3 -1
  100. package/dist/esm/types/chartType/line/zLine.js.map +1 -1
  101. package/dist/esm/types/properties/annotation/annotation.d.ts +303 -0
  102. package/dist/esm/types/properties/annotation/annotation.js +3 -1
  103. package/dist/esm/types/properties/annotation/annotation.js.map +1 -1
  104. package/dist/esm/types/properties/annotation/annotationDifferenceLine.d.ts +51 -0
  105. package/dist/esm/types/properties/annotation/annotationDifferenceLine.js +0 -0
  106. package/dist/esm/types/properties/annotation/index.d.ts +2 -0
  107. package/dist/esm/types/properties/annotation/index.js +1 -0
  108. package/dist/esm/types/properties/annotation/zAnnotationDifferenceLine.d.ts +294 -0
  109. package/dist/esm/types/properties/annotation/zAnnotationDifferenceLine.js +29 -0
  110. package/dist/esm/types/properties/annotation/zAnnotationDifferenceLine.js.map +1 -0
  111. package/dist/esm/types/properties/config/annotation/annotation.d.ts +2 -0
  112. package/dist/esm/types/properties/config/annotation/zAnnotation.d.ts +12 -0
  113. package/dist/esm/types/properties/config/annotation/zAnnotation.js +10 -2
  114. package/dist/esm/types/properties/config/annotation/zAnnotation.js.map +1 -1
  115. package/dist/esm/types/properties/config/area.d.ts +24 -0
  116. package/dist/esm/types/properties/config/area.js +2 -0
  117. package/dist/esm/types/properties/config/area.js.map +1 -1
  118. package/dist/esm/types/properties/config/bar.d.ts +36 -0
  119. package/dist/esm/types/properties/config/bar.js +2 -0
  120. package/dist/esm/types/properties/config/bar.js.map +1 -1
  121. package/dist/esm/types/properties/config/boxplot.d.ts +6 -0
  122. package/dist/esm/types/properties/config/column.d.ts +36 -0
  123. package/dist/esm/types/properties/config/column.js +2 -0
  124. package/dist/esm/types/properties/config/column.js.map +1 -1
  125. package/dist/esm/types/properties/config/config.d.ts +180 -0
  126. package/dist/esm/types/properties/config/dualAxis.d.ts +6 -0
  127. package/dist/esm/types/properties/config/histogram.d.ts +6 -0
  128. package/dist/esm/types/properties/config/line.d.ts +12 -0
  129. package/dist/esm/types/properties/config/line.js +2 -0
  130. package/dist/esm/types/properties/config/line.js.map +1 -1
  131. package/dist/esm/types/properties/config/race.d.ts +48 -0
  132. package/dist/esm/types/properties/config/scatter.d.ts +6 -0
  133. package/dist/esm/types/properties/index.d.ts +1 -0
  134. package/dist/esm/types/properties/index.js +1 -0
  135. package/dist/esm/types/properties/regionPadding/index.d.ts +2 -0
  136. package/dist/esm/types/properties/regionPadding/index.js +1 -0
  137. package/dist/esm/types/properties/regionPadding/regionPadding.d.ts +6 -0
  138. package/dist/esm/types/properties/regionPadding/regionPadding.js +0 -0
  139. package/dist/esm/types/properties/regionPadding/zRegionPadding.d.ts +7 -0
  140. package/dist/esm/types/properties/regionPadding/zRegionPadding.js +11 -0
  141. package/dist/esm/types/properties/regionPadding/zRegionPadding.js.map +1 -0
  142. package/dist/esm/types/properties/theme/customTheme.d.ts +360 -0
  143. package/dist/umd/index.js +560 -6
  144. package/dist/umd/index.js.map +1 -1
  145. 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,
@@ -1117,8 +1118,9 @@
1117
1118
  pivotTableSpecPipeline: ()=>pivotTableSpecPipeline,
1118
1119
  registerRoseParallel: ()=>registerRoseParallel,
1119
1120
  terminateWorkerPool: ()=>terminateWorkerPool,
1120
- zYBandAxis: ()=>zYBandAxis,
1121
+ zDifferenceAnchor: ()=>zDifferenceAnchor,
1121
1122
  zRaceBar: ()=>zRaceBar,
1123
+ zYBandAxis: ()=>zYBandAxis,
1122
1124
  zTimeFormat: ()=>zTimeFormat,
1123
1125
  zRacePie: ()=>zRacePie,
1124
1126
  DimAxisType: ()=>DimAxisType,
@@ -1192,6 +1194,7 @@
1192
1194
  zKdeRegressionLine: ()=>zKdeRegressionLine,
1193
1195
  zDynamicFilter: ()=>zDynamicFilter,
1194
1196
  zTooltip: ()=>zTooltip,
1197
+ zAnnotationDifferenceLineConfig: ()=>zAnnotationDifferenceLineConfig,
1195
1198
  zAreaPercentConfig: ()=>zAreaPercentConfig,
1196
1199
  zPivotChartGridConfig: ()=>zPivotChartGridConfig,
1197
1200
  zMarkStyle: ()=>zMarkStyle,
@@ -1206,10 +1209,10 @@
1206
1209
  BinStartMeasureId: ()=>BinStartMeasureId,
1207
1210
  MeasureEncodingEnum: ()=>MeasureEncodingEnum,
1208
1211
  ColorEncoding: ()=>ColorEncoding,
1209
- zLowessRegressionLine: ()=>zLowessRegressionLine,
1212
+ zDifferenceSelectors: ()=>zDifferenceSelectors,
1210
1213
  heatmapAdvancedPipeline: ()=>heatmapAdvancedPipeline,
1211
1214
  tableSpecPipeline: ()=>tableSpecPipeline,
1212
- zTableDynamicFilter: ()=>zTableDynamicFilter,
1215
+ zLowessRegressionLine: ()=>zLowessRegressionLine,
1213
1216
  zEncoding: ()=>zEncoding,
1214
1217
  zAreaConfig: ()=>zAreaConfig,
1215
1218
  registerAll: ()=>registerAll,
@@ -1225,6 +1228,7 @@
1225
1228
  FoldMeasureValue: ()=>FoldMeasureValue,
1226
1229
  isVChart: ()=>isVChart,
1227
1230
  zBrushConfig: ()=>zBrushConfig,
1231
+ zTableDynamicFilter: ()=>zTableDynamicFilter,
1228
1232
  zTheme: ()=>zTheme,
1229
1233
  autoFormatter: ()=>autoFormatter,
1230
1234
  zDatum: ()=>zDatum,
@@ -1235,6 +1239,7 @@
1235
1239
  zDimensionEncoding: ()=>zDimensionEncoding,
1236
1240
  zBodyCellStyle: ()=>zBodyCellStyle,
1237
1241
  barAdvancedPipeline: ()=>barAdvancedPipeline,
1242
+ zDifferenceSelector: ()=>zDifferenceSelector,
1238
1243
  zTreeMap: ()=>zTreeMap,
1239
1244
  DUAL_AXIS_CHART_COLUMN_Z_INDEX: ()=>1000,
1240
1245
  condition: ()=>condition_condition,
@@ -1321,6 +1326,7 @@
1321
1326
  zLinearColor: ()=>zLinearColor,
1322
1327
  zCirclePacking: ()=>zCirclePacking,
1323
1328
  isDualAxisChartType: ()=>isDualAxisChartType,
1329
+ zAnnotationDifferenceLine: ()=>zAnnotationDifferenceLine,
1324
1330
  raceScatterAdvancedPipeline: ()=>raceScatterAdvancedPipeline,
1325
1331
  treeMapAdvancedPipeline: ()=>treeMapAdvancedPipeline,
1326
1332
  barParallelAdvancedPipeline: ()=>barParallelAdvancedPipeline,
@@ -5573,6 +5579,7 @@ self.R = R;
5573
5579
  'color',
5574
5580
  'label',
5575
5581
  'legend',
5582
+ 'regionPadding',
5576
5583
  'tooltip',
5577
5584
  'xAxis',
5578
5585
  'yAxis',
@@ -5612,7 +5619,8 @@ self.R = R;
5612
5619
  'annotationPoint',
5613
5620
  'annotationHorizontalLine',
5614
5621
  'annotationVerticalLine',
5615
- 'annotationArea'
5622
+ 'annotationArea',
5623
+ 'annotationDifferenceLine'
5616
5624
  ]);
5617
5625
  return {
5618
5626
  ...advancedVSeed,
@@ -5686,6 +5694,23 @@ self.R = R;
5686
5694
  result.animation = true;
5687
5695
  return result;
5688
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
+ };
5689
5714
  const color_color = (spec, context)=>{
5690
5715
  const result = {
5691
5716
  ...spec
@@ -7070,6 +7095,426 @@ self.R = R;
7070
7095
  };
7071
7096
  };
7072
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
+ };
7073
7518
  const annotationVerticalLine_annotationVerticalLine = (spec, context)=>{
7074
7519
  const { advancedVSeed, vseed } = context;
7075
7520
  const { annotation, config } = advancedVSeed;
@@ -8713,6 +9158,7 @@ self.R = R;
8713
9158
  const line_line = [
8714
9159
  fontFamilyTheme,
8715
9160
  initLine,
9161
+ regionPadding,
8716
9162
  colorAdapter(color_color, linearColor),
8717
9163
  background_backgroundColor,
8718
9164
  datasetXY,
@@ -8730,6 +9176,7 @@ self.R = R;
8730
9176
  titleEncoding: 'x'
8731
9177
  }),
8732
9178
  annotationPoint_annotationPoint,
9179
+ annotationDifferenceLine_annotationDifferenceLine,
8733
9180
  annotationVerticalLine_annotationVerticalLine,
8734
9181
  annotationHorizontalLine_annotationHorizontalLine,
8735
9182
  annotationArea_annotationArea,
@@ -8743,6 +9190,7 @@ self.R = R;
8743
9190
  pivotIndicators_pivotIndicators([
8744
9191
  fontFamilyTheme,
8745
9192
  initLine,
9193
+ regionPadding,
8746
9194
  colorAdapter(color_color, linearColor),
8747
9195
  background_backgroundColor,
8748
9196
  datasetXY,
@@ -8759,6 +9207,7 @@ self.R = R;
8759
9207
  titleEncoding: 'x'
8760
9208
  }),
8761
9209
  annotationPoint_annotationPoint,
9210
+ annotationDifferenceLine_annotationDifferenceLine,
8762
9211
  annotationVerticalLine_annotationVerticalLine,
8763
9212
  annotationHorizontalLine_annotationHorizontalLine,
8764
9213
  annotationArea_annotationArea,
@@ -8856,6 +9305,7 @@ self.R = R;
8856
9305
  'color',
8857
9306
  'label',
8858
9307
  'legend',
9308
+ 'regionPadding',
8859
9309
  'tooltip',
8860
9310
  'xAxis',
8861
9311
  'yAxis',
@@ -9742,6 +10192,7 @@ self.R = R;
9742
10192
  const column_column = [
9743
10193
  fontFamilyTheme,
9744
10194
  initColumn,
10195
+ regionPadding,
9745
10196
  stackCornerRadius_stackCornerRadius,
9746
10197
  barMaxWidth_barMaxWidth,
9747
10198
  stackInverse,
@@ -9762,6 +10213,7 @@ self.R = R;
9762
10213
  annotationPoint_annotationPoint,
9763
10214
  annotationVerticalLine_annotationVerticalLine,
9764
10215
  annotationHorizontalLine_annotationHorizontalLine,
10216
+ annotationDifferenceLine_annotationDifferenceLine,
9765
10217
  annotationAreaBand,
9766
10218
  columnPolynomialRegressionLine
9767
10219
  ];
@@ -9773,6 +10225,7 @@ self.R = R;
9773
10225
  pivotIndicators_pivotIndicators([
9774
10226
  fontFamilyTheme,
9775
10227
  initColumn,
10228
+ regionPadding,
9776
10229
  stackCornerRadius_stackCornerRadius,
9777
10230
  barMaxWidth_barMaxWidth,
9778
10231
  stackInverse,
@@ -9792,6 +10245,7 @@ self.R = R;
9792
10245
  annotationPoint_annotationPoint,
9793
10246
  annotationVerticalLine_annotationVerticalLine,
9794
10247
  annotationHorizontalLine_annotationHorizontalLine,
10248
+ annotationDifferenceLine_annotationDifferenceLine,
9795
10249
  annotationAreaBand,
9796
10250
  columnPolynomialRegressionLine
9797
10251
  ]),
@@ -9957,6 +10411,7 @@ self.R = R;
9957
10411
  const columnParallel = [
9958
10412
  fontFamilyTheme,
9959
10413
  initColumnParallel,
10414
+ regionPadding,
9960
10415
  stackCornerRadius_stackCornerRadius,
9961
10416
  barMaxWidth_barMaxWidth,
9962
10417
  barGapInGroup_barGapInGroup,
@@ -9977,6 +10432,7 @@ self.R = R;
9977
10432
  annotationPoint_annotationPoint,
9978
10433
  annotationVerticalLine_annotationVerticalLine,
9979
10434
  annotationHorizontalLine_annotationHorizontalLine,
10435
+ annotationDifferenceLine_annotationDifferenceLine,
9980
10436
  annotationAreaBand
9981
10437
  ];
9982
10438
  const pivotColumnParallel = [
@@ -9987,6 +10443,7 @@ self.R = R;
9987
10443
  pivotIndicators_pivotIndicators([
9988
10444
  fontFamilyTheme,
9989
10445
  initColumnParallel,
10446
+ regionPadding,
9990
10447
  stackCornerRadius_stackCornerRadius,
9991
10448
  barMaxWidth_barMaxWidth,
9992
10449
  colorAdapter(color_color, linearColor),
@@ -10005,6 +10462,7 @@ self.R = R;
10005
10462
  annotationPoint_annotationPoint,
10006
10463
  annotationVerticalLine_annotationVerticalLine,
10007
10464
  annotationHorizontalLine_annotationHorizontalLine,
10465
+ annotationDifferenceLine_annotationDifferenceLine,
10008
10466
  annotationAreaBand
10009
10467
  ]),
10010
10468
  pivotRowDimensions,
@@ -10062,6 +10520,7 @@ self.R = R;
10062
10520
  const columnPercent = [
10063
10521
  fontFamilyTheme,
10064
10522
  initColumn,
10523
+ regionPadding,
10065
10524
  stackCornerRadius_stackCornerRadius,
10066
10525
  stackInverse,
10067
10526
  barMaxWidth_barMaxWidth,
@@ -10093,6 +10552,7 @@ self.R = R;
10093
10552
  pivotIndicators_pivotIndicators([
10094
10553
  fontFamilyTheme,
10095
10554
  initColumn,
10555
+ regionPadding,
10096
10556
  stackCornerRadius_stackCornerRadius,
10097
10557
  stackInverse,
10098
10558
  barMaxWidth_barMaxWidth,
@@ -10442,6 +10902,7 @@ self.R = R;
10442
10902
  const bar = [
10443
10903
  fontFamilyTheme,
10444
10904
  initBar,
10905
+ regionPadding,
10445
10906
  stackCornerRadius_stackCornerRadius,
10446
10907
  barMaxWidth_barMaxWidth,
10447
10908
  colorAdapter(color_color, linearColor),
@@ -10461,6 +10922,7 @@ self.R = R;
10461
10922
  annotationPoint_annotationPoint,
10462
10923
  annotationVerticalLine_annotationVerticalLine,
10463
10924
  annotationHorizontalLine_annotationHorizontalLine,
10925
+ annotationDifferenceLine_annotationDifferenceLine,
10464
10926
  annotationAreaBand
10465
10927
  ];
10466
10928
  const pivotBar = [
@@ -10471,6 +10933,7 @@ self.R = R;
10471
10933
  pivotIndicators_pivotIndicators([
10472
10934
  fontFamilyTheme,
10473
10935
  initBar,
10936
+ regionPadding,
10474
10937
  stackCornerRadius_stackCornerRadius,
10475
10938
  barMaxWidth_barMaxWidth,
10476
10939
  colorAdapter(color_color, linearColor),
@@ -10489,6 +10952,7 @@ self.R = R;
10489
10952
  annotationPoint_annotationPoint,
10490
10953
  annotationVerticalLine_annotationVerticalLine,
10491
10954
  annotationHorizontalLine_annotationHorizontalLine,
10955
+ annotationDifferenceLine_annotationDifferenceLine,
10492
10956
  annotationAreaBand
10493
10957
  ]),
10494
10958
  pivotRowDimensions,
@@ -13191,6 +13655,7 @@ self.R = R;
13191
13655
  const barParallel = [
13192
13656
  fontFamilyTheme,
13193
13657
  initBarParallel,
13658
+ regionPadding,
13194
13659
  stackCornerRadius_stackCornerRadius,
13195
13660
  barMaxWidth_barMaxWidth,
13196
13661
  barGapInGroup_barGapInGroup,
@@ -13211,6 +13676,7 @@ self.R = R;
13211
13676
  annotationPoint_annotationPoint,
13212
13677
  annotationVerticalLine_annotationVerticalLine,
13213
13678
  annotationHorizontalLine_annotationHorizontalLine,
13679
+ annotationDifferenceLine_annotationDifferenceLine,
13214
13680
  annotationAreaBand
13215
13681
  ];
13216
13682
  const pivotBarParallel = [
@@ -13221,6 +13687,7 @@ self.R = R;
13221
13687
  pivotIndicators_pivotIndicators([
13222
13688
  fontFamilyTheme,
13223
13689
  initBarParallel,
13690
+ regionPadding,
13224
13691
  stackCornerRadius_stackCornerRadius,
13225
13692
  barMaxWidth_barMaxWidth,
13226
13693
  colorAdapter(color_color, linearColor),
@@ -13238,6 +13705,7 @@ self.R = R;
13238
13705
  annotationPoint_annotationPoint,
13239
13706
  annotationVerticalLine_annotationVerticalLine,
13240
13707
  annotationHorizontalLine_annotationHorizontalLine,
13708
+ annotationDifferenceLine_annotationDifferenceLine,
13241
13709
  annotationAreaBand
13242
13710
  ]),
13243
13711
  pivotRowDimensions,
@@ -13288,6 +13756,7 @@ self.R = R;
13288
13756
  const barPercent = [
13289
13757
  fontFamilyTheme,
13290
13758
  initBar,
13759
+ regionPadding,
13291
13760
  stackCornerRadius_stackCornerRadius,
13292
13761
  barMaxWidth_barMaxWidth,
13293
13762
  colorAdapter(color_color, linearColor),
@@ -13318,6 +13787,7 @@ self.R = R;
13318
13787
  pivotIndicators_pivotIndicators([
13319
13788
  fontFamilyTheme,
13320
13789
  initBar,
13790
+ regionPadding,
13321
13791
  stackCornerRadius_stackCornerRadius,
13322
13792
  barMaxWidth_barMaxWidth,
13323
13793
  colorAdapter(color_color, linearColor),
@@ -13475,6 +13945,7 @@ self.R = R;
13475
13945
  const area_area = [
13476
13946
  fontFamilyTheme,
13477
13947
  initArea,
13948
+ regionPadding,
13478
13949
  stackInverse,
13479
13950
  colorAdapter(color_color, linearColor),
13480
13951
  background_backgroundColor,
@@ -13494,6 +13965,7 @@ self.R = R;
13494
13965
  colorLineStyleFill(lineStyle_lineStyle),
13495
13966
  colorAreaStyleFill(areaStyle_areaStyle),
13496
13967
  annotationPoint_annotationPoint,
13968
+ annotationDifferenceLine_annotationDifferenceLine,
13497
13969
  annotationVerticalLine_annotationVerticalLine,
13498
13970
  annotationHorizontalLine_annotationHorizontalLine,
13499
13971
  annotationArea_annotationArea,
@@ -13507,6 +13979,7 @@ self.R = R;
13507
13979
  pivotIndicators_pivotIndicators([
13508
13980
  fontFamilyTheme,
13509
13981
  initArea,
13982
+ regionPadding,
13510
13983
  colorAdapter(color_color, linearColor),
13511
13984
  background_backgroundColor,
13512
13985
  stackInverse,
@@ -13525,6 +13998,7 @@ self.R = R;
13525
13998
  colorLineStyleFill(lineStyle_lineStyle),
13526
13999
  colorAreaStyleFill(areaStyle_areaStyle),
13527
14000
  annotationPoint_annotationPoint,
14001
+ annotationDifferenceLine_annotationDifferenceLine,
13528
14002
  annotationVerticalLine_annotationVerticalLine,
13529
14003
  annotationHorizontalLine_annotationHorizontalLine,
13530
14004
  annotationArea_annotationArea,
@@ -13578,6 +14052,7 @@ self.R = R;
13578
14052
  const areaPercent = [
13579
14053
  fontFamilyTheme,
13580
14054
  initArea,
14055
+ regionPadding,
13581
14056
  stackInverse,
13582
14057
  colorAdapter(color_color, linearColor),
13583
14058
  background_backgroundColor,
@@ -13610,6 +14085,7 @@ self.R = R;
13610
14085
  pivotIndicators_pivotIndicators([
13611
14086
  fontFamilyTheme,
13612
14087
  initArea,
14088
+ regionPadding,
13613
14089
  stackInverse,
13614
14090
  colorAdapter(color_color, linearColor),
13615
14091
  background_backgroundColor,
@@ -19389,6 +19865,15 @@ self.R = R;
19389
19865
  textBackgroundBorderColor: '#BCC1CB'
19390
19866
  });
19391
19867
  const getLightAnnotationVerticalLine = ()=>getLightAnnotationHorizontalLine();
19868
+ const getDefaultAnnotationDifferenceLine = ()=>({
19869
+ textFontSize: 12
19870
+ });
19871
+ const getLightAnnotationDifferenceLine = ()=>({
19872
+ ...getDefaultAnnotationDifferenceLine(),
19873
+ lineColor: '#BCC1CB',
19874
+ textColor: '#ffffff',
19875
+ textBackgroundColor: '#BCC1CB'
19876
+ });
19392
19877
  const getDefaultAnnotationArea = ()=>({
19393
19878
  textFontSize: 12,
19394
19879
  textFontWeight: 400,
@@ -19417,6 +19902,7 @@ self.R = R;
19417
19902
  annotationPoint: getLightAnnotationPoint(),
19418
19903
  annotationHorizontalLine: getLightAnnotationHorizontalLine(),
19419
19904
  annotationVerticalLine: getLightAnnotationVerticalLine(),
19905
+ annotationDifferenceLine: getLightAnnotationDifferenceLine(),
19420
19906
  annotationArea: getLightAnnotationArea()
19421
19907
  });
19422
19908
  const getDarkAnnotationPoint = ()=>({
@@ -19433,6 +19919,12 @@ self.R = R;
19433
19919
  textBackgroundBorderColor: '#55595F'
19434
19920
  });
19435
19921
  const getDarkAnnotationVerticalLine = ()=>getDarkAnnotationHorizontalLine();
19922
+ const getDarkAnnotationDifferenceLine = ()=>({
19923
+ ...getDefaultAnnotationDifferenceLine(),
19924
+ lineColor: '#55595F',
19925
+ textColor: '#E2E3E6',
19926
+ textBackgroundColor: '#55595F'
19927
+ });
19436
19928
  const getDarkAnnotationArea = ()=>({
19437
19929
  ...getDefaultAnnotationArea(),
19438
19930
  textColor: '#E2E3E6',
@@ -19446,6 +19938,7 @@ self.R = R;
19446
19938
  annotationPoint: getDarkAnnotationPoint(),
19447
19939
  annotationHorizontalLine: getDarkAnnotationHorizontalLine(),
19448
19940
  annotationVerticalLine: getDarkAnnotationVerticalLine(),
19941
+ annotationDifferenceLine: getDarkAnnotationDifferenceLine(),
19449
19942
  annotationArea: getDarkAnnotationArea()
19450
19943
  });
19451
19944
  const getLightLinearAxis = ()=>({
@@ -25094,6 +25587,30 @@ self.R = R;
25094
25587
  offsetY: schemas_number().default(0).nullish(),
25095
25588
  offsetX: schemas_number().default(0).nullish()
25096
25589
  });
25590
+ const zDifferenceSelector = union([
25591
+ zPartialSelector,
25592
+ zMeasureSelector,
25593
+ zDimensionSelector
25594
+ ]);
25595
+ const zDifferenceSelectors = schemas_array(zDifferenceSelector);
25596
+ const zDifferenceAnchor = schemas_object({
25597
+ selector: union([
25598
+ zDifferenceSelector,
25599
+ zDifferenceSelectors
25600
+ ])
25601
+ });
25602
+ const zAnnotationDifferenceLine = schemas_object({
25603
+ start: zDifferenceAnchor,
25604
+ end: zDifferenceAnchor,
25605
+ differenceType: schemas_enum([
25606
+ 'absolute',
25607
+ 'percent'
25608
+ ]).nullish(),
25609
+ textFontSize: schemas_number().nullish(),
25610
+ textColor: schemas_string().nullish(),
25611
+ textBackgroundColor: schemas_string().nullish(),
25612
+ lineColor: schemas_string().nullish()
25613
+ });
25097
25614
  const zAnnotationHorizontalLine = schemas_object({
25098
25615
  yValue: union([
25099
25616
  schemas_number(),
@@ -25229,11 +25746,18 @@ self.R = R;
25229
25746
  areaLineDash: true,
25230
25747
  outerPadding: true
25231
25748
  }).partial();
25749
+ const zAnnotationDifferenceLineConfig = zAnnotationDifferenceLine.pick({
25750
+ lineColor: true,
25751
+ textColor: true,
25752
+ textFontSize: true,
25753
+ textBackgroundColor: true
25754
+ }).partial();
25232
25755
  const zAnnotationConfig = schemas_object({
25233
25756
  annotationPoint: zAnnotationPointConfig.nullish(),
25234
25757
  annotationHorizontalLine: zAnnotationHorizontalLineConfig.nullish(),
25235
25758
  annotationVerticalLine: zAnnotationVerticalLineConfig.nullish(),
25236
- annotationArea: zAnnotationAreaConfig.nullish()
25759
+ annotationArea: zAnnotationAreaConfig.nullish(),
25760
+ annotationDifferenceLine: zAnnotationDifferenceLineConfig.nullish()
25237
25761
  });
25238
25762
  const zPivotChartGridConfig = schemas_object({
25239
25763
  borderColor: schemas_string().nullish(),
@@ -25260,6 +25784,13 @@ self.R = R;
25260
25784
  showTooltip: schemas_boolean().nullish(),
25261
25785
  showLabel: schemas_boolean().nullish()
25262
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);
25263
25794
  const zBrushStyleConfig = schemas_object({
25264
25795
  opacity: schemas_number().optional(),
25265
25796
  stroke: schemas_string().optional(),
@@ -25292,6 +25823,7 @@ self.R = R;
25292
25823
  color: zColor.nullish(),
25293
25824
  tooltip: zTooltip.nullish(),
25294
25825
  legend: zLegend.nullish(),
25826
+ regionPadding: zRegionPadding.nullish(),
25295
25827
  xAxis: zXBandAxis.nullish(),
25296
25828
  yAxis: zYLinearAxis.nullish(),
25297
25829
  crosshairLine: zCrosshairLine.nullish(),
@@ -25347,6 +25879,7 @@ self.R = R;
25347
25879
  color: zColor.nullish(),
25348
25880
  tooltip: zTooltip.nullish(),
25349
25881
  legend: zLegend.nullish(),
25882
+ regionPadding: zRegionPadding.nullish(),
25350
25883
  xAxis: zXBandAxis.nullish(),
25351
25884
  yAxis: zYLinearAxis.nullish(),
25352
25885
  crosshairRect: zCrosshairRect.nullish(),
@@ -25368,6 +25901,7 @@ self.R = R;
25368
25901
  color: zColor.nullish(),
25369
25902
  tooltip: zTooltip.nullish(),
25370
25903
  legend: zLegend.nullish(),
25904
+ regionPadding: zRegionPadding.nullish(),
25371
25905
  xAxis: zXLinearAxis.nullish(),
25372
25906
  yAxis: zYBandAxis.nullish(),
25373
25907
  crosshairRect: zCrosshairRect.nullish(),
@@ -25385,6 +25919,7 @@ self.R = R;
25385
25919
  color: zColor.nullish(),
25386
25920
  tooltip: zTooltip.nullish(),
25387
25921
  legend: zLegend.nullish(),
25922
+ regionPadding: zRegionPadding.nullish(),
25388
25923
  xAxis: zXBandAxis.nullish(),
25389
25924
  yAxis: zYLinearAxis.nullish(),
25390
25925
  crosshairLine: zCrosshairLine.nullish(),
@@ -25789,7 +26324,8 @@ self.R = R;
25789
26324
  annotationPoint: zAnnotationPoint.or(schemas_array(zAnnotationPoint)).nullish(),
25790
26325
  annotationVerticalLine: zAnnotationVerticalLine.or(schemas_array(zAnnotationVerticalLine)).nullish(),
25791
26326
  annotationHorizontalLine: zAnnotationHorizontalLine.or(schemas_array(zAnnotationHorizontalLine)).nullish(),
25792
- annotationArea: zAnnotationArea.or(schemas_array(zAnnotationArea)).nullish()
26327
+ annotationArea: zAnnotationArea.or(schemas_array(zAnnotationArea)).nullish(),
26328
+ annotationDifferenceLine: zAnnotationDifferenceLine.or(schemas_array(zAnnotationDifferenceLine)).nullish()
25793
26329
  });
25794
26330
  const zSort = schemas_object({
25795
26331
  order: schemas_enum([
@@ -25920,6 +26456,7 @@ self.R = R;
25920
26456
  color: zColor.nullish(),
25921
26457
  label: zLabel.nullish(),
25922
26458
  legend: zLegend.nullish(),
26459
+ regionPadding: zRegionPadding.nullish(),
25923
26460
  tooltip: zTooltip.nullish(),
25924
26461
  brush: zBrush.nullish(),
25925
26462
  xAxis: zXBandAxis.nullish(),
@@ -25934,6 +26471,7 @@ self.R = R;
25934
26471
  annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).nullish(),
25935
26472
  annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).nullish(),
25936
26473
  annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).nullish(),
26474
+ annotationDifferenceLine: schemas_array(zAnnotationDifferenceLine).or(zAnnotationDifferenceLine).nullish(),
25937
26475
  dimensionLinkage: zDimensionLinkage.nullish(),
25938
26476
  locale: zLocale.nullish()
25939
26477
  });
@@ -25949,6 +26487,7 @@ self.R = R;
25949
26487
  color: zColor.nullish(),
25950
26488
  label: zLabel.nullish(),
25951
26489
  legend: zLegend.nullish(),
26490
+ regionPadding: zRegionPadding.nullish(),
25952
26491
  tooltip: zTooltip.nullish(),
25953
26492
  brush: zBrush.nullish(),
25954
26493
  xAxis: zXBandAxis.nullish(),
@@ -25964,6 +26503,7 @@ self.R = R;
25964
26503
  annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).nullish(),
25965
26504
  annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).nullish(),
25966
26505
  annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).nullish(),
26506
+ annotationDifferenceLine: schemas_array(zAnnotationDifferenceLine).or(zAnnotationDifferenceLine).nullish(),
25967
26507
  polynomialRegressionLine: schemas_array(zPolynomialRegressionLine).or(zPolynomialRegressionLine).nullish(),
25968
26508
  dimensionLinkage: zDimensionLinkage.nullish(),
25969
26509
  locale: zLocale.nullish()
@@ -25980,6 +26520,7 @@ self.R = R;
25980
26520
  color: zColor.nullish(),
25981
26521
  label: zLabel.nullish(),
25982
26522
  legend: zLegend.nullish(),
26523
+ regionPadding: zRegionPadding.nullish(),
25983
26524
  tooltip: zTooltip.nullish(),
25984
26525
  brush: zBrush.nullish(),
25985
26526
  xAxis: zXBandAxis.nullish(),
@@ -25994,6 +26535,7 @@ self.R = R;
25994
26535
  annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).nullish(),
25995
26536
  annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).nullish(),
25996
26537
  annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).nullish(),
26538
+ annotationDifferenceLine: schemas_array(zAnnotationDifferenceLine).or(zAnnotationDifferenceLine).nullish(),
25997
26539
  dimensionLinkage: zDimensionLinkage.nullish(),
25998
26540
  locale: zLocale.nullish()
25999
26541
  });
@@ -26008,6 +26550,7 @@ self.R = R;
26008
26550
  color: zColor.nullish(),
26009
26551
  label: zLabel.nullish(),
26010
26552
  legend: zLegend.nullish(),
26553
+ regionPadding: zRegionPadding.nullish(),
26011
26554
  tooltip: zTooltip.nullish(),
26012
26555
  brush: zBrush.nullish(),
26013
26556
  xAxis: zXBandAxis.nullish(),
@@ -26035,6 +26578,7 @@ self.R = R;
26035
26578
  color: zColor.nullish(),
26036
26579
  label: zLabel.nullish(),
26037
26580
  legend: zLegend.nullish(),
26581
+ regionPadding: zRegionPadding.nullish(),
26038
26582
  tooltip: zTooltip.nullish(),
26039
26583
  brush: zBrush.nullish(),
26040
26584
  xAxis: zXLinearAxis.nullish(),
@@ -26048,6 +26592,7 @@ self.R = R;
26048
26592
  annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).nullish(),
26049
26593
  annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).nullish(),
26050
26594
  annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).nullish(),
26595
+ annotationDifferenceLine: schemas_array(zAnnotationDifferenceLine).or(zAnnotationDifferenceLine).nullish(),
26051
26596
  dimensionLinkage: zDimensionLinkage.nullish(),
26052
26597
  locale: zLocale.nullish()
26053
26598
  });
@@ -26179,6 +26724,7 @@ self.R = R;
26179
26724
  color: zColor.nullish(),
26180
26725
  label: zLabel.nullish(),
26181
26726
  legend: zLegend.nullish(),
26727
+ regionPadding: zRegionPadding.nullish(),
26182
26728
  tooltip: zTooltip.nullish(),
26183
26729
  brush: zBrush.nullish(),
26184
26730
  xAxis: zXLinearAxis.nullish(),
@@ -26193,6 +26739,7 @@ self.R = R;
26193
26739
  annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).nullish(),
26194
26740
  annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).nullish(),
26195
26741
  annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).nullish(),
26742
+ annotationDifferenceLine: schemas_array(zAnnotationDifferenceLine).or(zAnnotationDifferenceLine).nullish(),
26196
26743
  dimensionLinkage: zDimensionLinkage.nullish(),
26197
26744
  locale: zLocale.nullish(),
26198
26745
  page: zPage.nullish()
@@ -26208,6 +26755,7 @@ self.R = R;
26208
26755
  color: zColor.nullish(),
26209
26756
  label: zLabel.nullish(),
26210
26757
  legend: zLegend.nullish(),
26758
+ regionPadding: zRegionPadding.nullish(),
26211
26759
  tooltip: zTooltip.nullish(),
26212
26760
  brush: zBrush.nullish(),
26213
26761
  xAxis: zXLinearAxis.nullish(),
@@ -26235,6 +26783,7 @@ self.R = R;
26235
26783
  color: zColor.nullish(),
26236
26784
  label: zLabel.nullish(),
26237
26785
  legend: zLegend.nullish(),
26786
+ regionPadding: zRegionPadding.nullish(),
26238
26787
  tooltip: zTooltip.nullish(),
26239
26788
  brush: zBrush.nullish(),
26240
26789
  xAxis: zXBandAxis.nullish(),
@@ -26248,6 +26797,7 @@ self.R = R;
26248
26797
  annotationVerticalLine: schemas_array(zAnnotationVerticalLine).or(zAnnotationVerticalLine).nullish(),
26249
26798
  annotationHorizontalLine: schemas_array(zAnnotationHorizontalLine).or(zAnnotationHorizontalLine).nullish(),
26250
26799
  annotationArea: schemas_array(zAnnotationArea).or(zAnnotationArea).nullish(),
26800
+ annotationDifferenceLine: schemas_array(zAnnotationDifferenceLine).or(zAnnotationDifferenceLine).nullish(),
26251
26801
  dimensionLinkage: zDimensionLinkage.nullish(),
26252
26802
  locale: zLocale.nullish()
26253
26803
  });
@@ -26262,6 +26812,7 @@ self.R = R;
26262
26812
  color: zColor.nullish(),
26263
26813
  label: zLabel.nullish(),
26264
26814
  legend: zLegend.nullish(),
26815
+ regionPadding: zRegionPadding.nullish(),
26265
26816
  tooltip: zTooltip.nullish(),
26266
26817
  brush: zBrush.nullish(),
26267
26818
  xAxis: zXBandAxis.nullish(),
@@ -26803,6 +27354,9 @@ self.R = R;
26803
27354
  annotationVerticalLine: {
26804
27355
  textFontSize: tokens.labelFontSize
26805
27356
  },
27357
+ annotationDifferenceLine: {
27358
+ textFontSize: tokens.labelFontSize
27359
+ },
26806
27360
  annotationArea: {
26807
27361
  textFontSize: tokens.labelFontSize
26808
27362
  }