@visactor/vseed 0.4.23 → 0.4.25

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 (89) 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/spec/chart/pipeline/bar.js +3 -1
  6. package/dist/esm/pipeline/spec/chart/pipeline/bar.js.map +1 -1
  7. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js +3 -1
  8. package/dist/esm/pipeline/spec/chart/pipeline/barParallel.js.map +1 -1
  9. package/dist/esm/pipeline/spec/chart/pipeline/column.js +3 -1
  10. package/dist/esm/pipeline/spec/chart/pipeline/column.js.map +1 -1
  11. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js +3 -1
  12. package/dist/esm/pipeline/spec/chart/pipeline/columnParallel.js.map +1 -1
  13. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.d.ts +2 -0
  14. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js +134 -0
  15. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js.map +1 -0
  16. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLineCommon.d.ts +27 -0
  17. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLineCommon.js +167 -0
  18. package/dist/esm/pipeline/spec/chart/pipes/annotation/annotationDifferenceLineCommon.js.map +1 -0
  19. package/dist/esm/pipeline/spec/chart/pipes/annotation/index.d.ts +1 -0
  20. package/dist/esm/pipeline/spec/chart/pipes/annotation/index.js +1 -0
  21. package/dist/esm/theme/common/annotaion.d.ts +6 -1
  22. package/dist/esm/theme/common/annotaion.js +18 -1
  23. package/dist/esm/theme/common/annotaion.js.map +1 -1
  24. package/dist/esm/theme/dark/area.d.ts +2 -0
  25. package/dist/esm/theme/dark/bar.d.ts +3 -0
  26. package/dist/esm/theme/dark/boxPlot.d.ts +1 -0
  27. package/dist/esm/theme/dark/column.d.ts +3 -0
  28. package/dist/esm/theme/dark/dualAxis.d.ts +1 -0
  29. package/dist/esm/theme/dark/histogram.d.ts +1 -0
  30. package/dist/esm/theme/dark/line.d.ts +1 -0
  31. package/dist/esm/theme/dark/race.d.ts +3 -0
  32. package/dist/esm/theme/dark/raceLine.d.ts +1 -0
  33. package/dist/esm/theme/dark/scatter.d.ts +1 -0
  34. package/dist/esm/theme/light/area.d.ts +2 -0
  35. package/dist/esm/theme/light/bar.d.ts +3 -0
  36. package/dist/esm/theme/light/boxPlot.d.ts +1 -0
  37. package/dist/esm/theme/light/column.d.ts +3 -0
  38. package/dist/esm/theme/light/dualAxis.d.ts +1 -0
  39. package/dist/esm/theme/light/histogram.d.ts +1 -0
  40. package/dist/esm/theme/light/line.d.ts +1 -0
  41. package/dist/esm/theme/light/race.d.ts +3 -0
  42. package/dist/esm/theme/light/raceLine.d.ts +1 -0
  43. package/dist/esm/theme/light/scatter.d.ts +1 -0
  44. package/dist/esm/theme/tokenTheme.js +3 -0
  45. package/dist/esm/theme/tokenTheme.js.map +1 -1
  46. package/dist/esm/types/chartType/bar/bar.d.ts +5 -1
  47. package/dist/esm/types/chartType/bar/zBar.d.ts +303 -0
  48. package/dist/esm/types/chartType/bar/zBar.js +2 -1
  49. package/dist/esm/types/chartType/bar/zBar.js.map +1 -1
  50. package/dist/esm/types/chartType/barParallel/barParallel.d.ts +5 -1
  51. package/dist/esm/types/chartType/barParallel/zBarParallel.d.ts +303 -0
  52. package/dist/esm/types/chartType/barParallel/zBarParallel.js +2 -1
  53. package/dist/esm/types/chartType/barParallel/zBarParallel.js.map +1 -1
  54. package/dist/esm/types/chartType/column/column.d.ts +5 -1
  55. package/dist/esm/types/chartType/column/zColumn.d.ts +303 -0
  56. package/dist/esm/types/chartType/column/zColumn.js +2 -1
  57. package/dist/esm/types/chartType/column/zColumn.js.map +1 -1
  58. package/dist/esm/types/chartType/columnParallel/columnParallel.d.ts +5 -1
  59. package/dist/esm/types/chartType/columnParallel/zColumnParallel.d.ts +303 -0
  60. package/dist/esm/types/chartType/columnParallel/zColumnParallel.js +2 -1
  61. package/dist/esm/types/chartType/columnParallel/zColumnParallel.js.map +1 -1
  62. package/dist/esm/types/properties/annotation/annotation.d.ts +303 -0
  63. package/dist/esm/types/properties/annotation/annotation.js +3 -1
  64. package/dist/esm/types/properties/annotation/annotation.js.map +1 -1
  65. package/dist/esm/types/properties/annotation/annotationDifferenceLine.d.ts +51 -0
  66. package/dist/esm/types/properties/annotation/annotationDifferenceLine.js +0 -0
  67. package/dist/esm/types/properties/annotation/index.d.ts +2 -0
  68. package/dist/esm/types/properties/annotation/index.js +1 -0
  69. package/dist/esm/types/properties/annotation/zAnnotationDifferenceLine.d.ts +294 -0
  70. package/dist/esm/types/properties/annotation/zAnnotationDifferenceLine.js +29 -0
  71. package/dist/esm/types/properties/annotation/zAnnotationDifferenceLine.js.map +1 -0
  72. package/dist/esm/types/properties/config/annotation/annotation.d.ts +2 -0
  73. package/dist/esm/types/properties/config/annotation/zAnnotation.d.ts +12 -0
  74. package/dist/esm/types/properties/config/annotation/zAnnotation.js +10 -2
  75. package/dist/esm/types/properties/config/annotation/zAnnotation.js.map +1 -1
  76. package/dist/esm/types/properties/config/area.d.ts +12 -0
  77. package/dist/esm/types/properties/config/bar.d.ts +18 -0
  78. package/dist/esm/types/properties/config/boxplot.d.ts +6 -0
  79. package/dist/esm/types/properties/config/column.d.ts +18 -0
  80. package/dist/esm/types/properties/config/config.d.ts +114 -0
  81. package/dist/esm/types/properties/config/dualAxis.d.ts +6 -0
  82. package/dist/esm/types/properties/config/histogram.d.ts +6 -0
  83. package/dist/esm/types/properties/config/line.d.ts +6 -0
  84. package/dist/esm/types/properties/config/race.d.ts +36 -0
  85. package/dist/esm/types/properties/config/scatter.d.ts +6 -0
  86. package/dist/esm/types/properties/theme/customTheme.d.ts +228 -0
  87. package/dist/umd/index.js +366 -6
  88. package/dist/umd/index.js.map +1 -1
  89. package/package.json +1 -1
@@ -5,7 +5,8 @@ const annotation_annotation = (advancedVSeed, context)=>{
5
5
  'annotationPoint',
6
6
  'annotationHorizontalLine',
7
7
  'annotationVerticalLine',
8
- 'annotationArea'
8
+ 'annotationArea',
9
+ 'annotationDifferenceLine'
9
10
  ]);
10
11
  return {
11
12
  ...advancedVSeed,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/advanced/chart/pipes/annotation/annotation.js","sources":["../../../../../../../src/pipeline/advanced/chart/pipes/annotation/annotation.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport type { AdvancedPipe, AdvancedVSeed } from 'src/types'\n\nexport const annotation: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const annotation = pick(vseed, [\n 'annotationPoint',\n 'annotationHorizontalLine',\n 'annotationVerticalLine',\n 'annotationArea',\n ]) as AdvancedVSeed['annotation']\n\n return { ...advancedVSeed, annotation }\n}\n"],"names":["annotation","advancedVSeed","context","vseed","pick"],"mappings":";AAGO,MAAMA,wBAA2B,CAACC,eAAeC;IACtD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAMF,aAAaI,KAAKD,OAAO;QAC7B;QACA;QACA;QACA;KACD;IAED,OAAO;QAAE,GAAGF,aAAa;QAAED;IAAW;AACxC"}
1
+ {"version":3,"file":"pipeline/advanced/chart/pipes/annotation/annotation.js","sources":["../../../../../../../src/pipeline/advanced/chart/pipes/annotation/annotation.ts"],"sourcesContent":["import { pick } from 'remeda'\nimport type { AdvancedPipe, AdvancedVSeed } from 'src/types'\n\nexport const annotation: AdvancedPipe = (advancedVSeed, context) => {\n const { vseed } = context\n const annotation = pick(vseed, [\n 'annotationPoint',\n 'annotationHorizontalLine',\n 'annotationVerticalLine',\n 'annotationArea',\n 'annotationDifferenceLine',\n ]) as AdvancedVSeed['annotation']\n\n return { ...advancedVSeed, annotation }\n}\n"],"names":["annotation","advancedVSeed","context","vseed","pick"],"mappings":";AAGO,MAAMA,wBAA2B,CAACC,eAAeC;IACtD,MAAM,EAAEC,KAAK,EAAE,GAAGD;IAClB,MAAMF,aAAaI,KAAKD,OAAO;QAC7B;QACA;QACA;QACA;QACA;KACD;IAED,OAAO;QAAE,GAAGF,aAAa;QAAED;IAAW;AACxC"}
@@ -1,4 +1,4 @@
1
- import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barMaxWidth, barStyle, brush, color, colorAdapter, colorBarStyleFill, colorLegend, datasetPivot, datasetYX, dimensionLinkage, discreteLegend, fontFamilyTheme, horizontalCrosshairRect, initBar, initPivot, label, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsCol, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, tooltip, xLinear, yBand } from "../pipes/index.js";
1
+ import { annotationAreaBand, annotationDifferenceLine, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barMaxWidth, barStyle, brush, color, colorAdapter, colorBarStyleFill, colorLegend, datasetPivot, datasetYX, dimensionLinkage, discreteLegend, fontFamilyTheme, horizontalCrosshairRect, initBar, initPivot, label, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsCol, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, tooltip, xLinear, yBand } from "../pipes/index.js";
2
2
  const bar = [
3
3
  fontFamilyTheme,
4
4
  initBar,
@@ -21,6 +21,7 @@ const bar = [
21
21
  annotationPoint,
22
22
  annotationVerticalLine,
23
23
  annotationHorizontalLine,
24
+ annotationDifferenceLine,
24
25
  annotationAreaBand
25
26
  ];
26
27
  const pivotBar = [
@@ -49,6 +50,7 @@ const pivotBar = [
49
50
  annotationPoint,
50
51
  annotationVerticalLine,
51
52
  annotationHorizontalLine,
53
+ annotationDifferenceLine,
52
54
  annotationAreaBand
53
55
  ]),
54
56
  pivotRowDimensions,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/bar.js","sources":["../../../../../../src/pipeline/spec/chart/pipeline/bar.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n initBar,\n datasetYX,\n xLinear,\n yBand,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsCol,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n horizontalCrosshairRect,\n stackCornerRadius,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n brush,\n fontFamilyTheme,\n} from '../pipes'\n\nconst bar: VChartSpecPipeline = [\n fontFamilyTheme,\n initBar,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n yBand,\n\n label,\n brush,\n tooltip({ titleEncoding: 'y' }),\n colorAdapter(discreteLegend, colorLegend),\n horizontalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotBar: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsCol,\n datasetPivot,\n pivotIndicators([\n fontFamilyTheme,\n initBar,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n pivotAxisStyle(yBand),\n label,\n brush,\n tooltip({ titleEncoding: 'y' }),\n colorBarStyleFill(barStyle),\n horizontalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const barSpecPipeline = [pivotAdapter(bar, pivotBar)]\n"],"names":["bar","fontFamilyTheme","initBar","stackCornerRadius","barMaxWidth","colorAdapter","color","linearColor","backgroundColor","datasetYX","progressive","xLinear","yBand","label","brush","tooltip","discreteLegend","colorLegend","horizontalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotBar","initPivot","pivotGridStyle","pivotIndicatorsAsCol","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","barSpecPipeline","pivotAdapter"],"mappings":";AAyCA,MAAMA,MAA0B;IAC9BC;IACAC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IAEAC;IACAC;IACAC,QAAQ;QAAE,eAAe;IAAI;IAC7BV,aAAaW,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,WAAmC;IACvCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd7B;QACAC;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAoB,eAAenB;QACfC;QACAC;QACAC,QAAQ;YAAE,eAAe;QAAI;QAC7BI,kBAAkBC;QAClBF;QACAG;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACA7B,aAAa8B,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,kBAAkB;IAACC,aAAavC,KAAKyB;CAAU"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/bar.js","sources":["../../../../../../src/pipeline/spec/chart/pipeline/bar.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n initBar,\n datasetYX,\n xLinear,\n yBand,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsCol,\n pivotGridStyle,\n pivotColumnDimensions,\n pivotRowDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationDifferenceLine,\n annotationAreaBand,\n horizontalCrosshairRect,\n stackCornerRadius,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n brush,\n fontFamilyTheme,\n} from '../pipes'\n\nconst bar: VChartSpecPipeline = [\n fontFamilyTheme,\n initBar,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n yBand,\n\n label,\n brush,\n tooltip({ titleEncoding: 'y' }),\n colorAdapter(discreteLegend, colorLegend),\n horizontalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationDifferenceLine,\n annotationAreaBand,\n]\n\nconst pivotBar: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsCol,\n datasetPivot,\n pivotIndicators([\n fontFamilyTheme,\n initBar,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n pivotAxisStyle(yBand),\n label,\n brush,\n tooltip({ titleEncoding: 'y' }),\n colorBarStyleFill(barStyle),\n horizontalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationDifferenceLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const barSpecPipeline = [pivotAdapter(bar, pivotBar)]\n"],"names":["bar","fontFamilyTheme","initBar","stackCornerRadius","barMaxWidth","colorAdapter","color","linearColor","backgroundColor","datasetYX","progressive","xLinear","yBand","label","brush","tooltip","discreteLegend","colorLegend","horizontalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationDifferenceLine","annotationAreaBand","pivotBar","initPivot","pivotGridStyle","pivotIndicatorsAsCol","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","barSpecPipeline","pivotAdapter"],"mappings":";AA0CA,MAAMA,MAA0B;IAC9BC;IACAC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IAEAC;IACAC;IACAC,QAAQ;QAAE,eAAe;IAAI;IAC7BV,aAAaW,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,WAAmC;IACvCC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd9B;QACAC;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAqB,eAAepB;QACfC;QACAC;QACAC,QAAQ;YAAE,eAAe;QAAI;QAC7BI,kBAAkBC;QAClBF;QACAG;QACAC;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACA9B,aAAa+B,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,kBAAkB;IAACC,aAAaxC,KAAK0B;CAAU"}
@@ -1,4 +1,4 @@
1
- import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barGapInGroup, barMaxWidth, barStyle, brush, color, colorAdapter, colorBarStyleFill, colorLegend, datasetPivot, datasetYX, dimensionLinkage, discreteLegend, fontFamilyTheme, horizontalCrosshairRect, initBarParallel, initPivot, label, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsCol, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, tooltip, xLinear, yBand } from "../pipes/index.js";
1
+ import { annotationAreaBand, annotationDifferenceLine, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barGapInGroup, barMaxWidth, barStyle, brush, color, colorAdapter, colorBarStyleFill, colorLegend, datasetPivot, datasetYX, dimensionLinkage, discreteLegend, fontFamilyTheme, horizontalCrosshairRect, initBarParallel, initPivot, label, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsCol, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, tooltip, xLinear, yBand } from "../pipes/index.js";
2
2
  const barParallel = [
3
3
  fontFamilyTheme,
4
4
  initBarParallel,
@@ -22,6 +22,7 @@ const barParallel = [
22
22
  annotationPoint,
23
23
  annotationVerticalLine,
24
24
  annotationHorizontalLine,
25
+ annotationDifferenceLine,
25
26
  annotationAreaBand
26
27
  ];
27
28
  const pivotBarParallel = [
@@ -49,6 +50,7 @@ const pivotBarParallel = [
49
50
  annotationPoint,
50
51
  annotationVerticalLine,
51
52
  annotationHorizontalLine,
53
+ annotationDifferenceLine,
52
54
  annotationAreaBand
53
55
  ]),
54
56
  pivotRowDimensions,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/barParallel.js","sources":["../../../../../../src/pipeline/spec/chart/pipeline/barParallel.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n datasetYX,\n xLinear,\n yBand,\n initBarParallel,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n initPivot,\n datasetPivot,\n pivotDiscreteLegend,\n pivotIndicators,\n pivotAdapter,\n pivotIndicatorsAsCol,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n horizontalCrosshairRect,\n stackCornerRadius,\n progressive,\n linearColor,\n colorAdapter,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n barGapInGroup,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n brush,\n fontFamilyTheme,\n} from '../pipes'\n\nconst barParallel: VChartSpecPipeline = [\n fontFamilyTheme,\n initBarParallel,\n stackCornerRadius,\n barMaxWidth,\n barGapInGroup,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n yBand,\n label,\n brush,\n tooltip({ titleEncoding: 'y' }),\n colorAdapter(discreteLegend, colorLegend),\n horizontalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotBarParallel: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsCol,\n datasetPivot,\n pivotIndicators([\n fontFamilyTheme,\n initBarParallel,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n xLinear,\n pivotAxisStyle(yBand),\n brush,\n label,\n tooltip({ titleEncoding: 'y' }),\n colorBarStyleFill(barStyle),\n horizontalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const barParallelSpecPipeline = [pivotAdapter(barParallel, pivotBarParallel)]\n"],"names":["barParallel","fontFamilyTheme","initBarParallel","stackCornerRadius","barMaxWidth","barGapInGroup","colorAdapter","color","linearColor","backgroundColor","datasetYX","progressive","xLinear","yBand","label","brush","tooltip","discreteLegend","colorLegend","horizontalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotBarParallel","initPivot","pivotGridStyle","pivotIndicatorsAsCol","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","barParallelSpecPipeline","pivotAdapter"],"mappings":";AA0CA,MAAMA,cAAkC;IACtCC;IACAC;IACAC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC,QAAQ;QAAE,eAAe;IAAI;IAC7BV,aAAaW,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,mBAA2C;IAC/CC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd9B;QACAC;QACAC;QACAC;QACAE,aAAaC,OAAOC;QACpBC;QACAC;QACAE;QACAoB,eAAenB;QACfE;QACAD;QACAE,QAAQ;YAAE,eAAe;QAAI;QAC7BI,kBAAkBC;QAClBF;QACAG;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACA7B,aAAa8B,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,0BAA0B;IAACC,aAAaxC,aAAa0B;CAAkB"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/barParallel.js","sources":["../../../../../../src/pipeline/spec/chart/pipeline/barParallel.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n datasetYX,\n xLinear,\n yBand,\n initBarParallel,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n initPivot,\n datasetPivot,\n pivotDiscreteLegend,\n pivotIndicators,\n pivotAdapter,\n pivotIndicatorsAsCol,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationDifferenceLine,\n annotationAreaBand,\n horizontalCrosshairRect,\n stackCornerRadius,\n progressive,\n linearColor,\n colorAdapter,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n barGapInGroup,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n brush,\n fontFamilyTheme,\n} from '../pipes'\n\nconst barParallel: VChartSpecPipeline = [\n fontFamilyTheme,\n initBarParallel,\n stackCornerRadius,\n barMaxWidth,\n barGapInGroup,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n progressive,\n xLinear,\n yBand,\n label,\n brush,\n tooltip({ titleEncoding: 'y' }),\n colorAdapter(discreteLegend, colorLegend),\n horizontalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationDifferenceLine,\n annotationAreaBand,\n]\n\nconst pivotBarParallel: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsCol,\n datasetPivot,\n pivotIndicators([\n fontFamilyTheme,\n initBarParallel,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetYX,\n xLinear,\n pivotAxisStyle(yBand),\n brush,\n label,\n tooltip({ titleEncoding: 'y' }),\n colorBarStyleFill(barStyle),\n horizontalCrosshairRect,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationDifferenceLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const barParallelSpecPipeline = [pivotAdapter(barParallel, pivotBarParallel)]\n"],"names":["barParallel","fontFamilyTheme","initBarParallel","stackCornerRadius","barMaxWidth","barGapInGroup","colorAdapter","color","linearColor","backgroundColor","datasetYX","progressive","xLinear","yBand","label","brush","tooltip","discreteLegend","colorLegend","horizontalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationDifferenceLine","annotationAreaBand","pivotBarParallel","initPivot","pivotGridStyle","pivotIndicatorsAsCol","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","barParallelSpecPipeline","pivotAdapter"],"mappings":";AA2CA,MAAMA,cAAkC;IACtCC;IACAC;IACAC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC,QAAQ;QAAE,eAAe;IAAI;IAC7BV,aAAaW,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,mBAA2C;IAC/CC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd/B;QACAC;QACAC;QACAC;QACAE,aAAaC,OAAOC;QACpBC;QACAC;QACAE;QACAqB,eAAepB;QACfE;QACAD;QACAE,QAAQ;YAAE,eAAe;QAAI;QAC7BI,kBAAkBC;QAClBF;QACAG;QACAC;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACA9B,aAAa+B,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,0BAA0B;IAACC,aAAazC,aAAa2B;CAAkB"}
@@ -1,4 +1,4 @@
1
- import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barMaxWidth, barStyle, brush, color, colorAdapter, colorBarStyleFill, colorLegend, columnPolynomialRegressionLine, datasetPivot, datasetXY, dimensionLinkage, discreteLegend, fontFamilyTheme, initColumn, initPivot, label, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, stackInverse, tooltip, verticalCrosshairRect, xBand, yLinear } from "../pipes/index.js";
1
+ import { annotationAreaBand, annotationDifferenceLine, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barMaxWidth, barStyle, brush, color, colorAdapter, colorBarStyleFill, colorLegend, columnPolynomialRegressionLine, datasetPivot, datasetXY, dimensionLinkage, discreteLegend, fontFamilyTheme, initColumn, initPivot, label, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, stackInverse, tooltip, verticalCrosshairRect, xBand, yLinear } from "../pipes/index.js";
2
2
  const column = [
3
3
  fontFamilyTheme,
4
4
  initColumn,
@@ -22,6 +22,7 @@ const column = [
22
22
  annotationPoint,
23
23
  annotationVerticalLine,
24
24
  annotationHorizontalLine,
25
+ annotationDifferenceLine,
25
26
  annotationAreaBand,
26
27
  columnPolynomialRegressionLine
27
28
  ];
@@ -52,6 +53,7 @@ const pivotColumn = [
52
53
  annotationPoint,
53
54
  annotationVerticalLine,
54
55
  annotationHorizontalLine,
56
+ annotationDifferenceLine,
55
57
  annotationAreaBand,
56
58
  columnPolynomialRegressionLine
57
59
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/column.js","sources":["../../../../../../src/pipeline/spec/chart/pipeline/column.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n initColumn,\n datasetXY,\n xBand,\n yLinear,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n stackInverse,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n verticalCrosshairRect,\n stackCornerRadius,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n columnPolynomialRegressionLine,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n brush,\n fontFamilyTheme,\n} from '../pipes'\n\nconst column: VChartSpecPipeline = [\n fontFamilyTheme,\n initColumn,\n stackCornerRadius,\n barMaxWidth,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n yLinear,\n label,\n brush,\n tooltip({ titleEncoding: 'x' }),\n verticalCrosshairRect,\n colorAdapter(discreteLegend, colorLegend),\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n columnPolynomialRegressionLine,\n]\n\nconst pivotColumn: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n fontFamilyTheme,\n initColumn,\n stackCornerRadius,\n barMaxWidth,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n pivotAxisStyle(yLinear),\n brush,\n label,\n tooltip({ titleEncoding: 'x' }),\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n columnPolynomialRegressionLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const columnSpecPipeline = [pivotAdapter(column, pivotColumn)]\n"],"names":["column","fontFamilyTheme","initColumn","stackCornerRadius","barMaxWidth","stackInverse","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","xBand","yLinear","label","brush","tooltip","verticalCrosshairRect","discreteLegend","colorLegend","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","columnPolynomialRegressionLine","pivotColumn","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","columnSpecPipeline","pivotAdapter"],"mappings":";AA2CA,MAAMA,SAA6B;IACjCC;IACAC;IACAC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC,QAAQ;QAAE,eAAe;IAAI;IAC7BC;IACAX,aAAaY,gBAAgBC;IAC7BC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,cAAsC;IAC1CC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd/B;QACAC;QACAC;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAqB,eAAepB;QACfE;QACAD;QACAE,QAAQ;YAAE,eAAe;QAAI;QAC7BC;QACAG,kBAAkBC;QAClBC;QACAC;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACA9B,aAAa+B,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,qBAAqB;IAACC,aAAazC,QAAQ2B;CAAa"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/column.js","sources":["../../../../../../src/pipeline/spec/chart/pipeline/column.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n initColumn,\n datasetXY,\n xBand,\n yLinear,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotAdapter,\n initPivot,\n datasetPivot,\n pivotIndicators,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n stackInverse,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationDifferenceLine,\n annotationAreaBand,\n verticalCrosshairRect,\n stackCornerRadius,\n progressive,\n colorAdapter,\n linearColor,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n columnPolynomialRegressionLine,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n brush,\n fontFamilyTheme,\n} from '../pipes'\n\nconst column: VChartSpecPipeline = [\n fontFamilyTheme,\n initColumn,\n stackCornerRadius,\n barMaxWidth,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n yLinear,\n label,\n brush,\n tooltip({ titleEncoding: 'x' }),\n verticalCrosshairRect,\n colorAdapter(discreteLegend, colorLegend),\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationDifferenceLine,\n annotationAreaBand,\n columnPolynomialRegressionLine,\n]\n\nconst pivotColumn: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n fontFamilyTheme,\n initColumn,\n stackCornerRadius,\n barMaxWidth,\n stackInverse,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n pivotAxisStyle(yLinear),\n brush,\n label,\n tooltip({ titleEncoding: 'x' }),\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationDifferenceLine,\n annotationAreaBand,\n columnPolynomialRegressionLine,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const columnSpecPipeline = [pivotAdapter(column, pivotColumn)]\n"],"names":["column","fontFamilyTheme","initColumn","stackCornerRadius","barMaxWidth","stackInverse","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","xBand","yLinear","label","brush","tooltip","verticalCrosshairRect","discreteLegend","colorLegend","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationDifferenceLine","annotationAreaBand","columnPolynomialRegressionLine","pivotColumn","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","columnSpecPipeline","pivotAdapter"],"mappings":";AA4CA,MAAMA,SAA6B;IACjCC;IACAC;IACAC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC,QAAQ;QAAE,eAAe;IAAI;IAC7BC;IACAX,aAAaY,gBAAgBC;IAC7BC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,cAAsC;IAC1CC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACdhC;QACAC;QACAC;QACAC;QACAC;QACAC,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAsB,eAAerB;QACfE;QACAD;QACAE,QAAQ;YAAE,eAAe;QAAI;QAC7BC;QACAG,kBAAkBC;QAClBC;QACAC;QACAC;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACA/B,aAAagC,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,qBAAqB;IAACC,aAAa1C,QAAQ4B;CAAa"}
@@ -1,4 +1,4 @@
1
- import { annotationAreaBand, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barGapInGroup, barMaxWidth, barStyle, brush, color, colorAdapter, colorBarStyleFill, colorLegend, datasetPivot, datasetXY, dimensionLinkage, discreteLegend, fontFamilyTheme, initColumnParallel, initPivot, label, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, tooltip, verticalCrosshairRect, xBand, yLinear } from "../pipes/index.js";
1
+ import { annotationAreaBand, annotationDifferenceLine, annotationHorizontalLine, annotationPoint, annotationVerticalLine, backgroundColor, barGapInGroup, barMaxWidth, barStyle, brush, color, colorAdapter, colorBarStyleFill, colorLegend, datasetPivot, datasetXY, dimensionLinkage, discreteLegend, fontFamilyTheme, initColumnParallel, initPivot, label, linearColor, pivotAdapter, pivotAxisStyle, pivotColorLegend, pivotColumnDimensions, pivotDiscreteLegend, pivotGridStyle, pivotIndicators, pivotIndicatorsAsRow, pivotRowDimensions, pivotTitle, progressive, stackCornerRadius, tooltip, verticalCrosshairRect, xBand, yLinear } from "../pipes/index.js";
2
2
  const columnParallel = [
3
3
  fontFamilyTheme,
4
4
  initColumnParallel,
@@ -22,6 +22,7 @@ const columnParallel = [
22
22
  annotationPoint,
23
23
  annotationVerticalLine,
24
24
  annotationHorizontalLine,
25
+ annotationDifferenceLine,
25
26
  annotationAreaBand
26
27
  ];
27
28
  const pivotColumnParallel = [
@@ -50,6 +51,7 @@ const pivotColumnParallel = [
50
51
  annotationPoint,
51
52
  annotationVerticalLine,
52
53
  annotationHorizontalLine,
54
+ annotationDifferenceLine,
53
55
  annotationAreaBand
54
56
  ]),
55
57
  pivotRowDimensions,
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline/spec/chart/pipeline/columnParallel.js","sources":["../../../../../../src/pipeline/spec/chart/pipeline/columnParallel.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n datasetXY,\n xBand,\n yLinear,\n initColumnParallel,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotIndicators,\n initPivot,\n datasetPivot,\n pivotAdapter,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n verticalCrosshairRect,\n stackCornerRadius,\n progressive,\n linearColor,\n colorAdapter,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n barGapInGroup,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n brush,\n fontFamilyTheme,\n} from '../pipes'\n\nconst columnParallel: VChartSpecPipeline = [\n fontFamilyTheme,\n initColumnParallel,\n stackCornerRadius,\n barMaxWidth,\n barGapInGroup,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n yLinear,\n label,\n brush,\n tooltip({ titleEncoding: 'x' }),\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n]\n\nconst pivotColumnParallel: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n fontFamilyTheme,\n initColumnParallel,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n pivotAxisStyle(yLinear),\n brush,\n label,\n tooltip({ titleEncoding: 'x' }),\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const columnParallelSpecPipeline = [pivotAdapter(columnParallel, pivotColumnParallel)]\n"],"names":["columnParallel","fontFamilyTheme","initColumnParallel","stackCornerRadius","barMaxWidth","barGapInGroup","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","xBand","yLinear","label","brush","tooltip","discreteLegend","colorLegend","verticalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationAreaBand","pivotColumnParallel","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","columnParallelSpecPipeline","pivotAdapter"],"mappings":";AA0CA,MAAMA,iBAAqC;IACzCC;IACAC;IACAC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC,QAAQ;QAAE,eAAe;IAAI;IAC7BV,aAAaW,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,sBAA8C;IAClDC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd9B;QACAC;QACAC;QACAC;QACAE,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAoB,eAAenB;QACfE;QACAD;QACAE,QAAQ;YAAE,eAAe;QAAI;QAC7BG;QACAC,kBAAkBC;QAClBC;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACA7B,aAAa8B,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,6BAA6B;IAACC,aAAaxC,gBAAgB0B;CAAqB"}
1
+ {"version":3,"file":"pipeline/spec/chart/pipeline/columnParallel.js","sources":["../../../../../../src/pipeline/spec/chart/pipeline/columnParallel.ts"],"sourcesContent":["import type { PivotChartSpecPipeline, VChartSpecPipeline } from 'src/types'\nimport {\n datasetXY,\n xBand,\n yLinear,\n initColumnParallel,\n backgroundColor,\n label,\n tooltip,\n discreteLegend,\n color,\n pivotIndicators,\n initPivot,\n datasetPivot,\n pivotAdapter,\n pivotDiscreteLegend,\n pivotIndicatorsAsRow,\n pivotGridStyle,\n pivotRowDimensions,\n pivotColumnDimensions,\n barStyle,\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationDifferenceLine,\n annotationAreaBand,\n verticalCrosshairRect,\n stackCornerRadius,\n progressive,\n linearColor,\n colorAdapter,\n colorLegend,\n colorBarStyleFill,\n pivotColorLegend,\n barMaxWidth,\n barGapInGroup,\n pivotAxisStyle,\n pivotTitle,\n dimensionLinkage,\n brush,\n fontFamilyTheme,\n} from '../pipes'\n\nconst columnParallel: VChartSpecPipeline = [\n fontFamilyTheme,\n initColumnParallel,\n stackCornerRadius,\n barMaxWidth,\n barGapInGroup,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n yLinear,\n label,\n brush,\n tooltip({ titleEncoding: 'x' }),\n colorAdapter(discreteLegend, colorLegend),\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationDifferenceLine,\n annotationAreaBand,\n]\n\nconst pivotColumnParallel: PivotChartSpecPipeline = [\n initPivot,\n pivotGridStyle,\n pivotIndicatorsAsRow,\n datasetPivot,\n pivotIndicators([\n fontFamilyTheme,\n initColumnParallel,\n stackCornerRadius,\n barMaxWidth,\n colorAdapter(color, linearColor),\n backgroundColor,\n datasetXY,\n progressive,\n xBand,\n pivotAxisStyle(yLinear),\n brush,\n label,\n tooltip({ titleEncoding: 'x' }),\n verticalCrosshairRect,\n colorBarStyleFill(barStyle),\n annotationPoint,\n annotationVerticalLine,\n annotationHorizontalLine,\n annotationDifferenceLine,\n annotationAreaBand,\n ]),\n pivotRowDimensions,\n pivotColumnDimensions,\n pivotTitle,\n colorAdapter(pivotDiscreteLegend, pivotColorLegend),\n dimensionLinkage,\n]\n\nexport const columnParallelSpecPipeline = [pivotAdapter(columnParallel, pivotColumnParallel)]\n"],"names":["columnParallel","fontFamilyTheme","initColumnParallel","stackCornerRadius","barMaxWidth","barGapInGroup","colorAdapter","color","linearColor","backgroundColor","datasetXY","progressive","xBand","yLinear","label","brush","tooltip","discreteLegend","colorLegend","verticalCrosshairRect","colorBarStyleFill","barStyle","annotationPoint","annotationVerticalLine","annotationHorizontalLine","annotationDifferenceLine","annotationAreaBand","pivotColumnParallel","initPivot","pivotGridStyle","pivotIndicatorsAsRow","datasetPivot","pivotIndicators","pivotAxisStyle","pivotRowDimensions","pivotColumnDimensions","pivotTitle","pivotDiscreteLegend","pivotColorLegend","dimensionLinkage","columnParallelSpecPipeline","pivotAdapter"],"mappings":";AA2CA,MAAMA,iBAAqC;IACzCC;IACAC;IACAC;IACAC;IACAC;IACAC,aAAaC,OAAOC;IACpBC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC;IACAC,QAAQ;QAAE,eAAe;IAAI;IAC7BV,aAAaW,gBAAgBC;IAC7BC;IACAC,kBAAkBC;IAClBC;IACAC;IACAC;IACAC;IACAC;CACD;AAED,MAAMC,sBAA8C;IAClDC;IACAC;IACAC;IACAC;IACAC,gBAAgB;QACd/B;QACAC;QACAC;QACAC;QACAE,aAAaC,OAAOC;QACpBC;QACAC;QACAC;QACAC;QACAqB,eAAepB;QACfE;QACAD;QACAE,QAAQ;YAAE,eAAe;QAAI;QAC7BG;QACAC,kBAAkBC;QAClBC;QACAC;QACAC;QACAC;QACAC;KACD;IACDQ;IACAC;IACAC;IACA9B,aAAa+B,qBAAqBC;IAClCC;CACD;AAEM,MAAMC,6BAA6B;IAACC,aAAazC,gBAAgB2B;CAAqB"}
@@ -0,0 +1,2 @@
1
+ import type { VChartSpecPipe } from '../../../../../types';
2
+ export declare const annotationDifferenceLine: VChartSpecPipe;
@@ -0,0 +1,134 @@
1
+ import { ANNOTATION_Z_INDEX } from "../../../../utils/constant.js";
2
+ import { buildDifferenceCoordinateDatum, buildDifferenceText, inferDifferenceConnectDirection, isDifferenceLineStacked, resolveDifferenceAnchor } from "./annotationDifferenceLineCommon.js";
3
+ const DEFAULT_LINE_COLOR = '#BCC1CB';
4
+ const DEFAULT_TEXT_COLOR = '#ffffff';
5
+ const DEFAULT_TEXT_BACKGROUND_COLOR = '#BCC1CB';
6
+ const DEFAULT_TEXT_FONT_SIZE = 12;
7
+ const DEFAULT_EXPAND_DISTANCE = 24;
8
+ const DEFAULT_LINE_WIDTH = 2;
9
+ const DEFAULT_CORNER_RADIUS = 4;
10
+ const DEFAULT_LABEL_PADDING = 4;
11
+ const DEFAULT_END_SYMBOL_SIZE = 12;
12
+ const DEFAULT_END_SYMBOL_REF_X = -4;
13
+ const getDifferenceLinePath = (index, total)=>1 === total ? 'annotationDifferenceLine' : `annotationDifferenceLine[${index}]`;
14
+ const assertDifferenceLineConfig = (value, path)=>{
15
+ if ('object' != typeof value || null === value || Array.isArray(value)) throw new Error(`${path} must be an object`);
16
+ const start = value.start;
17
+ if ('object' != typeof start || null === start || Array.isArray(start)) throw new Error(`${path}.start is required`);
18
+ if (null == start.selector) throw new Error(`${path}.start.selector is required`);
19
+ const end = value.end;
20
+ if ('object' != typeof end || null === end || Array.isArray(end)) throw new Error(`${path}.end is required`);
21
+ if (null == end.selector) throw new Error(`${path}.end.selector is required`);
22
+ };
23
+ const annotationDifferenceLine_annotationDifferenceLine = (spec, context)=>{
24
+ const { advancedVSeed, vseed } = context;
25
+ const annotationDifferenceLine = advancedVSeed.annotation?.annotationDifferenceLine;
26
+ if (!annotationDifferenceLine) return spec;
27
+ const theme = advancedVSeed.config?.[vseed.chartType]?.annotation?.annotationDifferenceLine;
28
+ const annotationDifferenceLineList = Array.isArray(annotationDifferenceLine) ? annotationDifferenceLine : [
29
+ annotationDifferenceLine
30
+ ];
31
+ const dataset = advancedVSeed.dataset.flat();
32
+ const barSpec = spec;
33
+ const isStacked = isDifferenceLineStacked(vseed, advancedVSeed);
34
+ const markLine = annotationDifferenceLineList.flatMap((annotationDifferenceLine, index)=>{
35
+ assertDifferenceLineConfig(annotationDifferenceLine, getDifferenceLinePath(index, annotationDifferenceLineList.length));
36
+ const start = resolveDifferenceAnchor({
37
+ dataset,
38
+ selectorLabel: 'start',
39
+ selectorValue: annotationDifferenceLine.start.selector,
40
+ spec: barSpec,
41
+ isStacked
42
+ });
43
+ const end = resolveDifferenceAnchor({
44
+ dataset,
45
+ selectorLabel: 'end',
46
+ selectorValue: annotationDifferenceLine.end.selector,
47
+ spec: barSpec,
48
+ isStacked
49
+ });
50
+ if (!start || !end) return [];
51
+ const lineColor = annotationDifferenceLine.lineColor ?? theme?.lineColor ?? DEFAULT_LINE_COLOR;
52
+ const textColor = annotationDifferenceLine.textColor ?? theme?.textColor ?? DEFAULT_TEXT_COLOR;
53
+ const textBackgroundColor = annotationDifferenceLine.textBackgroundColor ?? theme?.textBackgroundColor ?? DEFAULT_TEXT_BACKGROUND_COLOR;
54
+ const textFontSize = annotationDifferenceLine.textFontSize ?? theme?.textFontSize ?? DEFAULT_TEXT_FONT_SIZE;
55
+ return [
56
+ {
57
+ type: 'type-step',
58
+ autoRange: true,
59
+ zIndex: ANNOTATION_Z_INDEX,
60
+ connectDirection: inferDifferenceConnectDirection(vseed, [
61
+ start.value,
62
+ end.value
63
+ ]),
64
+ expandDistance: DEFAULT_EXPAND_DISTANCE,
65
+ coordinates: (seriesData, relativeSeries)=>[
66
+ buildDifferenceCoordinateDatum({
67
+ anchor: start,
68
+ seriesData,
69
+ relativeSeries
70
+ }),
71
+ buildDifferenceCoordinateDatum({
72
+ anchor: end,
73
+ seriesData,
74
+ relativeSeries
75
+ })
76
+ ],
77
+ line: {
78
+ style: {
79
+ visible: true,
80
+ stroke: lineColor,
81
+ lineWidth: DEFAULT_LINE_WIDTH,
82
+ lineDash: [
83
+ 0
84
+ ],
85
+ cornerRadius: DEFAULT_CORNER_RADIUS
86
+ }
87
+ },
88
+ label: {
89
+ confine: true,
90
+ visible: true,
91
+ position: 'middle',
92
+ text: buildDifferenceText(start.value, end.value, annotationDifferenceLine.differenceType ?? 'absolute'),
93
+ style: {
94
+ fill: textColor,
95
+ fontSize: textFontSize
96
+ },
97
+ labelBackground: {
98
+ visible: true,
99
+ padding: DEFAULT_LABEL_PADDING,
100
+ style: {
101
+ fill: textBackgroundColor,
102
+ fillOpacity: 1,
103
+ stroke: lineColor,
104
+ lineWidth: 1,
105
+ cornerRadius: DEFAULT_CORNER_RADIUS
106
+ }
107
+ }
108
+ },
109
+ startSymbol: {
110
+ visible: false
111
+ },
112
+ endSymbol: {
113
+ visible: true,
114
+ size: DEFAULT_END_SYMBOL_SIZE,
115
+ refX: DEFAULT_END_SYMBOL_REF_X,
116
+ style: {
117
+ fill: lineColor
118
+ }
119
+ }
120
+ }
121
+ ];
122
+ });
123
+ const specMarkLine = barSpec.markLine || [];
124
+ return {
125
+ ...spec,
126
+ markLine: [
127
+ ...specMarkLine,
128
+ ...markLine
129
+ ]
130
+ };
131
+ };
132
+ export { annotationDifferenceLine_annotationDifferenceLine as annotationDifferenceLine };
133
+
134
+ //# sourceMappingURL=annotationDifferenceLine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationDifferenceLine.ts"],"sourcesContent":["import type { IBarChartSpec, ICartesianSeries, IMarkLineSpec } from '@visactor/vchart'\nimport type { AnnotationDifferenceLine, VChartSpecPipe } from 'src/types'\nimport { ANNOTATION_Z_INDEX } from '../../../../utils/constant'\nimport {\n buildDifferenceCoordinateDatum,\n buildDifferenceText,\n inferDifferenceConnectDirection,\n isDifferenceLineStacked,\n resolveDifferenceAnchor,\n} from './annotationDifferenceLineCommon'\n\nconst DEFAULT_LINE_COLOR = '#BCC1CB'\nconst DEFAULT_TEXT_COLOR = '#ffffff'\nconst DEFAULT_TEXT_BACKGROUND_COLOR = '#BCC1CB'\nconst DEFAULT_TEXT_FONT_SIZE = 12\nconst DEFAULT_EXPAND_DISTANCE = 24\nconst DEFAULT_LINE_WIDTH = 2\nconst DEFAULT_CORNER_RADIUS = 4\nconst DEFAULT_LABEL_PADDING = 4\nconst DEFAULT_END_SYMBOL_SIZE = 12\nconst DEFAULT_END_SYMBOL_REF_X = -4\n\nconst getDifferenceLinePath = (index: number, total: number) =>\n total === 1 ? 'annotationDifferenceLine' : `annotationDifferenceLine[${index}]`\n\nconst assertDifferenceLineConfig: (value: unknown, path: string) => asserts value is AnnotationDifferenceLine = (\n value,\n path,\n) => {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new Error(`${path} must be an object`)\n }\n\n const start = (value as Record<string, unknown>).start\n if (typeof start !== 'object' || start === null || Array.isArray(start)) {\n throw new Error(`${path}.start is required`)\n }\n if ((start as Record<string, unknown>).selector == null) {\n throw new Error(`${path}.start.selector is required`)\n }\n\n const end = (value as Record<string, unknown>).end\n if (typeof end !== 'object' || end === null || Array.isArray(end)) {\n throw new Error(`${path}.end is required`)\n }\n if ((end as Record<string, unknown>).selector == null) {\n throw new Error(`${path}.end.selector is required`)\n }\n}\n\nexport const annotationDifferenceLine: VChartSpecPipe = (spec, context) => {\n const { advancedVSeed, vseed } = context\n const annotationDifferenceLine = advancedVSeed.annotation?.annotationDifferenceLine\n\n if (!annotationDifferenceLine) {\n return spec\n }\n\n const theme = advancedVSeed.config?.[vseed.chartType as 'column']?.annotation?.annotationDifferenceLine\n const annotationDifferenceLineList = Array.isArray(annotationDifferenceLine)\n ? annotationDifferenceLine\n : [annotationDifferenceLine]\n const dataset = advancedVSeed.dataset.flat()\n const barSpec = spec as IBarChartSpec\n const isStacked = isDifferenceLineStacked(vseed, advancedVSeed)\n\n const markLine = annotationDifferenceLineList.flatMap((annotationDifferenceLine, index) => {\n assertDifferenceLineConfig(\n annotationDifferenceLine,\n getDifferenceLinePath(index, annotationDifferenceLineList.length),\n )\n\n const start = resolveDifferenceAnchor({\n dataset,\n selectorLabel: 'start',\n selectorValue: annotationDifferenceLine.start.selector,\n spec: barSpec,\n isStacked,\n })\n const end = resolveDifferenceAnchor({\n dataset,\n selectorLabel: 'end',\n selectorValue: annotationDifferenceLine.end.selector,\n spec: barSpec,\n isStacked,\n })\n\n if (!start || !end) {\n return []\n }\n\n const lineColor = annotationDifferenceLine.lineColor ?? theme?.lineColor ?? DEFAULT_LINE_COLOR\n const textColor = annotationDifferenceLine.textColor ?? theme?.textColor ?? DEFAULT_TEXT_COLOR\n const textBackgroundColor =\n annotationDifferenceLine.textBackgroundColor ?? theme?.textBackgroundColor ?? DEFAULT_TEXT_BACKGROUND_COLOR\n const textFontSize = annotationDifferenceLine.textFontSize ?? theme?.textFontSize ?? DEFAULT_TEXT_FONT_SIZE\n\n return [\n {\n type: 'type-step',\n autoRange: true,\n zIndex: ANNOTATION_Z_INDEX,\n connectDirection: inferDifferenceConnectDirection(vseed, [start.value, end.value]),\n expandDistance: DEFAULT_EXPAND_DISTANCE,\n coordinates: (seriesData: any[], relativeSeries: ICartesianSeries) => [\n buildDifferenceCoordinateDatum({\n anchor: start,\n seriesData,\n relativeSeries,\n }),\n buildDifferenceCoordinateDatum({\n anchor: end,\n seriesData,\n relativeSeries,\n }),\n ],\n line: {\n style: {\n visible: true,\n stroke: lineColor,\n lineWidth: DEFAULT_LINE_WIDTH,\n lineDash: [0],\n cornerRadius: DEFAULT_CORNER_RADIUS,\n },\n },\n label: {\n confine: true,\n visible: true,\n position: 'middle',\n text: buildDifferenceText(start.value, end.value, annotationDifferenceLine.differenceType ?? 'absolute'),\n style: {\n fill: textColor,\n fontSize: textFontSize,\n },\n labelBackground: {\n visible: true,\n padding: DEFAULT_LABEL_PADDING,\n style: {\n fill: textBackgroundColor,\n fillOpacity: 1,\n stroke: lineColor,\n lineWidth: 1,\n cornerRadius: DEFAULT_CORNER_RADIUS,\n },\n },\n },\n startSymbol: {\n visible: false,\n },\n endSymbol: {\n visible: true,\n size: DEFAULT_END_SYMBOL_SIZE,\n refX: DEFAULT_END_SYMBOL_REF_X,\n style: {\n fill: lineColor,\n },\n },\n } as IMarkLineSpec,\n ]\n })\n\n const specMarkLine = (barSpec.markLine as IMarkLineSpec[]) || []\n\n return {\n ...spec,\n markLine: [...specMarkLine, ...markLine],\n }\n}\n"],"names":["DEFAULT_LINE_COLOR","DEFAULT_TEXT_COLOR","DEFAULT_TEXT_BACKGROUND_COLOR","DEFAULT_TEXT_FONT_SIZE","DEFAULT_EXPAND_DISTANCE","DEFAULT_LINE_WIDTH","DEFAULT_CORNER_RADIUS","DEFAULT_LABEL_PADDING","DEFAULT_END_SYMBOL_SIZE","DEFAULT_END_SYMBOL_REF_X","getDifferenceLinePath","index","total","assertDifferenceLineConfig","value","path","Array","Error","start","end","annotationDifferenceLine","spec","context","advancedVSeed","vseed","theme","annotationDifferenceLineList","dataset","barSpec","isStacked","isDifferenceLineStacked","markLine","resolveDifferenceAnchor","lineColor","textColor","textBackgroundColor","textFontSize","ANNOTATION_Z_INDEX","inferDifferenceConnectDirection","seriesData","relativeSeries","buildDifferenceCoordinateDatum","buildDifferenceText","specMarkLine"],"mappings":";;AAWA,MAAMA,qBAAqB;AAC3B,MAAMC,qBAAqB;AAC3B,MAAMC,gCAAgC;AACtC,MAAMC,yBAAyB;AAC/B,MAAMC,0BAA0B;AAChC,MAAMC,qBAAqB;AAC3B,MAAMC,wBAAwB;AAC9B,MAAMC,wBAAwB;AAC9B,MAAMC,0BAA0B;AAChC,MAAMC,2BAA2B;AAEjC,MAAMC,wBAAwB,CAACC,OAAeC,QAC5CA,AAAU,MAAVA,QAAc,6BAA6B,CAAC,yBAAyB,EAAED,MAAM,CAAC,CAAC;AAEjF,MAAME,6BAA0G,CAC9GC,OACAC;IAEA,IAAI,AAAiB,YAAjB,OAAOD,SAAsBA,AAAU,SAAVA,SAAkBE,MAAM,OAAO,CAACF,QAC/D,MAAM,IAAIG,MAAM,GAAGF,KAAK,kBAAkB,CAAC;IAG7C,MAAMG,QAASJ,MAAkC,KAAK;IACtD,IAAI,AAAiB,YAAjB,OAAOI,SAAsBA,AAAU,SAAVA,SAAkBF,MAAM,OAAO,CAACE,QAC/D,MAAM,IAAID,MAAM,GAAGF,KAAK,kBAAkB,CAAC;IAE7C,IAAKG,AAA8C,QAA9CA,MAAkC,QAAQ,EAC7C,MAAM,IAAID,MAAM,GAAGF,KAAK,2BAA2B,CAAC;IAGtD,MAAMI,MAAOL,MAAkC,GAAG;IAClD,IAAI,AAAe,YAAf,OAAOK,OAAoBA,AAAQ,SAARA,OAAgBH,MAAM,OAAO,CAACG,MAC3D,MA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QAAQkC;gBACR,kBAAkBC,gCAAgCd,OAAO;oBAACN,MAAM,KAAK;oBAAEC,IAAI,KAAK;iBAAC;gBACjF,gBAAgBf;gBAChB,aAAa,CAACmC,YAAmBC,iBAAqC;wBACpEC,+BAA+B;4BAC7B,QAAQvB;4BACRqB;4BACAC;wBACF;wBACAC,+BAA+B;4BAC7B,QAAQtB;4BACRoB;4BACAC;wBACF;qBACD;gBACD,MAAM;oBACJ,OAAO;wBACL,SAAS;wBACT,QAAQP;wBACR,WAAW5B;wBACX,UAAU;4BAAC;yBAAE;wBACb,cAAcC;oBAChB;gBACF;gBACA,OAAO;oBACL,SAAS;oBACT,SAAS;oBACT,UAAU;oBACV,MAAMoC,oBAAoBxB,MAAM,KAAK,EAAEC,IAAI,KAAK,EAAEC,yBAAyB,cAAc,IAAI;oBAC7F,OAAO;wBACL,MAAMc;wBACN,UAAUE;oBACZ;oBACA,iBAAiB;wBACf,SAAS;wBACT,SAAS7B;wBACT,OAAO;4BACL,MAAM4B;4BACN,aAAa;4BACb,QAAQF;4BACR,WAAW;4BACX,cAAc3B;wBAChB;oBACF;gBACF;gBACA,aAAa;oBACX,SAAS;gBACX;gBACA,WAAW;oBACT,SAAS;oBACT,MAAME;oBACN,MAAMC;oBACN,OAAO;wBACL,MAAMwB;oBACR;gBACF;YACF;SACD;IACH;IAEA,MAAMU,eAAgBf,QAAQ,QAAQ,IAAwB,EAAE;IAEhE,OAAO;QACL,GAAGP,IAAI;QACP,UAAU;eAAIsB;eAAiBZ;SAAS;IAC1C;AACF"}
@@ -0,0 +1,27 @@
1
+ import type { IBarChartSpec, ICartesianSeries } from '@visactor/vchart';
2
+ import type { AdvancedVSeed, Datum, Selector, Selectors, VSeed } from '../../../../../types';
3
+ type DifferenceSelectorLabel = 'start' | 'end';
4
+ export type ResolvedDifferenceAnchor = {
5
+ selectorLabel: DifferenceSelectorLabel;
6
+ coordinateDatum: Datum;
7
+ matchedDatum?: Datum;
8
+ stackGroupDatum?: Datum;
9
+ value: number;
10
+ };
11
+ export declare const isDifferenceLineStacked: (vseed: VSeed, advancedVSeed: AdvancedVSeed) => boolean;
12
+ export declare const resolveDifferenceAnchor: (options: {
13
+ dataset: Datum[];
14
+ selectorLabel: DifferenceSelectorLabel;
15
+ selectorValue: Selector | Selectors;
16
+ spec: IBarChartSpec;
17
+ isStacked: boolean;
18
+ }) => ResolvedDifferenceAnchor | undefined;
19
+ export declare const getStackRuntimeTotal: (runtimeMatches: Datum[]) => number | undefined;
20
+ export declare const buildDifferenceCoordinateDatum: (options: {
21
+ anchor: ResolvedDifferenceAnchor;
22
+ seriesData: Datum[];
23
+ relativeSeries: ICartesianSeries;
24
+ }) => Record<string | number, any>;
25
+ export declare const buildDifferenceText: (startValue: number, endValue: number, differenceType?: "absolute" | "percent") => string;
26
+ export declare const inferDifferenceConnectDirection: (vseed: VSeed, values: [number, number]) => "left" | "top" | "right" | "bottom";
27
+ export {};
@@ -0,0 +1,167 @@
1
+ import { isDimensionSelector, isFieldSelector, isMeasureSelector, isPartialDatumSelector, isValueSelector, selector } from "../../../../../dataSelector/index.js";
2
+ import { hasMultipleMeasureInSingleView, isBarLikeChart } from "../../../../utils/index.js";
3
+ import { isSubset } from "./utils.js";
4
+ const toArray = (value)=>{
5
+ if (Array.isArray(value)) return value;
6
+ return null == value ? [] : [
7
+ value
8
+ ];
9
+ };
10
+ const getDifferenceBandFields = (spec)=>toArray('horizontal' === spec.direction ? spec.yField : spec.xField);
11
+ const getDifferenceValueField = (spec)=>{
12
+ const valueField = toArray('horizontal' === spec.direction ? spec.xField : spec.yField)[0];
13
+ if (!valueField) throw new Error('annotationDifferenceLine requires a value field in the target chart spec');
14
+ return valueField;
15
+ };
16
+ const normalizeDifferenceValue = (value, selectorLabel, field)=>{
17
+ const numberValue = Number(value);
18
+ if (Number.isNaN(numberValue)) throw new Error(`annotationDifferenceLine ${selectorLabel} selector resolved to a non-numeric value on field "${field}"`);
19
+ return numberValue;
20
+ };
21
+ const buildStackGroupDatum = (datum, bandFields)=>Object.fromEntries(bandFields.map((field)=>[
22
+ field,
23
+ datum[field]
24
+ ]));
25
+ const buildFallbackSelectorDatum = (selectorValue)=>{
26
+ const selectorList = Array.isArray(selectorValue) ? selectorValue : [
27
+ selectorValue
28
+ ];
29
+ const fallbackDatum = {};
30
+ for (const currentSelector of selectorList){
31
+ if (isValueSelector(currentSelector) || isFieldSelector(currentSelector)) return;
32
+ if (isMeasureSelector(currentSelector)) {
33
+ const operator = currentSelector.operator || currentSelector.op;
34
+ const selectorValues = Array.isArray(currentSelector.value) ? currentSelector.value : [
35
+ currentSelector.value
36
+ ];
37
+ if (![
38
+ '=',
39
+ '=='
40
+ ].includes(operator) || 1 !== selectorValues.length) return;
41
+ fallbackDatum[currentSelector.field] = selectorValues[0];
42
+ continue;
43
+ }
44
+ if (isDimensionSelector(currentSelector)) {
45
+ const operator = currentSelector.operator || currentSelector.op;
46
+ const selectorValues = Array.isArray(currentSelector.value) ? currentSelector.value : [
47
+ currentSelector.value
48
+ ];
49
+ if ('in' !== operator || 1 !== selectorValues.length) return;
50
+ fallbackDatum[currentSelector.field] = selectorValues[0];
51
+ continue;
52
+ }
53
+ if (isPartialDatumSelector(currentSelector)) {
54
+ Object.assign(fallbackDatum, currentSelector);
55
+ continue;
56
+ }
57
+ return;
58
+ }
59
+ return Object.keys(fallbackDatum).length > 0 ? fallbackDatum : void 0;
60
+ };
61
+ const inferFallbackValue = (fallbackDatum, valueField, bandFields)=>{
62
+ if (valueField in fallbackDatum) return fallbackDatum[valueField];
63
+ const numericCandidateKeys = Object.keys(fallbackDatum).filter((key)=>{
64
+ if (key === valueField || bandFields.includes(key)) return false;
65
+ return 'number' == typeof fallbackDatum[key];
66
+ });
67
+ if (1 !== numericCandidateKeys.length) return;
68
+ return fallbackDatum[numericCandidateKeys[0]];
69
+ };
70
+ const resolveFallbackAnchor = (options)=>{
71
+ const { selectorLabel, selectorValue, valueField, bandFields } = options;
72
+ const fallbackDatum = buildFallbackSelectorDatum(selectorValue);
73
+ if (!fallbackDatum) return;
74
+ const inferredValue = inferFallbackValue(fallbackDatum, valueField, bandFields);
75
+ if (void 0 === inferredValue) return;
76
+ const coordinateDatum = {
77
+ ...fallbackDatum,
78
+ [valueField]: inferredValue
79
+ };
80
+ try {
81
+ return {
82
+ selectorLabel,
83
+ coordinateDatum,
84
+ matchedDatum: fallbackDatum,
85
+ value: normalizeDifferenceValue(inferredValue, selectorLabel, valueField)
86
+ };
87
+ } catch {
88
+ return;
89
+ }
90
+ };
91
+ const hasMixedSigns = (values)=>{
92
+ const nonZeroValues = values.filter((value)=>0 !== value);
93
+ return nonZeroValues.some((value)=>value > 0) && nonZeroValues.some((value)=>value < 0);
94
+ };
95
+ const isDifferenceLineStacked = (vseed, advancedVSeed)=>('column' === vseed.chartType || 'bar' === vseed.chartType) && hasMultipleMeasureInSingleView(advancedVSeed.reshapeMeasures ?? []);
96
+ const resolveDifferenceAnchor = (options)=>{
97
+ const { dataset, selectorLabel, selectorValue, spec, isStacked } = options;
98
+ const matches = dataset.filter((datum)=>selector(datum, selectorValue));
99
+ const valueField = getDifferenceValueField(spec);
100
+ const bandFields = getDifferenceBandFields(spec);
101
+ if (0 === matches.length) return isStacked ? void 0 : resolveFallbackAnchor({
102
+ selectorLabel,
103
+ selectorValue,
104
+ valueField,
105
+ bandFields
106
+ });
107
+ if (!isStacked) {
108
+ if (1 !== matches.length) throw new Error(`annotationDifferenceLine ${selectorLabel} selector must resolve to exactly one datum, got ${matches.length}`);
109
+ return {
110
+ selectorLabel,
111
+ coordinateDatum: matches[0],
112
+ matchedDatum: matches[0],
113
+ value: normalizeDifferenceValue(matches[0][valueField], selectorLabel, valueField)
114
+ };
115
+ }
116
+ const stackGroups = new Map();
117
+ matches.forEach((datum)=>{
118
+ const stackGroupDatum = buildStackGroupDatum(datum, bandFields);
119
+ stackGroups.set(JSON.stringify(stackGroupDatum), stackGroupDatum);
120
+ });
121
+ if (1 !== stackGroups.size) throw new Error(`annotationDifferenceLine ${selectorLabel} selector must resolve to exactly one stack group, got ${stackGroups.size}`);
122
+ const stackGroupDatum = Array.from(stackGroups.values())[0];
123
+ const groupRows = dataset.filter((datum)=>isSubset(stackGroupDatum, datum));
124
+ const groupValues = groupRows.map((datum)=>normalizeDifferenceValue(datum[valueField], selectorLabel, valueField));
125
+ if (hasMixedSigns(groupValues)) throw new Error('annotationDifferenceLine does not support mixed-sign stack totals in v1');
126
+ return {
127
+ selectorLabel,
128
+ coordinateDatum: stackGroupDatum,
129
+ matchedDatum: matches[0],
130
+ stackGroupDatum,
131
+ value: groupValues.reduce((sum, value)=>sum + value, 0)
132
+ };
133
+ };
134
+ const getStackRuntimeTotal = (runtimeMatches)=>{
135
+ const stackEndValues = runtimeMatches.map((datum)=>Number(datum.__VCHART_STACK_END));
136
+ if (stackEndValues.some((value)=>Number.isNaN(value))) return;
137
+ if (hasMixedSigns(stackEndValues)) throw new Error('annotationDifferenceLine does not support mixed-sign runtime stack totals in v1');
138
+ return stackEndValues.some((value)=>value < 0) ? Math.min(...stackEndValues) : Math.max(...stackEndValues);
139
+ };
140
+ const buildDifferenceCoordinateDatum = (options)=>{
141
+ const { anchor, seriesData, relativeSeries } = options;
142
+ if (!anchor.stackGroupDatum) {
143
+ const runtimeMatches = anchor.matchedDatum ? seriesData.filter((datum)=>isSubset(anchor.matchedDatum, datum)) : [];
144
+ return runtimeMatches[0] ?? anchor.coordinateDatum;
145
+ }
146
+ const runtimeMatches = seriesData.filter((datum)=>isSubset(anchor.stackGroupDatum, datum));
147
+ const runtimeStackTotal = getStackRuntimeTotal(runtimeMatches);
148
+ return {
149
+ ...runtimeMatches[0] ?? anchor.coordinateDatum,
150
+ [relativeSeries.getStackValueField()]: runtimeStackTotal ?? anchor.value
151
+ };
152
+ };
153
+ const buildDifferenceText = (startValue, endValue, differenceType = 'absolute')=>{
154
+ if ('percent' === differenceType) {
155
+ if (0 === startValue) throw new Error('annotationDifferenceLine percent difference cannot be computed because start value is 0');
156
+ return `${((endValue - startValue) / startValue * 100).toFixed(0)}%`;
157
+ }
158
+ return `${endValue - startValue}`;
159
+ };
160
+ const inferDifferenceConnectDirection = (vseed, values)=>{
161
+ const isNegativeSide = values.every((value)=>value < 0);
162
+ if (isBarLikeChart(vseed)) return isNegativeSide ? 'left' : 'right';
163
+ return isNegativeSide ? 'bottom' : 'top';
164
+ };
165
+ export { buildDifferenceCoordinateDatum, buildDifferenceText, getStackRuntimeTotal, inferDifferenceConnectDirection, isDifferenceLineStacked, resolveDifferenceAnchor };
166
+
167
+ //# sourceMappingURL=annotationDifferenceLineCommon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline/spec/chart/pipes/annotation/annotationDifferenceLineCommon.js","sources":["../../../../../../../src/pipeline/spec/chart/pipes/annotation/annotationDifferenceLineCommon.ts"],"sourcesContent":["import type { IBarChartSpec, ICartesianSeries } from '@visactor/vchart'\nimport {\n isDimensionSelector,\n isFieldSelector,\n isMeasureSelector,\n isPartialDatumSelector,\n isValueSelector,\n selector,\n} from '../../../../../dataSelector'\nimport { hasMultipleMeasureInSingleView, isBarLikeChart } from 'src/pipeline/utils'\nimport type { AdvancedVSeed, Datum, Selector, Selectors, VSeed } from 'src/types'\nimport { isSubset } from './utils'\n\ntype DifferenceSelectorLabel = 'start' | 'end'\n\nexport type ResolvedDifferenceAnchor = {\n selectorLabel: DifferenceSelectorLabel\n coordinateDatum: Datum\n matchedDatum?: Datum\n stackGroupDatum?: Datum\n value: number\n}\n\nconst toArray = <T>(value: T | T[] | undefined | null): T[] => {\n if (Array.isArray(value)) {\n return value\n }\n\n return value === undefined || value === null ? [] : [value]\n}\n\nconst getDifferenceBandFields = (spec: IBarChartSpec): string[] => {\n return toArray((spec.direction === 'horizontal' ? spec.yField : spec.xField) as string | string[] | undefined)\n}\n\nconst getDifferenceValueField = (spec: IBarChartSpec): string => {\n const valueField = toArray(\n (spec.direction === 'horizontal' ? spec.xField : spec.yField) as string | string[] | undefined,\n )[0]\n\n if (!valueField) {\n throw new Error('annotationDifferenceLine requires a value field in the target chart spec')\n }\n\n return valueField\n}\n\nconst normalizeDifferenceValue = (value: unknown, selectorLabel: DifferenceSelectorLabel, field: string): number => {\n const numberValue = Number(value)\n\n if (Number.isNaN(numberValue)) {\n throw new Error(\n `annotationDifferenceLine ${selectorLabel} selector resolved to a non-numeric value on field \"${field}\"`,\n )\n }\n\n return numberValue\n}\n\nconst buildStackGroupDatum = (datum: Datum, bandFields: string[]) => {\n return Object.fromEntries(bandFields.map((field) => [field, datum[field]])) as Datum\n}\n\nconst buildFallbackSelectorDatum = (selectorValue: Selector | Selectors): Datum | undefined => {\n const selectorList = Array.isArray(selectorValue) ? selectorValue : [selectorValue]\n const fallbackDatum: Datum = {}\n\n for (const currentSelector of selectorList) {\n if (isValueSelector(currentSelector) || isFieldSelector(currentSelector)) {\n return undefined\n }\n\n if (isMeasureSelector(currentSelector)) {\n const operator = currentSelector.operator || currentSelector.op\n const selectorValues = Array.isArray(currentSelector.value) ? currentSelector.value : [currentSelector.value]\n\n if (!['=', '=='].includes(operator as string) || selectorValues.length !== 1) {\n return undefined\n }\n\n fallbackDatum[currentSelector.field] = selectorValues[0]\n continue\n }\n\n if (isDimensionSelector(currentSelector)) {\n const operator = currentSelector.operator || currentSelector.op\n const selectorValues = Array.isArray(currentSelector.value) ? currentSelector.value : [currentSelector.value]\n\n if (operator !== 'in' || selectorValues.length !== 1) {\n return undefined\n }\n\n fallbackDatum[currentSelector.field] = selectorValues[0]\n continue\n }\n\n if (isPartialDatumSelector(currentSelector)) {\n Object.assign(fallbackDatum, currentSelector)\n continue\n }\n\n return undefined\n }\n\n return Object.keys(fallbackDatum).length > 0 ? fallbackDatum : undefined\n}\n\nconst inferFallbackValue = (fallbackDatum: Datum, valueField: string, bandFields: string[]) => {\n if (valueField in fallbackDatum) {\n return fallbackDatum[valueField]\n }\n\n const numericCandidateKeys = Object.keys(fallbackDatum).filter((key) => {\n if (key === valueField || bandFields.includes(key)) {\n return false\n }\n\n return typeof fallbackDatum[key] === 'number'\n })\n\n if (numericCandidateKeys.length !== 1) {\n return undefined\n }\n\n return fallbackDatum[numericCandidateKeys[0]]\n}\n\nconst resolveFallbackAnchor = (options: {\n selectorLabel: DifferenceSelectorLabel\n selectorValue: Selector | Selectors\n valueField: string\n bandFields: string[]\n}): ResolvedDifferenceAnchor | undefined => {\n const { selectorLabel, selectorValue, valueField, bandFields } = options\n const fallbackDatum = buildFallbackSelectorDatum(selectorValue)\n\n if (!fallbackDatum) {\n return undefined\n }\n\n const inferredValue = inferFallbackValue(fallbackDatum, valueField, bandFields)\n\n if (inferredValue === undefined) {\n return undefined\n }\n\n const coordinateDatum = {\n ...fallbackDatum,\n [valueField]: inferredValue,\n }\n\n try {\n return {\n selectorLabel,\n coordinateDatum,\n matchedDatum: fallbackDatum,\n value: normalizeDifferenceValue(inferredValue, selectorLabel, valueField),\n }\n } catch {\n return undefined\n }\n}\n\nconst hasMixedSigns = (values: number[]) => {\n const nonZeroValues = values.filter((value) => value !== 0)\n\n return nonZeroValues.some((value) => value > 0) && nonZeroValues.some((value) => value < 0)\n}\n\nexport const isDifferenceLineStacked = (vseed: VSeed, advancedVSeed: AdvancedVSeed) => {\n return (\n (vseed.chartType === 'column' || vseed.chartType === 'bar') &&\n hasMultipleMeasureInSingleView(advancedVSeed.reshapeMeasures ?? [])\n )\n}\n\nexport const resolveDifferenceAnchor = (options: {\n dataset: Datum[]\n selectorLabel: DifferenceSelectorLabel\n selectorValue: Selector | Selectors\n spec: IBarChartSpec\n isStacked: boolean\n}): ResolvedDifferenceAnchor | undefined => {\n const { dataset, selectorLabel, selectorValue, spec, isStacked } = options\n const matches = dataset.filter((datum) => selector(datum, selectorValue))\n const valueField = getDifferenceValueField(spec)\n const bandFields = getDifferenceBandFields(spec)\n\n if (matches.length === 0) {\n return isStacked ? undefined : resolveFallbackAnchor({ selectorLabel, selectorValue, valueField, bandFields })\n }\n\n if (!isStacked) {\n if (matches.length !== 1) {\n throw new Error(\n `annotationDifferenceLine ${selectorLabel} selector must resolve to exactly one datum, got ${matches.length}`,\n )\n }\n\n return {\n selectorLabel,\n coordinateDatum: matches[0],\n matchedDatum: matches[0],\n value: normalizeDifferenceValue(matches[0][valueField], selectorLabel, valueField),\n }\n }\n const stackGroups = new Map<string, Datum>()\n\n matches.forEach((datum) => {\n const stackGroupDatum = buildStackGroupDatum(datum, bandFields)\n stackGroups.set(JSON.stringify(stackGroupDatum), stackGroupDatum)\n })\n\n if (stackGroups.size !== 1) {\n throw new Error(\n `annotationDifferenceLine ${selectorLabel} selector must resolve to exactly one stack group, got ${stackGroups.size}`,\n )\n }\n\n const stackGroupDatum = Array.from(stackGroups.values())[0]\n const groupRows = dataset.filter((datum) => isSubset(stackGroupDatum, datum))\n const groupValues = groupRows.map((datum) => normalizeDifferenceValue(datum[valueField], selectorLabel, valueField))\n\n if (hasMixedSigns(groupValues)) {\n throw new Error('annotationDifferenceLine does not support mixed-sign stack totals in v1')\n }\n\n return {\n selectorLabel,\n coordinateDatum: stackGroupDatum,\n matchedDatum: matches[0],\n stackGroupDatum,\n value: groupValues.reduce((sum, value) => sum + value, 0),\n }\n}\n\nexport const getStackRuntimeTotal = (runtimeMatches: Datum[]) => {\n const stackEndValues = runtimeMatches.map((datum) => Number(datum.__VCHART_STACK_END))\n\n if (stackEndValues.some((value) => Number.isNaN(value))) {\n return undefined\n }\n\n if (hasMixedSigns(stackEndValues)) {\n throw new Error('annotationDifferenceLine does not support mixed-sign runtime stack totals in v1')\n }\n\n return stackEndValues.some((value) => value < 0) ? Math.min(...stackEndValues) : Math.max(...stackEndValues)\n}\n\nexport const buildDifferenceCoordinateDatum = (options: {\n anchor: ResolvedDifferenceAnchor\n seriesData: Datum[]\n relativeSeries: ICartesianSeries\n}) => {\n const { anchor, seriesData, relativeSeries } = options\n\n if (!anchor.stackGroupDatum) {\n const runtimeMatches = anchor.matchedDatum\n ? seriesData.filter((datum) => isSubset(anchor.matchedDatum as Datum, datum))\n : []\n\n return runtimeMatches[0] ?? anchor.coordinateDatum\n }\n\n const runtimeMatches = seriesData.filter((datum) => isSubset(anchor.stackGroupDatum as Datum, datum))\n const runtimeStackTotal = getStackRuntimeTotal(runtimeMatches)\n\n return {\n ...(runtimeMatches[0] ?? anchor.coordinateDatum),\n [relativeSeries.getStackValueField()]: runtimeStackTotal ?? anchor.value,\n }\n}\n\nexport const buildDifferenceText = (\n startValue: number,\n endValue: number,\n differenceType: 'absolute' | 'percent' = 'absolute',\n) => {\n if (differenceType === 'percent') {\n if (startValue === 0) {\n throw new Error('annotationDifferenceLine percent difference cannot be computed because start value is 0')\n }\n\n return `${(((endValue - startValue) / startValue) * 100).toFixed(0)}%`\n }\n\n return `${endValue - startValue}`\n}\n\nexport const inferDifferenceConnectDirection = (vseed: VSeed, values: [number, number]) => {\n const isNegativeSide = values.every((value) => value < 0)\n\n if (isBarLikeChart(vseed)) {\n return isNegativeSide ? 'left' : 'right'\n }\n\n return isNegativeSide ? 'bottom' : 'top'\n}\n"],"names":["toArray","value","Array","getDifferenceBandFields","spec","getDifferenceValueField","valueField","Error","normalizeDifferenceValue","selectorLabel","field","numberValue","Number","buildStackGroupDatum","datum","bandFields","Object","buildFallbackSelectorDatum","selectorValue","selectorList","fallbackDatum","currentSelector","isValueSelector","isFieldSelector","isMeasureSelector","operator","selectorValues","isDimensionSelector","isPartialDatumSelector","undefined","inferFallbackValue","numericCandidateKeys","key","resolveFallbackAnchor","options","inferredValue","coordinateDatum","hasMixedSigns","values","nonZeroValues","isDifferenceLineStacked","vseed","advancedVSeed","hasMultipleMeasureInSingleView","resolveDifferenceAnchor","dataset","isStacked","matches","selector","stackGroups","Map","stackGroupDatum","JSON","groupRows","isSubset","groupValues","sum","getStackRuntimeTotal","runtimeMatches","stackEndValues","Math","buildDifferenceCoordinateDatum","anchor","seriesData","relativeSeries","runtimeStackTotal","buildDifferenceText","startValue","endValue","differenceType","inferDifferenceConnectDirection","isNegativeSide","isBarLikeChart"],"mappings":";;;AAuBA,MAAMA,UAAU,CAA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EAAEC,UAAU,EAAEC,cAAc,EAAE,GAAG9B;IAE/C,IAAI,CAAC4B,OAAO,eAAe,EAAE;QAC3B,MAAMJ,iBAAiBI,OAAO,YAAY,GACtCC,WAAW,MAAM,CAAC,CAACjD,QAAUwC,SAASQ,OAAO,YAAY,EAAWhD,UACpE,EAAE;QAEN,OAAO4C,cAAc,CAAC,EAAE,IAAII,OAAO,eAAe;IACpD;IAEA,MAAMJ,iBAAiBK,WAAW,MAAM,CAAC,CAACjD,QAAUwC,SAASQ,OAAO,eAAe,EAAWhD;IAC9F,MAAMmD,oBAAoBR,qBAAqBC;IAE/C,OAAO;QACL,GAAIA,cAAc,CAAC,EAAE,IAAII,OAAO,eAAe;QAC/C,CAACE,eAAe,kBAAkB,GAAG,EAAEC,qBAAqBH,OAAO,KAAK;IAC1E;AACF;AAEO,MAAMI,sBAAsB,CACjCC,YACAC,UACAC,iBAAyC,UAAU;IAEnD,IAAIA,AAAmB,cAAnBA,gBAA8B;QAChC,IAAIF,AAAe,MAAfA,YACF,MAAM,IAAI5D,MAAM;QAGlB,OAAO,GAAI,AAAE6D,CAAAA,CAAAA,WAAWD,UAAS,IAAKA,aAAc,GAAE,EAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACxE;IAEA,OAAO,GAAGC,WAAWD,YAAY;AACnC;AAEO,MAAMG,kCAAkC,CAAC7B,OAAcH;IAC5D,MAAMiC,iBAAiBjC,OAAO,KAAK,CAAC,CAACrC,QAAUA,QAAQ;IAEvD,IAAIuE,eAAe/B,QACjB,OAAO8B,iBAAiB,SAAS;IAGnC,OAAOA,iBAAiB,WAAW;AACrC"}
@@ -2,6 +2,7 @@ export { annotationPointOfDualAxis } from './annotationPointOfDualAxis';
2
2
  export { annotationPoint } from './annotationPoint';
3
3
  export { annotationVerticalLine } from './annotationVerticalLine';
4
4
  export { annotationHorizontalLine } from './annotationHorizontalLine';
5
+ export { annotationDifferenceLine } from './annotationDifferenceLine';
5
6
  export { annotationArea } from './annotationArea';
6
7
  export { annotationAreaBand } from './annotationAreaBand';
7
8
  export { splitLine } from './splitLine';
@@ -2,6 +2,7 @@ export { annotationPointOfDualAxis } from "./annotationPointOfDualAxis.js";
2
2
  export { annotationPoint } from "./annotationPoint.js";
3
3
  export { annotationVerticalLine } from "./annotationVerticalLine.js";
4
4
  export { annotationHorizontalLine } from "./annotationHorizontalLine.js";
5
+ export { annotationDifferenceLine } from "./annotationDifferenceLine.js";
5
6
  export { annotationArea } from "./annotationArea.js";
6
7
  export { annotationAreaBand } from "./annotationAreaBand.js";
7
8
  export { splitLine } from "./splitLine.js";