@fluentui/react-charts 9.2.3 → 9.3.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 (347) hide show
  1. package/CHANGELOG.md +79 -10
  2. package/dist/index.d.ts +98 -5
  3. package/lib/components/AreaChart/AreaChart.js +8 -6
  4. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  5. package/lib/components/AreaChart/useAreaChartStyles.styles.js +4 -2
  6. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  7. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js +4 -15
  8. package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  9. package/lib/components/ChartTable/ChartTable.js +95 -8
  10. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  11. package/lib/components/ChartTable/useChartTableStyles.styles.js +5 -3
  12. package/lib/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  13. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js +3 -2
  14. package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  15. package/lib/components/CommonComponents/CartesianChart.js +45 -42
  16. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  17. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  18. package/lib/components/CommonComponents/ChartPopover.js +14 -5
  19. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  20. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +19 -14
  21. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  22. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +7 -33
  23. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  24. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js +5 -3
  25. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  26. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +3 -2
  27. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  28. package/lib/components/DeclarativeChart/DeclarativeChart.js +56 -16
  29. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  30. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +19 -0
  31. package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  32. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +1096 -337
  33. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  34. package/lib/components/DeclarativeChart/imageExporter.js +1 -0
  35. package/lib/components/DeclarativeChart/imageExporter.js.map +1 -1
  36. package/lib/components/DonutChart/Arc/Arc.js +8 -8
  37. package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
  38. package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
  39. package/lib/components/DonutChart/Arc/useArcStyles.styles.js +9 -2
  40. package/lib/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  41. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js +6 -1
  42. package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  43. package/lib/components/DonutChart/DonutChart.js +61 -25
  44. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  45. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  46. package/lib/components/DonutChart/Pie/Pie.js +1 -0
  47. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  48. package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
  49. package/lib/components/DonutChart/Pie/usePieStyles.styles.js +2 -0
  50. package/lib/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
  51. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js +1 -0
  52. package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -1
  53. package/lib/components/DonutChart/useDonutChartStyles.styles.js +23 -4
  54. package/lib/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  55. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js +9 -4
  56. package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  57. package/lib/components/FunnelChart/FunnelChart.js +11 -5
  58. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  59. package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
  60. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js +2 -0
  61. package/lib/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  62. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js +1 -0
  63. package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  64. package/lib/components/GanttChart/GanttChart.js +1 -0
  65. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  66. package/lib/components/GaugeChart/GaugeChart.js +2 -2
  67. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  68. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js +2 -0
  69. package/lib/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  70. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js +1 -0
  71. package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  72. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +15 -9
  73. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  74. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +6 -17
  75. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  76. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +5 -21
  77. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  78. package/lib/components/HeatMapChart/HeatMapChart.js +2 -1
  79. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  80. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js +2 -0
  81. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  82. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +1 -0
  83. package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  84. package/lib/components/HorizontalBarChart/HorizontalBarChart.js +3 -3
  85. package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  86. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +8 -2
  87. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  88. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +5 -1
  89. package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  90. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +2 -2
  91. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  92. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +2 -0
  93. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  94. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +1 -0
  95. package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  96. package/lib/components/Legends/Legends.js +1 -0
  97. package/lib/components/Legends/Legends.js.map +1 -1
  98. package/lib/components/Legends/OverflowMenu.js +1 -0
  99. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  100. package/lib/components/Legends/shape.js +1 -0
  101. package/lib/components/Legends/shape.js.map +1 -1
  102. package/lib/components/Legends/useLegendsStyles.styles.js +2 -0
  103. package/lib/components/Legends/useLegendsStyles.styles.js.map +1 -1
  104. package/lib/components/Legends/useLegendsStyles.styles.raw.js +1 -0
  105. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  106. package/lib/components/LineChart/LineChart.js +284 -281
  107. package/lib/components/LineChart/LineChart.js.map +1 -1
  108. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  109. package/lib/components/LineChart/eventAnnotation/LabelLink.js +1 -0
  110. package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  111. package/lib/components/LineChart/eventAnnotation/Textbox.js +1 -0
  112. package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  113. package/lib/components/LineChart/useLineChartStyles.styles.js +25 -10
  114. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  115. package/lib/components/LineChart/useLineChartStyles.styles.raw.js +5 -21
  116. package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  117. package/lib/components/ResponsiveContainer/ResponsiveContainer.js +1 -0
  118. package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  119. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +2 -0
  120. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -1
  121. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +1 -0
  122. package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -1
  123. package/lib/components/ResponsiveContainer/withResponsiveContainer.js +1 -0
  124. package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  125. package/lib/components/SankeyChart/SankeyChart.js +1 -0
  126. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  127. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +14 -25
  128. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  129. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js +3 -12
  130. package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  131. package/lib/components/ScatterChart/ScatterChart.js +121 -81
  132. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  133. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  134. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +13 -7
  135. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  136. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js +5 -22
  137. package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  138. package/lib/components/Sparkline/Sparkline.js +1 -0
  139. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  140. package/lib/components/Sparkline/useSparklineStyles.styles.js +2 -0
  141. package/lib/components/Sparkline/useSparklineStyles.styles.js.map +1 -1
  142. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js +1 -0
  143. package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -1
  144. package/lib/components/VerticalBarChart/VerticalBarChart.js +17 -12
  145. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  146. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +10 -6
  147. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  148. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +6 -19
  149. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  150. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +30 -25
  151. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  152. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +9 -6
  153. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  154. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +5 -19
  155. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  156. package/lib/types/DataPoint.js +3 -1
  157. package/lib/types/DataPoint.js.map +1 -1
  158. package/lib/utilities/Common.styles.js +47 -0
  159. package/lib/utilities/Common.styles.js.map +1 -0
  160. package/lib/utilities/Common.styles.raw.js +47 -0
  161. package/lib/utilities/Common.styles.raw.js.map +1 -0
  162. package/lib/utilities/FocusableTooltipText.js +1 -0
  163. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  164. package/lib/utilities/SVGTooltipText.js +1 -0
  165. package/lib/utilities/SVGTooltipText.js.map +1 -1
  166. package/lib/utilities/image-export-utils.js +1 -0
  167. package/lib/utilities/image-export-utils.js.map +1 -1
  168. package/lib/utilities/index.js +1 -0
  169. package/lib/utilities/index.js.map +1 -1
  170. package/lib/utilities/scatterpolar-utils.js +52 -0
  171. package/lib/utilities/scatterpolar-utils.js.map +1 -0
  172. package/lib/utilities/utilities.js +314 -146
  173. package/lib/utilities/utilities.js.map +1 -1
  174. package/lib/utilities/vbc-utils.js.map +1 -1
  175. package/lib-commonjs/components/AreaChart/AreaChart.js +7 -5
  176. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  177. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +1 -0
  178. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  179. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js +3 -14
  180. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
  181. package/lib-commonjs/components/ChartTable/ChartTable.js +95 -8
  182. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  183. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js +4 -3
  184. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.js.map +1 -1
  185. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js +3 -2
  186. package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
  187. package/lib-commonjs/components/CommonComponents/CartesianChart.js +45 -42
  188. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  189. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  190. package/lib-commonjs/components/CommonComponents/ChartPopover.js +14 -5
  191. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  192. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +16 -13
  193. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  194. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +5 -32
  195. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  196. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js +4 -3
  197. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  198. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +3 -2
  199. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  200. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +60 -20
  201. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  202. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js +22 -0
  203. package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
  204. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +1109 -338
  205. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  206. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +1 -0
  207. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +1 -1
  208. package/lib-commonjs/components/DonutChart/Arc/Arc.js +8 -8
  209. package/lib-commonjs/components/DonutChart/Arc/Arc.js.map +1 -1
  210. package/lib-commonjs/components/DonutChart/Arc/Arc.types.js.map +1 -1
  211. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js +11 -1
  212. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.js.map +1 -1
  213. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js +6 -1
  214. package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
  215. package/lib-commonjs/components/DonutChart/DonutChart.js +61 -25
  216. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  217. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  218. package/lib-commonjs/components/DonutChart/Pie/Pie.js +2 -1
  219. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  220. package/lib-commonjs/components/DonutChart/Pie/Pie.types.js.map +1 -1
  221. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js +1 -0
  222. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.js.map +1 -1
  223. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js +1 -0
  224. package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -1
  225. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js +33 -4
  226. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.js.map +1 -1
  227. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js +9 -4
  228. package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
  229. package/lib-commonjs/components/FunnelChart/FunnelChart.js +11 -5
  230. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  231. package/lib-commonjs/components/FunnelChart/funnelGeometry.js.map +1 -1
  232. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js +1 -0
  233. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.js.map +1 -1
  234. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js +1 -0
  235. package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
  236. package/lib-commonjs/components/GanttChart/GanttChart.js +1 -0
  237. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  238. package/lib-commonjs/components/GaugeChart/GaugeChart.js +2 -2
  239. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  240. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js +1 -0
  241. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.js.map +1 -1
  242. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js +1 -0
  243. package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
  244. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +15 -9
  245. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  246. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +3 -19
  247. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  248. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js +4 -20
  249. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
  250. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +2 -1
  251. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  252. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js +1 -0
  253. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.js.map +1 -1
  254. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js +1 -0
  255. package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
  256. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js +3 -3
  257. package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
  258. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js +10 -2
  259. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.js.map +1 -1
  260. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js +5 -1
  261. package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
  262. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +2 -2
  263. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  264. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js +1 -0
  265. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.js.map +1 -1
  266. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js +1 -0
  267. package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
  268. package/lib-commonjs/components/Legends/Legends.js +1 -0
  269. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  270. package/lib-commonjs/components/Legends/OverflowMenu.js +1 -0
  271. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  272. package/lib-commonjs/components/Legends/shape.js +1 -0
  273. package/lib-commonjs/components/Legends/shape.js.map +1 -1
  274. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js +1 -0
  275. package/lib-commonjs/components/Legends/useLegendsStyles.styles.js.map +1 -1
  276. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js +1 -0
  277. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  278. package/lib-commonjs/components/LineChart/LineChart.js +282 -279
  279. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  280. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  281. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js +1 -0
  282. package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
  283. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js +1 -0
  284. package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
  285. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +31 -9
  286. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  287. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js +3 -20
  288. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
  289. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js +1 -0
  290. package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
  291. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js +1 -0
  292. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.js.map +1 -1
  293. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js +1 -0
  294. package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -1
  295. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js +2 -1
  296. package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
  297. package/lib-commonjs/components/SankeyChart/SankeyChart.js +1 -0
  298. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  299. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +24 -33
  300. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  301. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js +2 -12
  302. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
  303. package/lib-commonjs/components/ScatterChart/ScatterChart.js +118 -78
  304. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  305. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  306. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +14 -7
  307. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  308. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js +3 -20
  309. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
  310. package/lib-commonjs/components/Sparkline/Sparkline.js +1 -0
  311. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  312. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js +1 -0
  313. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.js.map +1 -1
  314. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js +1 -0
  315. package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -1
  316. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +16 -11
  317. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  318. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +6 -3
  319. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  320. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js +4 -17
  321. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
  322. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +29 -24
  323. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  324. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +6 -3
  325. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  326. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js +4 -18
  327. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
  328. package/lib-commonjs/types/DataPoint.js +3 -1
  329. package/lib-commonjs/types/DataPoint.js.map +1 -1
  330. package/lib-commonjs/utilities/Common.styles.js +71 -0
  331. package/lib-commonjs/utilities/Common.styles.js.map +1 -0
  332. package/lib-commonjs/utilities/Common.styles.raw.js +71 -0
  333. package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -0
  334. package/lib-commonjs/utilities/FocusableTooltipText.js +2 -1
  335. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  336. package/lib-commonjs/utilities/SVGTooltipText.js +1 -0
  337. package/lib-commonjs/utilities/SVGTooltipText.js.map +1 -1
  338. package/lib-commonjs/utilities/image-export-utils.js +1 -0
  339. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  340. package/lib-commonjs/utilities/index.js +1 -0
  341. package/lib-commonjs/utilities/index.js.map +1 -1
  342. package/lib-commonjs/utilities/scatterpolar-utils.js +67 -0
  343. package/lib-commonjs/utilities/scatterpolar-utils.js.map +1 -0
  344. package/lib-commonjs/utilities/utilities.js +327 -137
  345. package/lib-commonjs/utilities/utilities.js.map +1 -1
  346. package/lib-commonjs/utilities/vbc-utils.js.map +1 -1
  347. package/package.json +10 -10
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
@@ -13,7 +14,38 @@ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
14
  const _useChartTableStylesstyles = require("./useChartTableStyles.styles");
14
15
  const _utilities = require("../../utilities/utilities");
15
16
  const _imageexportutils = require("../../utilities/image-export-utils");
17
+ const _reacttheme = require("@fluentui/react-theme");
18
+ const _d3color = /*#__PURE__*/ _interop_require_wildcard._(require("d3-color"));
19
+ const _colors = require("../../utilities/colors");
20
+ const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
21
+ const _tokens = require("@fluentui/tokens");
22
+ function invertHexColor(hex) {
23
+ const color = _d3color.color(hex);
24
+ if (!color) {
25
+ return _reacttheme.tokens.colorNeutralForeground1;
26
+ }
27
+ const rgb = color.rgb();
28
+ return _d3color.rgb(255 - rgb.r, 255 - rgb.g, 255 - rgb.b).formatHex();
29
+ }
30
+ function getSafeBackgroundColor(v9Theme, foreground, background) {
31
+ const fallbackFg = v9Theme.colorNeutralForeground1;
32
+ const fallbackBg = v9Theme.colorNeutralBackground1;
33
+ const fg = _d3color.color(foreground || fallbackFg);
34
+ const bg = _d3color.color(background || fallbackBg);
35
+ if (!fg || !bg) {
36
+ return fallbackBg;
37
+ }
38
+ const contrast = (0, _colors.getColorContrast)(fg.formatHex(), bg.formatHex());
39
+ if (contrast >= 3) {
40
+ return bg.formatHex();
41
+ }
42
+ const invertedBg = invertHexColor(bg.formatHex());
43
+ const invertedContrast = (0, _colors.getColorContrast)(fg.formatHex(), invertedBg);
44
+ return invertedContrast >= 3 ? invertedBg : fallbackBg;
45
+ }
16
46
  const ChartTable = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
47
+ const parentV9Theme = _react.useContext(_reactsharedcontexts.ThemeContext_unstable);
48
+ const v9Theme = parentV9Theme ? parentV9Theme : _tokens.webLightTheme;
17
49
  const { headers, rows, width, height } = props;
18
50
  const _isRTL = (0, _utilities.useRtl)();
19
51
  const _rootElem = _react.useRef(null);
@@ -27,6 +59,38 @@ const ChartTable = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
27
59
  if (!headers || headers.length === 0) {
28
60
  return /*#__PURE__*/ _react.createElement("div", null, "No data available");
29
61
  }
62
+ const bgColorSet = new Set();
63
+ headers.forEach((header)=>{
64
+ var _header_style, _d3_color;
65
+ const bg = header === null || header === void 0 ? void 0 : (_header_style = header.style) === null || _header_style === void 0 ? void 0 : _header_style.backgroundColor;
66
+ const normalized = (_d3_color = _d3color.color(bg || '')) === null || _d3_color === void 0 ? void 0 : _d3_color.formatHex();
67
+ if (normalized) {
68
+ bgColorSet.add(normalized);
69
+ }
70
+ });
71
+ let sharedBackgroundColor;
72
+ let useSharedBackground = false;
73
+ /*
74
+ If we have only one or two unique background colors, we can consider using a shared background color
75
+ for the table headers. This is to ensure better contrast with the foreground text.
76
+ For size 1, we will consider that as default color if it satisfies the contrast ratio.
77
+ There could also be a scenario where backgroundcolor array is of size 2, for eg: ["dimsgray", "gray"],
78
+ which will assign 1st column header bg color to dimsgray and rest to gray. so our logic of shared background
79
+ color won't run here. So will consider for size 2 as well.
80
+ For size greater than this, we will consider that user wants different colors and will let color contrast fail
81
+ if any.
82
+ */ if (bgColorSet.size === 1 || bgColorSet.size === 2) {
83
+ const candidateBg = bgColorSet.size === 1 ? Array.from(bgColorSet)[0] : Array.from(bgColorSet)[1];
84
+ for (const header of headers){
85
+ var _header_style;
86
+ const fg = header === null || header === void 0 ? void 0 : (_header_style = header.style) === null || _header_style === void 0 ? void 0 : _header_style.color;
87
+ if (fg && (0, _colors.getColorContrast)(fg, candidateBg) >= 3) {
88
+ sharedBackgroundColor = candidateBg;
89
+ useSharedBackground = true;
90
+ break;
91
+ }
92
+ }
93
+ }
30
94
  return /*#__PURE__*/ _react.createElement("div", {
31
95
  ref: (el)=>_rootElem.current = el,
32
96
  className: classes.root,
@@ -51,19 +115,42 @@ const ChartTable = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
51
115
  }, /*#__PURE__*/ _react.createElement("table", {
52
116
  className: classes.table,
53
117
  style: {
54
- width: width ? `${width}px` : '100%',
55
- height: height ? `${height}px` : '650px'
118
+ width: width ? `${width}px` : '100%'
56
119
  }
57
- }, /*#__PURE__*/ _react.createElement("thead", null, /*#__PURE__*/ _react.createElement("tr", null, headers.map((header, idx)=>/*#__PURE__*/ _react.createElement("th", {
120
+ }, /*#__PURE__*/ _react.createElement("thead", null, /*#__PURE__*/ _react.createElement("tr", null, headers.map((header, idx)=>{
121
+ const style = {
122
+ ...header === null || header === void 0 ? void 0 : header.style
123
+ };
124
+ const fg = style.color;
125
+ const bg = style.backgroundColor;
126
+ if (useSharedBackground) {
127
+ style.backgroundColor = sharedBackgroundColor;
128
+ } else if (fg || bg) {
129
+ style.backgroundColor = getSafeBackgroundColor(v9Theme, fg, bg);
130
+ }
131
+ return /*#__PURE__*/ _react.createElement("th", {
58
132
  key: idx,
59
133
  className: classes.headerCell,
60
- style: header === null || header === void 0 ? void 0 : header.style
61
- }, header.value)))), rows && rows.length > 0 && /*#__PURE__*/ _react.createElement("tbody", null, rows.map((row, rowIdx)=>/*#__PURE__*/ _react.createElement("tr", {
134
+ style: style,
135
+ tabIndex: 0
136
+ }, header.value);
137
+ }))), rows && rows.length > 0 && /*#__PURE__*/ _react.createElement("tbody", null, rows.map((row, rowIdx)=>/*#__PURE__*/ _react.createElement("tr", {
62
138
  key: rowIdx
63
- }, row.map((cell, colIdx)=>/*#__PURE__*/ _react.createElement("td", {
139
+ }, row.map((cell, colIdx)=>{
140
+ const style = {
141
+ ...cell === null || cell === void 0 ? void 0 : cell.style
142
+ };
143
+ const fg = style.color;
144
+ const bg = style.backgroundColor;
145
+ if (fg || bg) {
146
+ style.backgroundColor = getSafeBackgroundColor(v9Theme, fg, bg);
147
+ }
148
+ return /*#__PURE__*/ _react.createElement("td", {
64
149
  key: colIdx,
65
150
  className: classes.bodyCell,
66
- style: cell === null || cell === void 0 ? void 0 : cell.style
67
- }, cell.value))))))))));
151
+ style: style,
152
+ tabIndex: 0
153
+ }, cell.value);
154
+ })))))))));
68
155
  });
69
156
  ChartTable.displayName = 'ChartTable';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ChartTable/ChartTable.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChartTableProps } from './ChartTable.types';\nimport { useChartTableStyles } from './useChartTableStyles.styles';\nimport { useRtl } from '../../utilities/utilities';\nimport { ImageExportOptions } from '../../types/index';\nimport { toImage } from '../../utilities/image-export-utils';\n\nexport const ChartTable: React.FunctionComponent<ChartTableProps> = React.forwardRef<HTMLDivElement, ChartTableProps>(\n (props, forwardedRef) => {\n const { headers, rows, width, height } = props;\n const _isRTL: boolean = useRtl();\n const _rootElem = React.useRef<HTMLDivElement | null>(null);\n const classes = useChartTableStyles(props);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _rootElem.current,\n toImage: (opts?: ImageExportOptions): Promise<string> => {\n return toImage(_rootElem.current, undefined, _isRTL, opts);\n },\n }),\n [],\n );\n\n if (!headers || headers.length === 0) {\n return <div>No data available</div>;\n }\n\n return (\n <div\n ref={el => (_rootElem.current = el)}\n className={classes.root as string}\n style={{ height: height ? `${height}px` : '650px', overflow: 'hidden' }}\n >\n <svg width={width ?? '100%'} height={height ?? '650px'}>\n <foreignObject x=\"0\" y=\"0\" width=\"100%\" height=\"100%\">\n <div\n style={{\n maxHeight: height ? `${height}px` : '650px',\n overflowY: 'auto',\n overflowX: 'auto',\n }}\n >\n <table\n className={classes.table}\n style={{\n width: width ? `${width}px` : '100%',\n height: height ? `${height}px` : '650px',\n }}\n >\n <thead>\n <tr>\n {headers.map((header, idx) => (\n <th key={idx} className={classes.headerCell} style={header?.style}>\n {header.value}\n </th>\n ))}\n </tr>\n </thead>\n {rows && rows.length > 0 && (\n <tbody>\n {rows.map((row, rowIdx) => (\n <tr key={rowIdx}>\n {row.map((cell, colIdx) => (\n <td key={colIdx} className={classes.bodyCell} style={cell?.style}>\n {cell.value}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n )}\n </table>\n </div>\n </foreignObject>\n </svg>\n </div>\n );\n },\n);\n\nChartTable.displayName = 'ChartTable';\n"],"names":["React","useChartTableStyles","useRtl","toImage","ChartTable","forwardRef","props","forwardedRef","headers","rows","width","height","_isRTL","_rootElem","useRef","classes","useImperativeHandle","componentRef","chartContainer","current","opts","undefined","length","div","ref","el","className","root","style","overflow","svg","foreignObject","x","y","maxHeight","overflowY","overflowX","table","thead","tr","map","header","idx","th","key","headerCell","value","tbody","row","rowIdx","cell","colIdx","td","bodyCell","displayName"],"mappings":";;;;+BAOaI;;;;;;;iEAPU,QAAQ;2CAEK,+BAA+B;2BAC5C,4BAA4B;kCAE3B,qCAAqC;AAEtD,mBAAMA,WAAAA,GAAuDJ,OAAMK,UAAU,CAClF,CAACC,OAAOC;IACN,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAEC,KAAK,EAAEC,MAAM,EAAE,GAAGL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A,WAAAA,GACC,OAAA,aAAA,CAACC,MAAAA,MACE/B,QAAQgC,GAAG,CAAC,CAACC,QAAQC,MAAAA,WAAAA,GACpB,OAAA,aAAA,CAACC,MAAAA;YAAGC,KAAKF;YAAKhB,WAAWX,QAAQ8B,UAAU;YAAEjB,KAAK,EAAEa,WAAAA,QAAAA,WAAAA,KAAAA,IAAAA,KAAAA,IAAAA,OAAQb,KAAK;WAC9Da,OAAOK,KAAK,MAKpBrC,QAAQA,KAAKa,MAAM,GAAG,KAAA,WAAA,GACrB,OAAA,aAAA,CAACyB,SAAAA,MACEtC,KAAK+B,GAAG,CAAC,CAACQ,KAAKC,SAAAA,WAAAA,GACd,OAAA,aAAA,CAACV,MAAAA;YAAGK,KAAKK;WACND,IAAIR,GAAG,CAAC,CAACU,MAAMC,SAAAA,WAAAA,GACd,OAAA,aAAA,CAACC,MAAAA;gBAAGR,KAAKO;gBAAQzB,WAAWX,QAAQsC,QAAQ;gBAAEzB,KAAK,EAAEsB,SAAAA,QAAAA,SAAAA,KAAAA,IAAAA,KAAAA,IAAAA,KAAMtB,KAAK;eAC7DsB,KAAKJ,KAAK;AAarC,GACA;AAEF1C,WAAWkD,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/ChartTable/ChartTable.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { ChartTableProps } from './ChartTable.types';\nimport { useChartTableStyles } from './useChartTableStyles.styles';\nimport { useRtl } from '../../utilities/utilities';\nimport { ImageExportOptions } from '../../types/index';\nimport { toImage } from '../../utilities/image-export-utils';\nimport { tokens } from '@fluentui/react-theme';\nimport * as d3 from 'd3-color';\nimport { getColorContrast } from '../../utilities/colors';\nimport { ThemeContext_unstable as V9ThemeContext } from '@fluentui/react-shared-contexts';\nimport { Theme, webLightTheme } from '@fluentui/tokens';\n\nfunction invertHexColor(hex: string): string {\n const color = d3.color(hex);\n if (!color) {\n return tokens.colorNeutralForeground1!;\n }\n const rgb = color.rgb();\n return d3.rgb(255 - rgb.r, 255 - rgb.g, 255 - rgb.b).formatHex();\n}\n\nfunction getSafeBackgroundColor(v9Theme: Theme, foreground?: string, background?: string): string {\n const fallbackFg = v9Theme.colorNeutralForeground1;\n const fallbackBg = v9Theme.colorNeutralBackground1;\n\n const fg = d3.color(foreground || fallbackFg);\n const bg = d3.color(background || fallbackBg);\n if (!fg || !bg) {\n return fallbackBg;\n }\n const contrast = getColorContrast(fg.formatHex(), bg.formatHex());\n if (contrast >= 3) {\n return bg.formatHex();\n }\n\n const invertedBg = invertHexColor(bg.formatHex());\n const invertedContrast = getColorContrast(fg.formatHex(), invertedBg);\n return invertedContrast >= 3 ? invertedBg : fallbackBg;\n}\n\nexport const ChartTable: React.FunctionComponent<ChartTableProps> = React.forwardRef<HTMLDivElement, ChartTableProps>(\n (props, forwardedRef) => {\n const parentV9Theme = React.useContext(V9ThemeContext) as Theme;\n const v9Theme: Theme = parentV9Theme ? parentV9Theme : webLightTheme;\n const { headers, rows, width, height } = props;\n const _isRTL: boolean = useRtl();\n const _rootElem = React.useRef<HTMLDivElement | null>(null);\n const classes = useChartTableStyles(props);\n\n React.useImperativeHandle(\n props.componentRef,\n () => ({\n chartContainer: _rootElem.current,\n toImage: (opts?: ImageExportOptions): Promise<string> => {\n return toImage(_rootElem.current, undefined, _isRTL, opts);\n },\n }),\n [],\n );\n\n if (!headers || headers.length === 0) {\n return <div>No data available</div>;\n }\n\n const bgColorSet = new Set<string>();\n headers.forEach(header => {\n const bg = header?.style?.backgroundColor;\n const normalized = d3.color(bg || '')?.formatHex();\n if (normalized) {\n bgColorSet.add(normalized);\n }\n });\n let sharedBackgroundColor: string | undefined;\n let useSharedBackground = false;\n\n /*\n If we have only one or two unique background colors, we can consider using a shared background color\n for the table headers. This is to ensure better contrast with the foreground text.\n For size 1, we will consider that as default color if it satisfies the contrast ratio.\n There could also be a scenario where backgroundcolor array is of size 2, for eg: [\"dimsgray\", \"gray\"],\n which will assign 1st column header bg color to dimsgray and rest to gray. so our logic of shared background\n color won't run here. So will consider for size 2 as well.\n For size greater than this, we will consider that user wants different colors and will let color contrast fail\n if any.\n */\n if (bgColorSet.size === 1 || bgColorSet.size === 2) {\n const candidateBg = bgColorSet.size === 1 ? Array.from(bgColorSet)[0] : Array.from(bgColorSet)[1];\n for (const header of headers) {\n const fg = header?.style?.color;\n if (fg && getColorContrast(fg, candidateBg) >= 3) {\n sharedBackgroundColor = candidateBg;\n useSharedBackground = true;\n break;\n }\n }\n }\n\n return (\n <div\n ref={el => (_rootElem.current = el)}\n className={classes.root as string}\n style={{ height: height ? `${height}px` : '650px', overflow: 'hidden' }}\n >\n <svg width={width ?? '100%'} height={height ?? '650px'}>\n <foreignObject x=\"0\" y=\"0\" width=\"100%\" height=\"100%\">\n <div\n style={{\n maxHeight: height ? `${height}px` : '650px',\n overflowY: 'auto',\n overflowX: 'auto',\n }}\n >\n <table\n className={classes.table}\n style={{\n width: width ? `${width}px` : '100%',\n }}\n >\n <thead>\n <tr>\n {headers.map((header, idx) => {\n const style = { ...header?.style };\n const fg = style.color;\n const bg = style.backgroundColor;\n\n if (useSharedBackground) {\n style.backgroundColor = sharedBackgroundColor;\n } else if (fg || bg) {\n style.backgroundColor = getSafeBackgroundColor(v9Theme, fg, bg);\n }\n return (\n <th key={idx} className={classes.headerCell} style={style} tabIndex={0}>\n {header.value}\n </th>\n );\n })}\n </tr>\n </thead>\n {rows && rows.length > 0 && (\n <tbody>\n {rows.map((row, rowIdx) => (\n <tr key={rowIdx}>\n {row.map((cell, colIdx) => {\n const style = { ...cell?.style };\n const fg = style.color;\n const bg = style.backgroundColor;\n if (fg || bg) {\n style.backgroundColor = getSafeBackgroundColor(v9Theme, fg, bg);\n }\n return (\n <td key={colIdx} className={classes.bodyCell} style={style} tabIndex={0}>\n {cell.value}\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n )}\n </table>\n </div>\n </foreignObject>\n </svg>\n </div>\n );\n },\n);\n\nChartTable.displayName = 'ChartTable';\n"],"names":["React","useChartTableStyles","useRtl","toImage","tokens","d3","getColorContrast","ThemeContext_unstable","V9ThemeContext","webLightTheme","invertHexColor","hex","color","colorNeutralForeground1","rgb","r","g","b","formatHex","getSafeBackgroundColor","v9Theme","foreground","background","fallbackFg","fallbackBg","colorNeutralBackground1","fg","bg","contrast","invertedBg","invertedContrast","ChartTable","forwardRef","props","forwardedRef","parentV9Theme","useContext","headers","rows","width","height","_isRTL","_rootElem","useRef","classes","useImperativeHandle","componentRef","chartContainer","current","opts","undefined","length","div","bgColorSet","Set","forEach","header","style","backgroundColor","normalized","add","sharedBackgroundColor","useSharedBackground","size","candidateBg","Array","from","ref","el","className","root","overflow","svg","foreignObject","x","y","maxHeight","overflowY","overflowX","table","thead","tr","map","idx","th","key","headerCell","tabIndex","value","tbody","row","rowIdx","cell","colIdx","td","bodyCell","displayName"],"mappings":"AAAA;;;;;;;;eA0Ca+B;;;;iEAxCU,QAAQ;2CAEK,+BAA+B;2BAC5C,4BAA4B;kCAE3B,qCAAqC;4BACtC,wBAAwB;mEAC3B,WAAW;wBACE,yBAAyB;qCACF,kCAAkC;wBACrD,mBAAmB;AAExD,SAASrB,eAAeC,GAAW;IACjC,MAAMC,QAAQP,SAAGO,KAAK,CAACD;IACvB,IAAI,CAACC,OAAO;QACV,OAAOR,kBAAAA,CAAOS,uBAAuB;IACvC;IACA,MAAMC,MAAMF,MAAME,GAAG;IACrB,OAAOT,SAAGS,GAAG,CAAC,MAAMA,IAAIC,CAAC,EAAE,MAAMD,IAAIE,CAAC,EAAE,MAAMF,IAAIG,CAAC,EAAEC,SAAS;AAChE;AAEA,SAASC,uBAAuBC,OAAc,EAAEC,UAAmB,EAAEC,UAAmB;IACtF,MAAMC,aAAaH,QAAQP,uBAAuB;IAClD,MAAMW,aAAaJ,QAAQK,uBAAuB;IAElD,MAAMC,KAAKrB,SAAGO,KAAK,CAACS,cAAcE;IAClC,MAAMI,KAAKtB,SAAGO,KAAK,CAACU,cAAcE;IAClC,IAAI,CAACE,MAAM,CAAC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B,MAAMC,eAAe;YAChC,IAAIhC,MAAMC,IAAI;gBACZ8B,MAAMC,eAAe,GAAGvC,uBAAuBC,SAASM,IAAIC;YAC9D;YACA,OAAA,WAAA,GACE,OAAA,aAAA,CAACmE,MAAAA;gBAAGT,KAAKQ;gBAAQxB,WAAWzB,QAAQmD,QAAQ;gBAAEtC,OAAOA;gBAAO8B,UAAU;eACnEK,KAAKJ,KAAK;QAGjB;AAWtB,GACA;AAEFzD,WAAWiE,WAAW,GAAG"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
@@ -38,7 +39,7 @@ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
38
39
  Bhrd7zp: "fl43uef",
39
40
  Bg96gwp: "fwrc4pm",
40
41
  De3pzq: "f16xq7d1",
41
- sj55zd: "f19n0e5",
42
+ sj55zd: "f1o4jmwm",
42
43
  z8tnut: "f17mpqex",
43
44
  z189sj: [
44
45
  "f1vdfbxk",
@@ -131,7 +132,7 @@ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
131
132
  "fw35ms5",
132
133
  "f7pw515"
133
134
  ],
134
- sj55zd: "f19n0e5",
135
+ sj55zd: "f1o4jmwm",
135
136
  fsow6f: [
136
137
  "f1o700av",
137
138
  "fes3tcz"
@@ -148,7 +149,7 @@ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
148
149
  ".fl43uef{font-weight:var(--fontWeightSemibold);}",
149
150
  ".fwrc4pm{line-height:var(--lineHeightBase200);}",
150
151
  ".f16xq7d1{background-color:var(--colorNeutralBackground3);}",
151
- ".f19n0e5{color:var(--colorNeutralForeground1);}",
152
+ ".f1o4jmwm{color:black;}",
152
153
  ".f17mpqex{padding-top:var(--spacingHorizontalS);}",
153
154
  ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}",
154
155
  ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
@@ -1 +1 @@
1
- {"version":3,"sources":["useChartTableStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n/**\n * @internal\n */ export const chartTableClassNames = {\n root: 'fui-ChartTable__root',\n table: 'fui-ChartTable__table',\n headerCell: 'fui-ChartTable__headerCell',\n bodyCell: 'fui-ChartTable__bodyCell',\n chart: 'fui-ChartTable__chart'\n};\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n overflowX: 'auto'\n },\n table: {\n borderCollapse: 'collapse'\n },\n headerCell: {\n ...typographyStyles.caption1,\n fontWeight: tokens.fontWeightSemibold,\n backgroundColor: tokens.colorNeutralBackground3,\n color: tokens.colorNeutralForeground1,\n ...shorthands.padding(tokens.spacingHorizontalS),\n textAlign: 'left',\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorNeutralStroke2),\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n color: 'WindowText'\n }\n },\n bodyCell: {\n ...typographyStyles.caption1,\n ...shorthands.padding(tokens.spacingHorizontalS),\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorNeutralStroke2),\n color: tokens.colorNeutralForeground1,\n textAlign: 'left',\n '@media (forced-colors: active)': {\n color: 'WindowText'\n }\n }\n});\n/**\n * Apply styling to the ChartTable slots based on the state\n */ export const useChartTableStyles = (props)=>{\n const baseStyles = useStyles();\n return {\n root: mergeClasses(chartTableClassNames.root, baseStyles.root /*props.styles?.root*/ ),\n table: mergeClasses(chartTableClassNames.table, baseStyles.table /*props.styles?.table*/ ),\n headerCell: mergeClasses(chartTableClassNames.headerCell, baseStyles.headerCell /*props.styles?.headerCell*/ ),\n bodyCell: mergeClasses(chartTableClassNames.bodyCell, baseStyles.bodyCell /*props.styles?.bodyCell*/ ),\n chart: mergeClasses(chartTableClassNames.chart /*props.styles?.chart*/ )\n };\n};\n"],"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","chartTableClassNames","root","table","headerCell","bodyCell","chart","useStyles","a9b677","B68tc82","po53p8","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","De3pzq","sj55zd","z8tnut","z189sj","Byoj8tv","uwmqm3","fsow6f","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bsw6fvg","Bbusuzp","d","m","useChartTableStyles","props","baseStyles"],"mappings":";;;;;;;;;;;IAIiBK,oBAAoB;;;uBAyCD;eAAnBqC;;;uBA7CoC,gBAAgB;AAI1D,6BAA6B;IACpCpC,IAAI,EAAE,sBAAsB;IAC5BC,KAAK,EAAE,uBAAuB;IAC9BC,UAAU,EAAE,4BAA4B;IACxCC,QAAQ,EAAE,0BAA0B;IACpCC,KAAK,EAAE;AACX,CAAC;AACD,MAAMC,SAAS,GAAA,WAAA,OAAGX,eAAA,EAAA;IAAAM,IAAA,EAAA;QAAAM,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAN,KAAA,EAAA;QAAAO,MAAA,EAAA;IAAA;IAAAN,UAAA,EAAA;QAAAO,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,MAAA,EAAA;QAAAC,MAAA,EAAA;YAAA;YAAA;SAAA;QAAAC,OAA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AACtC,IAAI,CAAC,oBAAA,EAAuB,CAAC;QACtFC,KAAK,MAAEN,mBAAY,EAACI,oBAAoB,CAACE,KAAK,EAAEqC,UAAU,CAACrC,KAAK,CAAC,qBAAA,EAAwB,CAAC;QAC1FC,UAAU,MAAEP,mBAAY,EAACI,oBAAoB,CAACG,UAAU,EAAEoC,UAAU,CAACpC,UAAU,CAAC,0BAAA,EAA6B,CAAC;QAC9GC,QAAQ,MAAER,mBAAY,EAACI,oBAAoB,CAACI,QAAQ,EAAEmC,UAAU,CAACnC,QAAQ,CAAC,wBAAA,EAA2B,CAAC;QACtGC,KAAK,MAAET,mBAAY,EAACI,oBAAoB,CAACK,KAAK,CAAC,qBAAA,EAAwB;IAC3E,CAAC;AACL,CAAC"}
1
+ {"version":3,"sources":["useChartTableStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n/**\n * @internal\n */ export const chartTableClassNames = {\n root: 'fui-ChartTable__root',\n table: 'fui-ChartTable__table',\n headerCell: 'fui-ChartTable__headerCell',\n bodyCell: 'fui-ChartTable__bodyCell',\n chart: 'fui-ChartTable__chart'\n};\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n overflowX: 'auto'\n },\n table: {\n borderCollapse: 'collapse'\n },\n headerCell: {\n ...typographyStyles.caption1,\n fontWeight: tokens.fontWeightSemibold,\n backgroundColor: tokens.colorNeutralBackground3,\n color: 'black',\n ...shorthands.padding(tokens.spacingHorizontalS),\n textAlign: 'left',\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorNeutralStroke2),\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n color: 'WindowText'\n }\n },\n bodyCell: {\n ...typographyStyles.caption1,\n ...shorthands.padding(tokens.spacingHorizontalS),\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorNeutralStroke2),\n color: 'black',\n textAlign: 'left',\n '@media (forced-colors: active)': {\n color: 'WindowText'\n }\n }\n});\n/**\n * Apply styling to the ChartTable slots based on the state\n */ export const useChartTableStyles = (props)=>{\n const baseStyles = useStyles();\n return {\n root: mergeClasses(chartTableClassNames.root, baseStyles.root /*props.styles?.root*/ ),\n table: mergeClasses(chartTableClassNames.table, baseStyles.table /*props.styles?.table*/ ),\n headerCell: mergeClasses(chartTableClassNames.headerCell, baseStyles.headerCell /*props.styles?.headerCell*/ ),\n bodyCell: mergeClasses(chartTableClassNames.bodyCell, baseStyles.bodyCell /*props.styles?.bodyCell*/ ),\n chart: mergeClasses(chartTableClassNames.chart /*props.styles?.chart*/ )\n };\n};\n"],"names":["__styles","mergeClasses","shorthands","tokens","typographyStyles","chartTableClassNames","root","table","headerCell","bodyCell","chart","useStyles","a9b677","B68tc82","po53p8","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","De3pzq","sj55zd","z8tnut","z189sj","Byoj8tv","uwmqm3","fsow6f","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","icvyot","vrafjx","oivjwe","wvpqe5","g2u3we","h3c5rm","B9xav0g","zhjwy3","Bsw6fvg","Bbusuzp","d","m","useChartTableStyles","props","baseStyles"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAKKK,oBAAoB;;;uBAyCD;eAAnBqC;;;uBA7CoC,gBAAgB;AAI1D,6BAA6B;IACpCpC,IAAI,EAAE,sBAAsB;IAC5BC,KAAK,EAAE,uBAAuB;IAC9BC,UAAU,EAAE,4BAA4B;IACxCC,QAAQ,EAAE,0BAA0B;IACpCC,KAAK,EAAE;AACX,CAAC;AACD,MAAMC,SAAS,GAAA,WAAA,OAAGX,eAAA,EAAA;IAAAM,IAAA,EAAA;QAAAM,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAN,KAAA,EAAA;QAAAO,MAAA,EAAA;IAAA;IAAAN,UAAA,EAAA;QAAAO,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,OAAA,EAAA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EAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;IAAAC,CAAA,EAAA;QAAA;YAAA;YAAA;gBAAAA,CAAA,EAAA;YAAA;SAAA;QAAA;YAAA;YAAA;gBAAAA,CAAA,EAAA;YAAA;SAAA;KAAA;AAAA,CA+BjB,CAAC;AAGS,6BAA6BE,KAAK,IAAG;IAC5C,MAAMC,UAAU,GAAGjC,SAAS,CAAC,CAAC;IAC9B,OAAO;QACHL,IAAI,MAAEL,mBAAY,EAACI,oBAAoB,CAACC,IAAI,EAAEsC,UAAU,CAACtC,IAAI,CAAC,oBAAA,EAAuB,CAAC;QACtFC,KAAK,MAAEN,mBAAY,EAACI,oBAAoB,CAACE,KAAK,EAAEqC,UAAU,CAACrC,KAAK,CAAC,qBAAA,EAAwB,CAAC;QAC1FC,UAAU,EAAEP,uBAAY,EAACI,oBAAoB,CAACG,UAAU,EAAEoC,UAAU,CAACpC,UAAU,CAAC,0BAAA,EAA6B,CAAC;QAC9GC,QAAQ,MAAER,mBAAY,EAACI,oBAAoB,CAACI,QAAQ,EAAEmC,UAAU,CAACnC,QAAQ,CAAC,wBAAA,EAA2B,CAAC;QACtGC,KAAK,MAAET,mBAAY,EAACI,oBAAoB,CAACK,KAAK,CAAC,qBAAA,EAAwB;IAC3E,CAAC;AACL,CAAC"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
@@ -37,7 +38,7 @@ const useStyles = (0, _react.makeStyles)({
37
38
  ..._reacttheme.typographyStyles.caption1,
38
39
  fontWeight: _reacttheme.tokens.fontWeightSemibold,
39
40
  backgroundColor: _reacttheme.tokens.colorNeutralBackground3,
40
- color: _reacttheme.tokens.colorNeutralForeground1,
41
+ color: 'black',
41
42
  ..._react.shorthands.padding(_reacttheme.tokens.spacingHorizontalS),
42
43
  textAlign: 'left',
43
44
  ..._react.shorthands.border(_reacttheme.tokens.strokeWidthThick, 'solid', _reacttheme.tokens.colorNeutralStroke2),
@@ -50,7 +51,7 @@ const useStyles = (0, _react.makeStyles)({
50
51
  ..._reacttheme.typographyStyles.caption1,
51
52
  ..._react.shorthands.padding(_reacttheme.tokens.spacingHorizontalS),
52
53
  ..._react.shorthands.border(_reacttheme.tokens.strokeWidthThick, 'solid', _reacttheme.tokens.colorNeutralStroke2),
53
- color: _reacttheme.tokens.colorNeutralForeground1,
54
+ color: 'black',
54
55
  textAlign: 'left',
55
56
  '@media (forced-colors: active)': {
56
57
  color: 'WindowText'
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ChartTable/useChartTableStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { ChartTableProps, ChartTableStyles } from './ChartTable.types';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n\n/**\n * @internal\n */\nexport const chartTableClassNames: SlotClassNames<ChartTableStyles> = {\n root: 'fui-ChartTable__root',\n table: 'fui-ChartTable__table',\n headerCell: 'fui-ChartTable__headerCell',\n bodyCell: 'fui-ChartTable__bodyCell',\n chart: 'fui-ChartTable__chart',\n};\n\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n overflowX: 'auto',\n },\n table: {\n borderCollapse: 'collapse',\n },\n headerCell: {\n ...typographyStyles.caption1,\n fontWeight: tokens.fontWeightSemibold,\n backgroundColor: tokens.colorNeutralBackground3,\n color: tokens.colorNeutralForeground1,\n ...shorthands.padding(tokens.spacingHorizontalS),\n textAlign: 'left',\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorNeutralStroke2),\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n color: 'WindowText',\n },\n },\n bodyCell: {\n ...typographyStyles.caption1,\n ...shorthands.padding(tokens.spacingHorizontalS),\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorNeutralStroke2),\n color: tokens.colorNeutralForeground1,\n textAlign: 'left',\n '@media (forced-colors: active)': {\n color: 'WindowText',\n },\n },\n});\n\n/**\n * Apply styling to the ChartTable slots based on the state\n */\nexport const useChartTableStyles = (props: ChartTableProps): ChartTableStyles => {\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(chartTableClassNames.root, baseStyles.root /*props.styles?.root*/),\n table: mergeClasses(chartTableClassNames.table, baseStyles.table /*props.styles?.table*/),\n headerCell: mergeClasses(chartTableClassNames.headerCell, baseStyles.headerCell /*props.styles?.headerCell*/),\n bodyCell: mergeClasses(chartTableClassNames.bodyCell, baseStyles.bodyCell /*props.styles?.bodyCell*/),\n chart: mergeClasses(chartTableClassNames.chart /*props.styles?.chart*/),\n };\n};\n"],"names":["makeStyles","mergeClasses","shorthands","tokens","typographyStyles","chartTableClassNames","root","table","headerCell","bodyCell","chart","useStyles","width","overflowX","borderCollapse","caption1","fontWeight","fontWeightSemibold","backgroundColor","colorNeutralBackground3","color","colorNeutralForeground1","padding","spacingHorizontalS","textAlign","border","strokeWidthThick","colorNeutralStroke2","useChartTableStyles","props","baseStyles"],"mappings":";;;;;;;;;;;IAQaK,oBAAAA;;;IA4CAuB,mBAAAA;;;;uBApDwC,iBAAiB;4BAG7B,wBAAwB;AAK1D,6BAA+D;IACpEtB,MAAM;IACNC,OAAO;IACPC,YAAY;IACZC,UAAU;IACVC,OAAO;AACT,EAAE;AAEF,MAAMC,gBAAYX,iBAAAA,EAAW;IAC3BM,MAAM;QACJM,OAAO;QACPC,WAAW;IACb;IACAN,OAAO;QACLO,gBAAgB;IAClB;IACAN,YAAY;QACV,GAAGJ,4BAAAA,CAAiBW,QAAQ;QAC5BC,YAAYb,kBAAAA,CAAOc,kBAAkB;QACrCC,iBAAiBf,kBAAAA,CAAOgB,uBAAuB;QAC/CC,OAAOjB,kBAAAA,CAAOkB,uBAAuB;QACrC,GAAGnB,iBAAAA,CAAWoB,OAAO,CAACnB,kBAAAA,CAAOoB,kBAAkB,CAAC;QAChDC,WAAW;QACX,GAAGtB,iBAAAA,CAAWuB,MAAM,CAACtB,kBAAAA,CAAOuB,gBAAgB,EAAE,SAASvB,kBAAAA,CAAOwB,mBAAmB,CAAC;QAClF,kCAAkC;YAChCT,iBAAiB;YACjBE,OAAO;QACT;IACF;IACAX,UAAU;QACR,GAAGL,4BAAAA,CAAiBW,QAAQ;QAC5B,GAAGb,iBAAAA,CAAWoB,OAAO,CAACnB,kBAAAA,CAAOoB,kBAAkB,CAAC;QAChD,GAAGrB,iBAAAA,CAAWuB,MAAM,CAACtB,kBAAAA,CAAOuB,gBAAgB,EAAE,SAASvB,kBAAAA,CAAOwB,mBAAmB,CAAC;QAClFP,OAAOjB,kBAAAA,CAAOkB,uBAAuB;QACrCG,WAAW;QACX,kCAAkC;YAChCJ,OAAO;QACT;IACF;AACF;AAKO,4BAA4B,CAACS;IAClC,MAAMC,aAAanB;IAEnB,OAAO;QACLL,UAAML,mBAAAA,EAAaI,qBAAqBC,IAAI,EAAEwB,WAAWxB,IAAI,CAAC,oBAAoB;QAClFC,OAAON,uBAAAA,EAAaI,qBAAqBE,KAAK,EAAEuB,WAAWvB,KAAK,CAAC,qBAAqB;QACtFC,gBAAYP,mBAAAA,EAAaI,qBAAqBG,UAAU,EAAEsB,WAAWtB,UAAU,CAAC,0BAA0B;QAC1GC,cAAUR,mBAAAA,EAAaI,qBAAqBI,QAAQ,EAAEqB,WAAWrB,QAAQ,CAAC,wBAAwB;QAClGC,WAAOT,mBAAAA,EAAaI,qBAAqBK,KAAK,CAAC,qBAAqB;IACtE;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/ChartTable/useChartTableStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { ChartTableProps, ChartTableStyles } from './ChartTable.types';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\n\n/**\n * @internal\n */\nexport const chartTableClassNames: SlotClassNames<ChartTableStyles> = {\n root: 'fui-ChartTable__root',\n table: 'fui-ChartTable__table',\n headerCell: 'fui-ChartTable__headerCell',\n bodyCell: 'fui-ChartTable__bodyCell',\n chart: 'fui-ChartTable__chart',\n};\n\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n overflowX: 'auto',\n },\n table: {\n borderCollapse: 'collapse',\n },\n headerCell: {\n ...typographyStyles.caption1,\n fontWeight: tokens.fontWeightSemibold,\n backgroundColor: tokens.colorNeutralBackground3,\n color: 'black',\n ...shorthands.padding(tokens.spacingHorizontalS),\n textAlign: 'left',\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorNeutralStroke2),\n '@media (forced-colors: active)': {\n backgroundColor: 'Window',\n color: 'WindowText',\n },\n },\n bodyCell: {\n ...typographyStyles.caption1,\n ...shorthands.padding(tokens.spacingHorizontalS),\n ...shorthands.border(tokens.strokeWidthThick, 'solid', tokens.colorNeutralStroke2),\n color: 'black',\n textAlign: 'left',\n '@media (forced-colors: active)': {\n color: 'WindowText',\n },\n },\n});\n\n/**\n * Apply styling to the ChartTable slots based on the state\n */\nexport const useChartTableStyles = (props: ChartTableProps): ChartTableStyles => {\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(chartTableClassNames.root, baseStyles.root /*props.styles?.root*/),\n table: mergeClasses(chartTableClassNames.table, baseStyles.table /*props.styles?.table*/),\n headerCell: mergeClasses(chartTableClassNames.headerCell, baseStyles.headerCell /*props.styles?.headerCell*/),\n bodyCell: mergeClasses(chartTableClassNames.bodyCell, baseStyles.bodyCell /*props.styles?.bodyCell*/),\n chart: mergeClasses(chartTableClassNames.chart /*props.styles?.chart*/),\n };\n};\n"],"names":["makeStyles","mergeClasses","shorthands","tokens","typographyStyles","chartTableClassNames","root","table","headerCell","bodyCell","chart","useStyles","width","overflowX","borderCollapse","caption1","fontWeight","fontWeightSemibold","backgroundColor","colorNeutralBackground3","color","padding","spacingHorizontalS","textAlign","border","strokeWidthThick","colorNeutralStroke2","useChartTableStyles","props","baseStyles"],"mappings":"AAAA;;;;;;;;;;;;IAUaK,oBAAAA;;;uBA4CAsB;;;;uBApDwC,iBAAiB;4BAG7B,wBAAwB;AAK1D,6BAA+D;IACpErB,MAAM;IACNC,OAAO;IACPC,YAAY;IACZC,UAAU;IACVC,OAAO;AACT,EAAE;AAEF,MAAMC,gBAAYX,iBAAAA,EAAW;IAC3BM,MAAM;QACJM,OAAO;QACPC,WAAW;IACb;IACAN,OAAO;QACLO,gBAAgB;IAClB;IACAN,YAAY;QACV,GAAGJ,4BAAAA,CAAiBW,QAAQ;QAC5BC,YAAYb,kBAAAA,CAAOc,kBAAkB;QACrCC,iBAAiBf,kBAAAA,CAAOgB,uBAAuB;QAC/CC,OAAO;QACP,GAAGlB,iBAAAA,CAAWmB,OAAO,CAAClB,kBAAAA,CAAOmB,kBAAkB,CAAC;QAChDC,WAAW;QACX,GAAGrB,iBAAAA,CAAWsB,MAAM,CAACrB,kBAAAA,CAAOsB,gBAAgB,EAAE,SAAStB,kBAAAA,CAAOuB,mBAAmB,CAAC;QAClF,kCAAkC;YAChCR,iBAAiB;YACjBE,OAAO;QACT;IACF;IACAX,UAAU;QACR,GAAGL,4BAAAA,CAAiBW,QAAQ;QAC5B,GAAGb,iBAAAA,CAAWmB,OAAO,CAAClB,kBAAAA,CAAOmB,kBAAkB,CAAC;QAChD,GAAGpB,iBAAAA,CAAWsB,MAAM,CAACrB,kBAAAA,CAAOsB,gBAAgB,EAAE,SAAStB,kBAAAA,CAAOuB,mBAAmB,CAAC;QAClFN,OAAO;QACPG,WAAW;QACX,kCAAkC;YAChCH,OAAO;QACT;IACF;AACF;AAKO,MAAMO,sBAAsB,CAACC;IAClC,MAAMC,aAAalB;IAEnB,OAAO;QACLL,UAAML,mBAAAA,EAAaI,qBAAqBC,IAAI,EAAEuB,WAAWvB,IAAI,CAAC,oBAAoB;QAClFC,WAAON,mBAAAA,EAAaI,qBAAqBE,KAAK,EAAEsB,WAAWtB,KAAK,CAAC,qBAAqB;QACtFC,gBAAYP,mBAAAA,EAAaI,qBAAqBG,UAAU,EAAEqB,WAAWrB,UAAU,CAAC,0BAA0B;QAC1GC,cAAUR,mBAAAA,EAAaI,qBAAqBI,QAAQ,EAAEoB,WAAWpB,QAAQ,CAAC,wBAAwB;QAClGC,WAAOT,mBAAAA,EAAaI,qBAAqBK,KAAK,CAAC,qBAAqB;IACtE;AACF,EAAE"}
@@ -1,3 +1,4 @@
1
+ 'use client';
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
@@ -34,7 +35,11 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
34
35
  const _isFirstRender = _react.useRef(true);
35
36
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
37
  let _xScale;
37
- let isIntegralDataset = true;
38
+ const isIntegralDataset = _react.useMemo(()=>{
39
+ return !props.points.some((point)=>point.y % 1 !== 0);
40
+ }, [
41
+ props.points
42
+ ]);
38
43
  let _tooltipId = (0, _reactutilities.useId)('tooltip_');
39
44
  /* Used for when WrapXAxisLabels props appeared.
40
45
  * To display the total word (space separated words), Need to have more space than usual.
@@ -50,7 +55,8 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
50
55
  _index.ChartTypes.HorizontalBarChartWithAxis,
51
56
  _index.ChartTypes.HeatMapChart,
52
57
  _index.ChartTypes.VerticalStackedBarChart,
53
- _index.ChartTypes.GanttChart
58
+ _index.ChartTypes.GanttChart,
59
+ _index.ChartTypes.ScatterChart
54
60
  ];
55
61
  var _props_margins_top, _props_margins_bottom, _props_margins_left, _props_margins_right, _props_margins_right1, _props_margins_left1;
56
62
  /**
@@ -65,33 +71,34 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
65
71
  right: _useRtl ? (_props_margins_left = (_props_margins2 = props.margins) === null || _props_margins2 === void 0 ? void 0 : _props_margins2.left) !== null && _props_margins_left !== void 0 ? _props_margins_left : 40 : ((_props_margins_right = (_props_margins3 = props.margins) === null || _props_margins3 === void 0 ? void 0 : _props_margins3.right) !== null && _props_margins_right !== void 0 ? _props_margins_right : props === null || props === void 0 ? void 0 : props.secondaryYScaleOptions) ? 40 : 20,
66
72
  left: _useRtl ? ((_props_margins_right1 = (_props_margins4 = props.margins) === null || _props_margins4 === void 0 ? void 0 : _props_margins4.right) !== null && _props_margins_right1 !== void 0 ? _props_margins_right1 : props === null || props === void 0 ? void 0 : props.secondaryYScaleOptions) ? 40 : 20 : (_props_margins_left1 = (_props_margins5 = props.margins) === null || _props_margins5 === void 0 ? void 0 : _props_margins5.left) !== null && _props_margins_left1 !== void 0 ? _props_margins_left1 : 40
67
73
  };
68
- const TITLE_MARGIN = 20;
74
+ const TITLE_MARGIN_HORIZONTAL = 24;
75
+ const TITLE_MARGIN_VERTICAL = 20;
69
76
  if (props.xAxisTitle !== undefined && props.xAxisTitle !== '') {
70
77
  var _props_margins6;
71
78
  var _props_margins_bottom1;
72
- margins.bottom = (_props_margins_bottom1 = (_props_margins6 = props.margins) === null || _props_margins6 === void 0 ? void 0 : _props_margins6.bottom) !== null && _props_margins_bottom1 !== void 0 ? _props_margins_bottom1 : margins.bottom + TITLE_MARGIN;
79
+ margins.bottom = (_props_margins_bottom1 = (_props_margins6 = props.margins) === null || _props_margins6 === void 0 ? void 0 : _props_margins6.bottom) !== null && _props_margins_bottom1 !== void 0 ? _props_margins_bottom1 : margins.bottom + TITLE_MARGIN_VERTICAL;
73
80
  }
74
81
  if (props.yAxisTitle !== undefined && props.yAxisTitle !== '') {
75
82
  var _props_margins7, _props_margins8, _props_margins9, _props_margins10;
76
83
  var _props_margins_right2, _props_margins_left2;
77
- margins.left = _useRtl ? ((_props_margins_right2 = (_props_margins7 = props.margins) === null || _props_margins7 === void 0 ? void 0 : _props_margins7.right) !== null && _props_margins_right2 !== void 0 ? _props_margins_right2 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? margins.right + 2 * TITLE_MARGIN : margins.right + TITLE_MARGIN : (_props_margins_left2 = (_props_margins8 = props.margins) === null || _props_margins8 === void 0 ? void 0 : _props_margins8.left) !== null && _props_margins_left2 !== void 0 ? _props_margins_left2 : margins.left + TITLE_MARGIN;
84
+ margins.left = _useRtl ? ((_props_margins_right2 = (_props_margins7 = props.margins) === null || _props_margins7 === void 0 ? void 0 : _props_margins7.right) !== null && _props_margins_right2 !== void 0 ? _props_margins_right2 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? margins.right + 2 * TITLE_MARGIN_HORIZONTAL : margins.right + TITLE_MARGIN_HORIZONTAL : (_props_margins_left2 = (_props_margins8 = props.margins) === null || _props_margins8 === void 0 ? void 0 : _props_margins8.left) !== null && _props_margins_left2 !== void 0 ? _props_margins_left2 : margins.left + TITLE_MARGIN_HORIZONTAL;
78
85
  var _props_margins_left3, _props_margins_right3;
79
- margins.right = _useRtl ? (_props_margins_left3 = (_props_margins9 = props.margins) === null || _props_margins9 === void 0 ? void 0 : _props_margins9.left) !== null && _props_margins_left3 !== void 0 ? _props_margins_left3 : margins.left + TITLE_MARGIN : ((_props_margins_right3 = (_props_margins10 = props.margins) === null || _props_margins10 === void 0 ? void 0 : _props_margins10.right) !== null && _props_margins_right3 !== void 0 ? _props_margins_right3 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? margins.right + 2 * TITLE_MARGIN : margins.right + TITLE_MARGIN;
86
+ margins.right = _useRtl ? (_props_margins_left3 = (_props_margins9 = props.margins) === null || _props_margins9 === void 0 ? void 0 : _props_margins9.left) !== null && _props_margins_left3 !== void 0 ? _props_margins_left3 : margins.left + TITLE_MARGIN_HORIZONTAL : ((_props_margins_right3 = (_props_margins10 = props.margins) === null || _props_margins10 === void 0 ? void 0 : _props_margins10.right) !== null && _props_margins_right3 !== void 0 ? _props_margins_right3 : props === null || props === void 0 ? void 0 : props.secondaryYAxistitle) ? margins.right + 2 * TITLE_MARGIN_HORIZONTAL : margins.right + TITLE_MARGIN_HORIZONTAL;
80
87
  }
81
88
  if (props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '') {
82
89
  var _props_margins11;
83
90
  var _props_margins_top1;
84
- margins.top = (_props_margins_top1 = (_props_margins11 = props.margins) === null || _props_margins11 === void 0 ? void 0 : _props_margins11.top) !== null && _props_margins_top1 !== void 0 ? _props_margins_top1 : margins.top + TITLE_MARGIN;
91
+ margins.top = (_props_margins_top1 = (_props_margins11 = props.margins) === null || _props_margins11 === void 0 ? void 0 : _props_margins11.top) !== null && _props_margins_top1 !== void 0 ? _props_margins_top1 : margins.top + TITLE_MARGIN_VERTICAL;
85
92
  }
86
93
  if (props.yAxisAnnotation !== undefined && props.yAxisAnnotation !== '' && (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '')) {
87
94
  if (_useRtl) {
88
95
  var _props_margins12;
89
96
  var _props_margins_right4;
90
- margins.left = (_props_margins_right4 = (_props_margins12 = props.margins) === null || _props_margins12 === void 0 ? void 0 : _props_margins12.right) !== null && _props_margins_right4 !== void 0 ? _props_margins_right4 : margins.right + TITLE_MARGIN;
97
+ margins.left = (_props_margins_right4 = (_props_margins12 = props.margins) === null || _props_margins12 === void 0 ? void 0 : _props_margins12.right) !== null && _props_margins_right4 !== void 0 ? _props_margins_right4 : margins.right + TITLE_MARGIN_HORIZONTAL;
91
98
  } else {
92
99
  var _props_margins13;
93
100
  var _props_margins_right5;
94
- margins.right = (_props_margins_right5 = (_props_margins13 = props.margins) === null || _props_margins13 === void 0 ? void 0 : _props_margins13.right) !== null && _props_margins_right5 !== void 0 ? _props_margins_right5 : margins.right + TITLE_MARGIN;
101
+ margins.right = (_props_margins_right5 = (_props_margins13 = props.margins) === null || _props_margins13 === void 0 ? void 0 : _props_margins13.right) !== null && _props_margins_right5 !== void 0 ? _props_margins_right5 : margins.right + TITLE_MARGIN_HORIZONTAL;
95
102
  }
96
103
  }
97
104
  const classes = (0, _useCartesianChartStylesstyles.useCartesianChartStyles)(props);
@@ -113,8 +120,6 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
113
120
  } else if (startFromX !== 0) {
114
121
  setStartFromX(0);
115
122
  }
116
- // eslint-disable-next-line react-hooks/exhaustive-deps
117
- isIntegralDataset = !props.points.some((point)=>point.y % 1 !== 0);
118
123
  return ()=>{
119
124
  cancelAnimationFrame(_reqID);
120
125
  };
@@ -136,10 +141,6 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
136
141
  } else if (startFromX !== 0) {
137
142
  setStartFromX(0);
138
143
  }
139
- if (prevProps !== null && prevProps.points !== props.points) {
140
- // eslint-disable-next-line react-hooks/exhaustive-deps
141
- isIntegralDataset = !props.points.some((point)=>point.y % 1 !== 0);
142
- }
143
144
  }, [
144
145
  props,
145
146
  prevProps
@@ -189,6 +190,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
189
190
  let callout = null;
190
191
  let children = null;
191
192
  if (props.enableFirstRenderOptimization && chartContainer.current || !props.enableFirstRenderOptimization) {
193
+ var _props_xAxis, _props_xAxis1, _props_yAxis, _props_yAxis1;
192
194
  _isFirstRender.current = false;
193
195
  var _props_showRoundOffXTickValues;
194
196
  const XAxisParams = {
@@ -211,7 +213,9 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
211
213
  xAxisOuterPadding: props.xAxisOuterPadding,
212
214
  containerWidth: containerWidth,
213
215
  hideTickOverlap: props.rotateXAxisLables ? false : props.hideTickOverlap,
214
- calcMaxLabelWidth: _calcMaxLabelWidthWithTransform
216
+ calcMaxLabelWidth: _calcMaxLabelWidthWithTransform,
217
+ tickStep: (_props_xAxis = props.xAxis) === null || _props_xAxis === void 0 ? void 0 : _props_xAxis.tickStep,
218
+ tick0: (_props_xAxis1 = props.xAxis) === null || _props_xAxis1 === void 0 ? void 0 : _props_xAxis1.tick0
215
219
  };
216
220
  /**
217
221
  * These scales used for 2 purposes.
@@ -223,16 +227,16 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
223
227
  let tickValues;
224
228
  switch(props.xAxisType){
225
229
  case _index.XAxisTypes.NumericAxis:
226
- ({ xScale, tickValues } = (0, _index.createNumericXAxis)(XAxisParams, props.tickParams, props.chartType, culture));
230
+ ({ xScale, tickValues } = (0, _index.createNumericXAxis)(XAxisParams, props.tickParams, props.chartType, culture, props.xScaleType, _useRtl));
227
231
  break;
228
232
  case _index.XAxisTypes.DateAxis:
229
233
  ({ xScale, tickValues } = (0, _index.createDateXAxis)(XAxisParams, props.tickParams, culture, dateLocalizeOptions, timeFormatLocale, customDateTimeFormatter, props.useUTC, props.chartType));
230
234
  break;
231
235
  case _index.XAxisTypes.StringAxis:
232
- ({ xScale, tickValues } = (0, _index.createStringXAxis)(XAxisParams, props.tickParams, props.datasetForXAxisDomain, culture));
236
+ ({ xScale, tickValues } = (0, _index.createStringXAxis)(XAxisParams, props.tickParams, props.datasetForXAxisDomain, culture, _useRtl));
233
237
  break;
234
238
  default:
235
- ({ xScale, tickValues } = (0, _index.createNumericXAxis)(XAxisParams, props.tickParams, props.chartType, culture));
239
+ ({ xScale, tickValues } = (0, _index.createNumericXAxis)(XAxisParams, props.tickParams, props.chartType, culture, props.xScaleType, _useRtl));
236
240
  }
237
241
  _xScale = xScale;
238
242
  _tickValues = tickValues;
@@ -252,7 +256,10 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
252
256
  // please note these padding default values must be consistent in here
253
257
  // and the parent chart(HBWA/Vertical etc..) for more details refer example
254
258
  // http://using-d3js.com/04_07_ordinal_scales.html
255
- yAxisPadding: props.yAxisPadding || 0
259
+ yAxisPadding: props.yAxisPadding || 0,
260
+ tickValues: props.yAxisTickValues,
261
+ tickStep: (_props_yAxis = props.yAxis) === null || _props_yAxis === void 0 ? void 0 : _props_yAxis.tickStep,
262
+ tick0: (_props_yAxis1 = props.yAxis) === null || _props_yAxis1 === void 0 ? void 0 : _props_yAxis1.tick0
256
263
  };
257
264
  /**
258
265
  * These scales used for 2 purposes.
@@ -290,9 +297,9 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
290
297
  yMinMaxValues: props.getMinMaxOfYAxis(points, props.yAxisType, true),
291
298
  yAxisPadding: props.yAxisPadding
292
299
  };
293
- yScaleSecondary = props.createYAxis(YAxisParamsSecondary, _useRtl, axisData, isIntegralDataset, chartType, true, props.roundedTicks);
300
+ yScaleSecondary = props.createYAxis(YAxisParamsSecondary, _useRtl, axisData, isIntegralDataset, chartType, true, props.roundedTicks, props.secondaryYScaleType, _useRtl);
294
301
  }
295
- yScalePrimary = props.createYAxis(YAxisParams, _useRtl, axisData, isIntegralDataset, chartType, false, props.roundedTicks);
302
+ yScalePrimary = props.createYAxis(YAxisParams, _useRtl, axisData, isIntegralDataset, chartType, false, props.roundedTicks, props.yScaleType, _useRtl);
296
303
  }
297
304
  if (chartTypesWithStringYAxis.includes(props.chartType) && props.yAxisType === _index.YAxisType.StringAxis) {
298
305
  // Removing un wanted tooltip div from DOM, when prop not provided, for proper cleanup
@@ -349,6 +356,12 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
349
356
  };
350
357
  const xAxisTitleMaximumAllowedWidth = svgDimensions.width - margins.left - margins.right - startFromX;
351
358
  const yAxisTitleMaximumAllowedHeight = svgDimensions.height - margins.bottom - margins.top - _removalValueForTextTuncate - titleMargin;
359
+ const commonSvgToolTipProps = {
360
+ wrapContent: _index.wrapContent,
361
+ showBackground: true,
362
+ className: classes.svgTooltip,
363
+ content: ''
364
+ };
352
365
  /**
353
366
  * When screen resizes, along with screen, chart also auto adjusted.
354
367
  * This method used to adjust height and width of the charts.
@@ -508,6 +521,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
508
521
  transform: `translate(0, ${svgDimensions.height - margins.bottom - _removalValueForTextTuncate})`,
509
522
  className: classes.xAxis
510
523
  }), props.xAxisTitle !== undefined && props.xAxisTitle !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
524
+ ...commonSvgToolTipProps,
511
525
  content: props.xAxisTitle,
512
526
  textProps: {
513
527
  x: margins.left + startFromX + xAxisTitleMaximumAllowedWidth / 2,
@@ -515,11 +529,9 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
515
529
  className: classes.axisTitle,
516
530
  textAnchor: 'middle'
517
531
  },
518
- maxWidth: xAxisTitleMaximumAllowedWidth,
519
- wrapContent: _index.wrapContent,
520
- showBackground: true,
521
- className: classes.svgTooltip
532
+ maxWidth: xAxisTitleMaximumAllowedWidth
522
533
  }), props.xAxisAnnotation !== undefined && props.xAxisAnnotation !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
534
+ ...commonSvgToolTipProps,
523
535
  content: props.xAxisAnnotation,
524
536
  textProps: {
525
537
  x: margins.left + startFromX + xAxisTitleMaximumAllowedWidth / 2,
@@ -528,10 +540,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
528
540
  textAnchor: 'middle',
529
541
  'aria-hidden': true
530
542
  },
531
- maxWidth: xAxisTitleMaximumAllowedWidth,
532
- wrapContent: _index.wrapContent,
533
- showBackground: true,
534
- className: classes.svgTooltip
543
+ maxWidth: xAxisTitleMaximumAllowedWidth
535
544
  }), /*#__PURE__*/ _react.createElement("g", {
536
545
  ref: (e)=>{
537
546
  yAxisElement.current = e;
@@ -547,6 +556,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
547
556
  transform: `translate(${_useRtl ? margins.left + startFromX : svgDimensions.width - margins.right - startFromX}, 0)`,
548
557
  className: classes.yAxis
549
558
  }), props.secondaryYAxistitle !== undefined && props.secondaryYAxistitle !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
559
+ ...commonSvgToolTipProps,
550
560
  content: props.secondaryYAxistitle,
551
561
  textProps: {
552
562
  x: (yAxisTitleMaximumAllowedHeight - margins.bottom) / 2 + _removalValueForTextTuncate,
@@ -556,11 +566,9 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
556
566
  ${svgDimensions.height - margins.bottom - margins.top - titleMargin})rotate(-90)`,
557
567
  className: classes.axisTitle
558
568
  },
559
- maxWidth: yAxisTitleMaximumAllowedHeight,
560
- wrapContent: _index.wrapContent,
561
- showBackground: true,
562
- className: classes.svgTooltip
569
+ maxWidth: yAxisTitleMaximumAllowedHeight
563
570
  })), children, props.yAxisTitle !== undefined && props.yAxisTitle !== '' && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
571
+ ...commonSvgToolTipProps,
564
572
  content: props.yAxisTitle,
565
573
  textProps: {
566
574
  x: (yAxisTitleMaximumAllowedHeight - margins.bottom) / 2 + _removalValueForTextTuncate,
@@ -570,11 +578,9 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
570
578
  ${svgDimensions.height - margins.bottom - margins.top - titleMargin})rotate(-90)`,
571
579
  className: classes.axisTitle
572
580
  },
573
- maxWidth: yAxisTitleMaximumAllowedHeight,
574
- wrapContent: _index.wrapContent,
575
- showBackground: true,
576
- className: classes.svgTooltip
581
+ maxWidth: yAxisTitleMaximumAllowedHeight
577
582
  }), props.yAxisAnnotation !== undefined && props.yAxisAnnotation !== '' && (props.secondaryYAxistitle === undefined || props.secondaryYAxistitle === '') && /*#__PURE__*/ _react.createElement(_SVGTooltipText.SVGTooltipText, {
583
+ ...commonSvgToolTipProps,
578
584
  content: props.yAxisAnnotation,
579
585
  textProps: {
580
586
  x: (yAxisTitleMaximumAllowedHeight - margins.bottom) / 2 + _removalValueForTextTuncate,
@@ -585,10 +591,7 @@ const CartesianChart = /*#__PURE__*/ _react.forwardRef((props, forwardedRef)=>{
585
591
  className: classes.axisAnnotation,
586
592
  'aria-hidden': true
587
593
  },
588
- maxWidth: yAxisTitleMaximumAllowedHeight,
589
- wrapContent: _index.wrapContent,
590
- showBackground: true,
591
- className: classes.svgTooltip
594
+ maxWidth: yAxisTitleMaximumAllowedHeight
592
595
  }))), !props.hideLegend && /*#__PURE__*/ _react.createElement("div", {
593
596
  ref: (e)=>legendContainer = e,
594
597
  className: classes.legendContainer