@fluentui/react-charting 5.24.38 → 5.25.0

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 (264) hide show
  1. package/CHANGELOG.json +99 -1
  2. package/CHANGELOG.md +34 -2
  3. package/dist/react-charting.d.ts +129 -1
  4. package/dist/react-charting.js +1 -1
  5. package/dist/react-charting.min.js +1 -1
  6. package/etc/react-charting.api.md +76 -1
  7. package/lib/components/AreaChart/AreaChart.base.d.ts +2 -1
  8. package/lib/components/AreaChart/AreaChart.base.js.map +1 -1
  9. package/lib/components/ChartTable/ChartTable.base.d.ts +2 -1
  10. package/lib/components/ChartTable/ChartTable.base.js.map +1 -1
  11. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +3 -0
  12. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +343 -0
  13. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
  14. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +28 -0
  15. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +111 -0
  16. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -0
  17. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +52 -0
  18. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +2 -0
  19. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
  20. package/lib/components/CommonComponents/CartesianChart.base.d.ts +2 -1
  21. package/lib/components/CommonComponents/CartesianChart.base.js +38 -46
  22. package/lib/components/CommonComponents/CartesianChart.base.js.map +1 -1
  23. package/lib/components/CommonComponents/CartesianChart.styles.js +9 -1
  24. package/lib/components/CommonComponents/CartesianChart.styles.js.map +1 -1
  25. package/lib/components/CommonComponents/CartesianChart.types.d.ts +19 -2
  26. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  27. package/lib/components/CommonComponents/index.d.ts +2 -0
  28. package/lib/components/CommonComponents/index.js +2 -0
  29. package/lib/components/CommonComponents/index.js.map +1 -1
  30. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  31. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  32. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +641 -76
  33. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  34. package/lib/components/DonutChart/Arc/Arc.d.ts +2 -1
  35. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  36. package/lib/components/DonutChart/DonutChart.base.d.ts +2 -1
  37. package/lib/components/DonutChart/DonutChart.base.js.map +1 -1
  38. package/lib/components/DonutChart/Pie/Pie.d.ts +3 -2
  39. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  40. package/lib/components/FunnelChart/FunnelChart.base.js.map +1 -1
  41. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
  42. package/lib/components/GanttChart/GanttChart.base.js.map +1 -1
  43. package/lib/components/GaugeChart/GaugeChart.base.js.map +1 -1
  44. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  45. package/lib/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  46. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.d.ts +2 -1
  47. package/lib/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  48. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -1
  49. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  50. package/lib/components/Legends/Legends.base.d.ts +2 -1
  51. package/lib/components/Legends/Legends.base.js.map +1 -1
  52. package/lib/components/LineChart/LineChart.base.d.ts +2 -1
  53. package/lib/components/LineChart/LineChart.base.js.map +1 -1
  54. package/lib/components/PieChart/Arc/Arc.d.ts +3 -2
  55. package/lib/components/PieChart/Arc/Arc.js.map +1 -1
  56. package/lib/components/PieChart/Pie/Pie.d.ts +3 -2
  57. package/lib/components/PieChart/Pie/Pie.js.map +1 -1
  58. package/lib/components/PieChart/PieChart.base.d.ts +2 -1
  59. package/lib/components/PieChart/PieChart.base.js.map +1 -1
  60. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  61. package/lib/components/SankeyChart/SankeyChart.base.js.map +1 -1
  62. package/lib/components/ScatterChart/ScatterChart.base.js.map +1 -1
  63. package/lib/components/Sparkline/Sparkline.base.d.ts +3 -2
  64. package/lib/components/Sparkline/Sparkline.base.js.map +1 -1
  65. package/lib/components/StackedBarChart/MultiStackedBarChart.base.d.ts +2 -1
  66. package/lib/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  67. package/lib/components/StackedBarChart/StackedBarChart.base.d.ts +2 -1
  68. package/lib/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  69. package/lib/components/TreeChart/TreeChart.base.d.ts +2 -1
  70. package/lib/components/TreeChart/TreeChart.base.js.map +1 -1
  71. package/lib/components/VerticalBarChart/VerticalBarChart.base.d.ts +2 -1
  72. package/lib/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  73. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  74. package/lib/index.d.ts +1 -1
  75. package/lib/index.js.map +1 -1
  76. package/lib/types/IChartAnnotation.d.ts +99 -0
  77. package/lib/types/IChartAnnotation.js +2 -0
  78. package/lib/types/IChartAnnotation.js.map +1 -0
  79. package/lib/types/IDataPoint.d.ts +4 -0
  80. package/lib/types/IDataPoint.js.map +1 -1
  81. package/lib/types/index.d.ts +1 -0
  82. package/lib/types/index.js +1 -0
  83. package/lib/types/index.js.map +1 -1
  84. package/lib/utilities/image-export-utils.js +55 -0
  85. package/lib/utilities/image-export-utils.js.map +1 -1
  86. package/lib/utilities/scatterpolar-utils.d.ts +2 -2
  87. package/lib/utilities/scatterpolar-utils.js.map +1 -1
  88. package/lib/utilities/utilities.d.ts +14 -14
  89. package/lib/utilities/utilities.js +72 -20
  90. package/lib/utilities/utilities.js.map +1 -1
  91. package/lib/utilities/vbc-utils.js.map +1 -1
  92. package/lib-amd/components/AreaChart/AreaChart.base.d.ts +2 -1
  93. package/lib-amd/components/AreaChart/AreaChart.base.js.map +1 -1
  94. package/lib-amd/components/ChartTable/ChartTable.base.d.ts +2 -1
  95. package/lib-amd/components/ChartTable/ChartTable.base.js.map +1 -1
  96. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +3 -0
  97. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js +344 -0
  98. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
  99. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +28 -0
  100. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +119 -0
  101. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -0
  102. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +52 -0
  103. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +5 -0
  104. package/lib-amd/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
  105. package/lib-amd/components/CommonComponents/CartesianChart.base.d.ts +2 -1
  106. package/lib-amd/components/CommonComponents/CartesianChart.base.js +38 -47
  107. package/lib-amd/components/CommonComponents/CartesianChart.base.js.map +1 -1
  108. package/lib-amd/components/CommonComponents/CartesianChart.styles.js +9 -1
  109. package/lib-amd/components/CommonComponents/CartesianChart.styles.js.map +1 -1
  110. package/lib-amd/components/CommonComponents/CartesianChart.types.d.ts +19 -2
  111. package/lib-amd/components/CommonComponents/CartesianChart.types.js.map +1 -1
  112. package/lib-amd/components/CommonComponents/index.d.ts +2 -0
  113. package/lib-amd/components/CommonComponents/index.js +3 -1
  114. package/lib-amd/components/CommonComponents/index.js.map +1 -1
  115. package/lib-amd/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  116. package/lib-amd/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  117. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js +641 -76
  118. package/lib-amd/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  119. package/lib-amd/components/DonutChart/Arc/Arc.d.ts +2 -1
  120. package/lib-amd/components/DonutChart/Arc/Arc.js.map +1 -1
  121. package/lib-amd/components/DonutChart/DonutChart.base.d.ts +2 -1
  122. package/lib-amd/components/DonutChart/DonutChart.base.js.map +1 -1
  123. package/lib-amd/components/DonutChart/Pie/Pie.d.ts +3 -2
  124. package/lib-amd/components/DonutChart/Pie/Pie.js.map +1 -1
  125. package/lib-amd/components/FunnelChart/FunnelChart.base.js.map +1 -1
  126. package/lib-amd/components/FunnelChart/funnelGeometry.js.map +1 -1
  127. package/lib-amd/components/GanttChart/GanttChart.base.js.map +1 -1
  128. package/lib-amd/components/GaugeChart/GaugeChart.base.js.map +1 -1
  129. package/lib-amd/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  130. package/lib-amd/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  131. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.d.ts +2 -1
  132. package/lib-amd/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  133. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -1
  134. package/lib-amd/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  135. package/lib-amd/components/Legends/Legends.base.d.ts +2 -1
  136. package/lib-amd/components/Legends/Legends.base.js.map +1 -1
  137. package/lib-amd/components/LineChart/LineChart.base.d.ts +2 -1
  138. package/lib-amd/components/LineChart/LineChart.base.js.map +1 -1
  139. package/lib-amd/components/PieChart/Arc/Arc.d.ts +3 -2
  140. package/lib-amd/components/PieChart/Arc/Arc.js.map +1 -1
  141. package/lib-amd/components/PieChart/Pie/Pie.d.ts +3 -2
  142. package/lib-amd/components/PieChart/Pie/Pie.js.map +1 -1
  143. package/lib-amd/components/PieChart/PieChart.base.d.ts +2 -1
  144. package/lib-amd/components/PieChart/PieChart.base.js.map +1 -1
  145. package/lib-amd/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  146. package/lib-amd/components/SankeyChart/SankeyChart.base.js.map +1 -1
  147. package/lib-amd/components/ScatterChart/ScatterChart.base.js.map +1 -1
  148. package/lib-amd/components/Sparkline/Sparkline.base.d.ts +3 -2
  149. package/lib-amd/components/Sparkline/Sparkline.base.js.map +1 -1
  150. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.d.ts +2 -1
  151. package/lib-amd/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  152. package/lib-amd/components/StackedBarChart/StackedBarChart.base.d.ts +2 -1
  153. package/lib-amd/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  154. package/lib-amd/components/TreeChart/TreeChart.base.d.ts +2 -1
  155. package/lib-amd/components/TreeChart/TreeChart.base.js.map +1 -1
  156. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.d.ts +2 -1
  157. package/lib-amd/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  158. package/lib-amd/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  159. package/lib-amd/index.d.ts +1 -1
  160. package/lib-amd/index.js.map +1 -1
  161. package/lib-amd/types/IChartAnnotation.d.ts +99 -0
  162. package/lib-amd/types/IChartAnnotation.js +5 -0
  163. package/lib-amd/types/IChartAnnotation.js.map +1 -0
  164. package/lib-amd/types/IDataPoint.d.ts +4 -0
  165. package/lib-amd/types/IDataPoint.js.map +1 -1
  166. package/lib-amd/types/index.d.ts +1 -0
  167. package/lib-amd/types/index.js +2 -1
  168. package/lib-amd/types/index.js.map +1 -1
  169. package/lib-amd/utilities/image-export-utils.js +55 -0
  170. package/lib-amd/utilities/image-export-utils.js.map +1 -1
  171. package/lib-amd/utilities/scatterpolar-utils.d.ts +2 -2
  172. package/lib-amd/utilities/scatterpolar-utils.js.map +1 -1
  173. package/lib-amd/utilities/utilities.d.ts +14 -14
  174. package/lib-amd/utilities/utilities.js +72 -20
  175. package/lib-amd/utilities/utilities.js.map +1 -1
  176. package/lib-amd/utilities/vbc-utils.js.map +1 -1
  177. package/lib-commonjs/components/AreaChart/AreaChart.base.d.ts +2 -1
  178. package/lib-commonjs/components/AreaChart/AreaChart.base.js.map +1 -1
  179. package/lib-commonjs/components/ChartTable/ChartTable.base.d.ts +2 -1
  180. package/lib-commonjs/components/ChartTable/ChartTable.base.js.map +1 -1
  181. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.d.ts +3 -0
  182. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +346 -0
  183. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
  184. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.d.ts +28 -0
  185. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js +118 -0
  186. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.styles.js.map +1 -0
  187. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.d.ts +52 -0
  188. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +3 -0
  189. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
  190. package/lib-commonjs/components/CommonComponents/CartesianChart.base.d.ts +2 -1
  191. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js +38 -46
  192. package/lib-commonjs/components/CommonComponents/CartesianChart.base.js.map +1 -1
  193. package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js +9 -1
  194. package/lib-commonjs/components/CommonComponents/CartesianChart.styles.js.map +1 -1
  195. package/lib-commonjs/components/CommonComponents/CartesianChart.types.d.ts +19 -2
  196. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  197. package/lib-commonjs/components/CommonComponents/index.d.ts +2 -0
  198. package/lib-commonjs/components/CommonComponents/index.js +2 -0
  199. package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
  200. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  201. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  202. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +641 -76
  203. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  204. package/lib-commonjs/components/DonutChart/Arc/Arc.d.ts +2 -1
  205. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  206. package/lib-commonjs/components/DonutChart/DonutChart.base.d.ts +2 -1
  207. package/lib-commonjs/components/DonutChart/DonutChart.base.js.map +1 -1
  208. package/lib-commonjs/components/DonutChart/Pie/Pie.d.ts +3 -2
  209. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  210. package/lib-commonjs/components/FunnelChart/FunnelChart.base.js.map +1 -1
  211. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
  212. package/lib-commonjs/components/GanttChart/GanttChart.base.js.map +1 -1
  213. package/lib-commonjs/components/GaugeChart/GaugeChart.base.js.map +1 -1
  214. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.base.js.map +1 -1
  215. package/lib-commonjs/components/HeatMapChart/HeatMapChart.base.js.map +1 -1
  216. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.d.ts +2 -1
  217. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.base.js.map +1 -1
  218. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.d.ts +2 -1
  219. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.base.js.map +1 -1
  220. package/lib-commonjs/components/Legends/Legends.base.d.ts +2 -1
  221. package/lib-commonjs/components/Legends/Legends.base.js.map +1 -1
  222. package/lib-commonjs/components/LineChart/LineChart.base.d.ts +2 -1
  223. package/lib-commonjs/components/LineChart/LineChart.base.js.map +1 -1
  224. package/lib-commonjs/components/PieChart/Arc/Arc.d.ts +3 -2
  225. package/lib-commonjs/components/PieChart/Arc/Arc.js.map +1 -1
  226. package/lib-commonjs/components/PieChart/Pie/Pie.d.ts +3 -2
  227. package/lib-commonjs/components/PieChart/Pie/Pie.js.map +1 -1
  228. package/lib-commonjs/components/PieChart/PieChart.base.d.ts +2 -1
  229. package/lib-commonjs/components/PieChart/PieChart.base.js.map +1 -1
  230. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  231. package/lib-commonjs/components/SankeyChart/SankeyChart.base.js.map +1 -1
  232. package/lib-commonjs/components/ScatterChart/ScatterChart.base.js.map +1 -1
  233. package/lib-commonjs/components/Sparkline/Sparkline.base.d.ts +3 -2
  234. package/lib-commonjs/components/Sparkline/Sparkline.base.js.map +1 -1
  235. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.d.ts +2 -1
  236. package/lib-commonjs/components/StackedBarChart/MultiStackedBarChart.base.js.map +1 -1
  237. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.d.ts +2 -1
  238. package/lib-commonjs/components/StackedBarChart/StackedBarChart.base.js.map +1 -1
  239. package/lib-commonjs/components/TreeChart/TreeChart.base.d.ts +2 -1
  240. package/lib-commonjs/components/TreeChart/TreeChart.base.js.map +1 -1
  241. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.d.ts +2 -1
  242. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.base.js.map +1 -1
  243. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.base.js.map +1 -1
  244. package/lib-commonjs/index.d.ts +1 -1
  245. package/lib-commonjs/index.js.map +1 -1
  246. package/lib-commonjs/types/IChartAnnotation.d.ts +99 -0
  247. package/lib-commonjs/types/IChartAnnotation.js +3 -0
  248. package/lib-commonjs/types/IChartAnnotation.js.map +1 -0
  249. package/lib-commonjs/types/IDataPoint.d.ts +4 -0
  250. package/lib-commonjs/types/IDataPoint.js.map +1 -1
  251. package/lib-commonjs/types/index.d.ts +1 -0
  252. package/lib-commonjs/types/index.js +1 -0
  253. package/lib-commonjs/types/index.js.map +1 -1
  254. package/lib-commonjs/utilities/image-export-utils.js +55 -0
  255. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  256. package/lib-commonjs/utilities/scatterpolar-utils.d.ts +2 -2
  257. package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -1
  258. package/lib-commonjs/utilities/utilities.d.ts +14 -14
  259. package/lib-commonjs/utilities/utilities.js +72 -20
  260. package/lib-commonjs/utilities/utilities.js.map +1 -1
  261. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  262. package/package.json +9 -9
  263. package/src/components/CommonComponents/Annotations/ChartAnnotationLayer.types.ts +58 -0
  264. package/src/components/CommonComponents/CartesianChart.types.ts +23 -1
@@ -0,0 +1,111 @@
1
+ import { color as d3Color } from 'd3-color';
2
+ export var DEFAULT_ANNOTATION_BACKGROUND_OPACITY = 0.8;
3
+ export var DEFAULT_ANNOTATION_PADDING = '4px 8px';
4
+ export var DEFAULT_CONNECTOR_START_PADDING = 12;
5
+ export var DEFAULT_CONNECTOR_END_PADDING = 0;
6
+ export var DEFAULT_CONNECTOR_STROKE_WIDTH = 2;
7
+ export var DEFAULT_CONNECTOR_ARROW = 'end';
8
+ export var applyOpacityToColor = function (color, opacity) {
9
+ if (!color) {
10
+ return undefined;
11
+ }
12
+ var parsed = d3Color(color);
13
+ if (!parsed) {
14
+ return color;
15
+ }
16
+ parsed.opacity = Math.max(0, Math.min(1, opacity));
17
+ return parsed.toString();
18
+ };
19
+ export var getDefaultAnnotationBackgroundColor = function (theme) {
20
+ return applyOpacityToColor(theme.semanticColors.bodyBackground, DEFAULT_ANNOTATION_BACKGROUND_OPACITY);
21
+ };
22
+ export var getDefaultConnectorStrokeColor = function (theme) { return theme.palette.neutralPrimary; };
23
+ export var getStyles = function (props) {
24
+ var theme = props.theme, className = props.className;
25
+ var defaultBackground = getDefaultAnnotationBackgroundColor(theme);
26
+ var defaultTextColor = theme.semanticColors.bodyText;
27
+ var defaultBorderColor = theme.semanticColors.bodyDivider;
28
+ return {
29
+ root: [
30
+ {
31
+ position: 'absolute',
32
+ top: 0,
33
+ left: 0,
34
+ right: 0,
35
+ bottom: 0,
36
+ width: '100%',
37
+ height: '100%',
38
+ pointerEvents: 'none',
39
+ overflow: 'visible',
40
+ zIndex: 1,
41
+ },
42
+ className,
43
+ ],
44
+ annotation: [
45
+ theme.fonts.small,
46
+ {
47
+ position: 'absolute',
48
+ pointerEvents: 'none',
49
+ display: 'flex',
50
+ alignItems: 'center',
51
+ justifyContent: 'center',
52
+ textAlign: 'center',
53
+ backgroundColor: defaultBackground,
54
+ color: defaultTextColor,
55
+ padding: DEFAULT_ANNOTATION_PADDING,
56
+ borderRadius: 4,
57
+ boxShadow: theme.effects.elevation4,
58
+ border: "1px solid ".concat(defaultBorderColor),
59
+ whiteSpace: 'pre-wrap',
60
+ zIndex: 2,
61
+ },
62
+ ],
63
+ connectorLayer: [
64
+ {
65
+ position: 'absolute',
66
+ top: 0,
67
+ left: 0,
68
+ width: '100%',
69
+ height: '100%',
70
+ pointerEvents: 'none',
71
+ overflow: 'visible',
72
+ },
73
+ ],
74
+ measurement: [
75
+ {
76
+ position: 'absolute',
77
+ visibility: 'hidden',
78
+ pointerEvents: 'none',
79
+ },
80
+ ],
81
+ annotationContent: [
82
+ {
83
+ width: '100%',
84
+ height: '100%',
85
+ pointerEvents: 'none',
86
+ },
87
+ ],
88
+ annotationForeignObject: [
89
+ {
90
+ overflow: 'visible',
91
+ pointerEvents: 'none',
92
+ },
93
+ ],
94
+ annotationContentInteractive: [
95
+ {
96
+ pointerEvents: 'auto',
97
+ },
98
+ ],
99
+ annotationForeignObjectInteractive: [
100
+ {
101
+ pointerEvents: 'auto',
102
+ },
103
+ ],
104
+ connectorGroup: [
105
+ {
106
+ pointerEvents: 'none',
107
+ },
108
+ ],
109
+ };
110
+ };
111
+ //# sourceMappingURL=ChartAnnotationLayer.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartAnnotationLayer.styles.js","sourceRoot":"../src/","sources":["components/CommonComponents/Annotations/ChartAnnotationLayer.styles.ts"],"names":[],"mappings":"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","sourcesContent":["import { ITheme, IStyle } from '@fluentui/react/lib/Styling';\nimport { IStyleFunctionOrObject } from '@fluentui/react/lib/Utilities';\n\nexport interface IChartAnnotationLayerStyleProps {\n theme: ITheme;\n className?: string;\n}\nimport { color as d3Color } from 'd3-color';\nimport { ChartAnnotationArrowHead } from '../../../types/IChartAnnotation';\n\nexport interface IChartAnnotationLayerStyles {\n root?: IStyle;\n annotation?: IStyle;\n connectorLayer?: IStyle;\n measurement?: IStyle;\n annotationContent?: IStyle;\n annotationForeignObject?: IStyle;\n annotationContentInteractive?: IStyle;\n annotationForeignObjectInteractive?: IStyle;\n connectorGroup?: IStyle;\n}\n\nexport const DEFAULT_ANNOTATION_BACKGROUND_OPACITY = 0.8;\nexport const DEFAULT_ANNOTATION_PADDING = '4px 8px';\nexport const DEFAULT_CONNECTOR_START_PADDING = 12;\nexport const DEFAULT_CONNECTOR_END_PADDING = 0;\nexport const DEFAULT_CONNECTOR_STROKE_WIDTH = 2;\nexport const DEFAULT_CONNECTOR_ARROW: ChartAnnotationArrowHead = 'end';\n\nexport const applyOpacityToColor = (color: string | undefined, opacity: number): string | undefined => {\n if (!color) {\n return undefined;\n }\n\n const parsed = d3Color(color);\n if (!parsed) {\n return color;\n }\n\n parsed.opacity = Math.max(0, Math.min(1, opacity));\n return parsed.toString();\n};\n\nexport const getDefaultAnnotationBackgroundColor = (theme: ITheme): string | undefined =>\n applyOpacityToColor(theme.semanticColors.bodyBackground, DEFAULT_ANNOTATION_BACKGROUND_OPACITY);\n\nexport const getDefaultConnectorStrokeColor = (theme: ITheme): string => theme.palette.neutralPrimary;\n\nexport const getStyles: IStyleFunctionOrObject<IChartAnnotationLayerStyleProps, IChartAnnotationLayerStyles> = (\n props: IChartAnnotationLayerStyleProps,\n) => {\n const { theme, className } = props;\n const defaultBackground = getDefaultAnnotationBackgroundColor(theme);\n const defaultTextColor = theme.semanticColors.bodyText;\n const defaultBorderColor = theme.semanticColors.bodyDivider;\n\n return {\n root: [\n {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n width: '100%',\n height: '100%',\n pointerEvents: 'none',\n overflow: 'visible',\n zIndex: 1,\n },\n className,\n ],\n annotation: [\n theme.fonts.small,\n {\n position: 'absolute',\n pointerEvents: 'none',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n textAlign: 'center',\n backgroundColor: defaultBackground,\n color: defaultTextColor,\n padding: DEFAULT_ANNOTATION_PADDING,\n borderRadius: 4,\n boxShadow: theme.effects.elevation4,\n border: `1px solid ${defaultBorderColor}`,\n whiteSpace: 'pre-wrap',\n zIndex: 2,\n },\n ],\n connectorLayer: [\n {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n pointerEvents: 'none',\n overflow: 'visible',\n },\n ],\n measurement: [\n {\n position: 'absolute',\n visibility: 'hidden',\n pointerEvents: 'none',\n },\n ],\n annotationContent: [\n {\n width: '100%',\n height: '100%',\n pointerEvents: 'none',\n },\n ],\n annotationForeignObject: [\n {\n overflow: 'visible',\n pointerEvents: 'none',\n },\n ],\n annotationContentInteractive: [\n {\n pointerEvents: 'auto',\n },\n ],\n annotationForeignObjectInteractive: [\n {\n pointerEvents: 'auto',\n },\n ],\n connectorGroup: [\n {\n pointerEvents: 'none',\n },\n ],\n };\n};\n"]}
@@ -0,0 +1,52 @@
1
+ import { ITheme } from '@fluentui/react/lib/Styling';
2
+ import { IChartAnnotation, ChartAnnotationArrowHead } from '../../../types/IChartAnnotation';
3
+ export interface IAnnotationPoint {
4
+ x: number;
5
+ y: number;
6
+ }
7
+ export interface IAnnotationPlotRect {
8
+ x: number;
9
+ y: number;
10
+ width: number;
11
+ height: number;
12
+ }
13
+ export interface IChartAnnotationContext {
14
+ /** Rectangle describing the drawable area of the chart (without margins) */
15
+ plotRect: IAnnotationPlotRect;
16
+ /** Size of the owning SVG element */
17
+ svgRect: {
18
+ width: number;
19
+ height: number;
20
+ };
21
+ /** Indicates if layout should be mirrored */
22
+ isRtl?: boolean;
23
+ /** Primary x scale mapping data domain to pixels */
24
+ xScale?: (value: any) => number;
25
+ /** Primary y scale mapping data domain to pixels */
26
+ yScalePrimary?: (value: any) => number;
27
+ /** Secondary y scale when present */
28
+ yScaleSecondary?: (value: any) => number;
29
+ }
30
+ export interface IChartAnnotationLayerProps {
31
+ annotations?: IChartAnnotation[];
32
+ context: IChartAnnotationContext;
33
+ theme: ITheme;
34
+ className?: string;
35
+ }
36
+ export interface IResolvedAnnotationPosition {
37
+ /** Final absolute position after applying layout and offsets */
38
+ point: IAnnotationPoint;
39
+ /** Raw anchor position before offsets (used for connectors) */
40
+ anchor: IAnnotationPoint;
41
+ }
42
+ export type ConnectorRenderData = {
43
+ key: string;
44
+ start: IAnnotationPoint;
45
+ end: IAnnotationPoint;
46
+ strokeColor: string;
47
+ strokeWidth: number;
48
+ dashArray?: string;
49
+ arrow: ChartAnnotationArrowHead;
50
+ markerSize: number;
51
+ markerStrokeWidth: number;
52
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ChartAnnotationLayer.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartAnnotationLayer.types.js","sourceRoot":"../src/","sources":["components/CommonComponents/Annotations/ChartAnnotationLayer.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ITheme } from '@fluentui/react/lib/Styling';\nimport { IChartAnnotation, ChartAnnotationArrowHead } from '../../../types/IChartAnnotation';\n\nexport interface IAnnotationPoint {\n x: number;\n y: number;\n}\n\nexport interface IAnnotationPlotRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface IChartAnnotationContext {\n /** Rectangle describing the drawable area of the chart (without margins) */\n plotRect: IAnnotationPlotRect;\n /** Size of the owning SVG element */\n svgRect: { width: number; height: number };\n /** Indicates if layout should be mirrored */\n isRtl?: boolean;\n /** Primary x scale mapping data domain to pixels */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n xScale?: (value: any) => number;\n /** Primary y scale mapping data domain to pixels */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yScalePrimary?: (value: any) => number;\n /** Secondary y scale when present */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n yScaleSecondary?: (value: any) => number;\n}\n\nexport interface IChartAnnotationLayerProps {\n annotations?: IChartAnnotation[];\n context: IChartAnnotationContext;\n theme: ITheme;\n className?: string;\n}\n\nexport interface IResolvedAnnotationPosition {\n /** Final absolute position after applying layout and offsets */\n point: IAnnotationPoint;\n /** Raw anchor position before offsets (used for connectors) */\n anchor: IAnnotationPoint;\n}\n\nexport type ConnectorRenderData = {\n key: string;\n start: IAnnotationPoint;\n end: IAnnotationPoint;\n strokeColor: string;\n strokeWidth: number;\n dashArray?: string;\n arrow: ChartAnnotationArrowHead;\n markerSize: number;\n markerStrokeWidth: number;\n};\n"]}
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { IModifiedCartesianChartProps } from '../../index';
3
3
  import { IChart } from '../../types/index';
4
+ import type { JSXElement } from '@fluentui/utilities';
4
5
  export interface ICartesianChartState {
5
6
  containerWidth: number;
6
7
  containerHeight: number;
@@ -39,7 +40,7 @@ export declare class CartesianChartBase extends React.Component<IModifiedCartesi
39
40
  componentWillUnmount(): void;
40
41
  componentDidUpdate(prevProps: IModifiedCartesianChartProps): void;
41
42
  calculateMaxYAxisLabelLength: (className: string) => number;
42
- render(): JSX.Element;
43
+ render(): JSXElement;
43
44
  /**
44
45
  * Dedicated function to return the Callout JSX Element , which can further be used to only call this when
45
46
  * only the calloutprops and charthover props changes.
@@ -8,6 +8,7 @@ import { formatToLocaleString } from '@fluentui/chart-utilities';
8
8
  import { createNumericXAxis, createStringXAxis, getAccessibleDataObject, createDateXAxis, XAxisTypes, YAxisType, createWrapOfXLabels, rotateXAxisLabels, Points, pointTypes, calculateLongestLabelWidth, createYAxisLabels, ChartTypes, wrapContent, getSecureProps, truncateString, tooltipOfAxislabels, DEFAULT_WRAP_WIDTH, } from '../../utilities/index';
9
9
  import { Shape } from '../Legends/index';
10
10
  import { SVGTooltipText } from '../../utilities/SVGTooltipText';
11
+ import { ChartAnnotationLayer } from './Annotations/ChartAnnotationLayer';
11
12
  var getClassNames = classNamesFunction();
12
13
  var ChartHoverCard = React.lazy(function () {
13
14
  return import('../../utilities/ChartHoverCard/ChartHoverCard').then(function (module) { return ({ default: module.ChartHoverCard }); });
@@ -302,8 +303,8 @@ var CartesianChartBase = /** @class */ (function (_super) {
302
303
  CartesianChartBase.prototype.render = function () {
303
304
  var _a, _b, _c, _d;
304
305
  var _this = this;
305
- var _e, _f, _g, _h, _j, _k, _l, _m, _o;
306
- var _p = this.props, calloutProps = _p.calloutProps, points = _p.points, chartType = _p.chartType, chartHoverProps = _p.chartHoverProps, svgFocusZoneProps = _p.svgFocusZoneProps, svgProps = _p.svgProps, culture = _p.culture, dateLocalizeOptions = _p.dateLocalizeOptions, timeFormatLocale = _p.timeFormatLocale, customDateTimeFormatter = _p.customDateTimeFormatter;
306
+ var _e, _f, _g, _h, _j, _k;
307
+ var _l = this.props, calloutProps = _l.calloutProps, points = _l.points, chartType = _l.chartType, chartHoverProps = _l.chartHoverProps, svgFocusZoneProps = _l.svgFocusZoneProps, svgProps = _l.svgProps, culture = _l.culture, dateLocalizeOptions = _l.dateLocalizeOptions, timeFormatLocale = _l.timeFormatLocale, customDateTimeFormatter = _l.customDateTimeFormatter;
307
308
  if (this.props.parentRef) {
308
309
  this._fitParentContainer();
309
310
  }
@@ -329,36 +330,24 @@ var CartesianChartBase = /** @class */ (function (_super) {
329
330
  });
330
331
  // eslint-disable-next-line @typescript-eslint/no-deprecated
331
332
  var callout = null;
333
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
334
+ var yScalePrimary;
335
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
336
+ var yScaleSecondary;
332
337
  var children = null;
333
338
  if ((this.props.enableFirstRenderOptimization && this.chartContainer) ||
334
339
  !this.props.enableFirstRenderOptimization) {
335
340
  this._isFirstRender = false;
336
- var XAxisParams = {
337
- domainNRangeValues: this.props.getDomainNRangeValues(points, this.props.getDomainMargins ? this.props.getDomainMargins(this.state.containerWidth) : this.margins, this.state.containerWidth, chartType, this._isRtl, this.props.xAxisType, this.props.barwidth, this.props.tickValues,
341
+ var XAxisParams = __assign({ domainNRangeValues: this.props.getDomainNRangeValues(points, this.props.getDomainMargins ? this.props.getDomainMargins(this.state.containerWidth) : this.margins, this.state.containerWidth, chartType, this._isRtl, this.props.xAxisType, this.props.barwidth, this.props.tickValues,
338
342
  // This is only used for Horizontal Bar Chart with Axis for y as string axis
339
- this.state.startFromX),
343
+ this.state.startFromX),
340
344
  // FIXME: In XAxisParams, containerHeight is used by HBWA to generate vertical gridlines.
341
345
  // Since the x-axis in HBWA is numeric, it typically doesn't require transformation.
342
346
  // However, if transformation props are enabled, the updated _removalValueForTextTuncate
343
347
  // will only be available in the next render, as it's set after the axis is created.
344
348
  // Solution: Delay the creation of gridlines until after the transformation has been applied,
345
349
  // or precompute the required height for transformed labels (_removalValueForTextTuncate).
346
- containerHeight: this.state.containerHeight - this._removalValueForTextTuncate,
347
- margins: this.margins,
348
- xAxisElement: this.xAxisElement,
349
- showRoundOffXTickValues: (_e = this.props.showRoundOffXTickValues) !== null && _e !== void 0 ? _e : true,
350
- xAxisCount: this.props.xAxisTickCount,
351
- xAxistickSize: this.props.xAxistickSize,
352
- tickPadding: this.props.tickPadding || this.props.showXAxisLablesTooltip ? 5 : 10,
353
- xAxisPadding: this.props.xAxisPadding,
354
- xAxisInnerPadding: this.props.xAxisInnerPadding,
355
- xAxisOuterPadding: this.props.xAxisOuterPadding,
356
- containerWidth: this.state.containerWidth,
357
- hideTickOverlap: this.props.hideTickOverlap,
358
- calcMaxLabelWidth: this._calcMaxLabelWidthWithTransform,
359
- tickStep: (_f = this.props.xAxis) === null || _f === void 0 ? void 0 : _f.tickStep,
360
- tick0: (_g = this.props.xAxis) === null || _g === void 0 ? void 0 : _g.tick0,
361
- };
350
+ containerHeight: this.state.containerHeight - this._removalValueForTextTuncate, margins: this.margins, xAxisElement: this.xAxisElement, showRoundOffXTickValues: (_e = this.props.showRoundOffXTickValues) !== null && _e !== void 0 ? _e : true, xAxisCount: this.props.xAxisTickCount, xAxistickSize: this.props.xAxistickSize, tickPadding: this.props.tickPadding || this.props.showXAxisLablesTooltip ? 5 : 10, xAxisPadding: this.props.xAxisPadding, xAxisInnerPadding: this.props.xAxisInnerPadding, xAxisOuterPadding: this.props.xAxisOuterPadding, containerWidth: this.state.containerWidth, hideTickOverlap: this.props.hideTickOverlap, calcMaxLabelWidth: this._calcMaxLabelWidthWithTransform }, this.props.xAxis);
362
351
  /**
363
352
  * These scales used for 2 purposes.
364
353
  * 1. To create x and y axis
@@ -384,36 +373,17 @@ var CartesianChartBase = /** @class */ (function (_super) {
384
373
  this._xScale = xScale;
385
374
  this._tickValues = tickValues;
386
375
  this._transformXAxisLabels();
387
- var YAxisParams = {
388
- margins: this.props.getYDomainMargins ? this.props.getYDomainMargins(this.state.containerHeight) : this.margins,
389
- containerWidth: this.state.containerWidth,
390
- containerHeight: this.state.containerHeight - this._removalValueForTextTuncate,
391
- yAxisElement: this.yAxisElement,
392
- yAxisTickFormat: this.props.yAxisTickFormat,
393
- yAxisTickCount: this.props.yAxisTickCount,
394
- yMinValue: this.props.yMinValue || 0,
395
- yMaxValue: this.props.yMaxValue || 0,
396
- tickPadding: 10,
397
- maxOfYVal: this.props.maxOfYVal,
398
- yMinMaxValues: this.props.getMinMaxOfYAxis(points, this.props.yAxisType),
376
+ var YAxisParams = __assign({ margins: this.props.getYDomainMargins ? this.props.getYDomainMargins(this.state.containerHeight) : this.margins, containerWidth: this.state.containerWidth, containerHeight: this.state.containerHeight - this._removalValueForTextTuncate, yAxisElement: this.yAxisElement, yAxisTickFormat: this.props.yAxisTickFormat, yAxisTickCount: this.props.yAxisTickCount, yMinValue: this.props.yMinValue || 0, yMaxValue: this.props.yMaxValue || 0, tickPadding: 10, maxOfYVal: this.props.maxOfYVal, yMinMaxValues: this.props.getMinMaxOfYAxis(points, this.props.yAxisType),
399
377
  // please note these padding default values must be consistent in here
400
378
  // and the parent chart(HBWA/Vertical etc..) for more details refer example
401
379
  // http://using-d3js.com/04_07_ordinal_scales.html
402
- yAxisPadding: this.props.yAxisPadding || 0,
403
- tickValues: this.props.yAxisTickValues,
404
- tickStep: (_h = this.props.yAxis) === null || _h === void 0 ? void 0 : _h.tickStep,
405
- tick0: (_j = this.props.yAxis) === null || _j === void 0 ? void 0 : _j.tick0,
406
- };
380
+ yAxisPadding: this.props.yAxisPadding || 0, tickValues: this.props.yAxisTickValues }, this.props.yAxis);
407
381
  /**
408
382
  * These scales used for 2 purposes.
409
383
  * 1. To create x and y axis
410
384
  * 2. To draw the graph.
411
385
  * For area/line chart using same scales. For other charts, creating their own scales to draw the graph.
412
386
  */
413
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
414
- var yScalePrimary = void 0;
415
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
416
- var yScaleSecondary = void 0;
417
387
  var axisData = { yAxisDomainValues: [] };
418
388
  if (this.props.yAxisType && this.props.yAxisType === YAxisType.StringAxis) {
419
389
  yScalePrimary = this.props.createStringYAxis(YAxisParams, this.props.stringDatasetForYAxisDomain, this._isRtl, this.props.barwidth, this.props.chartType);
@@ -424,7 +394,7 @@ var CartesianChartBase = /** @class */ (function (_super) {
424
394
  // rendering the secondary y-axis. Therefore, rather than checking the secondaryYScaleOptions
425
395
  // prop to determine whether to create a secondary y-axis, it's more appropriate to check if any
426
396
  // data points are assigned to use the secondary y-scale.
427
- if ((_k = this.props) === null || _k === void 0 ? void 0 : _k.secondaryYScaleOptions) {
397
+ if ((_f = this.props) === null || _f === void 0 ? void 0 : _f.secondaryYScaleOptions) {
428
398
  var YAxisParamsSecondary = {
429
399
  margins: this.margins,
430
400
  containerWidth: this.state.containerWidth,
@@ -432,8 +402,8 @@ var CartesianChartBase = /** @class */ (function (_super) {
432
402
  yAxisElement: this.yAxisElementSecondary,
433
403
  yAxisTickFormat: this.props.yAxisTickFormat,
434
404
  yAxisTickCount: this.props.yAxisTickCount,
435
- yMinValue: ((_l = this.props.secondaryYScaleOptions) === null || _l === void 0 ? void 0 : _l.yMinValue) || 0,
436
- yMaxValue: (_o = (_m = this.props.secondaryYScaleOptions) === null || _m === void 0 ? void 0 : _m.yMaxValue) !== null && _o !== void 0 ? _o : 100,
405
+ yMinValue: ((_g = this.props.secondaryYScaleOptions) === null || _g === void 0 ? void 0 : _g.yMinValue) || 0,
406
+ yMaxValue: (_j = (_h = this.props.secondaryYScaleOptions) === null || _h === void 0 ? void 0 : _h.yMaxValue) !== null && _j !== void 0 ? _j : 100,
437
407
  tickPadding: 10,
438
408
  yMinMaxValues: this.props.getMinMaxOfYAxis(points, this.props.yAxisType, true),
439
409
  yAxisPadding: this.props.yAxisPadding,
@@ -487,6 +457,27 @@ var CartesianChartBase = /** @class */ (function (_super) {
487
457
  width: this.state.containerWidth,
488
458
  height: this.state.containerHeight,
489
459
  };
460
+ var startFromX = this.state.startFromX || 0;
461
+ var plotWidth = Math.max(0, svgDimensions.width - this.margins.left - this.margins.right - startFromX);
462
+ var plotHeight = Math.max(0, svgDimensions.height - this.margins.top - this.margins.bottom - this._removalValueForTextTuncate);
463
+ var plotRect = {
464
+ x: this._isRtl ? this.margins.left : this.margins.left + startFromX,
465
+ y: this.margins.top,
466
+ width: plotWidth,
467
+ height: plotHeight,
468
+ };
469
+ var annotations = (_k = this.props.annotations) !== null && _k !== void 0 ? _k : [];
470
+ var hasAnnotations = annotations.length > 0;
471
+ var annotationContext = hasAnnotations
472
+ ? {
473
+ plotRect: plotRect,
474
+ svgRect: svgDimensions,
475
+ isRtl: this._isRtl,
476
+ xScale: this._xScale,
477
+ yScalePrimary: yScalePrimary,
478
+ yScaleSecondary: yScaleSecondary,
479
+ }
480
+ : undefined;
490
481
  var focusDirection;
491
482
  if (this.props.focusZoneDirection === FocusZoneDirection.vertical) {
492
483
  focusDirection = this.props.focusZoneDirection;
@@ -599,7 +590,8 @@ var CartesianChartBase = /** @class */ (function (_super) {
599
590
  : this.margins.right / 2 + this.titleMargin, ",\n ").concat(svgDimensions.height - this.margins.bottom - this.margins.top - this.titleMargin, ")rotate(-90)"),
600
591
  className: this._classNames.axisAnnotation,
601
592
  'aria-hidden': true,
602
- }, maxWidth: yAxisTitleMaximumAllowedHeight }, commonSvgToolTipProps))))),
593
+ }, maxWidth: yAxisTitleMaximumAllowedHeight }, commonSvgToolTipProps)))),
594
+ hasAnnotations && annotationContext && (React.createElement(ChartAnnotationLayer, { annotations: annotations, context: annotationContext, theme: this.props.theme, className: this._classNames.annotationLayer }))),
603
595
  !this.props.hideLegend && (React.createElement("div", { ref: function (e) { return (_this.legendContainer = e); }, className: this._classNames.legendContainer }, this.props.legendBars)),
604
596
  callout && React.createElement(React.Suspense, { fallback: React.createElement("div", null, "Loading...") }, callout)));
605
597
  };