@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
@@ -1 +1 @@
1
- {"version":3,"file":"vbc-utils.js","sourceRoot":"../src/","sources":["utilities/vbc-utils.ts"],"names":[],"mappings":";;;AAEO,IAAM,0BAA0B,GAAG,UAAC,IAAuB;IAChE,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,OAAO;IACT,CAAC;IACD,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC;QACpB,OAAA,CAAC,YAAY,IAAI,CAAC,CAAC,CAAE,CAAU,CAAC,OAAO,EAAE,GAAI,CAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAE,CAAY,GAAI,CAAY;IAAjG,CAAiG,CAClG,CAAC;IACF,IAAI,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC;IAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EA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AAC,KAAK,GAAG,eAAe,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC,CACrG,CAAC;IACF,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAZW,QAAA,4BAA4B,gCAYvC;AAEF;;GAEG;AACI,IAAM,cAAc,GAAG,UAAC,cAAsB,EAAE,OAAiB,EAAE,WAAe;IAAf,4BAAA,EAAA,eAAe;IACvF,OAAO,cAAc,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC;AACvF,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB;AAEF;;GAEG;AACI,IAAM,kBAAkB,GAAG,UAAC,QAAgB,EAAE,YAAoB;IACvE,0EAA0E;IAC1E,6EAA6E;IAC7E,IAAM,cAAc,GAAG,YAAY,GAAG,CAAC,CAAC,GAAG,YAAY,CAAC,CAAC;IACzD,OAAO,QAAQ,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC;AACpD,CAAC,CAAC;AALW,QAAA,kBAAkB,sBAK7B;AAEF;;GAEG;AACI,IAAM,iBAAiB,GAAG,UAAC,SAAiB,EAAE,QAAgB,EAAE,YAAoB;IACzF,OAAO,SAAS,GAAG,IAAA,0BAAkB,EAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AAChE,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B;AAEF;;;GAGG;AACI,IAAM,aAAa,GAAG,UAAC,UAAkB,EAAE,QAAgB,EAAE,YAAoB;IACtF,OAAO,UAAU,GAAG,IAAA,0BAAkB,EAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACjE,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB","sourcesContent":["import { IMargins } from './utilities';\n\nexport const getClosestPairDiffAndRange = (data: number[] | Date[]): [number, number] | undefined => {\n if (data.length < 2) {\n return;\n }\n data = data.sort((a, b) =>\n a instanceof Date ? (a as Date).getTime() - (b as Date).getTime() : (a as number) - (b as number),\n );\n let minDiff = Number.MAX_VALUE;\n for (let i = 1; i < data.length; i++) {\n const diff =\n data[i] instanceof Date\n ? (data[i] as Date).getTime() - (data[i - 1] as Date).getTime()\n : (data[i] as number) - (data[i - 1] as number);\n minDiff = Math.min(minDiff, diff);\n }\n const range =\n data[0] instanceof Date\n ? (data[data.length - 1] as Date).getTime() - (data[0] as Date).getTime()\n : (data[data.length - 1] as number) - (data[0] as number);\n return [minDiff, range];\n};\n\nexport const calculateAppropriateBarWidth = (data: number[] | Date[], totalWidth: number, innerPadding: number) => {\n const result = getClosestPairDiffAndRange(data);\n if (!result || result[1] === 0) {\n return 16;\n }\n const [closestPairDiff, range] = result;\n // Refer to https://microsoft.github.io/fluentui-charting-contrib/docs/rfcs/fix-overlapping-bars-on-continuous-axes\n // for the derivation of the following formula.\n const barWidth = Math.floor(\n (totalWidth * closestPairDiff * (1 - innerPadding)) / (range + closestPairDiff * (1 - innerPadding)),\n );\n return barWidth;\n};\n\n/**\n * Calculates the total width available for rendering bars.\n */\nexport const calcTotalWidth = (containerWidth: number, margins: IMargins, extraMargin = 0): number => {\n return containerWidth - (margins.left || 0) - (margins.right || 0) - extraMargin * 2;\n};\n\n/**\n * Calculates the combined size of all bands and the gaps between them, in units relative to the bandwidth.\n */\nexport const calcTotalBandUnits = (numBands: number, innerPadding: number) => {\n // inner_padding = space_between_bands / (space_between_bands + bandwidth)\n // => space_between_bands = (inner_padding / (1 - inner_padding)) * bandwidth\n const gapToBandRatio = innerPadding / (1 - innerPadding);\n return numBands + (numBands - 1) * gapToBandRatio;\n};\n\n/**\n * Calculates the total width required to render all bands including the gaps between them.\n */\nexport const calcRequiredWidth = (bandwidth: number, numBands: number, innerPadding: number) => {\n return bandwidth * calcTotalBandUnits(numBands, innerPadding);\n};\n\n/**\n * Calculates the maximum possible bandwidth such that the combined widths of all bands\n * and the gaps between them exactly fill the total available width.\n */\nexport const calcBandwidth = (totalWidth: number, numBands: number, innerPadding: number) => {\n return totalWidth / calcTotalBandUnits(numBands, innerPadding);\n};\n"]}
1
+ {"version":3,"file":"vbc-utils.js","sourceRoot":"../src/","sources":["utilities/vbc-utils.ts"],"names":[],"mappings":";;;AAEO,IAAM,0BAA0B,GAAG,UAAC,IAAuB;IAChE,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,OAAO;IACT,CAAC;IACD,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC;QACpB,OAAA,CAAC,YAAY,IAAI,CAAC,CAAC,CAAE,CAAU,CAAC,OAAO,EAAE,GAAI,CAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAE,CAAY,GAAI,CAAY;IAAjG,CAAiG,CAClG,CAAC;IACF,IAAI,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC;IAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,IAAM,IAAI,GACR,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI;YACrB,CAAC,CAAE,IAAI,CAAC,CAAC,CAAU,CAAC,OAAO,EAAE,GAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAU,CAAC,OAAO,EAAE;YAC/D,CAAC,CAAE,IAAI,CAAC,CAAC,CAAY,GAAI,IAAI,CAAC,CAAC,GAAG,CAAC,CAAY,CAAC;QACpD,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,IAAM,KAAK,GACT,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI;QACrB,CAAC,CAAE,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAU,CAAC,OAAO,EAAE,GAAI,IAAI,CAAC,CAAC,CAAU,CAAC,OAAO,EAAE;QACzE,CAAC,CAAE,IA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AC,GAAG,YAAY,CAAC,CAAC;IACzD,OAAO,QAAQ,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC;AACpD,CAAC,CAAC;AALW,QAAA,kBAAkB,sBAK7B;AAEF;;GAEG;AACI,IAAM,iBAAiB,GAAG,UAAC,SAAiB,EAAE,QAAgB,EAAE,YAAoB;IACzF,OAAO,SAAS,GAAG,IAAA,0BAAkB,EAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AAChE,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B;AAEF;;;GAGG;AACI,IAAM,aAAa,GAAG,UAAC,UAAkB,EAAE,QAAgB,EAAE,YAAoB;IACtF,OAAO,UAAU,GAAG,IAAA,0BAAkB,EAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AACjE,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB","sourcesContent":["import { IMargins } from './utilities';\n\nexport const getClosestPairDiffAndRange = (data: number[] | Date[]): [number, number] | undefined => {\n if (data.length < 2) {\n return;\n }\n data = data.sort((a, b) =>\n a instanceof Date ? (a as Date).getTime() - (b as Date).getTime() : (a as number) - (b as number),\n );\n let minDiff = Number.MAX_VALUE;\n for (let i = 1; i < data.length; i++) {\n const diff =\n data[i] instanceof Date\n ? (data[i] as Date).getTime() - (data[i - 1] as Date).getTime()\n : (data[i] as number) - (data[i - 1] as number);\n minDiff = Math.min(minDiff, diff);\n }\n const range =\n data[0] instanceof Date\n ? (data[data.length - 1] as Date).getTime() - (data[0] as Date).getTime()\n : (data[data.length - 1] as number) - (data[0] as number);\n return [minDiff, range];\n};\n\nexport const calculateAppropriateBarWidth = (\n data: number[] | Date[],\n totalWidth: number,\n innerPadding: number,\n): number => {\n const result = getClosestPairDiffAndRange(data);\n if (!result || result[1] === 0) {\n return 16;\n }\n const [closestPairDiff, range] = result;\n // Refer to https://microsoft.github.io/fluentui-charting-contrib/docs/rfcs/fix-overlapping-bars-on-continuous-axes\n // for the derivation of the following formula.\n const barWidth = Math.floor(\n (totalWidth * closestPairDiff * (1 - innerPadding)) / (range + closestPairDiff * (1 - innerPadding)),\n );\n return barWidth;\n};\n\n/**\n * Calculates the total width available for rendering bars.\n */\nexport const calcTotalWidth = (containerWidth: number, margins: IMargins, extraMargin = 0): number => {\n return containerWidth - (margins.left || 0) - (margins.right || 0) - extraMargin * 2;\n};\n\n/**\n * Calculates the combined size of all bands and the gaps between them, in units relative to the bandwidth.\n */\nexport const calcTotalBandUnits = (numBands: number, innerPadding: number): number => {\n // inner_padding = space_between_bands / (space_between_bands + bandwidth)\n // => space_between_bands = (inner_padding / (1 - inner_padding)) * bandwidth\n const gapToBandRatio = innerPadding / (1 - innerPadding);\n return numBands + (numBands - 1) * gapToBandRatio;\n};\n\n/**\n * Calculates the total width required to render all bands including the gaps between them.\n */\nexport const calcRequiredWidth = (bandwidth: number, numBands: number, innerPadding: number): number => {\n return bandwidth * calcTotalBandUnits(numBands, innerPadding);\n};\n\n/**\n * Calculates the maximum possible bandwidth such that the combined widths of all bands\n * and the gaps between them exactly fill the total available width.\n */\nexport const calcBandwidth = (totalWidth: number, numBands: number, innerPadding: number): number => {\n return totalWidth / calcTotalBandUnits(numBands, innerPadding);\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-charting",
3
- "version": "5.24.38",
3
+ "version": "5.25.0",
4
4
  "description": "React web charting controls for Microsoft fluentui system.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -36,9 +36,9 @@
36
36
  "jest-canvas-mock": "2.4.0"
37
37
  },
38
38
  "dependencies": {
39
- "@fluentui/chart-utilities": "^1.1.33",
40
- "@fluentui/react-focus": "^8.9.28",
41
- "@fluentui/theme-samples": "^8.7.217",
39
+ "@fluentui/chart-utilities": "^1.1.35",
40
+ "@fluentui/react-focus": "^8.10.0",
41
+ "@fluentui/theme-samples": "^8.7.219",
42
42
  "@microsoft/load-themed-styles": "^1.10.26",
43
43
  "@types/d3-array": "^3.0.0",
44
44
  "@types/d3-axis": "^3.0.0",
@@ -66,11 +66,11 @@
66
66
  "tslib": "^2.1.0"
67
67
  },
68
68
  "peerDependencies": {
69
- "@fluentui/react": "^8.124.1",
70
- "@types/react": ">=16.8.0 <19.0.0",
71
- "@types/react-dom": ">=16.8.0 <19.0.0",
72
- "react": ">=16.8.0 <19.0.0",
73
- "react-dom": ">=16.8.0 <19.0.0"
69
+ "@fluentui/react": "^8.125.0",
70
+ "@types/react": ">=16.8.0 <20.0.0",
71
+ "@types/react-dom": ">=16.8.0 <20.0.0",
72
+ "react": ">=16.8.0 <20.0.0",
73
+ "react-dom": ">=16.8.0 <20.0.0"
74
74
  },
75
75
  "exports": {
76
76
  ".": {
@@ -0,0 +1,58 @@
1
+ import { ITheme } from '@fluentui/react/lib/Styling';
2
+ import { IChartAnnotation, ChartAnnotationArrowHead } from '../../../types/IChartAnnotation';
3
+
4
+ export interface IAnnotationPoint {
5
+ x: number;
6
+ y: number;
7
+ }
8
+
9
+ export interface IAnnotationPlotRect {
10
+ x: number;
11
+ y: number;
12
+ width: number;
13
+ height: number;
14
+ }
15
+
16
+ export interface IChartAnnotationContext {
17
+ /** Rectangle describing the drawable area of the chart (without margins) */
18
+ plotRect: IAnnotationPlotRect;
19
+ /** Size of the owning SVG element */
20
+ svgRect: { width: number; height: number };
21
+ /** Indicates if layout should be mirrored */
22
+ isRtl?: boolean;
23
+ /** Primary x scale mapping data domain to pixels */
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ xScale?: (value: any) => number;
26
+ /** Primary y scale mapping data domain to pixels */
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
+ yScalePrimary?: (value: any) => number;
29
+ /** Secondary y scale when present */
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+ yScaleSecondary?: (value: any) => number;
32
+ }
33
+
34
+ export interface IChartAnnotationLayerProps {
35
+ annotations?: IChartAnnotation[];
36
+ context: IChartAnnotationContext;
37
+ theme: ITheme;
38
+ className?: string;
39
+ }
40
+
41
+ export interface IResolvedAnnotationPosition {
42
+ /** Final absolute position after applying layout and offsets */
43
+ point: IAnnotationPoint;
44
+ /** Raw anchor position before offsets (used for connectors) */
45
+ anchor: IAnnotationPoint;
46
+ }
47
+
48
+ export type ConnectorRenderData = {
49
+ key: string;
50
+ start: IAnnotationPoint;
51
+ end: IAnnotationPoint;
52
+ strokeColor: string;
53
+ strokeWidth: number;
54
+ dashArray?: string;
55
+ arrow: ChartAnnotationArrowHead;
56
+ markerSize: number;
57
+ markerStrokeWidth: number;
58
+ };
@@ -11,6 +11,7 @@ import {
11
11
  AxisScaleType,
12
12
  IAccessibilityProps,
13
13
  IChart,
14
+ IChartAnnotation,
14
15
  IDataPoint,
15
16
  IGanttChartDataPoint,
16
17
  IGroupedVerticalBarChartData,
@@ -26,6 +27,7 @@ import { IChartHoverCardProps } from '../../utilities/index';
26
27
  import { TimeLocaleDefinition } from 'd3-time-format';
27
28
  import { ChartTypes, IAxisData, IDomainNRange, IYAxisParams, XAxisTypes, YAxisType } from '../../utilities/utilities';
28
29
  import { ScaleBand, ScaleLinear } from 'd3-scale';
30
+ import type { JSXElement } from '@fluentui/utilities';
29
31
 
30
32
  /**
31
33
  * Cartesian Chart style properties
@@ -193,11 +195,21 @@ export interface ICartesianChartStyles {
193
195
  */
194
196
  chartWrapper?: IStyle;
195
197
 
198
+ /**
199
+ * Styles for the element wrapping the svg and overlays for annotation
200
+ */
201
+ plotContainer?: IStyle;
202
+
196
203
  /**
197
204
  * Styles for the svg tooltip
198
205
  */
199
206
  svgTooltip?: IStyle;
200
207
 
208
+ /**
209
+ * Styles applied to the annotation layer root element
210
+ */
211
+ annotationLayer?: IStyle;
212
+
201
213
  /**
202
214
  * Styles for the chart svg element
203
215
  */
@@ -335,6 +347,11 @@ export interface ICartesianChartProps {
335
347
  */
336
348
  xAxistickSize?: number;
337
349
 
350
+ /**
351
+ * Text annotations rendered on top of the chart area
352
+ */
353
+ annotations?: IChartAnnotation[];
354
+
338
355
  /**
339
356
  * defines the space between the tick line and the data label
340
357
  * @default 10
@@ -609,7 +626,7 @@ export interface IModifiedCartesianChartProps extends ICartesianChartProps {
609
626
  * Legends of the chart.
610
627
  */
611
628
  // eslint-disable-next-line @typescript-eslint/no-deprecated
612
- legendBars: JSX.Element | null;
629
+ legendBars: JSXElement | null;
613
630
 
614
631
  /**
615
632
  * Callout props
@@ -708,6 +725,11 @@ export interface IModifiedCartesianChartProps extends ICartesianChartProps {
708
725
  */
709
726
  svgFocusZoneProps?: IFocusZoneProps;
710
727
 
728
+ /**
729
+ * Annotations to render on top of the chart area.
730
+ */
731
+ annotations?: IChartAnnotation[];
732
+
711
733
  /**
712
734
  * The prop used to define the culture to localize the numbers and date
713
735
  */