@fluentui/react-charts 9.3.5 → 9.3.7

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 (337) hide show
  1. package/CHANGELOG.md +42 -2
  2. package/dist/index.d.ts +239 -55
  3. package/lib/AnnotationOnlyChart.js +1 -0
  4. package/lib/AnnotationOnlyChart.js.map +1 -0
  5. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +194 -0
  6. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
  7. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +1 -0
  8. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
  9. package/lib/components/AnnotationOnlyChart/index.js +2 -0
  10. package/lib/components/AnnotationOnlyChart/index.js.map +1 -0
  11. package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +31 -0
  12. package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +1 -0
  13. package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +23 -0
  14. package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -0
  15. package/lib/components/AreaChart/AreaChart.js +3 -16
  16. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  17. package/lib/components/AreaChart/useAreaChartStyles.styles.js +11 -6
  18. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  19. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -1
  20. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  21. package/lib/components/ChartTable/ChartTable.js +2 -10
  22. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  23. package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
  24. package/lib/components/ChartTable/useChartTableStyles.styles.js +59 -39
  25. package/lib/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  26. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +5 -5
  27. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  28. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +617 -0
  29. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
  30. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +1 -0
  31. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
  32. package/lib/components/CommonComponents/Annotations/index.js +2 -0
  33. package/lib/components/CommonComponents/Annotations/index.js.map +1 -0
  34. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +173 -0
  35. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -0
  36. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +126 -0
  37. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -0
  38. package/lib/components/CommonComponents/CartesianChart.js +159 -132
  39. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  40. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  41. package/lib/components/CommonComponents/ChartPopover.js +1 -2
  42. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  43. package/lib/components/CommonComponents/index.js +2 -0
  44. package/lib/components/CommonComponents/index.js.map +1 -1
  45. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +32 -14
  46. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  47. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +17 -2
  48. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  49. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +2 -6
  50. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  51. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +1 -2
  52. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  53. package/lib/components/DeclarativeChart/DeclarativeChart.js +83 -40
  54. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  55. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +4 -8
  56. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  57. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +692 -94
  58. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  59. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +23 -8
  60. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  61. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +2 -2
  62. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  63. package/lib/components/DonutChart/DonutChart.js +3 -12
  64. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  65. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  66. package/lib/components/DonutChart/Pie/Pie.js +4 -2
  67. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  68. package/lib/components/DonutChart/useDonutChartStyles.styles.js +2 -2
  69. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  70. package/lib/components/FunnelChart/FunnelChart.js +2 -10
  71. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  72. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
  73. package/lib/components/GanttChart/GanttChart.js +6 -19
  74. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  75. package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
  76. package/lib/components/GanttChart/useGanttChartStyles.styles.js +3 -1
  77. package/lib/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
  78. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js +3 -1
  79. package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
  80. package/lib/components/GaugeChart/GaugeChart.js +2 -10
  81. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  82. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  83. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +8 -20
  84. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  85. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +11 -6
  86. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  87. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +3 -1
  88. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  89. package/lib/components/HeatMapChart/HeatMapChart.js +4 -17
  90. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  91. package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  92. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +3 -1
  93. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  94. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +3 -1
  95. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  96. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +25 -12
  97. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  98. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +4 -4
  99. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  100. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +5 -23
  101. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  102. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  103. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +3 -1
  104. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  105. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +3 -1
  106. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  107. package/lib/components/Legends/Legends.types.js.map +1 -1
  108. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  109. package/lib/components/Legends/useLegendsStyles.styles.js +97 -37
  110. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
  111. package/lib/components/Legends/useLegendsStyles.styles.raw.js +10 -11
  112. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  113. package/lib/components/LineChart/LineChart.js +11 -20
  114. package/lib/components/LineChart/LineChart.js.map +1 -1
  115. package/lib/components/LineChart/LineChart.types.js +1 -1
  116. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  117. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +3 -4
  118. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  119. package/lib/components/LineChart/useLineChartStyles.styles.js +15 -10
  120. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  121. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +3 -1
  122. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  123. package/lib/components/SankeyChart/SankeyChart.js +3 -9
  124. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  125. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  126. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +13 -10
  127. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  128. package/lib/components/ScatterChart/ScatterChart.js +24 -24
  129. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  130. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  131. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +13 -8
  132. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  133. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +3 -1
  134. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  135. package/lib/components/Sparkline/Sparkline.js +11 -7
  136. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  137. package/lib/components/VerticalBarChart/VerticalBarChart.js +3 -15
  138. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  139. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +13 -8
  140. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  141. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +3 -1
  142. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  143. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +8 -18
  144. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  145. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  146. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +11 -6
  147. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  148. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +3 -1
  149. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  150. package/lib/index.js +1 -0
  151. package/lib/index.js.map +1 -1
  152. package/lib/types/ChartAnnotation.js +1 -0
  153. package/lib/types/ChartAnnotation.js.map +1 -0
  154. package/lib/types/DataPoint.js.map +1 -1
  155. package/lib/types/index.js +1 -0
  156. package/lib/types/index.js.map +1 -1
  157. package/lib/utilities/Common.styles.js +1 -2
  158. package/lib/utilities/Common.styles.js.map +1 -1
  159. package/lib/utilities/Common.styles.raw.js +1 -2
  160. package/lib/utilities/Common.styles.raw.js.map +1 -1
  161. package/lib/utilities/FocusableTooltipText.js +1 -1
  162. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  163. package/lib/utilities/getWindow.js +0 -1
  164. package/lib/utilities/getWindow.js.map +1 -1
  165. package/lib/utilities/hooks.js +34 -0
  166. package/lib/utilities/hooks.js.map +1 -0
  167. package/lib/utilities/image-export-utils.js +221 -73
  168. package/lib/utilities/image-export-utils.js.map +1 -1
  169. package/lib/utilities/utilities.js +39 -37
  170. package/lib/utilities/utilities.js.map +1 -1
  171. package/lib-commonjs/AnnotationOnlyChart.js +6 -0
  172. package/lib-commonjs/AnnotationOnlyChart.js.map +1 -0
  173. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +205 -0
  174. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -0
  175. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js +6 -0
  176. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -0
  177. package/lib-commonjs/components/AnnotationOnlyChart/index.js +7 -0
  178. package/lib-commonjs/components/AnnotationOnlyChart/index.js.map +1 -0
  179. package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js +56 -0
  180. package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.js.map +1 -0
  181. package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js +33 -0
  182. package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -0
  183. package/lib-commonjs/components/AreaChart/AreaChart.js +2 -15
  184. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  185. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +14 -15
  186. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  187. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -1
  188. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  189. package/lib-commonjs/components/ChartTable/ChartTable.js +3 -10
  190. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  191. package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
  192. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +74 -102
  193. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  194. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +4 -4
  195. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  196. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +628 -0
  197. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -0
  198. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js +4 -0
  199. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -0
  200. package/lib-commonjs/components/CommonComponents/Annotations/index.js +7 -0
  201. package/lib-commonjs/components/CommonComponents/Annotations/index.js.map +1 -0
  202. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +265 -0
  203. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -0
  204. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +161 -0
  205. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -0
  206. package/lib-commonjs/components/CommonComponents/CartesianChart.js +159 -131
  207. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  208. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  209. package/lib-commonjs/components/CommonComponents/ChartPopover.js +1 -2
  210. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  211. package/lib-commonjs/components/CommonComponents/index.js +2 -0
  212. package/lib-commonjs/components/CommonComponents/index.js.map +1 -1
  213. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +35 -22
  214. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  215. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +17 -2
  216. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  217. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +0 -14
  218. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  219. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -1
  220. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  221. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +82 -39
  222. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  223. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  224. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +678 -60
  225. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  226. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +25 -16
  227. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  228. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +1 -1
  229. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  230. package/lib-commonjs/components/DonutChart/DonutChart.js +2 -11
  231. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  232. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  233. package/lib-commonjs/components/DonutChart/Pie/Pie.js +4 -2
  234. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  235. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +2 -2
  236. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  237. package/lib-commonjs/components/FunnelChart/FunnelChart.js +2 -10
  238. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  239. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
  240. package/lib-commonjs/components/GanttChart/GanttChart.js +5 -18
  241. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  242. package/lib-commonjs/components/GanttChart/GanttChart.types.js.map +1 -1
  243. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js +3 -1
  244. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.js.map +1 -1
  245. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js +3 -1
  246. package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
  247. package/lib-commonjs/components/GaugeChart/GaugeChart.js +2 -10
  248. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  249. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  250. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +8 -20
  251. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  252. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +14 -15
  253. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  254. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +3 -1
  255. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  256. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +3 -16
  257. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  258. package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
  259. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +3 -1
  260. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  261. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +3 -1
  262. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  263. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +47 -34
  264. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  265. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +3 -3
  266. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  267. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +4 -21
  268. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  269. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
  270. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +3 -1
  271. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  272. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +3 -1
  273. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  274. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  275. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  276. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +144 -86
  277. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
  278. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +9 -10
  279. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  280. package/lib-commonjs/components/LineChart/LineChart.js +11 -20
  281. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  282. package/lib-commonjs/components/LineChart/LineChart.types.js +1 -1
  283. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  284. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +2 -2
  285. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  286. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +18 -19
  287. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  288. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +3 -1
  289. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  290. package/lib-commonjs/components/SankeyChart/SankeyChart.js +3 -9
  291. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  292. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  293. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +16 -19
  294. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  295. package/lib-commonjs/components/ScatterChart/ScatterChart.js +22 -22
  296. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  297. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  298. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +16 -17
  299. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  300. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +3 -1
  301. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  302. package/lib-commonjs/components/Sparkline/Sparkline.js +11 -7
  303. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  304. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +3 -15
  305. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  306. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +16 -17
  307. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  308. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +3 -1
  309. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  310. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +7 -17
  311. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  312. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
  313. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +14 -15
  314. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  315. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +3 -1
  316. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  317. package/lib-commonjs/index.js +1 -0
  318. package/lib-commonjs/index.js.map +1 -1
  319. package/lib-commonjs/types/ChartAnnotation.js +6 -0
  320. package/lib-commonjs/types/ChartAnnotation.js.map +1 -0
  321. package/lib-commonjs/types/DataPoint.js.map +1 -1
  322. package/lib-commonjs/types/index.js +1 -0
  323. package/lib-commonjs/types/index.js.map +1 -1
  324. package/lib-commonjs/utilities/Common.styles.js +1 -2
  325. package/lib-commonjs/utilities/Common.styles.js.map +1 -1
  326. package/lib-commonjs/utilities/Common.styles.raw.js +1 -2
  327. package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -1
  328. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  329. package/lib-commonjs/utilities/getWindow.js +0 -1
  330. package/lib-commonjs/utilities/getWindow.js.map +1 -1
  331. package/lib-commonjs/utilities/hooks.js +45 -0
  332. package/lib-commonjs/utilities/hooks.js.map +1 -0
  333. package/lib-commonjs/utilities/image-export-utils.js +222 -74
  334. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  335. package/lib-commonjs/utilities/utilities.js +37 -33
  336. package/lib-commonjs/utilities/utilities.js.map +1 -1
  337. package/package.json +11 -11
@@ -1,4 +1,4 @@
1
- /* eslint-disable @typescript-eslint/naming-convention */ /**
1
+ /**
2
2
  * {@docCategory LineChart}
3
3
  */ "use strict";
4
4
  Object.defineProperty(exports, "__esModule", {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/LineChart/LineChart.types.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { RenderFunction } from '../../utilities/index';\nimport {\n ChartProps,\n LineChartPoints,\n Margins,\n Basestate,\n RefArrayData,\n CustomizedCalloutData,\n} from '../../types/index';\nimport { EventAnnotation } from '../../types/EventAnnotation';\nimport {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n ChildProps,\n} from '../CommonComponents/index';\n\nexport type { ChildProps, LineChartPoints, Margins, Basestate, RefArrayData };\n\n/**\n * Line Chart properties\n * {@docCategory LineChart}\n */\nexport interface LineChartProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data: ChartProps;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: LineChartStyles;\n\n /**\n * Show event annotation\n */\n eventAnnotationProps?: EventsAnnotationProps;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: RenderFunction<CustomizedCalloutData>;\n\n /**\n * Define a custom callout renderer for a stack; default is to render per data point\n */\n onRenderCalloutPerStack?: RenderFunction<CustomizedCalloutData>;\n\n /**\n * Callback for getting callout description message\n */\n getCalloutDescriptionMessage?: (calloutDataProps: CustomizedCalloutData) => string | undefined;\n\n /*\n * Color fill bars for the chart,\n */\n colorFillBars?: ColorFillBarsProps[];\n\n /**\n * if this is set to true, then for each line there will be a unique shape assigned to the point,\n * there are total 8 shapes which are as follow circle, square, triangele, diamond, pyramid,\n * hexagon, pentagon and octagon, which will get assigned as respectively, if there are more\n * than 8 lines in the line chart then it will again start from cicle to octagon.\n * setting this flag to true will also change the behavior of the points, like for a\n * line, last point shape and first point shape will be visible all the times, and all\n * other points will get enlarge only when hovered over them\n * if set to false default shape will be circle, with the existing behavior\n * @default false\n */\n allowMultipleShapesForPoints?: boolean;\n\n /*\n * Optimize line chart rendering for large data set. If this prop is enabled, line chart\n * can easily render over 10K datapoints with multiple lines smoothly.\n * This rendering mechanism does not support gaps in lines.\n */\n optimizeLargeData?: boolean;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * @default false\n * The prop used to enable the perf optimization\n */\n enablePerfOptimization?: boolean;\n\n /**\n * To enable callout for individual line or complete stack.\n * @default true\n * @type \\{boolean \\}\n */\n isCalloutForStack?: boolean;\n}\n\n/**\n * {@docCategory LineChart}\n */\nexport interface EventsAnnotationProps {\n events: EventAnnotation[];\n strokeColor?: string;\n labelColor?: string;\n labelHeight?: number;\n labelWidth?: number;\n mergedLabel: (count: number) => string;\n}\n\n/**\n * Line Chart styles\n * {@docCategory LineChart}\n */\nexport interface LineChartStyles extends CartesianChartStyles {\n /**\n * styles for line border\n */\n lineBorder?: string;\n\n /**\n * styles for marker label\n */\n markerLabel?: string;\n}\n\n/**\n * Line Chart style properties\n * {@docCategory LineChart}\n */\nexport interface LineChartStyleProps extends CartesianChartStyleProps {}\n\n/**\n * {@docCategory LineChart}\n */\nexport interface ColorFillBarsProps {\n legend: string;\n color: string;\n data: ColorFillBarData[];\n applyPattern?: boolean;\n onLegendClick?: (selectedLegend: string | string[] | null) => void | undefined;\n}\n\n/**\n * {@docCategory LineChart}\n */\nexport interface ColorFillBarData {\n startX: number | Date;\n endX: number | Date;\n}\n"],"names":[],"mappings":"AAAA,uDAAuD,GAgJvD;;CAEC,GACD,WAGC"}
1
+ {"version":3,"sources":["../src/components/LineChart/LineChart.types.ts"],"sourcesContent":["import { RenderFunction } from '../../utilities/index';\nimport {\n ChartProps,\n LineChartPoints,\n Margins,\n Basestate,\n RefArrayData,\n CustomizedCalloutData,\n} from '../../types/index';\nimport { EventAnnotation } from '../../types/EventAnnotation';\nimport {\n CartesianChartProps,\n CartesianChartStyleProps,\n CartesianChartStyles,\n ChildProps,\n} from '../CommonComponents/index';\n\nexport type { ChildProps, LineChartPoints, Margins, Basestate, RefArrayData };\n\n/**\n * Line Chart properties\n * {@docCategory LineChart}\n */\nexport interface LineChartProps extends CartesianChartProps {\n /**\n * Data to render in the chart.\n */\n data: ChartProps;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: LineChartStyles;\n\n /**\n * Show event annotation\n */\n eventAnnotationProps?: EventsAnnotationProps;\n\n /**\n * Define a custom callout renderer for a data point\n */\n onRenderCalloutPerDataPoint?: RenderFunction<CustomizedCalloutData>;\n\n /**\n * Define a custom callout renderer for a stack; default is to render per data point\n */\n onRenderCalloutPerStack?: RenderFunction<CustomizedCalloutData>;\n\n /**\n * Callback for getting callout description message\n */\n getCalloutDescriptionMessage?: (calloutDataProps: CustomizedCalloutData) => string | undefined;\n\n /*\n * Color fill bars for the chart,\n */\n colorFillBars?: ColorFillBarsProps[];\n\n /**\n * if this is set to true, then for each line there will be a unique shape assigned to the point,\n * there are total 8 shapes which are as follow circle, square, triangele, diamond, pyramid,\n * hexagon, pentagon and octagon, which will get assigned as respectively, if there are more\n * than 8 lines in the line chart then it will again start from cicle to octagon.\n * setting this flag to true will also change the behavior of the points, like for a\n * line, last point shape and first point shape will be visible all the times, and all\n * other points will get enlarge only when hovered over them\n * if set to false default shape will be circle, with the existing behavior\n * @default false\n */\n allowMultipleShapesForPoints?: boolean;\n\n /*\n * Optimize line chart rendering for large data set. If this prop is enabled, line chart\n * can easily render over 10K datapoints with multiple lines smoothly.\n * This rendering mechanism does not support gaps in lines.\n */\n optimizeLargeData?: boolean;\n\n /**\n * The prop used to define the culture to localized the numbers\n */\n culture?: string;\n\n /**\n * @default false\n * The prop used to enable the perf optimization\n */\n enablePerfOptimization?: boolean;\n\n /**\n * To enable callout for individual line or complete stack.\n * @default true\n * @type \\{boolean \\}\n */\n isCalloutForStack?: boolean;\n}\n\n/**\n * {@docCategory LineChart}\n */\nexport interface EventsAnnotationProps {\n events: EventAnnotation[];\n strokeColor?: string;\n labelColor?: string;\n labelHeight?: number;\n labelWidth?: number;\n mergedLabel: (count: number) => string;\n}\n\n/**\n * Line Chart styles\n * {@docCategory LineChart}\n */\nexport interface LineChartStyles extends CartesianChartStyles {\n /**\n * styles for line border\n */\n lineBorder?: string;\n\n /**\n * styles for marker label\n */\n markerLabel?: string;\n}\n\n/**\n * Line Chart style properties\n * {@docCategory LineChart}\n */\nexport interface LineChartStyleProps extends CartesianChartStyleProps {}\n\n/**\n * {@docCategory LineChart}\n */\nexport interface ColorFillBarsProps {\n legend: string;\n color: string;\n data: ColorFillBarData[];\n applyPattern?: boolean;\n onLegendClick?: (selectedLegend: string | string[] | null) => void | undefined;\n}\n\n/**\n * {@docCategory LineChart}\n */\nexport interface ColorFillBarData {\n startX: number | Date;\n endX: number | Date;\n}\n"],"names":[],"mappings":"AA+IA;;CAEC,GACD,WAGC"}
@@ -67,7 +67,7 @@ function calculateLabels(lineDefs, textWidth, maxX, minX) {
67
67
  if (lastX < leftXBoundary) {
68
68
  return [
69
69
  {
70
- x: x,
70
+ x,
71
71
  anchor: 'end',
72
72
  aggregatedIdx: [
73
73
  currentIdx
@@ -77,7 +77,7 @@ function calculateLabels(lineDefs, textWidth, maxX, minX) {
77
77
  } else if (x + textWidth < maxX) {
78
78
  return [
79
79
  {
80
- x: x,
80
+ x,
81
81
  anchor: 'start',
82
82
  aggregatedIdx: [
83
83
  currentIdx
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/LineChart/eventAnnotation/EventAnnotation.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ScaleTime } from 'd3-scale';\nimport { tokens } from '@fluentui/react-theme';\nimport { findIndex } from '../../../utilities/index';\nimport { LineDef, LabelLink, LabelDef } from './LabelLink';\nimport { EventsAnnotationProps } from '../LineChart.types';\nimport { getColorFromToken } from '../../../utilities/colors';\n\ninterface IEventsAnnotationExtendProps extends EventsAnnotationProps {\n scale: ScaleTime<number, number>;\n chartYBottom: number;\n chartYTop: number;\n}\n\nexport const EventsAnnotation: React.FunctionComponent<IEventsAnnotationExtendProps> = props => {\n const textWidth = props.labelWidth ? props.labelWidth : 105;\n const textY = props.chartYTop - 20;\n const lineTopY = textY + 7;\n const textPadding = 5;\n const lineHeight = 18;\n const fontSize = '10pt';\n const axisRange = props.scale.range();\n\n const lineDefs: LineDef[] = props.events.map(e => ({ ...e, x: props.scale(e.date) }));\n\n lineDefs.sort((e1, e2) => +e1.date - +e2.date);\n\n const fill: string | undefined = props.strokeColor\n ? getColorFromToken(props.strokeColor, false /*ToDo fix */)\n : tokens.colorNeutralForeground1;\n\n const lines = uniqBy(lineDefs, x => x.date.toString()).map((x, i) => (\n <line key={i} x1={x.x} x2={x.x} y1={lineTopY} y2={props.chartYBottom} stroke={fill} strokeDasharray=\"8\" />\n ));\n\n const labelLinks = calculateLabels(lineDefs, textWidth + textPadding, axisRange[1], axisRange[0]).map((x, i) => (\n <LabelLink\n key={i}\n {...{\n lineDefs,\n labelDef: x,\n textY,\n textWidth,\n textLineHeight: lineHeight,\n textFontSize: fontSize,\n textColor: props.labelColor,\n mergedLabel: props.mergedLabel,\n }}\n />\n ));\n\n return (\n <>\n {lines}\n {labelLinks}\n </>\n );\n};\n\nfunction calculateLabels(lineDefs: LineDef[], textWidth: number, maxX: number, minX: number): LabelDef[] {\n const calculateLabel = (lastX: number, currentIdx: number): LabelDef[] => {\n // base case 1\n if (currentIdx === lineDefs.length) {\n return [];\n }\n\n const { x } = lineDefs[currentIdx];\n const leftXBoundary = x - textWidth;\n\n // cannot render on top of other text\n if (x < lastX) {\n return [];\n }\n\n // base case 2\n if (currentIdx === lineDefs.length - 1) {\n if (lastX < leftXBoundary) {\n return [{ x: x, anchor: 'end', aggregatedIdx: [currentIdx] }];\n } else if (x + textWidth < maxX) {\n return [{ x: x, anchor: 'start', aggregatedIdx: [currentIdx] }];\n }\n\n return [];\n }\n\n if (lastX < leftXBoundary) {\n // label on left side\n return backtrack(currentIdx, 'end');\n } else {\n // label on right side\n return backtrack(currentIdx, 'start');\n }\n };\n\n const backtrack = (currentIdx: number, anchor: 'start' | 'end'): LabelDef[] => {\n const bd = anchor === 'end' ? lineDefs[currentIdx].x : lineDefs[currentIdx].x + textWidth;\n\n let idx = findIndex(\n lineDefs,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ds => ds.x > bd && (ds.x - textWidth >= bd || ds.x + textWidth < maxX),\n currentIdx + 1,\n );\n if (idx === -1) {\n idx = lineDefs.length;\n }\n\n const aggregatedIdx: number[] = [];\n for (let i = currentIdx; i < idx; i++) {\n aggregatedIdx.push(i);\n }\n const next = calculateLabel(bd, idx);\n\n next.unshift({ x: lineDefs[currentIdx].x, anchor, aggregatedIdx });\n return next;\n };\n\n return calculateLabel(minX, 0);\n}\n\n/** Get unique items of `arr`, comparing based on the result of calling `iteratee` on each item. */\nfunction uniqBy<T>(arr: T[], iteratee: (x: T) => string): T[] {\n const seen: string[] = [];\n const result: T[] = [];\n for (const x of arr) {\n const comp = iteratee(x);\n if (seen.indexOf(comp) === -1) {\n result.push(x);\n seen.push(comp);\n }\n }\n return result;\n}\n"],"names":["React","tokens","findIndex","LabelLink","getColorFromToken","EventsAnnotation","props","textWidth","labelWidth","textY","chartYTop","lineTopY","textPadding","lineHeight","fontSize","axisRange","scale","range","lineDefs","events","map","e","x","date","sort","e1","e2","fill","strokeColor","colorNeutralForeground1","lines","uniqBy","toString","i","line","key","x1","x2","y1","y2","chartYBottom","stroke","strokeDasharray","labelLinks","calculateLabels","labelDef","textLineHeight","textFontSize","textColor","labelColor","mergedLabel","maxX","minX","calculateLabel","lastX","currentIdx","length","leftXBoundary","anchor","aggregatedIdx","backtrack","bd","idx","ds","push","next","unshift","arr","iteratee","seen","result","comp","indexOf"],"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A,KAAMA,GAAGzC,CAAC,GAAGuC,MAAOE,CAAAA,GAAGzC,CAAC,GAAGf,aAAasD,MAAME,GAAGzC,CAAC,GAAGf,SADS,GACG4C,IAAAA,CAAG,EACpEI,aAAa;QAEf,IAAIO,QAAQ,CAAC,GAAG;YACdA,MAAM5C,SAASsC,MAAM;QACvB;QAEA,MAAMG,gBAA0B,EAAE;QAClC,IAAK,IAAI1B,IAAIsB,YAAYtB,IAAI6B,KAAK7B,IAAK;YACrC0B,cAAcK,IAAI,CAAC/B;QACrB;QACA,MAAMgC,OAAOZ,eAAeQ,IAAIC;QAEhCG,KAAKC,OAAO,CAAC;YAAE5C,GAAGJ,QAAQ,CAACqC,WAAW,CAACjC,CAAC;YAAEoC;YAAQC;QAAc;QAChE,OAAOM;IACT;IAEA,OAAOZ,eAAeD,MAAM;AAC9B;AAEA,iGAAiG,GACjG,SAASrB,OAAUoC,GAAQ,EAAEC,QAA0B;IACrD,MAAMC,OAAiB,EAAE;IACzB,MAAMC,SAAc,EAAE;IACtB,KAAK,MAAMhD,KAAK6C,IAAK;QACnB,MAAMI,OAAOH,SAAS9C;QACtB,IAAI+C,KAAKG,OAAO,CAACD,UAAU,CAAC,GAAG;YAC7BD,OAAON,IAAI,CAAC1C;YACZ+C,KAAKL,IAAI,CAACO;QACZ;IACF;IACA,OAAOD;AACT"}
1
+ {"version":3,"sources":["../src/components/LineChart/eventAnnotation/EventAnnotation.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ScaleTime } from 'd3-scale';\nimport { tokens } from '@fluentui/react-theme';\nimport { findIndex } from '../../../utilities/index';\nimport { LineDef, LabelLink, LabelDef } from './LabelLink';\nimport { EventsAnnotationProps } from '../LineChart.types';\nimport { getColorFromToken } from '../../../utilities/colors';\n\ninterface IEventsAnnotationExtendProps extends EventsAnnotationProps {\n scale: ScaleTime<number, number>;\n chartYBottom: number;\n chartYTop: number;\n}\n\nexport const EventsAnnotation: React.FunctionComponent<IEventsAnnotationExtendProps> = props => {\n const textWidth = props.labelWidth ? props.labelWidth : 105;\n const textY = props.chartYTop - 20;\n const lineTopY = textY + 7;\n const textPadding = 5;\n const lineHeight = 18;\n const fontSize = '10pt';\n const axisRange = props.scale.range();\n\n const lineDefs: LineDef[] = props.events.map(e => ({ ...e, x: props.scale(e.date) }));\n\n lineDefs.sort((e1, e2) => +e1.date - +e2.date);\n\n const fill: string | undefined = props.strokeColor\n ? getColorFromToken(props.strokeColor, false /*ToDo fix */)\n : tokens.colorNeutralForeground1;\n\n const lines = uniqBy(lineDefs, x => x.date.toString()).map((x, i) => (\n <line key={i} x1={x.x} x2={x.x} y1={lineTopY} y2={props.chartYBottom} stroke={fill} strokeDasharray=\"8\" />\n ));\n\n const labelLinks = calculateLabels(lineDefs, textWidth + textPadding, axisRange[1], axisRange[0]).map((x, i) => (\n <LabelLink\n key={i}\n {...{\n lineDefs,\n labelDef: x,\n textY,\n textWidth,\n textLineHeight: lineHeight,\n textFontSize: fontSize,\n textColor: props.labelColor,\n mergedLabel: props.mergedLabel,\n }}\n />\n ));\n\n return (\n <>\n {lines}\n {labelLinks}\n </>\n );\n};\n\nfunction calculateLabels(lineDefs: LineDef[], textWidth: number, maxX: number, minX: number): LabelDef[] {\n const calculateLabel = (lastX: number, currentIdx: number): LabelDef[] => {\n // base case 1\n if (currentIdx === lineDefs.length) {\n return [];\n }\n\n const { x } = lineDefs[currentIdx];\n const leftXBoundary = x - textWidth;\n\n // cannot render on top of other text\n if (x < lastX) {\n return [];\n }\n\n // base case 2\n if (currentIdx === lineDefs.length - 1) {\n if (lastX < leftXBoundary) {\n return [{ x, anchor: 'end', aggregatedIdx: [currentIdx] }];\n } else if (x + textWidth < maxX) {\n return [{ x, anchor: 'start', aggregatedIdx: [currentIdx] }];\n }\n\n return [];\n }\n\n if (lastX < leftXBoundary) {\n // label on left side\n return backtrack(currentIdx, 'end');\n } else {\n // label on right side\n return backtrack(currentIdx, 'start');\n }\n };\n\n const backtrack = (currentIdx: number, anchor: 'start' | 'end'): LabelDef[] => {\n const bd = anchor === 'end' ? lineDefs[currentIdx].x : lineDefs[currentIdx].x + textWidth;\n\n let idx = findIndex(\n lineDefs,\n ds => ds.x > bd && (ds.x - textWidth >= bd || ds.x + textWidth < maxX),\n currentIdx + 1,\n );\n if (idx === -1) {\n idx = lineDefs.length;\n }\n\n const aggregatedIdx: number[] = [];\n for (let i = currentIdx; i < idx; i++) {\n aggregatedIdx.push(i);\n }\n const next = calculateLabel(bd, idx);\n\n next.unshift({ x: lineDefs[currentIdx].x, anchor, aggregatedIdx });\n return next;\n };\n\n return calculateLabel(minX, 0);\n}\n\n/** Get unique items of `arr`, comparing based on the result of calling `iteratee` on each item. */\nfunction uniqBy<T>(arr: T[], iteratee: (x: T) => string): T[] {\n const seen: string[] = [];\n const result: T[] = [];\n for (const x of arr) {\n const comp = iteratee(x);\n if (seen.indexOf(comp) === -1) {\n result.push(x);\n seen.push(comp);\n }\n }\n return result;\n}\n"],"names":["React","tokens","findIndex","LabelLink","getColorFromToken","EventsAnnotation","props","textWidth","labelWidth","textY","chartYTop","lineTopY","textPadding","lineHeight","fontSize","axisRange","scale","range","lineDefs","events","map","e","x","date","sort","e1","e2","fill","strokeColor","colorNeutralForeground1","lines","uniqBy","toString","i","line","key","x1","x2","y1","y2","chartYBottom","stroke","strokeDasharray","labelLinks","calculateLabels","labelDef","textLineHeight","textFontSize","textColor","labelColor","mergedLabel","maxX","minX","calculateLabel","lastX","currentIdx","length","leftXBoundary","anchor","aggregatedIdx","backtrack","bd","idx","ds","push","next","unshift","arr","iteratee","seen","result","comp","indexOf"],"mappings":";;;;+BAcaK;;;;;;;iEAdU,QAAQ;4BAER,wBAAwB;uBACrB,2BAA2B;2BACR,cAAc;wBAEzB,4BAA4B;AAQvD,yBAAgFC,CAAAA;IACrF,MAAMC,YAAYD,MAAME,UAAU,GAAGF,MAAME,UAAU,GAAG;IACxD,MAAMC,QAAQH,MAAMI,SAAS,GAAG;IAChC,MAAMC,WAAWF,QAAQ;IACzB,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AI6B,KAAK7B,IAAK;YACrC0B,cAAcK,IAAI,CAAC/B;QACrB;QACA,MAAMgC,OAAOZ,eAAeQ,IAAIC;QAEhCG,KAAKC,OAAO,CAAC;YAAE5C,GAAGJ,QAAQ,CAACqC,WAAW,CAACjC,CAAC;YAAEoC;YAAQC;QAAc;QAChE,OAAOM;IACT;IAEA,OAAOZ,eAAeD,MAAM;AAC9B;AAEA,iGAAiG,GACjG,SAASrB,OAAUoC,GAAQ,EAAEC,QAA0B;IACrD,MAAMC,OAAiB,EAAE;IACzB,MAAMC,SAAc,EAAE;IACtB,KAAK,MAAMhD,KAAK6C,IAAK;QACnB,MAAMI,OAAOH,SAAS9C;QACtB,IAAI+C,KAAKG,OAAO,CAACD,UAAU,CAAC,GAAG;YAC7BD,OAAON,IAAI,CAAC1C;YACZ+C,KAAKL,IAAI,CAACO;QACZ;IACF;IACA,OAAOD;AACT"}
@@ -35,7 +35,9 @@ const linechartClassNames = {
35
35
  chartWrapper: 'fui-line__chartWrapper',
36
36
  svgTooltip: '',
37
37
  chart: '',
38
- axisAnnotation: ''
38
+ axisAnnotation: '',
39
+ plotContainer: '',
40
+ annotationLayer: ''
39
41
  };
40
42
  /**
41
43
  * Base Styles
@@ -47,16 +49,11 @@ const linechartClassNames = {
47
49
  Bg96gwp: "f1i3iumi",
48
50
  mc9l5x: "f22iagw",
49
51
  Beiy3e4: "f1vx9l62",
50
- z8tnut: "f17mpqex",
51
- z189sj: [
52
- "f1vdfbxk",
53
- "f1f5gg8d"
54
- ],
55
- Byoj8tv: "fdvome7",
56
- uwmqm3: [
57
- "f1f5gg8d",
58
- "f1vdfbxk"
59
- ],
52
+ Byoj8tv: 0,
53
+ uwmqm3: 0,
54
+ z189sj: 0,
55
+ z8tnut: 0,
56
+ B0ocmuz: "f1bnz8pu",
60
57
  qhf8xq: "f1euv43f",
61
58
  fsow6f: "f17mccla",
62
59
  Bhzewxz: "fr6rvge",
@@ -76,11 +73,11 @@ const linechartClassNames = {
76
73
  Bg96gwp: "f1i3iumi",
77
74
  Bkfmm31: "fhuob2q",
78
75
  jzqdnp: "fdxigdc",
79
- a6j6cd: "folz2wl"
76
+ Bxms50k: "f1yn2ez9"
80
77
  },
81
78
  lineBorder: {
82
79
  ojy3ng: "f1yuyku4",
83
- Bpvj6i6: "fdvt8h6"
80
+ Bj7tp1g: "f1s33jy0"
84
81
  }
85
82
  }, {
86
83
  d: [
@@ -90,10 +87,12 @@ const linechartClassNames = {
90
87
  ".f1i3iumi{line-height:var(--lineHeightBase300);}",
91
88
  ".f22iagw{display:flex;}",
92
89
  ".f1vx9l62{flex-direction:column;}",
93
- ".f17mpqex{padding-top:var(--spacingHorizontalS);}",
94
- ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}",
95
- ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
96
- ".fdvome7{padding-bottom:var(--spacingHorizontalS);}",
90
+ [
91
+ ".f1bnz8pu{padding:var(--spacingHorizontalS);}",
92
+ {
93
+ p: -1
94
+ }
95
+ ],
97
96
  ".f1euv43f{position:absolute;}",
98
97
  ".f17mccla{text-align:center;}",
99
98
  ".fr6rvge{top:var(--spacingVerticalNone);}",
@@ -112,13 +111,13 @@ const linechartClassNames = {
112
111
  ],
113
112
  m: [
114
113
  [
115
- "@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.folz2wl{fill:CanvasText;}}",
114
+ "@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.f1yn2ez9{fill:CanvasText;}}",
116
115
  {
117
116
  m: "screen and (-ms-high-contrast: active), screen and (forced-colors: active)"
118
117
  }
119
118
  ],
120
119
  [
121
- "@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.fdvt8h6{stroke:Canvas;}}",
120
+ "@media screen and (-ms-high-contrast: active),screen and (forced-colors: active){.f1s33jy0{stroke:Canvas;}}",
122
121
  {
123
122
  m: "screen and (-ms-high-contrast: active), screen and (forced-colors: active)"
124
123
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["useLineChartStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\nimport { getMarkerLabelStyle, getTooltipStyle } from '../../utilities/index';\n/**\n * @internal\n */ export const linechartClassNames = {\n tooltip: 'fui-line__tooltip',\n lineBorder: 'fui-line_lineBorder',\n markerLabel: 'fui-line__markerLabel',\n root: 'fui-line__root',\n xAxis: 'fui-line__xAxis',\n yAxis: 'fui-line__yAxis',\n legendContainer: 'fui-line__legendContainer',\n hover: 'fui-line__hover',\n descriptionMessage: 'fui-line__descriptionMessage',\n axisTitle: 'fui-line__axisTitle',\n chartTitle: 'fui-line__chartTitle',\n opacityChangeOnHover: 'fui-line__opacityChangeOnHover',\n shapeStyles: 'fui-line__shapeStyles',\n chartWrapper: 'fui-line__chartWrapper',\n svgTooltip: '',\n chart: '',\n axisAnnotation: ''\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n tooltip: getTooltipStyle(),\n markerLabel: getMarkerLabelStyle(),\n lineBorder: {\n stroke: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n stroke: 'Canvas'\n }\n }\n});\n/**\n * Apply styling to the Carousel slots based on the state\n */ export const useLineChartStyles = (props)=>{\n const baseStyles = useStyles();\n return {\n tooltip: mergeClasses(linechartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/ ),\n lineBorder: mergeClasses(linechartClassNames.lineBorder, baseStyles.lineBorder /*props.styles?.lineBorder*/ ),\n markerLabel: mergeClasses(linechartClassNames.markerLabel, baseStyles.markerLabel /*props.styles?.markerLabel*/ )\n };\n};\n"],"names":["__styles","mergeClasses","tokens","HighContrastSelector","getMarkerLabelStyle","getTooltipStyle","linechartClassNames","tooltip","lineBorder","markerLabel","root","xAxis","yAxis","legendContainer","hover","descriptionMessage","axisTitle","chartTitle","opacityChangeOnHover","shapeStyles","chartWrapper","svgTooltip","chart","axisAnnotation","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","z8tnut","z189sj","Byoj8tv","uwmqm3","qhf8xq","fsow6f","Bhzewxz","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bkecrkj","sj55zd","Bkfmm31","jzqdnp","a6j6cd","ojy3ng","Bpvj6i6","d","p","m","useLineChartStyles","props","baseStyles"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAOKM,mBAAmB;;;sBAiCD;eAAlBgD;;;uBAvCwB,gBAAgB;AAM9C,4BAA4B;IACnC/C,OAAO,EAAE,mBAAmB;IAC5BC,UAAU,EAAE,qBAAqB;IACjCC,WAAW,EAAE,uBAAuB;IACpCC,IAAI,EAAE,gBAAgB;IACtBC,KAAK,EAAE,iBAAiB;IACxBC,KAAK,EAAE,iBAAiB;IACxBC,eAAe,EAAE,2BAA2B;IAC5CC,KAAK,EAAE,iBAAiB;IACxBC,kBAAkB,EAAE,8BAA8B;IAClDC,SAAS,EAAE,qBAAqB;IAChCC,UAAU,EAAE,sBAAsB;IAClCC,oBAAoB,EAAE,gCAAgC;IACtDC,WAAW,EAAE,uBAAuB;IACpCC,YAAY,EAAE,wBAAwB;IACtCC,UAAU,EAAE,EAAE;IACdC,KAAK,EAAE,EAAE;IACTC,cAAc,EAAE;AACpB,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGxB,eAAA,EAAA;IAAAO,OAAA,EAAA;QAAAkB,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,O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nimport { tokens } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\nimport { getMarkerLabelStyle, getTooltipStyle } from '../../utilities/index';\n/**\n * @internal\n */ export const linechartClassNames = {\n tooltip: 'fui-line__tooltip',\n lineBorder: 'fui-line_lineBorder',\n markerLabel: 'fui-line__markerLabel',\n root: 'fui-line__root',\n xAxis: 'fui-line__xAxis',\n yAxis: 'fui-line__yAxis',\n legendContainer: 'fui-line__legendContainer',\n hover: 'fui-line__hover',\n descriptionMessage: 'fui-line__descriptionMessage',\n axisTitle: 'fui-line__axisTitle',\n chartTitle: 'fui-line__chartTitle',\n opacityChangeOnHover: 'fui-line__opacityChangeOnHover',\n shapeStyles: 'fui-line__shapeStyles',\n chartWrapper: 'fui-line__chartWrapper',\n svgTooltip: '',\n chart: '',\n axisAnnotation: '',\n plotContainer: '',\n annotationLayer: ''\n};\n/**\n * Base Styles\n */ const useStyles = makeStyles({\n tooltip: getTooltipStyle(),\n markerLabel: getMarkerLabelStyle(),\n lineBorder: {\n stroke: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n stroke: 'Canvas'\n }\n }\n});\n/**\n * Apply styling to the Carousel slots based on the state\n */ export const useLineChartStyles = (props)=>{\n const baseStyles = useStyles();\n return {\n tooltip: mergeClasses(linechartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/ ),\n lineBorder: mergeClasses(linechartClassNames.lineBorder, baseStyles.lineBorder /*props.styles?.lineBorder*/ ),\n markerLabel: mergeClasses(linechartClassNames.markerLabel, baseStyles.markerLabel /*props.styles?.markerLabel*/ )\n };\n};\n"],"names":["__styles","mergeClasses","tokens","HighContrastSelector","getMarkerLabelStyle","getTooltipStyle","linechartClassNames","tooltip","lineBorder","markerLabel","root","xAxis","yAxis","legendContainer","hover","descriptionMessage","axisTitle","chartTitle","opacityChangeOnHover","shapeStyles","chartWrapper","svgTooltip","chart","axisAnnotation","plotContainer","annotationLayer","useStyles","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","mc9l5x","Beiy3e4","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","qhf8xq","fsow6f","Bhzewxz","De3pzq","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bkecrkj","sj55zd","Bkfmm31","jzqdnp","Bxms50k","ojy3ng","Bj7tp1g","d","p","m","useLineChartStyles","props","baseStyles"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAOKM,mBAAmB;;;IAmCnBmD,kBAAkB;;;;uBAzCM,gBAAgB;AAM9C,4BAA4B;IACnClD,OAAO,EAAE,mBAAmB;IAC5BC,UAAU,EAAE,qBAAqB;IACjCC,WAAW,EAAE,uBAAuB;IACpCC,IAAI,EAAE,gBAAgB;IACtBC,KAAK,EAAE,iBAAiB;IACxBC,KAAK,EAAE,iBAAiB;IACxBC,eAAe,EAAE,2BAA2B;IAC5CC,KAAK,EAAE,iBAAiB;IACxBC,kBAAkB,EAAE,8BAA8B;IAClDC,SAAS,EAAE,qBAAqB;IAChCC,UAAU,EAAE,sBAAsB;IAClCC,oBAAoB,EAAE,gCAAgC;IACtDC,WAAW,EAAE,uBAAuB;IACpCC,YAAY,EAAE,wBAAwB;IACtCC,UAAU,EAAE,EAAE;IACdC,KAAK,EAAE,EAAE;IACTC,cAAc,EAAE,EAAE;IAClBC,aAAa,EAAE,EAAE;IACjBC,eAAe,EAAE;AACrB,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAG1B,eAAA,EAAA;IAAAO,OAAA,EAAA;QAAAoB,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,M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
37
  chartWrapper: 'fui-line__chartWrapper',
38
38
  svgTooltip: '',
39
39
  chart: '',
40
- axisAnnotation: ''
40
+ axisAnnotation: '',
41
+ plotContainer: '',
42
+ annotationLayer: ''
41
43
  };
42
44
  /**
43
45
  * Base Styles
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/LineChart/useLineChartStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { GriffelStyle, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { LineChartProps, LineChartStyles } from './LineChart.types';\nimport { SlotClassNames } from '@fluentui/react-utilities/src/index';\nimport { HighContrastSelector } from '../../utilities/index';\nimport { getMarkerLabelStyle, getTooltipStyle } from '../../utilities/index';\n\n/**\n * @internal\n */\nexport const linechartClassNames: SlotClassNames<LineChartStyles> = {\n tooltip: 'fui-line__tooltip',\n lineBorder: 'fui-line_lineBorder',\n markerLabel: 'fui-line__markerLabel',\n root: 'fui-line__root',\n xAxis: 'fui-line__xAxis',\n yAxis: 'fui-line__yAxis',\n legendContainer: 'fui-line__legendContainer',\n hover: 'fui-line__hover',\n descriptionMessage: 'fui-line__descriptionMessage',\n axisTitle: 'fui-line__axisTitle',\n chartTitle: 'fui-line__chartTitle',\n opacityChangeOnHover: 'fui-line__opacityChangeOnHover',\n shapeStyles: 'fui-line__shapeStyles',\n chartWrapper: 'fui-line__chartWrapper',\n svgTooltip: '',\n chart: '',\n axisAnnotation: '',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n tooltip: getTooltipStyle() as GriffelStyle,\n markerLabel: getMarkerLabelStyle() as GriffelStyle,\n lineBorder: {\n stroke: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n stroke: 'Canvas',\n },\n },\n});\n\n/**\n * Apply styling to the Carousel slots based on the state\n */\nexport const useLineChartStyles = (props: LineChartProps): LineChartStyles => {\n const baseStyles = useStyles();\n return {\n tooltip: mergeClasses(linechartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/),\n lineBorder: mergeClasses(linechartClassNames.lineBorder, baseStyles.lineBorder /*props.styles?.lineBorder*/),\n markerLabel: mergeClasses(linechartClassNames.markerLabel, baseStyles.markerLabel /*props.styles?.markerLabel*/),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","HighContrastSelector","getMarkerLabelStyle","getTooltipStyle","linechartClassNames","tooltip","lineBorder","markerLabel","root","xAxis","yAxis","legendContainer","hover","descriptionMessage","axisTitle","chartTitle","opacityChangeOnHover","shapeStyles","chartWrapper","svgTooltip","chart","axisAnnotation","useStyles","stroke","colorNeutralBackground1","useLineChartStyles","props","baseStyles"],"mappings":"AAAA;;;;;;;;;;;;IAYaM,mBAAAA;;;IAqCAqB,kBAAAA;;;;uBA/C0C,iBAAiB;4BACjD,wBAAwB;uBAGV,wBAAwB;AAMtD,4BAA6D;IAClEpB,SAAS;IACTC,YAAY;IACZC,aAAa;IACbC,MAAM;IACNC,OAAO;IACPC,OAAO;IACPC,iBAAiB;IACjBC,OAAO;IACPC,oBAAoB;IACpBC,WAAW;IACXC,YAAY;IACZC,sBAAsB;IACtBC,aAAa;IACbC,cAAc;IACdC,YAAY;IACZC,OAAO;IACPC,gBAAgB;AAClB,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAYxB,iBAAAA,EAAW;IAC3BO,aAASF,sBAAAA;IACTI,iBAAaL,0BAAAA;IACbI,YAAY;QACViB,QAAQvB,kBAAAA,CAAOwB,uBAAuB;QACtC,CAACvB,2BAAAA,CAAqB,EAAE;YACtBsB,QAAQ;QACV;IACF;AACF;AAKO,2BAA2B,CAACG;IACjC,MAAMC,aAAaL;IACnB,OAAO;QACLjB,aAASN,mBAAAA,EAAaK,oBAAoBC,OAAO,EAAEsB,WAAWtB,OAAO,CAAC,uBAAuB;QAC7FC,gBAAYP,mBAAAA,EAAaK,oBAAoBE,UAAU,EAAEqB,WAAWrB,UAAU,CAAC,0BAA0B;QACzGC,iBAAaR,mBAAAA,EAAaK,oBAAoBG,WAAW,EAAEoB,WAAWpB,WAAW,CAAC,2BAA2B;IAC/G;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/LineChart/useLineChartStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { GriffelStyle, makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { LineChartProps, LineChartStyles } from './LineChart.types';\nimport { SlotClassNames } from '@fluentui/react-utilities/src/index';\nimport { HighContrastSelector } from '../../utilities/index';\nimport { getMarkerLabelStyle, getTooltipStyle } from '../../utilities/index';\n\n/**\n * @internal\n */\nexport const linechartClassNames: SlotClassNames<LineChartStyles> = {\n tooltip: 'fui-line__tooltip',\n lineBorder: 'fui-line_lineBorder',\n markerLabel: 'fui-line__markerLabel',\n root: 'fui-line__root',\n xAxis: 'fui-line__xAxis',\n yAxis: 'fui-line__yAxis',\n legendContainer: 'fui-line__legendContainer',\n hover: 'fui-line__hover',\n descriptionMessage: 'fui-line__descriptionMessage',\n axisTitle: 'fui-line__axisTitle',\n chartTitle: 'fui-line__chartTitle',\n opacityChangeOnHover: 'fui-line__opacityChangeOnHover',\n shapeStyles: 'fui-line__shapeStyles',\n chartWrapper: 'fui-line__chartWrapper',\n svgTooltip: '',\n chart: '',\n axisAnnotation: '',\n plotContainer: '',\n annotationLayer: '',\n};\n\n/**\n * Base Styles\n */\nconst useStyles = makeStyles({\n tooltip: getTooltipStyle() as GriffelStyle,\n markerLabel: getMarkerLabelStyle() as GriffelStyle,\n lineBorder: {\n stroke: tokens.colorNeutralBackground1,\n [HighContrastSelector]: {\n stroke: 'Canvas',\n },\n },\n});\n\n/**\n * Apply styling to the Carousel slots based on the state\n */\nexport const useLineChartStyles = (props: LineChartProps): LineChartStyles => {\n const baseStyles = useStyles();\n return {\n tooltip: mergeClasses(linechartClassNames.tooltip, baseStyles.tooltip /*props.styles?.tooltip*/),\n lineBorder: mergeClasses(linechartClassNames.lineBorder, baseStyles.lineBorder /*props.styles?.lineBorder*/),\n markerLabel: mergeClasses(linechartClassNames.markerLabel, baseStyles.markerLabel /*props.styles?.markerLabel*/),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","HighContrastSelector","getMarkerLabelStyle","getTooltipStyle","linechartClassNames","tooltip","lineBorder","markerLabel","root","xAxis","yAxis","legendContainer","hover","descriptionMessage","axisTitle","chartTitle","opacityChangeOnHover","shapeStyles","chartWrapper","svgTooltip","chart","axisAnnotation","plotContainer","annotationLayer","useStyles","stroke","colorNeutralBackground1","useLineChartStyles","props","baseStyles"],"mappings":"AAAA;;;;;;;;;;;;IAYaM,mBAAAA;;;IAuCAuB,kBAAAA;;;;uBAjD0C,iBAAiB;4BACjD,wBAAwB;uBAGV,wBAAwB;AAMtD,4BAA6D;IAClEtB,SAAS;IACTC,YAAY;IACZC,aAAa;IACbC,MAAM;IACNC,OAAO;IACPC,OAAO;IACPC,iBAAiB;IACjBC,OAAO;IACPC,oBAAoB;IACpBC,WAAW;IACXC,YAAY;IACZC,sBAAsB;IACtBC,aAAa;IACbC,cAAc;IACdC,YAAY;IACZC,OAAO;IACPC,gBAAgB;IAChBC,eAAe;IACfC,iBAAiB;AACnB,EAAE;AAEF;;CAEC,GACD,MAAMC,gBAAY1B,iBAAAA,EAAW;IAC3BO,aAASF,sBAAAA;IACTI,iBAAaL,0BAAAA;IACbI,YAAY;QACVmB,QAAQzB,kBAAAA,CAAO0B,uBAAuB;QACtC,CAACzB,2BAAAA,CAAqB,EAAE;YACtBwB,QAAQ;QACV;IACF;AACF;AAKO,2BAA2B,CAACG;IACjC,MAAMC,aAAaL;IACnB,OAAO;QACLnB,aAASN,mBAAAA,EAAaK,oBAAoBC,OAAO,EAAEwB,WAAWxB,OAAO,CAAC,uBAAuB;QAC7FC,gBAAYP,mBAAAA,EAAaK,oBAAoBE,UAAU,EAAEuB,WAAWvB,UAAU,CAAC,0BAA0B;QACzGC,iBAAaR,mBAAAA,EAAaK,oBAAoBG,WAAW,EAAEsB,WAAWtB,WAAW,CAAC,2BAA2B;IAC/G;AACF,EAAE"}
@@ -36,7 +36,7 @@ const _useSankeyChartStylesstyles = require("./useSankeyChartStyles.styles");
36
36
  const _index = require("../CommonComponents/index");
37
37
  const _reacttabster = require("@fluentui/react-tabster");
38
38
  const _string = require("../../utilities/string");
39
- const _imageexportutils = require("../../utilities/image-export-utils");
39
+ const _hooks = require("../../utilities/hooks");
40
40
  const PADDING_PERCENTAGE = 0.3;
41
41
  const NON_SELECTED_NODE_AND_STREAM_COLOR = '#757575';
42
42
  const DEFAULT_NODE_COLORS = [
@@ -446,7 +446,7 @@ function nodeTextColor(state, singleNode) {
446
446
  const SankeyChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
447
447
  var _props_reflowProps;
448
448
  const classes = (0, _useSankeyChartStylesstyles.useSankeyChartStyles)(props);
449
- const chartContainer = _react.useRef(null);
449
+ const { chartContainerRef: chartContainer } = (0, _hooks.useImageExport)(props.componentRef, true, false);
450
450
  const _reqID = _react.useRef(undefined);
451
451
  const _linkId = (0, _reactutilities.useId)('link');
452
452
  const _chartId = (0, _reactutilities.useId)('sankeyChart');
@@ -483,12 +483,6 @@ const SankeyChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
483
483
  x: 0,
484
484
  y: 0
485
485
  });
486
- _react.useImperativeHandle(props.componentRef, ()=>({
487
- chartContainer: chartContainer.current,
488
- toImage: (opts)=>{
489
- return (0, _imageexportutils.toImage)(chartContainer.current, undefined, _isRtl, opts);
490
- }
491
- }), []);
492
486
  const _fitParentContainer = _react.useCallback(()=>{
493
487
  _reqID.current = _window === null || _window === void 0 ? void 0 : _window.requestAnimationFrame(()=>{
494
488
  // NOTE: Calls to this method trigger a re-render.
@@ -817,7 +811,7 @@ const SankeyChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
817
811
  };
818
812
  const _fillStreamColors = (singleLink, gradientUrl)=>{
819
813
  if (selectedState && selectedLinks.has(singleLink.index)) {
820
- return selectedNode ? selectedNode.color : gradientUrl;
814
+ return singleLink ? singleLink.color : selectedNode ? selectedNode.color : gradientUrl;
821
815
  }
822
816
  };
823
817
  const _fillStreamBorder = (singleLink, gradientUrl)=>{